Skip to content

Commit

Permalink
be better at software
Browse files Browse the repository at this point in the history
  • Loading branch information
fzhao99 committed Oct 25, 2023
1 parent 7729d0b commit 7c2feb5
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 @@ -132,8 +132,10 @@ public CompletableFuture<Set<Person>> savePatients(byte[] content, UUID facility
.ethnicity(convertEthnicityToDatabaseValue(extractedData.getEthnicity().getValue()))
.gender(convertSexToDatabaseValue(extractedData.getBiologicalSex().getValue()))
.genderIdentity(
convertGenderIdentityToDatabaseValue(
extractedData.getGenderIdentity().getValue()))
extractedData.getGenderIdentity().getValue() == null
? null
: convertGenderIdentityToDatabaseValue(
extractedData.getGenderIdentity().getValue()))
.residentCongregateSetting(
parseYesNoUnk(extractedData.getResidentCongregateSetting().getValue()))
.employedInHealthcare(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,10 @@ public static MappingIterator<Map<String, String>> getIteratorForCsv(InputStream

/* Values need to be lower case to play nice with frontend */
public static String convertGenderIdentityToDatabaseValue(String genderIdentity) {
return genderIdentity.toLowerCase();
if (genderIdentity != null) {
return genderIdentity.toLowerCase();
}
return "";
}

/* The acceptable values for race and ethnicity don't map to the values expected in our database. */
Expand Down

0 comments on commit 7c2feb5

Please sign in to comment.