Skip to content

Commit ebd4f0e

Browse files
NIAD-3304: Fix issue with ordering of originalText when mapping to CD XML
* Update CD template to ensure that `originalText` is always populated first. * Update tests to reflect the ordering change
1 parent e046b6a commit ebd4f0e

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<code{{#nullFlavor}} nullFlavor="UNK"{{/nullFlavor}}{{^nullFlavor}} code="{{mainCode}}" codeSystem="{{mainCodeSystem}}" displayName="{{mainDisplayName}}"{{/nullFlavor}}>
2+
{{#mainOriginalText}}
3+
<originalText>{{mainOriginalText}}</originalText>
4+
{{/mainOriginalText}}
25
{{#translations}}
36
<translation code="{{code}}" codeSystem="{{system}}" displayName="{{display}}" />
47
{{/translations}}
5-
{{#mainOriginalText}}
6-
<originalText>{{mainOriginalText}}</originalText>
7-
{{/mainOriginalText}}
88
</code>

service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/CodeableConceptCdMapperTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,9 @@ void When_WithSnomedCodingAndLegacyCodings_Expect_SnomedCdXmlWithTranslations()
351351
}""";
352352
var expectedOutput = """
353353
<code code="852471000000107" codeSystem="2.16.840.1.113883.2.1.3.2.4.15" displayName="Prothrombin time">
354+
<originalText>Prothrombin time</originalText>
354355
<translation code="42Q5.00" codeSystem="2.16.840.1.113883.2.1.6.2" displayName="Observed Prothrombin time" />
355356
<translation code="123456" codeSystem="2.16.840.1.113883.2.1.3.2.4.14" displayName="Prothrombin time (observed)" />
356-
<originalText>Prothrombin time</originalText>
357357
</code>""";
358358
var codeableConcept = fhirParseService.parseResource(inputJson, Observation.class).getCode();
359359

service/src/test/resources/ehr/mapper/blood_pressure/blood-pressure-with-codeable-concepts.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<CompoundStatement classCode="BATTERY" moodCode="EVN">
33
<id root="5E496953-065B-41F2-9577-BE8F2FBD0757"/>
44
<code code="852471000000107" codeSystem="2.16.840.1.113883.2.1.3.2.4.15" displayName="Prothrombin time">
5-
<translation code="42Q5.00" codeSystem="2.16.840.1.113883.2.1.6.2" displayName="Prothrombin time" />
65
<originalText>Prothrombin time</originalText>
6+
<translation code="42Q5.00" codeSystem="2.16.840.1.113883.2.1.6.2" displayName="Prothrombin time" />
77
</code>
88
<statusCode code="COMPLETE"/>
99
<effectiveTime>
@@ -14,8 +14,8 @@
1414
<ObservationStatement classCode="OBS" moodCode="EVN">
1515
<id root="5E496953-065B-41F2-9577-BE8F2FBD0757"/>
1616
<code code="72313002" codeSystem="2.16.840.1.113883.2.1.3.2.4.15" displayName="Systolic arterial pressure">
17-
<translation code="2469" codeSystem="2.16.840.1.113883.2.1.6.3" displayName="Systolic arterial pressure" />
1817
<originalText>Systolic arterial pressure</originalText>
18+
<translation code="2469" codeSystem="2.16.840.1.113883.2.1.6.3" displayName="Systolic arterial pressure" />
1919
</code>
2020
<statusCode code="COMPLETE"/>
2121
<effectiveTime>
@@ -36,8 +36,8 @@
3636
<ObservationStatement classCode="OBS" moodCode="EVN">
3737
<id root="5E496953-065B-41F2-9577-BE8F2FBD0757"/>
3838
<code code="1091811000000102" codeSystem="2.16.840.1.113883.2.1.3.2.4.15" displayName="Diastolic arterial pressure">
39-
<translation code="246A" codeSystem="2.16.840.1.113883.2.1.6.3" displayName="Diastolic arterial pressure" />
4039
<originalText>Diastolic arterial pressure</originalText>
40+
<translation code="246A" codeSystem="2.16.840.1.113883.2.1.6.3" displayName="Diastolic arterial pressure" />
4141
</code>
4242
<statusCode code="COMPLETE"/>
4343
<effectiveTime>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<code code="292971006" codeSystem="2.16.840.1.113883.2.1.3.2.4.15" displayName="Pivampicillin adverse reaction pt">
2+
<originalText>Pivampicillin adverse reaction (rt)</originalText>
23
<translation code="TJ00800" codeSystem="2.16.840.1.113883.2.1.6.2" displayName="Adverse reaction to pivampicillin pt" />
34
<translation code="TJ00800-1" codeSystem="2.16.840.1.113883.2.1.3.2.4.14" displayName="Adverse reaction to pivampicillin" />
4-
<originalText>Pivampicillin adverse reaction (rt)</originalText>
55
</code>

0 commit comments

Comments
 (0)