Ob/Gyn forms contributed by Douglas Crosdale
[openemr.git] / contrib / forms / plist / new.php
blobee7d1f192f29ed0980b8b370c44676092ca90a83
1 <?php
2 include_once("../../globals.php");
3 include_once("$srcdir/api.inc");
4 include_once("$srcdir/forms.inc");
5 include_once("$srcdir/calendar.inc");
6 include_once("$srcdir/lists.inc");
7 $frmn = 'form_plist';
8 $ftitle = 'Problem list';
9 $old = sqlStatement("select form_id, formdir from forms where (form_name='${ftitle}') and (pid=$pid) order by date desc limit 1");
10 if ($old) {
11 $dt = sqlFetchArray($old);
12 $fid = $dt{'form_id'};
13 if ($fid && ($fid != 0) && ($fid != '')){
14 $fdir = $dt{'formdir'};
15 unset($dt);
16 $dt = formFetch($frmn, $fid);
17 $newid = formSubmit($frmn, array_slice($dt,7), $id, $userauthorized);
18 addForm($encounter, $ftitle, $newid, $fdir, $pid, $userauthorized);
19 $id = $newid;
20 formJump("${rootdir}/patient_file/encounter/view_form.php?formname=${fdir}&id=${newid}");
21 exit;
25 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
26 "http://www.w3.org/TR/html4/loose.dtd">
28 <html>
29 <head>
30 <link rel=stylesheet href="<?echo $css_header;?>" type="text/css">
31 <link rel=stylesheet href="../../acog.css" type="text/css">
32 <script language="JavaScript" src="../../acog.js" type="text/JavaScript"></script>
33 <script language="JavaScript" type="text/JavaScript">
34 window.onload = initialize;
35 </script>
36 </head>
37 <?
38 $fres=sqlStatement("select * from patient_data where pid=".$_SESSION["pid"]);
39 if ($fres){
40 $patient = sqlFetchArray($fres);
42 $history = getHistoryData($_SESSION["pid"]);
44 <body <?echo $top_bg_line;?> >
46 <form action="<?echo $rootdir;?>/forms/plist/save.php?mode=new" method="post" enctype="multipart/form-data" name="my_form">
47 <? include("../../acog_menu.inc"); ?>
48 <table width="70%" border="0" cellspacing="0" cellpadding="4">
49 <tr>
50 <td width="120" align="left" valign="bottom" class="srvCaption">Patient name:</td>
51 <td align="left" valign="bottom"><input name="pname" type="text" class="fullin" id="pname" value="<? echo $patient{'fname'}.' '.$patient{'mname'}.' '.$patient{'lname'}; ?>"></td>
52 </tr>
53 <tr>
54 <td width="120" align="left" valign="bottom" class="srvCaption">Birth date: </td>
55 <td align="left" valign="bottom"><input name="pbdate" type="text" class="fullin" id="pbdate" value="<? echo $patient{'DOB'}; ?>"></td>
56 </tr>
57 <tr>
58 <td width="120" align="left" valign="bottom" class="srvCaption">ID No:</td>
59 <td align="left" valign="bottom"><input name="pl_pid" type="text" class="fullin" id="pl_pid" value="<? echo $patient{'id'}; ?>" readonly="true"></td>
60 </tr>
61 <tr>
62 <td width="120" align="left" valign="bottom" class="srvCaption">Date</td>
63 <td align="left" valign="bottom"><input name="pl_date" type="text" class="fullin" id="pl_date" value="<? echo date('Y-m-d'); ?>"></td>
64 </tr>
65 </table>
66 <div class="srvChapter">Problem list <a href="#" onMouseOver="toolTip('The Problem List captures problems, allergies, family history, and current medication use.')" onMouseOut="toolTip();"><img src="../../pic/mark_q.png" width="13" height="13" border="0"></a></div>
67 <div style="border: solid 2px black; background-color:#FFFFFF;">
68 <table width="100%" border="0" cellspacing="0" cellpadding="2">
69 <tr>
70 <td width="50%" class="ficaption3" id="bordR">High risk:</td>
71 <td width="50%" class="ficaption3">Family history:</td>
72 </tr>
73 <tr>
74 <td class="fibody2" id="bordR"><textarea name="pl_high_risk" rows="6" wrap="VIRTUAL" class="fullin2" id="pl_high_risk"><? echo $obj{'pl_high_risk'} ?></textarea></td>
75 <td class="fibody2"><textarea name="pl_family_history" rows="6" wrap="VIRTUAL" class="fullin2" id="pl_family_history"><?
76 ($history['history_mother'] != '')?$tmp[] = "Mother: ".$history['history_mother']:'';
77 ($history['history_father'] != '')?$tmp[] = "Father: ".$history['history_father']:'';
78 ($history['history_siblings'] != '')?$tmp[] = "Siblings: ".$history['history_siblings']:'';
79 ($history['history_spouse'] != '')?$tmp[] = "Spouse: ".$history['history_spouse']:'';
80 ($history['history_offspring'] != '')?$tmp[] = "Offspring: ".$history['history_offspring']:'';
81 echo join(', ', $tmp);
82 ?></textarea></td>
83 </tr>
84 <tr>
85 <td class="ficaption3" id="bordR">Drug/Latex/Transfusion/Allergic reactions: </td>
86 <td class="ficaption3">Current medications:</td>
87 </tr>
88 <tr>
89 <td class="fibody3" id="bordR"><textarea name="pl_reactions" rows="6" wrap="VIRTUAL" class="fullin2" id="pl_reactions"><?
90 $allergies = ''; $checked = 'checked';
91 if ($result = getListByType($pid, "allergy", "id,title,comments,activity,date", 1, "all", 0)){
92 foreach ($result as $iter) {
93 $al_tmp[] = $iter{"title"}.' ('.$iter{"comments"}.') ';
94 $checked = '';
96 $allergies = join(',', $al_tmp);
98 echo $allergies;
99 ?></textarea></td>
100 <td class="fibody3"><textarea name="pl_medications" rows="6" wrap="VIRTUAL" class="fullin2" id="pl_medications"><?
101 if ($result = getListByType($pid, "medication", "id,title,comments,activity,date", 1, "all", 0)){
102 foreach ($result as $iter) {
103 $tmp_med[] = $iter{"title"}.' ('.$iter{"comments"}.') ';
105 echo join(', ', $tmp_med);
107 ?></textarea></td>
108 </tr>
109 </table>
110 </div>
111 <p>&nbsp;</p>
112 <div style="border: solid 2px black; background-color:#FFFFFF;">
113 <table width="100%" border="0" cellspacing="0" cellpadding="2">
114 <tr>
115 <td width="20" align="left" valign="bottom" class="ficaption2" id="bordR">No</td>
116 <td width="120" align="center" valign="bottom" class="ficaption2" id="bordR">Entry date </td>
117 <td align="center" valign="bottom" class="ficaption2" id="bordR">Problem/Resolution</td>
118 <td width="120" align="center" valign="bottom" class="ficaption2" id="bordR">Onset age and date </td>
119 <td width="120" align="center" valign="bottom" class="ficaption2">Resolution date </td>
120 </tr>
122 $pli = 1;
124 while ($pli < 26){
125 //print $obj["pl_problem_$pli"];
126 list($pl_ed, $pl_problem, $pl_onset, $pl_rd) = explode('|~', $obj["pl_problem_${pli}"]);
127 print <<<EOL
128 <tr>
129 <td align="left" valign="bottom" class="fibody2" id="bordR">${pli}.</td>
130 <td align="left" valign="bottom" class="fibody2" id="bordR"><input name="pl_ed_${pli}" type="text" class="fullin2" value="${pl_ed}"></td>
131 <td align="left" valign="bottom" class="fibody2" id="bordR"><input name="pl_problem_${pli}" type="text" class="fullin2" value="${pl_problem}"></td>
132 <td align="left" valign="bottom" class="fibody2" id="bordR"><input name="pl_onset_${pli}" type="text" class="fullin2" value="${pl_onset}"></td>
133 <td align="left" valign="bottom" class="fibody2"><input name="pl_rd_${pli}" type="text" class="fullin2" value="${pl_rd}"></td>
134 </tr>
135 EOL;
136 $pli++;
139 </table>
140 </div>
141 <table width="100%" border="0">
142 <tr>
143 <td align="left" width="100"> <a href="javascript:document.my_form.submit();" class="link_submit">[Save Data]</a> </td>
144 <td align="right"> <a href="<?echo "$rootdir/patient_file/encounter/patient_encounter.php";?>" class="link_submit">[Don't Save]</a> </td>
145 </tr>
146 </table>
147 </form>
148 <?php
149 formFooter();
151 </body>
152 </html>