cosmetic
[openemr.git] / library / lists.inc
blobaed9d244083b41003bb8af9f01e3feecc7918e7c
1 <?php
2 require_once("{$GLOBALS['srcdir']}/sql.inc");
4 if (!empty($GLOBALS['ippf_specific'])) {
5   $ISSUE_TYPES = array(
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),
14   );
16 else if (!empty($GLOBALS['athletic_team'])) {
17   $ISSUE_TYPES = array(
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),
22   );
24 else { // default version
25   $ISSUE_TYPES = array(
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),
32     //
33     // Styles are:
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.
39     //
40   );
43 $ISSUE_OCCURRENCES = array(
44   0   => xl('Unknown or N/A'),
45   1   => xl('First'),
46   6   => xl('Early Recurrence (<2 Mo)'),
47   7   => xl('Late Recurrence (2-12 Mo)'),
48   8   => xl('Delayed Recurrence (> 12 Mo)'),
49 //2   => xl('Second'),
50 //3   => xl('Third'),
51   4   => xl('Chronic/Recurrent'),
52   5   => xl('Acute on Chronic')
55 $ISSUE_CLASSIFICATIONS = array(
56   0   => xl('Unknown or N/A'),
57   1   => xl('Trauma'),
58   2   => xl('Overuse')
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")
68         if($active == "all")
69                 $sql = "select $cols from lists where pid='$pid' and type='$type' order by date DESC";
70         else
71                 $sql = "select $cols from lists where pid='$pid' and type='$type' and activity='$active' order by date DESC";
72         if ($limit != "all")
73                 $sql .= " limit $offset,$limit";
74         
76         $res = sqlStatement($sql);
77         for($iter =0;$row = sqlFetchArray($res);$iter++)
78                 $all[$iter] = $row;
79         return $all;
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'");
91         return true;
94 function reappearList ($id)
96         sqlStatement("update lists set activity = '1' where id='$id'");
97         return true;