Unable to unmarshall CONNECT entity PD response

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Unable to unmarshall CONNECT entity PD response

Nick King
CONNECT version 4.4.1

We're seeing an issue with the response CONNECT sends back to our gateway during an outbound PD request. The sequence of events is as follows:

1. Local gateway sends entity PD request to CONNECT
2. CONNECT sends PD request to external gateway
3. External gateway sends PD response to CONNECT
4. CONNECT sends entity PD response to local gateway
5. Local gateway cannot unmarshall CONNECT's entity PD response

The issue appears to be with the minimumDegreeMatch in the entity PD response from CONNECT to the local gateway. When attempting to unmarshall the entity PD response we see the following error on our local gateway implementation:

Error message was: Unable to create an instance of org.hl7.v3.ANY
javax.xml.bind.UnmarshalException: Unable to create an instance of org.hl7.v3.ANY
 - with linked exception:
[java.lang.InstantiationException]
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:662)

Although the PD response from the external gateway appears to contain the type of the minimumDegreeMatch value (INT), the minimumDegreeMatch element in the entity PD response from CONNECT to the local gateway doesn't specify the value type. Is this an issue with the entity PD response from CONNECT? Below are the relevant queries:

External gateway PD response to CONNECT:

<controlActProcess moodCode="EVN" classCode="CACT">
        <code code="PRPA_TE201305UV02" codeSystem="2.16.840.1.113883.1.6"/>
        <authorOrPerformer typeCode="AUT">
                <assignedDevice classCode="ASSIGNED">
                        <id root="234.5.65.32.3.563452"/>
                        <assignedDevice determinerCode="INSTANCE" classCode="DEV">
                                <asLocatedEntity classCode="STOR">
                                        <location determinerCode="INSTANCE" classCode="COUNTRY"/>
                                </asLocatedEntity>
                        </assignedDevice>
                        <representedOrganization determinerCode="INSTANCE">
                                <id root="234.5.65.32.3.563452"/>
                        </representedOrganization>
                </assignedDevice>
        </authorOrPerformer>
        <queryByParameter>
                <queryId root="fdd7f993-e344-46cb-8611-823e3cad6b20" extension="1"/>
                <statusCode code="new"/>
                <responseModalityCode code="R"/>
                <responsePriorityCode code="I"/>
                <matchCriterionList>
                        <matchAlgorithm xsi:nil="true"/>
                        <matchWeight xsi:nil="true"/>
                        <minimumDegreeMatch>
                                <value xsi:type="INT" value="75"/>
                                <semanticsText>MinimumDegreeMatch</semanticsText>
                        </minimumDegreeMatch>
                </matchCriterionList>
                <parameterList>
                        <livingSubjectAdministrativeGender>
                                <value code="M"/>
                                <semanticsText>LivingSubject.administrativeGender</semanticsText>
                        </livingSubjectAdministrativeGender>
                        <livingSubjectBirthTime>
                                <value value="196540203"/>
                                <semanticsText>LivingSubject.birthTime</semanticsText>
                        </livingSubjectBirthTime>
                        <livingSubjectId>
                                <value root="23.5.423.2145.4232.13" extension="123245645"/>
                                <semanticsText>LivingSubject.Id</semanticsText>
                        </livingSubjectId>
                        <livingSubjectName>
                                <value>
                                        <family>TESTLAST</family>
                                        <given>TESTFIRST</given>
                                        <given>TESTMIDDLE</given>
                                </value>
                                <semanticsText>LivingSubject.name</semanticsText>
                        </livingSubjectName>
                        <patientAddress>
                                <value>
                                        <streetAddressLine>123 TEST STREET</streetAddressLine>
                                        <city>TESTCITY</city>
                                        <state>TEST</state>
                                        <postalCode>12345</postalCode>
                                </value>
                                <semanticsText>Patient.addr</semanticsText>
                        </patientAddress>
                </parameterList>
        </queryByParameter>
</controlActProcess>

CONNECT entity PD response to local gateway:

