Skip to content

Commit 0f82324

Browse files
author
Adrian Clay
authored
NIAD-3218: Fix malformed ehrSupplyDiscontinue / pertinentInformation / pertinentSupplyAnnotation (#965)
* Fix malformed ehrSupplyDiscontinue / pertinentInformation / pertinentSupplyAnnotation When a MedicationRequest didn't have reason text to provide, we were providing an invalid code element within the pertinentSupplyInformation. This is invalid according to the spec. Instead, move the nullFlavor annotation to the pertinentSupplyAnnotation where it is valid. * Remove stopped reason from "Pro-Cal shot neutral" medication Prescribed on 28th March 2019. Stopped on 10th May 2019.
1 parent b4e2033 commit 0f82324

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2525
* When mapping `Immunizations` which contain a `NOPAT` `meta.security` tag, the resultant XML for that resource
2626
will contain a `NOPAT` `confidentialityCode` element.
2727

28+
### Fixed
29+
30+
* Fix a malformed XML GP2GP message created when mapping a `MedicationRequest` with `intent` of `plan` and is stopped,
31+
but no free text reason for the discontinuation was provided.
32+
2833
## [2.1.2] - 2014-10-21
2934

3035
### Fixed

service/src/main/resources/templates/ehr_medication_statement_authorise_template.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
</priorMedicationRef>
6161
</reversalOf>
6262
<pertinentInformation typeCode="PERT">
63-
<pertinentSupplyAnnotation classCode="OBS" moodCode="EVN">
64-
{{#ehrSupplyDiscontinueReasonText}}<text>{{{ehrSupplyDiscontinueReasonText}}}</text>{{/ehrSupplyDiscontinueReasonText}}{{^ehrSupplyDiscontinueReasonText}}<code nullFlavor="UNK"><text>Stopped</text></code>{{/ehrSupplyDiscontinueReasonText}}
63+
<pertinentSupplyAnnotation classCode="OBS" moodCode="EVN"{{^ehrSupplyDiscontinueReasonText}} nullFlavor="UNK"{{/ehrSupplyDiscontinueReasonText}}>
64+
{{#ehrSupplyDiscontinueReasonText}}<text>{{{ehrSupplyDiscontinueReasonText}}}</text>{{/ehrSupplyDiscontinueReasonText}}{{^ehrSupplyDiscontinueReasonText}}<text>Stopped</text>{{/ehrSupplyDiscontinueReasonText}}
6565
</pertinentSupplyAnnotation>
6666
</pertinentInformation>
6767
</ehrSupplyDiscontinue>

service/src/test/resources/ehr/mapper/medication_request/medication-statement-with-authorise-default-status-reason-code.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
</priorMedicationRef>
4949
</reversalOf>
5050
<pertinentInformation typeCode="PERT">
51-
<pertinentSupplyAnnotation classCode="OBS" moodCode="EVN">
52-
<code nullFlavor="UNK"><text>Stopped</text></code>
51+
<pertinentSupplyAnnotation classCode="OBS" moodCode="EVN" nullFlavor="UNK">
52+
<text>Stopped</text>
5353
</pertinentSupplyAnnotation>
5454
</pertinentInformation>
5555
</ehrSupplyDiscontinue>

wiremock/stubs/__files/EMISPatientStructurede2eResponsePWTP3.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,12 +1150,6 @@
11501150
{
11511151
"url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationStatusReason-1",
11521152
"extension": [
1153-
{
1154-
"url": "statusReason",
1155-
"valueCodeableConcept": {
1156-
"text": "Expired"
1157-
}
1158-
},
11591153
{
11601154
"url": "statusChangeDate",
11611155
"valueDateTime": "2019-05-10T02:00:09.943+01:00"

0 commit comments

Comments
 (0)