scandihealth / lpr3-docs

https://scandihealth.github.io/lpr3-docs/
MIT License
11 stars 7 forks source link

Problem Replacing Condition Observation #141

Closed jbraschler closed 6 years ago

jbraschler commented 6 years ago

We're encountering an issue when we try to send a document that contains a Condition Observation (this occurs for both Major and Minor conditions) that was submitted in a previous document. We're including the External Condition Observation reference with typeCode="RPLC" with the same identifier as instructed in the document specification in order to replace an existing condition, but we're still getting an INTEGRITY_CHECK error response with a CONDITION_OBSERVATION_ALREADY_EXISTS integrity code.

Submitted Document:

<ClinicalDocument xmlns="urn:hl7-org:v3" classCode="DOCCLIN" moodCode="EVN">
    <realmCode code="DK"></realmCode>
    <typeId extension="POCD_HD000040" root="2.16.840.1.113883.1.3"></typeId>
    <templateId root="1.2.208.176.7.1.10.71"></templateId>
    <templateId root="2.16.840.1.113883.10.12.2"></templateId>
    <templateId root="2.16.840.1.113883.10.12.1"></templateId>
    <id extension="9C8D17CC-765F-11E8-958F-0050569C0201" root="488CB1DA-6DB0-11E8-AE21-0050568B75C0"></id>
    <code code="34133-9" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Summary of episode note"></code>
    <effectiveTime value="20180621122256-0500"></effectiveTime>
    <confidentialityCode code="N" codeSystem="2.16.840.1.113883.5.25"></confidentialityCode>
    <setId assigningAuthorityName="EPC" root="488CB1DA-6DB0-11E8-AE21-0050568B75C0"></setId>
    <versionNumber value="3"></versionNumber>
    <recordTarget>
        <templateId root="1.2.208.176.7.1.10.101"></templateId>
        <templateId root="2.16.840.1.113883.10.12.101"></templateId>
        <patientRole classCode="PAT">
            <templateId root="1.2.208.176.7.1.10.106"></templateId>
            <id extension="0707771119" root="1.2.208.176.1.2" assigningAuthorityName="CPR"></id>
        </patientRole>
    </recordTarget>
    <author typeCode="AUT">
        <templateId root="1.2.208.176.7.1.10.102"></templateId>
        <templateId root="2.16.840.1.113883.10.12.102"></templateId>
        <time value="20180621122256-0500"></time>
        <assignedAuthor classCode="ASSIGNED">
            <id nullFlavor="NI"></id>
            <representedOrganization classCode="ORG" determinerCode="INSTANCE">
                <id extension="6111000016004" root="1.2.208.176.1.1" assigningAuthorityName="SOR"></id>
            </representedOrganization>
        </assignedAuthor>
    </author>
    <custodian typeCode="CST">
        <templateId root="1.2.208.176.7.1.10.103"></templateId>
        <templateId root="2.16.840.1.113883.10.12.104"></templateId>
        <assignedCustodian classCode="ASSIGNED">
            <representedCustodianOrganization classCode="ORG" determinerCode="INSTANCE">
                <id extension="29190623" root="2.16.840.1.113883.2.24.1.1" assigningAuthorityName="Erhvervs- og Selskabsstyrelsen"></id>
            </representedCustodianOrganization>
        </assignedCustodian>
    </custodian>
    <relatedDocument typeCode="APND">
        <parentDocument classCode="DOCCLIN" moodCode="EVN">
            <id extension="BD23983C-7577-11E8-BF6D-0050568B75C0" root="488CB1DA-6DB0-11E8-AE21-0050568B75C0"></id>
            <setId assigningAuthorityName="EPC" root="488CB1DA-6DB0-11E8-AE21-0050568B75C0"></setId>
            <versionNumber value="2"></versionNumber>
        </parentDocument>
    </relatedDocument>
    <component contextConductionInd="true">
        <structuredBody>
            <component contextConductionInd="true">
                <section>
                    <templateId root="1.2.208.176.7.1.10.75"></templateId>
                    <templateId root="2.16.840.1.113883.10.12.201"></templateId>
                    <title>Hospital Account</title>
                    <text>
                        <table>
                            <colgroup>
                                <col span="3" width="15%"></col>
                                <col width="25%"></col>
                                <col width="30%"></col>
                            </colgroup>
                            <thead>
                                <tr styleCode="Bold">
                                    <th>Hospital Account Type</th>
                                    <th>Responsible Department</th>
                                    <th>Admission Type</th>
                                    <th>Duration</th>
                                    <th>Details</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>Physical Attendance Kontakt (ALCA01)</td>
                                    <td>DK Iliad Denmark Cardiology OP</td>
                                    <td>Urgent (ATA1)</td>
                                    <td>6/21/2018 11:14 CDT - </td>
                                    <td></td>
                                </tr>
                            </tbody>
                        </table>
                        <table>
                            <caption>Payment Conditions</caption>
                            <colgroup>
                                <col span="2" width="25%"></col>
                                <col width="20%"></col>
                                <col width="30%"></col>
                            </colgroup>
                            <thead>
                                <tr>
                                    <th>Duration</th>
                                    <th>Payment Agreement</th>
                                    <th>Payer</th>
                                    <th>Specialization Level</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>6/21/2018 11:14 CDT - </td>
                                    <td>CLH HOMER AGREEMENT - DRG (ALFA3)</td>
                                    <td>AA PAYOR (88)</td>
                                    <td>Main Function (ALFC2)</td>
                                </tr>
                            </tbody>
                        </table>
                        <table>
                            <caption>Service Delivery Location</caption>
                            <colgroup>
                                <col span="2" width="25%"></col>
                                <col width="50%"></col>
                            </colgroup>
                            <thead>
                                <tr>
                                    <th>Duration</th>
                                    <th>Location</th>
                                    <th>Absence Code</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>6/21/2018 11:14 CDT - </td>
                                    <td>DK ILIAD DMRK CARD HOD</td>
                                    <td></td>
                                </tr>
                            </tbody>
                        </table>
                    </text>
                    <entry typeCode="COMP">
                        <encounter classCode="ENC" moodCode="EVN">
                            <templateId root="1.2.208.176.7.1.10.74"></templateId>
                            <templateId root="2.16.840.1.113883.10.12.302"></templateId>
                            <id extension="4caa62af-3554-5396-8651-ab49ace19b87" root="488CB1DA-6DB0-11E8-AE21-0050568B75C0"></id>
                            <code code="ALCA01" codeSystem="1.2.208.176.2.4"></code>
                            <effectiveTime>
                                <low value="20180621111400-0500"></low>
                            </effectiveTime>
                            <priorityCode code="ATA1" codeSystem="1.2.208.176.2.4"></priorityCode>
                            <participant typeCode="RESP">
                                <templateId root="1.2.208.176.7.1.10.49"></templateId>
                                <templateId root="2.16.840.1.113883.10.12.321"></templateId>
                                <participantRole classCode="ROL">
                                    <scopingEntity classCode="ORG">
                                        <id extension="265431000016001" root="1.2.208.176.1.1" assigningAuthorityName="SOR"></id>
                                    </scopingEntity>
                                </participantRole>
                            </participant>
                            <entryRelationship typeCode="REFR">
                                <act classCode="ACT" moodCode="EVN">
                                    <templateId root="1.2.208.176.7.1.10.7"></templateId>
                                    <templateId root="2.16.840.1.113883.10.12.301"></templateId>
                                    <code code="ALFA3" codeSystem="1.2.208.176.2.4"></code>
                                    <effectiveTime>
                                        <low value="20180621111400-0500"></low>
                                    </effectiveTime>
                                    <participant typeCode="IND">
                                        <templateId root="1.2.208.176.7.1.10.8"></templateId>
                                        <templateId root="2.16.840.1.113883.10.12.321"></templateId>
                                        <participantRole classCode="PAYOR">
                                            <scopingEntity>
                                                <id extension="ALFB01" root="1.2.208.176.2.4"></id>
                                            </scopingEntity>
                                        </participantRole>
                                    </participant>
                                    <entryRelationship typeCode="COMP">
                                        <act classCode="ACT" moodCode="EVN">
                                            <templateId root="1.2.208.176.7.1.10.10"></templateId>
                                            <templateId root="2.16.840.1.113883.10.12.301"></templateId>
                                            <code code="ALFC2" codeSystem="1.2.208.176.2.4"></code>
                                        </act>
                                    </entryRelationship>
                                </act>
                            </entryRelationship>
                            <reference typeCode="REFR">
                                <templateId root="1.2.208.176.7.1.10.69"></templateId>
                                <templateId root="2.16.840.1.113883.10.12.324"></templateId>
                                <externalAct classCode="PCPR" moodCode="EVN">
                                    <templateId root="1.2.208.176.7.1.10.65"></templateId>
                                    <templateId root="2.16.840.1.113883.10.12.325"></templateId>
                                    <id extension="ad56c5d8-bf85-5138-b49f-66330d3757e5" root="488CB1DA-6DB0-11E8-AE21-0050568B75C0"></id>
                                </externalAct>
                            </reference>
                            <reference typeCode="RPLC">
                                <templateId root="1.2.208.176.7.1.10.121"></templateId>
                                <templateId root="1.2.208.176.7.1.10.117"></templateId>
                                <templateId root="2.16.840.1.113883.10.12.324"></templateId>
                                <externalAct classCode="ACT" moodCode="EVN">
                                    <templateId root="1.2.208.176.7.1.10.78"></templateId>
                                    <templateId root="2.16.840.1.113883.10.12.325"></templateId>
                                    <id extension="4caa62af-3554-5396-8651-ab49ace19b87" root="488CB1DA-6DB0-11E8-AE21-0050568B75C0"></id>
                                </externalAct>
                            </reference>
                        </encounter>
                    </entry>
                </section>
            </component>
            <component contextConductionInd="true">
                <section>
                    <templateId root="1.2.208.176.7.1.10.113"></templateId>
                    <templateId root="2.16.840.1.113883.10.12.201"></templateId>
                    <title>Diagnoses</title>
                    <text>
                        <table>
                            <caption>Secondary Diagnosis</caption>
                            <colgroup>
                                <col width="25%"></col>
                                <col width="75%"></col>
                            </colgroup>
                            <thead>
                                <tr styleCode="Bold">
                                    <th>Diagnosis</th>
                                    <th>Details</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>Sacrocoxalgia (DM533B)</td>
                                    <td>
                                        <paragraph styleCode="cellHeader">Laterality:</paragraph>
                                        <content styleCode="allIndent">congestive (TUL2)</content>
                                        <br></br>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </text>
                    <entry typeCode="COMP">
                        <observation classCode="OBS" moodCode="EVN" negationInd="false">
                            <templateId root="1.2.208.176.7.1.10.46"></templateId>
                            <templateId root="1.2.208.176.7.1.10.36"></templateId>
                            <templateId root="2.16.840.1.113883.10.12.303"></templateId>
                            <id extension="E21BB745-40BA-5855-B2C2-65622D3B9823" root="488CB1DA-6DB0-11E8-AE21-0050568B75C0"></id>
                            <code code="DM533B" codeSystem="1.2.208.176.2.4"></code>
                            <targetSiteCode code="TUL2" codeSystem="1.2.208.176.2.4"></targetSiteCode>
                            <entryRelationship typeCode="COMP">
                                <observation classCode="OBS" moodCode="EVN">
                                    <templateId root="1.2.208.176.7.1.10.43"></templateId>
                                    <templateId root="2.16.840.1.113883.10.12.303"></templateId>
                                    <code code="ALGA02" codeSystem="1.2.208.176.2.4"></code>
                                </observation>
                            </entryRelationship>
                            <entryRelationship typeCode="REFR">
                                <encounter classCode="ENC" moodCode="EVN">
                                    <templateId root="1.2.208.176.7.1.10.77"></templateId>
                                    <templateId root="2.16.840.1.113883.10.12.301"></templateId>
                                    <id extension="4caa62af-3554-5396-8651-ab49ace19b87" root="488CB1DA-6DB0-11E8-AE21-0050568B75C0"></id>
                                    <code nullFlavor="NA"></code>
                                </encounter>
                            </entryRelationship>
                            <reference typeCode="RPLC">
                                <externalObservation classCode="OBS" moodCode="EVN">
                                    <templateId root="1.2.208.176.7.1.10.100"></templateId>
                                    <templateId root="2.16.840.1.113883.10.12.326"></templateId>
                                    <id extension="E21BB745-40BA-5855-B2C2-65622D3B9823" root="488CB1DA-6DB0-11E8-AE21-0050568B75C0"></id>
                                </externalObservation>
                            </reference>
                        </observation>
                    </entry>
                </section>
            </component>
            <component contextConductionInd="true">
                <section>
                    <templateId root="1.2.208.176.7.1.10.76"></templateId>
                    <templateId root="2.16.840.1.113883.10.12.201"></templateId>
                    <title>Procedures</title>
                    <text>
                        <table>
                            <colgroup>
                                <col span="2" width="25%"></col>
                                <col width="20%"></col>
                                <col width="30%"></col>
                            </colgroup>
                            <thead>
                                <tr styleCode="Bold normRow">
                                    <th>Procedure</th>
                                    <th>Duration</th>
                                    <th>Producer</th>
                                    <th>Details</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr styleCode="normRow">
                                    <td>LEFT VENT-PERFORMABLE B TECH CHARGE (56000112)</td>
                                    <td>6/21/2018 00:00 CDT - </td>
                                    <td>
                                        <content styleCode="allIndent">DK ILIAD OP GASTRO</content>
                                        <paragraph styleCode="cellHeader">Personnel Category:</paragraph>
                                        <content styleCode="allIndent">Determination of refractive state was not performed in the course of diagnostic ophthalmological examination (AP)</content>
                                        <br></br>
                                    </td>
                                    <td></td>
                                </tr>
                            </tbody>
                        </table>
                        <table>
                            <colgroup>
                                <col span="2" width="25%"></col>
                                <col width="20%"></col>
                                <col width="30%"></col>
                            </colgroup>
                            <thead>
                                <tr styleCode="Bold altRow">
                                    <th>Procedure</th>
                                    <th>Duration</th>
                                    <th>Producer</th>
                                    <th>Details</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr styleCode="altRow">
                                    <td>RIGHT VENT-PERFORMABLE C TECH CHARGE (56000113)</td>
                                    <td>6/21/2018 00:00 CDT - </td>
                                    <td>
                                        <content styleCode="allIndent">DK ILIAD OP GASTRO</content>
                                    </td>
                                    <td>
                                        <paragraph styleCode="cellHeader">Laterality:</paragraph>
                                        <content styleCode="allIndent">congestive (TUL2)</content>
                                        <br></br>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </text>
                    <entry typeCode="COMP">
                        <procedure classCode="PROC" moodCode="EVN">
                            <templateId root="1.2.208.176.7.1.10.30"></templateId>
                            <templateId root="2.16.840.1.113883.10.12.306"></templateId>
                            <id extension="F22B87E7-9983-52D5-8643-2297E7F4D4F6" root="488CB1DA-6DB0-11E8-AE21-0050568B75C0"></id>
                            <code code="KAAA27" codeSystem="1.2.208.176.2.4"></code>
                            <effectiveTime>
                                <low value="20180621120000-0500"></low>
                            </effectiveTime>
                            <participant typeCode="PRF">
                                <templateId root="1.2.208.176.7.1.10.16"></templateId>
                                <templateId root="2.16.840.1.113883.10.12.321"></templateId>
                                <participantRole classCode="ROL">
                                    <code code="APAA10" codeSystem="1.2.208.176.2.4"></code>
                                    <scopingEntity classCode="ORG">
                                        <id extension="265431000016001" root="1.2.208.176.1.1" assigningAuthorityName="SOR"></id>
                                    </scopingEntity>
                                </participantRole>
                            </participant>
                            <entryRelationship typeCode="REFR">
                                <encounter classCode="ENC" moodCode="EVN">
                                    <templateId root="1.2.208.176.7.1.10.77"></templateId>
                                    <templateId root="2.16.840.1.113883.10.12.301"></templateId>
                                    <id extension="4caa62af-3554-5396-8651-ab49ace19b87" root="488CB1DA-6DB0-11E8-AE21-0050568B75C0"></id>
                                    <code nullFlavor="NA"></code>
                                </encounter>
                            </entryRelationship>
                            <reference typeCode="RPLC">
                                <templateId root="1.2.208.176.7.1.10.124"></templateId>
                                <templateId root="1.2.208.176.7.1.10.117"></templateId>
                                <templateId root="2.16.840.1.113883.10.12.324"></templateId>
                                <externalProcedure classCode="PROC" moodCode="EVN">
                                    <templateId root="1.2.208.176.7.1.10.67"></templateId>
                                    <templateId root="2.16.840.1.113883.10.12.327"></templateId>
                                    <id extension="F22B87E7-9983-52D5-8643-2297E7F4D4F6" root="488CB1DA-6DB0-11E8-AE21-0050568B75C0"></id>
                                </externalProcedure>
                            </reference>
                        </procedure>
                    </entry>
                    <entry typeCode="COMP">
                        <procedure classCode="PROC" moodCode="EVN">
                            <templateId root="1.2.208.176.7.1.10.30"></templateId>
                            <templateId root="2.16.840.1.113883.10.12.306"></templateId>
                            <id extension="403D6538-6F1C-5C69-AC63-5FC73EC05443" root="488CB1DA-6DB0-11E8-AE21-0050568B75C0"></id>
                            <code code="KAAA27" codeSystem="1.2.208.176.2.4"></code>
                            <effectiveTime>
                                <low value="20180621120000-0500"></low>
                            </effectiveTime>
                            <targetSiteCode code="TUL2" codeSystem="1.2.208.176.2.4"></targetSiteCode>
                            <participant typeCode="PRF">
                                <templateId root="1.2.208.176.7.1.10.16"></templateId>
                                <templateId root="2.16.840.1.113883.10.12.321"></templateId>
                                <participantRole classCode="ROL">
                                    <scopingEntity classCode="ORG">
                                        <id extension="265431000016001" root="1.2.208.176.1.1" assigningAuthorityName="SOR"></id>
                                    </scopingEntity>
                                </participantRole>
                            </participant>
                            <entryRelationship typeCode="REFR">
                                <encounter classCode="ENC" moodCode="EVN">
                                    <templateId root="1.2.208.176.7.1.10.77"></templateId>
                                    <templateId root="2.16.840.1.113883.10.12.301"></templateId>
                                    <id extension="4caa62af-3554-5396-8651-ab49ace19b87" root="488CB1DA-6DB0-11E8-AE21-0050568B75C0"></id>
                                    <code nullFlavor="NA"></code>
                                </encounter>
                            </entryRelationship>
                            <reference typeCode="RPLC">
                                <templateId root="1.2.208.176.7.1.10.124"></templateId>
                                <templateId root="1.2.208.176.7.1.10.117"></templateId>
                                <templateId root="2.16.840.1.113883.10.12.324"></templateId>
                                <externalProcedure classCode="PROC" moodCode="EVN">
                                    <templateId root="1.2.208.176.7.1.10.67"></templateId>
                                    <templateId root="2.16.840.1.113883.10.12.327"></templateId>
                                    <id extension="403D6538-6F1C-5C69-AC63-5FC73EC05443" root="488CB1DA-6DB0-11E8-AE21-0050568B75C0"></id>
                                </externalProcedure>
                            </reference>
                        </procedure>
                    </entry>
                </section>
            </component>
        </structuredBody>
    </component>
