Skip to content

Commit f78bd68

Browse files
* Remove check for resolved clinical status as call to method getOriginalTextForActiveAllergy yields as the fallback method contains the exact same functionality.
1 parent 44d8756 commit f78bd68

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

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

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public class CodeableConceptCdMapper {
3838
private static final String FIXED_ACTUAL_PROBLEM_CODE = "55607006";
3939
private static final String PROBLEM_DISPLAY_NAME = "Problem";
4040
private static final String ACTIVE_CLINICAL_STATUS = "active";
41-
private static final String RESOLVED_CLINICAL_STATUS = "resolved";
4241
private static final String PRESCRIBING_AGENCY_GP_PRACTICE_CODE = "prescribed-at-gp-practice";
4342
private static final String PRESCRIBING_AGENCY_PREVIOUS_PRACTICE_CODE = "prescribed-by-previous-practice";
4443
private static final String PRESCRIBING_AGENCY_ANOTHER_ORGANISATION_CODE = "prescribed-by-another-organisation";
@@ -353,9 +352,6 @@ private Optional<String> findOriginalTextForAllergy(
353352
return Optional.empty();
354353
}
355354

356-
if (RESOLVED_CLINICAL_STATUS.equals(allergyIntoleranceClinicalStatus.toCode())) {
357-
return getOriginalTextForResolvedAllergy(codeableConcept, coding.get());
358-
}
359355
if (ACTIVE_CLINICAL_STATUS.equals(allergyIntoleranceClinicalStatus.toCode())) {
360356
return getOriginalTextForActiveAllergy(coding.get());
361357
}
@@ -381,35 +377,6 @@ private Optional<String> getOriginalTextForActiveAllergy(Coding coding) {
381377
return Optional.empty();
382378
}
383379

384-
private Optional<String> getOriginalTextForResolvedAllergy(CodeableConcept codeableConcept, Coding coding) {
385-
386-
if (codeableConcept.hasText()) {
387-
return Optional.ofNullable(codeableConcept.getText());
388-
}
389-
390-
var extension = retrieveDescriptionExtension(coding);
391-
if (extension.isEmpty()) {
392-
return coding.hasDisplay()
393-
? Optional.ofNullable(coding.getDisplay())
394-
: Optional.empty();
395-
}
396-
397-
Optional<String> originalText = extension
398-
.get()
399-
.getExtension().stream()
400-
.filter(displayExtension -> DESCRIPTION_DISPLAY.equals(displayExtension.getUrl()))
401-
.map(extension1 -> extension1.getValue().toString())
402-
.findFirst();
403-
404-
if (originalText.isPresent()) {
405-
return originalText;
406-
} else if (coding.hasDisplay()) {
407-
return Optional.ofNullable(coding.getDisplay());
408-
}
409-
410-
return Optional.empty();
411-
}
412-
413380
private Optional<String> findDisplayText(Coding coding) {
414381
return Optional.ofNullable(coding.getDisplay());
415382
}

0 commit comments

Comments
 (0)