Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 0 additions & 52 deletions .tx/config

This file was deleted.

7 changes: 4 additions & 3 deletions ui/app/i18n/registration/locale_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,16 @@
"REGISTRATION_LABEL_VALID_PATIENT_IDENTIFIER":"Please enter a valid patient identifier",
"REGISTRATION_LABEL_PROVIDER_AUTOCOMPLETE_LIST":"Please select a provider from the autocomplete list",
"REGISTRATION_LABEL_PATIENT_AUTOCOMPLETE_LIST":"Please select a patient from the autocomplete list",
"REGISTRATION_LABEL_ENTER_NAME":"Enter Name",
"REGISTRATION_LABEL_ENTER_NAME":"Enter First Name",
"REGISTRATION_LABEL_ENTER_LAST_NAME":"Enter Last Name",
"REGISTRATION_LABEL_PERSON_NOT_FOUND":"Person not found",
"REGISTRATION_LABEL_PATIENT_ID":"ID",
"REGISTRATION_LABEL_PATIENT_ID_HIE":"ECID",
"REGISTRATION_LABEL_SEARCH":"Search",
"REGISTRATION_LABEL_NAME":"First Name",
"REGISTRATION_LABEL_LAST_NAME":"Last Name",
"REGISTRATION_LABEL_SEARCH_HIE":"HIE Search",
"REGISTRATION_LABEL_NAME":"Name",
"REGISTRATION_LABEL_ID":"ID",

"REGISTRATION_LABEL_NO_RESULTS":"No more results",
"REGISTRATION_LABEL_SUMMARY":"Summary",
"REGISTRATION_LABEL_CLOSE_VISIT":"Close Visit",
Expand Down
13 changes: 11 additions & 2 deletions ui/app/registration/controllers/searchPatientController.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ angular.module('bahmni.registration')

var hasSearchParameters = function () {
return $scope.searchParameters.name.trim().length > 0 ||
$scope.searchParameters.last_name.trim().length > 0 ||
$scope.searchParameters.addressFieldValue.trim().length > 0 ||
$scope.searchParameters.customAttribute.trim().length > 0 ||
$scope.searchParameters.programAttributeFieldValue.trim().length > 0 ||
Expand Down Expand Up @@ -91,6 +92,7 @@ angular.module('bahmni.registration')
var searchParameters = $location.search();
$scope.searchParameters.addressFieldValue = searchParameters.addressFieldValue || '';
$scope.searchParameters.name = searchParameters.name || '';
$scope.searchParameters.last_name = searchParameters.last_name || '';
$scope.searchParameters.customAttribute = searchParameters.customAttribute || '';
$scope.searchParameters.programAttributeFieldValue = searchParameters.programAttributeFieldValue || '';
$scope.searchParameters.addressSearchResultsConfig = searchParameters.addressSearchResultsConfig || '';
Expand All @@ -103,6 +105,7 @@ angular.module('bahmni.registration')
searching = true;
var searchPromise = patientService.search(
$scope.searchParameters.name,
$scope.searchParameters.last_name,
undefined,
$scope.addressSearchConfig.field,
$scope.searchParameters.addressFieldValue,
Expand Down Expand Up @@ -130,6 +133,7 @@ angular.module('bahmni.registration')
searching = true;
var searchPromise = patientService.searchHIE(
$scope.searchParameters.name,
$scope.searchParameters.last_name,
undefined,
$scope.searchParameters.nationalId,
$scope.searchParameters.gender,
Expand All @@ -150,7 +154,7 @@ angular.module('bahmni.registration')
$scope.noResultsMessage = null;

} else {
$scope.noResultsMessage = 'testing not found message ';
$scope.noResultsMessage = 'REGISTRATION_LABEL_COULD_NOT_FIND_PATIENT';
}
});

Expand Down Expand Up @@ -325,11 +329,14 @@ angular.module('bahmni.registration')

