Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #237 from ehrbase/refactoring_#204
Browse files Browse the repository at this point in the history
Refactoring #204
  • Loading branch information
SevKohler authored Feb 23, 2021
2 parents 5e8e55c + 4f258fb commit c53182c
Show file tree
Hide file tree
Showing 16 changed files with 1,111 additions and 865 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package org.ehrbase.fhirbridge.ehr.converter;

import org.ehrbase.fhirbridge.camel.component.ehr.composition.CompositionConverter;
import org.ehrbase.fhirbridge.ehr.converter.clinicalFrailty.ClinicalFrailtyScaleScoreCompositionConverter;
import org.ehrbase.fhirbridge.ehr.converter.radiologischerBefund.RadiologischerBefundConverter;
import org.ehrbase.fhirbridge.ehr.converter.bloodgas.BloodGasPanelCompositionConverter;
import org.ehrbase.fhirbridge.ehr.converter.sofascore.SofaScoreCompositionConverter;
import org.ehrbase.fhirbridge.fhir.common.Profile;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.ehrbase.fhirbridge.ehr.converter;

public enum TerminologyIdCode {

LOCAL("local");

private final String terminologyId;

TerminologyIdCode(String terminologyId){
this.terminologyId = terminologyId;
}

public String getTerminologyId(){
return terminologyId;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
import java.util.Optional;

public class BloodGasPanel {
private static final String pHUrl = "https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/pH";
private static final String carbonDioxidePartialPressureUrl = "https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/carbon-dioxide-partial-pressure";
private static final String oxygenPartialPressureUrl = "https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/oxygen-partial-pressure";
private static final String oxygenSaturationUrl = "https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/oxygen-saturation";

private Optional<Observation> bloodGasPanel = Optional.empty();
private Optional<Observation> pH = Optional.empty();
Expand All @@ -36,21 +32,16 @@ private void setObservations(Observation observation) {
private void setProfiles(Resource resource) {
try {
String profileUrl = resource.getMeta().getProfile().get(0).getValue();
switch (profileUrl) {
case pHUrl:
this.pH = Optional.of((Observation) resource);
break;
case carbonDioxidePartialPressureUrl:
this.carbonDioxidePartialPressure = Optional.of((Observation) resource);
break;
case oxygenPartialPressureUrl:
this.oxygenPartialPressure = Optional.of((Observation) resource);
break;
case oxygenSaturationUrl:
this.oxygenSaturation = Optional.of((Observation) resource);
break;
default:
throw new UnprocessableEntityException("Blood gas panel bundle needs to contain only the profiles for the blood gas panel. Please delete profile " + profileUrl + " from the Bundle.");
if (BloogGasProfileUrl.PH.getUrl().equals(profileUrl)) {
this.pH = Optional.of((Observation) resource);
} else if (BloogGasProfileUrl.CARBONDIOXIDE_PARTIAL_PRESSURE.getUrl().equals(profileUrl)) {
this.carbonDioxidePartialPressure = Optional.of((Observation) resource);
} else if (BloogGasProfileUrl.OXYGENPARTIAL_PRESSURE.getUrl().equals(profileUrl)) {
this.oxygenPartialPressure = Optional.of((Observation) resource);
} else if (BloogGasProfileUrl.OXYGEN_SATURATION.getUrl().equals(profileUrl)) {
this.oxygenSaturation = Optional.of((Observation) resource);
} else {
throw new UnprocessableEntityException("Blood gas panel bundle needs to contain only the profiles for the blood gas panel. Please delete profile " + profileUrl + " from the Bundle.");
}

} catch (IndexOutOfBoundsException e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.ehrbase.fhirbridge.ehr.converter.bloodgas;

public enum BloogGasProfileUrl {
PH("https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/pH"),
CARBONDIOXIDE_PARTIAL_PRESSURE("https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/carbon-dioxide-partial-pressure"),
OXYGENPARTIAL_PRESSURE("https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/oxygen-partial-pressure"),
OXYGEN_SATURATION("https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/oxygen-saturation");

private final String url;

BloogGasProfileUrl(String url) {
this.url = url;
}

public String getUrl() {
return url;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package org.ehrbase.fhirbridge.ehr.converter.clinicalFrailty;

import com.nedap.archie.rm.datatypes.CodePhrase;
import com.nedap.archie.rm.datavalues.DvCodedText;
import com.nedap.archie.rm.datavalues.quantity.DvOrdinal;
import com.nedap.archie.rm.support.identification.TerminologyId;
import org.ehrbase.fhirbridge.ehr.converter.TerminologyIdCode;

public enum ClinicalFrailtyBerurteilung {

SEHR_FIT(new DvOrdinal(1L,
new DvCodedText("1", new CodePhrase(new TerminologyId(TerminologyIdCode.LOCAL.getTerminologyId()), "at0005")))),
DURCHSCHNITTLICH_AKTIV(new DvOrdinal(2L,
new DvCodedText("2", new CodePhrase(new TerminologyId(TerminologyIdCode.LOCAL.getTerminologyId()), "at0006")))),
GUT_ZURECHTKOMMEND(new DvOrdinal(3L,
new DvCodedText("3", new CodePhrase(new TerminologyId(TerminologyIdCode.LOCAL.getTerminologyId()), "at0007")))),
VULNERABEL(new DvOrdinal(4L,
new DvCodedText("4", new CodePhrase(new TerminologyId(TerminologyIdCode.LOCAL.getTerminologyId()), "at0008")))),
GERINGGRADIG_FRAIL(new DvOrdinal(5L,
new DvCodedText("5", new CodePhrase(new TerminologyId(TerminologyIdCode.LOCAL.getTerminologyId()), "at0009")))),
MITTELGRADIG_FRAIL(new DvOrdinal(6L,
new DvCodedText("6", new CodePhrase(new TerminologyId(TerminologyIdCode.LOCAL.getTerminologyId()), "at0010")))),
AUSGEPRAEGT_FRAIL(new DvOrdinal(7L,
new DvCodedText("7", new CodePhrase(new TerminologyId(TerminologyIdCode.LOCAL.getTerminologyId()), "at0011")))),
EXTREM_FRAIL(new DvOrdinal(8L,
new DvCodedText("8", new CodePhrase(new TerminologyId(TerminologyIdCode.LOCAL.getTerminologyId()), "at0012")))),
TERMINAL_ERKRANKT(new DvOrdinal(9L,
new DvCodedText("9", new CodePhrase(new TerminologyId(TerminologyIdCode.LOCAL.getTerminologyId()), "at0013"))));

private final DvOrdinal berurteilung;

ClinicalFrailtyBerurteilung(DvOrdinal berurteilung) {
this.berurteilung = berurteilung;
}

public DvOrdinal getBerurteilung() {
return berurteilung;
}
}
Loading

0 comments on commit c53182c

Please sign in to comment.