Skip to content

Commit

Permalink
BAH-3053 | add pre-patient attribute in registration page (#600) (#638)
Browse files Browse the repository at this point in the history
* BAH-3053 | add pre-patient attribute in registration page (#600)

* BAH-3053 | add pre-patient attribute in registration page

* BAH-3053 | added check for pre-registration attribute

* BAH-3053 | refactored to drive by single config

* Kavitha | refactored pre-patient flow based on configs

* Kavitha | BAH-3065 | add additional search param for lucene search (#604)

* Update package.json (#884)

* [Rahul] | BAH-3710 | Fix. Remove Transifex Script

* [Bahmni Infra] | Add. Update Translation Resources

* Parvathy | BAH-2833 | Add. Display Error Message When Document Size Limit Exceed (#875)

* [Rahu] | BAH-3522 | Fix. Improve Test Coverage For DateUtils

* [Bahmni Infra] | Add. Update Translation Resources

* Parvathy | BAH-2833 | Fix. Handle Document Size Limit Error Message

* Revert "Update package.json (#884)"

This reverts commit 30091b3.

* Revert "[Rahul] | BAH-3710 | Fix. Remove Transifex Script"

This reverts commit bbc704d.

* Revert "Parvathy | BAH-2833 | Add. Display Error Message When Document Size Limit Exceed (#875)"

This reverts commit 67a004b.

* Revert "[Rahu] | BAH-3522 | Fix. Improve Test Coverage For DateUtils"

This reverts commit 1bf9ff7.

* Revert "[Bahmni Infra] | Add. Update Translation Resources"

This reverts commit 95d96c4.

* Revert "Parvathy | BAH-2833 | Fix. Handle Document Size Limit Error Message"

This reverts commit 95fdfac.

* Kavitha | refactor to accept grouped configs

* Revert unnecessary commit

* BAH-3053 | renamed configuration names

* BAH-3053 | renamed lables to related patient identifier

---------
  • Loading branch information
kavitha-sundararajan committed May 7, 2024
1 parent 53608c9 commit e9d72e8
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 20 deletions.
9 changes: 5 additions & 4 deletions ui/app/common/patient/services/patientService.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ angular.module('bahmni.common.patient')
q: query,
startIndex: offset,
identifier: identifier,
loginLocationUuid: sessionService.getLoginLocationUuid(),
patientSearchResultsConfig: customAttribute
loginLocationUuid: sessionService.getLoginLocationUuid()
};
if (appService.getAppDescriptor().getConfigValue("filterAttributeForAllSearch")) {
searchParams.attributeToFilterOut = appService.getAppDescriptor().getConfigValue("filterAttributeForAllSearch");
var filterOutAttributeForAllSearch = appService.getAppDescriptor().getConfigValue("filterOutAttributeForAllSearch") || [];
if (filterOutAttributeForAllSearch && filterOutAttributeForAllSearch.length > 0) {
searchParams.attributeToFilterOut = filterOutAttributeForAllSearch[0].attrName;
searchParams.attributeValueToFilterOut = filterOutAttributeForAllSearch[0].attrValue;
}
return $http.get(Bahmni.Common.Constants.bahmniCommonsSearchUrl + "/patient/lucene", {
method: "GET",
Expand Down
2 changes: 1 addition & 1 deletion ui/app/i18n/registration/locale_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,5 @@
"PATIENT_ATTRIBUTE_GIVEN_NAME_LOCAL": "First Name in Arabic",
"PATIENT_ATTRIBUTE_FAMILY_NAME_LOCAL": "Last Name in Arabic",
"PATIENT_ATTRIBUTE_MIDDLE_NAME_LOCAL": "Middle Name in Arabic",
"PRE_REGISTRATION_LABEL": "Patient"
"RELATED_PATIENT_IDENTIFIER_LABEL": "Patient"
}
6 changes: 4 additions & 2 deletions ui/app/registration/controllers/createPatientController.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ angular.module('bahmni.registration')
$scope.addressHierarchyConfigs = appService.getAppDescriptor().getConfigValue("addressHierarchy");
$scope.disablePhotoCapture = appService.getAppDescriptor().getConfigValue("disablePhotoCapture");
$scope.showEnterID = configValueForEnterId === null ? true : configValueForEnterId;
$scope.preRegistrationAttribute = appService.getAppDescriptor().getConfigValue('preRegistrationAttribute');
$scope.relatedIdentifierAttribute = appService.getAppDescriptor().getConfigValue('relatedIdentifierAttribute');
$scope.today = Bahmni.Common.Util.DateTimeFormatter.getDateWithoutTime(dateUtil.now());
$scope.moduleName = appService.getAppDescriptor().getConfigValue('registrationModuleName');
var patientId;
Expand Down Expand Up @@ -99,7 +99,9 @@ angular.module('bahmni.registration')
_.chain(defaultsWithAnswers).filter(isConcept).each(setDefaultConcept).value();
_.chain(defaultsWithAnswers).filter(isLocation).each(setDefaultLocation).value();
_.chain(defaultsWithAnswers).filter(isDateType).each(setDefaultValue).value();
$scope.patient[$scope.preRegistrationAttribute] = false;
if ($scope.relatedIdentifierAttribute && $scope.relatedIdentifierAttribute.name) {
$scope.patient[$scope.relatedIdentifierAttribute.name] = false;
}
};

var expandSectionsWithDefaultValue = function () {
Expand Down
10 changes: 8 additions & 2 deletions ui/app/registration/controllers/editPatientController.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@ angular.module('bahmni.registration')
expandDataFilledSections();
$scope.patientLoaded = true;
$scope.enableWhatsAppButton = (appService.getAppDescriptor().getConfigValue("enableWhatsAppButton") || Bahmni.Registration.Constants.enableWhatsAppButton) && ($scope.patient.phoneNumber != undefined);
$scope.preRegistrationAttribute = appService.getAppDescriptor().getConfigValue('preRegistrationAttribute');
$scope.showPreRegistrationOption = $scope.preRegistrationAttribute && $scope.patient[$scope.preRegistrationAttribute] == false;
$scope.relatedIdentifierAttribute = appService.getAppDescriptor().getConfigValue('relatedIdentifierAttribute');
if ($scope.relatedIdentifierAttribute && $scope.relatedIdentifierAttribute.name) {
const hideOrDisableAttr = $scope.relatedIdentifierAttribute.hideOrDisable;
const hideAttrOnValue = $scope.relatedIdentifierAttribute.hideOnValue;
$scope.showRelatedIdentifierOption = !(hideOrDisableAttr === "hide" && $scope.patient[$scope.relatedIdentifierAttribute.name] &&
$scope.patient[$scope.relatedIdentifierAttribute.name].toString() === hideAttrOnValue);
$scope.showDisabledAttrOption = hideOrDisableAttr === "disable" ? true : false;
}
};

var expandDataFilledSections = function () {
Expand Down
9 changes: 4 additions & 5 deletions ui/app/registration/views/editpatient.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,16 @@
<div class="field-value">
<span class="uneditable-input text-only">{{patient.registrationDate | bahmniDate}}</span>
</div>
<div ng-if="showPreRegistrationOption" class="field-value field-value-has-identifier">
<div ng-if="showRelatedIdentifierOption" class="field-value field-value-has-identifier">
<div class="fl">
<div class="field-attribute hasOldIdentifier-field-attribute">
<label for="pre-registration-attribute" class="control-label">{{::'PRE_REGISTRATION_LABEL' | translate}}</label>
<label for="related-identifier-attribute" class="control-label related-identifier-label">{{::'RELATED_PATIENT_IDENTIFIER_LABEL' | translate}}</label>
</div>
<div class="field-value">
<input class="input-label-inline" type="checkbox" id="pre-registration-attribute" ng-model="patient[preRegistrationAttribute]"
ng-change="patient[preRegistrationAttribute].handleUpdate()">
<input class="input-label-inline" type="checkbox" id="related-identifier-attribute" ng-model="patient[relatedIdentifierAttribute.name]"
ng-change="patient[relatedIdentifierAttribute.name].handleUpdate()" ng-disabled="showDisabledAttrOption" ng-style="{'opacity' : showDisabledAttrOption ? '0.4':'unset'}">
</div>
</div>
</div>
</article>
</div>
<ng-include src="'views/patientcommon.html'"></ng-include>
Expand Down
10 changes: 5 additions & 5 deletions ui/app/registration/views/newpatient.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@
</div>
</div>
</div>
<div ng-show="::preRegistrationAttribute" class="field-value field-value-has-identifier">
<div ng-show="true" class="fl">
<div ng-show="::relatedIdentifierAttribute.name" class="field-value field-value-has-identifier">
<div class="fl">
<div class="field-attribute hasOldIdentifier-field-attribute">
<label for="pre-registration-attribute" class="control-label">{{::'PRE_REGISTRATION_LABEL' | translate}}</label>
<label for="related-identifier-attribute" class="control-label">{{::'RELATED_PATIENT_IDENTIFIER_LABEL' | translate}}</label>
</div>
<div class="field-value">
<input type="checkbox" class="input-label-inline" id="pre-registration-attribute" ng-model="patient[preRegistrationAttribute]"
ng-change="patient[preRegistrationAttribute].handleUpdate()">
<input type="checkbox" class="input-label-inline" id="related-identifier-attribute" ng-model="patient[relatedIdentifierAttribute.name]"
ng-change="patient[relatedIdentifierAttribute.name].handleUpdate()">
</div>
</div>
</div>
Expand Down
5 changes: 4 additions & 1 deletion ui/app/styles/registration/_patientCommonInformation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
margin:8px 5px 8px 5px;
}
&.uneditable-input{
width: 5.2em;
width: 5.7em;
}
}
.related-identifier-label{
width: 14em !important;
}
}

form .form-field{
Expand Down

0 comments on commit e9d72e8

Please sign in to comment.