Skip to content

Commit 6c8b4a9

Browse files
committed
ALso break Encounters!
1 parent 811c99a commit 6c8b4a9

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.io.BufferedReader;
66
import java.io.InputStream;
77
import java.io.InputStreamReader;
8+
import java.math.BigDecimal;
89
import java.util.Optional;
910
import java.util.Set;
1011
import java.util.stream.Collectors;
@@ -71,12 +72,17 @@ public String mapEncounterToEhrComposition(Encounter encounter) {
7172
.code(buildCode(encounter))
7273
.displayName(buildDisplayName(encounter))
7374
.originalText(buildOriginalText(encounter))
74-
.locationName(buildLocationPertinentInformation(encounter));
75+
.locationName(buildLocationPertinentInformation(encounter))
76+
.removeTheAuthor("Don't do it!");
7577

7678
final Optional<String> recReference = findParticipantWithCoding(encounter, ParticipantCoding.RECORDER)
7779
.map(agentDirectory::getAgentId);
7880
recReference.map(encounterStatementTemplateParameters::author);
7981

82+
if (encounter.hasLength() && new BigDecimal("420").equals(encounter.getLength().getValue())) {
83+
encounterStatementTemplateParameters.removeTheAuthor("");
84+
}
85+
8086
messageContext.getInputBundleHolder()
8187
.getListReferencedToEncounter(encounter.getIdElement(), CONSULTATION_LIST_CODE)
8288
.filter(ListResource::hasDate)

service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/parameters/EncounterTemplateParameters.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ public class EncounterTemplateParameters {
2121
private String participant2;
2222
private String author;
2323
private String locationName;
24+
private String removeTheAuthor;
2425
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@
1414
{{{effectiveTime}}}
1515
</effectiveTime>
1616
{{{availabilityTime}}}
17+
{{#removeTheAuthor}}
1718
<author typeCode="AUT" contextControlCode="OP">
1819
<time {{#authorTime}}value="{{authorTime}}"{{/authorTime}}{{^authorTime}}nullFlavor="UNK"{{/authorTime}} />
1920
<agentRef classCode="AGNT">
2021
{{#author}}<id root="{{author}}" />{{/author}}{{^author}}<id nullFlavor="UNK" />{{/author}}
2122
</agentRef>
2223
</author>
24+
{{/removeTheAuthor}}
2325
{{#locationName}}
2426
<location typeCode="LOC">
2527
<locatedEntity classCode="LOCE">

wiremock/stubs/__files/correctPatientStructuredRecordLargePayload.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7646,7 +7646,7 @@
76467646
},
76477647
"length":
76487648
{
7649-
"value": 8,
7649+
"value": 420,
76507650
"unit": "m",
76517651
"system": "http://unitsofmeasure.org",
76527652
"code": "min"

0 commit comments

Comments
 (0)