Skip to content

Commit 0d64930

Browse files
author
Adrian Clay
authored
AllergyMapper: Add confidentialityCode to ObservationStatement (#1098)
Incumbents don't appear to be accepting the confidentialityCode as it is currently sent, which is only on the CompoundStatement. Also add the confidentialityCode to the ObservationStatement too, which causes both incumbent suppliers to accept that the Allergy shouldn't appear on the patients online record.
1 parent 3c585cf commit 0d64930

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
{{{effectiveTime}}}
2020
</effectiveTime>
2121
{{{availabilityTime}}}
22+
{{#confidentialityCode}}
23+
{{{confidentialityCode}}}
24+
{{/confidentialityCode}}
2225
<pertinentInformation typeCode="PERT">
2326
<sequenceNumber value="+1"/>
2427
<pertinentAnnotation classCode="OBS" moodCode="EVN">

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.mockito.Mock;
3030
import org.mockito.junit.jupiter.MockitoExtension;
3131

32+
import org.springframework.util.StringUtils;
3233
import uk.nhs.adaptors.gp2gp.common.service.ConfidentialityService;
3334
import uk.nhs.adaptors.gp2gp.common.service.FhirParseService;
3435
import uk.nhs.adaptors.gp2gp.common.service.RandomIdGeneratorService;
@@ -248,6 +249,9 @@ public void When_ConfidentialityServiceReturnsConfidentialityCode_Expect_Message
248249
final var message = allergyStructureMapper.mapAllergyIntoleranceToAllergyStructure(allergyIntolerance);
249250

250251
assertThat(message).contains(CONFIDENTIALITY_CODE);
252+
assertThat(StringUtils.countOccurrencesOf(message, CONFIDENTIALITY_CODE))
253+
.withFailMessage("<confidentialityCode /> should appear within both the CompoundStatement and ObservationStatement")
254+
.isEqualTo(2);
251255
}
252256

253257
@Test

0 commit comments

Comments
 (0)