MessageHeader Resource: V2 ADT to FHIR

134 views
Skip to first unread message

Paulo Rades

unread,
Nov 25, 2017, 9:37:24 PM11/25/17
to HAPI FHIR
Hello.

I have a channel in Mirth Connect that receives V2 ADT, transforms into FHIR JSON and persists in HAPI FHIR.


The transformed resource is this:


{
  "resourceType": "MessageHeader",
  "source": {
    "name": "NES"
  },
  "destination": [
    {
      "name": "openEMR"
    }
  ],
  "date": [
    {
      "resourceType": "Patient",
      "gender": "M",
      "birthDate": "1985-01-01",
      "identifier": [
        {
          "use": "usual",
          "type": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/v2/0203",
                "code": "MR"
              }
            ]
          },
          "value": "123456789"
        }
      ],
      "name": [
        {
          "family": [
            "HOUSE"
          ],
          "given": [
            "GREGORY"
          ],
          "text": "GREGORY HOUSE"
        }
      ]
    }
  ]
}



When I receive the message through Mirth, the error occurs:

ER7Serializer error

ERROR MESSAGE: Error converting XML to ER7
org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException (Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError (Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError (Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError (Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError (Unknown Source)
at org.apache.xerces.impl.XMLScanner.reportFatalError (Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl $ PrologDispatcher.dispatch (Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument (Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse (Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse (Unknown Source)
at com.mirth.connect.plugins.datatypes.hl7v2.ER7Serializer.fromXML (ER7Serializer.java:277)
at com.mirth.connect.donkey.server.channel.FilterTransformerExecutor.processConnectorMessage (FilterTransformerExecutor.java:123)
at com.mirth.connect.donkey.server.channel.Channel.process (Channel.java:1543)
at com.mirth.connect.donkey.server.channel.Channel.dispatchRawMessage (Channel.java:1191)
at com.mirth.connect.donkey.server.channel.SourceConnector.dispatchRawMessage (SourceConnector.java:192)
at com.mirth.connect.server.controllers.DonkeyEngineController.dispatchRawMessage (DonkeyEngineController.java:1067)
at com.mirth.connect.server.api.servlets.MessageServlet $ 2.run (MessageServlet.java:107)
at java.lang.Thread.run (Unknown Source)




But when I use the POST through postman the resource is created: 201 (with some errors because the resource is not complete, it is a test at the moment)


{
    "resourceType": "OperationOutcome",
    "text": {
        "status": "generated",
        "div": "<div xmlns = \" http: //www.w3.org/1999/xhtml \ "> <h1> Operation Outcome <table border = \" 0 \ "> <tr> </ Successfully created resource & quot; MessageHeader / 420097 / _history / 1 & quot; in 1ms <td style = \ "font-weight: bold; \"> INFORMATION </ td> \ n \ t \ t \ t \ t \ t \ t \ t \ t \ \ n \ t \ t \ t \ t <td style = \ "font-weight: bold; \"> ERROR </ td> \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t \ <td> </ td> <td> <td> <td> <td> <td> t </ t> \ n \ t \ t \ t <tt> t <td style = \ "font-weight: bold; \"> ERROR </ td> \ n \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t \ n \ t \ t \ t \ t \ t \ t <td> <pre> Profile http://hl7.org/fhir/StructureDefinition/MessageHeader, Element 'MessageHeader.event': minimum required = 1, but only found </ Td> </ td> </ td> </ td> </ td> <td> <td> </ td> </ td> <td> <td class = \ "font-weight: </ td> \ n \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t \ \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t <td> <pre> Profile http://hl7.org/fhir/StructureDefinition/MessageHeader, Element 'MessageHeader.timestamp': minimum required = 1, but only found 0 </ pre \ n \ t \ t \ t \ t \ t \ t \ t \ t \ t \ \ n \ t \ t \ t \ t <td style = \ "font-weight: bold; \"> ERROR </ td> \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t \ <td> <pre> Profile http://hl7.org/fhir/StructureDefinition/MessageHeader, Element 'MessageHeader.destination.endpoint': minimum required = 1, but only found 0 </ pre> </ td> \ n \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t \ n <td style = \ "font-weight: bold; \"> ERROR \ n \ t \ t \ t \ t \ t <td> [MessageHeader.source] </ td> \ n \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t \ t \ : //hl7.org/fhir/StructureDefinition/MessageHeader, Element 'MessageHeader.source.endpoint': minimum required = 1, but only found 0 </ pre> </ td> \ n \ t \ t \ t \ t \ \ n \ t \ t \ t \ t \ t \ t \ t \
    },
    "issue": [
        {
            "severity": "information"
            "code": "informational",
            "diagnostics": "Successfully created resource \"MessageHeader/420097/_history/1\" in 1ms"







What I need is to persist the patient on the FHIR server ....

If a FHIR server does not support the MessageHeader feature, can I insert only the patient?




Tks,

Paulo

Kevin Mayfield

unread,
Nov 26, 2017, 3:35:15 AM11/26/17
to Paulo Rades, HAPI FHIR
Your resource looks invalid. Patient looks as though it’s in the date part of message header.

I would have expected to see both resources within a bundle resource

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To post to this group, send email to hapi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/ba12ef25-b381-427d-9fa6-bcd56de5604f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Paulo Rades

unread,
Nov 27, 2017, 12:50:21 PM11/27/17
to Kevin Mayfield, HAPI FHIR
Hi Kevin. Thanks for the feedback.


I generated the Patient resource in conformance to spec and everything worked fine.


Cheers


Paulo R. Rades, HL7, cpTICS, McSa
skype: paulorades
11-9-8837-4372



To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages