@Test public void testAllergyChcsIenGetMappingCodeHappyPath() { try { ((MyHDDDao) testSubject).clearStaticData(); when(mockJLVDodAllergiesMap.getAllergyUMLSCuiFromChcsIen(any(String.class))).thenReturn(createGeneratedMappedCodeResponse()); JLVMappedCode oMappedCode = testSubject.getMappedCode(MappingType.AllergyCHCSIenToUMLSCui, "9999"); verifyGeneratedMappedCodeResponse(oMappedCode); } catch (Exception e) { System.out.println("An unexpected exception occurred. Error: " + e.getMessage()); e.printStackTrace(); fail("An unexpected exception occurred. Error: " + e.getMessage()); } }
public JLVMappedCode getMappedCode(MappingType oMappingType, String sSourceCode) throws TermLoadException { JLVMappedCode oMappedCode = null; openDatabase(); if (oMappingType == MappingType.AllergyVUIDtoUMLSCui) { JLVReactantsMap oReactantsMap = getJLVReactantsMap(); oMappedCode = oReactantsMap.getAllergyUMLSCuiFromVuid(sSourceCode); } else if (oMappingType == MappingType.AllergyCHCSIenToUMLSCui) { JLVDodAllergiesMap oDodAllergiesMap = getJLVDodAllergiesMap(); oMappedCode = oDodAllergiesMap.getAllergyUMLSCuiFromChcsIen(sSourceCode); } else if (oMappingType == MappingType.AllergyDODNcidToUMLSCui) { JLVDodAllergiesMap oDodAllergiesMap = getJLVDodAllergiesMap(); oMappedCode = oDodAllergiesMap.getAllergyUMLSCuiFromDodNcid(sSourceCode); } else if (oMappingType == MappingType.LabUseLOINCtoGetText) { JLVLoincMap oLoincMap = getJLVLoincMap(); oMappedCode = oLoincMap.getLabLoincInfoFromLoincCode(sSourceCode); } else if (oMappingType == MappingType.LabDODNcidToLOINC) { JLVDodLabsMap oDodLabsMap = getJLVDodLabsMap(); oMappedCode = oDodLabsMap.getLabLoincFromDodNcid(sSourceCode); } else if (oMappingType == MappingType.VitalsVuidToLoinc) { JLVVitalsMap oVitalsMap = getJLVVitalsMap(); oMappedCode = oVitalsMap.getVitalsLoincFromVuid(sSourceCode); } else if (oMappingType == MappingType.VitalsDODNcidToLoinc) { JLVVitalsMap oVitalsMap = getJLVVitalsMap(); oMappedCode = oVitalsMap.getVitalsLoincFromDodNcid(sSourceCode); } else if (oMappingType == MappingType.ProblemsIcd9ToSnomedCT) { JLVIcd9SnomedMap oIcd9SnomedMap = getJLVIcd9SnomedMap(); oMappedCode = oIcd9SnomedMap.getProblemSnomedCTFromIcd9(sSourceCode); } else if (oMappingType == MappingType.ProblemsMedcinIdToSnomedCT) { JLVMedcinSnomedMap oMedcinSnomedMap = getJLVMedcinSnomedMap(); oMappedCode = oMedcinSnomedMap.getProblemSnomedCTFromMedcinId(sSourceCode); } else if (oMappingType == MappingType.MedicationVuidToRxNorm) { JLVDrugsMap oDrugsMap = getJLVDrugsMap(); oMappedCode = oDrugsMap.getMedicationRxNormFromVuid(sSourceCode); } else if (oMappingType == MappingType.MedicationDodNcidToRxNorm) { JLVDodMedicationsMap oDodMedicationsMap = getJLVDodMedicationsMap(); oMappedCode = oDodMedicationsMap.getMedicationRxNormFromDodNcid(sSourceCode); } else if (oMappingType == MappingType.NotesDodNcidToLoinc) { JLVNotesMap oNotesMap = getJLVNotesMap(); oMappedCode = oNotesMap.getNotesLoincFromDodNcid(sSourceCode); } else if (oMappingType == MappingType.ImmunizationCptToCvx) { JLVImmunizationsMap oImmunizationsMap = getJLVImmunizationsMap(); oMappedCode = oImmunizationsMap.getImmunizationCvxFromCpt(sSourceCode); } return oMappedCode; }
JLVHddDao { public JLVMappedCode getMappedCode(MappingType oMappingType, String sSourceCode) throws TermLoadException { JLVMappedCode oMappedCode = null; openDatabase(); if (oMappingType == MappingType.AllergyVUIDtoUMLSCui) { JLVReactantsMap oReactantsMap = getJLVReactantsMap(); oMappedCode = oReactantsMap.getAllergyUMLSCuiFromVuid(sSourceCode); } else if (oMappingType == MappingType.AllergyCHCSIenToUMLSCui) { JLVDodAllergiesMap oDodAllergiesMap = getJLVDodAllergiesMap(); oMappedCode = oDodAllergiesMap.getAllergyUMLSCuiFromChcsIen(sSourceCode); } else if (oMappingType == MappingType.AllergyDODNcidToUMLSCui) { JLVDodAllergiesMap oDodAllergiesMap = getJLVDodAllergiesMap(); oMappedCode = oDodAllergiesMap.getAllergyUMLSCuiFromDodNcid(sSourceCode); } else if (oMappingType == MappingType.LabUseLOINCtoGetText) { JLVLoincMap oLoincMap = getJLVLoincMap(); oMappedCode = oLoincMap.getLabLoincInfoFromLoincCode(sSourceCode); } else if (oMappingType == MappingType.LabDODNcidToLOINC) { JLVDodLabsMap oDodLabsMap = getJLVDodLabsMap(); oMappedCode = oDodLabsMap.getLabLoincFromDodNcid(sSourceCode); } else if (oMappingType == MappingType.VitalsVuidToLoinc) { JLVVitalsMap oVitalsMap = getJLVVitalsMap(); oMappedCode = oVitalsMap.getVitalsLoincFromVuid(sSourceCode); } else if (oMappingType == MappingType.VitalsDODNcidToLoinc) { JLVVitalsMap oVitalsMap = getJLVVitalsMap(); oMappedCode = oVitalsMap.getVitalsLoincFromDodNcid(sSourceCode); } else if (oMappingType == MappingType.ProblemsIcd9ToSnomedCT) { JLVIcd9SnomedMap oIcd9SnomedMap = getJLVIcd9SnomedMap(); oMappedCode = oIcd9SnomedMap.getProblemSnomedCTFromIcd9(sSourceCode); } else if (oMappingType == MappingType.ProblemsMedcinIdToSnomedCT) { JLVMedcinSnomedMap oMedcinSnomedMap = getJLVMedcinSnomedMap(); oMappedCode = oMedcinSnomedMap.getProblemSnomedCTFromMedcinId(sSourceCode); } else if (oMappingType == MappingType.MedicationVuidToRxNorm) { JLVDrugsMap oDrugsMap = getJLVDrugsMap(); oMappedCode = oDrugsMap.getMedicationRxNormFromVuid(sSourceCode); } else if (oMappingType == MappingType.MedicationDodNcidToRxNorm) { JLVDodMedicationsMap oDodMedicationsMap = getJLVDodMedicationsMap(); oMappedCode = oDodMedicationsMap.getMedicationRxNormFromDodNcid(sSourceCode); } else if (oMappingType == MappingType.NotesDodNcidToLoinc) { JLVNotesMap oNotesMap = getJLVNotesMap(); oMappedCode = oNotesMap.getNotesLoincFromDodNcid(sSourceCode); } else if (oMappingType == MappingType.ImmunizationCptToCvx) { JLVImmunizationsMap oImmunizationsMap = getJLVImmunizationsMap(); oMappedCode = oImmunizationsMap.getImmunizationCvxFromCpt(sSourceCode); } return oMappedCode; } }
JLVHddDao { public JLVMappedCode getMappedCode(MappingType oMappingType, String sSourceCode) throws TermLoadException { JLVMappedCode oMappedCode = null; openDatabase(); if (oMappingType == MappingType.AllergyVUIDtoUMLSCui) { JLVReactantsMap oReactantsMap = getJLVReactantsMap(); oMappedCode = oReactantsMap.getAllergyUMLSCuiFromVuid(sSourceCode); } else if (oMappingType == MappingType.AllergyCHCSIenToUMLSCui) { JLVDodAllergiesMap oDodAllergiesMap = getJLVDodAllergiesMap(); oMappedCode = oDodAllergiesMap.getAllergyUMLSCuiFromChcsIen(sSourceCode); } else if (oMappingType == MappingType.AllergyDODNcidToUMLSCui) { JLVDodAllergiesMap oDodAllergiesMap = getJLVDodAllergiesMap(); oMappedCode = oDodAllergiesMap.getAllergyUMLSCuiFromDodNcid(sSourceCode); } else if (oMappingType == MappingType.LabUseLOINCtoGetText) { JLVLoincMap oLoincMap = getJLVLoincMap(); oMappedCode = oLoincMap.getLabLoincInfoFromLoincCode(sSourceCode); } else if (oMappingType == MappingType.LabDODNcidToLOINC) { JLVDodLabsMap oDodLabsMap = getJLVDodLabsMap(); oMappedCode = oDodLabsMap.getLabLoincFromDodNcid(sSourceCode); } else if (oMappingType == MappingType.VitalsVuidToLoinc) { JLVVitalsMap oVitalsMap = getJLVVitalsMap(); oMappedCode = oVitalsMap.getVitalsLoincFromVuid(sSourceCode); } else if (oMappingType == MappingType.VitalsDODNcidToLoinc) { JLVVitalsMap oVitalsMap = getJLVVitalsMap(); oMappedCode = oVitalsMap.getVitalsLoincFromDodNcid(sSourceCode); } else if (oMappingType == MappingType.ProblemsIcd9ToSnomedCT) { JLVIcd9SnomedMap oIcd9SnomedMap = getJLVIcd9SnomedMap(); oMappedCode = oIcd9SnomedMap.getProblemSnomedCTFromIcd9(sSourceCode); } else if (oMappingType == MappingType.ProblemsMedcinIdToSnomedCT) { JLVMedcinSnomedMap oMedcinSnomedMap = getJLVMedcinSnomedMap(); oMappedCode = oMedcinSnomedMap.getProblemSnomedCTFromMedcinId(sSourceCode); } else if (oMappingType == MappingType.MedicationVuidToRxNorm) { JLVDrugsMap oDrugsMap = getJLVDrugsMap(); oMappedCode = oDrugsMap.getMedicationRxNormFromVuid(sSourceCode); } else if (oMappingType == MappingType.MedicationDodNcidToRxNorm) { JLVDodMedicationsMap oDodMedicationsMap = getJLVDodMedicationsMap(); oMappedCode = oDodMedicationsMap.getMedicationRxNormFromDodNcid(sSourceCode); } else if (oMappingType == MappingType.NotesDodNcidToLoinc) { JLVNotesMap oNotesMap = getJLVNotesMap(); oMappedCode = oNotesMap.getNotesLoincFromDodNcid(sSourceCode); } else if (oMappingType == MappingType.ImmunizationCptToCvx) { JLVImmunizationsMap oImmunizationsMap = getJLVImmunizationsMap(); oMappedCode = oImmunizationsMap.getImmunizationCvxFromCpt(sSourceCode); } return oMappedCode; } protected  JLVHddDao(); protected  JLVHddDao(String sJLVH2JdbcUrl); }
JLVHddDao { public JLVMappedCode getMappedCode(MappingType oMappingType, String sSourceCode) throws TermLoadException { JLVMappedCode oMappedCode = null; openDatabase(); if (oMappingType == MappingType.AllergyVUIDtoUMLSCui) { JLVReactantsMap oReactantsMap = getJLVReactantsMap(); oMappedCode = oReactantsMap.getAllergyUMLSCuiFromVuid(sSourceCode); } else if (oMappingType == MappingType.AllergyCHCSIenToUMLSCui) { JLVDodAllergiesMap oDodAllergiesMap = getJLVDodAllergiesMap(); oMappedCode = oDodAllergiesMap.getAllergyUMLSCuiFromChcsIen(sSourceCode); } else if (oMappingType == MappingType.AllergyDODNcidToUMLSCui) { JLVDodAllergiesMap oDodAllergiesMap = getJLVDodAllergiesMap(); oMappedCode = oDodAllergiesMap.getAllergyUMLSCuiFromDodNcid(sSourceCode); } else if (oMappingType == MappingType.LabUseLOINCtoGetText) { JLVLoincMap oLoincMap = getJLVLoincMap(); oMappedCode = oLoincMap.getLabLoincInfoFromLoincCode(sSourceCode); } else if (oMappingType == MappingType.LabDODNcidToLOINC) { JLVDodLabsMap oDodLabsMap = getJLVDodLabsMap(); oMappedCode = oDodLabsMap.getLabLoincFromDodNcid(sSourceCode); } else if (oMappingType == MappingType.VitalsVuidToLoinc) { JLVVitalsMap oVitalsMap = getJLVVitalsMap(); oMappedCode = oVitalsMap.getVitalsLoincFromVuid(sSourceCode); } else if (oMappingType == MappingType.VitalsDODNcidToLoinc) { JLVVitalsMap oVitalsMap = getJLVVitalsMap(); oMappedCode = oVitalsMap.getVitalsLoincFromDodNcid(sSourceCode); } else if (oMappingType == MappingType.ProblemsIcd9ToSnomedCT) { JLVIcd9SnomedMap oIcd9SnomedMap = getJLVIcd9SnomedMap(); oMappedCode = oIcd9SnomedMap.getProblemSnomedCTFromIcd9(sSourceCode); } else if (oMappingType == MappingType.ProblemsMedcinIdToSnomedCT) { JLVMedcinSnomedMap oMedcinSnomedMap = getJLVMedcinSnomedMap(); oMappedCode = oMedcinSnomedMap.getProblemSnomedCTFromMedcinId(sSourceCode); } else if (oMappingType == MappingType.MedicationVuidToRxNorm) { JLVDrugsMap oDrugsMap = getJLVDrugsMap(); oMappedCode = oDrugsMap.getMedicationRxNormFromVuid(sSourceCode); } else if (oMappingType == MappingType.MedicationDodNcidToRxNorm) { JLVDodMedicationsMap oDodMedicationsMap = getJLVDodMedicationsMap(); oMappedCode = oDodMedicationsMap.getMedicationRxNormFromDodNcid(sSourceCode); } else if (oMappingType == MappingType.NotesDodNcidToLoinc) { JLVNotesMap oNotesMap = getJLVNotesMap(); oMappedCode = oNotesMap.getNotesLoincFromDodNcid(sSourceCode); } else if (oMappingType == MappingType.ImmunizationCptToCvx) { JLVImmunizationsMap oImmunizationsMap = getJLVImmunizationsMap(); oMappedCode = oImmunizationsMap.getImmunizationCvxFromCpt(sSourceCode); } return oMappedCode; } protected  JLVHddDao(); protected  JLVHddDao(String sJLVH2JdbcUrl); static JLVHddDao createInstance(); static JLVHddDao createInstance(String sJLVH2JdbcUrl); List<JLVMappedCode> getMappedCodeList(MappingType oMappingType, String sSourceCode); JLVMappedCode getMappedCode(MappingType oMappingType, String sSourceCode); }
JLVHddDao { public JLVMappedCode getMappedCode(MappingType oMappingType, String sSourceCode) throws TermLoadException { JLVMappedCode oMappedCode = null; openDatabase(); if (oMappingType == MappingType.AllergyVUIDtoUMLSCui) { JLVReactantsMap oReactantsMap = getJLVReactantsMap(); oMappedCode = oReactantsMap.getAllergyUMLSCuiFromVuid(sSourceCode); } else if (oMappingType == MappingType.AllergyCHCSIenToUMLSCui) { JLVDodAllergiesMap oDodAllergiesMap = getJLVDodAllergiesMap(); oMappedCode = oDodAllergiesMap.getAllergyUMLSCuiFromChcsIen(sSourceCode); } else if (oMappingType == MappingType.AllergyDODNcidToUMLSCui) { JLVDodAllergiesMap oDodAllergiesMap = getJLVDodAllergiesMap(); oMappedCode = oDodAllergiesMap.getAllergyUMLSCuiFromDodNcid(sSourceCode); } else if (oMappingType == MappingType.LabUseLOINCtoGetText) { JLVLoincMap oLoincMap = getJLVLoincMap(); oMappedCode = oLoincMap.getLabLoincInfoFromLoincCode(sSourceCode); } else if (oMappingType == MappingType.LabDODNcidToLOINC) { JLVDodLabsMap oDodLabsMap = getJLVDodLabsMap(); oMappedCode = oDodLabsMap.getLabLoincFromDodNcid(sSourceCode); } else if (oMappingType == MappingType.VitalsVuidToLoinc) { JLVVitalsMap oVitalsMap = getJLVVitalsMap(); oMappedCode = oVitalsMap.getVitalsLoincFromVuid(sSourceCode); } else if (oMappingType == MappingType.VitalsDODNcidToLoinc) { JLVVitalsMap oVitalsMap = getJLVVitalsMap(); oMappedCode = oVitalsMap.getVitalsLoincFromDodNcid(sSourceCode); } else if (oMappingType == MappingType.ProblemsIcd9ToSnomedCT) { JLVIcd9SnomedMap oIcd9SnomedMap = getJLVIcd9SnomedMap(); oMappedCode = oIcd9SnomedMap.getProblemSnomedCTFromIcd9(sSourceCode); } else if (oMappingType == MappingType.ProblemsMedcinIdToSnomedCT) { JLVMedcinSnomedMap oMedcinSnomedMap = getJLVMedcinSnomedMap(); oMappedCode = oMedcinSnomedMap.getProblemSnomedCTFromMedcinId(sSourceCode); } else if (oMappingType == MappingType.MedicationVuidToRxNorm) { JLVDrugsMap oDrugsMap = getJLVDrugsMap(); oMappedCode = oDrugsMap.getMedicationRxNormFromVuid(sSourceCode); } else if (oMappingType == MappingType.MedicationDodNcidToRxNorm) { JLVDodMedicationsMap oDodMedicationsMap = getJLVDodMedicationsMap(); oMappedCode = oDodMedicationsMap.getMedicationRxNormFromDodNcid(sSourceCode); } else if (oMappingType == MappingType.NotesDodNcidToLoinc) { JLVNotesMap oNotesMap = getJLVNotesMap(); oMappedCode = oNotesMap.getNotesLoincFromDodNcid(sSourceCode); } else if (oMappingType == MappingType.ImmunizationCptToCvx) { JLVImmunizationsMap oImmunizationsMap = getJLVImmunizationsMap(); oMappedCode = oImmunizationsMap.getImmunizationCvxFromCpt(sSourceCode); } return oMappedCode; } protected  JLVHddDao(); protected  JLVHddDao(String sJLVH2JdbcUrl); static JLVHddDao createInstance(); static JLVHddDao createInstance(String sJLVH2JdbcUrl); List<JLVMappedCode> getMappedCodeList(MappingType oMappingType, String sSourceCode); JLVMappedCode getMappedCode(MappingType oMappingType, String sSourceCode);  }