xml Novice

  • Creator
    Topic
  • #53511
    David Speare
    Participant

      Hello All –

      I am trying to do our first XML process (eventually building up to a CCD).  I have brought in the xsd into the package manager and compiled it with no issues.

      For testing i am trying to use the attached xsd and xml file.  I am only attempting at this point to understand how to get an xml into an hl7 message.  

      I have an xlate created to go from my xml schema to an ADT_A08 message.  I have 2 lines in my xlate.  One is a hard value of TEST in the msh:3 and the other is copy author from the xml file into the PID:5.

      When i run the test, i am getting the following error:

      MESSAGE 1

      Fatal Error generated during parsing. – Invalid document structure – Line 1, Col 22

      XML Error Source – Message Body for  mid [0.0.0]

      1:’

    Viewing 5 reply threads
    • Author
      Replies
      • #77942
        Robert Kersemakers
        Participant

          Hi David,

          What you first need to do is test your XML against the XSD that you have brought into the package manager. You can do this with the XML testing tool.

          I think the first line

          Quote:

          is the perpetrator… It isn’t defined in the XSD.

          Try putting this exact line as first line in the XSD as well, then recompile the XSD.

          Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

        • #77943
          David Speare
          Participant

            Thanks.  So i added that line to the xsd as suggested.

            When I try to compile with either the the property: namespace urn:book or use target namespace it throws an error.  I can compile it with the none option.

            when i try and test it.  I get the following:

            E:healthvisioncis5.8integratorbinhcixmltest.exe: unable to determine XML root element in E:/healthvision/cis5.8/integrator/s1_test/data/books.xml.  Possible short read — read 21 characters.

            Thoughts?

          • #77944
            Robert Kersemakers
            Participant

              Make sure you have ‘EOF Terminated’ instead of ‘New Line Terminated’ so the complete message/file is read by the testing tool. Should do the trick.

              Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

            • #77945
              David Speare
              Participant

                Thanks so much.  We are on our way.

                So as a final follow up before I order you beverage of choice  ðŸ˜€ .  

                I’m now running the xml file through an xlate.  I’m using the EOF terminator option.  Regardless of whether I indicate to process 1 or all the records, only the first record is coming back.

                What’s the trick here to for 2 HL7 messages to be created rather than just the first one.

              • #77946
                Robert Kersemakers
                Participant

                  I’ll have a plain water, thanks. I’m cheap… 😉

                  As you only see the first ‘record’, you will need an ITERATE in your Xlate to iterate through the various records in your XML to be able to send out more than one outbound (HL7) message. At the end of each iteration, you will need to put in a CONTINUE to send out the just formed outbound message. You may need a SUPPRESS at the start of the Xlate to avoid having the last record/message sent twice.

                  Be aware though that if you fill out outbound fields in the first message, you will need to fill them (or clear them) in the second/third/etc. message as well. Especially with repeating segments/fields, you could end up with information from the first record in your second record.

                  Another way to approach this is write a tcl-proc to first split up the XML into several XMLs/messages, where every XML/message contains only one outbound (HL7) message. Then your Xlate won’t need an ITERATE.

                  Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

                • #77947
                  David Speare
                  Participant

                    Thanks Robert.  This was very helpful.

                    Have you done any CCD work?  In theory should a CCD message work the same way?  Should I get an xsd from the vendor and import it into the CDA folder when i add it to the engine?

                Viewing 5 reply threads
                • The forum ‘Cloverleaf’ is closed to new topics and replies.