From 5fa86b92de21f80fac68e7e6bb8d7d6fa5f3d289 Mon Sep 17 00:00:00 2001 From: = Date: Tue, 2 Jul 2019 13:19:12 +0300 Subject: [PATCH 01/12] MPOC-175 pick latest obs on who stage concept --- openmrs/apps/clinical/dashboard.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/openmrs/apps/clinical/dashboard.json b/openmrs/apps/clinical/dashboard.json index 0e1cf555e..c2707aabc 100755 --- a/openmrs/apps/clinical/dashboard.json +++ b/openmrs/apps/clinical/dashboard.json @@ -170,14 +170,12 @@ "HTC, WHO Staging" ], "showDetailsButton": true, - "numberOfVisits": 1, "scope": "latest" }, "expandedViewConfig": { "conceptNames": [ "HTC, WHO Staging" ], - "numberOfVisits": 1, "scope": "latest", "showDetailsButton": true, "pivotTable": { From 643d40a8b14dcebaab13e3878a826359e22ca7bd Mon Sep 17 00:00:00 2001 From: krishnanspace Date: Fri, 12 Jul 2019 15:58:19 +0530 Subject: [PATCH 02/12] Krishnan | MPOC-397 Added conditions and fixed the conflicts --- openmrs/apps/clinical/formConditions.js | 55 ++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 5 deletions(-) diff --git a/openmrs/apps/clinical/formConditions.js b/openmrs/apps/clinical/formConditions.js index 076207dfb..ec77ca72a 100755 --- a/openmrs/apps/clinical/formConditions.js +++ b/openmrs/apps/clinical/formConditions.js @@ -74,25 +74,70 @@ Bahmni.ConceptSet.FormConditions.rulesOverride = { if (dia === true) { return { - show: ["Received nutritional education"] + show: ["Received nutritional education", "Nutrition Supplement"] } } else { return { - hide: ["Received nutritional education"] + hide: ["Received nutritional education", "Nutrition Supplement"] } } }, -"STI Diagnosis_Prophylaxis" (formName, formFieldValues) { +"Nutrition Supplement" (formName, formFieldValues) { + var dia = formFieldValues["Nutrition Supplement"]; + + if (dia) { + return { + + show: ["Quantity of Nutritional Supplement", "SP_Measurement_Unit"] + } + } else { + return { + hide: ["Quantity of Nutritional Supplement", "SP_Measurement_Unit"] + } + } +}, +"STI Diagnosis_Prophylaxis" (formName, formFieldValues, patient) { var dia = formFieldValues["STI Diagnosis_Prophylaxis"]; + var returnShowValue = []; + var returnHideValue = []; if (dia === "Syndromic Approach") { + if (patient.gender === "M") { + return { + show: ["Syndromic Approach_STI_M"] + } + } else { + return { + show: ["Syndromic Approach_STI_F"] + } + } + } else { + return { + hide:["Syndromic Approach_STI_M", "Syndromic Approach_STI_F"] + } + } +}, +"Nutrition_Prophylaxis" (formName, formFieldValues, patient) { + if (patient.age < 5) { return { + show: ["Infants Odema_Prophylaxis"] + } + } else { + return { + hide: ["Infants Odema_Prophylaxis"] + } + } - show: ["Syndromic Approach_STI"] +}, +"SP_Side_Effects" (formName, formFieldValues, patient) { + var answer = formFieldValues["SP_Side_Effects"]; + if (answer) { + return { + show: ["SP_Side_Effects_Text"] } } else { return { - hide: ["Syndromic Approach_STI"] + hide: ["SP_Side_Effects_Text"] } } }, From 90c43db507baaa7f828111b3e25f5c018cc68d60 Mon Sep 17 00:00:00 2001 From: Simao Mazive Date: Mon, 15 Jul 2019 11:17:22 +0200 Subject: [PATCH 03/12] =?UTF-8?q?Changes=20to=20Observation=20Form=20?= =?UTF-8?q?=E2=80=9CObserva=C3=A7=C3=A3o=20Clinica=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hide PerĂ­metro Branquial Field if patient gender is Male --- openmrs/apps/clinical/formConditions.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/openmrs/apps/clinical/formConditions.js b/openmrs/apps/clinical/formConditions.js index 076207dfb..296670f30 100755 --- a/openmrs/apps/clinical/formConditions.js +++ b/openmrs/apps/clinical/formConditions.js @@ -157,6 +157,18 @@ Bahmni.ConceptSet.FormConditions.rulesOverride = { } }, + "Anthropometric" (formName, formFieldValues, patient) { + if (patient.gender === "M" && patient.age > 5) { + return { + hide: ["Brachial_perimeter_new"] + } + } else { + return { + show: ["Brachial_perimeter_new"] + } + } + }, + "PP_Key_population" (formName, formFieldValues) { var dia = formFieldValues["PP_Key_population"]; if (dia === "PP_Key_population_Yes") { From 1aeec58678e38d81f655649032578b98826b6155 Mon Sep 17 00:00:00 2001 From: = Date: Mon, 15 Jul 2019 12:50:17 +0300 Subject: [PATCH 04/12] MPOC-399 handle form condition on form save --- openmrs/apps/clinical/formConditions.js | 40 +++++++++++++++++-------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/openmrs/apps/clinical/formConditions.js b/openmrs/apps/clinical/formConditions.js index 076207dfb..e211097e4 100755 --- a/openmrs/apps/clinical/formConditions.js +++ b/openmrs/apps/clinical/formConditions.js @@ -394,36 +394,50 @@ Bahmni.ConceptSet.FormConditions.rulesOverride = { "CONFIDENT_AGE_TYPE" (formName, formFieldValues) { var ageType = formFieldValues["CONFIDENT_AGE_TYPE"]; var ageVal = formFieldValues["CONFIDENT_AGE"]; - - if ((ageType != "Anos") && (ageType != "Years") && (ageType != "Meses") && (ageType != "Months")) { - return { - hide: ["CONFIDENT_CCR"] - } - } - if ((ageType === "Anos") || (ageType === "Years")) { - if (ageVal < 5) { + if(ageType && ageVal > 0){ + if(ageVal < 5 && (ageType === "Years" || ageType === "Anos" || ageType === "CONFIDENT_AGE_TYPE_YEARS")){ + return { + show: ["CONFIDENT_CCR"] + } + } else if (ageVal < 60 && (ageType === "Months" || ageType === "Meses" || ageType === "CONFIDENT_AGE_TYPE_MONTHS")){ return { show: ["CONFIDENT_CCR"] } - } else { + }else { return { hide: ["CONFIDENT_CCR"] } } - + } else { + return { + hide: ["CONFIDENT_CCR"] + } } + }, + "CONFIDENT_AGE" (formName, formFieldValues) { + var ageType = formFieldValues["CONFIDENT_AGE_TYPE"]; + var ageVal = formFieldValues["CONFIDENT_AGE"]; - if ((ageType === "Meses") || (ageType === "Months")) { - if (ageVal < 60) { + if(ageType && ageVal > 0){ + if(ageVal < 5 && (ageType === "Years" || ageType === "Anos" || ageType === "CONFIDENT_AGE_TYPE_YEARS")){ + return { + show: ["CONFIDENT_CCR"] + } + } else if (ageVal < 60 && (ageType === "Months" || ageType === "Meses" || ageType === "CONFIDENT_AGE_TYPE_MONTHS")){ return { show: ["CONFIDENT_CCR"] } - } else { + }else { return { hide: ["CONFIDENT_CCR"] } } + } else { + return { + hide: ["CONFIDENT_CCR"] + } } } + }; From 0afdc8cc8f7665b35214f6805c88f23867adb48f Mon Sep 17 00:00:00 2001 From: = Date: Mon, 15 Jul 2019 13:15:14 +0300 Subject: [PATCH 05/12] Complexity Fix #1 --- openmrs/apps/clinical/formConditions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openmrs/apps/clinical/formConditions.js b/openmrs/apps/clinical/formConditions.js index e211097e4..0311c9a26 100755 --- a/openmrs/apps/clinical/formConditions.js +++ b/openmrs/apps/clinical/formConditions.js @@ -395,7 +395,7 @@ Bahmni.ConceptSet.FormConditions.rulesOverride = { var ageType = formFieldValues["CONFIDENT_AGE_TYPE"]; var ageVal = formFieldValues["CONFIDENT_AGE"]; - if(ageType && ageVal > 0){ + if(ageVal > 0){ if(ageVal < 5 && (ageType === "Years" || ageType === "Anos" || ageType === "CONFIDENT_AGE_TYPE_YEARS")){ return { show: ["CONFIDENT_CCR"] @@ -419,7 +419,7 @@ Bahmni.ConceptSet.FormConditions.rulesOverride = { var ageType = formFieldValues["CONFIDENT_AGE_TYPE"]; var ageVal = formFieldValues["CONFIDENT_AGE"]; - if(ageType && ageVal > 0){ + if(ageVal > 0){ if(ageVal < 5 && (ageType === "Years" || ageType === "Anos" || ageType === "CONFIDENT_AGE_TYPE_YEARS")){ return { show: ["CONFIDENT_CCR"] From 0477be898b5d9f9d07cb171570449a1b474e5bf6 Mon Sep 17 00:00:00 2001 From: Joao Machiana Date: Mon, 15 Jul 2019 15:25:19 +0200 Subject: [PATCH 06/12] Update formConditions.js --- openmrs/apps/clinical/formConditions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openmrs/apps/clinical/formConditions.js b/openmrs/apps/clinical/formConditions.js index 296670f30..37a7f34b1 100755 --- a/openmrs/apps/clinical/formConditions.js +++ b/openmrs/apps/clinical/formConditions.js @@ -158,7 +158,7 @@ Bahmni.ConceptSet.FormConditions.rulesOverride = { }, "Anthropometric" (formName, formFieldValues, patient) { - if (patient.gender === "M" && patient.age > 5) { + if ((patient.gender === "M") && (patient.age > 5)) { return { hide: ["Brachial_perimeter_new"] } From 2abfb5a7eadc346010d59fadb35e9239f39e4586 Mon Sep 17 00:00:00 2001 From: Amol Chavan Date: Wed, 17 Jul 2019 12:23:12 +0530 Subject: [PATCH 07/12] =?UTF-8?q?Amol=20|=20Updated=20=20Refer=C3=AAncia?= =?UTF-8?q?=20Form=20as=20per=20new=20requirements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openmrs/apps/clinical/app.json | 4 +++- openmrs/apps/clinical/formConditions.js | 22 +++++++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/openmrs/apps/clinical/app.json b/openmrs/apps/clinical/app.json index befde1f16..ad45173de 100755 --- a/openmrs/apps/clinical/app.json +++ b/openmrs/apps/clinical/app.json @@ -373,6 +373,9 @@ "Reference_Other_Specify_Group": { "disableAddNotes": true }, + "Reference_Other_Specify_Group_Other": { + "disableAddNotes": true + }, "Reference_GA": { "disableAddNotes": true }, @@ -398,7 +401,6 @@ "disableAddNotes": true }, "Reference_Other_Services": { - "disableAddNotes": true, "multiSelect" : true }, "Reference_Eligible": { diff --git a/openmrs/apps/clinical/formConditions.js b/openmrs/apps/clinical/formConditions.js index 37a7f34b1..97d1d069b 100755 --- a/openmrs/apps/clinical/formConditions.js +++ b/openmrs/apps/clinical/formConditions.js @@ -326,16 +326,16 @@ Bahmni.ConceptSet.FormConditions.rulesOverride = { }; } }, - "Reference_Other_Services" (formName, formFieldValues) { - var value = formFieldValues["Reference_Other_Services"]; + "Reference_Other_Specify_Group" (formName, formFieldValues) { + var value = formFieldValues["Reference_Other_Specify_Group"]; - if (value === "Reference_Other") { + if (value) { return { - show: ["Reference_Other_Text"] + show: ["Reference_Other_Specify_Group_Other"] } } else { return { - hide: ["Reference_Other_Text"] + hide: ["Reference_Other_Specify_Group_Other"] } } }, @@ -352,6 +352,18 @@ Bahmni.ConceptSet.FormConditions.rulesOverride = { } } }, + "Reference_MDC_Other" (formName, formFieldValues) { + var pregValue = formFieldValues["Reference_MDC_Other"]; + if (pregValue) { + return { + show: ["Reference_MDC_Other_comments"] + } + } else { + return { + hide: ["Reference_MDC_Other_comments"] + } + } + }, "Pregnancy_Yes_No" (formName, formFieldValues) { var pregValue = formFieldValues["Pregnancy_Yes_No"]; From 8778172a35f6bcfa433cd7e2c4822aad565ed917 Mon Sep 17 00:00:00 2001 From: krishnanspace Date: Wed, 17 Jul 2019 15:58:26 +0530 Subject: [PATCH 08/12] Added the config to remove certain 'Add notes' fields --- openmrs/apps/clinical/app.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/openmrs/apps/clinical/app.json b/openmrs/apps/clinical/app.json index fb189cf47..7ccd65b8c 100755 --- a/openmrs/apps/clinical/app.json +++ b/openmrs/apps/clinical/app.json @@ -632,6 +632,15 @@ "disableAddNotes": true, "multiSelect" : true }, + "Prophylaxis_Nutritional_Status": { + "disableAddNotes": true + }, + "Syndromic Approach_STI_M": { + "disableAddNotes": true + }, + "Syndromic Approach_STI_F": { + "disableAddNotes": true + }, "defaults": { "Number of living children": 1, "Accepted Family Planning methods": [ From 48e4e72cc61241e35c0d8a50647d6815f761b9ed Mon Sep 17 00:00:00 2001 From: Joao Machiana Date: Wed, 17 Jul 2019 14:14:16 +0200 Subject: [PATCH 09/12] =?UTF-8?q?Revert=20"Amol=20|=20Updated=20=20Refer?= =?UTF-8?q?=C3=AAncia=20Form=20as=20per=20new=20requirements"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openmrs/apps/clinical/app.json | 4 +--- openmrs/apps/clinical/formConditions.js | 22 +++++----------------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/openmrs/apps/clinical/app.json b/openmrs/apps/clinical/app.json index ad45173de..befde1f16 100755 --- a/openmrs/apps/clinical/app.json +++ b/openmrs/apps/clinical/app.json @@ -373,9 +373,6 @@ "Reference_Other_Specify_Group": { "disableAddNotes": true }, - "Reference_Other_Specify_Group_Other": { - "disableAddNotes": true - }, "Reference_GA": { "disableAddNotes": true }, @@ -401,6 +398,7 @@ "disableAddNotes": true }, "Reference_Other_Services": { + "disableAddNotes": true, "multiSelect" : true }, "Reference_Eligible": { diff --git a/openmrs/apps/clinical/formConditions.js b/openmrs/apps/clinical/formConditions.js index 805794558..6d432eb2e 100755 --- a/openmrs/apps/clinical/formConditions.js +++ b/openmrs/apps/clinical/formConditions.js @@ -326,16 +326,16 @@ Bahmni.ConceptSet.FormConditions.rulesOverride = { }; } }, - "Reference_Other_Specify_Group" (formName, formFieldValues) { - var value = formFieldValues["Reference_Other_Specify_Group"]; + "Reference_Other_Services" (formName, formFieldValues) { + var value = formFieldValues["Reference_Other_Services"]; - if (value) { + if (value === "Reference_Other") { return { - show: ["Reference_Other_Specify_Group_Other"] + show: ["Reference_Other_Text"] } } else { return { - hide: ["Reference_Other_Specify_Group_Other"] + hide: ["Reference_Other_Text"] } } }, @@ -352,18 +352,6 @@ Bahmni.ConceptSet.FormConditions.rulesOverride = { } } }, - "Reference_MDC_Other" (formName, formFieldValues) { - var pregValue = formFieldValues["Reference_MDC_Other"]; - if (pregValue) { - return { - show: ["Reference_MDC_Other_comments"] - } - } else { - return { - hide: ["Reference_MDC_Other_comments"] - } - } - }, "Pregnancy_Yes_No" (formName, formFieldValues) { var pregValue = formFieldValues["Pregnancy_Yes_No"]; From 74ab8f5325105d2655bcdd88ae730e342561807e Mon Sep 17 00:00:00 2001 From: krishnanspace Date: Thu, 18 Jul 2019 12:40:13 +0530 Subject: [PATCH 10/12] Changed the conditions for Side Effects --- openmrs/apps/clinical/app.json | 12 ++++++ openmrs/apps/clinical/formConditions.js | 52 ++++++++++++++++++------- 2 files changed, 51 insertions(+), 13 deletions(-) diff --git a/openmrs/apps/clinical/app.json b/openmrs/apps/clinical/app.json index 7ccd65b8c..2a4b46477 100755 --- a/openmrs/apps/clinical/app.json +++ b/openmrs/apps/clinical/app.json @@ -641,6 +641,18 @@ "Syndromic Approach_STI_F": { "disableAddNotes": true }, + "SP_Side_Effects_INH": { + "disableAddNotes": true + }, + "SP_Side_Effects_CTZ": { + "disableAddNotes": true + }, + "SP_Side_Effects_Fluconazol": { + "disableAddNotes": true + }, + "SP_Measurement_Unit": { + "disableAddNotes": true + }, "defaults": { "Number of living children": 1, "Accepted Family Planning methods": [ diff --git a/openmrs/apps/clinical/formConditions.js b/openmrs/apps/clinical/formConditions.js index ec77ca72a..5ccbce302 100755 --- a/openmrs/apps/clinical/formConditions.js +++ b/openmrs/apps/clinical/formConditions.js @@ -129,26 +129,14 @@ Bahmni.ConceptSet.FormConditions.rulesOverride = { } }, -"SP_Side_Effects" (formName, formFieldValues, patient) { - var answer = formFieldValues["SP_Side_Effects"]; - if (answer) { - return { - show: ["SP_Side_Effects_Text"] - } - } else { - return { - hide: ["SP_Side_Effects_Text"] - } - } -}, "Type_Prophylaxis" (formName, formFieldValues) { var dia = formFieldValues["Type_Prophylaxis"]; var returnShowValue = []; var returnHideValue = []; - if (dia === "INH") { returnShowValue.push("INH_Details"); + returnHideValue.push("Secondary effects_INH"); } else { returnHideValue.push("INH_Details"); @@ -157,6 +145,7 @@ Bahmni.ConceptSet.FormConditions.rulesOverride = { if (dia === "CTZ") { returnShowValue.push("CTZ_Details"); + returnHideValue.push("Secondary effects_CTZ"); } else { returnHideValue.push("CTZ_Details"); @@ -165,6 +154,7 @@ Bahmni.ConceptSet.FormConditions.rulesOverride = { if (dia ==="Fluconazol") { returnShowValue.push("Fluconazol_Details"); + returnHideValue.push("Secondary effects_Fluconazol"); } else { returnHideValue.push("Fluconazol_Details"); @@ -179,6 +169,42 @@ Bahmni.ConceptSet.FormConditions.rulesOverride = { +}, +"SP_Side_Effects_INH" (formName, formFieldValues, patient) { + var answer = formFieldValues["SP_Side_Effects_INH"]; + if (answer) { + return { + show: ["Secondary effects_INH"] + } + } else { + return { + hide: ["Secondary effects_INH"] + } + } +}, +"SP_Side_Effects_CTZ" (formName, formFieldValues, patient) { + var answer = formFieldValues["SP_Side_Effects_CTZ"]; + if (answer) { + return { + show: ["Secondary effects_CTZ"] + } + } else { + return { + hide: ["Secondary effects_CTZ"] + } + } +}, +"SP_Side_Effects_Fluconazol" (formName, formFieldValues, patient) { + var answer = formFieldValues["SP_Side_Effects_Fluconazol"]; + if (answer) { + return { + show: ["Secondary effects_Fluconazol"] + } + } else { + return { + hide: ["Secondary effects_Fluconazol"] + } + } }, "Family_Planning_Methods" (formName, formFieldValues, patient) { From b111adcc9ae2128976b9a58802ba511dc2e75558 Mon Sep 17 00:00:00 2001 From: krishnanspace Date: Thu, 18 Jul 2019 12:18:54 +0200 Subject: [PATCH 11/12] Removed unused variables --- openmrs/apps/clinical/formConditions.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/openmrs/apps/clinical/formConditions.js b/openmrs/apps/clinical/formConditions.js index 73e9ddc58..a74ea97c3 100755 --- a/openmrs/apps/clinical/formConditions.js +++ b/openmrs/apps/clinical/formConditions.js @@ -98,8 +98,6 @@ Bahmni.ConceptSet.FormConditions.rulesOverride = { }, "STI Diagnosis_Prophylaxis" (formName, formFieldValues, patient) { var dia = formFieldValues["STI Diagnosis_Prophylaxis"]; - var returnShowValue = []; - var returnHideValue = []; if (dia === "Syndromic Approach") { if (patient.gender === "M") { From 34479b33f8611587ba38556a95ac4a5d2dbc4048 Mon Sep 17 00:00:00 2001 From: = Date: Thu, 18 Jul 2019 18:52:56 +0300 Subject: [PATCH 12/12] MPOC-477 only show age type when age is entered --- openmrs/apps/clinical/formConditions.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openmrs/apps/clinical/formConditions.js b/openmrs/apps/clinical/formConditions.js index a74ea97c3..cb0d801ad 100755 --- a/openmrs/apps/clinical/formConditions.js +++ b/openmrs/apps/clinical/formConditions.js @@ -511,12 +511,13 @@ Bahmni.ConceptSet.FormConditions.rulesOverride = { } }else { return { - hide: ["CONFIDENT_CCR"] + hide: ["CONFIDENT_CCR"], + show: ["CONFIDENT_AGE_TYPE"] } } } else { return { - hide: ["CONFIDENT_CCR"] + hide: ["CONFIDENT_CCR","CONFIDENT_AGE_TYPE"] } } }