Skip to content

Commit

Permalink
Modify section exit program (#85)
Browse files Browse the repository at this point in the history
* Modify section exit program

* Correction add hiddenObs
  • Loading branch information
Joseph-Developer authored May 24, 2022
1 parent 6383ad0 commit 44f9a75
Show file tree
Hide file tree
Showing 2 changed files with 170 additions and 75 deletions.
235 changes: 161 additions & 74 deletions configuration/pih/htmlforms/consult.xml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,15 @@
margin-bottom: 30px;
}

#Exit-program-asthma,
#Exit-program-diabetes,
#Exit-program-hypertension,
#Exit-program-epilepsy,
#Exit-program-maternal,
#Exit-program-mental{
display:none;
}

</style>

<div class="print-form-datestamps" style="display:none">
Expand Down Expand Up @@ -379,7 +388,11 @@
<img src="/openmrs/ms/uiframework/resource/file/configuration/pih/images/ssa-logo.png" style="width: 20%; margin: 0 5%;"/>
</div>


<script>
jq(function() {
setupProgramExit();
});
</script>

<section id="context" sectionTag="fieldset" headerTag="legend" headerStyle="title">
<div class="section-container">
Expand Down Expand Up @@ -565,18 +578,30 @@
</div>
</div>
<hr/>
<div class="question-container">
<obsgroup groupingConceptId="PIH:Exit from program construct">
<obs id="asthma-exit-checkbox"
conceptId="PIH:Service or program"
answerConceptId="PIH:Asthma Program"
labelText="Dar de baja de la programa Asma"
answerLabel=""
toggle="asthma-exit-status-div"/>
<div id="asthma-exit-status-div">
<obs id="asthma-exit-status" conceptId="PIH:Program outcome" labelText="Estatus (requerido)"/>
</div>
</obsgroup>
<div class="question-container two-columns">

<div>
<label>Estatus del paciente</label>
<select name="asthma" class="StatusPatient">
<option value="">Continuar con tratamiento</option>
<option value="ExitProgramAsthma">Salir del programa</option>
</select>
</div>

<div id="Exit-program-asthma">
<obsgroup groupingConceptId="PIH:Exit from program construct"
hiddenConceptId="PIH:Service or program"
hiddenAnswerConceptId="PIH:Asthma Program">

<div id="asthma-exit-status">
<obs id="asthma-exit"
conceptId="PIH:Program outcome"
answerConceptIds="PIH:TREATMENT COMPLETE, PIH:PATIENT TRANSFERRED OUT, PIH: TREATMENT NEVER STARTED - PATIENT REFUSED"
answerLabels="Tratamiento completado, Paciente tranferido, Tratamiento rechazado por el paciente"
labelText="Estatus (requerido)"/>
</div>
</obsgroup>
</div>
</div>
</section>

Expand Down Expand Up @@ -691,19 +716,32 @@
/>
</repeat>
<hr/>
<div class="question-container">
<obsgroup groupingConceptId="PIH:Exit from program construct">
<obs id="diabetes-exit-checkbox"
conceptId="PIH:Service or program"
answerConceptId="PIH:Diabetes Program"
labelText="Dar de baja de la programa Diabetes"
answerLabel=""
toggle="diabetes-exit-status-div"/>
<div id="diabetes-exit-status-div">
<obs id="diabetes-exit-status" conceptId="PIH:Program outcome" labelText="Estatus (requerido)"/>
</div>
</obsgroup>
<div class="question-container two-columns">

<div>
<label>Estatus del paciente</label>
<select name="diabetes" class="StatusPatient">
<option value="">Continuar con tratamiento</option>
<option value="ExitProgramDiabetes">Salir del programa</option>
</select>
</div>

<div id="Exit-program-diabetes">
<obsgroup groupingConceptId="PIH:Exit from program construct"
hiddenConceptId="PIH:Service or program"
hiddenAnswerConceptId="PIH:Diabetes Program">

