Allow switch to simpler age display format for patients above certain age
[openemr.git] / custom / refercare.php
blob810429bff331a6c5b9f3866a876dc2c325e3bd3a
1 <?php
3 // Copyright (C) 2005 Rod Roark <rod@sunsetsystems.com>
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 /////////////////////////////////////////////////////////////////////
11 // This program invokes ReferCare to create a new referral.
12 /////////////////////////////////////////////////////////////////////
14 include_once("../interface/globals.php");
16 $query = "SELECT * FROM patient_data WHERE pid = '$pid' LIMIT 1";
17 $row = sqlFetchArray(sqlStatement($query));
19 $phone = "";
20 if ($row['phone_home']) {
21 $phone .= "Home: " . $row['phone_home'];
23 if ($row['phone_biz']) {
24 if ($phone) $phone .= "; ";
25 $phone .= "Work: " . $row['phone_biz'];
27 if ($row['phone_cell']) {
28 if ($phone) $phone .= "; ";
29 $phone .= "Cell: " . $row['phone_cell'];
31 if ($row['phone_contact']) {
32 if ($phone) $phone .= "; ";
33 $phone .= "Contact: " . $row['phone_contact'];
36 $rcurl = "https://www.refercare.org/edit_referral.php?chart=$pid";
37 $rcurl .= "&lastname=" . htmlentities(trim($row['lname']), ENT_QUOTES);
38 $rcurl .= "&firstname=" . htmlentities(trim($row['fname']), ENT_QUOTES);
39 $rcurl .= "&ssn=" . htmlentities(trim($row['ss']) , ENT_QUOTES);
40 $rcurl .= "&dob=" . htmlentities(trim($row['DOB']) , ENT_QUOTES);
41 $rcurl .= "&contactinfo=" . htmlentities(trim($phone) , ENT_QUOTES);
43 <html>
44 <head>
45 <?php html_header_show();?>
46 <link rel=stylesheet href="<?php echo $css_header;?>" type="text/css">
47 <title>Create a Referral</title>
48 </head>
49 <body>
50 <script language="JavaScript">
51 window.location.href='<?php echo $rcurl ?>';
52 </script>
53 </body>
54 </html>