2 // Copyright (C) 2005 Rod Roark <rod@sunsetsystems.com>
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
9 /////////////////////////////////////////////////////////////////////
10 // This program invokes ReferCare to create a new referral.
11 /////////////////////////////////////////////////////////////////////
13 include_once("../interface/globals.php");
14 // include_once("../library/patient.inc");
16 // This mess gets all the info for the patient.
18 $query = "SELECT * FROM patient_data WHERE pid = '$pid' LIMIT 1";
19 $row = sqlFetchArray(sqlStatement($query));
22 if ($row['phone_home']) {
23 $phone .= "Home: " . $row['phone_home'];
25 if ($row['phone_biz']) {
26 if ($phone) $phone .= "; ";
27 $phone .= "Work: " . $row['phone_biz'];
29 if ($row['phone_cell']) {
30 if ($phone) $phone .= "; ";
31 $phone .= "Cell: " . $row['phone_cell'];
33 if ($row['phone_contact']) {
34 if ($phone) $phone .= "; ";
35 $phone .= "Contact: " . $row['phone_contact'];
38 $rcurl = "https://www.refercare.org/edit_referral.php?chart=$pid";
39 $rcurl .= "&lastname=" . htmlentities(trim($row['lname']), ENT_QUOTES
);
40 $rcurl .= "&firstname=" . htmlentities(trim($row['fname']), ENT_QUOTES
);
41 $rcurl .= "&ssn=" . htmlentities(trim($row['ss']) , ENT_QUOTES
);
42 $rcurl .= "&dob=" . htmlentities(trim($row['DOB']) , ENT_QUOTES
);
43 $rcurl .= "&contactinfo=" . htmlentities(trim($phone) , ENT_QUOTES
);
47 <link rel
=stylesheet href
="<?echo $css_header;?>" type
="text/css">
48 <title
>Create a Referral
</title
>
51 <script language
="JavaScript">
52 window
.location
.href
='<?php echo $rcurl ?>';