</ClinicalDocument>

Response:

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
    <Header>
        <ep2:Header xmlns:ep2="http://www.medcom.dk/dgws/2006/04/dgws-1.0.xsd">
            <ep2:SecurityLevel>3</ep2:SecurityLevel>
            <ep2:TimeOut></ep2:TimeOut>
            <ep2:Linking>
                <ep2:MessageID>950950950-106879-64822225</ep2:MessageID>
            </ep2:Linking>
            <ep2:FlowStatus>flow_finalized_succesfully</ep2:FlowStatus>
            <ep2:RequireNonRepudiationReceipt>no</ep2:RequireNonRepudiationReceipt>
        </ep2:Header>
    </Header>
    <Body>
        <ep6:RegistryResponse xmlns:ep6="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0" status="urn:oasis:names:tc:ebxml-regrep:ResponseStatusType:Failure">
            <ep6:RegistryErrorList highestSeverity="urn:oasis:names:tc:ebxml-regrep:ErrorSeverityType:Error">
                <ep6:RegistryError codeContext="INTEGRITY_CHECK|||Condition Observation E21BB745-40BA-5855-B2C2-65622D3B9823 already exists in the registry|||CONDITION_OBSERVATION_ALREADY_EXISTS|||E21BB745-40BA-5855-B2C2-65622D3B9823" errorCode="InvalidDocumentContent" location="488CB1DA-6DB0-11E8-AE21-0050568B75C0^9C8D17CC-765F-11E8-958F-0050569C0201|||//*[local-name()='observation' and @classCode='OBS' and @moodCode='EVN'][child::*[local-name()='id' and @extension='E21BB745-40BA-5855-B2C2-65622D3B9823']][child::*[local-name()='templateId' and @root='1.2.208.176.7.1.10.36']][child::*[local-name()='templateId' and @root='2.16.840.1.113883.10.12.303']]" severity="urn:oasis:names:tc:ebxml-regrep:ErrorSeverityType:Error"></ep6:RegistryError>
            </ep6:RegistryErrorList>
        </ep6:RegistryResponse>
    </Body>
</Envelope>
DaveSS commented 6 years ago

As a follow-up, the case that was causing the INTEGRITY_CHECK error above uses the Art-Décor specified format of:

<reference typeCode="RPLC">
    <externalObservation classCode="OBS" moodCode="EVN">
        <templateId root="1.2.208.176.7.1.10.100"></templateId>
        <templateId root="2.16.840.1.113883.10.12.326"></templateId>
        <id extension="E21BB745-40BA-5855-B2C2-65622D3B9823" root="488CB1DA-6DB0-11E8-AE21-0050568B75C0"></id>
    </externalObservation>
</reference>

for the Condition reference to a replacement. Note that the Art-Décor for the Condition Observation does not specifiy that the reference element come from the DK External Condition Replacement Reference (Body) template (1.2.208.176.7.1.10.125). If we include the templates from (1.2.208.176.7.1.10.125) in the document included at the top, the Conditions do not generate the INTEGRITY_CHECK error. So the following works to replace a condition:

<reference typeCode="RPLC">
    <templateId root="1.2.208.176.7.1.10.117"></templateId>
    <templateId root="2.16.840.1.113883.10.12.324"></templateId>
    <templateId root="1.2.208.176.7.1.10.125"></templateId>
    <externalObservation classCode="OBS" moodCode="EVN">
        <templateId root="1.2.208.176.7.1.10.100"></templateId>
        <templateId root="2.16.840.1.113883.10.12.326"></templateId>
        <id extension="E21BB745-40BA-5855-B2C2-65622D3B9823" root="488CB1DA-6DB0-11E8-AE21-0050568B75C0"></id>
    </externalObservation>
</reference>

Please update the reference element in Condition Observation (1.2.208.176.7.1.10.36) in Art-Décor to use the DK External Condition Replacement Reference (Body) template (1.2.208.176.7.1.10.125) if that is the intent.

jonigkeit commented 6 years ago

RESOLUTION We have removed the check for templateId on the reference. It will be deployed with the next release.