Skip to content

Commit

Permalink
Added Alien ID and driving license as patient identifiers, added an a…
Browse files Browse the repository at this point in the history
…ge validated banner if patient does not have all national identifiers
  • Loading branch information
patryllus committed Apr 20, 2022
1 parent 90d4fad commit f7c2226
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 10 deletions.
2 changes: 2 additions & 0 deletions api/src/main/distro/metadata/identifierTypes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@
<ref key="HUDUMA_NUMBER" uuid="6428800b-5a8c-4f77-a285-8d5f6174e5fb" />
<ref key="PASSPORT_NUMBER" uuid="be9beef6-aacc-4e1f-ac4e-5babeaa1e303" />
<ref key="BIRTH_CERTIFICATE_NUMBER" uuid="68449e5a-8829-44dd-bfef-c9c8cf2cb9b2" />
<ref key="ALIEN_ID_NUMBER" uuid="1c7d0e5b-2068-4816-a643-8de83ab65fbf" />
<ref key="DRIVING_LICENSE" uuid="ca125004-e8af-445d-9436-a43684150f8b" />
</refs>
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@ public CalculationResultMap evaluate(Collection<Integer> cohort, Map<String, Obj
PatientService patientService = Context.getPatientService();

PatientIdentifierType nationalID = MetadataUtils.existing(PatientIdentifierType.class, CommonMetadata._PatientIdentifierType.NATIONAL_ID);
PatientIdentifierType patientClinicNo = MetadataUtils.existing(PatientIdentifierType.class, CommonMetadata._PatientIdentifierType.PATIENT_CLINIC_NUMBER);
PatientIdentifierType passPortNo = MetadataUtils.existing(PatientIdentifierType.class, CommonMetadata._PatientIdentifierType.PASSPORT_NUMBER);
PatientIdentifierType hudumaNo = MetadataUtils.existing(PatientIdentifierType.class, CommonMetadata._PatientIdentifierType.HUDUMA_NUMBER);
PatientIdentifierType birthCertNo = MetadataUtils.existing(PatientIdentifierType.class, CommonMetadata._PatientIdentifierType.BIRTH_CERTIFICATE_NUMBER);
PatientIdentifierType alienID = MetadataUtils.existing(PatientIdentifierType.class, CommonMetadata._PatientIdentifierType.ALIEN_ID_NUMBER);
PatientIdentifierType drivingLicenseNo = MetadataUtils.existing(PatientIdentifierType.class, CommonMetadata._PatientIdentifierType.DRIVING_LICENSE);

List<PatientIdentifier> patientRegIdentifiers = patientService.getPatientIdentifiers(null, Arrays.asList(nationalID,patientClinicNo,passPortNo,hudumaNo,birthCertNo), null, Arrays.asList(patientService.getPatient(ptId)), false);
List<PatientIdentifier> patientRegIdentifiers = patientService.getPatientIdentifiers(null, Arrays.asList(nationalID,passPortNo,hudumaNo,birthCertNo,alienID,drivingLicenseNo), null, Arrays.asList(patientService.getPatient(ptId)), false);
if(patientRegIdentifiers.size() > 0){
missingAllIdentifiers = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ public static final class _PatientIdentifierType {
public static final String HUDUMA_NUMBER = Metadata.IdentifierType.HUDUMA_NUMBER;
public static final String PASSPORT_NUMBER = Metadata.IdentifierType.PASSPORT_NUMBER;
public static final String BIRTH_CERTIFICATE_NUMBER = Metadata.IdentifierType.BIRTH_CERTIFICATE_NUMBER;
public static final String ALIEN_ID_NUMBER = Metadata.IdentifierType.ALIEN_ID_NUMBER;
public static final String DRIVING_LICENSE = Metadata.IdentifierType.DRIVING_LICENSE;
}

public static final class _PersonAttributeType {
Expand Down Expand Up @@ -200,6 +202,10 @@ public void install() {
null, LocationBehavior.NOT_USED, false, _PatientIdentifierType.PASSPORT_NUMBER));
install(patientIdentifierType("Birth Certificate Number", "Birth certificate number for client", "^[a-zA-Z0-9]+$", "Allows for alphanumeric format",
null, LocationBehavior.NOT_USED, false, _PatientIdentifierType.BIRTH_CERTIFICATE_NUMBER));
install(patientIdentifierType("Alien ID Number", "Alien ID number for client", "^[a-zA-Z0-9]+$", "Allows for alphanumeric format",
null, LocationBehavior.NOT_USED, false, _PatientIdentifierType.ALIEN_ID_NUMBER));
install(patientIdentifierType("Driving License Number", "Driving License number for client", "^[a-zA-Z0-9]+$", "Allows for alphanumeric format",
null, LocationBehavior.NOT_USED, false, _PatientIdentifierType.DRIVING_LICENSE));


install(personAttributeType("Telephone contact", "Telephone contact number",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,40 @@ public String getBirthCertificateNumber() {
public void setBirthCertificateNumber(String value, Location location) {
setAsIdentifier(CommonMetadata._PatientIdentifierType.BIRTH_CERTIFICATE_NUMBER, value, location);
}
/**
* Gets the alien ID number
* @return the identifier value
*/
public String getAlienIdNumber() {
return getAsIdentifier(CommonMetadata._PatientIdentifierType.ALIEN_ID_NUMBER);
}


/**
* Sets the alien ID number
* @param value the identifier value
* @param location the identifier location
*/
public void setAlienIdNumber(String value, Location location) {
setAsIdentifier(CommonMetadata._PatientIdentifierType.ALIEN_ID_NUMBER, value, location);
}
/**
* Gets the Driving Licence number
* @return the identifier value
*/
public String getDrivingLicenseNumber() {
return getAsIdentifier(CommonMetadata._PatientIdentifierType.DRIVING_LICENSE);
}


/**
* Sets the Driving Licence number
* @param value the identifier value
* @param location the identifier location
*/
public void setDrivingLicenseNumber(String value, Location location) {
setAsIdentifier(CommonMetadata._PatientIdentifierType.DRIVING_LICENSE, value, location);
}

/**
* Sets the client number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ public class EditPatientForm extends AbstractWebForm {
private String passPortNumber;
private String hudumaNumber;
private String birthCertificateNumber;
private String alienIdNumber;
private String drivingLicenseNumber;



Expand Down Expand Up @@ -347,6 +349,8 @@ public EditPatientForm(Patient patient) {
patientClinicNumber = wrapper.getPatientClinicNumber();
passPortNumber = wrapper.getPassPortNumber();
hudumaNumber = wrapper.getHudumaNumber();
alienIdNumber = wrapper.getAlienIdNumber();
drivingLicenseNumber = wrapper.getDrivingLicenseNumber();
birthCertificateNumber = wrapper.getBirthCertificateNumber();
nationalIdNumber = wrapper.getNationalIdNumber();
nameOfNextOfKin = wrapper.getNextOfKinName();
Expand Down Expand Up @@ -460,6 +464,8 @@ public void validate(Object target, Errors errors) {
validateIdentifierField(errors, "passPortNumber", CommonMetadata._PatientIdentifierType.PASSPORT_NUMBER);
validateIdentifierField(errors, "hudumaNumber", CommonMetadata._PatientIdentifierType.HUDUMA_NUMBER);
validateIdentifierField(errors, "birthCertificateNumber", CommonMetadata._PatientIdentifierType.BIRTH_CERTIFICATE_NUMBER);
validateIdentifierField(errors, "alienIdNumber", CommonMetadata._PatientIdentifierType.ALIEN_ID_NUMBER);
validateIdentifierField(errors, "drivingLicenseNumber", CommonMetadata._PatientIdentifierType.DRIVING_LICENSE);



Expand Down Expand Up @@ -553,6 +559,8 @@ else if (original != null) {
wrapper.setPassPortNumber(passPortNumber, location);
wrapper.setHudumaNumber(hudumaNumber, location);
wrapper.setBirthCertificateNumber(birthCertificateNumber, location);
wrapper.setAlienIdNumber(alienIdNumber, location);
wrapper.setDrivingLicenseNumber(drivingLicenseNumber, location);


wrapper.setNextOfKinName(nameOfNextOfKin);
Expand Down Expand Up @@ -782,7 +790,32 @@ public String getBirthCertificateNumber() {
public void setBirthCertificateNumber(String birthCertificateNumber) {
this.birthCertificateNumber = birthCertificateNumber;
}
/**
* @return the alienIdNumber
*/

public String getAlienIdNumber() {
return alienIdNumber;
}
/**
* @param alienIdNumber the alienIdNumber to set
*/
public void setAlienIdNumber(String alienIdNumber) {
this.alienIdNumber = alienIdNumber;
}
/**
* @return the drivingLicenseNumber
*/

public String getDrivingLicenseNumber() {
return drivingLicenseNumber;
}
/**
* @param drivingLicenseNumber the drivingLicenseNumber to set
*/
public void setDrivingLicenseNumber(String drivingLicenseNumber) {
this.drivingLicenseNumber = drivingLicenseNumber;
}


/**
Expand Down
14 changes: 12 additions & 2 deletions omod/src/main/webapp/fragments/patient/editPatient.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<tr>
<td class="ke-field-label">National ID Number</td>
<td>${ui.includeFragment("kenyaui", "widget/field", [object: command, property: "nationalIdNumber"])}</td>
<td class="ke-field-instructions"><% if (!command.nationalIdNumber) { %>(If the patient is below 18 years of age, enter the guardian`s National Identification Number if available.)<% } %></td>
<td class="ke-field-instructions"><% if (!command.nationalIdNumber) { %>(If the patient is below 18 years of age, enter the guardian`s National Identification Number or patient's National ID waiting card number if available)<% } %></td>
</tr>
<tr>
<td class="ke-field-label">Passport Number</td>
Expand All @@ -140,7 +140,17 @@
<tr>
<td class="ke-field-label">Birth Certificate Number</td>
<td>${ui.includeFragment("kenyaui", "widget/field", [object: command, property: "birthCertificateNumber"])}</td>
<td class="ke-field-instructions"><% if (!command.birthCertificateNumber) { %>(if available)<% } %></td>
<td class="ke-field-instructions"><% if (!command.birthCertificateNumber) { %>(if available or Birth Notification number)<% } %></td>
</tr>
<tr>
<td class="ke-field-label">Alien ID Number</td>
<td>${ui.includeFragment("kenyaui", "widget/field", [object: command, property: "alienIdNumber"])}</td>
<td class="ke-field-instructions"><% if (!command.alienIdNumber) { %>(if available)<% } %></td>
</tr>
<tr>
<td class="ke-field-label">Driving License Number</td>
<td>${ui.includeFragment("kenyaui", "widget/field", [object: command, property: "drivingLicenseNumber"])}</td>
<td class="ke-field-instructions"><% if (!command.drivingLicenseNumber) { %>(if available)<% } %></td>
</tr>

<tr id="kdod-service-no">
Expand Down
17 changes: 11 additions & 6 deletions omod/src/main/webapp/fragments/patient/patientSummary.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@
Patient has been recorded as deceased in a program form. Please update the registration form.
</div>
<% } %>
<% if (missingIdentifiers) { %>
<div class="ke-warning" style="margin-bottom: 5px">
Patient has missing registration identifiers.
</div>
<% } %>

<% if (missingIdentifiers) { %>
<% if (patient.age > 17) { %>
<div class="ke-warning" style="margin-bottom: 5px">
Patient has missing National ID Number and other registration identifiers.
</div>
<% } else { %>
<div class="ke-warning" style="margin-bottom: 5px">
Patient has missing Birth Certificate Number and other registration identifiers.
</div>
<% } %>
<% } %>
<button type="button" class="ke-compact" onclick="ui.navigate('${ ui.pageLink("kenyaemr", "registration/editPatient", [ patientId: patient.id, returnUrl: ui.thisUrl() ]) }')">
<img src="${ ui.resourceLink("kenyaui", "images/glyphs/edit.png") }" />
</button>
Expand Down

0 comments on commit f7c2226

Please sign in to comment.