web stats
How to convert String to XML with prefix - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 03-04-2016, 10:54 AM
jmedina2930 jmedina2930 is offline
Mirth Newb
 
Join Date: Feb 2014
Posts: 7
jmedina2930 is on a distinguished road
Default How to convert String to XML with prefix

Hello, I have a problem. I need to parse a HL7 that is in String format, so, I'm using the SerializerFactory class to convert a String format to XML format, thus:
tmp = new XML(SerializerFactory.getSerializer('HL7V3').toXML (decodedCDA));

But, it return the following error:
DETAILS: TypeError: The prefix "hl7" for element "hl7:RCMR_IN000032UV01" is not bound.

I've had the same problem in the conectors, but, I solve this unchecking "Strip Namespaces" in all connectors.

I don't know how to solve this . I hope you help me.
Thanks.
Reply With Quote
  #2  
Old 03-04-2016, 11:38 AM
jackwhaines jackwhaines is offline
 
Join Date: May 2011
Location: Kansas City, Missouri
Posts: 168
jackwhaines is on a distinguished road
Send a message via Skype™ to jackwhaines
Default

Any chance of getting a sample of a message and a copy of the channel?
__________________

-= Jack Haines : Healthcare Integrations, LLC
-= jack.haines@HealthcareIntegrations.com
-= Mirth Connect (Advanced)-certified
-= Gold member of HL7.org
-= Available for Mirth Connect channel development and consultation! Schedule a call with me at https://integrations.as.me
Reply With Quote
  #3  
Old 03-04-2016, 12:26 PM
jmedina2930 jmedina2930 is offline
Mirth Newb
 
Join Date: Feb 2014
Posts: 7
jmedina2930 is on a distinguished road
Default

