Esempio n. 1
0
 public function __construct()
 {
     parent::__construct('configuration');
     $this->setAttribute('method', 'post');
     /*
      * Automatic SignOff settings
      */
     $this->add(array('name' => 'hie_auto_sign_off_id', 'attributes' => array('type' => 'text', 'id' => 'hie_auto_sign_off_id'), 'options' => array('label' => \Application\Listener\Listener::z_xlt('Auto Sign-Off [days]'))));
     /*
      * Automatic Tranfer settings
      */
     $this->add(array('type' => 'Zend\\Form\\Element\\Checkbox', 'name' => 'hie_auto_send_id', 'attributes' => array('id' => 'hie_auto_send_id'), 'options' => array('label' => \Application\Listener\Listener::z_xlt('Auto Send'), 'checked_value' => 'yes', 'unchecked_value' => 'no')));
     /*
      * Author settings
      */
     $this->add(array('name' => 'hie_author_id', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('class' => '', 'data-options' => 'required:true', 'editable' => 'false', 'required' => 'required', 'id' => 'hie_author_fname'), 'options' => array('label' => \Application\Listener\Listener::z_xlt('Author'), 'value_options' => $this->getUsers())));
     /*
      * Data Enterer settings
      */
     $this->add(array('name' => 'hie_data_enterer_id', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('class' => '', 'data-options' => 'required:true', 'editable' => 'false', 'required' => 'required', 'id' => 'hie_data_enterer_id'), 'options' => array('label' => \Application\Listener\Listener::z_xlt('Data Enterer'), 'value_options' => $this->getUsers())));
     /*
      * Informant settings
      */
     $this->add(array('name' => 'hie_informant_id', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('class' => '', 'data-options' => 'required:true', 'editable' => 'false', 'required' => 'required', 'id' => 'hie_informant_id'), 'options' => array('label' => \Application\Listener\Listener::z_xlt('Informant'), 'value_options' => $this->getUsers())));
     /*
      * Personal Informant settings
      */
     $this->add(array('name' => 'hie_personal_informant_id', 'attributes' => array('type' => 'text', 'id' => 'hie_personal_informant_id'), 'options' => array('label' => \Application\Listener\Listener::z_xlt('Informant'))));
     /*
      * Custodian settings
      */
     $this->add(array('name' => 'hie_custodian_id', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('class' => '', 'data-options' => 'required:true', 'editable' => 'false', 'required' => 'required', 'id' => 'hie_custodian_id'), 'options' => array('label' => \Application\Listener\Listener::z_xlt('Custodian'), 'value_options' => $this->getUsers())));
     /*
      * Recipient settings
      */
     $this->add(array('name' => 'hie_recipient_id', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('class' => '', 'data-options' => 'required:true', 'editable' => 'false', 'required' => 'required', 'id' => 'hie_recipient_id'), 'options' => array('label' => \Application\Listener\Listener::z_xlt('Recipient'), 'value_options' => $this->getUsers())));
     /*
      * Legal Authenticator settings
      */
     $this->add(array('name' => 'hie_legal_authenticator_id', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('class' => '', 'data-options' => 'required:true', 'editable' => 'false', 'required' => 'required', 'id' => 'hie_legal_authenticator_id'), 'options' => array('label' => \Application\Listener\Listener::z_xlt('Legal Authenticator'), 'value_options' => $this->getUsers())));
     /*
      * Authenticator settings
      */
     $this->add(array('name' => 'hie_authenticator_id', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('class' => '', 'data-options' => 'required:true', 'editable' => 'false', 'required' => 'required', 'id' => 'hie_authenticator_id'), 'options' => array('label' => \Application\Listener\Listener::z_xlt('Authenticator'), 'value_options' => $this->getUsers())));
     /*
      * Primary Care Provider settings
      */
     $this->add(array('name' => 'hie_primary_care_provider_id', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('class' => '', 'data-options' => 'required:true', 'editable' => 'false', 'required' => 'required', 'id' => 'hie_primary_care_provider_id'), 'options' => array('label' => \Application\Listener\Listener::z_xlt('Primary Care Provider'), 'value_options' => $this->getUsers())));
     /*
      * MIRTH IP settings
      */
     $this->add(array('name' => 'hie_mirth_ip', 'attributes' => array('type' => 'text', 'id' => 'hie_mirth_ip'), 'options' => array('label' => \Application\Listener\Listener::z_xlt('Mirth IP'))));
 }
