-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
strengthen tests and cleanup uneeded pojos (#6468)
- Loading branch information
1 parent
f5de49f
commit 7620c47
Showing
8 changed files
with
145 additions
and
560 deletions.
There are no files selected for viewing
111 changes: 0 additions & 111 deletions
111
backend/src/main/java/gov/cdc/usds/simplereport/api/model/PersonUpdate.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
150 changes: 24 additions & 126 deletions
150
...d/src/main/java/gov/cdc/usds/simplereport/db/model/auxiliary/PatientSelfRegistration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,131 +1,29 @@ | ||
package gov.cdc.usds.simplereport.db.model.auxiliary; | ||
|
||
import static gov.cdc.usds.simplereport.api.Translators.parsePersonRole; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import gov.cdc.usds.simplereport.api.model.PersonUpdate; | ||
import java.time.LocalDate; | ||
import java.util.List; | ||
import java.util.Objects; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class PatientSelfRegistration extends PersonUpdate { | ||
private final String registrationLink; | ||
private final String lookupId; | ||
private final String firstName; | ||
private final String middleName; | ||
private final String lastName; | ||
private final String suffix; | ||
private final LocalDate birthDate; | ||
|
||
@JsonCreator | ||
public PatientSelfRegistration( | ||
@JsonProperty("registrationLink") String registrationLink, | ||
@JsonProperty("lookupId") String lookupId, | ||
@JsonProperty("firstName") String firstName, | ||
@JsonProperty("middleName") String middleName, | ||
@JsonProperty("lastName") String lastName, | ||
@JsonProperty("suffix") String suffix, | ||
@JsonProperty("birthDate") LocalDate birthDate, | ||
@JsonProperty("address") StreetAddress address, | ||
@JsonProperty("country") String country, | ||
@JsonProperty("telephone") String telephone, | ||
@JsonProperty("phoneNumbers") List<PhoneNumberInput> phoneNumbers, | ||
@JsonProperty("role") String role, | ||
@JsonProperty("email") String email, | ||
@JsonProperty("emails") List<String> emails, | ||
@JsonProperty("race") String race, | ||
@JsonProperty("ethnicity") String ethnicity, | ||
@JsonProperty("tribalAffiliation") String tribalAffiliation, | ||
@JsonProperty("gender") String gender, | ||
@JsonProperty("genderIdentity") String genderIdentity, | ||
@JsonProperty("residentCongregateSetting") Boolean residentCongregateSetting, | ||
@JsonProperty("employedInHealthcare") Boolean employedInHealthcare, | ||
@JsonProperty("preferredLanguage") String preferredLanguage, | ||
@JsonProperty("testResultDelivery") TestResultDeliveryPreference testResultDelivery) { | ||
super( | ||
address, | ||
country, | ||
telephone, | ||
phoneNumbers, | ||
parsePersonRole(role, false), | ||
email, | ||
emails, | ||
race, | ||
ethnicity, | ||
tribalAffiliation, | ||
gender, | ||
genderIdentity, | ||
residentCongregateSetting, | ||
employedInHealthcare, | ||
preferredLanguage, | ||
testResultDelivery); | ||
this.registrationLink = registrationLink; | ||
this.lookupId = lookupId; | ||
this.firstName = firstName; | ||
this.middleName = middleName; | ||
this.lastName = lastName; | ||
this.suffix = suffix; | ||
this.birthDate = birthDate; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
PatientSelfRegistration that = (PatientSelfRegistration) o; | ||
return Objects.equals(registrationLink, that.registrationLink) | ||
&& Objects.equals(lookupId, that.lookupId) | ||
&& Objects.equals(firstName, that.firstName) | ||
&& Objects.equals(middleName, that.middleName) | ||
&& Objects.equals(lastName, that.lastName) | ||
&& Objects.equals(suffix, that.suffix) | ||
&& Objects.equals(birthDate, that.birthDate) | ||
&& Objects.equals(getAddress(), that.getAddress()) | ||
&& Objects.equals(getCountry(), that.getCountry()) | ||
&& Objects.equals(getTelephone(), that.getTelephone()) | ||
&& Objects.equals(getPhoneNumbers(), that.getPhoneNumbers()) | ||
&& getRole() == that.getRole() | ||
&& Objects.equals(getEmail(), that.getEmail()) | ||
&& Objects.equals(getRace(), that.getRace()) | ||
&& Objects.equals(getEthnicity(), that.getEthnicity()) | ||
&& Objects.equals(getTribalAffiliation(), that.getTribalAffiliation()) | ||
&& Objects.equals(getGender(), that.getGender()) | ||
&& Objects.equals(getGenderIdentity(), that.getGenderIdentity()) | ||
&& Objects.equals(getResidentCongregateSetting(), that.getResidentCongregateSetting()) | ||
&& Objects.equals(getEmployedInHealthcare(), that.getEmployedInHealthcare()) | ||
&& Objects.equals(getPreferredLanguage(), that.getPreferredLanguage()); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash( | ||
registrationLink, | ||
lookupId, | ||
firstName, | ||
middleName, | ||
lastName, | ||
suffix, | ||
birthDate, | ||
getAddress(), | ||
getCountry(), | ||
getTelephone(), | ||
getPhoneNumbers(), | ||
getRole(), | ||
getEmail(), | ||
getRace(), | ||
getEthnicity(), | ||
getTribalAffiliation(), | ||
getGender(), | ||
getGenderIdentity(), | ||
getResidentCongregateSetting(), | ||
getEmployedInHealthcare(), | ||
getPreferredLanguage()); | ||
} | ||
} | ||
public record PatientSelfRegistration( | ||
String registrationLink, | ||
String lookupId, | ||
String firstName, | ||
String middleName, | ||
String lastName, | ||
String suffix, | ||
LocalDate birthDate, | ||
StreetAddress address, | ||
String country, | ||
String telephone, | ||
List<PhoneNumberInput> phoneNumbers, | ||
String role, | ||
String email, | ||
List<String> emails, | ||
String race, | ||
String ethnicity, | ||
String tribalAffiliation, | ||
String gender, | ||
String genderIdentity, | ||
Boolean residentCongregateSetting, | ||
Boolean employedInHealthcare, | ||
String preferredLanguage, | ||
TestResultDeliveryPreference testResultDelivery) {} |
39 changes: 2 additions & 37 deletions
39
...rc/main/java/gov/cdc/usds/simplereport/service/model/ExistingPatientCheckRequestBody.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,6 @@ | ||
package gov.cdc.usds.simplereport.service.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import java.time.LocalDate; | ||
|
||
public class ExistingPatientCheckRequestBody { | ||
private final String firstName; | ||
private final String lastName; | ||
private final LocalDate birthDate; | ||
private final String postalCode; | ||
|
||
@JsonCreator | ||
public ExistingPatientCheckRequestBody( | ||
@JsonProperty("firstName") String firstName, | ||
@JsonProperty("lastName") String lastName, | ||
@JsonProperty("birthDate") LocalDate birthDate, | ||
@JsonProperty("postalCode") String postalCode) { | ||
|
||
this.firstName = firstName; | ||
this.lastName = lastName; | ||
this.birthDate = birthDate; | ||
this.postalCode = postalCode; | ||
} | ||
|
||
public String getFirstName() { | ||
return firstName; | ||
} | ||
|
||
public String getLastName() { | ||
return lastName; | ||
} | ||
|
||
public LocalDate getBirthDate() { | ||
return birthDate; | ||
} | ||
|
||
public String getPostalCode() { | ||
return postalCode; | ||
} | ||
} | ||
public record ExistingPatientCheckRequestBody( | ||
String firstName, String lastName, LocalDate birthDate, String postalCode) {} |
Oops, something went wrong.