<controlActProcess classCode="CACT" moodCode="EVN">
        <code code="PRPA_TE201305UV02" codeSystem="2.16.840.1.113883.1.6"/>
        <code code="PRPA_TE201305UV02" codeSystem="2.16.840.1.113883.1.6"/>
        <authorOrPerformer typeCode="AUT">
                <assignedDevice classCode="ASSIGNED">
                        <id root="234.5.65.32.3.563452"/>
                        <assignedDevice determinerCode="INSTANCE" classCode="DEV">
                                <asLocatedEntity classCode="STOR">
                                        <location determinerCode="INSTANCE" classCode="COUNTRY"/>
                                </asLocatedEntity>
                        </assignedDevice>
                        <representedOrganization determinerCode="INSTANCE">
                                <id root="234.5.65.32.3.563452"/>
                        </representedOrganization>
                </assignedDevice>
        </authorOrPerformer>
        <queryByParameter>
                <queryId extension="1" root="fdd7f993-e344-46cb-8611-823e3cad6b20"/>
                <statusCode code="new"/>
                <responseModalityCode code="R"/>
                <responsePriorityCode code="I"/>
                <matchCriterionList>
                        <matchAlgorithm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
                        <matchWeight xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
                        <minimumDegreeMatch>
                                <value value="75"/>
                                <semanticsText>MinimumDegreeMatch</semanticsText>
                        </minimumDegreeMatch>
                </matchCriterionList>
                <parameterList>
                        <livingSubjectAdministrativeGender>
                                <value code="M"/>
                                <semanticsText>LivingSubject.administrativeGender</semanticsText>
                        </livingSubjectAdministrativeGender>
                        <livingSubjectBirthTime>
                                <value value="196540203"/>
                                <semanticsText>LivingSubject.birthTime</semanticsText>
                        </livingSubjectBirthTime>
                        <livingSubjectId>
                                <value root="23.5.423.2145.4232.13" extension="123245645"/>
                                <semanticsText>LivingSubject.Id</semanticsText>
                        </livingSubjectId>
                        <livingSubjectName>
                                <value>
                                        <family>TESTLAST</family>
                                        <given>TESTFIRST</given>
                                        <given>TESTMIDDLE</given>
                                </value>
                                <semanticsText>LivingSubject.name</semanticsText>
                        </livingSubjectName>
                        <patientAddress>
                                <value>
                                        <streetAddressLine>123 TEST STREET</streetAddressLine>
                                        <city>TESTCITY</city>
                                        <state>TEST</state>
                                        <postalCode>12345</postalCode>
                                </value>
                                <semanticsText>Patient.addr</semanticsText>
                        </patientAddress>
                </parameterList>
        </queryByParameter>
</controlActProcess>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to unmarshall CONNECT entity PD response

Sovann Huynh
Administrator
Just want to clarify:

- By local gateway and external gateway, do you mean local adapter and remote adapter?

When you say "External gateway PD response to CONNECT:", what is responding to CONNECT? Isn't CONNECT the external gateway?

Can you give us the crossgateway NwHIN response message?
Sovann
CONNECT Product Team Member
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to unmarshall CONNECT entity PD response

Minh
Administrator
In reply to this post by Nick King
If possible, can you provide us your error log or stacktrace? Thank
Minh-Hai Nguyen
CONNECT Product Team Member
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to unmarshall CONNECT entity PD response

Nick King
In reply to this post by Sovann Huynh
Hi Sovann,

CONNECT isn't the external gateway. In our solution, CONNECT acts as an adapter for requests that the application wants to make to other health organisations. By local gateway I mean the application making the outbound request. I mentioned this in the sequence of events causing our issue:

1. Local gateway sends entity PD request to CONNECT
2. CONNECT sends PD request to external gateway
3. External gateway sends PD response to CONNECT
4. CONNECT sends entity PD response to local gateway
5. Local gateway cannot unmarshall CONNECT's entity PD response

The external gateway is some other health organisation that can communicate with CONNECT over the eHealth exchange.

The first xml snippet in my original post is the cross gateway response message
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to unmarshall CONNECT entity PD response

Nick King
Stack trace when attempting to unmarshall entity PD response:

Error message was: Unable to create an instance of org.hl7.v3.ANY
javax.xml.bind.UnmarshalException: Unable to create an instance of org.hl7.v3.ANY
 - with linked exception:
