Skip to content

Commit

Permalink
refactor: rename lookup methods
Browse files Browse the repository at this point in the history
This should remove a detailed description of the
lookup in the method name which is also contained in
the class name.
  • Loading branch information
pcvolkmer committed Aug 12, 2024
1 parent 214dcbc commit e9a4104
Show file tree
Hide file tree
Showing 17 changed files with 42 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class BeurteilungResidualstatusVsLookup {
}
};

public final String lookupBeurteilungResidualstatusDisplay(String code) {
public final 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 lookupAdtSeitenlokalisationDisplay(String code) {
public final 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 lookupFMLokalisationVSDisplay(String code) {
public final 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 lookupGradingDisplay(String code) {
public final 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 lookupJnuDisplay(String code) {
public final 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 lookupOPIntentionVSDisplay(String code) {
public final 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 lookupOPKomplikationVSDisplay(String code) {
public final 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 lookupSYSTTherapieartCSLookupDisplay(List<String> code) {
public final String lookupDisplay(List<String> code) {

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

public final String lookupSYSTTherapieartCSLookupCode(List<String> code) {
public final 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 lookupSideEffectTherapyGradingCode(String code) {
public final String lookupCode(String code) {
return lookup.get(code) != null ? lookup.get(code).get(0) : null;
}

public final String lookupSideEffectTherapyGradingDisplay(String code) {
public final 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 lookupSnomedCode(String AdtCode) {
public final String lookupCode(String AdtCode) {
return lookup.get(AdtCode) != null ? lookup.get(AdtCode).get(0) : null;
}

public final String lookupSnomedDisplay(String AdtCode) {
public final 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 lookupStellungOpDisplay(String code) {
public final 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 lookupSystIntentionDisplay(String code) {
public final 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 lookupTnmCpuPraefixDisplay(String code) {
public final String lookupDisplay(String code) {
return lookup.get(code);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,10 @@ public Bundle mapOnkoResourcesToCondition(

if (adtBodySite != null) {
var adtSeitenlokalisationDisplay =
displayAdtSeitenlokalisationLookup.lookupAdtSeitenlokalisationDisplay(adtBodySite);
var snomedCtSeitenlokalisationCode =
snomedCtSeitenlokalisationLookup.lookupSnomedCode(adtBodySite);
displayAdtSeitenlokalisationLookup.lookupDisplay(adtBodySite);
var snomedCtSeitenlokalisationCode = snomedCtSeitenlokalisationLookup.lookupCode(adtBodySite);
var snomedCtSeitenlokalisationDisplay =
snomedCtSeitenlokalisationLookup.lookupSnomedDisplay(adtBodySite);
snomedCtSeitenlokalisationLookup.lookupDisplay(adtBodySite);

if (adtSeitenlokalisationDisplay != null) {
bodySiteADTCoding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,8 @@ public MedicationStatement createSystemtherapyMedicationStatement(
therapyCategory.addCoding(
new Coding()
.setSystem(fhirProperties.getSystems().getSystTherapieart())
.setCode(displaySystTherapieLookup.lookupSYSTTherapieartCSLookupCode(category))
.setDisplay(
displaySystTherapieLookup.lookupSYSTTherapieartCSLookupDisplay(category)));
.setCode(displaySystTherapieLookup.lookupCode(category))
.setDisplay(displaySystTherapieLookup.lookupDisplay(category)));

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

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

stMedicationStatement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ public Bundle createHistologieAndGradingObservation(
new Coding()
.setSystem(fhirProperties.getSystems().getGradingDktk())
.setCode(grading)
.setDisplay(gradingLookup.lookupGradingDisplay(grading)));
.setDisplay(gradingLookup.lookupDisplay(grading)));

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

bundle = addResourceAsEntryInBundle(bundle, fernMetaObs);

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ public Procedure createOpProcedure(
new Coding()
.setCode(opIntention)
.setSystem(fhirProperties.getSystems().getOpIntention())
.setDisplay(
displayOPIntentionLookup.lookupOPIntentionVSDisplay(opIntention))));
.setDisplay(displayOPIntentionLookup.lookupDisplay(opIntention))));

// Status
opProcedure.setStatus(Procedure.ProcedureStatus.COMPLETED);
Expand All @@ -240,9 +239,7 @@ public Procedure createOpProcedure(
new Coding()
.setSystem(fhirProperties.getSystems().getSystTherapieart())
.setCode("OP")
.setDisplay(
displaySystTherapieLookup.lookupSYSTTherapieartCSLookupDisplay(
List.of("OP")))));
.setDisplay(displaySystTherapieLookup.lookupDisplay(List.of("OP")))));

// Subject
opProcedure.setSubject(
Expand Down Expand Up @@ -286,8 +283,7 @@ public Procedure createOpProcedure(
.setSystem(fhirProperties.getSystems().getLokalBeurtResidualCS())
.setCode(lokalResidualstatus)
.setDisplay(
displayBeurteilungResidualstatusLookup.lookupBeurteilungResidualstatusDisplay(
lokalResidualstatus)));
displayBeurteilungResidualstatusLookup.lookupDisplay(lokalResidualstatus)));
}

if (gesamtResidualstatus != null) {
Expand All @@ -296,8 +292,7 @@ public Procedure createOpProcedure(
.setSystem(fhirProperties.getSystems().getGesamtBeurtResidualCS())
.setCode(gesamtResidualstatus)
.setDisplay(
displayBeurteilungResidualstatusLookup.lookupBeurteilungResidualstatusDisplay(
gesamtResidualstatus)));
displayBeurteilungResidualstatusLookup.lookupDisplay(gesamtResidualstatus)));
}

if (gesamtResidualstatus != null || lokalResidualstatus != null) {
Expand All @@ -315,8 +310,7 @@ public Procedure createOpProcedure(
new Coding()
.setSystem(fhirProperties.getSystems().getOpComplication())
.setCode(complication)
.setDisplay(
displayOPKomplicationLookup.lookupOPKomplikationVSDisplay(complication)));
.setDisplay(displayOPKomplicationLookup.lookupDisplay(complication)));
}
opProcedure.setComplication(List.of(complicationConcept));
}
Expand Down Expand Up @@ -414,7 +408,7 @@ public Procedure createRadiotherapyProcedure(
.setCode(radioTherapy.getST_Stellung_OP())
.setSystem(fhirProperties.getSystems().getSystStellungOP())
.setDisplay(
displayStellungOpLookup.lookupStellungOpDisplay(
displayStellungOpLookup.lookupDisplay(
radioTherapy.getST_Stellung_OP()))));

// check if systIntention is defined in xml, otherwise set "X"
Expand All @@ -431,8 +425,7 @@ public Procedure createRadiotherapyProcedure(
new Coding()
.setCode(systIntention)
.setSystem(fhirProperties.getSystems().getSystIntention())
.setDisplay(
displaySystIntentionLookup.lookupSystIntentionDisplay(systIntention))));
.setDisplay(displaySystIntentionLookup.lookupDisplay(systIntention))));

// Status
if (meldeanlass == Meldeanlass.BEHANDLUNGSENDE) {
Expand All @@ -448,9 +441,7 @@ public Procedure createRadiotherapyProcedure(
new Coding()
.setSystem(fhirProperties.getSystems().getSystTherapieart())
.setCode("ST")
.setDisplay(
displaySystTherapieLookup.lookupSYSTTherapieartCSLookupDisplay(
List.of("ST")))));
.setDisplay(displaySystTherapieLookup.lookupDisplay(List.of("ST")))));

// Subject
stProcedure.setSubject(
Expand Down Expand Up @@ -488,12 +479,8 @@ public Procedure createRadiotherapyProcedure(
if (sideEffectGrading != null && !sideEffectGrading.equals("U")) {
sideEffectsCodeConcept.addCoding(
new Coding()
.setCode(
displaySideEffectGradingLookup.lookupSideEffectTherapyGradingCode(
sideEffectGrading))
.setDisplay(
displaySideEffectGradingLookup.lookupSideEffectTherapyGradingDisplay(
sideEffectGrading))
.setCode(displaySideEffectGradingLookup.lookupCode(sideEffectGrading))
.setDisplay(displaySideEffectGradingLookup.lookupDisplay(sideEffectGrading))
.setSystem(fhirProperties.getSystems().getCtcaeGrading()));
}

Expand Down

0 comments on commit e9a4104

Please sign in to comment.