Why can't document query find the patient in the correlation row?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Why can't document query find the patient in the correlation row?

Daniel Kaplan
I have a g1 docquery test that passes on my local gateway (HCID: 421.421).  I'm trying to do something similar, by getting doc query to work between two gateways.  I'm doing this by clearing the local correlation table, doing a patient discovery to the remote gateway (HCID: 422.422) to insert a correlation table and then doing a document query.  But, the document query returns with an error message (no exception though):

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Header/><soap:Body><ns3:AdhocQueryResponse xmlns="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" xmlns:ns10="urn:gov:hhs:fha:nhinc:common:subscriptionb2overrideforcdc" xmlns:ns11="http://docs.oasis-open.org/wsrf/bf-2" xmlns:ns12="http://docs.oasis-open.org/wsn/t-1" xmlns:ns13="urn:oasis:names:tc:emergency:EDXL:DE:1.0" xmlns:ns14="urn:ihe:iti:xds-b:2007" xmlns:ns15="urn:gov:hhs:fha:nhinc:common:subscriptionb2overridefordocuments" xmlns:ns16="http://nhinc.services.com/schema/auditmessage" xmlns:ns2="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0" xmlns:ns3="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0" xmlns:ns4="urn:gov:hhs:fha:nhinc:common:nhinccommon" xmlns:ns5="urn:gov:hhs:fha:nhinc:common:nhinccommonentity" xmlns:ns6="urn:oasis:names:tc:ebxml-regrep:xsd:lcm:3.0" xmlns:ns7="http://www.w3.org/2005/08/addressing" xmlns:ns8="http://docs.oasis-open.org/wsn/b-2" xmlns:ns9="http://www.hhs.gov/healthit/nhin/cdc" status="urn:oasis:names:tc:ebxml-regrep:ResponseStatusType:Failure"><ns2:RegistryErrorList highestSeverity="urn:oasis:names:tc:ebxml-regrep:ErrorSeverityType:Error"><ns2:RegistryError codeContext="No patient correlations found." errorCode="XDSUnknownPatientId" severity="urn:oasis:names:tc:ebxml-regrep:ErrorSeverityType:Error"/></ns2:RegistryErrorList><RegistryObjectList/></ns3:AdhocQueryResponse></soap:Body></soap:Envelope>

Or, to summarize: No patient correlations found.

Here is the way the correlation table looks after the soapui test and after my attempt, respectively:

<raw>mysql> select * from correlatedidentifiers;
+---------------+-----------------------------+-----------+-------------------------------+---------------------+---------------------------+
| correlationId | PatientAssigningAuthorityId | PatientId | CorrelatedPatientAssignAuthId | CorrelatedPatientId | CorrelationExpirationDate |
+---------------+-----------------------------+-----------+-------------------------------+---------------------+---------------------------+
|             1 | 1.1                         | D123401   | 2.2                           | D123401             | NULL                      |
+---------------+-----------------------------+-----------+-------------------------------+---------------------+---------------------------+
1 row in set (0.00 sec)

mysql> select * from correlatedidentifiers;
+---------------+-----------------------------+-----------+-------------------------------+---------------------+---------------------------+
| correlationId | PatientAssigningAuthorityId | PatientId | CorrelatedPatientAssignAuthId | CorrelatedPatientId | CorrelationExpirationDate |
+---------------+-----------------------------+-----------+-------------------------------+---------------------+---------------------------+
|            21 | 422.422                     | 1038      | 421.421                       | 1038                | 2014-12-16 22:10:26       |
+---------------+-----------------------------+-----------+-------------------------------+---------------------+---------------------------+
1 row in set (0.00 sec)
mysql>

Here's the message I'm sending to the local gateway:

