scandihealth / lpr3-docs

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

Clinical Document validation error #154

Closed metodikamikaelnilsson closed 6 years ago

metodikamikaelnilsson commented 6 years ago

If I send this clinical document to https://lprws-test.sds.dsdn.dk/cda-ws/DocumentRepository_Service/PatientHealthcareValidateReportingService for validation, the response is a validation error:

Invalid content was found starting with element 'confidentialityCode'. One of '{"urn:hl7-org:v3":title, "urn:hl7-org:v3":effectiveTime}' is expected.

According to the docs at DK Episode Of Care Summaries Document (2.0.2) there should not exist any title element or effectiveTime element at this position in the clinical document. Also, the example clinical document at this web page doesn't include these elements. So why do the validation endpoint respond with this error?

<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" classCode="DOCCLIN" moodCode="EVN">
   <realmCode code="DK" />
   <typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040" />
   <templateId root="1.2.208.176.7.1.10.71" />
   <templateId root="2.16.840.1.113883.10.12.2" />
   <templateId root="2.16.840.1.113883.10.12.1" />
   <id root="6A451BBF-A5A2-43DF-A1BE-98A41418B746" extension="06C20C50-87F0-558B-A16F-B3F3B045AF3B" />
   <code displayName="Summary of episode note" codeSystemName="LOINC" codeSystem="2.16.840.1.113883.6.1" code="34133-9" />
   <confidentialityCode code="N" codeSystem="2.16.840.1.113883.5.25" />
   <setId root="6A451BBF-A5A2-43DF-A1BE-98A41418B746" assigningAuthorityName="Some authority name" />
   <versionNumber value="2" />
   <recordTarget>
      <templateId root="1.2.208.176.7.1.10.101" />
      <templateId root="2.16.840.1.113883.10.12.101" />
      <patientRole classCode="PAT">
         <templateId root="1.2.208.176.7.1.10.106" />
         <id extension="3010384019" root="1.2.208.176.1.2" assigningAuthorityName="CPR" />
      </patientRole>
   </recordTarget>
   <author typeCode="AUT">
      <templateId root="1.2.208.176.7.1.10.102" />
      <templateId root="2.16.840.1.113883.10.12.102" />
      <time value="20170228101500+0100" />
      <assignedAuthor classCode="ASSIGNED">
         <id nullFlavor="NI" />
         <representedOrganization classCode="ORG" determinerCode="INSTANCE">
            <id assigningAuthorityName="SOR" root="1.2.208.176.1.1" extension="6071000016008" />
         </representedOrganization>
      </assignedAuthor>
   </author>
   <custodian typeCode="CST">
      <templateId root="1.2.208.176.7.1.10.103" />
      <templateId root="2.16.840.1.113883.10.12.104" />
      <assignedCustodian classCode="ASSIGNED">
         <representedCustodianOrganization classCode="ORG" determinerCode="INSTANCE">
            <id assigningAuthorityName="Erhvervs- og Selskabsstyrelsen" root="2.16.840.1.113883.2.24.1.1" extension="25469364" />
         </representedCustodianOrganization>
      </assignedCustodian>
   </custodian>
   <component contextConductionInd="true">
      <structuredBody>
         <component contextConductionInd="true">
            <section>
               <templateId root="1.2.208.176.7.1.10.95" />
               <templateId root="2.16.840.1.113883.10.12.201" />
               <entry typeCode="COMP">
                  <act classCode="PCPR" moodCode="EVN">
                     <templateId root="1.2.208.176.7.1.10.80" />
                     <templateId root="2.16.840.1.113883.10.12.301" />
                     <id root="6A451BBF-A5A2-43DF-A1BE-98A41418B746" extension="bbbfa3ea-2ad7-571c-986c-d72f7443ba4b" />
                     <code nullFlavor="NA" />
                     <effectiveTime>
                        <low value="20170328101500+0100" />
                     </effectiveTime>
                     <participant typeCode="RESP">
                        <templateId root="1.2.208.176.7.1.10.49" />
                        <templateId root="2.16.840.1.113883.10.12.321" />
                        <participantRole classCode="ROL">
                           <scopingEntity classCode="ORG">
                              <id assigningAuthorityName="SOR" root="1.2.208.176.1.1" extension="6071000016008" />
                           </scopingEntity>
                        </participantRole>
                     </participant>
                     <entryRelationship typeCode="RSON">
                        <act classCode="PCPR" moodCode="RQO">
                           <templateId root="1.2.208.176.7.1.10.51" />
                           <templateId root="2.16.840.1.113883.10.12.301" />
                           <code nullFlavor="NA" />
                           <effectiveTime value="20170428101500+0100" />
                           <entryRelationship typeCode="COMP">
                              <act classCode="REG" moodCode="EVN">
                                 <templateId root="1.2.208.176.7.1.10.53" />
                                 <templateId root="2.16.840.1.113883.10.12.301" />
                                 <code codeSystemName="Sundhedsvæsenets Klassifikations System" codeSystem="1.2.208.176.2.4" code="ALDB00" />
                              </act>
                           </entryRelationship>
                           <entryRelationship typeCode="COMP">
                              <act classCode="REG" moodCode="EVN">
                                 <templateId root="1.2.208.176.7.1.10.54" />
                                 <templateId root="2.16.840.1.113883.10.12.301" />
                                 <code codeSystemName="Sundhedsvæsenets Klassifikations System" codeSystem="1.2.208.176.2.4" code="ALDA11" />
                              </act>
                           </entryRelationship>
                        </act>
                     </entryRelationship>
                     <entryRelationship typeCode="COMP">
                        <act classCode="REG" moodCode="EVN">
                           <templateId root="1.2.208.176.7.1.10.81" />
                           <templateId root="2.16.840.1.113883.10.12.301" />
                           <code codeSystemName="Sundhedsvæsenets Klassifikations System" codeSystem="1.2.208.176.2.4" code="ALAL01" />
                        </act>
                     </entryRelationship>
                  </act>
               </entry>
            </section>
         </component>
      </structuredBody>
   </component>
