Skip to content

Commit

Permalink
EA-178 Allow telephone number person attribute type name to be config…
Browse files Browse the repository at this point in the history
…urable (#216)
  • Loading branch information
mseaton authored Nov 18, 2023
1 parent e4d98e4 commit 51b01ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ public class EmrApiConstants {

public static final String TEST_PATIENT_ATTRIBUTE_UUID = "4f07985c-88a5-4abd-aa0c-f3ec8324d8e7";

public static final String TELEPHONE_ATTRIBUTE_TYPE_NAME = "Telephone Number";
public static final String GP_TELEPHONE_ATTRIBUTE_TYPE_NAME = "emr.telephoneAttributeType";

public static final String TELEPHONE_ATTRIBUTE_TYPE_NAME = "Telephone Number"; // Default name if not defined

public static final String PRIMARY_IDENTIFIER_TYPE = "emr.primaryIdentifierType";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,11 @@ public PersonAttributeType getTestPatientPersonAttributeType() {
}

public PersonAttributeType getTelephoneAttributeType() {
PersonAttributeType type = null;
type = personService.getPersonAttributeTypeByName(EmrApiConstants.TELEPHONE_ATTRIBUTE_TYPE_NAME);
String lookup = getGlobalProperty(EmrApiConstants.GP_TELEPHONE_ATTRIBUTE_TYPE_NAME, false);
if (!StringUtils.hasText(lookup)) {
lookup = EmrApiConstants.TELEPHONE_ATTRIBUTE_TYPE_NAME;
}
PersonAttributeType type = personService.getPersonAttributeTypeByName(lookup);
if (type == null) {
throw new IllegalStateException("Configuration required: " + EmrApiConstants.TELEPHONE_ATTRIBUTE_TYPE_NAME);
}
Expand Down

0 comments on commit 51b01ab

Please sign in to comment.