Esempio n. 2
0
 public function __construct($name = null)
 {
     global $pid, $encounter;
     parent::__construct('immunization');
     $this->setAttribute('method', 'post');
     // Codes
     $this->add(array('name' => 'codes', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('multiple' => 'multiple', 'size' => '3', 'class' => 'select', 'style' => 'width:150px', 'editable' => 'false', 'id' => 'codes'), 'options' => array('value_options' => array('' => \Application\Listener\Listener::z_xlt('Unassigned')))));
     $this->add(array('name' => 'from_date', 'type' => 'Zend\\Form\\Element\\Text', 'attributes' => array('id' => 'from_date', 'placeholder' => 'From Date', 'value' => date('Y-m-d', strtotime(date('Ymd')) - 86400 * 7), 'class' => 'date_field', 'style' => 'width: 42%;cursor:not-allowed;')));
     $this->add(array('name' => 'to_date', 'type' => 'Date', 'attributes' => array('id' => 'to_date', 'placeholder' => 'To Date', 'class' => 'date_field', 'value' => date('Y-m-d'), 'style' => 'width: 42%;cursor:not-allowed;', 'type' => 'text', 'onchange' => 'validate_search();')));
     $this->add(array('name' => 'search', 'type' => 'submit', 'attributes' => array('value' => \Application\Listener\Listener::z_xlt('SEARCH'), 'id' => 'search_form_button')));
     $this->add(array('name' => 'print', 'attributes' => array('type' => 'button', 'value' => \Application\Listener\Listener::z_xlt('Print'), 'id' => 'printbutton')));
     $this->add(array('name' => 'hl7button', 'type' => 'submit', 'attributes' => array('value' => \Application\Listener\Listener::z_xlt('GET HL7'), 'id' => 'hl7button', 'onclick' => 'getHl7(this.value);', 'style' => 'display:none;')));
 }
 public function getEncounterHistory($pid, $encounter)
 {
     $wherCon = '';
     if ($encounter) {
         $wherCon = "AND fe.encounter = {$encounter}";
     }
     $results = "";
     $query = "SELECT fe.date, fe.encounter,fe.reason,\n\t    f.id as fid, f.name, f.phone, f.street as fstreet, f.city as fcity, f.state as fstate, f.postal_code as fzip, f.country_code, f.phone as fphone,\n\t    u.fname, u.mname, u.lname, u.npi, u.street, u.city, u.state, u.zip, u.phonew1, cat.pc_catname, lo.title, lo.codes AS physician_type_code,\n\t    SUBSTRING(ll.diagnosis, LENGTH('SNOMED-CT:')+1, LENGTH(ll.diagnosis)) AS encounter_diagnosis, ll.title, ll.begdate, ll.enddate\n\t    FROM form_encounter AS fe\n\t    LEFT JOIN facility AS f ON f.id=fe.facility_id\n\t    LEFT JOIN users AS u ON u.id=fe.provider_id\n\t    LEFT JOIN openemr_postcalendar_categories AS cat ON cat.pc_catid=fe.pc_catid\n\t    LEFT JOIN list_options AS lo ON lo.list_id = ? AND lo.option_id = u.physician_type\n\t    LEFT JOIN issue_encounter AS ie ON ie.encounter=fe.encounter AND ie.pid=fe.pid\n\t    LEFT JOIN lists AS ll ON ll.id=ie.list_id AND ll.pid=fe.pid\n\t    WHERE fe.pid = ? {$wherCon} ORDER BY fe.date";
     $appTable = new ApplicationTable();
     $res = $appTable->zQuery($query, array('physician_type', $pid));
     $results = "<encounter_list>";
     foreach ($res as $row) {
         $encounter_reason = '';
         if ($row['reason'] != '') {
             $encounter_reason = "<encounter_reason>" . htmlspecialchars($this->date_format(substr($row['date'], 0, 10)) . " - " . $row['reason'], ENT_QUOTES) . "</encounter_reason>";
         }
         $codes = "";
         $query_procedures = "SELECT c.code, c.code_text FROM billing AS b\n\t\t\t    JOIN code_types AS ct ON ct.ct_key = ?\n\t\t\t    JOIN codes AS c ON c.code = b.code AND c.code_type = ct.ct_id\n\t\t\t    WHERE b.pid = ? AND b.code_type = ? AND activity = 1 AND b.encounter = ?";
         $appTable_procedures = new ApplicationTable();
         $res_procedures = $appTable_procedures->zQuery($query_procedures, array('CPT4', $pid, 'CPT4', $row['encounter']));
         foreach ($res_procedures as $row_procedures) {
             $codes .= "\n\t\t<procedures>\n\t\t    <code>" . htmlspecialchars($row_procedures['code'], ENT_QUOTES) . "</code>\n\t\t    <text>" . htmlspecialchars($row_procedures['code_text'], ENT_QUOTES) . "</text>\n\t\t</procedures>\n\t\t";
         }
         if ($row['encounter_diagnosis']) {
             $encounter_activity = '';
             if ($row['enddate'] != '') {
                 $encounter_activity = 'Completed';
             } else {
                 $encounter_activity = 'Active';
             }
             $codes .= "\n\t\t<procedures>\n\t\t    <code>" . htmlspecialchars($row['encounter_diagnosis'], ENT_QUOTES) . "</code>\n\t\t    <text>" . htmlspecialchars(\Application\Listener\Listener::z_xlt($row['title']), ENT_QUOTES) . "</text>\n\t\t    <status>" . htmlspecialchars($encounter_activity, ENT_QUOTES) . "</status>\n\t\t</procedures>\n\t\t";
         }
         $location_details = $row['name'] != '' ? ',' . $row['fstreet'] . ',' . $row['fcity'] . ',' . $row['fstate'] . ' ' . $row['fzip'] : '';
         $results .= "\n\t    <encounter>\n\t\t<extension>" . htmlspecialchars(base64_encode($_SESSION['site_id'] . $row['encounter']), ENT_QUOTES) . "</extension>\n\t\t<sha_extension>" . htmlspecialchars(sha1($_SESSION['site_id'] . $row['encounter']), ENT_QUOTES) . "</sha_extension>\n\t\t<encounter_id>" . htmlspecialchars($row['encounter'], ENT_QUOTES) . "</encounter_id>\n\t\t<visit_category>" . htmlspecialchars($row['pc_catname'], ENT_QUOTES) . "</visit_category>\n\t\t<performer>" . htmlspecialchars($row['fname'] . " " . $row['mname'] . " " . $row['lname'], ENT_QUOTES) . "</performer>\n\t\t<physician_type_code>" . htmlspecialchars($row['physician_type_code'], ENT_QUOTES) . "</physician_type_code>\n\t\t<physician_type>" . htmlspecialchars($row['title'], ENT_QUOTES) . "</physician_type>\n\t\t<npi>" . htmlspecialchars($row['npi'], ENT_QUOTES) . "</npi>\n\t\t<fname>" . htmlspecialchars($row['fname'], ENT_QUOTES) . "</fname>\n\t\t<mname>" . htmlspecialchars($row['mname'], ENT_QUOTES) . "</mname>\n\t\t<lname>" . htmlspecialchars($row['lname'], ENT_QUOTES) . "</lname>\n\t\t<street>" . htmlspecialchars($row['street'], ENT_QUOTES) . "</street>\n\t\t<city>" . htmlspecialchars($row['city'], ENT_QUOTES) . "</city>\n\t\t<state>" . htmlspecialchars($row['state'], ENT_QUOTES) . "</state>\n\t\t<zip>" . htmlspecialchars($row['zip'], ENT_QUOTES) . "</zip>\n\t\t<work_phone>" . htmlspecialchars($row['phonew1'], ENT_QUOTES) . "</work_phone>\n\t\t<location>" . htmlspecialchars($row['name'], ENT_QUOTES) . "</location>\n    <location_details>" . htmlspecialchars($location_details, ENT_QUOTES) . "</location_details>\n\t\t<date>" . htmlspecialchars($this->date_format(substr($row['date'], 0, 10)), ENT_QUOTES) . "</date>\n\t\t<date_formatted>" . htmlspecialchars(preg_replace('/-/', '', substr($row['date'], 0, 10)), ENT_QUOTES) . "</date_formatted>\t\t\n\t\t<facility_extension>" . htmlspecialchars(base64_encode($_SESSION['site_id'] . $row['fid']), ENT_QUOTES) . "</facility_extension>\n\t\t<facility_sha_extension>" . htmlspecialchars(sha1($_SESSION['site_id'] . $row['fid']), ENT_QUOTES) . "</facility_sha_extension>\n\t\t<facility_name>" . htmlspecialchars($row['name'], ENT_QUOTES) . "</facility_name>\n\t\t<facility_address>" . htmlspecialchars($row['fstreet'], ENT_QUOTES) . "</facility_address>\n\t\t<facility_city>" . htmlspecialchars($row['fcity'], ENT_QUOTES) . "</facility_city>\n\t\t<facility_state>" . htmlspecialchars($row['fstate'], ENT_QUOTES) . "</facility_state>\n\t\t<facility_country>" . htmlspecialchars($row['country_code'], ENT_QUOTES) . "</facility_country>\n\t\t<facility_zip>" . htmlspecialchars($row['fzip'], ENT_QUOTES) . "</facility_zip>\n\t\t<facility_phone>" . htmlspecialchars($row['fphone'], ENT_QUOTES) . "</facility_phone>\n\t\t<encounter_procedures>{$codes}</encounter_procedures>\n                {$encounter_reason}\n\t    </encounter>";
     }
     $results .= "</encounter_list>";
     return $results;
 }
 public function getEachCCDAComponentDetailsAction()
 {
     $request = $this->getRequest();
     $id = $request->getQuery('id');
     $component = $request->getQuery('component');
     $amid = $request->getQuery('amid');
     $temp = '';
     switch ($component) {
         case 'allergies':
             $allergies_audit = $this->getCarecoordinationTable()->createAuditArray($amid, 'lists2');
             if (count($allergies_audit) > 0) {
                 $temp .= '<div><table class="narr_table" border="1" width="100%!important;">
                                      <thead><tr class="narr_tr">
                                             <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Substance') . '</th>
                                             <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Reaction') . '</th>
                                             <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Severity') . '</th>
                                             <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Status') . '</th>
                                         </tr></thead>
                                      <tbody>';
                 foreach ($allergies_audit['lists2'] as $key => $val) {
                     $severity_option_id = $this->getCarecoordinationTable()->getOptionId('severity_ccda', '', 'SNOMED-CT:' . $val['severity_al']);
                     $severity_text = $this->getCarecoordinationTable()->getListTitle($severity_option_id, 'severity_ccda', 'SNOMED-CT:' . $val['severity_al']);
                     if ($val['enddate'] != 0 && $val['enddate'] != '') {
                         $status = 'completed';
                     } else {
                         $status = 'active';
                     }
                     $temp .= '<tr class="narr_tr">
                                                 <td>' . \Application\Plugin\CommonPlugin::escape($val['list_code_text']) . '</td>
                                                 <td>' . \Application\Listener\Listener::z_xlt($val['reaction_text']) . '</td>
                                                 <td>' . \Application\Listener\Listener::z_xlt($severity_text) . '</td>
                                                 <td>' . \Application\Listener\Listener::z_xlt($status) . '</td>
                                                </tr>';
                 }
                 $temp .= '</tbody></table></div>';
             } else {
                 $temp .= \Application\Listener\Listener::z_xlt('No Known Allergies');
             }
             break;
         case 'medications':
             $medications_audit = $this->getCarecoordinationTable()->createAuditArray($amid, 'lists3');
             if (count($medications_audit) > 0) {
                 $temp .= '<div><table class="narr_table" border="1" width="100%">
                                         <thead><tr class="narr_tr">
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Medication') . '</th>
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Directions') . '</th>
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Start Date') . '</th>
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Status') . '</th>
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Indications') . '</th>
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Fill Instructions') . '</th>
                                             </tr></thead>
                                         <tbody>';
                 foreach ($medications_audit['lists3'] as $key => $val) {
                     if ($val['enddate'] && $val['enddate'] != 0) {
                         $active = 'completed';
                     } else {
                         $active = 'active';
                     }
                     $temp .= '<tr class="narr_tr">
                                                     <td>' . \Application\Plugin\CommonPlugin::escape($val['drug_text']) . '</td>
                                                     <td>' . \Application\Plugin\CommonPlugin::escape($val['rate'] . " " . $val['rate_unit'] . " " . $val['route_display'] . " " . $val['dose'] . " " . $val['dose_unit']) . '</td>
                                                     <td>' . \Application\Model\ApplicationTable::fixDate(substr($val['begdate'], 0, 4) . "-" . substr($val['begdate'], 4, 2) . "-" . substr($val['begdate'], 6, 2), $this->date_format, 'yyyy-mm-dd') . '</td>
                                                     <td>' . \Application\Listener\Listener::z_xlt($active) . '</td>
                                                     <td>' . \Application\Plugin\CommonPlugin::escape($val['indication']) . '</td>
                                                     <td>' . \Application\Plugin\CommonPlugin::escape($val['note']) . '</td>
                                                 </tr>';
                 }
                 $temp .= '</tbody></table></div>';
             } else {
                 $temp .= \Application\Listener\Listener::z_xlt('No Known Medications');
             }
             break;
         case 'problems':
             $problems_audit = $this->getCarecoordinationTable()->createAuditArray($amid, 'lists1');
             if (count($problems_audit) > 0) {
                 $temp .= '<div><ul>';
                 $i = 1;
                 foreach ($problems_audit['lists1'] as $key => $val) {
                     if ($val['enddate'] != 0 && $val['enddate'] != '') {
                         $status = 'Resolved';
                     } else {
                         $status = 'Active';
                     }
                     $temp .= '<li>' . $i . '. ' . \Application\Plugin\CommonPlugin::escape($val['list_code_text']) . ',' . substr($val['begdate'], 0, 4) . "-" . substr($val['begdate'], 4, 2) . "-" . substr($val['begdate'], 6, 2) . ', ' . \Application\Listener\Listener::z_xlt('Status') . ' :' . \Application\Listener\Listener::z_xlt($status) . '</li>';
                     $i++;
                 }
                 $temp .= '</ul></div>';
             } else {
                 $temp .= \Application\Listener\Listener::z_xlt('No Known Problems');
             }
             break;
         case 'immunizations':
             $immunizations_audit = $this->getCarecoordinationTable()->createAuditArray($amid, 'immunization');
             if (count($immunizations_audit) > 0) {
                 $temp .= '<div><table class="narr_table" border="1" width="100%">
                                         <thead><tr class="narr_tr">
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Vaccine') . '</th>
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Date') . '</th>
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Status') . '</th>
                                             </tr></thead>
                                         <tbody>';
                 foreach ($immunizations_audit['immunization'] as $key => $val) {
                     $temp .= '<tr class="narr_tr">
                                             <td>' . \Application\Plugin\CommonPlugin::escape($val['cvx_code_text']) . '</td>
                                             <td>' . $this->getCarecoordinationTable()->getMonthString(substr($val['administered_date'], 4, 2)) . ' ' . substr($val['administered_date'], 0, 4) . '</td>
                                             <td>' . \Application\Listener\Listener::z_xlt('Completed') . '</td>
                                         </tr>';
                 }
                 $temp .= '</tbody></table></div>';
             } else {
                 $temp .= \Application\Listener\Listener::z_xlt('No Known Immunizations');
             }
             break;
         case 'procedures':
             $procedure_audit = $this->getCarecoordinationTable()->createAuditArray($amid, 'procedure');
             if (count($procedure_audit) > 0) {
                 $temp .= '<div><table class="narr_table" border="1" width="100%">
                                         <thead><tr class="narr_tr">
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Procedure') . '</th>
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Date') . '</th>
                                             </tr></thead>
                                         <tbody>';
                 foreach ($procedure_audit['procedure'] as $key => $val) {
                     $temp .= '<tr class="narr_tr">
                                             <td>' . \Application\Plugin\CommonPlugin::escape($val['code_text']) . '</td>
                                             <td>' . \Application\Model\ApplicationTable::fixDate(substr($val['date'], 0, 4) . "-" . substr($val['date'], 4, 2) . "-" . substr($val['date'], 6, 2), $this->date_format, 'yyyy-mm-dd') . '</td>
                                         </tr>';
                 }
                 $temp .= '</tbody></table></div>';
             } else {
                 $temp .= \Application\Listener\Listener::z_xlt('No Known Procedures');
             }
             break;
         case 'results':
             $lab_results_audit = $this->getCarecoordinationTable()->createAuditArray($amid, 'procedure_result');
             if (count($lab_results_audit) > 0) {
                 $temp .= '<div>
                                         <table class="narr_table" border="1">
                                             <thead><tr class="narr_tr">
                                                     <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Laboratory Information') . '</th>
                                                     <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Result') . '</th>
                                                     <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Date') . '</th>
                                                 </tr></thead>
                                             <tbody>';
                 foreach ($lab_results_audit['procedure_result'] as $key => $val) {
                     if ($val['results_text']) {
                         $temp .= '<tr class="narr_tr">
                                             <td>' . \Application\Plugin\CommonPlugin::escape($val['results_text']) . ($val['results_range'] != "-" ? "(" . \Application\Plugin\CommonPlugin::escape($val['results_range']) . ")" : "") . '</td>
                                             <td>' . \Application\Plugin\CommonPlugin::escape($val['results_value']) . " " . \Application\Plugin\CommonPlugin::escape($val['results_unit']) . '</td>
                                             <td>' . \Application\Model\ApplicationTable::fixDate(substr($val['date'], 0, 4) . "-" . substr($val['date'], 4, 2) . "-" . substr($val['date'], 6, 2), $this->date_format, 'yyyy-mm-dd') . '</td>
                                          </tr>';
                     }
                 }
                 $temp .= '</tbody></table></div>';
             } else {
                 $temp .= \Application\Listener\Listener::z_xlt('No Known Lab Results');
             }
             break;
         case 'plan_of_care':
             $care_plan_audit = $this->getCarecoordinationTable()->createAuditArray($amid, 'care_plan');
             if (count($care_plan_audit) > 0) {
                 $temp .= '<div><table class="narr_table" border="1" width="100%">
                                         <head><tr class="narr_tr">
                                         <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Planned Activity') . '</th>
                                         <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Planned Date') . '</th>
                                         </tr></thead>
                                         <tbody>';
                 foreach ($care_plan_audit['care_plan'] as $key => $val) {
                     $temp .= '<tr class="narr_tr">
                                         <td>' . \Application\Plugin\CommonPlugin::escape($val['code_text']) . '</td>
                                         <td>' . \Application\Model\ApplicationTable::fixDate(substr($val['date'], 0, 4) . "-" . substr($val['date'], 4, 2) . "-" . substr($val['date'], 6, 2), $this->date_format, 'yyyy-mm-dd') . '</td>
                                         </tr>';
                 }
                 $temp .= '</tbody></table></div>';
             } else {
                 $temp .= \Application\Listener\Listener::z_xlt('No Known Plan of Care');
             }
             break;
         case 'vitals':
             $vitals_audit = $this->getCarecoordinationTable()->createAuditArray($amid, 'vital_sign');
             if (count($vitals_audit) > 0) {
                 $temp .= '<div><table class="narr_table" border="1" width="100%">
                                      <thead><tr class="narr_tr">
                                      <th class="narr_th" align="right">' . \Application\Listener\Listener::z_xlt('Date / Time') . ': </th>';
                 foreach ($vitals_audit['vital_sign'] as $key => $val) {
                     $temp .= '<th class="narr_th">' . \Application\Model\ApplicationTable::fixDate(substr($val['date'], 0, 4) . "-" . substr($val['date'], 4, 2) . "-" . substr($val['date'], 6, 2), $this->date_format, 'yyyy-mm-dd') . '</th>';
                 }
                 $temp .= '</tr></thead><tbody>
                                      <tr class="narr_tr">
                                         <th class="narr_th" align="left">' . \Application\Listener\Listener::z_xlt('Temperature') . '</th>';
                 foreach ($vitals_audit['vital_sign'] as $key => $val) {
                     $temp .= '<td>' . \Application\Plugin\CommonPlugin::escape($val['temperature']) . '</td>';
                 }
                 $temp .= '</tr>
                                      <tr class="narr_tr">
                                         <th class="narr_th" align="left">' . \Application\Listener\Listener::z_xlt('Diastolic') . '</th>';
                 foreach ($vitals_audit['vital_sign'] as $key => $val) {
                     $temp .= '<td>' . \Application\Plugin\CommonPlugin::escape($val['bpd']) . '</td>';
                 }
                 $temp .= '</tr>
                                      <tr class="narr_tr">
                                         <th class="narr_th" align="left">' . \Application\Listener\Listener::z_xlt('Systolic') . '</th>';
                 foreach ($vitals_audit['vital_sign'] as $key => $val) {
                     $temp .= '<td>' . \Application\Plugin\CommonPlugin::escape($val['bps']) . '</td>';
                 }
                 $temp .= '</tr>
                                      <tr class="narr_tr">
                                         <th class="narr_th" align="left">' . \Application\Listener\Listener::z_xlt('Head Circumference') . '</th>';
                 foreach ($vitals_audit['vital_sign'] as $key => $val) {
                     $temp .= '<td>' . \Application\Plugin\CommonPlugin::escape($val['head_circ']) . '</td>';
                 }
                 $temp .= '</tr>
                                      <tr class="narr_tr">
                                         <th class="narr_th" align="left">' . \Application\Listener\Listener::z_xlt('Pulse') . '</th>';
                 foreach ($vitals_audit['vital_sign'] as $key => $val) {
                     $temp .= '<td>' . \Application\Plugin\CommonPlugin::escape($val['pulse']) . '</td>';
                 }
                 $temp .= '</tr>
                                      <tr class="narr_tr">
                                         <th class="narr_th" align="left">' . \Application\Listener\Listener::z_xlt('Height') . '</th>';
                 foreach ($vitals_audit['vital_sign'] as $key => $val) {
                     $temp .= '<td>' . \Application\Plugin\CommonPlugin::escape($val['height']) . '</td>';
                 }
                 $temp .= '</tr>
                                      <tr class="narr_tr">
                                         <th class="narr_th" align="left">' . \Application\Listener\Listener::z_xlt('Oxygen Saturation') . '</th>';
                 foreach ($vitals_audit['vital_sign'] as $key => $val) {
                     $temp .= '<td>' . \Application\Plugin\CommonPlugin::escape($val['oxygen_saturation']) . '</td>';
                 }
                 $temp .= '</tr>
                                      <tr class="narr_tr">
                                         <th class="narr_th" align="left">' . \Application\Listener\Listener::z_xlt('Breath') . '</th>';
                 foreach ($vitals_audit['vital_sign'] as $key => $val) {
                     $temp .= '<td>' . \Application\Plugin\CommonPlugin::escape($val['breath']) . '</td>';
                 }
                 $temp .= '</tr>
                                      <tr class="narr_tr">
                                         <th class="narr_th" align="left">' . \Application\Listener\Listener::z_xlt('Weight') . '</th>';
                 foreach ($vitals_audit['vital_sign'] as $key => $val) {
                     $temp .= '<td>' . \Application\Plugin\CommonPlugin::escape($val['weight']) . '</td>';
                 }
                 $temp .= '</tr>
                                      <tr class="narr_tr">
                                         <th class="narr_th" align="left">' . \Application\Listener\Listener::z_xlt('BMI') . '</th>';
                 foreach ($vitals_audit['vital_sign'] as $key => $val) {
                     $temp .= '<td>' . \Application\Plugin\CommonPlugin::escape($val['BMI']) . '</td>';
                 }
                 $temp .= '</tr></tbody></table></div>';
             } else {
                 $temp .= \Application\Listener\Listener::z_xlt('No Known Vitals');
             }
             break;
         case 'social_history':
             $social_history_audit = $this->getCarecoordinationTable()->createAuditArray($amid, 'social_history');
             if (count($social_history_audit) > 0) {
                 $temp .= '<div><table class="narr_table" border="1" width="100%">
                                         <thead><tr class="narr_tr">
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Social History Element') . '</th>
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Description') . '</th>
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Effective Dates') . '</th>
                                             </tr></thead>
                                         <tbody>';
                 foreach ($social_history_audit['social_history'] as $key => $val) {
                     $array_his_tobacco = explode("|", $val['smoking']);
                     if ($array_his_tobacco[2] != 0 && $array_his_tobacco[2] != '') {
                         $his_tob_date = substr($array_his_tobacco[2], 0, 4) . "-" . substr($array_his_tobacco[2], 4, 2) . "-" . substr($array_his_tobacco[2], 6, 2);
                     }
                     $temp .= '<tr class="narr_tr">
                                             <td>' . \Application\Listener\Listener::z_xlt('Smoking') . '</td>
                                             <td>' . \Application\Plugin\CommonPlugin::escape($array_his_tobacco[0]) . '</td>
                                             <td>' . \Application\Model\ApplicationTable::fixDate($his_tob_date, $this->date_format, 'yyyy-mm-dd') . '</td>
                                         </tr>';
                 }
                 $temp .= '</tbody></table></div>';
             } else {
                 $temp .= \Application\Listener\Listener::z_xlt('No Known Social History');
             }
             break;
         case 'encounters':
             $encounter_audit = $this->getCarecoordinationTable()->createAuditArray($amid, 'encounter');
             if (count($encounter_audit) > 0) {
                 $temp .= '<div><table class="narr_table" border="1" width="100%">
                                         <thead><tr class="narr_tr">
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Encounter') . '</th>
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Performer') . '</th>
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Location') . '</th>
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Date') . '</th>
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Encounter Diagnosis') . '</th>
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Status') . '</th>
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Reason for Visit') . '</th>
                                             </tr></thead>
                                         <tbody>';
                 foreach ($encounter_audit['encounter'] as $key => $val) {
                     if ($val['code_text'] != 'NULL') {
                         $encounter_activity = 'Active';
                     } else {
                         $encounter_activity = '';
                     }
                     $enc_date = substr($val['date'], 0, 4) . "-" . substr($val['date'], 4, 2) . "-" . substr($val['date'], 6, 2);
                     $temp .= '<tr class="narr_tr">                                    
                                             <td>' . \Application\Plugin\CommonPlugin::escape($val['pc_catname']) . '</td>
                                             <td>' . \Application\Plugin\CommonPlugin::escape($val['provider_name']) . '</td>
                                             <td>' . \Application\Plugin\CommonPlugin::escape($val['represented_organization_name']) . '</td>
                                             <td>' . \Application\Model\ApplicationTable::fixDate($enc_date, $this->date_format, 'yyyy-mm-dd') . '</td>
                                             <td>' . ($val['code_text'] != 'NULL' ? \Application\Plugin\CommonPlugin::escape($val['code_text']) : '') . '</td>
                                             <td>' . \Application\Listener\Listener::z_xlt($encounter_activity) . '</td>
                                             <td></td>
                                         </tr>';
                 }
                 $temp .= '</tbody></table></div>';
             } else {
                 $temp .= \Application\Listener\Listener::z_xlt('No Known Encounters');
             }
             break;
         case 'functional_status':
             $functional_cognitive_status_audit = $this->getCarecoordinationTable()->createAuditArray($amid, 'functional_cognitive_status');
             if (count($functional_cognitive_status_audit) > 0) {
                 $temp .= '<div><table class="narr_table" border="1" width="100%">
                                         <thead><tr class="narr_tr">
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Functional Condition') . '</th>
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Effective Dates') . '</th>
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Condition Status') . '</th>
                                             </tr></thead>
                                         <tbody>';
                 foreach ($functional_cognitive_status_audit['functional_cognitive_status'] as $key => $val) {
                     $temp .= '<tr class="narr_tr">
                                             <td>' . \Application\Plugin\CommonPlugin::escape($val['description']) . '</td>
                                             <td>' . \Application\Model\ApplicationTable::fixDate(substr($val['date'], 0, 4) . "-" . substr($val['date'], 4, 2) . "-" . substr($val['date'], 6, 2), $this->date_format, 'yyyy-mm-dd') . '</td>
                                             <td>' . \Application\Listener\Listener::z_xlt('Active') . '</td>
                                         </tr>';
                 }
                 $temp .= '</tbody></table></div>';
             } else {
                 $temp .= \Application\Listener\Listener::z_xlt('No Known Social Functional Status');
             }
             break;
         case 'referral':
             $referral_audit = $this->getCarecoordinationTable()->createAuditArray($amid, 'referral');
             if (count($referral_audit) > 0) {
                 $temp .= '<div>';
                 foreach ($referral_audit['referral'] as $key => $val) {
                     $referal_data = explode("#\$%^&*", $val['body']);
                     foreach ($referal_data as $k => $v) {
                         $temp .= '<p>' . \Application\Plugin\CommonPlugin::escape($v) . '</p>';
                     }
                 }
                 $temp .= '</div>';
             } else {
                 $temp .= \Application\Listener\Listener::z_xlt('No Known Referrals');
             }
             break;
         case 'instructions':
             $temp .= \Application\Listener\Listener::z_xlt('No Known Clinical Instructions');
             break;
         case 'discharge_medication':
             $discharge_medication_audit = $this->getCarecoordinationTable()->createAuditArray($amid, 'discharge_medication');
             $temp .= '<div><table class="narr_table" border="1" width="100%">
                                         <thead><tr class="narr_tr">
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Medication') . '</th>
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Directions') . '</th>
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Start Date') . '</th>
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Status') . '</th>
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Indications') . '</th>
                                                 <th class="narr_th">' . \Application\Listener\Listener::z_xlt('Fill Instructions') . '</th>
                                             </tr></thead>
                                         <tbody>';
             foreach ($discharge_medication_audit['discharge_medication'] as $key => $val) {
                 if ($val['enddate'] && $val['enddate'] != 0) {
                     $active = 'completed';
                 } else {
                     $active = 'active';
                 }
                 $temp .= '<tr class="narr_tr">
                                                     <td>' . \Application\Plugin\CommonPlugin::escape($val['drug_text']) . '</td>
                                                     <td>' . \Application\Plugin\CommonPlugin::escape($val['rate'] . " " . $val['rate_unit'] . " " . $val['route_display'] . " " . $val['dose'] . " " . $val['dose_unit']) . '</td>
                                                     <td>' . \Application\Model\ApplicationTable::fixDate(substr($val['begdate'], 0, 4) . "-" . substr($val['begdate'], 4, 2) . "-" . substr($val['begdate'], 6, 2), $this->date_format, 'yyyy-mm-dd') . '</td>
                                                     <td>' . \Application\Listener\Listener::z_xlt($active) . '</td>
                                                     <td>' . \Application\Plugin\CommonPlugin::escape($val['indication']) . '</td>
                                                     <td>' . \Application\Plugin\CommonPlugin::escape($val['note']) . '</td>
                                                 </tr>';
             }
             $temp .= '</tbody></table></div>';
             break;
         case 'discharge_summary':
             $discharge_summary_audit = $this->getCarecoordinationTable()->createAuditArray($amid, 'discharge_summary');
             $temp .= '<div>';
             foreach ($discharge_summary_audit['discharge_summary'] as $key => $val) {
                 $text = str_replace("#\$%", "<br>", \Application\Plugin\CommonPlugin::escape($val['text']));
                 $temp .= $text;
             }
             $temp .= '</div>';
             break;
     }
     echo $temp;
     exit;
 }
