New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tarun,Supriya,Ramu, Prajakta, Venky | BAH-1389 | MOBN-1748 | MOBN-1784 | Registration Module] Make local language field mandatory and add UI Validation to extra Patient Identifiers #489
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
3ff3bb9
Tarun,Supriya,Ramu, Prajakta, Venky | BAH-1839 | MOBN-1748 | MOBN-178…
venkybavisetti 054923b
Kiruthiga, Venky | BAH-1389 | add labels name in internationalisation…
venkybavisetti 2423474
Kiruthiga, Venky | BAH-1389 | resolve merge conflicts
venkybavisetti File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict'; | ||
|
||
angular.module('bahmni.registration') | ||
.directive('extraPatientIdentifiers', function () { | ||
return { | ||
templateUrl: 'views/patientIdentifier.html', | ||
scope: { | ||
fieldValidation: '=', | ||
patient: '=' | ||
}, | ||
restrict: 'E' | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<section ng-controller="PatientCommonController"> | ||
<div ng-if="patient.uuid != undefined"> | ||
<article ng-repeat="identifier in patient.extraIdentifiers" class="form-field existing-patient"> | ||
<div class="field-attribute"> | ||
<label class="control-label" for="patientID">{{:: getTranslatedPatientControls(identifier.identifierType.name)}} | ||
<span ng-show=":: identifier.identifierType.required && !identifier.hasIdentifierSources()" | ||
class="asterick">*</span> | ||
</label> | ||
</div> | ||
<div class="field-value"> | ||
<input type="text" ng-model="identifier.identifier" disabled | ||
ng-if="identifier.hasIdentifierSources()"/> | ||
|
||
<input type="text" id="{{identifier.identifierType.name}}" ng-model="identifier.registrationNumber" | ||
ng-if="!identifier.hasIdentifierSources()" | ||
non-blank="identifier.identifierType.required && !identifier.hasIdentifierSources()" | ||
pattern-validate ng-change="identifier.generate()" | ||
ng-disabled="readOnlyExtraIdentifiers.indexOf(identifier.identifierType.name)>-2"> | ||
<div class="extension-btn" ng-show="showIdentifierVerificationButton(identifier.identifierType.name,identifier.registrationNumber)"> | ||
<span ng-repeat="extButton in getExtButtons(identifier.identifierType.name)"> | ||
<span> {{:: extButton.link}} </span> | ||
<button type="button" | ||
ng-click="openIdentifierPopup(identifier.identifierType.name, extButton.action)">{{:: extButton.display}} | ||
</button> | ||
</span> | ||
</div> | ||
</div> | ||
</article> | ||
</div> | ||
<div ng-if="patient.uuid == undefined"> | ||
<article ng-repeat="identifier in patient.extraIdentifiers" | ||
class="form-field existing-patient"> | ||
<div class="field-attribute"> | ||
<label class="control-label" for="patientID">{{:: getTranslatedPatientControls(identifier.identifierType.name)}} | ||
<span ng-show="::identifier.identifierType.required && !identifier.hasIdentifierSources()" | ||
class="asterick">*</span> | ||
</label> | ||
</div> | ||
<div ng-show="::(identifier.hasIdentifierSources() && !identifier.hasIdentifierSourceWithEmptyPrefix())" | ||
class="field-value" id="patientID"> | ||
<select id="identifierPrefix" ng-model="identifier.selectedIdentifierSource" | ||
ng-options="identifierSource.prefix for identifierSource in ::identifier.identifierType.identifierSources" | ||
ng-change="patient.generateIdentifier(identifier)" | ||
required> | ||
</select> | ||
</div> | ||
<div class="field-value" ng-if="!identifier.hasIdentifierSources()"> | ||
<input type="text" id="{{identifier.identifierType.name}}" ng-model="identifier.registrationNumber" | ||
non-blank="identifier.isIdentifierRequired()" pattern-validate | ||
ng-change="identifier.generate()" focus-on="identifier.hasOldIdentifier" | ||
ng-show="identifier.hasOldIdentifier || !identifier.hasIdentifierSources()" | ||
ng-disabled="readOnlyExtraIdentifiers.indexOf(identifier.identifierType.name)>-1"> | ||
<div class="extension-btn" ng-show="showIdentifierVerificationButton(identifier.identifierType.name,identifier.registrationNumber)"> | ||
<span ng-repeat="extButton in getExtButtons(identifier.identifierType.name)"> | ||
<span> {{:: extButton.link}} </span> | ||
<button type="button" | ||
ng-click="openIdentifierPopup(identifier.identifierType.name, extButton.action)">{{:: extButton.display}} | ||
</button> | ||
</span> | ||
</div> | ||
</div> | ||
|
||
<div class="field-value field-value-has-identifier" ng-show="::identifier.hasIdentifierSources()"> | ||
<input type="text" id="{{identifier.identifierType.name}}" ng-model="identifier.registrationNumber" | ||
non-blank="identifier.isIdentifierRequired()" pattern-validate | ||
ng-change="identifier.generate()" focus-on="identifier.hasOldIdentifier" | ||
ng-show="identifier.hasOldIdentifier || !identifier.hasIdentifierSources()" | ||
ng-disabled="readOnlyExtraIdentifiers.indexOf(identifier.identifierType.name)>-1"> | ||
|
||
<div class="fl"> | ||
<div class="field-attribute hasOldIdentifier-field-attribute"> | ||
<label for="hasOldIdentifier" ng-show="::showEnterID" class="control-label">{{::'REGISTRATION_LABEL_ENTER_ID' | | ||
translate}}</label> | ||
</div> | ||
<div class="field-value"> | ||
<input class="input-label-inline" ng-show="::showEnterID" type="checkbox" | ||
id="hasOldIdentifier" ng-model="identifier.hasOldIdentifier" | ||
ng-change="identifier.clearRegistrationNumber()"> | ||
</div> | ||
</div> | ||
</div> | ||
</article> | ||
</div> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,21 +3,21 @@ | |
<section> | ||
<article class="form-field patient-name-wrapper" ng-if="::patientConfiguration.local()['showNameField']"> | ||
<div class="field-attribute"> | ||
<label for="patientName">{{::getTranslatedPatientControls(patientConfiguration.local()['labelForNameField'])}}</label> | ||
<label for="patientName">{{::getTranslatedPatientControls(patientConfiguration.local()['labelForNameField'])}}<span class="asterick" ng-show="localLanguageNameIsRequired()">*</span></label> | ||
</div> | ||
<div class="field-value" id="patientNameLocal"> | ||
<span ng-repeat="nameField in patientNameDisplayOrder"> | ||
<input type="text" id="givenNameLocal" ng-model="patient.givenNameLocal" pattern-validate | ||
placeholder="{{::getTranslatedPatientControls(patientConfiguration.local()['placeholderForGivenName'])}}" focus-me="true" | ||
ng-if="nameField === 'firstName'"> | ||
placeholder="{{::'PATIENT_ATTRIBUTE_GIVEN_NAME_LOCAL' | translate}}" focus-me="true" | ||
ng-if="nameField === 'firstName'" ng-required={{localLanguageNameIsRequired('givenNameLocal')}}> | ||
<input ng-show="::showMiddleName" type="text" id="middleNameLocal" | ||
ng-model="patient.middleNameLocal" | ||
pattern-validate | ||
placeholder="{{::getTranslatedPatientControls(patientConfiguration.local()['placeholderForMiddleName'])}}" | ||
ng-if="nameField === 'middleName'"> | ||
placeholder="{{::'PATIENT_ATTRIBUTE_MIDDLE_NAME_LOCAL' | translate}}" | ||
ng-if="nameField === 'middleName'" ng-required={{localLanguageNameIsRequired('middleNameLocal')}}> | ||
<input type="text" ng-show="::showLastName" id="familyNameLocal" ng-model="patient.familyNameLocal" pattern-validate | ||
placeholder="{{::getTranslatedPatientControls(patientConfiguration.local()['placeholderForFamilyName'])}}" | ||
ng-if="nameField === 'lastName'"> | ||
placeholder="{{::'PATIENT_ATTRIBUTE_FAMILY_NAME_LOCAL' | translate}}" | ||
ng-if="nameField === 'lastName'" ng-required={{localLanguageNameIsRequired('familyNameLocal')}}> | ||
</span> | ||
</div> | ||
</article> | ||
|
@@ -152,90 +152,7 @@ | |
|
||
<section> | ||
<!--edit patient flow--> | ||
<section> | ||
<div ng-if="patient.uuid != undefined"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are these code sections removed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed, We have refactored this code to validate Additional identifier |
||
<article ng-repeat="identifier in patient.extraIdentifiers" class="form-field existing-patient"> | ||
<div class="field-attribute"> | ||
<label class="control-label" for="patientID">{{:: getTranslatedPatientControls(identifier.identifierType.name)}} | ||
<span ng-show=":: identifier.identifierType.required && !identifier.hasIdentifierSources()" | ||
class="asterick">*</span> | ||
</label> | ||
</div> | ||
<div class="field-value"> | ||
<input type="text" ng-model="identifier.identifier" disabled | ||
ng-if="identifier.hasIdentifierSources()"/> | ||
|
||
<input type="text" id="registrationNumber" ng-model="identifier.registrationNumber" | ||
ng-if="!identifier.hasIdentifierSources()" | ||
non-blank="identifier.identifierType.required && !identifier.hasIdentifierSources()" | ||
pattern-validate ng-change="identifier.generate()" | ||
ng-disabled="readOnlyExtraIdentifiers.indexOf(identifier.identifierType.name)>-2"> | ||
<div class="extension-btn" ng-show="showIdentifierVerificationButton(identifier.identifierType.name,identifier.registrationNumber)"> | ||
<span ng-repeat="extButton in getExtButtons(identifier.identifierType.name)"> | ||
<span> {{:: extButton.link}} </span> | ||
<button type="button" | ||
ng-click="openIdentifierPopup(identifier.identifierType.name, extButton.action)">{{:: extButton.display}} | ||
</button> | ||
</span> | ||
</div> | ||
</div> | ||
</article> | ||
</div> | ||
<div ng-if="patient.uuid == undefined"> | ||
<article ng-repeat="identifier in patient.extraIdentifiers" | ||
class="form-field existing-patient"> | ||
<div class="field-attribute"> | ||
<label class="control-label" for="patientID">{{:: getTranslatedPatientControls(identifier.identifierType.name)}} | ||
<span ng-show="::identifier.identifierType.required && !identifier.hasIdentifierSources()" | ||
class="asterick">*</span> | ||
</label> | ||
</div> | ||
<div ng-show="::(identifier.hasIdentifierSources() && !identifier.hasIdentifierSourceWithEmptyPrefix())" | ||
class="field-value" id="patientID"> | ||
<select id="identifierPrefix" ng-model="identifier.selectedIdentifierSource" | ||
ng-options="identifierSource.prefix for identifierSource in ::identifier.identifierType.identifierSources" | ||
ng-change="patient.generateIdentifier(identifier)" | ||
required> | ||
</select> | ||
</div> | ||
<div class="field-value" ng-if="!identifier.hasIdentifierSources()"> | ||
<input type="text" id="registrationNumber" ng-model="identifier.registrationNumber" | ||
non-blank="identifier.isIdentifierRequired()" pattern-validate | ||
ng-change="identifier.generate()" focus-on="identifier.hasOldIdentifier" | ||
ng-show="identifier.hasOldIdentifier || !identifier.hasIdentifierSources()" | ||
ng-disabled="readOnlyExtraIdentifiers.indexOf(identifier.identifierType.name)>-1"> | ||
<div class="extension-btn" ng-show="showIdentifierVerificationButton(identifier.identifierType.name,identifier.registrationNumber)"> | ||
<span ng-repeat="extButton in getExtButtons(identifier.identifierType.name)"> | ||
<span> {{:: extButton.link}} </span> | ||
<button type="button" | ||
ng-click="openIdentifierPopup(identifier.identifierType.name, extButton.action)">{{:: extButton.display}} | ||
</button> | ||
</span> | ||
</div> | ||
</div> | ||
|
||
<div class="field-value field-value-has-identifier" ng-show="::identifier.hasIdentifierSources()"> | ||
<input type="text" id="registrationNumber" ng-model="identifier.registrationNumber" | ||
non-blank="identifier.isIdentifierRequired()" pattern-validate | ||
ng-change="identifier.generate()" focus-on="identifier.hasOldIdentifier" | ||
ng-show="identifier.hasOldIdentifier || !identifier.hasIdentifierSources()" | ||
ng-disabled="readOnlyExtraIdentifiers.indexOf(identifier.identifierType.name)>-1"> | ||
|
||
<div class="fl"> | ||
<div class="field-attribute hasOldIdentifier-field-attribute"> | ||
<label for="hasOldIdentifier" ng-show="::showEnterID" class="control-label">{{::'REGISTRATION_LABEL_ENTER_ID' | | ||
translate}}</label> | ||
</div> | ||
<div class="field-value"> | ||
<input class="input-label-inline" ng-show="::showEnterID" type="checkbox" | ||
id="hasOldIdentifier" ng-model="identifier.hasOldIdentifier" | ||
ng-change="identifier.clearRegistrationNumber()"> | ||
</div> | ||
</div> | ||
</div> | ||
</article> | ||
</div> | ||
</section> | ||
<extra-patient-identifiers field-validation="::fieldValidation" patient="patient"></extra-patient-identifiers> | ||
<div class="identifier-ui" ng-hide="!showExtIframe"> | ||
<div class="identifier-iframe"> | ||
<span class="close" ng-click="closeIdentifierPopup()">×</span> | ||
|
@@ -310,4 +227,4 @@ | |
<ng-include src="'views/patientDeathInformation.html'"></ng-include> | ||
</section> | ||
</div> | ||
</div> | ||
</div> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if this is advisable anymore i.e using person attribute. OMRS already has a name model where names in different locale can be added. I would have advised that.
Also, just because the person attribute is marked as required does not mean that value must be provided - I would have thought you enable this by some sort of configuration (which I think we already have).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, we couldn’t see any option make the field has mandatory in the back-end so we have added this