Summary Table
Categories |
Total Count |
PII |
0 |
URL |
0 |
DNS |
0 |
EKL |
0 |
IP |
0 |
PORT |
0 |
VsID |
0 |
CF |
0 |
AI |
0 |
VPD |
0 |
PL |
0 |
Other |
0 |
File Content
package gov.va.med.pbm.ampl.asset.mock;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.Collection;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import gov.va.med.pbm.ampl.constant.AmplConstants;
import gov.va.med.pbm.ampl.constant.MockDataConstants;
import gov.va.med.pbm.ampl.controller.EnvironmentInternalController;
import gov.va.med.pbm.ampl.model.Allergy;
import gov.va.med.pbm.ampl.model.AllergyReaction;
import gov.va.med.pbm.ampl.model.AllergySeverity;
import gov.va.med.pbm.ampl.model.Appointment;
import gov.va.med.pbm.ampl.model.Comment;
import gov.va.med.pbm.ampl.model.Consult;
import gov.va.med.pbm.ampl.model.Contact;
import gov.va.med.pbm.ampl.model.address.Address;
import gov.va.med.pbm.ampl.model.address.ConfidentialAddress;
import gov.va.med.pbm.ampl.model.Provider;
import gov.va.med.pbm.ampl.model.patientdemographics.PatientDetails;
import gov.va.med.pbm.ampl.model.patientdemographics.PatientCareTeam;
import gov.va.med.pbm.ampl.model.patientdemographics.PatientEligibility;
import gov.va.med.pbm.ampl.model.patientdemographics.PatientDisability;
import gov.va.med.pbm.ampl.model.patientdemographics.Language;
import gov.va.med.pbm.ampl.model.patientdemographics.MilitaryService;
import gov.va.med.pbm.ampl.model.patientdemographics.Service;
import gov.va.med.pbm.ampl.model.patientdemographics.ServiceLocation;
import gov.va.med.pbm.ampl.model.patientdemographics.EnvironmentalExposure;
import gov.va.med.pbm.ampl.model.patientdemographics.Person;
import gov.va.med.pbm.ampl.model.patientdemographics.HealthBenefits;
import gov.va.med.pbm.ampl.model.patientdemographics.HealthInsurance;
import gov.va.med.pbm.ampl.model.patientdemographics.SocialHistory;
import gov.va.med.pbm.ampl.model.patientdemographics.ClinicInformation;
import gov.va.med.pbm.ampl.model.patientdemographics.DeathInformation;
import gov.va.med.pbm.ampl.model.patientdemographics.PharmacyInformation;
import gov.va.med.pbm.ampl.model.address.PermanentAddress;
import gov.va.med.pbm.ampl.model.address.TemporaryAddress;
import gov.va.med.pbm.ampl.utility.CollectionUtility;
import gov.va.med.pbm.ampl.utility.DateUtility;
import gov.va.med.pbm.ampl.utility.NumberUtility;
import gov.va.med.pbm.ampl.utility.operations.SortOperation;
/**
* This class generates mock data for the {@link EnvironmentInternalController} end points .
*
* @author Ian Meinert
* @author Asli Goncer
* @author Pavani Mukthipudi
* @author Jason Dittrich
*
* @since 1.0
*/
public class PatientData {
private String patientId;
/**
* The application logger.
*/
static final Logger LOGGER = LoggerFactory.getLogger(PatientData.class);
/**
* Single parameter constructor.
*
* @param patientId {@link Long}
*/
public PatientData(String patientId) {
this.patientId = patientId;
}
/**
* The test patient.
*
* @return {@link PatientDetails} with mock data
*/
public PatientDetails testPatient() {
String t = PatientDetails.class.getSimpleName().toUpperCase() + patientId;
PatientDetails p = new PatientDetails();
FacilityData f = new FacilityData();
ContactData con = new ContactData();
// PatientIdentity fields
p.setDfn(patientId);
p.setDob(DateUtility.randomOffsetDateTime(MockDataConstants.NINETEEN_TWENTY, MockDataConstants.TWO_K));
// Lets get a random date, but make sure DOD is always > DOB
OffsetDateTime d = DateUtility.randomOffsetDateTime(p.getDob().getYear() + MockDataConstants.TWENTY_THREE,
LocalDate.now().getYear());
if (d.getYear() < MockDataConstants.TWO_K) {
p.setDateOfDeath(d);
}
p.setFullName(t);
p.setGender((String) CollectionUtility.getRandom(new String[] { "Female", "Male" }));
p.setPatientId(patientId);
p.setSsn("99988"
+ String.format("%04d", NumberUtility.randomBetween(AmplConstants.NUMBER_ONE, AmplConstants.MAX_STR_LEN - 1)));
// PatientDetails fields
p.setClinicInformation(this.testClinicInformationForPatient());
if ((boolean) CollectionUtility.getRandom(new Boolean[] { true, false })) {
p.setConfidentialAddress(this.testConfidentialAddress());
}
p.setContactDetails(con.testContact());
if ((boolean) CollectionUtility.getRandom(new Boolean[] { true, false }) && p.getDateOfDeath() != null) {
p.setDeathInformation(this.testDeathInformationForPatient());
}
p.setDisabilities(this.testDisabilitiesForPatient(NumberUtility.randomBetween(0, MockDataConstants.THREE)));
p.setEligibility(this.testEligibilityForPatient());
if ((boolean) CollectionUtility.getRandom(new Boolean[] { true, false })) {
p.setEmergencyContactPrimary(this.testPersonForPatient());
if ((boolean) CollectionUtility.getRandom(new Boolean[] { true, false })) {
p.setEmergencyContactSecondary(this.testPersonForPatient());
}
}
p.setEmergencyResponse("EmergencyResponse_" + t);
p.setHealthBenefits(this.testHealthBenefitsForPatient());
p.setLanguages(this.testLanguagesForPatient(NumberUtility.randomBetween(0, MockDataConstants.THREE)));
p.setMilitaryService(this.testMilitaryServiceForPatient());
if ((boolean) CollectionUtility.getRandom(new Boolean[] { true, false })) {
p.setNextOfKinPrimary(this.testPersonForPatient());
if ((boolean) CollectionUtility.getRandom(new Boolean[] { true, false })) {
p.setNextOfKinSecondary(this.testPersonForPatient());
}
}
p.setOneVaStatus(t);
if ((boolean) CollectionUtility.getRandom(new Boolean[] { true, false })) {
p.setPatientCareTeams(this.testPatientCareTeamForPatient(NumberUtility.randomBetween(0, MockDataConstants.SEVEN)));
// Setting the first patient care team on the list to the patient's Primary Care team at their local site
if (p.getPatientCareTeams() != null && p.getPatientCareTeams().length > 0) {
p.getPatientCareTeams()[0].setFacility(p.getSite());
p.getPatientCareTeams()[0].setPurpose("Primary Care");
}
}
p.setPermanentAddress(this.testPermanentAddress());
p.setPharmacyInformation(this.testPharmacyInformationForPatient());
p.setRemoteSitesVisited(f.testRemoteSitesVisited(NumberUtility.randomBetween(0, MockDataConstants.SEVEN)));
p.setSite(f.testFacilityForPatient(NumberUtility.randomBetween(0, MockDataConstants.SEVEN)));
p.setSocialHistory(this.testSocialHistoryForPatient());
if ((boolean) CollectionUtility.getRandom(new Boolean[] { true, false })) {
p.setTemporaryAddress(this.testTemporaryAddress());
}
return p;
}
/**
* This method implements a business rule which moves the missing ConflictLocations to the top of the stack.
*
* @param locations array of {@link ServiceLocation}
* @return array of {@link ServiceLocation}
*/
public ServiceLocation[] sortConflictLocations(Collection<ServiceLocation> locations) {
SortOperation<ServiceLocation> sortOperation = new SortOperation<ServiceLocation>();
sortOperation.setSortParams("fromDate[ASC]");
Collection<ServiceLocation> temp = sortOperation.sortFieldWithNull(locations);
return temp.toArray(new ServiceLocation[temp.size()]);
}
/**
* This method implements a business rule which moves the missing ServiceInformation to the top of the stack.
*
* @param services array of {@link Service}
* @return array of {@link Service}
*/
public Service[] sortServiceInformation(Collection<Service> services) {
SortOperation<Service> sortOperation = new SortOperation<Service>();
sortOperation.setSortParams("entryDate[ASC]");
Collection<Service> temp = sortOperation.sortFieldWithNull(services);
return temp.toArray(new Service[temp.size()]);
}
/**
* This method generates a mock {@link ClinicInformation} for a patient.
*
* @return {@link ClinicInformation}
*/
private ClinicInformation testClinicInformationForPatient() {
ClinicInformation clinicInfo = new ClinicInformation();
int c = NumberUtility.randomBetween(0, MockDataConstants.FIVE);
if (c > 0) {
String[] clinics = new String[c];
for (int i = 0; i < c; i++) {
clinics[i] = "Clinic_" + i+1;
}
clinicInfo.setClinicsEnrolledIn(clinics);
c = NumberUtility.randomBetween(0, MockDataConstants.FIVE);
AppointmentData data = new AppointmentData(patientId);
Collection<Appointment> appts = data.testAppointmentsForPatient(c);
Appointment[] appointments = appts.toArray(new Appointment[appts.size()]);
clinicInfo.setFutureAppointments(appointments);
}
return clinicInfo;
}
/**
* Generates an {@link ConfidentialAddress} used in mock cases
*
* @return {@link ConfidentialAddress} with mock data
*/
private ConfidentialAddress testConfidentialAddress() {
ConfidentialAddress cAddress = new ConfidentialAddress();
OffsetDateTime dateTime = DateUtility.randomOffsetDateTime(MockDataConstants.NINETEEN_TWENTY, MockDataConstants.TWO_K);
AddressData a = new AddressData();
cAddress.setConfidentialAddressCategories(new String[] { "Category1", "Category2", "Category3" });
cAddress.setActive((boolean) CollectionUtility.getRandom(new Boolean[] { true, false }));
cAddress
.setActiveConfidentialCategory((String) CollectionUtility.getRandom(cAddress.getConfidentialAddressCategories()));
cAddress.setAddress(a.testAddress());
cAddress.setFromDate(dateTime);
cAddress.setToDate(dateTime.plusDays(NumberUtility.randomBetween(0, MockDataConstants.TWENTY)));
return cAddress;
}
/**
* This method generates a mock {@link DeathInformation} for a patient.
*
* @return {@link DeathInformation}
*/
private DeathInformation testDeathInformationForPatient() {
DeathInformation deathInfo = new DeathInformation();
deathInfo.setLastEditedBy("Test_Edited_By");
deathInfo.setSource("Test_Source");
deathInfo.setUpdatedDate(DateUtility.randomOffsetDateTime(MockDataConstants.NINETEEN_TWENTY, MockDataConstants.TWO_K));
return deathInfo;
}
/**
* This method generates a mock {@link PatientDisability} array for a patient.
*
* @param c random int
* @return {@link PatientDisability} array
*/
private PatientDisability[] testDisabilitiesForPatient(int c) {
Collection<PatientDisability> pc = new ArrayList<PatientDisability>();
for (int i = 0; i < c; i++) {
String s = "DISABILITY" + i;
PatientDisability p = new PatientDisability();
p.setDisabilityPercentage((double) NumberUtility.randomBetween(1, MockDataConstants.ONE_HUNDRED - 1));
p.setIsServiceConnected((boolean) CollectionUtility.getRandom(new Boolean[] { true, false }));
p.setRatedDisability(s);
pc.add(p);
}
return pc.toArray(new PatientDisability[pc.size()]);
}
/**
* This method generates a mock {@link PatientEligibility} for a patient.
*
* @return {@link PatientEligibility}
*/
private PatientEligibility testEligibilityForPatient() {
String t = "Eligibility";
PatientEligibility p = new PatientEligibility();
p.setCode(t + "_Code");
if ((boolean) CollectionUtility.getRandom(new Boolean[] { true, false })) {
p.setCombatVetEndDate(DateUtility.randomOffsetDateTime(MockDataConstants.NINETEEN_TWENTY, MockDataConstants.TWO_K));
}
p.setCurrentMeansTestStatus((String) CollectionUtility.getRandom(new String[] { "Required", "Test_Status" }));
p.setMedCopayExemptionStatus((String) CollectionUtility.getRandom(new String[] { "EXEMPT", "Test_Status" }));
p.setPermanentTotalDisabled((String) CollectionUtility.getRandom(new String[] { "Yes", "No" }));
p.setRxPatientStatus(t + "_Rx");
p.setServiceConnected((boolean) CollectionUtility.getRandom(new Boolean[] { true, false }));
p.setServiceConnectedPercentage((double) NumberUtility.randomBetween(1, MockDataConstants.ONE_HUNDRED - 1));
p.setStatus(t + "_Status");
p.setUnemployable((String) CollectionUtility.getRandom(new String[] { "Yes", "No" }));
return p;
}
/**
* This method generates a mock {@link Person} for a patient.
*
* @return {@link Person} array
*/
private Person testPersonForPatient() {
Person person = new Person();
AddressData a = new AddressData();
ContactData con = new ContactData();
String t = Person.class.getSimpleName().toUpperCase();
person.setAddress((Address) a.testAddress());
person.setContactDetails(con.testContact());
person.setName(t + "_name");
person.setRelationship((String) CollectionUtility.getRandom(new String[] { "BROTHER", "SISTER", "FATHER", "MOTHER" }));
return person;
}
/**
* This method generates a mock {@link HealthBenefits} for a patient.
*
* @return {@link HealthBenefits}
*/
private HealthBenefits testHealthBenefitsForPatient() {
HealthBenefits benefits = new HealthBenefits();
int c = NumberUtility.randomBetween(1, MockDataConstants.FIVE);
String[] plans = new String[c];
for (int i = 0; i < c; i++) {
plans[i] = "Health Benefits Plan_" + i;
}
benefits.setPlans(plans);
c = NumberUtility.randomBetween(1, MockDataConstants.FIVE);
HealthInsurance[] insurance = new HealthInsurance[c];
for (int i = 0; i < c; i++) {
OffsetDateTime dateTime = DateUtility.randomOffsetDateTime(MockDataConstants.NINETEEN_TWENTY,
MockDataConstants.TWO_K);
insurance[i] = new HealthInsurance();
insurance[i].setEffectiveDate(dateTime);
insurance[i].setExpiryDate(
dateTime.plusMonths(NumberUtility.randomBetween(MockDataConstants.SIX, MockDataConstants.EIGHTTEEN)));
insurance[i]
.setGroupNumber(NumberUtility.randomBetween(MockDataConstants.TEN_K, MockDataConstants.ONE_HUNDRED_K - 1) + "");
insurance[i].setHolder((String) CollectionUtility.getRandom(new String[] { "Self", "Spouse", "Test Holder" }));
insurance[i].setInsuranceType((String) CollectionUtility.getRandom(
new String[] { "Blue Cross Blue Shield", "Blue Anthem", "United HealthCare", "Test Insurance Type" }));
insurance[i]
.setSubscriberId(NumberUtility.randomBetween(MockDataConstants.ONE_M, MockDataConstants.TEN_M - 1) + "");
}
benefits.setInsurance(insurance);
return benefits;
}
/**
* This method generates a mock {@link Language} array for a patient.
*
* @param c random int
* @return {@link Language} array
*/
private Language[] testLanguagesForPatient(int c) {
Collection<Language> languages = new ArrayList<Language>();
for (int i = 0; i < c; i++) {
Language language = new Language();
language
.setLanguageDate(DateUtility.randomOffsetDateTime(MockDataConstants.NINETEEN_TWENTY, MockDataConstants.TWO_K));
language.setLanguagePref(
(String) CollectionUtility.getRandom(new String[] { "English", "Spanish", "Polish", "French", "German" }));
languages.add(language);
}
return languages.toArray(new Language[languages.size()]);
}
/**
* This method generates a mock {@link MilitaryService} for a patient.
*
* @return {@link MilitaryService}
*/
private MilitaryService testMilitaryServiceForPatient() {
MilitaryService military = new MilitaryService();
military.setCombatInformation(this.testServiceLocationForMilitary(NumberUtility.randomBetween(1, 1))[0]);
military
.setConflictLocations(this.testServiceLocationForMilitary(NumberUtility.randomBetween(1, MockDataConstants.SIX)));
military.setDentalExtraction((String) CollectionUtility.getRandom(new String[] { "Yes", "No" }));
military.setDentalInjury((String) CollectionUtility.getRandom(new String[] { "Yes", "No" }));
military.setDisabilityDischarge((String) CollectionUtility.getRandom(new String[] { "Yes", "No" }));
military.setDisabilityRetirement((String) CollectionUtility.getRandom(new String[] { "Yes", "No" }));
military.setEnvironmentalExposures(this.testExposureForMilitary(NumberUtility.randomBetween(1, MockDataConstants.SIX)));
military.setPowInformation(this.testServiceLocationForMilitary(NumberUtility.randomBetween(1, 1))[0]);
military.setPurpleHeartIndicator((String) CollectionUtility.getRandom(new String[] { "Yes", "No" }));
military.setPurpleHeartStatus((String) CollectionUtility.getRandom(new String[] { "PENDING", "TEST" }));
military.setServiceInformation(this.testServiceForMilitary(NumberUtility.randomBetween(1, MockDataConstants.SIX)));
return military;
}
/**
* This method generates a mock {@link Service} information array for a patient's military service.
*
* @param c count to create
* @return {@link Service} array
*/
private Service[] testServiceForMilitary(int c) {
Collection<Service> serviceCollection = new ArrayList<Service>();
for (int i = 0; i < c; i++) {
Service service = new Service();
service.setBranch((String) CollectionUtility
.getRandom(new String[] { "Army", "Air Force", "Coast Guard", "Marine Corps", "Navy" }));
service.setComponent((String) CollectionUtility.getRandom(new String[] { "Regular", "Reserve", "Guard" }));
service.setNumber(NumberUtility.randomBetween(MockDataConstants.TEN_K, MockDataConstants.ONE_HUNDRED_K - 1) + "");
if (!NumberUtility.isPrime(i)) {
OffsetDateTime dateTime = DateUtility.randomOffsetDateTime(MockDataConstants.NINETEEN_TWENTY,
MockDataConstants.TWO_K);
service.setDischargeType("Honorable");
service.setEntryDate(dateTime);
service.setSeparationDate(dateTime.plusYears(NumberUtility.randomBetween(1, MockDataConstants.FIVE)));
}
serviceCollection.add(service);
}
return sortServiceInformation(serviceCollection);
}
/**
* This method generates a mock {@link ServiceLocation} array for a patient's military service.
*
* @param c count to create
* @return {@link ServiceLocation} array
*/
private ServiceLocation[] testServiceLocationForMilitary(int c) {
Collection<ServiceLocation> locationCollection = new ArrayList<ServiceLocation>();
for (int i = 0; i < c; i++) {
ServiceLocation location = new ServiceLocation();
if ((boolean) CollectionUtility.getRandom(new Boolean[] { true, false })) {
location.setLocation((String) CollectionUtility.getRandom(new String[] { "Vietnam", "Lebanon" }));
}
location.setServiceIndicated((boolean) CollectionUtility.getRandom(new Boolean[] { true, false }));
if (!NumberUtility.isPrime(i)) {
OffsetDateTime dateTime = DateUtility.randomOffsetDateTime(MockDataConstants.NINETEEN_TWENTY,
MockDataConstants.TWO_K);
if ((boolean) CollectionUtility.getRandom(new Boolean[] { true, false })) {
location.setFromDate(dateTime);
}
if ((boolean) CollectionUtility.getRandom(new Boolean[] { true, false })) {
location.setToDate(dateTime.plusYears(NumberUtility.randomBetween(1, 5)));
}
}
locationCollection.add(location);
}
return this.sortConflictLocations(locationCollection);
}
/**
* This method generates a mock {@link EnvironmentalExposure} array for a patient's military service.
*
* @param c count to create
* @return {@link EnvironmentalExposure} array
*/
private EnvironmentalExposure[] testExposureForMilitary(int c) {
Collection<EnvironmentalExposure> exposureCollection = new ArrayList<EnvironmentalExposure>();
for (int i = 0; i < c; i++) {
EnvironmentalExposure exposure = new EnvironmentalExposure();
OffsetDateTime dateTime = DateUtility.randomOffsetDateTime(MockDataConstants.NINETEEN_TWENTY,
MockDataConstants.TWO_K);
exposure.setExamDate(dateTime.plusYears(NumberUtility.randomBetween(1, MockDataConstants.FIVE)));
exposure.setExposureIndicated((boolean) CollectionUtility.getRandom(new Boolean[] { true, false }));
exposure.setRegistrationDate(dateTime);
exposure.setTypeOfExposure((String) CollectionUtility
.getRandom(new String[] { "Agent Orange Exposure", "Radiation", "SW Asia Cond", "N/T Radium" }));
if ("Radiation".equals(exposure.getTypeOfExposure())) {
exposure.setExposureMethod("Exposure_Method");
} else if ("N/T Radium".equals(exposure.getTypeOfExposure())) {
exposure.setScreeningStatus((String) CollectionUtility.getRandom(new String[] { "1", "2", "3", "4", "5" }));
}
exposureCollection.add(exposure);
}
return exposureCollection.toArray(new EnvironmentalExposure[exposureCollection.size()]);
}
/**
* This method generates a mock {@link PatientCareTeam} array for a patient.
*
* @param c int
* @return {@link PatientCareTeam} array
*/
private PatientCareTeam[] testPatientCareTeamForPatient(int c) {
Collection<PatientCareTeam> careTeams = new ArrayList<PatientCareTeam>();
FacilityData fac = new FacilityData();
ProviderData prov = new ProviderData();
for (int i = 0; i < c; i++) {
PatientCareTeam p = new PatientCareTeam();
String t = patientId + "CARETEAM_" + i;
p.setAssignedDate(DateUtility.randomOffsetDateTime(MockDataConstants.NINETEEN_TWENTY, MockDataConstants.TWO_K));
p.setContactDetails(
new Contact("997-556-" + NumberUtility.randomBetween(MockDataConstants.ONE_K, MockDataConstants.TEN_K - 1),
"9" + NumberUtility.randomBetween(MockDataConstants.ONE_K, MockDataConstants.TEN_K - 1)));
p.setFacility(fac.testFacilityForPatient(NumberUtility.randomBetween(0, MockDataConstants.SEVEN)));
p.setMentalHealthTeamContactDetails(
new Contact("997-999-" + NumberUtility.randomBetween(MockDataConstants.ONE_K, MockDataConstants.TEN_K - 1),
"99" + NumberUtility.randomBetween(MockDataConstants.ONE_HUNDRED, MockDataConstants.ONE_K - 1)));
p.setMentalHealthTeamCoordinator(prov.testProvidersForPatient(1)[0]);
p.setMentalHealthTeamName(t + "_MH");
p.setName(t);
p.setPrimaryCareProvider(prov.testProvidersForPatient(1)[0]);
if ((boolean) CollectionUtility.getRandom(new Boolean[] { true, false })) {
p.setPurpose("Primary Care");
} else {
p.setPurpose("Mental Health Treatment");
}
p.setTeamPositions(prov.testProvidersForPatient(NumberUtility.randomBetween(0, MockDataConstants.SEVEN)));
careTeams.add(p);
}
return careTeams.toArray(new PatientCareTeam[careTeams.size()]);
}
/**
* Generates an {@link PermanentAddress} used in mock cases
*
* @return {@link PermanentAddress} with mock data
*/
private PermanentAddress testPermanentAddress() {
PermanentAddress pAddress = new PermanentAddress();
AddressData a = new AddressData();
pAddress.setAddress(a.testAddress());
pAddress.setBadAddressIndicator((String) CollectionUtility.getRandom(new String[] { "UNDELIVERABLE", new String() }));
return pAddress;
}
/**
* This method generates a mock {@link PharmacyInformation} for a patient.
*
* @return {@link PharmacyInformation}
*/
private PharmacyInformation testPharmacyInformationForPatient() {
PharmacyInformation pharmacy = new PharmacyInformation();
pharmacy.setCapInformation((String) CollectionUtility.getRandom(new String[] { "Non-Safety", "Other" }));
pharmacy.setCnhCurrent((String) CollectionUtility.getRandom(new String[] { "Yes", "No" }));
pharmacy.setDialysisPatient((String) CollectionUtility.getRandom(new String[] { "Yes", "No" }));
pharmacy.setFeeHospitalId((String) CollectionUtility.getRandom(new String[] { "Issued", "Not Issued" }));
pharmacy.setIpNarrative(
"This is the inpatient pharmacy narrative field about the patient." + " This field allows up to 250 characters.");
pharmacy.setLastDateOfContract(
DateUtility.randomOffsetDateTime(MockDataConstants.NINETEEN_TWENTY, MockDataConstants.TWO_K));
pharmacy.setMailInformation((String) CollectionUtility.getRandom(new String[] { "Regular Mail", "Other" }));
pharmacy
.setMailStatusExpDate(DateUtility.randomOffsetDateTime(MockDataConstants.NINETEEN_TWENTY, MockDataConstants.TWO_K));
pharmacy.setNursingHome((String) CollectionUtility.getRandom(new String[] { "Yes", "No" }));
pharmacy.setNursingHomeContract((String) CollectionUtility.getRandom(new String[] { "Yes", "No" }));
pharmacy.setOpNarrative("This is the outpatient narrative field and contains notable information about"
+ " the patient that pertains to pharmacy. This field allows up to 250 characters.");
pharmacy.setOtherLanguagePref((String) CollectionUtility.getRandom(new String[] { "Yes", "No" }));
pharmacy.setPmiLanguagePref((String) CollectionUtility.getRandom(new String[] { "Spanish", "Polish" }));
pharmacy.setRemarks("This is the remarks field and allows for up to 60 characters about the patient.");
pharmacy
.setRespiteEndDate(DateUtility.randomOffsetDateTime(MockDataConstants.NINETEEN_TWENTY, MockDataConstants.TWO_K));
pharmacy
.setRespiteStartDate(DateUtility.randomOffsetDateTime(MockDataConstants.NINETEEN_TWENTY, MockDataConstants.TWO_K));
return pharmacy;
}
/**
* This method generates a mock {@link SocialHistory} for a patient.
*
* @return {@link SocialHistory}
*/
private SocialHistory testSocialHistoryForPatient() {
SocialHistory social = new SocialHistory();
social.setEthnicity("Test_Ethnicity");
social
.setEthnicitySource((String) CollectionUtility.getRandom(new String[] { "Self Identification", "Family Member" }));
social.setMaritalStatus((String) CollectionUtility.getRandom(new String[] { "Married", "Never Married" }));
social.setRace("Test_Race");
social.setRaceSource((String) CollectionUtility.getRandom(new String[] { "Self Identification", "Family Member" }));
social.setReligion("Test_Religious_Preference");
return social;
}
/**
* Generates an {@link TemporaryAddress} used in mock cases
*
* @return {@link TemporaryAddress} with mock data
*/
private TemporaryAddress testTemporaryAddress() {
TemporaryAddress tAddress = new TemporaryAddress();
AddressData a = new AddressData();
OffsetDateTime dateTime = DateUtility.randomOffsetDateTime(MockDataConstants.NINETEEN_TWENTY, MockDataConstants.TWO_K);
tAddress.setActive((boolean) CollectionUtility.getRandom(new Boolean[] { true, false }));
tAddress.setAddress(a.testAddress());
tAddress.setFromDate(dateTime);
tAddress.setToDate(dateTime.plusDays(NumberUtility.randomBetween(0, MockDataConstants.SIXTY)));
return tAddress;
}
}