Skip to content

Commit

Permalink
Merge branch 'master' into refac_extract_address_deceased
Browse files Browse the repository at this point in the history
  • Loading branch information
chgl authored Sep 15, 2024
2 parents 5808780 + abba11e commit afdf6eb
Showing 1 changed file with 35 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,39 +120,9 @@ public Bundle mapOnkoResourcesToCondition(
var conditionCode = new CodeableConcept().addCoding(coding);
onkoCondition.setCode(conditionCode);

var bodySiteADTCoding = new Coding();
var bodySiteSNOMEDCoding = new Coding();

var adtBodySite = primDia.getSeitenlokalisation();

if (adtBodySite != null) {
var adtSeitenlokalisationDisplay =
DisplayAdtSeitenlokalisationLookup.lookupDisplay(adtBodySite);
var snomedCtSeitenlokalisationCode = SnomedCtSeitenlokalisationLookup.lookupCode(adtBodySite);
var snomedCtSeitenlokalisationDisplay =
SnomedCtSeitenlokalisationLookup.lookupDisplay(adtBodySite);

if (adtSeitenlokalisationDisplay != null) {
bodySiteADTCoding
.setSystem(fhirProperties.getSystems().getAdtSeitenlokalisation())
.setCode(adtBodySite)
.setDisplay(adtSeitenlokalisationDisplay);
} else {
LOG.warn("Unmappable body site in oBDS data: {}", adtBodySite);
}

if (snomedCtSeitenlokalisationDisplay != null) {
bodySiteSNOMEDCoding
.setSystem(fhirProperties.getSystems().getSnomed())
.setCode(snomedCtSeitenlokalisationCode)
.setDisplay(snomedCtSeitenlokalisationDisplay);
} else {
LOG.warn("Unmappable snomed body site in oBDS data: {}", adtBodySite);
}

var bodySiteConcept = new CodeableConcept();
bodySiteConcept.addCoding(bodySiteADTCoding).addCoding(bodySiteSNOMEDCoding);
onkoCondition.addBodySite(bodySiteConcept);
onkoCondition.addBodySite(getBodySiteConcept(adtBodySite));
}

onkoCondition.setSubject(
Expand Down Expand Up @@ -229,4 +199,38 @@ public Bundle mapOnkoResourcesToCondition(

return bundle;
}

private CodeableConcept getBodySiteConcept(String adtBodySite) {
var bodySiteADTCoding = new Coding();
var bodySiteSNOMEDCoding = new Coding();

var adtSeitenlokalisationDisplay =
DisplayAdtSeitenlokalisationLookup.lookupDisplay(adtBodySite);
var snomedCtSeitenlokalisationCode = SnomedCtSeitenlokalisationLookup.lookupCode(adtBodySite);
var snomedCtSeitenlokalisationDisplay =
SnomedCtSeitenlokalisationLookup.lookupDisplay(adtBodySite);

if (adtSeitenlokalisationDisplay != null) {
bodySiteADTCoding
.setSystem(fhirProperties.getSystems().getAdtSeitenlokalisation())
.setCode(adtBodySite)
.setDisplay(adtSeitenlokalisationDisplay);
} else {
LOG.warn("Unmappable body site in oBDS data: {}", adtBodySite);
}

if (snomedCtSeitenlokalisationDisplay != null) {
bodySiteSNOMEDCoding
.setSystem(fhirProperties.getSystems().getSnomed())
.setCode(snomedCtSeitenlokalisationCode)
.setDisplay(snomedCtSeitenlokalisationDisplay);
} else {
LOG.warn("Unmappable snomed body site in oBDS data: {}", adtBodySite);
}

var bodySiteConcept = new CodeableConcept();
bodySiteConcept.addCoding(bodySiteADTCoding).addCoding(bodySiteSNOMEDCoding);

return bodySiteConcept;
}
}

0 comments on commit afdf6eb

Please sign in to comment.