Skip to content

Commit

Permalink
validation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
BoehmDo committed Nov 26, 2024
1 parent 747a0d9 commit c6535a2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import de.basisdatensatz.obds.v3.AllgemeinICDTyp;
import de.basisdatensatz.obds.v3.OBDS;
import java.util.Arrays;
import java.util.Objects;
import java.util.regex.Pattern;
import org.apache.commons.lang3.Validate;
Expand Down Expand Up @@ -47,16 +48,17 @@ public Observation map(

var observation = new Observation();
observation.getMeta().addProfile(fhirProperties.getProfiles().getMiiPrOnkoTod());
observation.setStatus(Observation.ObservationStatus.FINAL);

// Observation Code
// Code | 184305005 | Cause of death (observable entity)
var snomedCode = new CodeableConcept();
snomedCode.addCoding().setSystem(fhirProperties.getSystems().getSnomed()).setCode("184305005");
observation.setCode(snomedCode);

// Subject
observation.setSubject(patient);

// Effective | Todesdatum
// Effective | Sterbedatum
var todesZeitpunkt = convertObdsDatumToDateTimeType(meldung.getTod().getSterbedatum());
if (todesZeitpunkt.isPresent()) {
observation.setEffective(todesZeitpunkt.get());
Expand All @@ -69,7 +71,7 @@ public Observation map(
observation.setFocus(focusList);
*/

// Value | Todesursache ICD10GM
// Value | Todesursache(n) ICD10GM
if (meldung.getTod().getMengeTodesursachen() != null) {
var todesursacheConcept = new CodeableConcept();
for (AllgemeinICDTyp todesursache :
Expand All @@ -78,22 +80,19 @@ public Observation map(
.addCoding()
.setSystem(fhirProperties.getSystems().getIcd10gm())
.setCode(todesursache.getCode())
.setDisplay(todesursache.getCode())
.setVersion(todesursache.getVersion());
}
observation.setValue(todesursacheConcept);
}

// Interpretation
// ToDo get display from system
// Interpretation | Tod Tumorbedingt
if (meldung.getTod().getTodTumorbedingt() != null) {
var interpretation = new CodeableConcept();
interpretation
.addCoding()
.setSystem(fhirProperties.getSystems().getMiiCsOnkoTodInterpretation())
.setCode(meldung.getTod().getTodTumorbedingt().value())
.setDisplay(meldung.getTod().getTodTumorbedingt().value());
observation.setCode(interpretation);
.setCode(meldung.getTod().getTodTumorbedingt().value());
observation.setInterpretation(Arrays.asList(interpretation));
}

return observation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"meta": {
"profile": [ "https://www.medizininformatik-initiative.de/fhir/ext/modul-onko/StructureDefinition/mii-pr-onko-tod" ]
},
"status": "final",
"code": {
"coding": [ {
"system": "https://www.medizininformatik-initiative.de/fhir/ext/modul-onko/CodeSystem/mii-cs-onko-tod",
"code": "J",
"display": "J"
"system": "http://snomed.info/sct",
"code": "184305005"
} ]
},
"subject": {
Expand All @@ -18,13 +18,17 @@
"coding": [ {
"system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
"version": "10 2020 GM",
"code": "C50.9",
"display": "C50.9"
"code": "C50.9"
}, {
"system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm",
"version": "10 2020 GM",
"code": "T57.3",
"display": "T57.3"
"code": "T57.3"
} ]
},
"interpretation": [ {
"coding": [ {
"system": "https://www.medizininformatik-initiative.de/fhir/ext/modul-onko/CodeSystem/mii-cs-onko-tod",
"code": "J"
} ]
}
} ]
}

0 comments on commit c6535a2

Please sign in to comment.