</ClinicalDocument>
TueCN commented 6 years ago

Hi

The attached XML is not XSD valid. You receive an XSD validation error (not a SCHEMATRON error).

The CDA.xsd (which includes POCD_MT000040.xsd) enforces the order and requires an effectiveTime as shown below (taken from POCD_MT000040.xsd)

<xs:complexType name="POCD_MT000040.ClinicalDocument">
    <xs:sequence>
        <xs:element name="realmCode" type="CS" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element name="typeId" type="POCD_MT000040.InfrastructureRoot.typeId"/>
        <xs:element name="templateId" type="II" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element name="id" type="II"/>
        <xs:element name="code" type="CE"/>
        <xs:element name="title" type="ST" minOccurs="0"/>
        <xs:element name="effectiveTime" type="TS"/>
        <xs:element name="confidentialityCode" type="CE"/>
        <xs:element name="languageCode" type="CS" minOccurs="0"/>
        <xs:element name="setId" type="II" minOccurs="0"/>
        <xs:element name="versionNumber" type="INT" minOccurs="0"/>
        <xs:element name="copyTime" type="TS" minOccurs="0"/>
        <xs:element name="recordTarget" type="POCD_MT000040.RecordTarget" maxOccurs="unbounded"/>
        <xs:element name="author" type="POCD_MT000040.Author" maxOccurs="unbounded"/>
        <xs:element name="dataEnterer" type="POCD_MT000040.DataEnterer" minOccurs="0"/>
        <xs:element name="informant" type="POCD_MT000040.Informant12" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element name="custodian" type="POCD_MT000040.Custodian"/>
        <xs:element name="informationRecipient" type="POCD_MT000040.InformationRecipient" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element name="legalAuthenticator" type="POCD_MT000040.LegalAuthenticator" minOccurs="0"/>
        <xs:element name="authenticator" type="POCD_MT000040.Authenticator" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element name="participant" type="POCD_MT000040.Participant1" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element name="inFulfillmentOf" type="POCD_MT000040.InFulfillmentOf" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element name="documentationOf" type="POCD_MT000040.DocumentationOf" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element name="relatedDocument" type="POCD_MT000040.RelatedDocument" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element name="authorization" type="POCD_MT000040.Authorization" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element name="componentOf" type="POCD_MT000040.Component1" minOccurs="0"/>
        <xs:element name="component" type="POCD_MT000040.Component2"/>
    </xs:sequence>
...

You are correct that the example on art-decor is not XSD valid, we will fix that.