Announcement

Collapse
No announcement yet.

How to convert String to XML with prefix

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

  • #2
    Any chance of getting a sample of a message and a copy of the channel?

    -= Jack Haines : Founder/CEO of Healthcare Integrations, LLC
    -= [email protected]
    -= Mirth Connect (Advanced)-certified
    -= Gold member of HL7.org
    -= Available for Mirth Connect channel development and consultation! Schedule a FREE call with me at https://calendly.com/jackhaines

    Comment


    • #3
      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?

      Comment


      • #4
        Yes, please. An "Export" of the channel would be great!

        -= Jack Haines : Founder/CEO of Healthcare Integrations, LLC
        -= [email protected]
        -= Mirth Connect (Advanced)-certified
        -= Gold member of HL7.org
        -= Available for Mirth Connect channel development and consultation! Schedule a FREE call with me at https://calendly.com/jackhaines

        Comment


        • #5
          Hi friend,
          Excuse me forthe delay, I attach the channel.
          Thank you.
          Attached Files

          Comment


          • #6
            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 : Founder/CEO of Healthcare Integrations, LLC
            -= [email protected]
            -= Mirth Connect (Advanced)-certified
            -= Gold member of HL7.org
            -= Available for Mirth Connect channel development and consultation! Schedule a FREE call with me at https://calendly.com/jackhaines

            Comment


            • #7
              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.

              Comment


              • #8
                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.

                Comment


                • #9
                  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 : Founder/CEO of Healthcare Integrations, LLC
                  -= [email protected]
                  -= Mirth Connect (Advanced)-certified
                  -= Gold member of HL7.org
                  -= Available for Mirth Connect channel development and consultation! Schedule a FREE call with me at https://calendly.com/jackhaines

                  Comment


                  • #10
                    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));

                    Comment


                    • #11
                      That looks perfect! You put the code in place and it worked??

                      -= Jack Haines : Founder/CEO of Healthcare Integrations, LLC
                      -= [email protected]
                      -= Mirth Connect (Advanced)-certified
                      -= Gold member of HL7.org
                      -= Available for Mirth Connect channel development and consultation! Schedule a FREE call with me at https://calendly.com/jackhaines

                      Comment


                      • #12
                        Yes, it did.

                        Comment

                        Working...
                        X