<div id="diabetes-exit-status">
<obs id="diabetes-exit"
conceptId="PIH:Program outcome"
answerConceptIds="PIH:TREATMENT COMPLETE, PIH:PATIENT TRANSFERRED OUT, PIH: TREATMENT NEVER STARTED - PATIENT REFUSED"
answerLabels="Tratamiento completado, Paciente tranferido, Tratamiento rechazado por el paciente"
labelText="Estatus (requerido)"/>
</div>
</obsgroup>
</div>
</div>

</section>

<script>
Expand Down Expand Up @@ -795,18 +833,30 @@
</div>

<hr/>
<div class="question-container">
<obsgroup groupingConceptId="PIH:Exit from program construct">
<obs id="hypertension-exit-checkbox"
conceptId="PIH:Service or program"
answerConceptId="PIH:Hypertension Program"
labelText="Dar de baja de la programa Hipertensión"
answerLabel=""
toggle="hypertension-exit-status-div"/>
<div id="hypertension-exit-status-div">
<obs id="hypertension-exit-status" conceptId="PIH:Program outcome" labelText="Estatus (requerido)"/>
</div>
</obsgroup>
<div class="question-container two-columns">

<div>
<label>Estatus del paciente</label>
<select name="hypertension" class="StatusPatient">
<option value="">Continuar con tratamiento</option>
<option value="ExitProgramHypertension">Salir del programa</option>
</select>
</div>

<div id="Exit-program-hypertension">
<obsgroup groupingConceptId="PIH:Exit from program construct"
hiddenConceptId="PIH:Service or program"
hiddenAnswerConceptId="PIH:Hypertension Program">

<div id="hypertension-exit-status">
<obs id="hypertension-exit"
conceptId="PIH:Program outcome"
answerConceptIds="PIH:TREATMENT COMPLETE, PIH:PATIENT TRANSFERRED OUT, PIH: TREATMENT NEVER STARTED - PATIENT REFUSED"
answerLabels="Tratamiento completado, Paciente tranferido, Tratamiento rechazado por el paciente"
labelText="Estatus (requerido)"/>
</div>
</obsgroup>
</div>
</div>

</section>
Expand Down Expand Up @@ -857,19 +907,32 @@
</p>
</div>
<hr/>
<div class="question-container">
<obsgroup groupingConceptId="PIH:Exit from program construct">
<obs id="epilepsy-exit-checkbox"
conceptId="PIH:Service or program"
answerConceptId="PIH:Epilepsy program"
labelText="Dar de baja de la programa Epilepsy"
answerLabel=""
toggle="epilepsy-exit-status-div"/>
<div id="epilepsy-exit-status-div">
<obs id="epilepsy-exit-status" conceptId="PIH:Program outcome" labelText="Estatus (requerido)"/>
</div>
</obsgroup>
<div class="question-container two-columns">

<div>
<label>Estatus del paciente</label>
<select name="epilepsy" class="StatusPatient">
<option value="">Continuar con tratamiento</option>
<option value="ExitProgramEpilepsy">Salir del programa</option>
</select>
</div>

<div id="Exit-program-epilepsy">
<obsgroup groupingConceptId="PIH:Exit from program construct"
hiddenConceptId="PIH:Service or program"
hiddenAnswerConceptId="PIH:Epilepsy program">

<div id="epilepsy-exit-status">
<obs id="epilepsy-exit"
conceptId="PIH:Program outcome"
answerConceptIds="PIH:TREATMENT COMPLETE, PIH:PATIENT TRANSFERRED OUT, PIH: TREATMENT NEVER STARTED - PATIENT REFUSED"
answerLabels="Tratamiento completado, Paciente tranferido, Tratamiento rechazado por el paciente"
labelText="Estatus (requerido)"/>
</div>
</obsgroup>
</div>
</div>

</section>

<!-- Maternal -->
Expand Down Expand Up @@ -1165,18 +1228,30 @@
</div>

