css file for four pane rx printing.
[openemr.git] / library / lists.inc
blobe9d942e99a6081455b92511548c60b2650f41c73
1 <?php
2 require_once("{$GLOBALS['srcdir']}/sql.inc");
4 $ISSUE_TYPES = array(
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)
11  //
12  // Styles are:
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.
17  //
20 $ISSUE_OCCURRENCES = array(
21   0   => xl('Unknown or N/A'),
22   1   => xl('First'),
23   6   => xl('Early Recurrence (<2 Mo)'),
24   7   => xl('Late Recurrence (2-12 Mo)'),
25   8   => xl('Delayed Recurrence (> 12 Mo)'),
26 //2   => xl('Second'),
27 //3   => xl('Third'),
28   4   => xl('Chronic/Recurrent'),
29   5   => xl('Acute on Chronic')
32 $ISSUE_CLASSIFICATIONS = array(
33   0   => xl('Unknown or N/A'),
34   1   => xl('Trauma'),
35   2   => xl('Overuse')
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")
45         if($active == "all")
46                 $sql = "select $cols from lists where pid='$pid' and type='$type' order by date DESC";
47         else
48                 $sql = "select $cols from lists where pid='$pid' and type='$type' and activity='$active' order by date DESC";
49         if ($limit != "all")
50                 $sql .= " limit $offset,$limit";
51         
53         $res = sqlStatement($sql);
54         for($iter =0;$row = sqlFetchArray($res);$iter++)
55                 $all[$iter] = $row;
56         return $all;
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'");
68         return true;
71 function reappearList ($id)
73         sqlStatement("update lists set activity = '1' where id='$id'");
74         return true;