diff --git a/src/main/java/gov/cms/mat/cql_elm_translation/service/DataCriteriaService.java b/src/main/java/gov/cms/mat/cql_elm_translation/service/DataCriteriaService.java index 08ba3d87..e3cc43f7 100644 --- a/src/main/java/gov/cms/mat/cql_elm_translation/service/DataCriteriaService.java +++ b/src/main/java/gov/cms/mat/cql_elm_translation/service/DataCriteriaService.java @@ -233,6 +233,7 @@ private String splitByPipeAndGetLast(String criteria) { DataElementDescriptor getCriteriaType(String dataType) { return QdmDatatypeUtil.isValidNegation(dataType) ? QdmDatatypeUtil.getDescriptorForNegation(dataType) - : new DataElementDescriptor(dataType.replace(",", "").replace(" ", "").replace("Not", ""), dataType); + : new DataElementDescriptor( + dataType.replace(",", "").replace(" ", "").replace("Not", ""), dataType); } } diff --git a/src/main/java/gov/cms/mat/cql_elm_translation/utils/cql/QdmDatatypeUtil.java b/src/main/java/gov/cms/mat/cql_elm_translation/utils/cql/QdmDatatypeUtil.java index a35c4e99..5794cfd4 100644 --- a/src/main/java/gov/cms/mat/cql_elm_translation/utils/cql/QdmDatatypeUtil.java +++ b/src/main/java/gov/cms/mat/cql_elm_translation/utils/cql/QdmDatatypeUtil.java @@ -8,45 +8,107 @@ public class QdmDatatypeUtil { private static final Map negationRationale; static { - negationRationale = Map.ofEntries( - Map.entry("Assessment, Not Ordered", new DataElementDescriptor("AssessmentOrder", "Assessment, Order")), - Map.entry( - "Assessment, Not Performed", new DataElementDescriptor("AssessmentPerformed", "Assessment, Performed")), - Map.entry( - "Assessment, Not Recommended", new DataElementDescriptor("AssessmentRecommended", "Assessment, Recommended")), - Map.entry("Communication, Not Performed", new DataElementDescriptor("CommunicationPerformed", "Communication, Performed")), - Map.entry("Device, Not Ordered", new DataElementDescriptor("DeviceOrder", "Device, Order")), - Map.entry("Device, Not Recommended" , new DataElementDescriptor("DeviceRecommended", "Device, Recommended")), - Map.entry("Diagnostic Study, Not Ordered", new DataElementDescriptor("DiagnosticStudyOrder", "Diagnostic Study, Order")), - Map.entry("Diagnostic Study, Not Performed", new DataElementDescriptor("DiagnosticStudyPerformed", "Diagnostic Study, Performed")), - Map.entry("Diagnostic Study, Not Recommended", new DataElementDescriptor("DiagnosticStudyRecommended", "Diagnostic Study, Recommended")), - Map.entry("Encounter, Not Ordered", new DataElementDescriptor("EncounterOrder", "Encounter, Order")), - Map.entry("Encounter, Not Recommended", new DataElementDescriptor("EncounterRecommended", "Encounter Recommended")), - Map.entry("Intervention, Not Ordered", new DataElementDescriptor("InterventionOrder", "Intervention, Order")), - Map.entry("Intervention, Not Performed", new DataElementDescriptor("InterventionPerformed", "Intervention, Performed")), - Map.entry("Intervention, Not Recommended", new DataElementDescriptor("InterventionRecommended", "Intervention, Recommended")), - Map.entry("Immunization, Not Ordered", new DataElementDescriptor("ImmunizationOrder", "Immunization, Order")), - Map.entry("Immunization, Not Administered", new DataElementDescriptor("ImmunizationAdministered", "Immunization, Administered")), - Map.entry("Laboratory Test, Not Ordered", new DataElementDescriptor("LaboratoryTestOrder", "Laboratory Test, Order")), - Map.entry("Laboratory Test, Not Performed", new DataElementDescriptor("LaboratoryTestPerformed", "Laboratory Test, Performed")), - Map.entry("Laboratory Test, Not Recommended", new DataElementDescriptor("LaboratoryTestRecommended", "Laboratory Test, Recommended")), - Map.entry("Medication, Not Administered", new DataElementDescriptor("MedicationAdministered", "Medication, Administered")), - Map.entry("Medication, Not Discharged", new DataElementDescriptor("MedicationDischarge", "Medication, Discharge")), - Map.entry("Medication, Not Dispensed", new DataElementDescriptor("MedicationDispensed", "Medication, Dispensed")), - Map.entry("Medication, Not Ordered", new DataElementDescriptor("MedicationOrder", "Medication, Order")), - Map.entry("Physical Exam, Not Ordered", new DataElementDescriptor("PhysicalExamOrder", "Physical Exam, Order")), - Map.entry("Physical Exam, Not Performed", new DataElementDescriptor("PhysicalExamPerformed", "Physical Exam, Performed")), - Map.entry("Physical Exam, Not Recommended", new DataElementDescriptor("PhysicalExamRecommended", "Physical Exam, Recommended")), - Map.entry("Procedure, Not Ordered", new DataElementDescriptor("ProcedureOrder", "Procedure, Order")), - Map.entry("Procedure, Not Performed", new DataElementDescriptor("ProcedurePerformed", "Procedure, Performed")), - Map.entry("Procedure, Not Recommended", new DataElementDescriptor("ProcedureRecommended", "Procedure, Recommended")), - Map.entry("Substance, Not Administered", new DataElementDescriptor("SubstanceAdministered", "Substance, Administered")), - Map.entry("Substance, Not Ordered", new DataElementDescriptor("SubstanceOrder", "Substance, Order")), - Map.entry("Substance, Not Recommended", new DataElementDescriptor("SubstanceRecommended", "Substance, Recommended")) - - - - ); + negationRationale = + Map.ofEntries( + Map.entry( + "Assessment, Not Ordered", + new DataElementDescriptor("AssessmentOrder", "Assessment, Order")), + Map.entry( + "Assessment, Not Performed", + new DataElementDescriptor("AssessmentPerformed", "Assessment, Performed")), + Map.entry( + "Assessment, Not Recommended", + new DataElementDescriptor("AssessmentRecommended", "Assessment, Recommended")), + Map.entry( + "Communication, Not Performed", + new DataElementDescriptor("CommunicationPerformed", "Communication, Performed")), + Map.entry( + "Device, Not Ordered", new DataElementDescriptor("DeviceOrder", "Device, Order")), + Map.entry( + "Device, Not Recommended", + new DataElementDescriptor("DeviceRecommended", "Device, Recommended")), + Map.entry( + "Diagnostic Study, Not Ordered", + new DataElementDescriptor("DiagnosticStudyOrder", "Diagnostic Study, Order")), + Map.entry( + "Diagnostic Study, Not Performed", + new DataElementDescriptor( + "DiagnosticStudyPerformed", "Diagnostic Study, Performed")), + Map.entry( + "Diagnostic Study, Not Recommended", + new DataElementDescriptor( + "DiagnosticStudyRecommended", "Diagnostic Study, Recommended")), + Map.entry( + "Encounter, Not Ordered", + new DataElementDescriptor("EncounterOrder", "Encounter, Order")), + Map.entry( + "Encounter, Not Recommended", + new DataElementDescriptor("EncounterRecommended", "Encounter Recommended")), + Map.entry( + "Intervention, Not Ordered", + new DataElementDescriptor("InterventionOrder", "Intervention, Order")), + Map.entry( + "Intervention, Not Performed", + new DataElementDescriptor("InterventionPerformed", "Intervention, Performed")), + Map.entry( + "Intervention, Not Recommended", + new DataElementDescriptor("InterventionRecommended", "Intervention, Recommended")), + Map.entry( + "Immunization, Not Ordered", + new DataElementDescriptor("ImmunizationOrder", "Immunization, Order")), + Map.entry( + "Immunization, Not Administered", + new DataElementDescriptor( + "ImmunizationAdministered", "Immunization, Administered")), + Map.entry( + "Laboratory Test, Not Ordered", + new DataElementDescriptor("LaboratoryTestOrder", "Laboratory Test, Order")), + Map.entry( + "Laboratory Test, Not Performed", + new DataElementDescriptor("LaboratoryTestPerformed", "Laboratory Test, Performed")), + Map.entry( + "Laboratory Test, Not Recommended", + new DataElementDescriptor( + "LaboratoryTestRecommended", "Laboratory Test, Recommended")), + Map.entry( + "Medication, Not Administered", + new DataElementDescriptor("MedicationAdministered", "Medication, Administered")), + Map.entry( + "Medication, Not Discharged", + new DataElementDescriptor("MedicationDischarge", "Medication, Discharge")), + Map.entry( + "Medication, Not Dispensed", + new DataElementDescriptor("MedicationDispensed", "Medication, Dispensed")), + Map.entry( + "Medication, Not Ordered", + new DataElementDescriptor("MedicationOrder", "Medication, Order")), + Map.entry( + "Physical Exam, Not Ordered", + new DataElementDescriptor("PhysicalExamOrder", "Physical Exam, Order")), + Map.entry( + "Physical Exam, Not Performed", + new DataElementDescriptor("PhysicalExamPerformed", "Physical Exam, Performed")), + Map.entry( + "Physical Exam, Not Recommended", + new DataElementDescriptor("PhysicalExamRecommended", "Physical Exam, Recommended")), + Map.entry( + "Procedure, Not Ordered", + new DataElementDescriptor("ProcedureOrder", "Procedure, Order")), + Map.entry( + "Procedure, Not Performed", + new DataElementDescriptor("ProcedurePerformed", "Procedure, Performed")), + Map.entry( + "Procedure, Not Recommended", + new DataElementDescriptor("ProcedureRecommended", "Procedure, Recommended")), + Map.entry( + "Substance, Not Administered", + new DataElementDescriptor("SubstanceAdministered", "Substance, Administered")), + Map.entry( + "Substance, Not Ordered", + new DataElementDescriptor("SubstanceOrder", "Substance, Order")), + Map.entry( + "Substance, Not Recommended", + new DataElementDescriptor("SubstanceRecommended", "Substance, Recommended"))); } public static boolean isValidNegation(final String negation) { diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 37b6361b..9be344f6 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -1,7 +1,7 @@ server: port: 8084 servlet: - context-path: /api + context-path: /api/fhir spring: profiles: diff --git a/src/test/java/gov/cms/mat/cql_elm_translation/dto/ElementLookupTest.java b/src/test/java/gov/cms/mat/cql_elm_translation/dto/ElementLookupTest.java index f0c7f0fe..bd301cfe 100644 --- a/src/test/java/gov/cms/mat/cql_elm_translation/dto/ElementLookupTest.java +++ b/src/test/java/gov/cms/mat/cql_elm_translation/dto/ElementLookupTest.java @@ -5,7 +5,6 @@ import java.util.HashSet; import java.util.Set; - import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.equalTo; @@ -14,16 +13,17 @@ class ElementLookupTest { @Test void testHashSetUniqueness() { - ElementLookup elementLookup1 = ElementLookup.builder() - .id("ID1") - .oid("111.222.333") - .name("TestCode") - .codeName("TestCodeName") - .codeSystemName("Amazing Code System") - .release("Release1") - .displayName("Test Code") - .datatype("Code") - .build(); + ElementLookup elementLookup1 = + ElementLookup.builder() + .id("ID1") + .oid("111.222.333") + .name("TestCode") + .codeName("TestCodeName") + .codeSystemName("Amazing Code System") + .release("Release1") + .displayName("Test Code") + .datatype("Code") + .build(); ElementLookup elementLookup2 = elementLookup1.toBuilder().id("ID2").build(); @@ -32,4 +32,4 @@ void testHashSetUniqueness() { set.add(elementLookup2); assertThat(set.size(), is(equalTo(1))); } -} \ No newline at end of file +}