-
Notifications
You must be signed in to change notification settings - Fork 55
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
add notes and gender to patient bulk upload #6778
Changes from 9 commits
8145b40
2e5e814
38a4807
c50418f
a6737b1
9f696c4
2284a0a
2dc1268
24760e5
cc36960
5c5762a
7729d0b
7c2feb5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,30 +116,31 @@ public CompletableFuture<Set<Person>> savePatients(byte[] content, UUID facility | |
|
||
// create new person with current organization, then add to new patients list | ||
Person newPatient = | ||
new Person( | ||
currentOrganization, | ||
assignedFacility.orElse(null), | ||
null, // lookupid | ||
extractedData.getFirstName().getValue(), | ||
extractedData.getMiddleName().getValue(), | ||
extractedData.getLastName().getValue(), | ||
extractedData.getSuffix().getValue(), | ||
parseUserShortDate(extractedData.getDateOfBirth().getValue()), | ||
address, | ||
country, | ||
parsePersonRole(extractedData.getRole().getValue(), false), | ||
extractedData.getEmail().getValue() == null | ||
? Collections.emptyList() | ||
: List.of(extractedData.getEmail().getValue()), | ||
convertRaceToDatabaseValue(extractedData.getRace().getValue()), | ||
convertEthnicityToDatabaseValue(extractedData.getEthnicity().getValue()), | ||
null, // tribalAffiliation | ||
convertSexToDatabaseValue(extractedData.getBiologicalSex().getValue()), | ||
parseYesNoUnk(extractedData.getResidentCongregateSetting().getValue()), | ||
parseYesNoUnk(extractedData.getEmployedInHealthcare().getValue()), | ||
null, // preferredLanguage | ||
null // testResultDeliveryPreference | ||
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. Removed these explicit nulls by not specifying them in the builder, but lmk if we want to add them back in. |
||
); | ||
Person.builder() | ||
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. it was super annoying to deal with the multi-param constructor off the person object so I added a new one with the Builder annotation to make it more manageable. Do recognize that we're adding an entirely new constructor to enable this though, so if folks have a better way to work with this large object lmk. |
||
.organization(currentOrganization) | ||
.facility(assignedFacility.orElse(null)) | ||
.birthDate(parseUserShortDate(extractedData.getDateOfBirth().getValue())) | ||
.address(address) | ||
.country(country) | ||
.role(parsePersonRole(extractedData.getRole().getValue(), false)) | ||
.emails( | ||
extractedData.getEmail().getValue() == null | ||
? Collections.emptyList() | ||
: List.of(extractedData.getEmail().getValue())) | ||
.race(convertRaceToDatabaseValue(extractedData.getRace().getValue())) | ||
.ethnicity(convertEthnicityToDatabaseValue(extractedData.getEthnicity().getValue())) | ||
.gender(convertSexToDatabaseValue(extractedData.getBiologicalSex().getValue())) | ||
.genderIdentity(extractedData.getGenderIdentity().getValue()) | ||
fzhao99 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
.residentCongregateSetting( | ||
parseYesNoUnk(extractedData.getResidentCongregateSetting().getValue())) | ||
.employedInHealthcare( | ||
parseYesNoUnk(extractedData.getEmployedInHealthcare().getValue())) | ||
.firstName(extractedData.getFirstName().getValue()) | ||
.middleName(extractedData.getMiddleName().getValue()) | ||
.lastName(extractedData.getLastName().getValue()) | ||
.suffix(extractedData.getSuffix().getValue()) | ||
.notes(extractedData.getNotes().getValue()) | ||
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. Right now since we're not doing any string interpolation this column can either get filled with lmk if anyone prefers null or |
||
.build(); | ||
|
||
if (!allPatients.contains(newPatient)) { | ||
// collect phone numbers and associate them with the patient | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,8 @@ class PatientUploadRowTest { | |
"country", | ||
"phone_number", | ||
"phone_number_type", | ||
"email"); | ||
"email", | ||
"gender_identity"); | ||
|
||
@BeforeEach | ||
public void init() { | ||
|
@@ -69,6 +70,8 @@ public void init() { | |
validRowMap.put("resident_congregate_setting", "No"); | ||
validRowMap.put("role", "Staff"); | ||
validRowMap.put("email", "[email protected]"); | ||
validRowMap.put("gender_identity", "female"); | ||
validRowMap.put("address_notes", "test address notes"); | ||
} | ||
|
||
@Test | ||
|
@@ -103,6 +106,9 @@ void processRowSetsAllValues() { | |
.isEqualTo(validRowMap.get("resident_congregate_setting")); | ||
assertThat(patientUploadRow.getRole().getValue()).isEqualTo(validRowMap.get("role")); | ||
assertThat(patientUploadRow.getEmail().getValue()).isEqualTo(validRowMap.get("email")); | ||
assertThat(patientUploadRow.getGenderIdentity().getValue()) | ||
.isEqualTo(validRowMap.get("gender_identity")); | ||
assertThat(patientUploadRow.getNotes().getValue()).isEqualTo(validRowMap.get("address_notes")); | ||
} | ||
|
||
@Test | ||
|
@@ -134,6 +140,7 @@ void validateIndividualFields() { | |
invalidIndividualValues.put("phone_number", "1"); | ||
invalidIndividualValues.put("phone_number_type", "cell"); | ||
invalidIndividualValues.put("email", "email"); | ||
invalidIndividualValues.put("gender_identity", "not a gender identity"); | ||
|
||
var patientUploadRow = new PatientUploadRow(invalidIndividualValues); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
last_name,first_name,middle_name,suffix,race,date_of_birth,biological_sex,ethnicity,street,street_2,city,county,state,zip_code,phone_number,phone_number_type,employed_in_healthcare,resident_congregate_setting,role,email | ||
Sporer,Foobar,,,2028-9,6/12/40,A,2186-5,838 Waelchi Extensions,,Palm Bay,,AK,99501,410-881-4268,Landline,U,Unk,Staff,[email protected] | ||
last_name,first_name,middle_name,suffix,race,date_of_birth,biological_sex,ethnicity,street,street_2,city,county,state,zip_code,phone_number,phone_number_type,employed_in_healthcare,resident_congregate_setting,role,email,gender_identity,address_notes | ||
Sporer,Foobar,,,2028-9,6/12/40,A,2186-5,838 Waelchi Extensions,,Palm Bay,,AK,99501,410-881-4268,Landline,U,Unk,Staff,[email protected],, |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
last_name,first_name,middle_name,suffix,race,date_of_birth,biological_sex,ethnicity,street,street_2,city,county,state,zip_code,phone_number,phone_number_type,employed_in_healthcare,resident_congregate_setting,role,email | ||
Doe,Jane,Amanda,,black or african american,11/3/80,Female,not hispanic or latino,1234 Main Street,Apt 2,Anchorage,,AK,99501,410-867-5309,mobile,No,No,Staff,[email protected] | ||
last_name,first_name,middle_name,suffix,race,date_of_birth,biological_sex,ethnicity,street,street_2,city,county,state,zip_code,phone_number,phone_number_type,employed_in_healthcare,resident_congregate_setting,role,email,gender_identity,address_notes | ||
Doe,Jane,Amanda,,black or african american,11/3/80,Female,not hispanic or latino,1234 Main Street,Apt 2,Anchorage,,AK,99501,410-867-5309,mobile,No,No,Staff,[email protected],female,some address note |
Check notice
Code scanning / CodeQL
Use of default toString()