[java.lang.InstantiationException]
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:662)
        at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:258)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.createInstance(UnmarshallingContext.java:629)
        at com.sun.xml.bind.v2.runtime.unmarshaller.StructureLoader.startElement(StructureLoader.java:186)
        at com.sun.xml.bind.v2.runtime.unmarshaller.XsiTypeLoader.startElement(XsiTypeLoader.java:80)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:501)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:480)
        at com.sun.xml.bind.v2.runtime.unmarshaller.InterningXmlVisitor.startElement(InterningXmlVisitor.java:75)
        at com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:150)
        at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:244)
        at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:281)
        at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:250)
        at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:281)
        at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:250)
        at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:281)
        at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:250)
        at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:281)
        at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:250)
        at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:281)
        at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:250)
        at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:281)
        at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:250)
        at com.sun.xml.bind.unmarshaller.DOMScanner.scan(DOMScanner.java:127)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:324)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:303)

Caused by: java.lang.InstantiationException
        at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:48)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at com.sun.xml.bind.v2.ClassFactory.create0(ClassFactory.java:133)
        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.createInstance(ClassBeanInfoImpl.java:286)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.createInstance(UnmarshallingContext.java:623)
        ... 53 more
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to unmarshall CONNECT entity PD response

christophermay07
Hey Nick,

I've seen this exact issue before -- in answer to your original question: yes, it appears to be an issue with the entity PD response from CONNECT, although it was fixed in CONNECT 4.4.1 in support of the following ticket:  https://connectopensource.atlassian.net/browse/CONN-1544

Is there any way to confirm what version of CONNECT this particular organization is using?  Now might be a great time to plug CONNECT 4.6.0 to any external organization, which contains the cumulative bug fixes from every release, is feature-rich, and has seen amazing results in performance testing.

Regards,

Chris May
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to unmarshall CONNECT entity PD response

Sovann Huynh
Administrator
Nick,

PRPA_TE201305UV02 is the request message. Can you give us the message associated with the following:

<Action soap:mustUnderstand="true" xmlns="http://www.w3.org/2005/08/addressing">urn:hl7-org:v3:PRPA_IN201306UV02:CrossGatewayPatientDiscovery</Action>
Sovann
CONNECT Product Team Member
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to unmarshall CONNECT entity PD response

Nick King
In reply to this post by christophermay07
The CONNECT version of the initiator is 4.4.1. The responder gateway is an external organisation I don't know the details of. So the CONNECT version doesn't appear to affect the issue.

I'm not sure if https://connectopensource.atlassian.net/browse/CONN-1544 directly relates to our issue. The issue I see is the removal of the type attribute from the gateway response to the entity PD response:

Gateway response snippet:

<minimumDegreeMatch>
    <value xsi:type="INT" value="75"/>
    <semanticsText>MinimumDegreeMatch</semanticsText>
</minimumDegreeMatch>

Entity PD response snippet:

<minimumDegreeMatch>
    <value value="75"/>
    <semanticsText>MinimumDegreeMatch</semanticsText>
</minimumDegreeMatch>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to unmarshall CONNECT entity PD response

Nick King
In reply to this post by Sovann Huynh
Sovann,

The gateway response is in the original post. I removed the wrapper content. Here it is again:

<controlActProcess moodCode="EVN" classCode="CACT">
        <code code="PRPA_TE201305UV02" codeSystem="2.16.840.1.113883.1.6"/>
        <authorOrPerformer typeCode="AUT">
                <assignedDevice classCode="ASSIGNED">
                        <id root="234.5.65.32.3.563452"/>
                        <assignedDevice determinerCode="INSTANCE" classCode="DEV">
                                <asLocatedEntity classCode="STOR">
                                        <location determinerCode="INSTANCE" classCode="COUNTRY"/>
                                </asLocatedEntity>
                        </assignedDevice>
                        <representedOrganization determinerCode="INSTANCE">
                                <id root="234.5.65.32.3.563452"/>
                        </representedOrganization>
                </assignedDevice>
        </authorOrPerformer>
        <queryByParameter>
                <queryId root="fdd7f993-e344-46cb-8611-823e3cad6b20" extension="1"/>
                <statusCode code="new"/>
                <responseModalityCode code="R"/>
                <responsePriorityCode code="I"/>
                <matchCriterionList>
                        <matchAlgorithm xsi:nil="true"/>
                        <matchWeight xsi:nil="true"/>
                        <minimumDegreeMatch>
                                <value xsi:type="INT" value="75"/>
                                <semanticsText>MinimumDegreeMatch</semanticsText>
                        </minimumDegreeMatch>
                </matchCriterionList>
                <parameterList>
                        <livingSubjectAdministrativeGender>
                                <value code="M"/>
                                <semanticsText>LivingSubject.administrativeGender</semanticsText>
                        </livingSubjectAdministrativeGender>
                        <livingSubjectBirthTime>
                                <value value="196540203"/>
                                <semanticsText>LivingSubject.birthTime</semanticsText>
                        </livingSubjectBirthTime>
                        <livingSubjectId>
                                <value root="23.5.423.2145.4232.13" extension="123245645"/>
                                <semanticsText>LivingSubject.Id</semanticsText>
                        </livingSubjectId>
                        <livingSubjectName>
                                <value>
                                        <family>TESTLAST</family>
                                        <given>TESTFIRST</given>
                                        <given>TESTMIDDLE</given>
                                </value>
                                <semanticsText>LivingSubject.name</semanticsText>
                        </livingSubjectName>
                        <patientAddress>
                                <value>
                                        <streetAddressLine>123 TEST STREET</streetAddressLine>
                                        <city>TESTCITY</city>
                                        <state>TEST</state>
                                        <postalCode>12345</postalCode>
                                </value>
                                <semanticsText>Patient.addr</semanticsText>
                        </patientAddress>
                </parameterList>
        </queryByParameter>
