Immunization_information_(MU2) changes, take 5.
authorjajalla23 <jansta23@gmail.com>
Fri, 12 Apr 2013 06:29:24 +0000 (11 23:29 -0700)
committerbradymiller <bradymiller@users.sourceforge.net>
Wed, 1 May 2013 01:30:45 +0000 (30 18:30 -0700)
 -Change Date Administered to Date/Time Administered
 -Add an Amount Administered field
 -Add an Immunization Expiration Date field
 -Add a Route field
 -Add a Administration Site field
 -Add a erroneously added field/mechanism

Some additional integration work by bradymiller.

interface/patient_file/report/custom_report.php
interface/patient_file/summary/immunizations.php
interface/patient_file/summary/shot_record.php
interface/patient_file/summary/stats.php
interface/reports/immunization_report.php
library/clinical_rules.php
library/immunization_helper.php [new file with mode: 0644]
library/sql-ccr.inc
sql/4_1_1-to-4_1_2_upgrade.sql
sql/database.sql
version.php

index b58fbd5..87975f3 100644 (file)
@@ -473,19 +473,19 @@ else { // not printable
   <table style="width:100%;">
     <tr>
       <td>
-        <input type="text" onkeyup="clear_last_visit();remove_mark_all();find_all();" name="search_element" id="search_element" style="width:180px;"/>
+        <input type="text" onKeyUp="clear_last_visit();remove_mark_all();find_all();" name="search_element" id="search_element" style="width:180px;"/>
       </td>
       <td>
-         <a class="css_button" onclick="clear_last_visit();remove_mark_all();find_all();" ><span><?php echo xlt('Find'); ?></span></a>
+         <a class="css_button" onClick="clear_last_visit();remove_mark_all();find_all();" ><span><?php echo xlt('Find'); ?></span></a>
       </td>
       <td>
-         <a class="css_button" onclick="next_prev('prev');" ><span><?php echo xlt('Prev'); ?></span></a>
+         <a class="css_button" onClick="next_prev('prev');" ><span><?php echo xlt('Prev'); ?></span></a>
       </td>
       <td>
-         <a class="css_button" onclick="next_prev('next');" ><span><?php echo xlt('Next'); ?></span></a>
+         <a class="css_button" onClick="next_prev('next');" ><span><?php echo xlt('Next'); ?></span></a>
       </td>
       <td>
-        <input type="checkbox" onclick="clear_last_visit();remove_mark_all();find_all();" name="search_case" id="search_case" />
+        <input type="checkbox" onClick="clear_last_visit();remove_mark_all();find_all();" name="search_case" id="search_case" />
       </td>
       <td>
         <span><?php echo xlt('Match case'); ?></span>
@@ -665,7 +665,7 @@ foreach ($ar as $key => $val) {
                    " from immunizations i1 ".
                    " left join code_types ct on ct.ct_key = 'CVX' ".
                    " left join codes c on c.code_type = ct.ct_id AND i1.cvx_code = c.code ".
-                   " where i1.patient_id = '$pid' ".
+                   " where i1.patient_id = '$pid' and i1.added_erroneously = 0 ".
                    " order by administered_date desc";
                 $result = sqlStatement($sql);
                 while ($row=sqlFetchArray($result)) {
index f89a375..fcd6009 100644 (file)
@@ -11,11 +11,15 @@ $fake_register_globals=false;
 include_once("../../globals.php");
 include_once("$srcdir/sql.inc");
 include_once("$srcdir/options.inc.php");
+include_once("$srcdir/immunization_helper.php");
 
 if (isset($_GET['mode'])) {
-    
-    if ($_GET['mode'] == "add" ) {
-       
+    /*
+        * THIS IS A BUG. IF NEW IMMUN IS ADDED AND USER PRINTS PDF, 
+        * WHEN BACK IS CLICKED, ANOTHER ITEM GETS ADDED
+        */
+       
+       if ($_GET['mode'] == "add") {           
         $sql = "REPLACE INTO immunizations set 
                       id = ?,
                       administered_date = if(?,?,NULL),  
@@ -31,7 +35,12 @@ if (isset($_GET['mode'])) {
                       patient_id   = ?,
                       created_by = ?,
                       updated_by = ?,
-                      create_date = now() ";
+                                     create_date = now(), 
+                                         amount_administered = ?,
+                                         amount_administered_unit = ?,
+                                         expiration_date = if(?,?,NULL),
+                                         route = ?,
+                                         administration_site = ? ";
        $sqlBindArray = array(
                     trim($_GET['id']),
                     trim($_GET['administered_date']), trim($_GET['administered_date']),
@@ -46,12 +55,19 @@ if (isset($_GET['mode'])) {
                     trim($_GET['note']),
                     $pid,
                     $_SESSION['authId'],
-                    $_SESSION['authId']
+                    $_SESSION['authId'],
+                        trim($_GET['immuniz_amt_adminstrd']),
+                        trim($_GET['form_drug_units']),
+                        trim($_GET['immuniz_exp_date']), trim($_GET['immuniz_exp_date']),
+                        trim($_GET['immuniz_route']),
+                        trim($_GET['immuniz_admin_ste'])                        
                     );
         sqlStatement($sql,$sqlBindArray);
-        $administered_date=$education_date=date('Y-m-d');
+        $administered_date=date('Y-m-d H:i');
+               $education_date=date('Y-m-d');
         $immunization_id=$cvx_code=$manufacturer=$lot_number=$administered_by_id=$note=$id="";
         $administered_by=$vis_date="";
+               
     }
     elseif ($_GET['mode'] == "delete" ) {
         // log the event
@@ -59,13 +75,31 @@ if (isset($_GET['mode'])) {
         // delete the immunization
         $sql="DELETE FROM immunizations WHERE id =? LIMIT 1";
         sqlStatement($sql, array($_GET['id']));
+               
     }
+       elseif ($_GET['mode'] == "added_error" ) {
+               $sql = "UPDATE immunizations " .
+                          "SET added_erroneously=? "  .
+                          "WHERE id=?";
+               $sql_arg_array = array(
+                                                       ($_GET['isError'] === 'true'),
+                                                       $_GET['id']
+                                                );
+               sqlStatement($sql, $sql_arg_array);
+       }
     elseif ($_GET['mode'] == "edit" ) {
         $sql = "select * from immunizations where id = ?";
         $result = sqlQuery($sql, array($_GET['id']));
-        $administered_date = $result['administered_date'];
-        $immunization_id = $result['immunization_id'];
-        $cvx_code = $result['cvx_code'];
+               
+               $administered_date = new DateTime($result['administered_date']);
+               $administered_date = $administered_date->format('Y-m-d H:i');
+               
+               $immuniz_amt_adminstrd = $result['amount_administered'];
+               $drugunitselecteditem = $result['amount_administered_unit'];
+        $immunization_id = $result['immunization_id']; 
+               $immuniz_exp_date = $result['expiration_date'];
+               
+               $cvx_code = $result['cvx_code'];
         $code_text = '';
         if ( !(empty($cvx_code)) ) {
             $query = "SELECT codes.code_text as `code_text`, codes.code as `code` " .
@@ -78,11 +112,23 @@ if (isset($_GET['mode'])) {
         $manufacturer = $result['manufacturer'];
         $lot_number = $result['lot_number'];
         $administered_by_id = ($result['administered_by_id'] ? $result['administered_by_id'] : 0);
-        $administered_by = $result['administered_by'];
+
+               $administered_by = "";
+               if (!$result['administered_by'] && !$row['administered_by_id']) { 
+               $stmt = "select concat(lname,', ',fname) as full_name ".
+                       "from users where ".
+                       "id=?";
+               $user_result = sqlQuery($stmt, array($result['administered_by_id']));
+               $administered_by = $user_result['full_name'];
+               }
+               
         $education_date = $result['education_date'];
         $vis_date = $result['vis_date'];
+               $immuniz_route = $result['route'];
+               $immuniz_admin_ste = $result['administration_site'];
         $note = $result['note'];
-
+               $isAddedError = $result['added_erroneously'];
+               
        //set id for page
        $id = $_GET['id'];
        
@@ -163,7 +209,7 @@ var mypcc = '<?php echo htmlspecialchars( $GLOBALS['phone_country_code'], ENT_QU
 <?php if ($GLOBALS['concurrent_layout']) { ?>
     <span class="title"><?php echo htmlspecialchars( xl('Immunizations'), ENT_NOQUOTES); ?></span>
 <?php } else { ?>
-    <a href="patient_summary.php" target="Main" onclick="top.restoreSession()">
+    <a href="patient_summary.php" target="Main" onClick="top.restoreSession()">
     <span class="title"><?php echo htmlspecialchars( xl('Immunizations'), ENT_NOQUOTES); ?></span>
     <span class=back><?php echo htmlspecialchars( $tback, ENT_NOQUOTES); ?></span></a>
 <?php } ?>
@@ -174,85 +220,93 @@ var mypcc = '<?php echo htmlspecialchars( $GLOBALS['phone_country_code'], ENT_QU
 <input type="hidden" name="pid" id="pid" value="<?php echo htmlspecialchars( $pid, ENT_QUOTES); ?>"> 
 <br>
       <table border=0 cellpadding=1 cellspacing=1>
+         <?php
+               if ($isAddedError) {
+                       echo "<tr><font color='red'><b>" . xlt("Entered in Error") . "</b></font></tr>";
+               }
+         ?> 
 
       <?php if (!($useCVX)) { ?>
         <tr>
           <td align="right">
             <span class=text>
-              <?php echo htmlspecialchars( xl('Immunization'), ENT_NOQUOTES); ?>
-            </span>
-          </td>
+              <?php echo htmlspecialchars( xl('Immunization'), ENT_NOQUOTES); ?>            </span>          </td>
           <td>
               <?php
                        // Modified 7/2009 by BM to incorporate the immunization items into the list_options listings
                 generate_form_field(array('data_type'=>1,'field_id'=>'immunization_id','list_id'=>'immunizations','empty_title'=>'SKIP'), $immunization_id);
-              ?>
-          </td>
+              ?>          
+                  </td>
         </tr>
       <?php } else { ?>
            <tr>
           <td align="right" valign="top" style="padding-top:4px;">
             <span class=text>
-              <?php echo htmlspecialchars( xl('Immunization'), ENT_NOQUOTES); ?> (<?php echo htmlspecialchars( xl('CVX Code'), ENT_NOQUOTES); ?>)
-            </span>
-          </td>
+              <?php echo htmlspecialchars( xl('Immunization'), ENT_NOQUOTES); ?> (<?php echo htmlspecialchars( xl('CVX Code'), ENT_NOQUOTES); ?>)            </span>          </td>
                  <td>
                   <input type='text' size='10' name='cvx_code' id='cvx_code'
                    value='<?php echo htmlspecialchars($cvx_code,ENT_QUOTES); ?>' onclick='sel_cvxcode(this)'
                    title='<?php echo htmlspecialchars( xl('Click to select or change CVX code'), ENT_QUOTES); ?>'
                    />
                    <div id='cvx_description' style='display:inline; float:right; padding:3px; margin-left:3px; width:400px'>
-                       <?php echo htmlspecialchars( xl( $code_text ), ENT_QUOTES); ?>
-                   </div>
-                 </td>
+                       <?php echo htmlspecialchars( xl( $code_text ), ENT_QUOTES); ?>              </div>                </td>
                </tr>
       <?php } ?>
         
         <tr>
           <td align="right">
             <span class=text>
-              <?php echo htmlspecialchars( xl('Date Administered'), ENT_NOQUOTES); ?>
-            </span>
-          </td>
-          <td>
-
-   <input type='text' size='10' name="administered_date" id="administered_date"
-    value='<?php echo $administered_date ? htmlspecialchars( $administered_date, ENT_QUOTES) : date('Y-m-d'); ?>'
+              <?php echo htmlspecialchars( xl('Date & Time Administered'), ENT_NOQUOTES); ?>            </span>          </td>
+          <td><table border="0">
+     <tr>
+       <td><input type='text' size='14' name="administered_date" id="administered_date"
+               value='<?php echo $administered_date ? htmlspecialchars( $administered_date, ENT_QUOTES) : date('Y-m-d H:i'); ?>'
+               title='<?php echo htmlspecialchars( xl('yyyy-mm-dd Hours(24):minutes'), ENT_QUOTES); ?>'
+               onKeyUp='datekeyup(this,mypcc)' onBlur='dateblur(this,mypcc);'
+               />
+               <img src='<?php echo $rootdir; ?>/pic/show_calendar.gif' align='absbottom' width='24' height='22'
+                       id='img_administered_date' border='0' alt='[?]' style='cursor:pointer;cursor:hand'
+                       title='<?php echo htmlspecialchars( xl('Click here to choose a date'), ENT_QUOTES); ?>'>
+               </td>
+     </tr>
+   </table></td>
+        </tr>
+        <tr>
+          <td align="right"><span class="text"><?php echo htmlspecialchars( xl('Amount Administered'), ENT_NOQUOTES); ?></span></td>
+          <td class='text'>
+                       <input class='text' type='text' name="immuniz_amt_adminstrd" size="25" value="<?php echo htmlspecialchars( $immuniz_amt_adminstrd, ENT_QUOTES); ?>">
+                       <?php echo generate_select_list("form_drug_units", "drug_units", $drugunitselecteditem,'Select Drug Unit',''); ?>
+                 </td>
+        </tr>
+        <tr>
+          <td align="right"><span class="text"><?php echo htmlspecialchars( xl('Immunization Expiration Date'), ENT_NOQUOTES); ?></span></td>
+          <td class='text'><input type='text' size='10' name="immuniz_exp_date" id="immuniz_exp_date"
+    value='<?php echo $immuniz_exp_date ? htmlspecialchars( $immuniz_exp_date, ENT_QUOTES) : ''; ?>'
     title='<?php echo htmlspecialchars( xl('yyyy-mm-dd'), ENT_QUOTES); ?>'
     onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc);'
     />
-   <img src='<?php echo $rootdir; ?>/pic/show_calendar.gif' align='absbottom' width='24' height='22'
-    id='img_administered_date' border='0' alt='[?]' style='cursor:pointer;cursor:hand'
-    title='<?php echo htmlspecialchars( xl('Click here to choose a date'), ENT_QUOTES); ?>'>
-
-          </td>
-        </tr>
+          <img src='<?php echo $rootdir; ?>/pic/show_calendar.gif' align='absbottom' width='24' height='22'
+    id='img_immuniz_exp_date' border='0' alt='[?]' style='cursor:pointer;cursor:hand'
+    title='<?php echo htmlspecialchars( xl('Click here to choose a date'), ENT_QUOTES); ?>'></td>
+        </tr>          
         <tr>
           <td align="right">
             <span class=text>
-              <?php echo htmlspecialchars( xl('Immunization Manufacturer'), ENT_NOQUOTES); ?>
-            </span>
-          </td>
+              <?php echo htmlspecialchars( xl('Immunization Manufacturer'), ENT_NOQUOTES); ?>            </span>          </td>
           <td>
-            <input class='text' type='text' name="manufacturer" size="25" value="<?php echo htmlspecialchars( $manufacturer, ENT_QUOTES); ?>">
-          </td>
+            <input class='text' type='text' name="manufacturer" size="25" value="<?php echo htmlspecialchars( $manufacturer, ENT_QUOTES); ?>">          </td>
         </tr>
         <tr>
           <td align="right">
             <span class=text>
-              <?php echo htmlspecialchars( xl('Immunization Lot Number'), ENT_NOQUOTES); ?>
-            </span>
-          </td>
+              <?php echo htmlspecialchars( xl('Immunization Lot Number'), ENT_NOQUOTES); ?>            </span>          </td>
           <td>
-            <input class='text' type='text' name="lot_number" size="25" value="<?php echo htmlspecialchars( $lot_number, ENT_QUOTES); ?>">
-          </td>
+            <input class='text' type='text' name="lot_number" size="25" value="<?php echo htmlspecialchars( $lot_number, ENT_QUOTES); ?>">          </td>
         </tr>
         <tr>
           <td align="right">
             <span class='text'>
-              <?php echo htmlspecialchars( xl('Name and Title of Immunization Administrator'), ENT_NOQUOTES); ?>
-            </span>
-          </td>
+              <?php echo htmlspecialchars( xl('Name and Title of Immunization Administrator'), ENT_NOQUOTES); ?>            </span>          </td>
           <td class='text'>
             <input type="text" name="administered_by" id="administered_by" size="25" value="<?php echo htmlspecialchars( $administered_by, ENT_QUOTES); ?>">
             <?php echo htmlspecialchars( xl('or choose'), ENT_NOQUOTES); ?>
@@ -271,13 +325,11 @@ var mypcc = '<?php echo htmlspecialchars( $GLOBALS['phone_country_code'], ENT_QU
                   echo htmlspecialchars( $row{'full_name'}, ENT_NOQUOTES) . '</OPTION>';
                 }
               ?>
-            </select>
-          </td>
+            </select>          </td>
         </tr>
         <tr>
           <td align="right" class="text">
-              <?php echo htmlspecialchars( xl('Date Immunization Information Statements Given'), ENT_NOQUOTES); ?>
-          </td>
+              <?php echo htmlspecialchars( xl('Date Immunization Information Statements Given'), ENT_NOQUOTES); ?>          </td>
           <td>
             <input type='text' size='10' name="education_date" id="education_date"
                     value='<?php echo $education_date? htmlspecialchars( $education_date, ENT_QUOTES) : date('Y-m-d'); ?>'
@@ -287,14 +339,12 @@ var mypcc = '<?php echo htmlspecialchars( $GLOBALS['phone_country_code'], ENT_QU
             <img src='<?php echo $rootdir; ?>/pic/show_calendar.gif' align='absbottom' width='24' height='22'
                 id='img_education_date' border='0' alt='[?]' style='cursor:pointer;'
                 title='<?php echo htmlspecialchars( xl('Click here to choose a date'), ENT_QUOTES); ?>'
-            />
-          </td>
+            />          </td>
         </tr>
         <tr>
           <td align="right" class="text">
               <?php echo htmlspecialchars( xl('Date of VIS Statement'), ENT_NOQUOTES); ?>
-              (<a href="http://www.cdc.gov/vaccines/pubs/vis/default.htm" title="<?php echo htmlspecialchars( xl('Help'), ENT_QUOTES); ?>" target="_blank">?</a>)
-          </td>
+              (<a href="http://www.cdc.gov/vaccines/pubs/vis/default.htm" title="<?php echo htmlspecialchars( xl('Help'), ENT_QUOTES); ?>" target="_blank">?</a>)          </td>
           <td>
             <input type='text' size='10' name="vis_date" id="vis_date"
                     value='<?php echo $vis_date ? htmlspecialchars( $vis_date, ENT_QUOTES) : date('Y-m-d'); ?>'
@@ -304,16 +354,25 @@ var mypcc = '<?php echo htmlspecialchars( $GLOBALS['phone_country_code'], ENT_QU
             <img src='<?php echo $rootdir; ?>/pic/show_calendar.gif' align='absbottom' width='24' height='22'
                 id='img_vis_date' border='0' alt='[?]' style='cursor:pointer;'
                 title='<?php echo htmlspecialchars( xl('Click here to choose a date'), ENT_QUOTES); ?>'
-            />
-          </td>
+            />          </td>
+        </tr>
+        <tr>
+          <td align="right" class='text'><?php echo htmlspecialchars( xl('Route'), ENT_NOQUOTES); ?></td>
+          <td>
+                       <?php echo generate_select_list('immuniz_route', 'drug_route', $immuniz_route, 'Select Route', '');?>             
+                 </td>
+        </tr>
+        <tr>
+          <td align="right" class='text'><?php echo htmlspecialchars( xl('Administration Site'), ENT_NOQUOTES); ?></td>
+          <td>
+                       <?php echo generate_select_list('immuniz_admin_ste', 'proc_body_site', $immuniz_admin_ste, 'Select Administration Site', ' ');?>
+                 </td>
         </tr>
         <tr>
           <td align="right" class='text'>
-              <?php echo htmlspecialchars( xl('Notes'), ENT_NOQUOTES); ?>
-          </td>
+              <?php echo htmlspecialchars( xl('Notes'), ENT_NOQUOTES); ?>          </td>
           <td>
-            <textarea class='text' name="note" id="note" rows=5 cols=25><?php echo htmlspecialchars( $note, ENT_NOQUOTES); ?></textarea>
-          </td>
+            <textarea class='text' name="note" id="note" rows=5 cols=25><?php echo htmlspecialchars( $note, ENT_NOQUOTES); ?></textarea>          </td>
         </tr>
         <tr>
           <td colspan="3" align="center">
@@ -324,11 +383,10 @@ var mypcc = '<?php echo htmlspecialchars( $GLOBALS['phone_country_code'], ENT_QU
        
            <input type="button" name="printHtml" id="printHtml" value="<?php echo htmlspecialchars( xl('Print Record') . xl('HTML','',' (',')'), ENT_QUOTES); ?>">
             
-            <input type="reset" name="clear" id="clear" value="<?php echo htmlspecialchars( xl('Clear'), ENT_QUOTES); ?>">
-          </td>
+            <input type="reset" name="clear" id="clear" value="<?php echo htmlspecialchars( xl('Clear'), ENT_QUOTES); ?>">          </td>
         </tr>
       </table>
-    </form>
+</form>
 
 <div id="immunization_list">
 
@@ -346,37 +404,35 @@ var mypcc = '<?php echo htmlspecialchars( $GLOBALS['phone_country_code'], ENT_QU
           <?php echo htmlspecialchars( xl('Date'), ENT_NOQUOTES); ?></a>
         <span class='small' style='font-family:arial'><?php if ($sortby == 'date') { echo 'v'; } ?></span>
     </th>
+       <th><?php echo htmlspecialchars( xl('Amount'), ENT_NOQUOTES); ?></th>
     <th><?php echo htmlspecialchars( xl('Manufacturer'), ENT_NOQUOTES); ?></th>
     <th><?php echo htmlspecialchars( xl('Lot Number'), ENT_NOQUOTES); ?></th>
     <th><?php echo htmlspecialchars( xl('Administered By'), ENT_NOQUOTES); ?></th>
     <th><?php echo htmlspecialchars( xl('Education Date'), ENT_NOQUOTES); ?></th>
-    <th><?php echo htmlspecialchars( xl('Note'), ENT_NOQUOTES); ?></th>
-    <th>&nbsp;</th>
+       <th><?php echo htmlspecialchars( xl('Route'), ENT_NOQUOTES); ?></th>
+       <th><?php echo htmlspecialchars( xl('Administered Site'), ENT_NOQUOTES); ?></th>
+    <th><?php echo htmlspecialchars( xl('Notes'), ENT_NOQUOTES); ?></th>
+    <th><?php echo htmlspecialchars( xl('Error'), ENT_NOQUOTES); ?></th>
+       <th>&nbsp;</th>
     </tr>
     
 <?php
-        $sql = "select i1.id ,i1.immunization_id, i1.cvx_code, i1.administered_date, c.code_text_short, c.code".
-                ",i1.manufacturer ,i1.lot_number ".
-                ",ifnull(concat(u.lname,', ',u.fname),'Other') as administered_by ".
-                ",i1.education_date ,i1.note ".
-                " from immunizations i1 ".
-                " left join users u on i1.administered_by_id = u.id ".
-                " left join code_types ct on ct.ct_key = 'CVX' ".
-                " left join codes c on c.code_type = ct.ct_id AND i1.cvx_code = c.code ".
-                " where i1.patient_id = ? ".
-                " order by ";
-        if ($sortby == "vacc") { 
-            $sql .= " c.code_text_short, i1.immunization_id, i1.administered_date DESC"; 
-        }
-        else { $sql .= " administered_date desc"; }
-
-        $result = sqlStatement($sql, array($pid) );
+               $result = getImmunizationList($pid, $_GET['sortby'], true);
+                       
         while($row = sqlFetchArray($result)) {
+                       $isError = $row['added_erroneously'];
+                       
+                       if ($isError) {
+                               $tr_title = 'title="' . xla("Entered in Error") . '"';
+                       } else {
+                               $tr_title = "";
+                       }
+
             if ($row["id"] == $id) {
-                echo "<tr class='immrow text selected' id='".htmlspecialchars( $row["id"], ENT_QUOTES)."'>";
+                echo "<tr " . $tr_title . " class='immrow text selected' id='".htmlspecialchars( $row["id"], ENT_QUOTES)."'>";
             }
             else {
-                echo "<tr class='immrow text' id='".htmlspecialchars( $row["id"], ENT_QUOTES)."'>";
+                echo "<tr " . $tr_title . " class='immrow text' id='".htmlspecialchars( $row["id"], ENT_QUOTES)."'>";
             }
 
             // Figure out which name to use (ie. from cvx list or from the custom list)
@@ -390,17 +446,48 @@ var mypcc = '<?php echo htmlspecialchars( $GLOBALS['phone_country_code'], ENT_QU
                 else {
                     $vaccine_display = generate_display_field(array('data_type'=>'1','list_id'=>'immunizations'), $row['immunization_id']);
                 }
-
             } 
-            echo "<td>" . $vaccine_display . "</td>";
-
-            echo "<td>" . htmlspecialchars( $row["administered_date"], ENT_NOQUOTES) . "</td>";
-            echo "<td>" . htmlspecialchars( $row["manufacturer"], ENT_NOQUOTES) . "</td>";
-            echo "<td>" . htmlspecialchars( $row["lot_number"], ENT_NOQUOTES) . "</td>";
-            echo "<td>" . htmlspecialchars( $row["administered_by"], ENT_NOQUOTES) . "</td>";
-            echo "<td>" . htmlspecialchars( $row["education_date"], ENT_NOQUOTES) . "</td>";
-            echo "<td>" . htmlspecialchars( $row["note"], ENT_NOQUOTES) . "</td>";
-            echo "<td><input type='button' class='delete' id='".htmlspecialchars( $row["id"], ENT_QUOTES)."' value='" . htmlspecialchars( xl('Delete'), ENT_QUOTES) . "'></td>";
+                       
+                       if ($isError) {
+                               $del_tag_open = "<del>";
+                               $del_tag_close = "</del>";
+                       } else {
+                               $del_tag_open = "";
+                               $del_tag_close = "";                            
+                       }                       
+                       
+            echo "<td>" . $del_tag_open . $vaccine_display . $del_tag_close . "</td>";
+                       
+                       if ($row["administered_date"]) {
+                               $administered_date_summary = new DateTime($row['administered_date']);
+                               $administered_date_summary = $administered_date_summary->format('Y-m-d H:i');
+                       } else {
+                               $administered_date_summary = "";
+                       }                       
+                       echo "<td>" . $del_tag_open . htmlspecialchars( $administered_date_summary, ENT_NOQUOTES) . $del_tag_close . "</td>";
+                        if ($row["amount_administered"] > 0) {
+                               echo "<td>" . $del_tag_open . htmlspecialchars( $row["amount_administered"] . " " . generate_display_field(array('data_type'=>'1','list_id'=>'drug_units'), $row['amount_administered_unit']) , ENT_NOQUOTES) . $del_tag_close . "</td>";
+                        }
+                        else {
+                               echo "<td>&nbsp</td>";
+                        }
+            echo "<td>" . $del_tag_open . htmlspecialchars( $row["manufacturer"], ENT_NOQUOTES) . $del_tag_close . "</td>";
+            echo "<td>" . $del_tag_open . htmlspecialchars( $row["lot_number"], ENT_NOQUOTES) . $del_tag_close . "</td>";
+            echo "<td>" . $del_tag_open . htmlspecialchars( $row["administered_by"], ENT_NOQUOTES) . $del_tag_close . "</td>";
+            echo "<td>" . $del_tag_open . htmlspecialchars( $row["education_date"], ENT_NOQUOTES) . $del_tag_close . "</td>";
+                       echo "<td>" . $del_tag_open . generate_display_field(array('data_type'=>'1','list_id'=>'drug_route'), $row['route']) . $del_tag_close . "</td>";                        
+                       echo "<td>" . $del_tag_open . generate_display_field(array('data_type'=>'1','list_id'=>'proc_body_site'), $row['administration_site']) . $del_tag_close . "</td>";
+                       echo "<td>" . $del_tag_open . htmlspecialchars( $row["note"], ENT_NOQUOTES) . $del_tag_close . "</td>";
+                       
+                       if ($isError) {
+                               $checkbox = "checked";
+                       } else {
+                               $checkbox = "";
+                       }
+                       
+            echo "<td><input type='checkbox' class='error' id='".htmlspecialchars( $row["id"], ENT_QUOTES)."' value='" . htmlspecialchars( xl('Error'), ENT_QUOTES) . "' " . $checkbox . "></td>";
+                       
+                       echo "<td><input type='button' class='delete' id='".htmlspecialchars( $row["id"], ENT_QUOTES)."' value='" . htmlspecialchars( xl('Delete'), ENT_QUOTES) . "'></td>";
             echo "</tr>";
         }
 
@@ -413,7 +500,8 @@ var mypcc = '<?php echo htmlspecialchars( $GLOBALS['phone_country_code'], ENT_QU
 
 <script language="javascript">
 /* required for popup calendar */
-Calendar.setup({inputField:"administered_date", ifFormat:"%Y-%m-%d", button:"img_administered_date"});
+Calendar.setup({inputField:"administered_date", ifFormat:"%Y-%m-%d %H:%M", button:"img_administered_date", showsTime:true});
+Calendar.setup({inputField:"immuniz_exp_date", ifFormat:"%Y-%m-%d", button:"img_immuniz_exp_date"});
 Calendar.setup({inputField:"education_date", ifFormat:"%Y-%m-%d", button:"img_education_date"});
 Calendar.setup({inputField:"vis_date", ifFormat:"%Y-%m-%d", button:"img_vis_date"});
 
@@ -435,6 +523,7 @@ $(document).ready(function(){
     $("#print").click(function() { PrintForm("pdf"); });
     $("#printHtml").click(function() { PrintForm("html"); });
     $(".immrow").click(function() { EditImm(this); });
+       $(".error").click(function(event) { ErrorImm(this); event.stopPropagation(); });
     $(".delete").click(function(event) { DeleteImm(this); event.stopPropagation(); });
 
     $(".immrow").mouseover(function() { $(this).toggleClass("highlight"); });
@@ -454,12 +543,7 @@ $(document).ready(function(){
 var PrintForm = function(typ) {
     top.restoreSession();
     newURL='shot_record.php?output='+typ+'&sortby=<?php echo $sortby; ?>';
-    if (typ=="pdf") {
-        location.href=newURL;
-    }
-    else { // typ=html
-        window.open(newURL, '_blank', "menubar=1,toolbar=1,scrollbars=1,resizable=1,width=600,height=450");
-    }  
+       window.open(newURL, '_blank', "menubar=1,toolbar=1,scrollbars=1,resizable=1,width=600,height=450");
 }
 
 var SaveForm = function() {
@@ -479,6 +563,11 @@ var DeleteImm = function(imm) {
     }
 }
 
+var ErrorImm = function(imm) {
+    top.restoreSession();
+       location.href='immunizations.php?mode=added_error&id='+imm.id+'&isError='+imm.checked;
+}
+
 //This is for callback by the find-code popup.
 //Appends to or erases the current list of diagnoses.
 function set_related(codetype, code, selector, codedesc) {
index 74a29bf..2ef9eb2 100644 (file)
@@ -11,6 +11,7 @@ $fake_register_globals=false;
 include_once("../../globals.php");
 include_once("$srcdir/sql.inc");
 include_once("$srcdir/options.inc.php");
+include_once("$srcdir/immunization_helper.php");
 
 //collect facility data
 $res = sqlQuery("select concat(f.name,'\n',f.street,'\n',f.city,', ',f.state,' ',f.postal_code) as facility_address ".
@@ -27,51 +28,102 @@ $res2 = sqlQuery("select concat(p.lname,', ',p.fname,' ',p.mname) patient_name "
                 );
 
 //collect immunizations
-$sqlstmt = "select date_format(i1.administered_date,'%Y-%m-%d') as '" . xl('Date') . "\n" . xl('Administered') . "' ".
-            ",i1.immunization_id as '" . xl('Vaccine') . "' ".
-            ",c.code_text_short as cvx_text ".
-            ",i1.manufacturer as '" . xl('Manufacturer') . "' ".
-            ",i1.lot_number as '" . xl('Lot') . "\n" . xl('Number') . "' ".
-            ",concat(u.lname,', ',u.fname) as '" . xl('Administered By') . "' ".
-            ",date_format(i1.education_date,'%Y-%m-%d') as '" . xl('Patient') . "\n" . xl('Education') . "\n" . xl('Date') . "' ".
-            ",i1.note as '" . xl('Comments') . "'".
-            " from immunizations i1 ".
-            " left join users u on i1.administered_by_id = u.id ".
-            " left join patient_data p on i1.patient_id = p.pid ".
-            " left join code_types ct on ct.ct_key = 'CVX' ".
-            " left join codes c on c.code_type = ct.ct_id AND i1.cvx_code = c.code ".
-            " where p.pid = ? ";
+$res3 = getImmunizationList($pid, $_GET['sortby'], false);
+$data_array = convertToDataArray($res3);
 
-// sort the results, as they are on the user's screen
-$sqlstmt .= " order by ";
-if ($_GET['sortby'] == "vacc") { $sqlstmt .= " i1.immunization_id, i1.administered_date DESC"; }
-else { $sqlstmt .= " i1.administered_date desc"; }
+$title = xl('Shot Record as of:','','',' ') . date('m/d/Y h:i:s a');
 
-$res3 = sqlStatement($sqlstmt, array($pid) );
+if ($_GET['output'] == "html") { 
+       printHTML($res, $res2, $data_array);
+}
+else {
+       printPDF($res, $res2, $data_array);
+}
 
-while ($data[] = sqlFetchArray($res3)) {}
 
-for ($i=0;$i<count($data);$i++) {
-  // Figure out which name to use (ie. from cvx list or from the custom list)
-  if ($GLOBALS['use_custom_immun_list']) {
-   $data[$i][xl('Vaccine')] = generate_display_field(array('data_type'=>'1','list_id'=>'immunizations'), $data[$i][xl('Vaccine')]);
-  }
-  else {
-    if (!(empty($data[$i]['cvx_text']))) {
-      $data[$i][xl('Vaccine')] = htmlspecialchars( xl($data[$i]['cvx_text']), ENT_NOQUOTES);
-    }
-    else {
-      $data[$i][xl('Vaccine')] = generate_display_field(array('data_type'=>'1','list_id'=>'immunizations'), $data[$i][xl('Vaccine')]);
-    }
-  }
-  unset( $data[$i]['cvx_text'] );
-}
+function convertToDataArray($data_array) {     
+       $current = 0;
+       while ($row = sqlFetchArray($data_array)) {
+               //admin date
+               $temp_date = new DateTime($row['administered_date']);
+               $data[$current][xl('Date') . "\n" . xl('Admin')] = $temp_date->format('Y-m-d H:i'); //->format('%Y-%m-%d %H:%i');
 
+               //Vaccine
+        // Figure out which name to use (ie. from cvx list or from the custom list)
+        if ($GLOBALS['use_custom_immun_list']) {
+               $vaccine_display = generate_display_field(array('data_type'=>'1','list_id'=>'immunizations'), $row['immunization_id']);
+        }
+        else {
+            if (!empty($row['code_text_short'])) {
+                   $vaccine_display = htmlspecialchars( xl($row['code_text_short']), ENT_NOQUOTES);
+            }
+            else {
+                $vaccine_display = generate_display_field(array('data_type'=>'1','list_id'=>'immunizations'), $row['immunization_id']);
+            }
+        }              
+               $data[$current][xl('Vaccine')] = $vaccine_display;
+               
+               //Amount
+                if ($row['amount_administered'] > 0) {
+                       $data[$current][xl('Amount') . "\n" . xl('Admin')] = $row['amount_administered'] . " " . 
+                               generate_display_field(array('data_type'=>'1','list_id'=>'drug_units'), $row['amount_administered_unit']);
+                }
+                else {
+                        $data[$current][xl('Amount') . "\n" . xl('Admin')] = "";
+                }
+               
+               //expiration date
+               $temp_date = new DateTime($row['expiration_date']);
+               $data[$current][xl('Expiration') . "\n" . xl('Date')] = $temp_date->format('Y-m-d');
+               
+               //Manufacturer
+               $data[$current][xl('Manufacturer')] = $row['manufacturer'];
+               
+               //Lot Number
+               $data[$current][xl('Lot') . "\n" . xl('Number')] = $row['lot_number'];
 
-$title = xl('Shot Record as of:','','',' ') . date('m/d/Y h:i:s a');
+               //Admin By
+               $data[$current][xl('Admin') . "\n" . xl('By')] = $row['administered_by'];
+               
+               //education date
+               $temp_date = new DateTime($row['education_date']);
+               $data[$current][xl('Patient') . "\n" . xl('Education') . "\n" . xl('Date')] = $temp_date->format('Y-m-d');              
 
+               //Route
+               $data[$current][xl('Route')] = generate_display_field(array('data_type'=>'1','list_id'=>'drug_route'), $row['route']); 
+               
+               //Admin Site
+               $data[$current][xl('Admin') . "\n" . xl('Site')] = generate_display_field(array('data_type'=>'1','list_id'=>'proc_body_site'), $row['administration_site']);
+               
+               //Comments
+               $data[$current][xl('Comments')] = $row['note'];
+               $current ++;
+       }
+       return $data;   
+}
+
+function printPDF($res, $res2, $data) {
+       require_once ($GLOBALS['fileroot'] . "/library/classes/class.ezpdf.php");
+       
+       $pdf =& new Cezpdf("LETTER");
+       $pdf->ezSetMargins(72,30,50,30);
+       $pdf->selectFont($GLOBALS['fileroot'] . "/library/fonts/Helvetica.afm");
+       
+       $opts = array('justification' => "center");
+       $pdf->ezText($res['facility_address'] ,"",$opts);
+       
+       $pdf->ezText("\n" . $res2['patient_name'] . "\n" . xl('Date of Birth') . ": " . $res2['patient_DOB'] . "\n" . $res2['patient_address']);
+       $pdf->ezText("\n");
+       
+       $opts = array('maxWidth' => 550, 'fontSize' => 8);
+       
+       $pdf->ezTable($data, "", $title, $opts);
+       $pdf->ezText("\n\n\n\n" . xl('Signature') . ":________________________________","",array('justification' => 'right'));
+       $pdf->ezStream();
+}
 
-if ($_GET['output'] == "html") { //print html css
+function printHTML($res, $res2, $data) {
+//print html css
     
   //convert end of line characters to html (escape for html output first)
   $patterns = array ('/\n/');
@@ -82,7 +134,7 @@ if ($_GET['output'] == "html") { //print html css
   $res2['patient_address'] = preg_replace($patterns, $replace, $res2['patient_address']);
   
   //deal with bug (last array index is empty)
-  array_pop($data);
+  //array_pop($data);
     
   ?>  
        
@@ -175,6 +227,7 @@ if ($_GET['output'] == "html") { //print html css
     //display header
     echo "<tr>\n";
     foreach ($data[0] as $key => $value) {
+
        //convert end of line characters to space
        $patterns = array ('/\n/');
        $replace = array (' ');
@@ -204,7 +257,6 @@ if ($_GET['output'] == "html") { //print html css
            echo ($value == "") ? "&nbsp;" : htmlspecialchars($value, ENT_NOQUOTES);
          echo "</td>";
        }
-       echo "<tr>\n";
       }
       else {
        //done displaying shot data, so leave loop
@@ -235,31 +287,8 @@ if ($_GET['output'] == "html") { //print html css
   </script>
   </body>
   </html>
-       
   <?php
 }
 
-else { //print pdf
-require_once ($GLOBALS['fileroot'] . "/library/classes/class.ezpdf.php");
-
-$pdf =& new Cezpdf("LETTER");
-$pdf->ezSetMargins(72,30,50,30);
-$pdf->selectFont($GLOBALS['fileroot'] . "/library/fonts/Helvetica.afm");
-
-$opts = array('justification' => "center");
-$pdf->ezText($res['facility_address'] ,"",$opts);
-
-$pdf->ezText("\n" . $res2['patient_name'] . "\n" . xl('Date of Birth') . ": " . $res2['patient_DOB'] . "\n" . $res2['patient_address']);
-$pdf->ezText("\n");
-
-$opts = array('maxWidth' => 504, 'fontSize' => 8);
-
-$pdf->ezTable($data, "", $title, $opts);
-
-$pdf->ezText("\n\n\n\n" . xl('Signature') . ":________________________________","",array('justification' => 'right'));
-
-$pdf->ezStream();
-
-} # end pdf print
 
 ?>
index ba0d0d6..7d89f8f 100644 (file)
@@ -285,6 +285,7 @@ else { ?>
          " left join code_types ct on ct.ct_key = 'CVX' ".
          " left join codes c on c.code_type = ct.ct_id AND i1.cvx_code = c.code ".
          " where i1.patient_id = ? ".
+                " and i1.added_erroneously = 0".
          " order by i1.administered_date desc";
 
   $result = sqlStatement($sql, array($pid) );
index 03f9a7a..91ae892 100644 (file)
@@ -124,7 +124,10 @@ function format_ethnicity($ethnicity) {
   }
   $query .= "i.patient_id=p.pid and ".
   $query_codes .
-  "i.cvx_code = c.code ";
+  "i.cvx_code = c.code and ";
+  
+  //do not show immunization added erroneously
+  $query .=  "i.added_erroneously = 0";
 
 //echo "<p> DEBUG query: $query </p>\n"; // debugging
   
index 145c54b..c2448ce 100644 (file)
@@ -1519,19 +1519,25 @@ function exist_database_item($patient_id,$table,$column='',$data_comp,$data='',$
   // get the appropriate sql comparison operator
   $compSql = convertCompSql($data_comp);
 
+  // custom issues per table can be placed here
+  $customSQL = '';
+  if ($table == 'immunizations') {
+    $customSQL = " AND `added_erroneously` = '0' ";
+  }
+
   // check for items
   if (empty($column)) {
     // simple search for any table entries
     $sql = sqlStatementCdrEngine("SELECT * " .
       "FROM `" . add_escape_custom($table)  . "` " .
-      "WHERE `" . add_escape_custom($patient_id_label)  . "`=?", array($patient_id) );
+      "WHERE `" . add_escape_custom($patient_id_label)  . "`=? " . $customSQL, array($patient_id) );
   }
   else {
     // search for number of specific items
     $sql = sqlStatementCdrEngine("SELECT `" . add_escape_custom($column) . "` " .
       "FROM `" . add_escape_custom($table)  . "` " .
       "WHERE `" . add_escape_custom($column) ."`" . $compSql . "? " .
-      "AND `" . add_escape_custom($patient_id_label)  . "`=? " .
+      "AND `" . add_escape_custom($patient_id_label)  . "`=? " . $customSQL .
       $dateSql, array($data,$patient_id) );
   }
 
diff --git a/library/immunization_helper.php b/library/immunization_helper.php
new file mode 100644 (file)
index 0000000..bfdbde7
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+/**
+ * library/immunization_helper.php Upgrading and patching functions of database.
+ *
+ * Copyright (C) 2013  Jan Jajalla <jansta23@gmail.com>
+ *
+ * LICENSE: This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
+ *
+ * @package OpenEMR
+ * @author  Jan Jajalla <jansta23@gmail.com>
+ * @link    http://www.open-emr.org
+ */
+
+/**
+ * Return listing of immunizations for a patient.
+ *
+ * @param   string    $pid        person id
+ * @param   string    $sortby     sorting field ('vacc' sorts by name, otherwise will sort by date)
+ * @param   boolean   $showError  indicator whether to retrieve the records that were added erroneously
+ * @return  recordset             listing of immunizations for a patient
+ */
+function getImmunizationList($pid,$sortby,$showError) {
+        $sql = "select i1.id ,i1.immunization_id, i1.cvx_code, i1.administered_date, c.code_text_short, c.code".
+                ",i1.manufacturer ,i1.lot_number ".
+                ",ifnull(concat(u.lname,', ',u.fname),'Other') as administered_by ".
+                ",i1.education_date ,i1.note ".
+                ",i1.amount_administered, i1.amount_administered_unit, i1.route, i1.administration_site, i1.added_erroneously".
+                " from immunizations i1 ".
+                " left join users u on i1.administered_by_id = u.id ".
+                " left join code_types ct on ct.ct_key = 'CVX' ".
+                " left join codes c on c.code_type = ct.ct_id AND i1.cvx_code = c.code ".
+                " where i1.patient_id = ? ";
+        if (!$showError) {
+                $sql .= "and i1.added_erroneously = 0 ";
+        }
+
+        $sql .= " order by ";
+        
+        if ($sortby == "vacc") { 
+                $sql .= " c.code_text_short, i1.immunization_id, i1.administered_date DESC"; 
+        }
+        else { 
+                $sql .= " administered_date desc"; 
+        }
+
+        $results = sqlStatement($sql,array($pid));
+        return $results;
+}
+
+?>
index 20677bd..3669851 100644 (file)
@@ -149,7 +149,7 @@ function getImmunizationData() {
     FROM immunizations 
     LEFT JOIN codes ON immunizations.cvx_code = codes.code
     LEFT JOIN code_types ON codes.code_type = code_types.ct_id
-    WHERE immunizations.patient_id = ? AND code_types.ct_key = 'CVX'
+    WHERE immunizations.patient_id = ? AND code_types.ct_key = 'CVX' AND immunizations.added_erroneously = 0
     AND create_date BETWEEN ? AND ?" ;
     $result = sqlStatement($sql, array($pid,$start,$end) );
   }else{
@@ -164,7 +164,7 @@ function getImmunizationData() {
     FROM immunizations 
     LEFT JOIN codes ON immunizations.cvx_code = codes.code
     LEFT JOIN code_types ON codes.code_type = code_types.ct_id
-    WHERE immunizations.patient_id = ? AND code_types.ct_key = 'CVX'";
+    WHERE immunizations.patient_id = ? AND immunizations.added_erroneously = 0 AND code_types.ct_key = 'CVX'";
     $result = sqlStatement($sql, array($pid) );
   }
        return $result;
index 9a88661..c06e8b5 100644 (file)
@@ -406,3 +406,39 @@ INSERT INTO issue_types(`ordering`,`category`,`type`,`plural`,`singular`,`abbrev
 ALTER TABLE `issue_types` ADD COLUMN `active` tinyint(1) NOT NULL DEFAULT '1';
 #EndIf
 
+#IfNotColumnType immunizations administered_date datetime
+ALTER TABLE `immunizations`
+  MODIFY COLUMN administered_date datetime DEFAULT NULL;
+#EndIf
+
+#IfMissingColumn immunizations amount_administered
+ALTER TABLE `immunizations`
+  ADD COLUMN `amount_administered` int(11) DEFAULT NULL;
+#EndIf
+
+
+#IfMissingColumn immunizations amount_administered_unit
+ALTER TABLE `immunizations`
+  ADD COLUMN `amount_administered_unit` varchar(50) DEFAULT NULL;
+#EndIf
+
+#IfMissingColumn immunizations expiration_date
+ALTER TABLE `immunizations`
+  ADD COLUMN `expiration_date` date DEFAULT NULL;
+#EndIf
+
+#IfMissingColumn immunizations route
+ALTER TABLE `immunizations`
+  ADD COLUMN `route` varchar(100) DEFAULT NULL;
+#EndIf
+
+#IfMissingColumn immunizations administration_site
+ALTER TABLE `immunizations`
+  ADD COLUMN `administration_site` varchar(100) DEFAULT NULL;
+#EndIf
+
+#IfMissingColumn immunizations added_erroneously
+ALTER TABLE `immunizations`
+  ADD COLUMN `added_erroneously` tinyint(1) NOT NULL DEFAULT '0';
+#EndIf
+
index 4e3a0ca..a27b78c 100644 (file)
@@ -2222,7 +2222,7 @@ DROP TABLE IF EXISTS `immunizations`;
 CREATE TABLE `immunizations` (
   `id` bigint(20) NOT NULL auto_increment,
   `patient_id` int(11) default NULL,
-  `administered_date` date default NULL,
+  `administered_date` datetime default NULL,
   `immunization_id` int(11) default NULL,
   `cvx_code` int(11) default NULL,
   `manufacturer` varchar(100) default NULL,
@@ -2236,6 +2236,12 @@ CREATE TABLE `immunizations` (
   `update_date` timestamp NOT NULL,
   `created_by` bigint(20) default NULL,
   `updated_by` bigint(20) default NULL,
+  `amount_administered` int(11) DEFAULT NULL,                  
+  `amount_administered_unit` varchar(50) DEFAULT NULL,                 
+  `expiration_date` date DEFAULT NULL,                 
+  `route` varchar(100) DEFAULT NULL,                   
+  `administration_site` varchar(100) DEFAULT NULL,                     
+  `added_erroneously` tinyint(1) NOT NULL DEFAULT '0',  
   PRIMARY KEY  (`id`),
   KEY `patient_id` (`patient_id`)
 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
index 0fb4376..e4cc975 100644 (file)
@@ -17,7 +17,7 @@ $v_realpatch = '0';
 // is a database change in the course of development.  It is used
 // internally to determine when a database upgrade is needed.
 //
-$v_database = 93;
+$v_database = 94;
 
 // Access control version identifier, this is to be incremented whenever there
 // is a access control change in the course of development.  It is used