Hi jackwhaines, thank you for reply.
The mesage the I using is the following:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<hl7:ClinicalDocument xmlns:hl7="urn:hl7-org:v3"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="urn:hl7-org:v3 ../../../../infraestructure/cda/CDA.xsd" 
    classCode="DOCCLIN" moodCode="EVN">
    <!-- Estructura del documento-:POCD_HD000040 -->
    <hl7:typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040"/>
    <!-- Identificacion del documento-->
    <hl7:id extension="c4721ce0-4024-11e3-aa6e-0800200c9a66" />
    <!-- Clase de documento: codificación LOINC para Informe de Antecedentes del Paciente-->
    <hl7:code code="69459-6" displayName="Care record summary panel" codeSystemName="LOINC" 
        codeSystem="2.16.840.1.113883.6.1">
        <!-- Titulo del documento - irá en el encabezado-->
        <hl7:originalText>Antecedentes del paciente</hl7:originalText>
    </hl7:code>
    <!-- Fecha de generación del documento -->
    <hl7:effectiveTime value="20131028180200"/>
    <!-- Código de confidencialidad N=Normal-->
    <hl7:confidentialityCode code="N" codeSystem="2.16.840.1.113883.5.1" ></hl7:confidentialityCode>
    <hl7:recordTarget typeCode="RCT" contextControlCode="OP">
        <!-- Paciente al que corresponde el documento -->
        <hl7:patientRole classCode="PAT">
            <!--Identificación del paciente HC -->
            <hl7:id extension="HC1020413454"/>
            <hl7:patient>
                <!-- Identificación de paciente CC, TI, PAS -->
                <hl7:id extension="1020413454" root="2.16.840.1.113883.19.57.1.1.1.1.1" />
                <!--Apellido y Nombres -->
                <hl7:name>
                    <hl7:given>Juan</hl7:given>
                    <hl7:given>Camilo</hl7:given>
                    <hl7:family>Alzate</hl7:family>
                    <hl7:family>Restrepo</hl7:family>
                </hl7:name>
                <!--Género-->
                <hl7:administrativeGenderCode code="M" codeSystem="2.16.840.1.113883.5.1" 
                    codeSystemName="AdministrativeGender" displayName="MASCULINO" />
                <!--Fecha de nacimiento-->
                <hl7:birthTime value="19270101"/>                
            </hl7:patient>
        </hl7:patientRole>        
    </hl7:recordTarget>
    <!--Autor del documento-->
    <hl7:author typeCode="AUT" contextControlCode="OP">
        <!--Fecha del documento-->
        <hl7:time value="20062805153000"/>
        <hl7:assignedAuthor classCode="ASSIGNED">
            <!--Identificacion del autor (médico responsable) en el registro-->
            <hl7:id extension="Registro007"/>
            <hl7:telecom value="tel:3014498855"></hl7:telecom>
            <!--Apellido y Nombres del autor-->
            <hl7:assignedPerson>
                <hl7:name>
                    <hl7:prefix>Dra.</hl7:prefix>
                    <hl7:given>Diana</hl7:given>
                    <hl7:family>Restrepo</hl7:family>
                </hl7:name>                
            </hl7:assignedPerson>
            <!--Organizacion a la que representa el autor en este acto-->
            <hl7:representedOrganization>
                <!--Organización que enmarca el rol como autor-->
                <hl7:id extension="co.udea.telesalud.hcteleasis"/>
            </hl7:representedOrganization>
        </hl7:assignedAuthor>
    </hl7:author>
    <hl7:custodian typeCode="CST">
        <hl7:assignedCustodian classCode="ASSIGNED">
            <hl7:representedCustodianOrganization classCode="ORG" determinerCode="INSTANCE">
                <!--Organización que enmarca el rol como autor-->
                <hl7:id extension="co.udea.telesalud.hcteleasis"/>
            </hl7:representedCustodianOrganization>
        </hl7:assignedCustodian>
    </hl7:custodian>
    <hl7:componentOf>
        <hl7:encompassingEncounter>
            <hl7:effectiveTime>
                <!-- Fecha inicial y final del episodio-->
                <hl7:low value="20120101"/>
                <hl7:high value="20120101"/>
            </hl7:effectiveTime>
            
        </hl7:encompassingEncounter>
    </hl7:componentOf>
    <hl7:component typeCode="COMP" contextConductionInd="true">
        <hl7:structuredBody>
            
            <!--Alergias-->
            <hl7:component typeCode="COMP" contextConductionInd="true">
                <hl7:section classCode="DOCSECT" moodCode="EVN">
                    <hl7:code code="10155-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" 
                        displayName="History of allergies"/>
                    <hl7:title>Alergias</hl7:title>
                    <hl7:text>
                        <hl7:list>                           
                        </hl7:list>
                    </hl7:text>                    
                </hl7:section>
            </hl7:component>
            
            <!--Medicamentos-->
            <hl7:component typeCode="COMP" contextConductionInd="true">
                <hl7:section classCode="DOCSECT" moodCode="EVN">
                    <hl7:code code="10160-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" 
                        displayName="History of medication use narrative"/>
                    <hl7:title>Medicamentos</hl7:title>
                    <hl7:text>
                        <hl7:list>                           
                        </hl7:list>
                    </hl7:text>                    
                </hl7:section>
            </hl7:component>
            
            <!--Enfermedades-->
            <hl7:component typeCode="COMP" contextConductionInd="true">
                <hl7:section classCode="DOCSECT" moodCode="EVN">
                    <hl7:code code="11348-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" 
                        displayName="History of past illness"/>
                    <hl7:title>Historial de enfermedades</hl7:title>
                    <hl7:text>
                        <hl7:content>Paciente de 25 años de edad con síndrome vaso vagal</hl7:content>
                        <hl7:list>
                                                                             
                        </hl7:list>
                    </hl7:text>                    
                </hl7:section>
            </hl7:component>
          </hl7:structuredBody>
    </hl7:component>
</hl7:ClinicalDocument>
What do you mean with a copy of channel? dou you need that I import thi?
Reply With Quote
  #4  
Old 03-04-2016, 01:04 PM
jackwhaines jackwhaines is offline
 
Join Date: May 2011
Location: Kansas City, Missouri
Posts: 168
jackwhaines is on a distinguished road
Send a message via Skype™ to jackwhaines
Default