<hr/>
<div class="question-container">
<obsgroup groupingConceptId="PIH:Exit from program construct">
<obs id="maternal-exit-checkbox"
conceptId="PIH:Service or program"
answerConceptId="CIEL:159937"
labelText="Dar de baja de la programa Salud Materna"
answerLabel=""
toggle="maternal-exit-status-div"/>
<div id="maternal-exit-status-div">
<obs id="maternal-exit-status" conceptId="PIH:Program outcome" labelText="Estatus (requerido)"/>
</div>
</obsgroup>
<div class="question-container two-columns">

<div>
<label>Estatus del paciente</label>
<select name="maternal" class="StatusPatient">
<option value="">Continuar con tratamiento</option>
<option value="ExitProgramMaternal">Salir del programa</option>
</select>
</div>

<div id="Exit-program-maternal">
<obsgroup groupingConceptId="PIH:Exit from program construct"
hiddenConceptId="PIH:Service or program"
hiddenAnswerConceptId="CIEL:159937">

<div id="maternal-exit-status">
<obs id="maternal-exit"
conceptId="PIH:Program outcome"
answerConceptIds="PIH:TREATMENT COMPLETE, PIH:PATIENT TRANSFERRED OUT, PIH: TREATMENT NEVER STARTED - PATIENT REFUSED"
answerLabels="Tratamiento completado, Paciente tranferido, Tratamiento rechazado por el paciente"
labelText="Estatus (requerido)"/>
</div>
</obsgroup>
</div>
</div>

</section>
Expand Down Expand Up @@ -1367,18 +1442,30 @@
</div>

<hr/>
<div class="question-container">
<obsgroup groupingConceptId="PIH:Exit from program construct">
<obs id="mental-exit-checkbox"
conceptId="PIH:Service or program"
answerConceptId="PIH:Mental Health Program"
labelText="Dar de baja de la programa Salud Mental"
answerLabel=""
toggle="mental-exit-status-div"/>
<div id="mental-exit-status-div">
<obs id="mental-exit-status" conceptId="PIH:Program outcome" labelText="Estatus (requerido)"/>
</div>
</obsgroup>
<div class="question-container two-columns">

<div>
<label>Estatus del paciente</label>
<select name="mental" class="StatusPatient">
<option value="">Continuar con tratamiento</option>
<option value="ExitProgramMental">Salir del programa</option>
</select>
</div>

<div id="Exit-program-mental">
<obsgroup groupingConceptId="PIH:Exit from program construct"
hiddenConceptId="PIH:Service or program"
hiddenAnswerConceptId="PIH:Mental Health Program">

<div id="mental-exit-status">
<obs id="mental-exit"
conceptId="PIH:Program outcome"
answerConceptIds="PIH:TREATMENT COMPLETE, PIH:PATIENT TRANSFERRED OUT, PIH: TREATMENT NEVER STARTED - PATIENT REFUSED"
answerLabels="Tratamiento completado, Paciente tranferido, Tratamiento rechazado por el paciente"
labelText="Estatus (requerido)"/>
</div>
</obsgroup>
</div>
</div>

</section>
Expand Down Expand Up @@ -1715,4 +1802,4 @@
</div>
</ifMode>

</htmlform>
</htmlform>
10 changes: 9 additions & 1 deletion configuration/pih/scripts/global/ces.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Ensures that if the box is ticked to remove a patient from a program,
* then the user must have also provided an outcome.
*/
function setUpProgramExitStatusValidation(requiredMsg) {
function setUpProgramExitStatusValidation(requiredMsg) {
const programs = [
"asthma",
"diabetes",
Expand Down Expand Up @@ -455,3 +455,11 @@ function actualizarGAD7() {
function sum(arr) {
return arr.reduce((partialSum, a) => partialSum + a, 0);
}

function setupProgramExit() {
let selectExitProgram = jq(".StatusPatient");
jq(selectExitProgram).change(function () {
let nameSelect = jq(this).attr("name");
jq("#Exit-program-" + nameSelect).show();
});
}

0 comments on commit 44f9a75

Please sign in to comment.