scandihealth / lpr3-docs

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

Another "transaction rolled back" error when trying to create an episode of care #87

Closed RolandPedersenSSE closed 6 years ago

RolandPedersenSSE commented 6 years ago

We get another "transaction rolled back" error when trying to create an episode of care with a little more data in it than last

Bug in the central solution to return the raw "Transaction rolled back" to the client.

The error:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
   <env:Header xmlns:env="http://www.w3.org/2003/05/soap-envelope"/>
   <soap:Body>
      <soap:Fault>
         <soap:Code>
            <soap:Value>soap:Receiver</soap:Value>
         </soap:Code>
         <soap:Reason>
            <soap:Text xml:lang="en">Transaction rolled back</soap:Text>
         </soap:Reason>
      </soap:Fault>
   </soap:Body>
</soap:Envelope>

It looks like the cause of the error is this part of the xml:

<entryRelationship typeCode="COMP">
    <act classCode="REG" moodCode="EVN">
        <templateId root="1.2.208.176.7.1.10.82"/>
        <templateId root="2.16.840.1.113883.10.12.301"/>
        <code code="AFA01A" codeSystem="1.2.208.176.2.4" codeSystemName="Sundhedsvæsenets Klassifikations System" displayName="Diagnostisk pakkeforløb: henvisning til pakkeforløb start"/>
        <effectiveTime value="20171124135151+0100"/>
    </act>
</entryRelationship>
<entryRelationship typeCode="COMP">
    <act classCode="REG" moodCode="EVN">
        <templateId root="1.2.208.176.7.1.10.82"/>
        <templateId root="2.16.840.1.113883.10.12.301"/>
        <code code="AFA01B" codeSystem="1.2.208.176.2.4" codeSystemName="Sundhedsvæsenets Klassifikations System" displayName="Diagnostisk pakkeforløb: udredning start, første fremmøde"/>
        <effectiveTime value="20171124145151+0100"/>
    </act>
</entryRelationship>

When we remove it, the creation works

Episode of care clinical document that fails: EpisodeOfCare-Create.zip

RasmusThernoe commented 6 years ago

This issue is now blocking - we are testing reporting of event markers.

TueCN commented 6 years ago

The error happens because the database has a constraint specifying that Episode of Care Markers must have a non-null hl7:id, but the art-decor template specifies that hl7:id is optional.

While we analyse and decide on a resolution, you can work around the issue by specifing a hl7:id in Episode of Care Marker elements.