2 require_once("{$GLOBALS['srcdir']}/sql.inc");
4 if (!empty($GLOBALS['ippf_specific'])) {
6 // table type plural singular abbrev style
7 'medical_problem' => array('Medical Problems', 'Problem' , 'P', 0),
8 'allergy' => array('Allergies' , 'Allergy' , 'Y', 0),
9 'medication' => array('Medications' , 'Medication' , 'M', 0),
10 'surgery' => array('Surgeries' , 'Surgery' , 'S', 0),
11 'ippf_gcac' => array('Abortions' , 'Abortion' , 'A', 3),
12 'contraceptive' => array('Contraception' , 'Contraception', 'C', 4),
13 // 'ippf_srh' => array('SRH' , 'SRH' , 'R', 5),
16 else if (!empty($GLOBALS['athletic_team'])) {
18 'football_injury' => array('Football Injuries', 'Injury' , 'I', 2),
19 'medical_problem' => array('Medical Problems' , 'Problem' , 'P', 0),
20 'allergy' => array('Allergies' , 'Allergy' , 'A', 1),
21 'general' => array('General' , 'General' , 'G', 1),
24 else { // default version
26 // table type plural singular abbrev style
27 'medical_problem' => array('Medical Problems', 'Problem' , 'P', 0),
28 'allergy' => array('Allergies' , 'Allergy' , 'A', 0),
29 'medication' => array('Medications' , 'Medication', 'M', 0),
30 'surgery' => array('Surgeries' , 'Surgery' , 'S', 0),
31 'dental' => array('Dental Issues' , 'Dental' , 'D', 0),
34 // 0 - Normal, as in 2.8.1.
35 // 1 - Simplified: only title, start date, comments and an Active checkbox;
36 // no diagnosis, occurrence, end date, referred-by or sports fields.
37 // Internally we'll still use a null end date to indicate active.
38 // 2 - Football Injury.
43 $ISSUE_OCCURRENCES = array(
44 0 => xl('Unknown or N/A'),
46 6 => xl('Early Recurrence (<2 Mo)'),
47 7 => xl('Late Recurrence (2-12 Mo)'),
48 8 => xl('Delayed Recurrence (> 12 Mo)'),
51 4 => xl('Chronic/Recurrent'),
52 5 => xl('Acute on Chronic')
55 $ISSUE_CLASSIFICATIONS = array(
56 0 => xl('Unknown or N/A'),
61 function getListById ($id, $cols = "*")
63 return sqlQuery("select $cols from lists where id='$id' order by date DESC limit 0,1");
66 function getListByType ($pid, $type, $cols = "*", $active = "all", $limit = "all", $offset="0")
69 $sql = "select $cols from lists where pid='$pid' and type='$type' order by date DESC";
71 $sql = "select $cols from lists where pid='$pid' and type='$type' and activity='$active' order by date DESC";
73 $sql .= " limit $offset,$limit";
76 $res = sqlStatement($sql);
77 for($iter =0;$row = sqlFetchArray($res);$iter++)
83 function addList ($pid, $type, $title, $comments, $activity = "1")
85 return sqlInsert("insert into lists (date, pid, type, title, activity, comments, user, groupname) values (NOW(), '$pid', '$type', '$title', '$activity', '$comments', '".$_SESSION['authUser']."', '".$_SESSION['authProvider']."')");
88 function disappearList ($id)
90 sqlStatement("update lists set activity = '0' where id='$id'");
94 function reappearList ($id)
96 sqlStatement("update lists set activity = '1' where id='$id'");