Yes, please. An "Export" of the channel would be great!
__________________

-= Jack Haines : Healthcare Integrations, LLC
-= jack.haines@HealthcareIntegrations.com
-= Mirth Connect (Advanced)-certified
-= Gold member of HL7.org
-= Available for Mirth Connect channel development and consultation! Schedule a call with me at https://integrations.as.me
Reply With Quote
  #5  
Old 03-07-2016, 10:45 AM
jmedina2930 jmedina2930 is offline
Mirth Newb
 
Join Date: Feb 2014
Posts: 7
jmedina2930 is on a distinguished road
Default

Hi friend,
Excuse me forthe delay, I attach the channel.
Thank you.
Attached Files
File Type: xml GEN_002_Request_Receive.xml (81.2 KB, 42 views)
Reply With Quote
  #6  
Old 03-07-2016, 11:20 AM
jackwhaines jackwhaines is offline
 
Join Date: May 2011
Location: Kansas City, Missouri
Posts: 168
jackwhaines is on a distinguished road
Send a message via Skype™ to jackwhaines
Default

jmedina2930,

When I processed the message sample that you have in your transformer through the channel, it works for me. (I did have to set the source and destination to channel reader and channel writer) and also removed the external javascript that you had in the transformer.
__________________

-= Jack Haines : Healthcare Integrations, LLC
-= jack.haines@HealthcareIntegrations.com
-= Mirth Connect (Advanced)-certified
-= Gold member of HL7.org
-= Available for Mirth Connect channel development and consultation! Schedule a call with me at https://integrations.as.me
Reply With Quote
  #7  
Old 03-07-2016, 12:15 PM
jmedina2930 jmedina2930 is offline
Mirth Newb
 
Join Date: Feb 2014
Posts: 7
jmedina2930 is on a distinguished road
Default

In the transformer of destination there are 2 steps, in the first step I try to get a CDA of controlActProcess/text tag coded in BASE64. with a javascript function I decode the CDA, but I need convert this to XML for I can process it.
Reply With Quote
  #8  
Old 03-07-2016, 12:24 PM
jmedina2930 jmedina2930 is offline
Mirth Newb
 
Join Date: Feb 2014
Posts: 7
jmedina2930 is on a distinguished road
Default

My question is if there are some way to do this function:
tmp = new XML(SerializerFactory.getSerializer('HL7V3').toXML (decodedCDA));
But, specifying that it doesn't strip namespaces.
Thanks.
Reply With Quote
  #9  
Old 03-07-2016, 12:40 PM
jackwhaines jackwhaines is offline
 
Join Date: May 2011
Location: Kansas City, Missouri
Posts: 168
jackwhaines is on a distinguished road
Send a message via Skype™ to jackwhaines
Default

I know the answer is to use:

Code:
var serializationProperties = SerializerFactory.getDefaultSerializationProperties('HL7V3');
SerializerFactory.getSerializer('HL7V3', serializationProperties, null).toXML(message);
but I don't know how to explicitly set to not strip the namespaces. There is a way to change the map manually, I've just never had to do that...
__________________

-= Jack Haines : Healthcare Integrations, LLC
-= jack.haines@HealthcareIntegrations.com
-= Mirth Connect (Advanced)-certified
-= Gold member of HL7.org
-= Available for Mirth Connect channel development and consultation! Schedule a call with me at https://integrations.as.me
Reply With Quote
  #10  
Old 03-08-2016, 09:40 AM
jmedina2930 jmedina2930 is offline
Mirth Newb
 
Join Date: Feb 2014
Posts: 7
jmedina2930 is on a distinguished road
Default

Thak you for your help.
I could solve the problem with the following lines:
Code:
var serializationProperties = SerializerFactory.getDefaultSerializationProperties('HL7V3');
serializationProperties.put("stripNamespaces",false);
tmp = new XML(SerializerFactory.getSerializer('HL7V3', serializationProperties, null).toXML(decodedCDA));
Reply With Quote
Reply

Tags
hl7v3, serializer, xml

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 05:07 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation