scandihealth / lpr3-docs

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

Nullifying EpisodeOfCare/Encounter/Procedure #91

Closed RasmusThernoe closed 6 years ago

RasmusThernoe commented 6 years ago

Looking at: http://lpr-art-decor.westeurope.cloudapp.azure.com:8080/art-decor/decor-templates--lpr-?id=1.2.208.176.7.1.10.118&effectiveDate=dynamic

We must state the reference type code and template ids:

<reference typeCode="RPLC">
  <templateId root="1.2.208.176.7.1.10.117"/>
  <templateId root="2.16.840.1.113883.10.12.324"/>

Looking at the example "Nullifying an encounter" at ArtDecor they are not stated:

<act classCode="ACT" moodCode="EVN">
  <templateId root="1.2.208.176.7.1.10.118"/>
  <templateId root="2.16.840.1.113883.10.12.301"/>
  <code nullFlavor="NA"/>
  <statusCode code="nullified"/>
  <reference>
    <externalAct classCode="ACT" moodCode="EVN">
      <templateId root="1.2.208.176.7.1.10.78"/>
      <templateId root="2.16.840.1.113883.10.12.325"/>
      <id root="539341f8-d2de-4ee0-9cf3-bf06b5f70efb" extension="47041012-132f-5de1-b16a-df273f8f000f"/>
    </externalAct>
  </reference>
</act>

Looking at the example "Indberetning af sletning af kontaktelement" and id stated which is not part of template 1.2.208.176.7.1.10.118:

<act classCode="ACT" moodCode="EVN">
  <templateId root="1.2.208.176.7.1.10.118"/>
  <templateId root="2.16.840.1.113883.10.12.301"/>
  <id root="1.2.208.176.7.1.2.3" extension="bbbfa3ea-2ad7-571c-986c-d72f7443ba4b"/>
  <code nullFlavor="NA"/>
  <statusCode code="nullified"/>
  <reference typeCode="RPLC">
    <templateId root="1.2.208.176.7.1.10.117"/>
    <templateId root="2.16.840.1.113883.10.12.324"/>
    <externalAct classCode="ACT" moodCode="EVN">
       <templateId root="1.2.208.176.7.1.10.78"/>
       <templateId root="2.16.840.1.113883.10.12.325"/>
       <id root="5B7F555E-4AF5-527A-81A3-E67A322E5B8A" extension="bbbfa3ea-2ad7-571c-986c-d72f7443ba4b"/>
     </externalAct>
  </reference>
</act>

This is confusing - what is the right syntax?

Same issues applies to Episode of Care and Procedure.

jkiddo commented 6 years ago

The typeCode in the template is 'fixed' - meaning that it is default and is not needed in the instance of the document. This is according to the standard.

jkiddo commented 6 years ago

The use of id stated in the last example it not prohibited. It is neither part of the spec. One can also add eg. participants to the Act without violating what is specified. Hence, the use of eg. id it is allowed but not interpreted internally by LPR3. ART-DECOR states what is required AKA minimal requirements. Piggybacking more data into the documents while still adheering to the standard is allowed.

RasmusThernoe commented 6 years ago

If I try to use the example on ART-DECOR I get this response:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
   <soap:Header>
      <ns10:Header xmlns="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" xmlns:ns10="http://www.medcom.dk/dgws/2006/04/dgws-1.0.xsd" xmlns:ns11="http://www.nsi.dk/hsuid/2016/08/hsuid-1.1.xsd" xmlns:ns2="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0" xmlns:ns3="urn:oasis:names:tc:ebxml-regrep:xsd:lcm:3.0" xmlns:ns4="urn:ihe:iti:xds-b:2007" xmlns:ns5="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0" xmlns:ns6="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:ns7="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:ns8="http://www.w3.org/2000/09/xmldsig#" xmlns:ns9="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <ns10:SecurityLevel>3</ns10:SecurityLevel>
         <ns10:Linking>
            <ns10:MessageID>d7f374e7c0a8380100c79bd5a367ebf2</ns10:MessageID>
         </ns10:Linking>
         <ns10:FlowStatus>flow_finalized_succesfully</ns10:FlowStatus>
      </ns10:Header>
   </soap:Header>
   <soap:Body>
      <ns2:RegistryResponse status="urn:oasis:names:tc:ebxml-regrep:ResponseStatusType:Failure" xmlns="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" xmlns:ns10="http://www.medcom.dk/dgws/2006/04/dgws-1.0.xsd" xmlns:ns11="http://www.nsi.dk/hsuid/2016/08/hsuid-1.1.xsd" xmlns:ns2="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0" xmlns:ns3="urn:oasis:names:tc:ebxml-regrep:xsd:lcm:3.0" xmlns:ns4="urn:ihe:iti:xds-b:2007" xmlns:ns5="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0" xmlns:ns6="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:ns7="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:ns8="http://www.w3.org/2000/09/xmldsig#" xmlns:ns9="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <ns2:RegistryErrorList highestSeverity="urn:oasis:names:tc:ebxml-regrep:ErrorSeverityType:Error">
            <ns2:RegistryError codeContext="XSD|||cvc-complex-type.4: Attribute 'typeCode' must appear on element 'reference'." errorCode="InvalidDocumentContent" location="072CB92B-0A45-58F6-9703-8E6B7CAB935E^4db5a613-a959-5f12-a14d-2b9c44246306|||62:14" severity="urn:oasis:names:tc:ebxml-regrep:ErrorSeverityType:Error"/>
         </ns2:RegistryErrorList>
      </ns2:RegistryResponse>
   </soap:Body>
</soap:Envelope>
jkiddo commented 6 years ago

My mistake - I got it wrong. The use of typeCode is in indeed in the XSD schema <xs:attribute name="typeCode" type="x_ActRelationshipExternalReference" use="required"/>

which means the examples are inconsistent. They will be fixed

jkiddo commented 6 years ago

ID removed: a1f009383ccc1ce61690fb4580c371e99a5a3437 Sample fixed: http://lpr-art-decor.westeurope.cloudapp.azure.com:8080/art-decor/decor-templates--lpr-?id=1.2.208.176.7.1.10.118&effectiveDate=2017-09-13T00%3A00%3A00

jkiddo commented 6 years ago

I can only encourage you to run xsd schema checks on your own side before submitting documents - at least during development as you'll save the transmission time. Thx for the report so far

RasmusThernoe commented 6 years ago

If I try to send the new example on ART-DECOR I get this response:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
   <soap:Header>
      <ns10:Header xmlns="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" xmlns:ns10="http://www.medcom.dk/dgws/2006/04/dgws-1.0.xsd" xmlns:ns11="http://www.nsi.dk/hsuid/2016/08/hsuid-1.1.xsd" xmlns:ns2="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0" xmlns:ns3="urn:oasis:names:tc:ebxml-regrep:xsd:lcm:3.0" xmlns:ns4="urn:ihe:iti:xds-b:2007" xmlns:ns5="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0" xmlns:ns6="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:ns7="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:ns8="http://www.w3.org/2000/09/xmldsig#" xmlns:ns9="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <ns10:SecurityLevel>3</ns10:SecurityLevel>
         <ns10:Linking>
            <ns10:MessageID>d7f374e7c0a8380100c79bd5a367ebf2</ns10:MessageID>
         </ns10:Linking>
         <ns10:FlowStatus>flow_finalized_succesfully</ns10:FlowStatus>
      </ns10:Header>
   </soap:Header>
   <soap:Body>
      <ns2:RegistryResponse status="urn:oasis:names:tc:ebxml-regrep:ResponseStatusType:Failure" xmlns="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" xmlns:ns10="http://www.medcom.dk/dgws/2006/04/dgws-1.0.xsd" xmlns:ns11="http://www.nsi.dk/hsuid/2016/08/hsuid-1.1.xsd" xmlns:ns2="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0" xmlns:ns3="urn:oasis:names:tc:ebxml-regrep:xsd:lcm:3.0" xmlns:ns4="urn:ihe:iti:xds-b:2007" xmlns:ns5="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0" xmlns:ns6="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:ns7="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:ns8="http://www.w3.org/2000/09/xmldsig#" xmlns:ns9="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <ns2:RegistryErrorList highestSeverity="urn:oasis:names:tc:ebxml-regrep:ErrorSeverityType:Error">
            <ns2:RegistryError codeContext="SCHEMATRON|||(DKNullifyAct): element hl7:reference[hl7:templateId[@root='1.2.208.176.7.1.10.117']][hl7:templateId[@root='2.16.840.1.113883.10.12.324']] is mandatory [min 1x]." errorCode="InvalidDocumentContent" location="072CB92B-0A45-58F6-9703-8E6B7CAB935E^899885cf-215e-5828-9a57-0a6a70c4d765|||/*:ClinicalDocument[namespace-uri()='urn:hl7-org:v3'][1]/*:component[namespace-uri()='urn:hl7-org:v3'][1]/*:structuredBody[namespace-uri()='urn:hl7-org:v3'][1]/*:component[namespace-uri()='urn:hl7-org:v3'][1]/*:section[namespace-uri()='urn:hl7-org:v3'][1]/*:entry[namespace-uri()='urn:hl7-org:v3'][1]/*:act[namespace-uri()='urn:hl7-org:v3'][1]" severity="urn:oasis:names:tc:ebxml-regrep:ErrorSeverityType:Error"/>
         </ns2:RegistryErrorList>
      </ns2:RegistryResponse>
   </soap:Body>
</soap:Envelope>

You are still missing template ids.

jkiddo commented 6 years ago

@RasmusThernoe Please provide link to the sample in question

RasmusThernoe commented 6 years ago

http://lpr-art-decor.westeurope.cloudapp.azure.com:8080/art-decor/decor-templates--lpr-?id=1.2.208.176.7.1.10.118&effectiveDate=2017-09-13T00%3A00%3A00

picture1

jkiddo commented 6 years ago

should be there now