</controlActProcess>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to unmarshall CONNECT entity PD response

drodrigues
Administrator
Nick,

The response that you have here doesn't seem to be a valid NwHIN PD response. The PD response requires the information below the controlActProcess element with code value of PRPA_TE201306UV02

<controlActProcess classCode="CACT" moodCode="EVN">
<code code="PRPA_TE201306UV02" codeSystem="2.16.840.1.113883.1.6"/>
<subject typeCode="SUBJ">
<registrationEvent classCode="REG" moodCode="EVN">
----------------------

whereas in the case of a PD request it requires the following information with code value of PRPA_TE201305UV02

<controlActProcess classCode="CACT" moodCode="EVN">
<code code="PRPA_TE201305UV02" codeSystem="2.16.840.1.113883.1.6"/>
<authorOrPerformer typeCode="AUTH">
---------------
Note in the snippet that you provided for the PD response from the External Gateway to CONNECT (which seems to be your initiating gateway or broker),  you mention the response as having a code of PRPA_TE201305UV02" indicating that it is a request. It seems that the external gateway is not sending you the appropriate response in this case. Does that make sense or am I missing something?

I just want to make sure we are understanding the scenario correctly to replicate the error you are seeing.

Thanks,
Deepthi
CONNECT Team
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to unmarshall CONNECT entity PD response

Minh
Administrator
In reply to this post by Nick King
We could not reproduce the issues when testing gateway(4.4.1) to gateway(4.4.1).  We run both scenarios with and without xsi:type =“INT” inside <minimumDegreeMatch><value xsi:type="INT" value="75"/><semanticsText>MinimumDegreeMatch</semanticsText></minimumDegreeMatch>, the Connect gateway still parse correctly.  

Connect use internal apache cxf JAXB framework to transform xml. Cxf JAXB will remove prefix if it detects correct default namespace scope in the xml since it is redundancy.  If possible, can you provide the full request along with full response to see if they already have correct default namespace scope in xml.  To capture XML before it goes out the wire, you can set the following option as below
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.xml.ws.transport.http.HttpAdapter.dump=true"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true"

By the way, I assume your local gateway is 4.4.1
Here is the example of our response namespace:
<RespondingGateway_PRPA_IN201306UV02Response xmlns="urn:hl7-org:v3" xmlns:ns2="urn:hl7-org:sdtc" xmlns:ns3="urn:gov:hhs:fha:nhinc:common:nhinccommon" xmlns:ns4="http://www.w3.org/2005/08/addressing" xmlns:ns5="urn:gov:hhs:fha:nhinc:common:patientcorrelationfacade">


For namespace reference, please refer to this https://www.w3.org/TR/xml-names/#scoping
Thanks,
Minh
CONNECT TEAM

Minh-Hai Nguyen
CONNECT Product Team Member
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to unmarshall CONNECT entity PD response

Nick King
Appologies, the flow of queries I mentioned was incorrect. I've created a new post with the correct details.

http://forums.connectopensource.org/Unable-to-unmarshall-CONNECT-adapter-PD-request-td7580176.html
Loading...