File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -273,6 +273,21 @@ void When_MappingTestResult_With_NopatMetaSecurity_Expect_ConfidentialityCodeWit
273273 assertThatXml (actualXml ).containsXPath (OBSERVATION_STATEMENT_CONFIDENTIALITY_CODE_XPATH );
274274 }
275275
276+ @ Test
277+ void When_ObservationDoesNotContainNotPresentElements_Expect_MappedObservetionNotContainAggregateComments () {
278+ final Observation observation = getObservationResourceFromJson (OBSERVATION_TEST_RESULT_JSON );
279+
280+ ConfidentialityCodeUtility .appendNopatSecurityToMetaForResource (observation );
281+ when (confidentialityService .generateConfidentialityCode (observation ))
282+ .thenReturn (Optional .of (NOPAT_HL7_CONFIDENTIALITY_CODE ));
283+
284+ final String actualXml = observationMapper .mapObservationToCompoundStatement (observation );
285+
286+ String expression = "/component/NarrativeStatement/text[contains(normalize-space(.), 'AGGREGATE COMMENT SET')]" ;
287+
288+ assertThatXml (actualXml ).doesNotContainXPath (expression );
289+ }
290+
276291 @ Test
277292 void When_MappingTestResult_With_NoscrubMetaSecurity_Expect_ConfidentialityCodeNotPresent () {
278293 final Observation observation = getObservationResourceFromJson (OBSERVATION_TEST_RESULT_JSON );
You can’t perform that action at this time.
0 commit comments