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

Feature/mat 7054 #3

Merged
merged 2 commits into from
Jun 4, 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 @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,107 @@ public class QdmDatatypeUtil {
private static final Map<String, DataElementDescriptor> 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) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
server:
port: 8084
servlet:
context-path: /api
context-path: /api/fhir

spring:
profiles:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();

Expand All @@ -32,4 +32,4 @@ void testHashSetUniqueness() {
set.add(elementLookup2);
assertThat(set.size(), is(equalTo(1)));
}
}
}
Loading