diff --git a/keep_diabetes_no_dr.json b/keep_diabetes_no_dr.json new file mode 100644 index 0000000000..19e9391b71 --- /dev/null +++ b/keep_diabetes_no_dr.json @@ -0,0 +1,54 @@ +{ + "name": "keep_diabetes_no_dr", + "remarks": [ + "A blank module" + ], + "states": { + "Initial": { + "type": "Initial", + "conditional_transition": [ + { + "transition": "Keep", + "condition": { + "condition_type": "And", + "conditions": [ + { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": 44054006, + "display": "Diabetes mellitus type 2 (disorder)" + } + ] + }, + { + "condition_type": "Not", + "condition": { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": "1551000119108", + "display": "Nonproliferative diabetic retinopathy due to type 2 diabetes mellitus (disorder)" + } + ] + } + } + ] + } + }, + { + "transition": "Terminal" + } + ] + }, + "Terminal": { + "type": "Terminal" + }, + "Keep": { + "type": "Terminal" + } + }, + "gmf_version": 2 +} \ No newline at end of file diff --git a/keep_npdr.json b/keep_npdr.json new file mode 100644 index 0000000000..f23728fa49 --- /dev/null +++ b/keep_npdr.json @@ -0,0 +1,36 @@ +{ + "name": "Generated Keep Module", + "states": { + "Initial": { + "type": "Initial", + "name": "Initial", + "conditional_transition": [ + { + "transition": "Keep", + "condition": { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": "1551000119108", + "display": "Nonproliferative diabetic retinopathy due to type 2 diabetes mellitus (disorder)" + } + ] + } + }, + { + "transition": "Terminal" + } + ] + }, + "Terminal": { + "type": "Terminal", + "name": "Terminal" + }, + "Keep": { + "type": "Terminal", + "name": "Keep" + } + }, + "gmf_version": 2 +} \ No newline at end of file diff --git a/keep_npdr_no_pdr.json b/keep_npdr_no_pdr.json new file mode 100644 index 0000000000..ae94d51578 --- /dev/null +++ b/keep_npdr_no_pdr.json @@ -0,0 +1,54 @@ +{ + "name": "keep_npdr_no_pdr", + "remarks": [ + "A blank module" + ], + "states": { + "Initial": { + "type": "Initial", + "conditional_transition": [ + { + "transition": "Keep", + "condition": { + "condition_type": "And", + "conditions": [ + { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": "1551000119108", + "display": "Nonproliferative diabetic retinopathy due to type 2 diabetes mellitus (disorder)" + } + ] + }, + { + "condition_type": "Not", + "condition": { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": "1501000119109", + "display": "Proliferative diabetic retinopathy due to type II diabetes mellitus (disorder)" + } + ] + } + } + ] + } + }, + { + "transition": "Terminal" + } + ] + }, + "Terminal": { + "type": "Terminal" + }, + "Keep": { + "type": "Terminal" + } + }, + "gmf_version": 2 +} \ No newline at end of file diff --git a/keep_pdr.json b/keep_pdr.json new file mode 100644 index 0000000000..78c086e091 --- /dev/null +++ b/keep_pdr.json @@ -0,0 +1,36 @@ +{ + "name": "Generated Keep Module", + "states": { + "Initial": { + "type": "Initial", + "name": "Initial", + "conditional_transition": [ + { + "transition": "Keep", + "condition": { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": "1501000119109", + "display": "Proliferative diabetic retinopathy due to type II diabetes mellitus (disorder)" + } + ] + } + }, + { + "transition": "Terminal" + } + ] + }, + "Terminal": { + "type": "Terminal", + "name": "Terminal" + }, + "Keep": { + "type": "Terminal", + "name": "Keep" + } + }, + "gmf_version": 2 +} \ No newline at end of file diff --git a/src/main/java/org/mitre/synthea/engine/State.java b/src/main/java/org/mitre/synthea/engine/State.java index 0008efaa71..8279f8a397 100644 --- a/src/main/java/org/mitre/synthea/engine/State.java +++ b/src/main/java/org/mitre/synthea/engine/State.java @@ -2089,7 +2089,7 @@ private void duplicateInstances(RandomNumberGenerator random, long time, // Create the new instances for (int j = 0; j < s.instances.size(); j++) { - instanceClones.add(s.instances.get(i).clone()); + instanceClones.add(s.instances.get(j).clone()); } s.instances = instanceClones; } diff --git a/src/main/java/org/mitre/synthea/export/ClinicalNoteExporter.java b/src/main/java/org/mitre/synthea/export/ClinicalNoteExporter.java index 4ac79d45cd..ac7042f325 100644 --- a/src/main/java/org/mitre/synthea/export/ClinicalNoteExporter.java +++ b/src/main/java/org/mitre/synthea/export/ClinicalNoteExporter.java @@ -130,6 +130,11 @@ public static String export(Person person, Encounter encounter) { person.attributes.put("ehr_medications", encounter.medications); person.attributes.put("ehr_careplans", encounter.careplans); person.attributes.put("ehr_imaging_studies", encounter.imagingStudies); + if (encounter.note == null) { + person.attributes.remove("ehr_note"); + } else { + person.attributes.put("ehr_note", encounter.note); + } person.attributes.put("time", encounter.start); if (person.attributes.containsKey(LifecycleModule.QUIT_SMOKING_AGE)) { person.attributes.put("quit_smoking_age", diff --git a/src/main/java/org/mitre/synthea/helpers/RandomNumberGenerator.java b/src/main/java/org/mitre/synthea/helpers/RandomNumberGenerator.java index 73f115c534..e5bc9d909f 100644 --- a/src/main/java/org/mitre/synthea/helpers/RandomNumberGenerator.java +++ b/src/main/java/org/mitre/synthea/helpers/RandomNumberGenerator.java @@ -55,7 +55,7 @@ public default double rand(double[] range) { * @param choices The options to be returned. * @return One of the options randomly selected. */ - public default String rand(String[] choices) { + public default String rand(String... choices) { int value = randInt(choices.length); return choices[value]; } diff --git a/src/main/java/org/mitre/synthea/world/concepts/HealthRecord.java b/src/main/java/org/mitre/synthea/world/concepts/HealthRecord.java index be74e8074d..126a78e03a 100644 --- a/src/main/java/org/mitre/synthea/world/concepts/HealthRecord.java +++ b/src/main/java/org/mitre/synthea/world/concepts/HealthRecord.java @@ -167,6 +167,7 @@ public class Entry implements Serializable { public String type; public List codes; private BigDecimal cost; + public String note; /** * Constructor for Entry. diff --git a/src/main/resources/modules/diabetic_retinopathy_treatment.json b/src/main/resources/modules/diabetic_retinopathy_treatment.json new file mode 100644 index 0000000000..edfcb43836 --- /dev/null +++ b/src/main/resources/modules/diabetic_retinopathy_treatment.json @@ -0,0 +1,660 @@ +{ + "name": "Diabetic Retinopathy Treatment", + "remarks": [ + "The Diabetic Retinopathy Treatment top-level module represents the ophthalmic treatment cycle a patient with diabetes will go through after diagnosis. This module starts with a Guard state that allows only patients with an active diagnosis diabetes, then two possible paths prior to their first encounter: some patients follow recommended practices and will seek an ophthalmologist for screening right away after the diabetes diagnosis, some patients will wait until there are significant symptoms. Once a patient is in the treatment cycle, they will continue to have encounters based on the recommended follow-up schedule for their disease status.", + "", + "At the start of each encounter, the OphthalmicProgression submodule is called to align various attributes with the patient’s current disease status, so that those attributes can be read at the subsequent examination states. Then the patient will have basic exams performed:", + " - visual acuity (via the Visual Acuity submodule),", + " - intraocular pressure (via the Intraocular Pressure submodule),", + " - slit-lamp,", + " - dilation,", + " - gonioscopy, and", + " - fundoscopy.", + "", + "If the patient has previously been diagnosed with diabetic retinopathy, an OCT will be performed (via the Ophthalmic Tomography submodule). Further diagnoses will be made in the Diabetic Retinopathy Diagnoses submodule. Treatments will be considered based on the AAO PPP: panretinal laser, grid laser, and anti-VEGF injections. Finally, the OphthalmicNote submodule is called to create an unstructured note based on the observations and procedures from this encounter.", + "", + "These modules and submodules are intended to reflect the most common diagnoses and treatment options associated with diabetic retinopathy, not necessarily every possible complication and comorbidity. Treatment plans represented in the module are primarily based on the American Academy of Ophthalmology® (AAO) Diabetic Retinopathy Preferred Practice Pattern® (PPP), 2019 edition[1].", + "", + "", + "Thanks to Brig. Gen. James Dienst for assisting with the initial module structure, and Dr. Aaron Lee and Dr. Emily Chew for their time in reviewing this module. (No endorsement of this module by Dr. Lee or Dr. Chew is implied)", + "", + "", + "1: C. J. Flaxel et al., “Diabetic retinopathy preferred practice pattern®,” Ophthalmology, vol. 127, no. 1, Sep. 2019. doi:10.1016/j.ophtha.2019.09.025" + ], + "states": { + "Initial": { + "type": "Initial", + "direct_transition": "Guard_for_Diabetes_Diagnosis" + }, + "Guard_for_Diabetes_Diagnosis": { + "type": "Guard", + "allow": { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": 44054006, + "display": "Diabetes mellitus type 2 (disorder)" + } + ] + }, + "distributed_transition": [ + { + "transition": "Delay_before_first_encounter", + "distribution": 0.75 + }, + { + "transition": "Guard_for_Vision_Impact", + "distribution": 0.25 + } + ] + }, + "Delay_before_first_encounter": { + "type": "Delay", + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 5, + "low": 1 + } + }, + "unit": "weeks", + "direct_transition": "Initial_Ophthalmic_Encounter" + }, + "Check_Visual_Acuity": { + "type": "CallSubmodule", + "submodule": "eye/visual_acuity", + "direct_transition": "Check_IOP" + }, + "Slit-lamp biomicroscopy": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 55468007, + "display": "Ocular slit lamp examination (procedure)" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 2 + } + }, + "unit": "minutes", + "direct_transition": "Dilation" + }, + "Check_IOP": { + "type": "CallSubmodule", + "submodule": "eye/intraocular_pressure", + "direct_transition": "Slit-lamp biomicroscopy" + }, + "Patient history": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 84100007, + "display": "History taking (procedure)" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 5 + } + }, + "unit": "minutes", + "direct_transition": "Progress_DR_Vitals" + }, + "Gonioscopy": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 389153003, + "display": "Indirect gonioscopy (procedure)" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 10 + } + }, + "unit": "minutes", + "direct_transition": "Fundoscopy" + }, + "Examination of the peripheral retina and vitreous": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 722161008, + "display": "Diabetic retinal eye exam (procedure)" + } + ], + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 5, + "low": 2 + } + }, + "unit": "minutes", + "direct_transition": "Consider_OCT" + }, + "Consider_Panretinal_Laser": { + "type": "Simple", + "complex_transition": [ + { + "condition": { + "condition_type": "PriorState", + "name": "Panretinal Laser" + }, + "distributions": [], + "transition": "Consider_Grid_Laser" + }, + { + "condition": { + "condition_type": "Attribute", + "attribute": "diabetic_retinopathy_stage", + "operator": "==", + "value": 4 + }, + "distributions": [ + { + "distribution": 0.85, + "transition": "Numbing_Drops_Panretinal_Laser" + }, + { + "transition": "Consider_Grid_Laser", + "distribution": 0.15 + } + ] + }, + { + "condition": { + "condition_type": "Attribute", + "attribute": "diabetic_retinopathy_stage", + "operator": "==", + "value": 3 + }, + "distributions": [ + { + "distribution": 0.25, + "transition": "Numbing_Drops_Panretinal_Laser" + }, + { + "transition": "Consider_Grid_Laser", + "distribution": 0.75 + } + ] + }, + { + "distributions": [], + "transition": "Consider_Grid_Laser" + } + ] + }, + "Consider_Grid_Laser": { + "type": "Simple", + "complex_transition": [ + { + "condition": { + "condition_type": "PriorState", + "name": "Grid_Laser", + "within": { + "quantity": 1, + "unit": "years" + } + }, + "distributions": [], + "transition": "Consider_AntiVEGF_Therapy" + }, + { + "condition": { + "condition_type": "Attribute", + "attribute": "macular_edema", + "operator": "==", + "value": true + }, + "distributions": [ + { + "distribution": 0.2, + "transition": "Numbing_Drops_Grid_Laser" + }, + { + "transition": "Consider_AntiVEGF_Therapy", + "distribution": 0.8 + } + ] + }, + { + "distributions": [], + "transition": "Consider_AntiVEGF_Therapy" + } + ] + }, + "Consider_AntiVEGF_Therapy": { + "type": "Simple", + "complex_transition": [ + { + "condition": { + "condition_type": "Attribute", + "attribute": "diabetic_retinopathy_stage", + "operator": "==", + "value": 4 + }, + "distributions": [], + "transition": "Numbing_Drops_AntiVEGF_Injection" + }, + { + "condition": { + "condition_type": "And", + "conditions": [ + { + "condition_type": "Attribute", + "attribute": "diabetic_retinopathy_stage", + "operator": ">=", + "value": 2 + }, + { + "condition_type": "Attribute", + "attribute": "macular_edema", + "operator": "==", + "value": true + } + ] + }, + "distributions": [ + { + "distribution": 0.85, + "transition": "Numbing_Drops_AntiVEGF_Injection" + }, + { + "transition": "End_Encounter", + "distribution": 0.15 + } + ] + }, + { + "distributions": [], + "transition": "End_Encounter" + } + ] + }, + "Schedule_Followup": { + "type": "Simple", + "lookup_table_transition": [ + { + "transition": "Followup_2-4Months", + "default_probability": 0, + "lookup_table_name": "diabetic_retinopathy_followup.csv" + }, + { + "transition": "Followup_3-6Months", + "default_probability": 0, + "lookup_table_name": "diabetic_retinopathy_followup.csv" + }, + { + "transition": "Followup_6-12Months", + "default_probability": 0, + "lookup_table_name": "diabetic_retinopathy_followup.csv" + }, + { + "transition": "Followup_Yearly", + "default_probability": 1, + "lookup_table_name": "diabetic_retinopathy_followup.csv" + }, + { + "transition": "Followup_Monthly", + "default_probability": 0, + "lookup_table_name": "diabetic_retinopathy_followup.csv" + } + ] + }, + "Followup_Yearly": { + "type": "Delay", + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 13, + "low": 11 + } + }, + "unit": "months", + "direct_transition": "Subsequent_Ophthalmic_Encounters" + }, + "Followup_Monthly": { + "type": "Delay", + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 1 + } + }, + "unit": "months", + "direct_transition": "Subsequent_Ophthalmic_Encounters" + }, + "Followup_6-12Months": { + "type": "Delay", + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 12, + "low": 6 + } + }, + "unit": "months", + "direct_transition": "Subsequent_Ophthalmic_Encounters" + }, + "Followup_3-6Months": { + "type": "Delay", + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 6, + "low": 3 + } + }, + "unit": "months", + "direct_transition": "Subsequent_Ophthalmic_Encounters" + }, + "Followup_2-4Months": { + "type": "Delay", + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 4, + "low": 2 + } + }, + "unit": "months", + "direct_transition": "Subsequent_Ophthalmic_Encounters" + }, + "Make_Diagnoses": { + "type": "CallSubmodule", + "submodule": "metabolic_syndrome/diabetic_retinopathy_diagnoses", + "direct_transition": "Consider_Panretinal_Laser" + }, + "Consider_OCT": { + "type": "Simple", + "conditional_transition": [ + { + "transition": "OCT", + "condition": { + "condition_type": "Or", + "conditions": [ + { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": 1551000119108, + "display": "Nonproliferative diabetic retinopathy due to type 2 diabetes mellitus (disorder)" + } + ] + }, + { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": 1501000119109, + "display": "Proliferative diabetic retinopathy due to type II diabetes mellitus (disorder)" + } + ] + } + ] + } + }, + { + "transition": "Make_Diagnoses" + } + ] + }, + "OCT": { + "type": "CallSubmodule", + "submodule": "eye/ophthalmic_tomography", + "direct_transition": "Make_Diagnoses" + }, + "End_Encounter": { + "type": "EncounterEnd", + "direct_transition": "Schedule_Followup" + }, + "Panretinal Laser": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 413180006, + "display": "Pan retinal photocoagulation for diabetes (procedure)" + } + ], + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 60, + "low": 30 + } + }, + "unit": "minutes", + "direct_transition": "End_Encounter" + }, + "Grid_Laser": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 397539000, + "display": "Grid retinal photocoagulation (procedure)" + } + ], + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 60, + "low": 30 + } + }, + "unit": "minutes", + "direct_transition": "End_Encounter" + }, + "Progress_DR_Vitals": { + "type": "CallSubmodule", + "submodule": "eye/ophthalmic_progression", + "direct_transition": "Check_Visual_Acuity" + }, + "AntiVEGF_Therapy_Med": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 1657066, + "display": "4 ML bevacizumab 25 MG/ML Injection" + } + ], + "direct_transition": "AntiVEGF_Therapy_Procedure", + "administration": true + }, + "AntiVEGF_Therapy_Procedure": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 1004045004, + "display": "Intravitreal injection of anti-vascular endothelial growth factor (procedure)" + } + ], + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 10, + "low": 5 + } + }, + "unit": "minutes", + "direct_transition": "End_Encounter" + }, + "Numbing_Drops_Panretinal_Laser": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 1191013, + "display": "proparacaine hydrochloride 5 MG/ML Ophthalmic Solution" + } + ], + "direct_transition": "End_Drops_Panretinal", + "administration": true + }, + "Numbing_Drops_Grid_Laser": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 1191013, + "display": "proparacaine hydrochloride 5 MG/ML Ophthalmic Solution" + } + ], + "direct_transition": "End_Drops_Grid", + "administration": true + }, + "Numbing_Drops_AntiVEGF_Injection": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 1191013, + "display": "proparacaine hydrochloride 5 MG/ML Ophthalmic Solution" + } + ], + "direct_transition": "End_Drops_AntiVEGF", + "administration": true + }, + "Dilation": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 313521, + "display": "tropicamide 5 MG/ML Ophthalmic Solution" + } + ], + "direct_transition": "End_Dilation_Med", + "administration": true + }, + "Guard_for_Vision_Impact": { + "type": "Guard", + "allow": { + "condition_type": "Attribute", + "attribute": "diabetic_retinopathy_stage", + "operator": "==", + "value": 3 + }, + "direct_transition": "Initial_Ophthalmic_Encounter", + "remarks": [ + "Intended to represent patients who don't seek treatment until there are significant vision impacts" + ] + }, + "Fundoscopy": { + "type": "ImagingStudy", + "procedure_code": { + "system": "SNOMED-CT", + "code": 314971001, + "display": "Camera fundoscopy (procedure)" + }, + "series": [ + { + "body_site": { + "system": "SNOMED-CT", + "code": 181171005, + "display": "Entire retina (body structure)" + }, + "modality": { + "system": "DICOM-DCM", + "code": "OP", + "display": "Ophthalmic Photography" + }, + "instances": [ + { + "title": "OS", + "sop_class": { + "system": "DICOM-SOP", + "code": "1.2.840.10008.5.1.4.1.1.77.1.5.1", + "display": "Ophthalmic Photography 8 Bit Image Storage" + } + }, + { + "title": "OD", + "sop_class": { + "system": "DICOM-SOP", + "code": "1.2.840.10008.5.1.4.1.1.77.1.5.1", + "display": "Ophthalmic Photography 8 Bit Image Storage" + } + } + ] + } + ], + "direct_transition": "Examination of the peripheral retina and vitreous", + "remarks": [ + "DICOM notes: https://www.dicomstandard.org/News-dir/ftsup/docs/sups/sup91.pdf" + ] + }, + "Initial_Ophthalmic_Encounter": { + "type": "Encounter", + "encounter_class": "ambulatory", + "reason": "", + "telemedicine_possibility": "none", + "codes": [ + { + "system": "SNOMED-CT", + "code": "36228007", + "display": "Ophthalmic examination and evaluation (procedure)" + }, + { + "system": "SNOMED-CT", + "code": "185387006", + "display": "New patient consultation (procedure)" + } + ], + "direct_transition": "Patient history" + }, + "Subsequent_Ophthalmic_Encounters": { + "type": "Encounter", + "encounter_class": "ambulatory", + "reason": "", + "telemedicine_possibility": "none", + "codes": [ + { + "system": "SNOMED-CT", + "code": "36228007", + "display": "Ophthalmic examination and evaluation (procedure)" + } + ], + "direct_transition": "Progress_DR_Vitals" + }, + "End_Drops_Panretinal": { + "type": "MedicationEnd", + "direct_transition": "Panretinal Laser", + "medication_order": "Numbing_Drops_Panretinal_Laser" + }, + "End_Drops_AntiVEGF": { + "type": "MedicationEnd", + "direct_transition": "AntiVEGF_Therapy_Med", + "medication_order": "Numbing_Drops_AntiVEGF_Injection" + }, + "End_Drops_Grid": { + "type": "MedicationEnd", + "direct_transition": "Grid_Laser", + "medication_order": "Numbing_Drops_Grid_Laser" + }, + "End_Dilation_Med": { + "type": "MedicationEnd", + "direct_transition": "Gonioscopy", + "medication_order": "Dilation" + } + }, + "gmf_version": 2 +} \ No newline at end of file diff --git a/src/main/resources/modules/eye/intraocular_pressure.json b/src/main/resources/modules/eye/intraocular_pressure.json new file mode 100644 index 0000000000..0178dc4dd9 --- /dev/null +++ b/src/main/resources/modules/eye/intraocular_pressure.json @@ -0,0 +1,129 @@ +{ + "name": "Intraocular Pressure", + "remarks": [ + "Submodule for IOP procedure and findings." + ], + "states": { + "Initial": { + "type": "Initial", + "direct_transition": "IOP_Test" + }, + "Terminal": { + "type": "Terminal" + }, + "IOP_Test": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": "252832004", + "display": "Intraocular pressure test (procedure)" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 1 + } + }, + "unit": "minutes", + "direct_transition": "IOP_Results_Left" + }, + "Timolol": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 1923432, + "display": "dorzolamide 20 MG/ML / timolol 5 MG/ML Ophthalmic Solution" + } + ], + "direct_transition": "Terminal", + "assign_to_attribute": "eye_pressure_med" + }, + "Brimonidine": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 861204, + "display": "brimonidine tartrate 1 MG/ML Ophthalmic Solution" + } + ], + "direct_transition": "Terminal", + "assign_to_attribute": "eye_pressure_med" + }, + "High IOP Meds": { + "type": "Simple", + "complex_transition": [ + { + "condition": { + "condition_type": "Attribute", + "attribute": "intraocular_pressure", + "operator": ">", + "value": 21 + }, + "distributions": [ + { + "transition": "Timolol", + "distribution": 0.5 + }, + { + "transition": "Brimonidine", + "distribution": 0.5 + } + ] + }, + { + "distributions": [], + "transition": "Terminal" + } + ] + }, + "IOP_Results_Left": { + "type": "Observation", + "category": "vital-signs", + "unit": "mm[Hg]", + "codes": [ + { + "system": "LOINC", + "code": "79893-4", + "display": "Left eye Intraocular pressure" + }, + { + "system": "SNOMED-CT", + "code": "41633001", + "display": "Intraocular pressure (observable entity)" + } + ], + "direct_transition": "IOP_Results_Right", + "remarks": [ + "Note code 2 is actually SNOMED" + ], + "attribute": "intraocular_pressure" + }, + "IOP_Results_Right": { + "type": "Observation", + "category": "vital-signs", + "unit": "mm[Hg]", + "codes": [ + { + "system": "LOINC", + "code": "79892-6", + "display": "Right eye Intraocular pressure" + }, + { + "system": "SNOMED-CT", + "code": "41633001", + "display": "Intraocular pressure (observable entity)" + } + ], + "direct_transition": "High IOP Meds", + "remarks": [ + "Note code 1 is actually SNOMED" + ], + "attribute": "intraocular_pressure" + } + }, + "gmf_version": 2 +} \ No newline at end of file diff --git a/src/main/resources/modules/eye/ophthalmic_progression.json b/src/main/resources/modules/eye/ophthalmic_progression.json new file mode 100644 index 0000000000..236cffb535 --- /dev/null +++ b/src/main/resources/modules/eye/ophthalmic_progression.json @@ -0,0 +1,368 @@ +{ + "name": "ophthalmic_progression", + "states": { + "Initial": { + "type": "Initial", + "direct_transition": "Check_Stage" + }, + "Terminal": { + "type": "Terminal" + }, + "Set_VA_High": { + "type": "SetAttribute", + "attribute": "visual_acuity_logmar", + "direct_transition": "Check_IOP", + "value": 0 + }, + "Set_VA_Low": { + "type": "SetAttribute", + "attribute": "visual_acuity_logmar", + "direct_transition": "Check_IOP", + "value": 0.3 + }, + "Check_Edema_for_VA": { + "type": "Simple", + "conditional_transition": [ + { + "transition": "Set_VA_Low", + "condition": { + "condition_type": "Attribute", + "attribute": "macular_edema", + "operator": "==", + "value": true + } + }, + { + "transition": "Set_VA_High" + } + ] + }, + "Check_IOP": { + "type": "Simple", + "complex_transition": [ + { + "condition": { + "condition_type": "Attribute", + "attribute": "high_iop", + "operator": "==", + "value": true + }, + "distributions": [ + { + "transition": "Set_High_IOP_Flag", + "distribution": 1 + } + ] + }, + { + "condition": { + "condition_type": "Attribute", + "attribute": "diabetic_retinopathy_stage", + "operator": "==", + "value": 4 + }, + "distributions": [ + { + "distribution": 0.001, + "transition": "Set_High_IOP_Flag" + }, + { + "transition": "Set_IOP_Normal_Range", + "distribution": 0.9990000000000001 + } + ] + }, + { + "distributions": [ + { + "distribution": 1, + "transition": "Set_IOP_Normal_Range" + } + ] + } + ] + }, + "Set_High_IOP_Flag": { + "type": "SetAttribute", + "attribute": "high_iop", + "value": true, + "conditional_transition": [ + { + "transition": "Set_IOP_High_Reduced", + "condition": { + "condition_type": "Active Medication", + "codes": [ + { + "system": "RxNorm", + "code": 1923432, + "display": "dorzolamide 20 MG/ML / timolol 5 MG/ML Ophthalmic Solution" + }, + { + "system": "RxNorm", + "code": 861204, + "display": "brimonidine tartrate 1 MG/ML Ophthalmic Solution" + } + ] + } + }, + { + "transition": "Set_IOP_High_Range" + } + ] + }, + "Set_IOP_Normal_Range": { + "type": "SetAttribute", + "attribute": "intraocular_pressure", + "direct_transition": "Set_Findings_Right", + "distribution": { + "kind": "UNIFORM", + "round": true, + "parameters": { + "high": 18, + "low": 14 + } + } + }, + "Set_IOP_High_Range": { + "type": "SetAttribute", + "attribute": "intraocular_pressure", + "direct_transition": "Set_Findings_Right", + "distribution": { + "kind": "UNIFORM", + "round": true, + "parameters": { + "high": 24, + "low": 18 + } + } + }, + "Set_IOP_High_Reduced": { + "type": "SetAttribute", + "attribute": "intraocular_pressure", + "direct_transition": "Set_Findings_Right", + "distribution": { + "kind": "UNIFORM", + "round": false, + "parameters": { + "high": 18, + "low": 15 + } + } + }, + "Set_Findings_Left": { + "type": "SetAttribute", + "attribute": "oct_findings_left", + "direct_transition": "Set_oct_center_point_thickness", + "value_code": { + "system": "LOINC", + "code": "LA28409-8", + "display": "No abnormal findings" + } + }, + "Set_Findings_Right": { + "type": "SetAttribute", + "attribute": "oct_findings_right", + "direct_transition": "Set_Findings_Left", + "value_code": { + "system": "LOINC", + "code": "LA28409-8", + "display": "No abnormal findings" + } + }, + "Check_Stage": { + "type": "Simple", + "conditional_transition": [ + { + "transition": "Set_Stage_Code_0", + "condition": { + "condition_type": "Attribute", + "attribute": "diabetic_retinopathy_stage", + "operator": "==", + "value": 0 + } + }, + { + "transition": "Set_Stage_Code_1", + "condition": { + "condition_type": "Attribute", + "attribute": "diabetic_retinopathy_stage", + "operator": "==", + "value": 1 + } + }, + { + "transition": "Set_Stage_Code_2", + "condition": { + "condition_type": "Attribute", + "attribute": "diabetic_retinopathy_stage", + "operator": "==", + "value": 2 + } + }, + { + "transition": "Set_Stage_Code_3", + "condition": { + "condition_type": "Attribute", + "attribute": "diabetic_retinopathy_stage", + "operator": "==", + "value": 3 + } + }, + { + "transition": "Set_Stage_Code_4", + "condition": { + "condition_type": "Attribute", + "attribute": "diabetic_retinopathy_stage", + "operator": "==", + "value": 4 + } + } + ], + "remarks": [ + "https://loinc.org/LL2117-1" + ] + }, + "Set_Stage_Code_0": { + "type": "SetAttribute", + "attribute": "diabetic_retinopathy_stage_code", + "value_code": { + "system": "LOINC", + "code": "LA18643-9", + "display": "No apparent retinopathy" + }, + "direct_transition": "Check_Edema_for_VA" + }, + "Set_Stage_Code_1": { + "type": "SetAttribute", + "attribute": "diabetic_retinopathy_stage_code", + "value_code": { + "system": "LOINC", + "code": "LA18644-7", + "display": "Mild non-proliferative retinopathy" + }, + "direct_transition": "Check_Edema_for_VA" + }, + "Set_Stage_Code_2": { + "type": "SetAttribute", + "attribute": "diabetic_retinopathy_stage_code", + "value_code": { + "system": "LOINC", + "code": "LA18645-4", + "display": "Moderate non-proliferative retinopathy" + }, + "direct_transition": "Check_Edema_for_VA" + }, + "Set_Stage_Code_3": { + "type": "SetAttribute", + "attribute": "diabetic_retinopathy_stage_code", + "value_code": { + "system": "LOINC", + "code": "LA18646-2", + "display": "Severe non-proliferative retinopathy" + }, + "direct_transition": "Check_Edema_for_VA" + }, + "Set_Stage_Code_4": { + "type": "SetAttribute", + "attribute": "diabetic_retinopathy_stage_code", + "value_code": { + "system": "LOINC", + "code": "LA18648-8", + "display": "Proliferative retinopathy" + }, + "direct_transition": "Check_Edema_for_VA" + }, + "Set_oct_center_point_thickness": { + "type": "SetAttribute", + "attribute": "oct_center_point_thickness", + "direct_transition": "Set_oct_center_subfield_thickness", + "value": "227" + }, + "Set_oct_center_subfield_thickness": { + "type": "SetAttribute", + "attribute": "oct_center_subfield_thickness", + "direct_transition": "Set_oct_inner_superior_subfield_thickness", + "value": "270" + }, + "Set_oct_inner_superior_subfield_thickness": { + "type": "SetAttribute", + "attribute": "oct_inner_superior_subfield_thickness", + "direct_transition": "Set_oct_inner_nasal_subfield_thickness", + "value": "335" + }, + "Set_oct_inner_nasal_subfield_thickness": { + "type": "SetAttribute", + "attribute": "oct_inner_nasal_subfield_thickness", + "direct_transition": "Set_oct_inner_inferior_subfield_thickness", + "value": "338" + }, + "Set_oct_inner_inferior_subfield_thickness": { + "type": "SetAttribute", + "attribute": "oct_inner_inferior_subfield_thickness", + "direct_transition": "Set_oct_inner_temporal_subfield_thickness", + "value": "332" + }, + "Set_oct_inner_temporal_subfield_thickness": { + "type": "SetAttribute", + "attribute": "oct_inner_temporal_subfield_thickness", + "direct_transition": "Set_oct_outer_superior_subfield_thickness", + "value": "324" + }, + "Set_oct_outer_superior_subfield_thickness": { + "type": "SetAttribute", + "attribute": "oct_outer_superior_subfield_thickness", + "direct_transition": "Set_oct_outer_nasal_subfield_thickness", + "value": "290" + }, + "Set_oct_outer_nasal_subfield_thickness": { + "type": "SetAttribute", + "attribute": "oct_outer_nasal_subfield_thickness", + "direct_transition": "Set_oct_outer_inferior_subfield_thickness", + "value": "305" + }, + "Set_oct_outer_inferior_subfield_thickness": { + "type": "SetAttribute", + "attribute": "oct_outer_inferior_subfield_thickness", + "direct_transition": "Set_oct_outer_temporal_subfield_thickness", + "value": "280" + }, + "Set_oct_outer_temporal_subfield_thickness": { + "type": "SetAttribute", + "attribute": "oct_outer_temporal_subfield_thickness", + "direct_transition": "Set_oct_total_volume", + "value": "279" + }, + "Set_oct_total_volume": { + "type": "SetAttribute", + "attribute": "oct_total_volume", + "direct_transition": "Terminal", + "value": "8.4" + } + }, + "gmf_version": 2, + "remarks": [ + "A simple module to represent a few aspects of the progression of diabetic retinopathy. On the original \"diabetic_retinopathy\" branch this was implemented as a Java submodule which allows for additional power, but is opaque to the module builder and most users. The main difference is in the OCT quantitative measurements; in the original an individual had a single randomized offset which was applied to every value, here the values are fixed.", + "", + "Stage Codes are from https://loinc.org/LL2117-1", + "", + "Visual Acuity modeled in LogMAR", + "some examples (ref: https://en.wikipedia.org/wiki/LogMAR_chart)", + "Foot LogMAR", + "20/200 1.00", + "20/160 0.90", + "20/100 0.70", + "20/80 0.60", + "20/40 0.30", + "20/20 0.00", + "20/16 −0.10", + "", + "IOP:", + "\"Pressures of between 11 and 21 mmHg are considered normal\"", + "https://www.ncbi.nlm.nih.gov/books/NBK532237/", + "https://www.mdpi.com/2077-0383/13/3/676", + "", + "OCT measurements:", + "https://iovs.arvojournals.org/article.aspx?articleid=2165526", + "another source (not used) https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1941772/" + ] +} \ No newline at end of file diff --git a/src/main/resources/modules/eye/ophthalmic_tomography.json b/src/main/resources/modules/eye/ophthalmic_tomography.json new file mode 100644 index 0000000000..d75e4cb794 --- /dev/null +++ b/src/main/resources/modules/eye/ophthalmic_tomography.json @@ -0,0 +1,104 @@ +{ + "name": "ophthalmic_tomography", + "remarks": [ + "Submodule containing OCT imaging study and qualitative findings.", + "Quantitative findings are possible, but generally not present in real-world EHRs." + ], + "states": { + "Initial": { + "type": "Initial", + "direct_transition": "OCT_Imaging" + }, + "Terminal": { + "type": "Terminal" + }, + "OCT_Imaging": { + "type": "ImagingStudy", + "procedure_code": { + "system": "SNOMED-CT", + "code": "700070005", + "display": "Optical coherence tomography of retina (procedure)" + }, + "series": [ + { + "body_site": { + "system": "SNOMED-CT", + "code": "181171005", + "display": "Entire retina (body structure)" + }, + "modality": { + "system": "DICOM-DCM", + "code": "OPT", + "display": "Ophthalmic Tomography" + }, + "instances": [ + { + "title": "OS", + "sop_class": { + "system": "DICOM-SOP", + "code": "1.2.840.10008.5.1.4.1.1.77.1.5.4", + "display": "Ophthalmic Tomography Image" + } + }, + { + "title": "OD", + "sop_class": { + "system": "DICOM-SOP", + "code": "1.2.840.10008.5.1.4.1.1.77.1.5.4", + "display": "Ophthalmic Tomography Image" + } + } + ] + } + ], + "direct_transition": "Qualitative_Report", + "remarks": [ + "Body site \"entire retina\" has child codes for left/right eye; sibling codes for other parts", + "", + "DICOM notes: https://www.dicomstandard.org/News-dir/ftsup/docs/sups/sup110.pdf" + ] + }, + "Qualitative_Report": { + "type": "DiagnosticReport", + "codes": [ + { + "system": "LOINC", + "code": "87674-8", + "display": "Optical coherence tomography study" + } + ], + "observations": [ + { + "category": "imaging", + "unit": "{nominal}", + "codes": [ + { + "system": "LOINC", + "code": "79819-9", + "display": "Study observation Left retina by OCT" + } + ], + "attribute": "oct_findings_left" + }, + { + "category": "imaging", + "unit": "{nominal}", + "codes": [ + { + "system": "LOINC", + "code": "79818-1", + "display": "Study observation Right retina by OCT" + } + ], + "attribute": "oct_findings_right" + } + ], + "direct_transition": "Terminal", + "remarks": [ + "Note different codes for Left/Right", + "Answer list at https://loinc.org/79818-1/" + ] + } + }, + "gmf_version": 2 +} \ No newline at end of file diff --git a/src/main/resources/modules/eye/visual_acuity.json b/src/main/resources/modules/eye/visual_acuity.json new file mode 100644 index 0000000000..1c2f86d93a --- /dev/null +++ b/src/main/resources/modules/eye/visual_acuity.json @@ -0,0 +1,98 @@ +{ + "name": "Visual Acuity", + "remarks": [ + "Simple visual acuity tests. Tests are skipped if the patient is blind.", + "", + "Codes are selected based on the \"Eyes on FHIR\" IG:", + "https://build.fhir.org/ig/HL7/fhir-eyecare-ig/index.html" + ], + "states": { + "Initial": { + "type": "Initial", + "conditional_transition": [ + { + "transition": "Terminal", + "condition": { + "condition_type": "Attribute", + "attribute": "blindness", + "operator": "==", + "value": true + } + }, + { + "transition": "VA_Test" + } + ] + }, + "Terminal": { + "type": "Terminal" + }, + "VA_Test": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 16830007, + "display": "Visual acuity testing (procedure)" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 1 + } + }, + "unit": "minutes", + "direct_transition": "VA_Results_Left" + }, + "VA_Results_Left": { + "type": "Observation", + "category": "exam", + "unit": "{logmar}", + "codes": [ + { + "system": "SNOMED-CT", + "code": 413077008, + "display": "LogMAR visual acuity left eye (observable entity)" + }, + { + "system": "LOINC", + "code": "98498-9", + "display": "Visual acuity uncorrected Left eye" + } + ], + "direct_transition": "VA_Results_Right", + "remarks": [ + "Note code 1 is SNOMED per eyes-on-fhir IG", + "", + "LOINC has options for left/right, corrrected/uncorrected, near/far: https://loinc.org/98497-1/" + ], + "attribute": "visual_acuity_logmar" + }, + "VA_Results_Right": { + "type": "Observation", + "category": "exam", + "unit": "{logmar}", + "codes": [ + { + "system": "SNOMED-CT", + "code": 413078003, + "display": "LogMAR visual acuity right eye (observable entity)" + }, + { + "system": "LOINC", + "code": "98499-7", + "display": "Visual acuity uncorrected Right eye" + } + ], + "direct_transition": "Terminal", + "remarks": [ + "Note code 1 is SNOMED per eyes-on-fhir IG", + "", + "LOINC has options for left/right, corrrected/uncorrected, near/far: https://loinc.org/98497-1/" + ], + "attribute": "visual_acuity_logmar" + } + }, + "gmf_version": 2 +} \ No newline at end of file diff --git a/src/main/resources/modules/lookup_tables/diabetic_retinopathy_followup.csv b/src/main/resources/modules/lookup_tables/diabetic_retinopathy_followup.csv new file mode 100644 index 0000000000..3fba1bae01 --- /dev/null +++ b/src/main/resources/modules/lookup_tables/diabetic_retinopathy_followup.csv @@ -0,0 +1,11 @@ +diabetic_retinopathy_stage,macular_edema,Followup_Yearly,Followup_6-12Months,Followup_3-6Months,Followup_2-4Months,Followup_Monthly +0,false,1,0,0,0,0 +0,true,1,0,0,0,0 +1,false,1,0,0,0,0 +1,true,0,0,1,0,0 +2,false,0,1,0,0,0 +2,true,0,0,1,0,0 +3,false,0,0,1,0,0 +3,true,0,0,0,1,0 +4,false,0,0,0,1,0 +4,true,0,0,0,0,1 \ No newline at end of file diff --git a/src/main/resources/modules/metabolic_syndrome/diabetic_retinopathy_diagnoses.json b/src/main/resources/modules/metabolic_syndrome/diabetic_retinopathy_diagnoses.json new file mode 100644 index 0000000000..81e49058d2 --- /dev/null +++ b/src/main/resources/modules/metabolic_syndrome/diabetic_retinopathy_diagnoses.json @@ -0,0 +1,238 @@ +{ + "name": "diabetic retinopathy diagnoses", + "remarks": [], + "states": { + "Initial": { + "type": "Initial", + "direct_transition": "DR_Stage_Left_Eye" + }, + "Check_Nonproliferative_Retinopathy": { + "type": "Simple", + "conditional_transition": [ + { + "condition": { + "condition_type": "And", + "conditions": [ + { + "condition_type": "Attribute", + "attribute": "diabetic_retinopathy_stage", + "operator": "<=", + "value": 3 + }, + { + "condition_type": "Not", + "condition": { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": "1551000119108", + "display": "Nonproliferative diabetic retinopathy due to type 2 diabetes mellitus (disorder)" + } + ] + } + } + ] + }, + "transition": "Diagnose_Nonproliferative_Retinopathy" + }, + { + "transition": "Check_Proliferative_Retinopathy" + } + ] + }, + "Diagnose_Nonproliferative_Retinopathy": { + "type": "ConditionOnset", + "codes": [ + { + "system": "SNOMED-CT", + "code": "1551000119108", + "display": "Nonproliferative diabetic retinopathy due to type 2 diabetes mellitus (disorder)" + } + ], + "direct_transition": "Check_Proliferative_Retinopathy" + }, + "Check_Proliferative_Retinopathy": { + "type": "Simple", + "conditional_transition": [ + { + "condition": { + "condition_type": "And", + "conditions": [ + { + "condition_type": "Attribute", + "attribute": "diabetic_retinopathy_stage", + "operator": "==", + "value": 4 + }, + { + "condition_type": "Not", + "condition": { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": "1501000119109", + "display": "Proliferative diabetic retinopathy due to type II diabetes mellitus (disorder)" + } + ] + } + } + ] + }, + "transition": "Diagnose_Proliferative_Retinopathy" + }, + { + "transition": "Check_Macular_Edema" + } + ] + }, + "Diagnose_Proliferative_Retinopathy": { + "type": "ConditionOnset", + "codes": [ + { + "system": "SNOMED-CT", + "code": "1501000119109", + "display": "Proliferative diabetic retinopathy due to type II diabetes mellitus (disorder)" + } + ], + "direct_transition": "Check_Macular_Edema" + }, + "Check_Macular_Edema": { + "type": "Simple", + "conditional_transition": [ + { + "condition": { + "condition_type": "And", + "conditions": [ + { + "condition_type": "Attribute", + "attribute": "macular_edema", + "operator": "==", + "value": true + }, + { + "condition_type": "Not", + "condition": { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": "97331000119101", + "display": "Macular edema and retinopathy due to type 2 diabetes mellitus (disorder)" + } + ] + } + } + ] + }, + "transition": "Diagnose_Macular_Edema" + }, + { + "transition": "Check_Blindness" + } + ] + }, + "Diagnose_Macular_Edema": { + "type": "ConditionOnset", + "codes": [ + { + "system": "SNOMED-CT", + "code": "97331000119101", + "display": "Macular edema and retinopathy due to type 2 diabetes mellitus (disorder)" + } + ], + "direct_transition": "Check_Blindness" + }, + "Check_Blindness": { + "type": "Simple", + "conditional_transition": [ + { + "condition": { + "condition_type": "And", + "conditions": [ + { + "condition_type": "Attribute", + "attribute": "blindness", + "operator": "is not nil" + }, + { + "condition_type": "Not", + "condition": { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": "60951000119105", + "display": "Blindness due to type 2 diabetes mellitus (disorder)" + } + ] + } + } + ] + }, + "transition": "Diagnose_Blindness" + }, + { + "transition": "Terminal" + } + ] + }, + "Diagnose_Blindness": { + "type": "ConditionOnset", + "codes": [ + { + "system": "SNOMED-CT", + "code": "60951000119105", + "display": "Blindness due to type 2 diabetes mellitus (disorder)" + } + ], + "direct_transition": "Terminal" + }, + "Terminal": { + "type": "Terminal" + }, + "DR_Stage_Left_Eye": { + "type": "Observation", + "category": "exam", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "71490-7", + "display": "Left eye Diabetic retinopathy severity level by Ophthalmoscopy" + } + ], + "attribute": "diabetic_retinopathy_stage_code", + "direct_transition": "DR_Stage_Right_Eye" + }, + "DR_Stage_Right_Eye": { + "type": "Observation", + "category": "exam", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "71491-5", + "display": "Right eye Diabetic retinopathy severity level by Ophthalmoscopy" + } + ], + "attribute": "diabetic_retinopathy_stage_code", + "conditional_transition": [ + { + "transition": "Terminal", + "condition": { + "condition_type": "Attribute", + "attribute": "diabetic_retinopathy_stage", + "operator": "==", + "value": 0 + } + }, + { + "transition": "Check_Nonproliferative_Retinopathy" + } + ] + } + }, + "gmf_version": 2 +} \ No newline at end of file diff --git a/src/main/resources/modules/metabolic_syndrome/diabetic_retinopathy_progression.json b/src/main/resources/modules/metabolic_syndrome/diabetic_retinopathy_progression.json new file mode 100644 index 0000000000..f7cdf97821 --- /dev/null +++ b/src/main/resources/modules/metabolic_syndrome/diabetic_retinopathy_progression.json @@ -0,0 +1,233 @@ +{ + "name": "Diabetic Retinopathy Progression", + "remarks": [], + "states": { + "Initial": { + "type": "Initial", + "direct_transition": "Retinopathy_Progression" + }, + "Retinopathy_Progression": { + "type": "Simple", + "remarks": [ + "In the USA, studies estimate that 28.5–40.3 % of patients with type 2 diabetes had DR, and 4.4–8.2 % of them had VTDR", + "https://www.ncbi.nlm.nih.gov/pubmed/15078674", + "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4657234/", + "https://eandv.biomedcentral.com/articles/10.1186/s40662-015-0026-2", + "Currently the %s below do not take into consideration any medications the patient may be taking" + ], + "complex_transition": [ + { + "condition": { + "condition_type": "Attribute", + "attribute": "diabetic_retinopathy_stage", + "operator": "==", + "value": 0 + }, + "distributions": [ + { + "distribution": 0.998, + "transition": "Terminal" + }, + { + "distribution": 0.002, + "transition": "Set_Mild_Eye_Damage" + } + ], + "remarks": [ + "Prevalence of DR = ~40%, we assume an estimated lifespan of ~20 yrs after diagnosis", + ".2%/month over 20 yrs, 1- (.998 ^ (12*20)) = .38 " + ] + }, + { + "condition": { + "condition_type": "Attribute", + "attribute": "diabetic_retinopathy_stage", + "operator": "==", + "value": 1 + }, + "distributions": [ + { + "distribution": 0.9915, + "transition": "Set_Mild_Eye_Damage" + }, + { + "distribution": 0.0085, + "transition": "Set_Moderate_Eye_Damage" + } + ], + "remarks": [ + "Roughly 10% chance of DR progression per year == 0.85% chance per month", + "https://eandv.biomedcentral.com/articles/10.1186/s40662-015-0026-2 (Table 3)" + ] + }, + { + "condition": { + "condition_type": "Attribute", + "attribute": "diabetic_retinopathy_stage", + "operator": "==", + "value": 2 + }, + "distributions": [ + { + "distribution": 0.9975, + "transition": "Set_Moderate_Eye_Damage" + }, + { + "distribution": 0.0025, + "transition": "Set_Severe_Eye_Damage" + } + ], + "remarks": [ + "Roughly 3% progression from NPDR to PDR per year == .25% per month", + "https://eandv.biomedcentral.com/articles/10.1186/s40662-015-0026-2 (Table 3 again)" + ] + }, + { + "condition": { + "condition_type": "Attribute", + "attribute": "diabetic_retinopathy_stage", + "operator": "==", + "value": 3 + }, + "distributions": [ + { + "distribution": 0.9975, + "transition": "Set_Severe_Eye_Damage" + }, + { + "transition": "Set_HighRisk_Eye_Damage", + "distribution": 0.0025 + } + ] + }, + { + "condition": { + "condition_type": "Attribute", + "attribute": "diabetic_retinopathy_stage", + "operator": "==", + "value": 4 + }, + "distributions": [], + "transition": "Set_HighRisk_Eye_Damage" + } + ] + }, + "Set_Mild_Eye_Damage": { + "type": "SetAttribute", + "attribute": "diabetic_retinopathy_stage", + "value": 1, + "direct_transition": "Mild_Eye_Damage_Symptom" + }, + "Mild_Eye_Damage_Symptom": { + "type": "Symptom", + "symptom": "Blurred Vision", + "range": { + "low": 1, + "high": 60 + }, + "direct_transition": "Terminal" + }, + "Set_Moderate_Eye_Damage": { + "type": "SetAttribute", + "attribute": "diabetic_retinopathy_stage", + "value": 2, + "direct_transition": "Moderate_Eye_Damage_Symptom" + }, + "Moderate_Eye_Damage_Symptom": { + "type": "Symptom", + "symptom": "Blurred Vision", + "range": { + "low": 20, + "high": 100 + }, + "direct_transition": "Chance_of_Macular_Edema" + }, + "Set_Severe_Eye_Damage": { + "type": "SetAttribute", + "attribute": "diabetic_retinopathy_stage", + "value": 3, + "direct_transition": "Severe_Eye_Damage_Symptom" + }, + "Severe_Eye_Damage_Symptom": { + "type": "Symptom", + "symptom": "Blurred Vision", + "range": { + "low": 50, + "high": 100 + }, + "direct_transition": "Chance_of_Macular_Edema" + }, + "Chance_of_Macular_Edema": { + "type": "Simple", + "remarks": [ + "Incidence of DME is very low. Very rough estimate == ~1% per year or less.", + "1% / yr = .08% / month ; bumped up slightly per experimentation", + "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4657234/table/Tab5/" + ], + "distributed_transition": [ + { + "distribution": 0.001, + "transition": "Set_Macular_Edema" + }, + { + "distribution": 0.999, + "transition": "Chance_of_Blindness" + } + ] + }, + "Set_Macular_Edema": { + "type": "SetAttribute", + "attribute": "macular_edema", + "value": true, + "direct_transition": "Chance_of_Blindness" + }, + "Chance_of_Blindness": { + "type": "Simple", + "remarks": [ + "estimated prevalence of blindness is ~1% in MA; among diabetics we estimate 3%", + "3% / 30 yrs = ~ 0.01 % / month", + "http://www.idf.org/sites/default/files/IDF%2520Toolkit_Backgrounder_FINAL.pdf" + ], + "distributed_transition": [ + { + "distribution": 0.0001, + "transition": "Set_Blindness" + }, + { + "distribution": 0.9999, + "transition": "Terminal" + } + ] + }, + "Set_Blindness": { + "type": "SetAttribute", + "attribute": "blindness", + "value": true, + "direct_transition": "Terminal" + }, + "Set_HighRisk_Eye_Damage": { + "type": "SetAttribute", + "attribute": "diabetic_retinopathy_stage", + "value": 4, + "direct_transition": "HighRisk_Eye_Damage_Symptom" + }, + "HighRisk_Eye_Damage_Symptom": { + "type": "Symptom", + "symptom": "Blurred Vision", + "cause": "", + "probability": 1, + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 20, + "low": 10 + } + }, + "direct_transition": "Chance_of_Macular_Edema" + }, + "Terminal": { + "type": "Terminal" + } + }, + "gmf_version": 2 +} \ No newline at end of file diff --git a/src/main/resources/modules/metabolic_syndrome/eye_conditions.json b/src/main/resources/modules/metabolic_syndrome/eye_conditions.json deleted file mode 100644 index b6029bdfd7..0000000000 --- a/src/main/resources/modules/metabolic_syndrome/eye_conditions.json +++ /dev/null @@ -1,408 +0,0 @@ -{ - "name": "eye conditions", - "remarks": [], - "states": { - "Initial": { - "type": "Initial", - "direct_transition": "Check_Retinopathy" - }, - "Check_Retinopathy": { - "type": "Simple", - "conditional_transition": [ - { - "condition": { - "condition_type": "And", - "conditions": [ - { - "condition_type": "Attribute", - "attribute": "retinopathy", - "operator": "is not nil" - }, - { - "condition_type": "Not", - "condition": { - "condition_type": "Active Condition", - "codes": [ - { - "system": "SNOMED-CT", - "code": "422034002", - "display": "Retinopathy due to type 2 diabetes mellitus (disorder)" - } - ] - } - } - ] - }, - "transition": "Diagnose_Retinopathy" - }, - { - "condition": { - "condition_type": "And", - "conditions": [ - { - "condition_type": "Attribute", - "attribute": "retinopathy", - "operator": "is nil" - }, - { - "condition_type": "Active Condition", - "codes": [ - { - "system": "SNOMED-CT", - "code": "422034002", - "display": "Retinopathy due to type 2 diabetes mellitus (disorder)" - } - ] - } - ] - }, - "transition": "End_Retinopathy" - }, - { - "transition": "Check_Nonproliferative_Retinopathy" - } - ] - }, - "Diagnose_Retinopathy": { - "type": "ConditionOnset", - "codes": [ - { - "system": "SNOMED-CT", - "code": "422034002", - "display": "Retinopathy due to type 2 diabetes mellitus (disorder)" - } - ], - "direct_transition": "Check_Nonproliferative_Retinopathy" - }, - "End_Retinopathy": { - "type": "ConditionEnd", - "codes": [ - { - "system": "SNOMED-CT", - "code": "422034002", - "display": "Retinopathy due to type 2 diabetes mellitus (disorder)" - } - ], - "direct_transition": "Check_Nonproliferative_Retinopathy" - }, - "Check_Nonproliferative_Retinopathy": { - "type": "Simple", - "conditional_transition": [ - { - "condition": { - "condition_type": "And", - "conditions": [ - { - "condition_type": "Attribute", - "attribute": "nonproliferative_retinopathy", - "operator": "is not nil" - }, - { - "condition_type": "Not", - "condition": { - "condition_type": "Active Condition", - "codes": [ - { - "system": "SNOMED-CT", - "code": "1551000119108", - "display": "Nonproliferative retinopathy due to type 2 diabetes mellitus (disorder)" - } - ] - } - } - ] - }, - "transition": "Diagnose_Nonproliferative_Retinopathy" - }, - { - "condition": { - "condition_type": "And", - "conditions": [ - { - "condition_type": "Attribute", - "attribute": "nonproliferative_retinopathy", - "operator": "is nil" - }, - { - "condition_type": "Active Condition", - "codes": [ - { - "system": "SNOMED-CT", - "code": "1551000119108", - "display": "Nonproliferative retinopathy due to type 2 diabetes mellitus (disorder)" - } - ] - } - ] - }, - "transition": "End_Nonproliferative_Retinopathy" - }, - { - "transition": "Check_Proliferative_Retinopathy" - } - ] - }, - "Diagnose_Nonproliferative_Retinopathy": { - "type": "ConditionOnset", - "codes": [ - { - "system": "SNOMED-CT", - "code": "1551000119108", - "display": "Nonproliferative retinopathy due to type 2 diabetes mellitus (disorder)" - } - ], - "direct_transition": "Check_Proliferative_Retinopathy" - }, - "End_Nonproliferative_Retinopathy": { - "type": "ConditionEnd", - "codes": [ - { - "system": "SNOMED-CT", - "code": "1551000119108", - "display": "Nonproliferative retinopathy due to type 2 diabetes mellitus (disorder)" - } - ], - "direct_transition": "Check_Proliferative_Retinopathy" - }, - "Check_Proliferative_Retinopathy": { - "type": "Simple", - "conditional_transition": [ - { - "condition": { - "condition_type": "And", - "conditions": [ - { - "condition_type": "Attribute", - "attribute": "proliferative_retinopathy", - "operator": "is not nil" - }, - { - "condition_type": "Not", - "condition": { - "condition_type": "Active Condition", - "codes": [ - { - "system": "SNOMED-CT", - "code": "1501000119109", - "display": "Proliferative retinopathy due to type 2 diabetes mellitus (disorder)" - } - ] - } - } - ] - }, - "transition": "Diagnose_Proliferative_Retinopathy" - }, - { - "condition": { - "condition_type": "And", - "conditions": [ - { - "condition_type": "Attribute", - "attribute": "proliferative_retinopathy", - "operator": "is nil" - }, - { - "condition_type": "Active Condition", - "codes": [ - { - "system": "SNOMED-CT", - "code": "1501000119109", - "display": "Proliferative retinopathy due to type 2 diabetes mellitus (disorder)" - } - ] - } - ] - }, - "transition": "End_Proliferative_Retinopathy" - }, - { - "transition": "Check_Macular_Edema" - } - ] - }, - "Diagnose_Proliferative_Retinopathy": { - "type": "ConditionOnset", - "codes": [ - { - "system": "SNOMED-CT", - "code": "1501000119109", - "display": "Proliferative retinopathy due to type 2 diabetes mellitus (disorder)" - } - ], - "direct_transition": "Check_Macular_Edema" - }, - "End_Proliferative_Retinopathy": { - "type": "ConditionEnd", - "codes": [ - { - "system": "SNOMED-CT", - "code": "1501000119109", - "display": "Proliferative retinopathy due to type 2 diabetes mellitus (disorder)" - } - ], - "direct_transition": "Check_Macular_Edema" - }, - "Check_Macular_Edema": { - "type": "Simple", - "conditional_transition": [ - { - "condition": { - "condition_type": "And", - "conditions": [ - { - "condition_type": "Attribute", - "attribute": "macular_edema", - "operator": "is not nil" - }, - { - "condition_type": "Not", - "condition": { - "condition_type": "Active Condition", - "codes": [ - { - "system": "SNOMED-CT", - "code": "97331000119101", - "display": "Macular edema and retinopathy due to type 2 diabetes mellitus (disorder)" - } - ] - } - } - ] - }, - "transition": "Diagnose_Macular_Edema" - }, - { - "condition": { - "condition_type": "And", - "conditions": [ - { - "condition_type": "Attribute", - "attribute": "macular_edema", - "operator": "is nil" - }, - { - "condition_type": "Active Condition", - "codes": [ - { - "system": "SNOMED-CT", - "code": "97331000119101", - "display": "Macular edema and retinopathy due to type 2 diabetes mellitus (disorder)" - } - ] - } - ] - }, - "transition": "End_Macular_Edema" - }, - { - "transition": "Check_Blindness" - } - ] - }, - "Diagnose_Macular_Edema": { - "type": "ConditionOnset", - "codes": [ - { - "system": "SNOMED-CT", - "code": "97331000119101", - "display": "Macular edema and retinopathy due to type 2 diabetes mellitus (disorder)" - } - ], - "direct_transition": "Check_Blindness" - }, - "End_Macular_Edema": { - "type": "ConditionEnd", - "codes": [ - { - "system": "SNOMED-CT", - "code": "97331000119101", - "display": "Macular edema and retinopathy due to type 2 diabetes mellitus (disorder)" - } - ], - "direct_transition": "Check_Blindness" - }, - "Check_Blindness": { - "type": "Simple", - "conditional_transition": [ - { - "condition": { - "condition_type": "And", - "conditions": [ - { - "condition_type": "Attribute", - "attribute": "blindness", - "operator": "is not nil" - }, - { - "condition_type": "Not", - "condition": { - "condition_type": "Active Condition", - "codes": [ - { - "system": "SNOMED-CT", - "code": "60951000119105", - "display": "Blindness due to type 2 diabetes mellitus (disorder)" - } - ] - } - } - ] - }, - "transition": "Diagnose_Blindness" - }, - { - "condition": { - "condition_type": "And", - "conditions": [ - { - "condition_type": "Attribute", - "attribute": "blindness", - "operator": "is nil" - }, - { - "condition_type": "Active Condition", - "codes": [ - { - "system": "SNOMED-CT", - "code": "60951000119105", - "display": "Blindness due to type 2 diabetes mellitus (disorder)" - } - ] - } - ] - }, - "transition": "End_Blindness" - }, - { - "transition": "Terminal" - } - ] - }, - "Diagnose_Blindness": { - "type": "ConditionOnset", - "codes": [ - { - "system": "SNOMED-CT", - "code": "60951000119105", - "display": "Blindness due to type 2 diabetes mellitus (disorder)" - } - ], - "direct_transition": "Terminal" - }, - "End_Blindness": { - "type": "ConditionEnd", - "codes": [ - { - "system": "SNOMED-CT", - "code": "60951000119105", - "display": "Blindness due to type 2 diabetes mellitus (disorder)" - } - ], - "direct_transition": "Terminal" - }, - "Terminal": { - "type": "Terminal" - } - } -} \ No newline at end of file diff --git a/src/main/resources/modules/metabolic_syndrome_care.json b/src/main/resources/modules/metabolic_syndrome_care.json index cf17ca8639..477f14f39a 100644 --- a/src/main/resources/modules/metabolic_syndrome_care.json +++ b/src/main/resources/modules/metabolic_syndrome_care.json @@ -470,7 +470,7 @@ "distribution": 0.084 }, { - "transition": "Check_Eye_Conditions", + "transition": "Check_Neuropathy", "distribution": 0.916 } ] @@ -488,7 +488,7 @@ "distribution": 0.121 }, { - "transition": "Check_Eye_Conditions", + "transition": "Check_Neuropathy", "distribution": 0.879 } ] @@ -500,7 +500,7 @@ "distribution": 0.174 }, { - "transition": "Check_Eye_Conditions", + "transition": "Check_Neuropathy", "distribution": 0.826 } ], @@ -524,7 +524,7 @@ "distribution": 0.503 }, { - "transition": "Check_Eye_Conditions", + "transition": "Check_Neuropathy", "distribution": 0.497 } ] @@ -539,11 +539,6 @@ "submodule": "metabolic_syndrome/kidney_conditions", "direct_transition": "Check_Diabetes" }, - "Check_Eye_Conditions": { - "type": "CallSubmodule", - "submodule": "metabolic_syndrome/eye_conditions", - "direct_transition": "Check_Neuropathy" - }, "Check_Neuropathy": { "type": "Simple", "conditional_transition": [ @@ -706,7 +701,7 @@ "Anemia_Submodule": { "type": "CallSubmodule", "submodule": "anemia/anemia_sub", - "direct_transition": "Check_Eye_Conditions" + "direct_transition": "Check_Neuropathy" }, "Check_Anemia_Exist": { "type": "Simple", @@ -720,7 +715,7 @@ } }, { - "transition": "Check_Eye_Conditions" + "transition": "Check_Neuropathy" } ], "remarks": [ diff --git a/src/main/resources/modules/metabolic_syndrome_disease.json b/src/main/resources/modules/metabolic_syndrome_disease.json index 631f551c88..347c0ab1b5 100644 --- a/src/main/resources/modules/metabolic_syndrome_disease.json +++ b/src/main/resources/modules/metabolic_syndrome_disease.json @@ -8,8 +8,14 @@ }, "Initial_Eye_Health": { "type": "SetAttribute", - "attribute": "diabetic_eye_damage", + "attribute": "diabetic_retinopathy_stage", "value": 0, + "direct_transition": "Initial_Macular_Edema" + }, + "Initial_Macular_Edema": { + "type": "SetAttribute", + "attribute": "macular_edema", + "value": false, "direct_transition": "Initial_Nerve_Health" }, "Initial_Nerve_Health": { @@ -143,202 +149,8 @@ "direct_transition": "Retinopathy_Progression" }, "Retinopathy_Progression": { - "type": "Simple", - "remarks": [ - "In the USA, studies estimate that 28.5–40.3 % of patients with type 2 diabetes had DR, and 4.4–8.2 % of them had VTDR", - "https://www.ncbi.nlm.nih.gov/pubmed/15078674", - "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4657234/", - "https://eandv.biomedcentral.com/articles/10.1186/s40662-015-0026-2", - "Currently the %s below do not take into consideration any medications the patient may be taking" - ], - "complex_transition": [ - { - "condition": { - "condition_type": "Attribute", - "attribute": "diabetic_eye_damage", - "operator": "==", - "value": 0 - }, - "distributions": [ - { - "distribution": 0.998, - "transition": "Neuropathy_Progression" - }, - { - "distribution": 0.002, - "transition": "Set_Mild_Eye_Damage" - } - ], - "remarks": [ - "Prevalence of DR = ~40%, we assume an estimated lifespan of ~20 yrs after diagnosis", - ".2%/month over 20 yrs, 1- (.998 ^ (12*20)) = .38 " - ] - }, - { - "condition": { - "condition_type": "Attribute", - "attribute": "diabetic_eye_damage", - "operator": "==", - "value": 1 - }, - "distributions": [ - { - "distribution": 0.9915, - "transition": "Set_Mild_Eye_Damage" - }, - { - "distribution": 0.0085, - "transition": "Set_Moderate_Eye_Damage" - } - ], - "remarks": [ - "Roughly 10% chance of DR progression per year == 0.85% chance per month", - "https://eandv.biomedcentral.com/articles/10.1186/s40662-015-0026-2 (Table 3)" - ] - }, - { - "condition": { - "condition_type": "Attribute", - "attribute": "diabetic_eye_damage", - "operator": "==", - "value": 2 - }, - "distributions": [ - { - "distribution": 0.9975, - "transition": "Set_Moderate_Eye_Damage" - }, - { - "distribution": 0.0025, - "transition": "Set_Severe_Eye_Damage" - } - ], - "remarks": [ - "Roughly 3% progression from NPDR to PDR per year == .25% per month", - "https://eandv.biomedcentral.com/articles/10.1186/s40662-015-0026-2 (Table 3 again)" - ] - }, - { - "condition": { - "condition_type": "Attribute", - "attribute": "diabetic_eye_damage", - "operator": "==", - "value": 3 - }, - "transition": "Set_Severe_Eye_Damage" - } - ] - }, - "Set_Mild_Eye_Damage": { - "type": "SetAttribute", - "attribute": "diabetic_eye_damage", - "value": 1, - "direct_transition": "Mild_Eye_Damage_Symptom" - }, - "Mild_Eye_Damage_Symptom": { - "type": "Symptom", - "symptom": "Blurred Vision", - "range": { - "low": 1, - "high": 60 - }, - "direct_transition": "Set_Retinopathy" - }, - "Set_Retinopathy": { - "type": "SetAttribute", - "attribute": "retinopathy", - "value": true, - "direct_transition": "Neuropathy_Progression" - }, - "Set_Moderate_Eye_Damage": { - "type": "SetAttribute", - "attribute": "diabetic_eye_damage", - "value": 2, - "direct_transition": "Moderate_Eye_Damage_Symptom" - }, - "Moderate_Eye_Damage_Symptom": { - "type": "Symptom", - "symptom": "Blurred Vision", - "range": { - "low": 20, - "high": 100 - }, - "direct_transition": "Set_Nonproliferative_Retinopathy" - }, - "Set_Nonproliferative_Retinopathy": { - "type": "SetAttribute", - "attribute": "nonproliferative_retinopathy", - "value": true, - "direct_transition": "Chance_of_Macular_Edema" - }, - "Set_Severe_Eye_Damage": { - "type": "SetAttribute", - "attribute": "diabetic_eye_damage", - "value": 3, - "direct_transition": "Severe_Eye_Damage_Symptom" - }, - "Severe_Eye_Damage_Symptom": { - "type": "Symptom", - "symptom": "Blurred Vision", - "range": { - "low": 50, - "high": 100 - }, - "direct_transition": "Set_Proliferative_Retinopathy" - }, - "Set_Proliferative_Retinopathy": { - "type": "SetAttribute", - "attribute": "proliferative_retinopathy", - "value": true, - "direct_transition": "Chance_of_Macular_Edema" - }, - "Chance_of_Macular_Edema": { - "type": "Simple", - "remarks": [ - "Incidence of DME is very low. Very rough estimate == ~1% per year.", - "only around 20% of patients will hit this state, so we scale up to about 5% per year among those patients", - "5% / yr = .4% / month", - "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4657234/table/Tab5/" - ], - "distributed_transition": [ - { - "distribution": 0.004, - "transition": "Set_Macular_Edema" - }, - { - "distribution": 0.996, - "transition": "Chance_of_Blindness" - } - ] - }, - "Set_Macular_Edema": { - "type": "SetAttribute", - "attribute": "macular_edema", - "value": true, - "direct_transition": "Chance_of_Blindness" - }, - "Chance_of_Blindness": { - "type": "Simple", - "remarks": [ - "estimated prevalence of blindness is ~1% in MA; among diabetics we estimate 3%", - "3% / 30 yrs = ~ 0.01 % / month", - "http://www.idf.org/sites/default/files/IDF%2520Toolkit_Backgrounder_FINAL.pdf" - ], - "distributed_transition": [ - { - "distribution": 0.0001, - "transition": "Set_Blindness" - }, - { - "distribution": 0.9999, - "transition": "Neuropathy_Progression" - } - ] - }, - "Set_Blindness": { - "type": "SetAttribute", - "attribute": "blindness", - "value": true, + "type": "CallSubmodule", + "submodule": "metabolic_syndrome/diabetic_retinopathy_progression", "direct_transition": "Neuropathy_Progression" }, "Neuropathy_Progression": { diff --git a/src/main/resources/templates/notes/note.ftl b/src/main/resources/templates/notes/note.ftl index 8958795a93..e144a85071 100644 --- a/src/main/resources/templates/notes/note.ftl +++ b/src/main/resources/templates/notes/note.ftl @@ -28,18 +28,22 @@ Patient currently has ${ehr_insurance?replace("_", " ")}. # Assessment and Plan <#if ehr_conditions?has_content>Patient is presenting with <#list ehr_conditions as entry>${entry.codes[0].display?lower_case}<#sep>, . <#if ehr_allergies?has_content>Patient is presenting with <#list ehr_allergies as entry>${entry.codes[0].display?lower_case}<#sep>, . +<#if ehr_note??>${ehr_note} ## Plan <#if ehr_immunizations?has_content>Patient was given the following immunizations: <#list ehr_immunizations as entry>${entry.codes[0].display?lower_case}<#sep>, . <#if ehr_procedures?has_content>The following procedures were conducted: <#list ehr_procedures as entry> -- ${entry.codes[0].display?lower_case} +- ${entry.codes[0].display?lower_case}<#if entry.note??> + - ${entry.note} <#if ehr_medications?has_content>The patient was prescribed the following medications: <#list ehr_medications as entry> -- ${entry.codes[0].display?lower_case} +- ${entry.codes[0].display?lower_case}<#if entry.note??> + - ${entry.note} <#if ehr_careplans?has_content>The patient was placed on a careplan: <#list ehr_careplans as entry> -- ${entry.codes[0].display?lower_case} +- ${entry.codes[0].display?lower_case}<#if entry.note??> + - ${entry.note} diff --git a/src/test/resources/flexporter/eyes_on_fhir.yaml b/src/test/resources/flexporter/eyes_on_fhir.yaml new file mode 100644 index 0000000000..beb53cb914 --- /dev/null +++ b/src/test/resources/flexporter/eyes_on_fhir.yaml @@ -0,0 +1,45 @@ +--- +name: Eyes on FHIR + +# applicability determines whether this mapping applies to a given file. +# for now the assumption is 1 file = 1 synthea patient bundle. +applicability: true + +actions: + - name: Apply Profiles + profiles: + - profile: http://hl7.org/fhir/uv/eyecare/StructureDefinition/observation-iop + applicability: Observation.code.coding.where($this.code = '41633001') + - profile: http://hl7.org/fhir/uv/eyecare/StructureDefinition/observation-visual-acuity + applicability: Observation.code.coding.where($this.code = '422673001') + - profile: http://hl7.org/fhir/uv/eyecare/StructureDefinition/diagnostic-report-oct-macula + applicability: DiagnosticReport.code.coding.where($this.code = '57119-0') + + + - name: Delete MedicationRequests for drops + # numbing and dilation drops used in the clinic aren't prescribed. + # delete the MedicationRequests and just leave the MedicationAdministrations + delete_resources: + # tropicamide / dilation drops + - MedicationRequest.medication.coding.where($this.code = '313521') + # proparacaine / numbing drops + - MedicationRequest.medication.coding.where($this.code = '1191013') + + + - name: Set Missing Values + set_values: + - applicability: Observation.code.coding.where($this.code = '422673001') + fields: + - location: Observation.method.coding + value: + system: http://snomed.info/sct + code: "400914004" + display: "Early Treatment of Diabetic Retinopathy Study visual acuity chart (physical object)" + - applicability: DiagnosticReport.code.coding.where($this.code = '57119-0') + fields: + - location: DiagnosticReport.category.coding + value: + system: http://snomed.info/sct + code: "394594003" + display: "Ophthalmology (qualifier value)" +