2 include_once("../globals.php");
4 include_once("$srcdir/sql.inc");
5 include_once("$srcdir/pid.inc");
6 include_once("$srcdir/patient.inc");
8 //here, we lock the patient data table while we find the most recent max PID
9 //other interfaces can still read the data during this lock, however
10 sqlStatement("lock tables patient_data read");
12 $result = sqlQuery("select max(pid)+1 as pid from patient_data");
14 sqlStatement("unlock tables");
18 if ($result['pid'] > 1)
19 $newpid = $result['pid'];
27 //what do we set for the public pid?
28 if (isset($_POST["pubpid"]) && ($_POST["pubpid"] != "")) {
29 $mypubpid = $_POST["pubpid"];
36 newPatientData( $_POST["db_id"],
38 ucwords($_POST["fname"]),
39 ucwords($_POST["lname"]),
40 ucwords($_POST["mname"]),
71 newEmployerData( $pid);
73 newHistoryData( $pid);
76 newInsuranceData( $pid, "primary");
81 newInsuranceData( $pid, "secondary");
84 newInsuranceData( $pid, "tertiary");
94 <script language
="Javascript">
96 window
.location
="<?echo "$rootdir/patient_file
/patient_file
.php?set_pid
=$pid";?>";