Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use static lookup methods #69

Merged
merged 2 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class BeurteilungResidualstatusVsLookup {
}
};

public final String lookupDisplay(String code) {
public static String lookupDisplay(String code) {
return lookup.get(code);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class DisplayAdtSeitenlokalisationLookup {
}
};

public final String lookupDisplay(String code) {
public static String lookupDisplay(String code) {
return lookup.get(code);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class FMLokalisationVsLookup {
}
};

public final String lookupDisplay(String code) {
public static String lookupDisplay(String code) {
return lookup.get(code);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class GradingLookup {
}
};

public final String lookupDisplay(String code) {
public static String lookupDisplay(String code) {
return lookup.get(code);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class JnuVsLookup {
}
};

public final String lookupDisplay(String code) {
public static String lookupDisplay(String code) {
return lookup.get(code);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class OPIntentionVsLookup {
}
};

public final String lookupDisplay(String code) {
public static String lookupDisplay(String code) {
return lookup.get(code);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public class OPKomplikationVsLookup {
}
};

public final String lookupDisplay(String code) {
public static String lookupDisplay(String code) {
return lookup.get(code);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class SYSTTherapieartCSLookup {
}
};

public final String lookupDisplay(List<String> code) {
public static String lookupDisplay(List<String> code) {

if (code.size() == 1) {
return lookup.get(code.get(0));
Expand All @@ -50,7 +50,7 @@ public final String lookupDisplay(List<String> code) {
}
}

public final String lookupCode(List<String> code) {
public static String lookupCode(List<String> code) {

if (code.size() == 1) {
return code.get(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ public class SideEffectTherapyGradingLookup {
}
};

public final String lookupCode(String code) {
public static String lookupCode(String code) {
return lookup.get(code) != null ? lookup.get(code).get(0) : null;
}

public final String lookupDisplay(String code) {
public static String lookupDisplay(String code) {
return lookup.get(code) != null ? lookup.get(code).get(1) : null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ public class SnomedCtSeitenlokalisationLookup {
}
};

public final String lookupCode(String AdtCode) {
public static String lookupCode(String AdtCode) {
return lookup.get(AdtCode) != null ? lookup.get(AdtCode).get(0) : null;
}

public final String lookupDisplay(String AdtCode) {
public static String lookupDisplay(String AdtCode) {
return lookup.get(AdtCode) != null ? lookup.get(AdtCode).get(1) : null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class StellungOpVsLookup {
}
};

public final String lookupDisplay(String code) {
public static String lookupDisplay(String code) {
return lookup.get(code);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class SystIntentionVsLookup {
}
};

public final String lookupDisplay(String code) {
public static String lookupDisplay(String code) {
return lookup.get(code);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class TnmCpuPraefixTvsLookup {
}
};

public final String lookupDisplay(String code) {
public static String lookupDisplay(String code) {
return lookup.get(code);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ public class ObdsConditionMapper extends ObdsToFhirMapper {
@Value("${app.enableCheckDigitConv}")
private boolean checkDigitConversion;

private final SnomedCtSeitenlokalisationLookup snomedCtSeitenlokalisationLookup =
new SnomedCtSeitenlokalisationLookup();

private final DisplayAdtSeitenlokalisationLookup displayAdtSeitenlokalisationLookup =
new DisplayAdtSeitenlokalisationLookup();

@Autowired
public ObdsConditionMapper(FhirProperties fhirProperties) {
super(fhirProperties);
Expand Down Expand Up @@ -133,10 +127,10 @@ public Bundle mapOnkoResourcesToCondition(

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

if (adtSeitenlokalisationDisplay != null) {
bodySiteADTCoding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ public class ObdsMedicationStatementMapper extends ObdsToFhirMapper {
@Value("${app.enableCheckDigitConv}")
private boolean checkDigitConversion;

private final StellungOpVsLookup displayStellungOpLookup = new StellungOpVsLookup();

private final SystIntentionVsLookup displaySystIntentionLookup = new SystIntentionVsLookup();

private final SYSTTherapieartCSLookup displaySystTherapieLookup = new SYSTTherapieartCSLookup();

public ObdsMedicationStatementMapper(FhirProperties fhirProperties) {
super(fhirProperties);
}
Expand Down Expand Up @@ -193,8 +187,8 @@ public MedicationStatement createSystemtherapyMedicationStatement(
therapyCategory.addCoding(
new Coding()
.setSystem(fhirProperties.getSystems().getSystTherapieart())
.setCode(displaySystTherapieLookup.lookupCode(category))
.setDisplay(displaySystTherapieLookup.lookupDisplay(category)));
.setCode(SYSTTherapieartCSLookup.lookupCode(category))
.setDisplay(SYSTTherapieartCSLookup.lookupDisplay(category)));

if (systemTherapy.getSYST_Therapieart_Anmerkung() != null) {
therapyCategory.setText(systemTherapy.getSYST_Therapieart_Anmerkung());
Expand All @@ -218,7 +212,7 @@ public MedicationStatement createSystemtherapyMedicationStatement(
.setCode(systemTherapy.getSYST_Stellung_OP())
.setSystem(fhirProperties.getSystems().getSystStellungOP())
.setDisplay(
displayStellungOpLookup.lookupDisplay(
StellungOpVsLookup.lookupDisplay(
systemTherapy.getSYST_Stellung_OP()))));

stMedicationStatement
Expand All @@ -231,7 +225,7 @@ public MedicationStatement createSystemtherapyMedicationStatement(
.setCode(systemTherapy.getSYST_Intention())
.setSystem(fhirProperties.getSystems().getSystIntention())
.setDisplay(
displaySystIntentionLookup.lookupDisplay(
SystIntentionVsLookup.lookupDisplay(
systemTherapy.getSYST_Intention()))));

stMedicationStatement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@ public static record ModulProstataMappingParams(

private static final Logger LOG = LoggerFactory.getLogger(ObdsObservationMapper.class);

private final GradingLookup gradingLookup = new GradingLookup();

private final TnmCpuPraefixTvsLookup tnmPraefixLookup = new TnmCpuPraefixTvsLookup();

private final FMLokalisationVsLookup fmLokalisationVSLookup = new FMLokalisationVsLookup();

private final JnuVsLookup jnuVsLookup = new JnuVsLookup();

@Value("${app.version}")
private String appVersion;

Expand Down Expand Up @@ -498,7 +490,7 @@ public Bundle createHistologieAndGradingObservation(
new Coding()
.setSystem(fhirProperties.getSystems().getGradingDktk())
.setCode(grading)
.setDisplay(gradingLookup.lookupDisplay(grading)));
.setDisplay(GradingLookup.lookupDisplay(grading)));

gradingObs.setValue(gradingValueCodeableCon);
}
Expand Down Expand Up @@ -644,7 +636,7 @@ public Bundle createFernMetaObservation(
new Coding()
.setSystem(fhirProperties.getSystems().getFMLokalisationCS())
.setCode(fernMetaLokal)
.setDisplay(fmLokalisationVSLookup.lookupDisplay(fernMetaLokal))));
.setDisplay(FMLokalisationVsLookup.lookupDisplay(fernMetaLokal))));

bundle = addResourceAsEntryInBundle(bundle, fernMetaObs);

Expand Down Expand Up @@ -734,7 +726,7 @@ public Bundle createCTnmObservation(
backBoneComponentListC.add(
createTNMComponentElement(
cTnmCpuPraefixT,
tnmPraefixLookup.lookupDisplay(cTnmCpuPraefixT),
TnmCpuPraefixTvsLookup.lookupDisplay(cTnmCpuPraefixT),
"21905-5",
"Primary tumor.clinical Cancer",
fhirProperties.getSystems().getTnmTCs(),
Expand All @@ -747,7 +739,7 @@ public Bundle createCTnmObservation(
backBoneComponentListC.add(
createTNMComponentElement(
cTnmCpuPraefixN,
tnmPraefixLookup.lookupDisplay(cTnmCpuPraefixN),
TnmCpuPraefixTvsLookup.lookupDisplay(cTnmCpuPraefixN),
"21906-3",
"Regional lymph nodes.clinical",
fhirProperties.getSystems().getTnmNCs(),
Expand All @@ -760,7 +752,7 @@ public Bundle createCTnmObservation(
backBoneComponentListC.add(
createTNMComponentElement(
cTnmCpuPraefixM,
tnmPraefixLookup.lookupDisplay(cTnmCpuPraefixM),
TnmCpuPraefixTvsLookup.lookupDisplay(cTnmCpuPraefixM),
"21907-1",
"Distant metastases.clinical [Class] Cancer",
fhirProperties.getSystems().getTnmMCs(),
Expand Down Expand Up @@ -894,7 +886,7 @@ public Bundle createPTnmObservation(
backBoneComponentListP.add(
createTNMComponentElement(
pTnmCpuPraefixT,
tnmPraefixLookup.lookupDisplay(pTnmCpuPraefixT),
TnmCpuPraefixTvsLookup.lookupDisplay(pTnmCpuPraefixT),
"21899-0",
"Primary tumor.pathology Cancer",
fhirProperties.getSystems().getTnmTCs(),
Expand All @@ -907,7 +899,7 @@ public Bundle createPTnmObservation(
backBoneComponentListP.add(
createTNMComponentElement(
pTnmCpuPraefixN,
tnmPraefixLookup.lookupDisplay(pTnmCpuPraefixN),
TnmCpuPraefixTvsLookup.lookupDisplay(pTnmCpuPraefixN),
"21900-6",
"Regional lymph nodes.pathology",
fhirProperties.getSystems().getTnmNCs(),
Expand All @@ -920,7 +912,7 @@ public Bundle createPTnmObservation(
backBoneComponentListP.add(
createTNMComponentElement(
pTnmCpuPraefixM,
tnmPraefixLookup.lookupDisplay(pTnmCpuPraefixM),
TnmCpuPraefixTvsLookup.lookupDisplay(pTnmCpuPraefixM),
"21901-4",
"Distant metastases.pathology [Class] Cancer",
fhirProperties.getSystems().getTnmMCs(),
Expand Down Expand Up @@ -1063,7 +1055,7 @@ public Bundle createDeathObservation(
new Coding()
.setSystem(fhirProperties.getSystems().getJnuCs())
.setCode(death.getTod_tumorbedingt())
.setDisplay(jnuVsLookup.lookupDisplay(death.getTod_tumorbedingt()));
.setDisplay(JnuVsLookup.lookupDisplay(death.getTod_tumorbedingt()));
deathValueCodeConcept.addCoding(deathByTumorCoding);
}

Expand Down
Loading
Loading