Skip to content

Commit 7c44bc2

Browse files
NIAD-3304: Fix issue with ordering of originalText when mapping to CD XML
* Update `CodeableConceptCdMapper` to create a new coding element for legacy codes, to avoid modifying an element whilst iterating a list.
1 parent c2a8fe5 commit 7c44bc2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,7 @@ private List<Coding> getNonSnomedCodeCodings(CodeableConcept codeableConcept) {
322322
for (Coding coding : nonSnomedCodeCodings) {
323323
var hl7CodeSystem = CodeSystemsUtil.getHl7code(coding.getSystem());
324324
if (!hl7CodeSystem.isEmpty()) {
325-
coding.setSystem(hl7CodeSystem);
326-
nonSnomedCodings.add(coding);
325+
nonSnomedCodings.add(new Coding(hl7CodeSystem, coding.getCode(), coding.getDisplay()));
327326
}
328327
}
329328

0 commit comments

Comments
 (0)