Skip to content

Commit

Permalink
feat(admissions): make checkboxes into bhYesNoRadios
Browse files Browse the repository at this point in the history
Makes the checkboxes for patient admissions into bhYesNoRadios to remove
ambiguity.

Closes Third-Culture-Software#7800.
  • Loading branch information
jniles committed Oct 26, 2024
1 parent 63ded7c commit 3629ce4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ function VisitsAdmissionController(ModalInstance, Patients, Visits, Notify,
vm.visit.bed = bed;
};

vm.onChangeRefered = value => {
vm.visit.is_refered = value;
}
vm.onChangePregnant = value => {
vm.visit.is_pregnant = value;
}

vm.onServiceSelect = service => {
vm.visit.service = service;
};
Expand Down
47 changes: 15 additions & 32 deletions client/src/modules/patients/visits/modals/visits.modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,35 +89,19 @@
</label>
</div>

<!-- refereed -->
<div class="checkbox">
<p class="control-label" style="margin-bottom:5px;">
<strong translate>PATIENT_RECORDS.VISITS.REFERED</strong>
</p>
<label>
<input
type="checkbox"
ng-true-value="1"
ng-false-value="0"
ng-model="AdmitCtrl.visit.is_refered"> <span translate>PATIENT_RECORDS.VISITS.IS_REFERED</span>
</label>
</div>

<!-- pregnant -->
<div ng-if="AdmitCtrl.isFemale">
<div class="checkbox">
<p class="control-label" style="margin-bottom:5px;">
<strong translate>PATIENT_RECORDS.VISITS.PREGNANT</strong>
</p>
<label>
<input
type="checkbox"
ng-true-value="1"
ng-false-value="0"
ng-model="AdmitCtrl.visit.is_pregnant"> <span translate>PATIENT_RECORDS.VISITS.IS_PREGNANT</span>
</label>
</div>
</div>
<bh-yes-no-radios
label ="PATIENT_RECORDS.VISITS.IS_REFERED"
value = "AdmitCtrl.visit.is_refered"
on-change-callback = "AdmitCtrl.onChangeRefered(value)">
<!-- optionally include help-text -->
</bh-yes-no-radios>

<bh-yes-no-radios
label ="PATIENT_RECORDS.VISITS.IS_PREGNANT"
value = "AdmitCtrl.visit.is_pregnant"
on-change-callback = "AdmitCtrl.onChangePregant(value)">
<!-- optionally include help-text -->
</bh-yes-no-radios>

<!-- in health zone -->
<p class="control-label" style="margin-bottom:5px;">
Expand All @@ -128,7 +112,7 @@
<input
type="radio"
name="inside_health_zone"
id="yes"
id = "hz-yes"
ng-value="1"
ng-model="AdmitCtrl.visit.inside_health_zone"
ng-change="AdmitCtrl.onChangeHZ()" checked>
Expand All @@ -140,7 +124,7 @@
<input
type="radio"
name="inside_health_zone"
id="no"
id="hz-no"
ng-value="0"
ng-model="AdmitCtrl.visit.inside_health_zone"
ng-change="AdmitCtrl.onChangeHZ()">
Expand All @@ -150,7 +134,6 @@
</div>

<br>

<!-- only on discharge -->
<div ng-if="!AdmitCtrl.isAdmission">
<bh-discharge-select on-change-callback="AdmitCtrl.onSelectDischarge(dischargeType)"></bh-discharge-select>
Expand Down

0 comments on commit 3629ce4

Please sign in to comment.