<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:urn="urn:gov:hhs:fha:nhinc:common:nhinccommonentity" xmlns:urn1="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0" xmlns:urn2="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" xmlns:nhinc="urn:gov:hhs:fha:nhinc:common:nhinccommon" xmlns:add="http://schemas.xmlsoap.org/ws/2004/08/addressing">
        <soapenv:Header />
        <soapenv:Body>
                <urn:RespondingGateway_CrossGatewayQueryRequest>
                        <urn1:AdhocQueryRequest federated="false" startIndex="0" maxResults="-1">
                                <urn1:ResponseOption returnType="LeafClass" returnComposedObjects="true" />

                <!-- This line is what the ONC interop tests need to pass, but this line is invalid.  Only uncomment this if we're doing ONC interop tests. -->
                <!--<urn2:AdhocQuery home="urn:oid:421.421" id="urn:uuid:14d4debf-8f97-4251-9a74-a90016b0af0d">-->
                <!-- http://ihewiki.wustl.edu/wiki/index.php/Notes_on_XDS_Profile -->
                <urn2:AdhocQuery home="urn:oid:422.422" id="urn:uuid:14d4debf-8f97-4251-9a74-a90016b0af0d">
                                        <urn2:Slot name="$XDSDocumentEntryStatus">
                                                <urn2:ValueList>
                                                        <urn2:Value>('urn:oasis:names:tc:ebxml-regrep:StatusType:Approved','urn:ihe:iti:2010:StatusType:DeferredCreation')</urn2:Value>
                                                </urn2:ValueList>
                                        </urn2:Slot>
                                        <urn2:Slot name="$XDSDocumentEntryPatientId">
                                                <urn2:ValueList>
                                                        <urn2:Value>'1038^^^&amp;422.422&amp;ISO'</urn2:Value>
                                                </urn2:ValueList>
                                        </urn2:Slot>

                                                                                <urn2:Slot name="$XDSDocumentEntryClassCode">
                                                <urn2:ValueList>
                                                        <urn2:Value>('34133-9^^2.16.840.1.113883.6.1')</urn2:Value>
                                                </urn2:ValueList>
                                        </urn2:Slot>








                                </urn2:AdhocQuery>
                        </urn1:AdhocQueryRequest>
                        <urn:assertion>
    <nhinc:address>
        <nhinc:addressType>
            <nhinc:code>W</nhinc:code>
        </nhinc:addressType>

        <nhinc:country>US</nhinc:country>



    </nhinc:address>
    <nhinc:dateOfBirth>1960-02-10 00:00:00.0 PST</nhinc:dateOfBirth>
        <nhinc:explanationNonClaimantSignature>NEEDED
    </nhinc:explanationNonClaimantSignature>
    <nhinc:haveSecondWitnessSignature>false</nhinc:haveSecondWitnessSignature>
    <nhinc:haveSignature>false</nhinc:haveSignature>
    <nhinc:haveWitnessSignature>false</nhinc:haveWitnessSignature>
    <nhinc:homeCommunity>

        <nhinc:homeCommunityId>urn:oid:421.421</nhinc:homeCommunityId>
        <nhinc:name>Test Site</nhinc:name>
    </nhinc:homeCommunity>
    <nhinc:personName>
        <nhinc:familyName>Carson</nhinc:familyName>
        <nhinc:givenName>Robert</nhinc:givenName>
        <nhinc:nameType>
            <nhinc:code>G</nhinc:code>
        </nhinc:nameType>
        <nhinc:secondNameOrInitials>M</nhinc:secondNameOrInitials>
    </nhinc:personName>




    <nhinc:SSN>001-11-1111</nhinc:SSN>
    <nhinc:uniquePatientId>1038^^^&amp;421.421&amp;ISO</nhinc:uniquePatientId>



    <nhinc:userInfo>
                <nhinc:personName>
            <nhinc:familyName>${#Project#FamilyName}</nhinc:familyName>
            <nhinc:givenName>${#Project#GivenName}</nhinc:givenName>
            <nhinc:nameType>
                <nhinc:code>G</nhinc:code>
            </nhinc:nameType>
            <nhinc:secondNameOrInitials>FJ</nhinc:secondNameOrInitials>
            <nhinc:fullName>Joe Smith</nhinc:fullName>
            <nhinc:prefix>Mr</nhinc:prefix>
        </nhinc:personName>
                        <nhinc:userName>admin</nhinc:userName>
                <nhinc:org>

            <nhinc:homeCommunityId>urn:oid:421.421</nhinc:homeCommunityId>
            <nhinc:name>Test Site</nhinc:name>
        </nhinc:org>
        <nhinc:roleCoded>
            <nhinc:code>22515006</nhinc:code>
            <nhinc:codeSystem>2.16.840.1.113883.6.96</nhinc:codeSystem>
            <nhinc:codeSystemName>SNOMED_CT</nhinc:codeSystemName>
            <nhinc:codeSystemVersion>1.0</nhinc:codeSystemVersion>
            <nhinc:displayName>Medical Assistant</nhinc:displayName>
            <nhinc:originalText>Medical Assistant</nhinc:originalText>
        </nhinc:roleCoded>
    </nhinc:userInfo>
    <nhinc:authorized>true</nhinc:authorized>
    <nhinc:purposeOfDisclosureCoded>
        <nhinc:code>TREATMENT</nhinc:code>
        <nhinc:codeSystem>2.16.840.1.113883.3.18.7.1</nhinc:codeSystem>
        <nhinc:codeSystemName>nhin-purpose</nhinc:codeSystemName>
        <nhinc:codeSystemVersion>1.0</nhinc:codeSystemVersion>
        <nhinc:displayName>Use or disclosure by the covered entity for its own training programs</nhinc:displayName>
        <nhinc:originalText>Use or disclosure by the covered entity for its own training programs</nhinc:originalText>
    </nhinc:purposeOfDisclosureCoded>
    <nhinc:samlAuthnStatement>
        <nhinc:authInstant>2013-12-16T14:12:24-0800</nhinc:authInstant>
        <nhinc:sessionIndex>987</nhinc:sessionIndex>
                <nhinc:authContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:X509</nhinc:authContextClassRef>
        <nhinc:subjectLocalityAddress>
                            158.147.185.168
                    </nhinc:subjectLocalityAddress>
        <nhinc:subjectLocalityDNSName>
                            cs.myharris.net
                    </nhinc:subjectLocalityDNSName>
    </nhinc:samlAuthnStatement>
    <nhinc:samlIssuer>
        <nhinc:issuer>my saml issuer</nhinc:issuer>
        <nhinc:issuerFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</nhinc:issuerFormat>
    </nhinc:samlIssuer>
        <nhinc:samlAuthzDecisionStatement>
        <nhinc:decision>Permit</nhinc:decision>
        <nhinc:resource>https://158.147.185.168:8181/SamlReceiveService/SamlProcessWS</nhinc:resource>
        <nhinc:action>TestSaml</nhinc:action>
        <nhinc:evidence>
            <nhinc:assertion>
                <nhinc:id>40df7c0a-ff3e-4b26-baeb-f2910f6d05a9</nhinc:id>
                <nhinc:issueInstant>2009-04-16T13:10:39.093Z</nhinc:issueInstant>
                <nhinc:version>2.0</nhinc:version>
                <nhinc:issuerFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName</nhinc:issuerFormat>
                <nhinc:issuer>CN=SAML User,OU=Harris,O=HITS,L=Melbourne,ST=FL,C=US</nhinc:issuer>
                <nhinc:conditions>
                    <nhinc:notBefore>2009-04-16T13:10:39.093Z</nhinc:notBefore>
                    <nhinc:notOnOrAfter>2009-12-31T12:00:00.000Z</nhinc:notOnOrAfter>
                </nhinc:conditions>
                <nhinc:accessConsentPolicy>Claim-Ref-1234</nhinc:accessConsentPolicy>
                <nhinc:instanceAccessConsentPolicy>Claim-Instance-1</nhinc:instanceAccessConsentPolicy>
            </nhinc:assertion>
        </nhinc:evidence>
    </nhinc:samlAuthzDecisionStatement>
    </urn:assertion>

                                    <urn:NhinTargetCommunities>
                <nhinc:nhinTargetCommunity>
                    <nhinc:homeCommunity>
                        <nhinc:description></nhinc:description>
                        <nhinc:homeCommunityId>422.422</nhinc:homeCommunityId>
                        <nhinc:name></nhinc:name>
                    </nhinc:homeCommunity>
                </nhinc:nhinTargetCommunity>
            </urn:NhinTargetCommunities>

                </urn:RespondingGateway_CrossGatewayQueryRequest>
        </soapenv:Body>
</soapenv:Envelope>

What am I doing wrong?  Is this part in the wrong format:

                                        <urn2:Slot name="$XDSDocumentEntryPatientId">
                                                <urn2:ValueList>
                                                        <urn2:Value>'1038^^^&amp;422.422&amp;ISO'</urn2:Value>
                                                </urn2:ValueList>
                                        </urn2:Slot>

This patient's local id is 1038 and his remote id is also 1038.  

Let me know if there's any other information I can provide to be helpful.  Thanks.  
Reply | Threaded
Open this post in threaded view
|

Re: Why can't document query find the patient in the correlation row?

Daniel Kaplan
I've figured out a work around to this by changing the $XDSDocumentEntryPatientId value.  In all other NwHIN implementations, I've been using this value:

<urn2:Value>'$RemoteCorrelatedPatientId^^^&amp;${RemoteAssigningAuthorityOid}&amp;ISO'</urn2:Value>

But it seems like I have to use this in CONNECT 4.2:

<urn2:Value>'$LocalCorrelatedPatientId^^^&amp;${LocalAssigningAuthorityOid}&amp;ISO'</urn2:Value>

If I don't do that, then CONNECT 4.2 can't find the correlation row in the correlation table.  If it can't find that row, it doesn't do a document query out.  

Technically, it does find a row but it's "unfiltered".  This match is then removed in the "filtering" step of this method: gov.hhs.fha.nhinc.patientcorrelation.nhinc.dao.Retriever#retrievePatientCorrelation

Back to my work around: I've done some research on the topic and although this change fixes my problem, it seems to violate the IHE_ITI_Suppl_XCA_Rev2-1_TI_2010-08-10.pdf spec.  If you look at section 3.38.4.1.2.1, it says: "The homeCommunityId shall contain the value that identifies the communited[sic] associated with the Responding Gateway."  I think that's saying, "use the remote community id".  

If that spec is relevant, then I shouldn't have to change the $XDSDocumentEntryPatientId value.  I should be able to leave it as remote.  

Why is CONNECT4.2 even looking in the correlation table during a document query request?  Is there a configuration option to turn this behavior off?  I have legacy code that assumes it can do a document query without ever having done a patient discovery first.  This behavior presents an obstacle to that.  
Reply | Threaded
Open this post in threaded view
|

Re: Why can't document query find the patient in the correlation row?

Daniel Kaplan
BTW, it might be useful to know that I'm sending a document query to this url:  /Gateway/DocumentQuery/2_0/EntityService/EntityDocQueryUnsecured
Reply | Threaded
Open this post in threaded view
|

Re: Why can't document query find the patient in the correlation row?

Daniel Kaplan
I resolved this by modifying the gateway.properties file and uncommenting these lines:

docquery.20.inboundDocQuery=gov.hhs.fha.nhinc.docquery.inbound.PassthroughInboundDocQuery
docquery.20.outboundDocQuery=gov.hhs.fha.nhinc.docquery.outbound.PassthroughOutboundDocQuery

docquery.30.inboundDocQuery=gov.hhs.fha.nhinc.docquery.inbound.PassthroughInboundDocQuery
docquery.30.outboundDocQuery=gov.hhs.fha.nhinc.docquery.outbound.PassthroughOutboundDocQuery

This will skip the correlation checking step.