Skip to content

Commit

Permalink
Merge pull request #132 from Bahmni/fix-appointments-list-view
Browse files Browse the repository at this point in the history
Fix | Handle null value for customPersonAttributeTypes
  • Loading branch information
umair-fayaz authored Sep 19, 2023
2 parents 8014727 + 034e33d commit 4cac231
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ private Map createPatientMap(Patient p) {
}

private static Map<String, String> mapAttributeTypes(Patient p) {
String customPersonAttributeTypes = Context.getAdministrationService().getGlobalProperty("appointments.personAttributeTypes");
String[] attributeTypes = customPersonAttributeTypes.split(",");
String customPersonAttributeTypes = Context.getAdministrationService().getGlobalProperty("appointments.customPersonAttributeTypes");
String[] attributeTypes = customPersonAttributeTypes != null ? customPersonAttributeTypes.split(",") : new String[0];
Map<String, String> customAttributesMap = new HashMap<>();
for (String attributeType : attributeTypes) {
if (p.getAttribute(attributeType) != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public class AppointmentMapperTest {
private Provider provider;
private Location location;

private static final String PERSON_ATTRIBUTE_TYPE_GLOBAL_PROPERTY = "appointments.personAttributeTypes";
private static final String PERSON_ATTRIBUTE_TYPE_GLOBAL_PROPERTY = "appointments.customPersonAttributeTypes";

private static final String PERSON_ATTRIBUTE_TYPE_GLOBAL_PROPERTY_VALUES = "attributeA,attributeB,attributeC,attributeD";

Expand Down

0 comments on commit 4cac231

Please sign in to comment.