Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/npm_and_yarn/types/node-22.10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcameron authored Dec 2, 2024
2 parents c640253 + 82daf27 commit d477418
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
32 changes: 17 additions & 15 deletions client/src/modules/patients/visits/modals/search.modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,25 @@
<uib-tabset>
<uib-tab index="0" heading="{{ 'FORM.LABELS.SEARCH_QUERIES' | translate }}" data-custom-filter-tab>
<div class="tab-body">
<!-- refered -->
<div class="checkbox">
<label>
<input type="checkbox" ng-true-value="1" ng-false-value=0 ng-model="$ctrl.searchQueries.is_refered">
<span translate>PATIENT_RECORDS.VISITS.IS_REFERED</span>
</label>
<bh-clear on-clear="$ctrl.clear('is_refered')"></bh-clear>
</div>

<!-- pregnant -->
<div class="checkbox">
<label>
<input type="checkbox" ng-true-value="1" ng-false-value=0 ng-model="$ctrl.searchQueries.is_pregnant">
<span translate>PATIENT_RECORDS.VISITS.IS_PREGNANT</span>
</label>
<!-- determine if patients are referred or not -->
<bh-yes-no-radios
label="PATIENT_RECORDS.VISITS.IS_REFERED"
value="$ctrl.searchQueries.is_refered"
name="is_refered"
on-change-callback="$ctrl.onReferralChange(value)">
<bh-clear on-clear="$ctrl.clear('is_refered')"></bh-clear>
</bh-yes-no-radios>

<!-- determine if patients are pregnant or not -->
<bh-yes-no-radios
id = "patient-is-pregnant"
label="PATIENT_RECORDS.VISITS.IS_PREGNANT"
value="$ctrl.searchQueries.is_pregnant"
name="is_pregnant"
on-change-callback="$ctrl.onPregnantChange(value)">
<bh-clear on-clear="$ctrl.clear('is_pregnant')"></bh-clear>
</div>
</bh-yes-no-radios>

<!-- hospitalized -->
<div>
Expand Down
9 changes: 8 additions & 1 deletion client/src/modules/patients/visits/modals/search.modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ function AdmissionRegistryModalController(ModalInstance, filters, Store, util, P

vm.today = new Date();
vm.defaultQueries = {};
vm.searchQueries = {};

// assign default limit filter
if (filters.limit) {
Expand Down Expand Up @@ -59,6 +58,14 @@ function AdmissionRegistryModalController(ModalInstance, filters, Store, util, P
displayValues.service_uuid = service.name;
};

vm.onReferralChange = value => {
vm.searchQueries.is_refered = value;
};

vm.onPregnantChange = value => {
vm.searchQueries.is_pregnant = value;
};

// default filter limit - directly write to changes list
vm.onSelectLimit = function onSelectLimit(val) {
// input is type value, this will only be defined for a valid number
Expand Down
2 changes: 1 addition & 1 deletion test/end-to-end/visits/visits.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class VisitPage {
}

if (options.isPregnant) {
await TU.locator(by.model('$ctrl.searchQueries.is_pregnant')).check();
await components.yesNoRadios.set('yes', 'patient-is-pregnant');
}

// hospitalization
Expand Down

0 comments on commit d477418

Please sign in to comment.