Example #1
0
 public function getEncounterDx($params)
 {
     $record = $this->edx->load($params)->one();
     if ($record !== false) {
         $code = $this->diagnosis->getICDDataByCode($record['code'], $record['code_type']);
         if (is_array($code)) {
             $record = array_merge($record, $code);
         }
     }
     return $record;
 }
Example #2
0
 /**
  * @param stdClass $params
  * @return array
  */
 public function addPatientImmunization($params)
 {
     $immunization = $this->i->save($params);
     // add service
     if ($immunization !== false && isset($params->eid) && $params->eid > 0) {
         $service = new stdClass();
         $service->pid = $params->pid;
         $service->eid = $params->eid;
         $service->uid = $params->uid;
         $service->code = $this->immunizations->getCptByCvx($params->code);
         $dx_pointers = array();
         foreach ($this->diagnosis->getICDByEid($params->eid, true) as $dx) {
             $dx_children[] = $dx;
             $dx_pointers[] = $dx['code'];
         }
         $service->dx_pointers = implode(',', $dx_pointers);
         $this->services->addCptCode($service);
     }
     return $immunization;
 }
Example #3
0
 /**
  * @param $eid
  * @return array
  *  Naming: "closePatientEncounter"
  */
 public function getProgressNoteByEid($eid)
 {
     $this->db->setSQL("SELECT * FROM encounters WHERE eid = '{$eid}'");
     $encounter = $this->db->fetchRecord(PDO::FETCH_ASSOC);
     $encounter['service_date'] = date('F j, Y, g:i a', strtotime($encounter['service_date']));
     $encounter['patient_name'] = $this->patient->getPatientFullNameByPid($encounter['pid']);
     $encounter['open_by'] = $this->user->getUserNameById($encounter['open_uid']);
     $encounter['signed_by'] = $this->user->getUserNameById($encounter['provider_uid']);
     /**
      * Add vitals to progress note
      */
     $vitals = $this->getVitalsByEid($eid);
     if (count($vitals)) {
         $encounter['vitals'] = $vitals;
     }
     /**
      * Add Review of Systems to progress note
      */
     $ros = $this->getReviewOfSystemsByEid($eid);
     $foo = array();
     foreach ($ros as $key => $value) {
         if ($key != 'id' && $key != 'pid' && $key != 'eid' && $key != 'uid' && $key != 'date') {
             if ($value != null && $value != 'null') {
                 $value = $value == 1 || $value == '1' ? 'Yes' : 'No';
                 $foo[] = array('name' => $key, 'value' => $value);
             }
         }
     }
     if (!empty($foo)) {
         $encounter['reviewofsystems'] = $foo;
     }
     /**
      * Add Review of Systems Checks to progress note
      */
     $rosck = $this->getReviewOfSystemsChecksByEid($eid);
     $foo = array();
     foreach ($rosck[0] as $key => $value) {
         if ($key != 'id' && $key != 'pid' && $key != 'eid' && $key != 'uid' && $key != 'date') {
             if ($value != null && $value != 'null' && $value != '0' || $value != 0) {
                 $value = $value == 1 || $value == '1' ? 'Yes' : 'No';
                 $foo[] = array('name' => $key, 'value' => $value);
             }
         }
     }
     if (!empty($foo)) {
         $encounter['reviewofsystemschecks'] = $foo;
     }
     /**
      * Add SOAP to progress note
      */
     $icdxs = '';
     foreach ($this->diagnosis->getICDByEid($eid) as $code) {
         $icdxs .= '<li><span style="font-weight:bold; text-decoration:none">' . $code['code'] . '</span> - ' . $code['long_desc'] . '</li>';
     }
     //$icdxs = substr($icdxs, 0, -2);
     $soap = $this->getSoapByEid($eid);
     $soap['objective'] .= $this->getObjectiveExtraDataByEid($eid);
     $soap['assessment'] = $soap['assessment'] . '<ul  class="ProgressNote-ul">' . $icdxs . '</ul>';
     $encounter['soap'] = $soap;
     /**
      * Add Dictation to progress note
      */
     $speech = $this->getDictationByEid($eid);
     if ($speech['dictation']) {
         $encounter['speechdictation'] = $speech;
     }
     /**
      * return the encounter array of data
      */
     return $encounter;
 }