added drivers license to pt demographics
[openemr.git] / interface / patient_file / summary / demographics_save.php
blob5d77f07b339ae5d783088c1c77680269d33acd2f
1 <?
2 include_once("../../globals.php");
3 include_once("$srcdir/patient.inc");
4 include_once("$srcdir/acl.inc");
6 // Check authorization.
7 $thisauth = acl_check('patients', 'demo');
8 if ($pid) {
9 if ($thisauth != 'write')
10 die("Updating demographics is not authorized.");
11 $tmp = getPatientData($pid, "squad");
12 if ($tmp['squad'] && ! acl_check('squads', $tmp['squad']))
13 die("You are not authorized to access this squad.");
14 } else {
15 if ($thisauth != 'write' && $thisauth != 'addonly')
16 die("Adding demographics is not authorized.");
19 foreach ($_POST as $key => $val) {
20 if ($val == "MM/DD/YYYY") {
21 $_POST[$key] = "";
25 if ($_POST["sex"] == "Unselected") {
26 $var_sex = "";
27 } else {
28 $var_sex = $_POST["sex"];
31 if ($_POST{dob} != "") {
32 $dob = $_POST["dob"];
33 } else {
34 $dob = "";
37 $finrev = fixDate($_POST["financial_review"]);
39 newPatientData(
40 $_POST["db_id"],
41 $_POST["title"],
42 $_POST["fname"],
43 $_POST["lname"],
44 $_POST["mname"],
45 $var_sex,
46 $dob,
47 $_POST["street"],
48 $_POST["postal_code"],
49 $_POST["city"],
50 $_POST["state"],
51 $_POST["country_code"],
52 $_POST["ss"],
53 $_POST["occupation"],
54 $_POST["phone_home"],
55 $_POST["phone_biz"],
56 $_POST["phone_contact"],
57 $_POST["status"],
58 $_POST["contact_relationship"],
59 $_POST["referrer"],
60 $_POST["referrerID"],
61 $_POST["email"],
62 strtolower($_POST["language"]),
63 $_POST["ethnoracial"],
64 $_POST["interpretter"],
65 $_POST["migrantseasonal"],
66 $_POST["family_size"],
67 $_POST["monthly_income"],
68 $_POST["homeless"],
69 $finrev,
70 $_POST["pubpid"],
71 $pid,
72 $_POST["providerID"],
73 $_POST["genericname1"],
74 $_POST["genericval1"],
75 $_POST["genericname2"],
76 $_POST["genericval2"],
77 $_POST["phone_cell"],
78 $_POST["hipaa_mail"],
79 $_POST["hipaa_voice"],
80 $_POST["squad"],
81 $_POST["phone_pharmacy"],
82 $_POST["drivers_license"]
85 newEmployerData(
86 $pid,
87 $_POST["ename"],
88 $_POST["estreet"],
89 $_POST["epostal_code"],
90 $_POST["ecity"],
91 $_POST["estate"],
92 $_POST["ecountry"]
95 $i1dob = fixDate($_POST["i1subscriber_DOB"]);
97 newInsuranceData(
98 $pid,
99 "primary",
100 $_POST["i1provider"],
101 $_POST["i1policy_number"],
102 $_POST["i1group_number"],
103 $_POST["i1plan_name"],
104 $_POST["i1subscriber_lname"],
105 $_POST["i1subscriber_mname"],
106 $_POST["i1subscriber_fname"],
107 $_POST["i1subscriber_relationship"],
108 $_POST["i1subscriber_ss"],
109 $i1dob,
110 $_POST["i1subscriber_street"],
111 $_POST["i1subscriber_postal_code"],
112 $_POST["i1subscriber_city"],
113 $_POST["i1subscriber_state"],
114 $_POST["i1subscriber_country"],
115 $_POST["i1subscriber_phone"],
116 $_POST["i1subscriber_employer"],
117 $_POST["i1subscriber_employer_street"],
118 $_POST["i1subscriber_employer_city"],
119 $_POST["i1subscriber_employer_postal_code"],
120 $_POST["i1subscriber_employer_state"],
121 $_POST["i1subscriber_employer_country"],
122 $_POST['i1copay'],
123 $_POST['i1subscriber_sex']
126 $i2dob = fixDate($_POST["i2subscriber_DOB"]);
128 newInsuranceData(
129 $pid,
130 "secondary",
131 $_POST["i2provider"],
132 $_POST["i2policy_number"],
133 $_POST["i2group_number"],
134 $_POST["i2plan_name"],
135 $_POST["i2subscriber_lname"],
136 $_POST["i2subscriber_mname"],
137 $_POST["i2subscriber_fname"],
138 $_POST["i2subscriber_relationship"],
139 $_POST["i2subscriber_ss"],
140 $i2dob,
141 $_POST["i2subscriber_street"],
142 $_POST["i2subscriber_postal_code"],
143 $_POST["i2subscriber_city"],
144 $_POST["i2subscriber_state"],
145 $_POST["i2subscriber_country"],
146 $_POST["i2subscriber_phone"],
147 $_POST["i2subscriber_employer"],
148 $_POST["i2subscriber_employer_street"],
149 $_POST["i2subscriber_employer_city"],
150 $_POST["i2subscriber_employer_postal_code"],
151 $_POST["i2subscriber_employer_state"],
152 $_POST["i2subscriber_employer_country"],
153 $_POST['i2copay'],
154 $_POST['i2subscriber_sex']
157 $i3dob = fixDate($_POST["i3subscriber_DOB"]);
159 newInsuranceData(
160 $pid,
161 "tertiary",
162 $_POST["i3provider"],
163 $_POST["i3policy_number"],
164 $_POST["i3group_number"],
165 $_POST["i3plan_name"],
166 $_POST["i3subscriber_lname"],
167 $_POST["i3subscriber_mname"],
168 $_POST["i3subscriber_fname"],
169 $_POST["i3subscriber_relationship"],
170 $_POST["i3subscriber_ss"],
171 $i3dob,
172 $_POST["i3subscriber_street"],
173 $_POST["i3subscriber_postal_code"],
174 $_POST["i3subscriber_city"],
175 $_POST["i3subscriber_state"],
176 $_POST["i3subscriber_country"],
177 $_POST["i3subscriber_phone"],
178 $_POST["i3subscriber_employer"],
179 $_POST["i3subscriber_employer_street"],
180 $_POST["i3subscriber_employer_city"],
181 $_POST["i3subscriber_employer_postal_code"],
182 $_POST["i3subscriber_employer_state"],
183 $_POST["i3subscriber_employer_country"],
184 $_POST['i3copay'],
185 $_POST['i3subscriber_sex']
188 include_once("patient_summary.php");