Skip to content

Commit

Permalink
Merge pull request #131 from esaude/develop
Browse files Browse the repository at this point in the history
Release 2.0.0
  • Loading branch information
joaomachiana authored Jul 19, 2019
2 parents c71ce32 + 6d88286 commit 6ba477a
Show file tree
Hide file tree
Showing 3 changed files with 138 additions and 23 deletions.
21 changes: 21 additions & 0 deletions openmrs/apps/clinical/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,27 @@
"disableAddNotes": true,
"multiSelect" : true
},
"Prophylaxis_Nutritional_Status": {
"disableAddNotes": true
},
"Syndromic Approach_STI_M": {
"disableAddNotes": true
},
"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": [
Expand Down
2 changes: 0 additions & 2 deletions openmrs/apps/clinical/dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
138 changes: 117 additions & 21 deletions openmrs/apps/clinical/formConditions.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,36 +74,67 @@ 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"];

if (dia === "Syndromic Approach") {
if (patient.gender === "M") {
return {
show: ["Syndromic Approach_STI_M"]
}
} else {
return {
show: ["Syndromic Approach_STI_F"]
}
}
} else {
return {

show: ["Syndromic Approach_STI"]
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: ["Syndromic Approach_STI"]
hide: ["Infants Odema_Prophylaxis"]
}
}

},
"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");
Expand All @@ -112,6 +143,7 @@ Bahmni.ConceptSet.FormConditions.rulesOverride = {
if (dia === "CTZ") {

returnShowValue.push("CTZ_Details");
returnHideValue.push("Secondary effects_CTZ");

} else {
returnHideValue.push("CTZ_Details");
Expand All @@ -120,6 +152,7 @@ Bahmni.ConceptSet.FormConditions.rulesOverride = {
if (dia ==="Fluconazol") {

returnShowValue.push("Fluconazol_Details");
returnHideValue.push("Secondary effects_Fluconazol");

} else {
returnHideValue.push("Fluconazol_Details");
Expand All @@ -134,6 +167,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) {

Expand All @@ -157,6 +226,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") {
Expand Down Expand Up @@ -394,36 +475,51 @@ 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(ageVal > 0){
if(ageVal < 5 && (ageType === "Years" || ageType === "Anos" || ageType === "CONFIDENT_AGE_TYPE_YEARS")){
return {
show: ["CONFIDENT_CCR"]
}
} else {
} else if (ageVal < 60 && (ageType === "Months" || ageType === "Meses" || ageType === "CONFIDENT_AGE_TYPE_MONTHS")){
return {
show: ["CONFIDENT_CCR"]
}
}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(ageVal > 0){
if(ageVal < 5 && (ageType === "Years" || ageType === "Anos" || ageType === "CONFIDENT_AGE_TYPE_YEARS")){
return {
show: ["CONFIDENT_CCR"]
}
} else {
} else if (ageVal < 60 && (ageType === "Months" || ageType === "Meses" || ageType === "CONFIDENT_AGE_TYPE_MONTHS")){
return {
hide: ["CONFIDENT_CCR"]
show: ["CONFIDENT_CCR"]
}
}else {
return {
hide: ["CONFIDENT_CCR"],
show: ["CONFIDENT_AGE_TYPE"]
}
}
} else {
return {
hide: ["CONFIDENT_CCR","CONFIDENT_AGE_TYPE"]
}
}
}

};

0 comments on commit 6ba477a

Please sign in to comment.