Skip to content

Commit 6d138dd

Browse files
committed
init changes
1 parent a6017f5 commit 6d138dd

File tree

5 files changed

+17
-16
lines changed

5 files changed

+17
-16
lines changed

service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/DiagnosticReportMapper.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
public class DiagnosticReportMapper {
5454

5555
public static final String NOT_PRESENT_SPECIMEN_ID_PREFIX = "NOT-PRESENT-SPECIMEN-";
56-
public static final String DUMMY_OBSERVATION_ID_PREFIX = "DUMMY-OBSERVATION-";
56+
public static final String NOT_PRESENT_OBSERVATION_ID_PREFIX = "NOT-PRESENT-OBSERVATION-";
5757

5858
private static final Mustache DIAGNOSTIC_REPORT_COMPOUND_STATEMENT_TEMPLATE =
5959
TemplateUtils.loadTemplate("diagnostic_report_compound_statement_template.mustache");
@@ -230,10 +230,10 @@ private List<Observation> addDummyObservationsToObservationList(
230230

231231
// Generate a dummy Observation for each Specimen without an Observation
232232
for (String specimenWithoutObservations : getSpecimenIdsWithoutObservation(specimens, observations)) {
233-
Observation dummyObservation = generateDummyObservation(diagnosticReport);
233+
Observation notPresentObservation = generateNotPresentObservation(diagnosticReport);
234234
Reference specimenReference = new Reference(specimenWithoutObservations);
235-
dummyObservation.setSpecimen(specimenReference);
236-
completeObservations.add(dummyObservation);
235+
notPresentObservation.setSpecimen(specimenReference);
236+
completeObservations.add(notPresentObservation);
237237
}
238238

239239
return completeObservations;
@@ -264,10 +264,10 @@ private List<String> getSpecimenIdsWithoutObservation(List<Specimen> specimens,
264264
return specimensWithoutObservations;
265265
}
266266

267-
private Observation generateDummyObservation(DiagnosticReport diagnosticReport) {
267+
private Observation generateNotPresentObservation(DiagnosticReport diagnosticReport) {
268268
Observation observation = new Observation();
269269

270-
observation.setId(DUMMY_OBSERVATION_ID_PREFIX + randomIdGeneratorService.createNewId());
270+
observation.setId(NOT_PRESENT_OBSERVATION_ID_PREFIX + randomIdGeneratorService.createNewId());
271271

272272
return observation
273273
.setIssuedElement(diagnosticReport.getIssuedElement())

service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/diagnosticreport/ObservationMapper.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package uk.nhs.adaptors.gp2gp.ehr.mapper.diagnosticreport;
22

3-
import static uk.nhs.adaptors.gp2gp.ehr.mapper.diagnosticreport.DiagnosticReportMapper.DUMMY_OBSERVATION_ID_PREFIX;
43

54
import java.util.List;
65
import java.util.Objects;
@@ -46,6 +45,8 @@
4645
import uk.nhs.adaptors.gp2gp.ehr.utils.StatementTimeMappingUtils;
4746
import uk.nhs.adaptors.gp2gp.ehr.utils.TemplateUtils;
4847

48+
import static uk.nhs.adaptors.gp2gp.ehr.mapper.diagnosticreport.DiagnosticReportMapper.NOT_PRESENT_OBSERVATION_ID_PREFIX;
49+
4950
@Component
5051
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
5152
@Slf4j
@@ -240,7 +241,7 @@ private String mapObservationToObservationStatement(MultiStatementObservationHol
240241
private Optional<String> prepareNarrativeStatements(MultiStatementObservationHolder holder, boolean interpretationCodeMapped) {
241242
Observation observation = holder.getObservation();
242243

243-
if (observation.getIdElement().getIdPart().contains(DUMMY_OBSERVATION_ID_PREFIX)) {
244+
if (observation.getIdElement().getIdPart().contains(NOT_PRESENT_OBSERVATION_ID_PREFIX)) {
244245
return Optional.of(
245246
mapObservationToNarrativeStatement(holder, observation.getComment(), CommentType.AGGREGATE_COMMENT_SET.getCode())
246247
);

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ void When_DiagnosticReport_Has_MultipleSpecimensAndOneObservation_Expect_ADummyO
412412

413413
assertThat(actualXml).containsIgnoringWhitespaces(
414414
"<!-- Mapped Specimen with id: Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1 "
415-
+ "with linked Observations: DUMMY-OBSERVATION-5E496953-065B-41F2-9577-BE8F2FBD0757-->");
415+
+ "with linked Observations: NOT-PRESENT-OBSERVATION-5E496953-065B-41F2-9577-BE8F2FBD0757-->");
416416

417417
}
418418

@@ -438,11 +438,11 @@ void When_DiagnosticReport_Has_ThreeSpecimensAndOneObservation_Expect_DummyObser
438438

439439
assertThat(actualXml).containsIgnoringWhitespaces(
440440
"<!-- Mapped Specimen with id: Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1 "
441-
+ "with linked Observations: DUMMY-OBSERVATION-5E496953-065B-41F2-9577-BE8F2FBD0757-->");
441+
+ "with linked Observations: NOT-PRESENT-OBSERVATION-5E496953-065B-41F2-9577-BE8F2FBD0757-->");
442442

443443
assertThat(actualXml).containsIgnoringWhitespaces(
444444
"<!-- Mapped Specimen with id: Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2 "
445-
+ "with linked Observations: DUMMY-OBSERVATION-5E496953-065B-41F2-9577-BE8F2FBD0757-->");
445+
+ "with linked Observations: NOT-PRESENT-OBSERVATION-5E496953-065B-41F2-9577-BE8F2FBD0757-->");
446446
}
447447

448448
/**
@@ -472,7 +472,7 @@ void When_DiagnosticReport_Has_TwoLinkedSpecimensOneUnlinkedSpecimenAndOneObserv
472472

473473
assertThat(actualXml).containsIgnoringWhitespaces(
474474
"<!-- Mapped Specimen with id: Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2 "
475-
+ "with linked Observations: DUMMY-OBSERVATION-5E496953-065B-41F2-9577-BE8F2FBD0757-->");
475+
+ "with linked Observations: NOT-PRESENT-OBSERVATION-5E496953-065B-41F2-9577-BE8F2FBD0757-->");
476476
}
477477

478478
@Test

service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-multi-specimens.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Status: unknown</text>
2020
<availabilityTime value="20100225154100"/>
2121
</NarrativeStatement>
2222
</component>
23-
<!-- Mapped Specimen with id: Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0 with linked Observations: DUMMY-OBSERVATION-5E496953-065B-41F2-9577-BE8F2FBD0757-->
24-
<!-- Mapped Specimen with id: Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1 with linked Observations: DUMMY-OBSERVATION-5E496953-065B-41F2-9577-BE8F2FBD0757-->
25-
<!-- Mapped Specimen with id: Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2 with linked Observations: DUMMY-OBSERVATION-5E496953-065B-41F2-9577-BE8F2FBD0757-->
23+
<!-- Mapped Specimen with id: Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0 with linked Observations: NOT-PRESENT-OBSERVATION-5E496953-065B-41F2-9577-BE8F2FBD0757-->
24+
<!-- Mapped Specimen with id: Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-1 with linked Observations: NOT-PRESENT-OBSERVATION-5E496953-065B-41F2-9577-BE8F2FBD0757-->
25+
<!-- Mapped Specimen with id: Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-2 with linked Observations: NOT-PRESENT-OBSERVATION-5E496953-065B-41F2-9577-BE8F2FBD0757-->
2626
</CompoundStatement>
2727
</component>

service/src/test/resources/ehr/mapper/diagnosticreport/diagnostic-report-with-one-specimen.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ Status: unknown</text>
2020
<availabilityTime value="20100225154100"/>
2121
</NarrativeStatement>
2222
</component>
23-
<!-- Mapped Specimen with id: Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0 with linked Observations: DUMMY-OBSERVATION-5E496953-065B-41F2-9577-BE8F2FBD0757-->
23+
<!-- Mapped Specimen with id: Specimen/96B93E28-293D-46E7-B4C2-D477EEBF7098-SPEC-0 with linked Observations: NOT-PRESENT-OBSERVATION-5E496953-065B-41F2-9577-BE8F2FBD0757-->
2424
</CompoundStatement>
2525
</component>

0 commit comments

Comments
 (0)