From e9a4104ab110baf1ecb7e26feb1c9d1e040031d7 Mon Sep 17 00:00:00 2001 From: Paul-Christian Volkmer Date: Mon, 12 Aug 2024 20:55:47 +0200 Subject: [PATCH] refactor: rename lookup methods This should remove a detailed description of the lookup in the method name which is also contained in the class name. --- .../BeurteilungResidualstatusVsLookup.java | 2 +- .../DisplayAdtSeitenlokalisationLookup.java | 2 +- .../lookup/FMLokalisationVsLookup.java | 2 +- .../ume/obdstofhir/lookup/GradingLookup.java | 2 +- .../ume/obdstofhir/lookup/JnuVsLookup.java | 2 +- .../lookup/OPIntentionVsLookup.java | 2 +- .../lookup/OPKomplikationVsLookup.java | 2 +- .../lookup/SYSTTherapieartCSLookup.java | 4 +-- .../SideEffectTherapyGradingLookup.java | 4 +-- .../SnomedCtSeitenlokalisationLookup.java | 4 +-- .../obdstofhir/lookup/StellungOpVsLookup.java | 2 +- .../lookup/SystIntentionVsLookup.java | 2 +- .../lookup/TnmCpuPraefixTvsLookup.java | 2 +- .../mapper/ObdsConditionMapper.java | 7 ++-- .../mapper/ObdsMedicationStatementMapper.java | 9 +++-- .../mapper/ObdsObservationMapper.java | 18 +++++----- .../mapper/ObdsProcedureMapper.java | 33 ++++++------------- 17 files changed, 42 insertions(+), 57 deletions(-) diff --git a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/BeurteilungResidualstatusVsLookup.java b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/BeurteilungResidualstatusVsLookup.java index a83ffdb7..00c027ef 100644 --- a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/BeurteilungResidualstatusVsLookup.java +++ b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/BeurteilungResidualstatusVsLookup.java @@ -16,7 +16,7 @@ public class BeurteilungResidualstatusVsLookup { } }; - public final String lookupBeurteilungResidualstatusDisplay(String code) { + public final String lookupDisplay(String code) { return lookup.get(code); } } diff --git a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/DisplayAdtSeitenlokalisationLookup.java b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/DisplayAdtSeitenlokalisationLookup.java index 7f1b9641..a5fb1f14 100644 --- a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/DisplayAdtSeitenlokalisationLookup.java +++ b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/DisplayAdtSeitenlokalisationLookup.java @@ -17,7 +17,7 @@ public class DisplayAdtSeitenlokalisationLookup { } }; - public final String lookupAdtSeitenlokalisationDisplay(String code) { + public final String lookupDisplay(String code) { return lookup.get(code); } } diff --git a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/FMLokalisationVsLookup.java b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/FMLokalisationVsLookup.java index bad48107..4bc81389 100644 --- a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/FMLokalisationVsLookup.java +++ b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/FMLokalisationVsLookup.java @@ -21,7 +21,7 @@ public class FMLokalisationVsLookup { } }; - public final String lookupFMLokalisationVSDisplay(String code) { + public final String lookupDisplay(String code) { return lookup.get(code); } } diff --git a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/GradingLookup.java b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/GradingLookup.java index a6a8f82f..ff2c96b2 100644 --- a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/GradingLookup.java +++ b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/GradingLookup.java @@ -22,7 +22,7 @@ public class GradingLookup { } }; - public final String lookupGradingDisplay(String code) { + public final String lookupDisplay(String code) { return lookup.get(code); } } diff --git a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/JnuVsLookup.java b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/JnuVsLookup.java index 8350e872..35ca9aed 100644 --- a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/JnuVsLookup.java +++ b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/JnuVsLookup.java @@ -12,7 +12,7 @@ public class JnuVsLookup { } }; - public final String lookupJnuDisplay(String code) { + public final String lookupDisplay(String code) { return lookup.get(code); } } diff --git a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/OPIntentionVsLookup.java b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/OPIntentionVsLookup.java index a99a52fa..cb2e935b 100644 --- a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/OPIntentionVsLookup.java +++ b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/OPIntentionVsLookup.java @@ -16,7 +16,7 @@ public class OPIntentionVsLookup { } }; - public final String lookupOPIntentionVSDisplay(String code) { + public final String lookupDisplay(String code) { return lookup.get(code); } } diff --git a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/OPKomplikationVsLookup.java b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/OPKomplikationVsLookup.java index 31eab104..e535dc1f 100644 --- a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/OPKomplikationVsLookup.java +++ b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/OPKomplikationVsLookup.java @@ -94,7 +94,7 @@ public class OPKomplikationVsLookup { } }; - public final String lookupOPKomplikationVSDisplay(String code) { + public final String lookupDisplay(String code) { return lookup.get(code); } } diff --git a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/SYSTTherapieartCSLookup.java b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/SYSTTherapieartCSLookup.java index 7848b549..665237b7 100644 --- a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/SYSTTherapieartCSLookup.java +++ b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/SYSTTherapieartCSLookup.java @@ -39,7 +39,7 @@ public class SYSTTherapieartCSLookup { } }; - public final String lookupSYSTTherapieartCSLookupDisplay(List code) { + public final String lookupDisplay(List code) { if (code.size() == 1) { return lookup.get(code.get(0)); @@ -50,7 +50,7 @@ public final String lookupSYSTTherapieartCSLookupDisplay(List code) { } } - public final String lookupSYSTTherapieartCSLookupCode(List code) { + public final String lookupCode(List code) { if (code.size() == 1) { return code.get(0); diff --git a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/SideEffectTherapyGradingLookup.java b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/SideEffectTherapyGradingLookup.java index 60208a47..34a81d68 100644 --- a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/SideEffectTherapyGradingLookup.java +++ b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/SideEffectTherapyGradingLookup.java @@ -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; } } diff --git a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/SnomedCtSeitenlokalisationLookup.java b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/SnomedCtSeitenlokalisationLookup.java index 55684b44..d6bb5182 100644 --- a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/SnomedCtSeitenlokalisationLookup.java +++ b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/SnomedCtSeitenlokalisationLookup.java @@ -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; } } diff --git a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/StellungOpVsLookup.java b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/StellungOpVsLookup.java index 70c062a7..10084120 100644 --- a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/StellungOpVsLookup.java +++ b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/StellungOpVsLookup.java @@ -14,7 +14,7 @@ public class StellungOpVsLookup { } }; - public final String lookupStellungOpDisplay(String code) { + public final String lookupDisplay(String code) { return lookup.get(code); } } diff --git a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/SystIntentionVsLookup.java b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/SystIntentionVsLookup.java index 5bb48261..f47b02bb 100644 --- a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/SystIntentionVsLookup.java +++ b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/SystIntentionVsLookup.java @@ -13,7 +13,7 @@ public class SystIntentionVsLookup { } }; - public final String lookupSystIntentionDisplay(String code) { + public final String lookupDisplay(String code) { return lookup.get(code); } } diff --git a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/TnmCpuPraefixTvsLookup.java b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/TnmCpuPraefixTvsLookup.java index 8397a03d..f8aaaf3a 100644 --- a/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/TnmCpuPraefixTvsLookup.java +++ b/src/main/java/org/miracum/streams/ume/obdstofhir/lookup/TnmCpuPraefixTvsLookup.java @@ -19,7 +19,7 @@ public class TnmCpuPraefixTvsLookup { } }; - public final String lookupTnmCpuPraefixDisplay(String code) { + public final String lookupDisplay(String code) { return lookup.get(code); } } diff --git a/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsConditionMapper.java b/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsConditionMapper.java index 6cd938a0..9a4f9770 100644 --- a/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsConditionMapper.java +++ b/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsConditionMapper.java @@ -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 diff --git a/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsMedicationStatementMapper.java b/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsMedicationStatementMapper.java index 1ef03d93..5ad1b690 100644 --- a/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsMedicationStatementMapper.java +++ b/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsMedicationStatementMapper.java @@ -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()); @@ -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 @@ -232,7 +231,7 @@ public MedicationStatement createSystemtherapyMedicationStatement( .setCode(systemTherapy.getSYST_Intention()) .setSystem(fhirProperties.getSystems().getSystIntention()) .setDisplay( - displaySystIntentionLookup.lookupSystIntentionDisplay( + displaySystIntentionLookup.lookupDisplay( systemTherapy.getSYST_Intention())))); stMedicationStatement diff --git a/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsObservationMapper.java b/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsObservationMapper.java index d9210be8..b260906a 100644 --- a/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsObservationMapper.java +++ b/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsObservationMapper.java @@ -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); } @@ -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); @@ -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(), @@ -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(), @@ -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(), @@ -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(), @@ -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(), @@ -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(), @@ -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); } diff --git a/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsProcedureMapper.java b/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsProcedureMapper.java index 3afc7400..ca137aff 100644 --- a/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsProcedureMapper.java +++ b/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsProcedureMapper.java @@ -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); @@ -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( @@ -286,8 +283,7 @@ public Procedure createOpProcedure( .setSystem(fhirProperties.getSystems().getLokalBeurtResidualCS()) .setCode(lokalResidualstatus) .setDisplay( - displayBeurteilungResidualstatusLookup.lookupBeurteilungResidualstatusDisplay( - lokalResidualstatus))); + displayBeurteilungResidualstatusLookup.lookupDisplay(lokalResidualstatus))); } if (gesamtResidualstatus != null) { @@ -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) { @@ -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)); } @@ -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" @@ -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) { @@ -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( @@ -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())); }