File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 11package uk .nhs .adaptors .gp2gp .ehr .mapper ;
22
3+ import java .util .ArrayList ;
34import java .util .Collections ;
45import java .util .List ;
56import java .util .Optional ;
@@ -314,15 +315,18 @@ private List<Coding> getNonSnomedCodeCodings(CodeableConcept codeableConcept) {
314315 var nonSnomedCodeCodings = codeableConcept .getCoding ()
315316 .stream ()
316317 .filter (coding -> !isSnomed (coding ))
317- .filter (coding -> !CodeSystemsUtil .getHl7code (coding .getSystem ()).isEmpty ())
318318 .toList ();
319319
320+ List <Coding > nonSnomedCodes = new ArrayList <>();
321+
320322 for (Coding coding : nonSnomedCodeCodings ) {
321323 var hl7CodeSystem = CodeSystemsUtil .getHl7code (coding .getSystem ());
322- coding .setSystem (hl7CodeSystem );
324+ if (!hl7CodeSystem .isEmpty ()) {
325+ nonSnomedCodes .add (new Coding (hl7CodeSystem , coding .getCode (), coding .getDisplay ()));
326+ }
323327 }
324328
325- return nonSnomedCodeCodings ;
329+ return nonSnomedCodes ;
326330 }
327331
328332 private Optional <String > findOriginalText (CodeableConcept codeableConcept , Optional <Coding > coding ) {
You can’t perform that action at this time.
0 commit comments