1: <?php
2: namespace Azalea\Selenium\App\Patients;
3:
4: class PatientFaker
5: {
6: public static $marital_statuses = array(
7: "SINGLE",
8: "MARRIED",
9: "DIVORCED",
10: "SEPARATED",
11: "WIDOW",
12: "CIVIL UNION",
13: "DOMESTIC PARTNERSHIP"
14: );
15:
16: public static $ethnicities = array(
17: "HISPANIC OR LATINO",
18: "NOT HISPANIC OR LATINO",
19: "DECLINED TO SPECIFY"
20: );
21:
22: public function __construct($faker)
23: {
24: $this->faker = $faker;
25: }
26:
27: public function generate()
28: {
29:
30: $gender = (rand(1, 2) == 1 ? 'male' : 'female');
31:
32: $this->pat_fname = $this->faker->firstName($gender);
33: $this->pat_mname = $this->faker->firstName($gender);
34: $this->pat_lname = $this->faker->lastName($gender);
35:
36: $this->pat_dob_datetime = $this->faker->dateTimeBetween("-70 years", "-2 years");
37: $this->pat_dob = $this->pat_dob_datetime->format("Ymd");
38:
39: $this->pat_mrn = $this->faker->numerify("TEST######");
40: $this->pat_xray_num = $this->faker->numerify("#####");
41: $this->pat_sex = strtoupper($gender);
42: $this->pat_email = strtolower($this->pat_fname.".".$this->pat_lname)."@".$this->faker->freeEmailDomain;
43: $this->pat_maritial_status = self::$marital_statuses[rand(0, count(self::$marital_statuses) - 1)];
44: $this->pat_ethnicity = self::$ethnicities[rand(0, count(self::$ethnicities) - 1)];
45: $this->pat_lang_id = 30;
46: $this->pat_address1 = $this->faker->streetAddress;
47: $this->pat_address2 = "";
48: $this->pat_city = "VALDOSTA";
49: $this->pat_state = "GA";
50: $this->pat_zip = "31601";
51: $this->pat_contact_method = rand(0, 4);
52: $this->pat_apt_not_contact_method = rand(0, 6);
53: $this->pat_phone = $this->getPhoneNumber();
54: $this->pat_phone_work = $this->getPhoneNumber();
55: $this->pat_phone_other = $this->getPhoneNumber();
56:
57: $this->pat_guarantor_relation = "SELF";
58: }
59:
60: protected function getPhoneNumber()
61: {
62: $phone = $this->faker->numerify("##########");
63: if (substr($phone, 0, 1) == "1") {
64: $phone = "2".substr($phone, 1);
65: }
66: return $phone;
67: }
68: }