Skip to content

Commit

Permalink
disabled motherlinkage unused fields
Browse files Browse the repository at this point in the history
  • Loading branch information
daviemukungi committed Jul 22, 2020
1 parent 03d0d16 commit 6d5f939
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions ui/app/registration/directives/patientRelationship.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ angular.module('bahmni.registration')
.controller('PatientRelationshipController', ['$window', '$scope', '$rootScope', 'spinner', 'patientService', 'providerService', 'appService', '$q',
function ($window, $scope, $rootScope, spinner, patientService, providerService, appService, $q) {
$scope.isReadOnly = $scope.isReadOnly() || function () { return false; };

var personAttributes = [];
$scope.addPlaceholderRelationship = function () {
$scope.patient.newlyAddedRelationships.push({});
};
Expand Down Expand Up @@ -59,7 +59,7 @@ angular.module('bahmni.registration')
};

$scope.getRelationshipType = function (uuid) {
return _.find($scope.relationshipTypes, {uuid: uuid});
return _.find($scope.relationshipTypes, { uuid: uuid });
};

$scope.getRelationshipTypeForDisplay = function (relationship) {
Expand All @@ -86,7 +86,7 @@ angular.module('bahmni.registration')
};

var getPersonB = function (personName, personUuid) {
return {'display': personName, 'uuid': personUuid};
return { 'display': personName, 'uuid': personUuid };
};
$scope.searchByPatientIdentifier = function (relationship) {
if (!relationship.patientIdentifier) {
Expand Down Expand Up @@ -254,6 +254,13 @@ angular.module('bahmni.registration')
delete relationship.providerName;
delete relationship.endDate;
delete relationship.content;
if (relationship.relationshipType.uuid) {
angular.element(document).find("#MothersArtNo").attr('disabled', true);
angular.element(document).find("#MotherInCareAtArtClinic").attr('disabled', true);
} else {
angular.element(document).find("#MothersArtNo").attr('disabled', false);
angular.element(document).find("#MotherInCareAtArtClinic").attr('disabled', false);
}
managePlaceholderRelationshipRows(index);
};

Expand Down

0 comments on commit 6d5f939

Please sign in to comment.