Fix for web site change courtesy of info from whimmel.
[openemr.git] / custom / refercare.php
blob80d2ead5317bd4b7042f6cdba477a28b30f6eb1b
1 <?
2 // Copyright (C) 2005 Rod Roark <rod@sunsetsystems.com>
3 //
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");
15 $query = "SELECT * FROM patient_data WHERE pid = '$pid' LIMIT 1";
16 $row = sqlFetchArray(sqlStatement($query));
18 $phone = "";
19 if ($row['phone_home']) {
20 $phone .= "Home: " . $row['phone_home'];
22 if ($row['phone_biz']) {
23 if ($phone) $phone .= "; ";
24 $phone .= "Work: " . $row['phone_biz'];
26 if ($row['phone_cell']) {
27 if ($phone) $phone .= "; ";
28 $phone .= "Cell: " . $row['phone_cell'];
30 if ($row['phone_contact']) {
31 if ($phone) $phone .= "; ";
32 $phone .= "Contact: " . $row['phone_contact'];
35 $rcurl = "https://www.refercare.org/edit_referral.php?chart=$pid";
36 $rcurl .= "&lastname=" . htmlentities(trim($row['lname']), ENT_QUOTES);
37 $rcurl .= "&firstname=" . htmlentities(trim($row['fname']), ENT_QUOTES);
38 $rcurl .= "&ssn=" . htmlentities(trim($row['ss']) , ENT_QUOTES);
39 $rcurl .= "&dob=" . htmlentities(trim($row['DOB']) , ENT_QUOTES);
40 $rcurl .= "&contactinfo=" . htmlentities(trim($phone) , ENT_QUOTES);
42 <html>
43 <head>
44 <? html_header_show();?>
45 <link rel=stylesheet href="<?echo $css_header;?>" type="text/css">
46 <title>Create a Referral</title>
47 </head>
48 <body>
49 <script language="JavaScript">
50 window.location.href='<?php echo $rcurl ?>';
51 </script>
52 </body>
53 </html>