Esempio n. 5
0
 public function checkDependencyOnDisable($mod_id)
 {
     $retArray = array();
     $depFlag = "0";
     $modArray = $this->getInstalledModules();
     //GET MODULE DIRECTORY OF DISABLING MODULE
     $modDirectory = $this->getModuleDirectory($mod_id);
     $usedModArr = array();
     if (count($modArray) > 0) {
         //LOOP THROUGH INSTALLED MODULES
         foreach ($modArray as $module) {
             if ($module->modId != "") {
                 //GET MODULE DEPENDED MODULES
                 $InstalledmodDirectory = $this->getModuleDirectory($module->modId);
                 $depModArr = $this->getDependencyModulesDir($module->modId);
                 if (count($depModArr) > 0) {
                     //LOOP THROUGH DEPENDENCY MODULES
                     //CHECK IF THE DISABLING MODULE IS BEING DEPENDED BY OTHER INSTALLED MODULES
                     foreach ($depModArr as $depModule) {
                         if ($modDirectory == $depModule) {
                             $depFlag = "1";
                             $usedModArr[] = $InstalledmodDirectory;
                         }
                     }
                 }
             }
         }
     }
     if ($depFlag == "0") {
         $retArray['status'] = "success";
         $retArray['code'] = "1";
         $retArray['value'] = "";
     } else {
         $usedModArr = array_unique($usedModArr);
         $multiple = "module";
         if (count($usedModArr) > 1) {
             $multiple = "modules";
         }
         $usedModules = implode(",", $usedModArr);
         $retArray['status'] = "failure";
         $retArray['code'] = "200";
         $retArray['value'] = \Application\Listener\Listener::z_xlt("Dependency Problem") . ': ' . \Application\Listener\Listener::z_xlt("This module is being used by ") . $usedModules . " " . \Application\Listener\Listener::z_xlt($multiple);
     }
     return $retArray;
 }