Skip to content

Commit

Permalink
Merge pull request #102 from abdimoha-dev/userFormsByRoles
Browse files Browse the repository at this point in the history
Added consulatation forms according to user roles
  • Loading branch information
daviemukungi authored Feb 8, 2021
2 parents 2f7ae6c + caa37dc commit edc2fc1
Showing 1 changed file with 37 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,43 @@ angular.module('bahmni.clinical')
allTemplates.splice(i, 1);
}
}
} else {
}
else if ((currentuserRoleName == "PMTCT") && (currentuserRoleName != "superman")){
for (var i = allTemplates.length - 1; i >= 0; i--) {
if (allTemplates[i].uuid == endoffollowupform || allTemplates[i].uuid == anccard || allTemplates[i].uuid == maternityform || allTemplates[i].uuid == personalhist || allTemplates[i].uuid == familyhistdata) {
allTemplates.splice(i, 1);
}
}
}
else if ((currentuserRoleName == "PMTCT (HEI)") && (currentuserRoleName != "superman")){
for (var i = allTemplates.length - 1; i >= 0; i--) {
if (allTemplates[i].uuid == arthistoryclinical || allTemplates[i].uuid == arttreatmentform || allTemplates[i].uuid == artandhivfollowup || allTemplates[i].uuid == endoffollowupform || allTemplates[i].uuid == anccard || allTemplates[i].uuid == viralload || allTemplates[i].uuid == maternityform || allTemplates[i].uuid == personalhist || allTemplates[i].uuid == familyhistdata) {
allTemplates.splice(i, 1);
}
}
}
else if ((currentuserRoleName == "EAC") && (currentuserRoleName != "superman")){
for (var i = allTemplates.length - 1; i >= 0; i--) {
if (allTemplates[i].uuid == arthistoryclinical || allTemplates[i].uuid == arttreatmentform || allTemplates[i].uuid == artandhivfollowup || allTemplates[i].uuid == endoffollowupform || allTemplates[i].uuid == anccard || allTemplates[i].uuid == viralload || allTemplates[i].uuid == tbscreeningform || allTemplates[i].uuid == maternityform || allTemplates[i].uuid == personalhist || allTemplates[i].uuid == familyhistdata) {
allTemplates.splice(i, 1);
}
}
}
else if ((currentuserRoleName == "CLINICIAN") && (currentuserRoleName != "superman")){
for (var i = allTemplates.length - 1; i >= 0; i--) {
if ( allTemplates[i].uuid == arttreatmentform || allTemplates[i].uuid == endoffollowupform || allTemplates[i].uuid == anccard || allTemplates[i].uuid == eacforms || allTemplates[i].uuid == maternityform) {
allTemplates.splice(i, 1);
}
}
}
else if ((currentuserRoleName == "MATERNITY") && (currentuserRoleName != "superman")){
for (var i = allTemplates.length - 1; i >= 0; i--) {
if (allTemplates[i].uuid == arthistoryclinical || allTemplates[i].uuid == arttreatmentform || allTemplates[i].uuid == artandhivfollowup || allTemplates[i].uuid == endoffollowupform || allTemplates[i].uuid == viralload || allTemplates[i].uuid == tbscreeningform || allTemplates[i].uuid == eacforms || allTemplates[i].uuid == personalhist || allTemplates[i].uuid == familyhistdata) {
allTemplates.splice(i, 1);
}
}
}
else {
for (var i = allTemplates.length - 1; i >= 0; i--) {
if (allTemplates[i].uuid == personalhist || allTemplates[i].uuid == familyhistdata) {
allTemplates.splice(i, 1);
Expand Down

0 comments on commit edc2fc1

Please sign in to comment.