2 require_once("{$GLOBALS['srcdir']}/sql.inc");
5 // table type plural singular abbrev style
6 'medical_problem' => array('Medical Problems', 'Problem' , 'P', 0),
7 'allergy' => array('Allergies' , 'Allergy' , 'A', 0),
8 'medication' => array('Medications' , 'Medication', 'M', 0),
9 'surgery' => array('Surgeries' , 'Surgery' , 'S', 0),
10 'dental' => array('Dental Issues' , 'Dental' , 'D', 0)
13 // 0 - Normal, as in 2.8.1.
14 // 1 - Simplified: only title, start date, comments and an Active checkbox;
15 // no diagnosis, occurrence, end date, referred-by or sports fields.
16 // Internally we'll still use a null end date to indicate active.
20 $ISSUE_OCCURRENCES = array(
21 0 => xl('Unknown or N/A'),
23 6 => xl('Early Recurrence (<2 Mo)'),
24 7 => xl('Late Recurrence (2-12 Mo)'),
25 8 => xl('Delayed Recurrence (> 12 Mo)'),
28 4 => xl('Chronic/Recurrent'),
29 5 => xl('Acute on Chronic')
32 $ISSUE_CLASSIFICATIONS = array(
33 0 => xl('Unknown or N/A'),
38 function getListById ($id, $cols = "*")
40 return sqlQuery("select $cols from lists where id='$id' order by date DESC limit 0,1");
43 function getListByType ($pid, $type, $cols = "*", $active = "all", $limit = "all", $offset="0")
46 $sql = "select $cols from lists where pid='$pid' and type='$type' order by date DESC";
48 $sql = "select $cols from lists where pid='$pid' and type='$type' and activity='$active' order by date DESC";
50 $sql .= " limit $offset,$limit";
53 $res = sqlStatement($sql);
54 for($iter =0;$row = sqlFetchArray($res);$iter++)
60 function addList ($pid, $type, $title, $comments, $activity = "1")
62 return sqlInsert("insert into lists (date, pid, type, title, activity, comments, user, groupname) values (NOW(), '$pid', '$type', '$title', '$activity', '$comments', '".$_SESSION['authUser']."', '".$_SESSION['authProvider']."')");
65 function disappearList ($id)
67 sqlStatement("update lists set activity = '0' where id='$id'");
71 function reappearList ($id)
73 sqlStatement("update lists set activity = '1' where id='$id'");