if ($scope.option.selected == "national") {
disabled = !$scope.searchParameters.name && !$scope.searchParameters.addressFieldValue
&& !$scope.searchParameters.last_name
&& !$scope.searchParameters.addressFieldValue
&& !$scope.searchParameters.customAttribute
&& !$scope.searchParameters.programAttributeFieldValue
&& !$scope.searchParameters.nationalIdNumber;
} else if ($scope.option.selected == "local") {
disabled = !$scope.searchParameters.name && !$scope.searchParameters.addressFieldValue
&& !$scope.searchParameters.last_name
&& !$scope.searchParameters.customAttribute
&& !$scope.searchParameters.programAttributeFieldValue;
}
Expand All @@ -354,7 +361,6 @@ angular.module('bahmni.registration')
$scope.hieresults = [];

var patientIdentifier = $scope.searchParameters.registrationNumber;
debugger;
$location.search({
registrationNumber: $scope.searchParameters.registrationNumber,
programAttributeFieldName: $scope.programAttributesSearchConfig.field,
Expand Down Expand Up @@ -454,6 +460,9 @@ angular.module('bahmni.registration')
if ($scope.searchParameters.name) {
queryParams.name = $scope.searchParameters.name;
}
if ($scope.searchParameters.last_name) {
queryParams.last_name = $scope.searchParameters.last_name;
}
if ($scope.searchParameters.addressFieldValue) {
queryParams.addressFieldValue = $scope.searchParameters.addressFieldValue;
}
Expand Down
10 changes: 6 additions & 4 deletions ui/app/registration/services/patientService.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ angular.module('bahmni.registration')
var openmrsUrl = Bahmni.Registration.Constants.openmrsUrl;
var baseOpenMRSRESTURL = Bahmni.Registration.Constants.baseOpenMRSRESTURL;

var search = function (query, identifier, addressFieldName, addressFieldValue, customAttributeValue,
var search = function (query, surname, identifier, addressFieldName, addressFieldValue, customAttributeValue,
offset, customAttributeFields, programAttributeFieldName, programAttributeFieldValue, addressSearchResultsConfig,
patientSearchResultsConfig, filterOnAllIdentifiers) {
var config = {
params: {
q: query,
q: query + " " + surname,
surname: surname,
identifier: identifier,
s: "byIdOrNameOrVillage",
addressFieldName: addressFieldName,
Expand All @@ -29,13 +30,14 @@ angular.module('bahmni.registration')
};
return patientServiceStrategy.search(config);
};
var searchHIE = function (query, identifier, nationalId, gender, addressFieldName, addressFieldValue, customAttributeValue,
var searchHIE = function (query, surname, identifier, nationalId, gender, addressFieldName, addressFieldValue, customAttributeValue,
offset, customAttributeFields, programAttributeFieldName, programAttributeFieldValue, addressSearchResultsConfig,
patientSearchResultsConfig, filterOnAllIdentifiers) {

var config = {
params: {
q: query,
q: query + " " + surname,
surname: surname,
identifier: identifier,
nationalId: nationalId,
gender: gender,
Expand Down
6 changes: 3 additions & 3 deletions ui/app/registration/views/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ <h2 class="section-title">Location</h2>
<label for="name"><strong>{{ ::'REGISTRATION_LABEL_NAME' | translate}}</strong></label>
<input tabindex="4" type="text" id="name" ng-model="searchParameters.name" placeholder="{{ ::'REGISTRATION_LABEL_ENTER_NAME' | translate}}">
</article>
<article class="fl" ng-if="::customAttributesSearchConfig.show">
<label for="name"><strong>{{::customAttributesSearchConfig.label}}</strong></label>
<input tabindex="5" type="text" id="customAttribute" ng-model="searchParameters.customAttribute" placeholder="{{::customAttributesSearchConfig.placeholder}}">
<article class="fl">
<label for="last_name"><strong>{{ ::'REGISTRATION_LABEL_LAST_NAME' | translate}}</strong></label>
<input tabindex="4" type="text" id="last_name" ng-model="searchParameters.last_name" placeholder="{{ ::'REGISTRATION_LABEL_ENTER_LAST_NAME' | translate}}">
</article>

<article class="fl" ng-show="showNationalId()">
Expand Down