public function getPatientDocuments(stdClass $params) { $this->setDocumentModel(); $docs = $this->d->load($params)->all(); if (isset($docs['data'])) { foreach ($docs['data'] as $index => $row) { $docs['data'][$index]['user_name'] = $this->user->getUserNameById($row['uid']); } } return $docs; }
/** * @param stdClass $params * @return stdClass */ public function updateVitals($params) { $record = $this->v->save($params); if (is_array($params)) { foreach ($record as $i => $rec) { $record[$i] = $rec = (object) $rec; if (isset($rec->uid)) { $record[$i]->administer_by = $rec->uid != 0 ? $this->User->getUserNameById($rec->uid) : ''; } if (isset($rec->auth_uid)) { $record[$i]->authorized_by = $rec->auth_uid != 0 ? $this->User->getUserNameById($rec->auth_uid) : ''; } } } else { $record = (object) $record; if (isset($record->uid)) { $record->administer_by = $record->uid != 0 ? $this->User->getUserNameById($record->uid) : ''; } if (isset($record->auth_uid)) { $record->authorized_by = $record->auth_uid != 0 ? $this->User->getUserNameById($record->auth_uid) : ''; } } return $record; }
public function getPatientDocuments(stdClass $params) { $records = array(); if (isset($params->eid)) { $this->db->setSQL("SELECT * FROM patient_documents WHERE eid = '{$params->eid}'"); foreach ($this->db->fetchRecords(PDO::FETCH_ASSOC) as $row) { $row['user_name'] = $this->user->getUserNameById($row['uid']); $records[] = $row; } } elseif (isset($params->pid)) { $this->db->setSQL("SELECT * FROM patient_documents WHERE pid = '{$params->pid}'"); foreach ($this->db->fetchRecords(PDO::FETCH_ASSOC) as $row) { $row['user_name'] = $this->user->getUserNameById($row['uid']); $records[] = $row; } } return $records; }
/** * @param $eid * @return array * Naming: "closePatientEncounter" */ public function getProgressNoteByEid($eid) { $record = $this->getEncounter($eid, true, false); unset($filters); $encounter = (array) $record['encounter']; $user = new User(); $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'] = $user->getUserNameById($encounter['open_uid']); $encounter['signed_by'] = $user->getUserNameById($encounter['provider_uid']); unset($user); /** * Add vitals to progress note */ if ($_SESSION['globals']['enable_encounter_vitals']) { if (count($encounter['vitals']) == 0) { unset($encounter['vitals']); } } /** * Add Review of Systems to progress note */ if ($_SESSION['globals']['enable_encounter_review_of_systems']) { $foo = []; foreach ($encounter['reviewofsystems'] 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[] = ['name' => $key, 'value' => $value]; } } } if (!empty($foo)) { $encounter['reviewofsystems'] = $foo; } } /** * Add SOAP to progress note */ if ($_SESSION['globals']['enable_encounter_soap']) { $dxCodes = $this->diagnosis->getICDByEid($eid, true); if (count($dxCodes) > 0) { $dxOl = ''; $dxGroups = []; foreach ($dxCodes as $dxCode) { $dxGroups[$dxCode['dx_group']][] = $dxCode; } foreach ($dxGroups as $dxGroup) { $dxOl .= '<p>Dx Group ' . $dxGroup[0]['dx_group'] . '</p>'; $dxOl .= '<ol class="ProgressNote-ol">'; foreach ($dxGroup as $dxCode) { $dxOl .= '<li><span style="font-weight:bold; text-decoration:none">' . $dxCode['code'] . '</span> - ' . $dxCode['long_desc'] . '</li>'; } $dxOl .= '</ol>'; } } $soap = $this->getSoapByEid($eid); $soap['assessment'] = isset($soap['assessment']) ? $soap['assessment'] : ''; $soap['objective'] = (isset($soap['objective']) ? $soap['objective'] : '') . $this->getObjectiveExtraDataByEid($eid); $soap['assessment'] = $soap['assessment'] . (isset($dxOl) ? $dxOl : ''); $encounter['soap'] = $soap; } /** * Add Dictation to progress note */ if ($_SESSION['globals']['enable_encounter_dictation']) { $speech = $this->getDictationByEid($eid); if ($speech['dictation']) { $encounter['speechdictation'] = $speech; } } return $encounter; }
echo ' <table class="w3-table w3-bordered w3-striped w3-border w3-card-2" > <thead> <tr> <th>Commentaire</th> <th>| Operation</th> </tr> </thead> <tbody style="color:#000;">'; while ($data = $dataComent->fetch()) { ?> <!-- partie dynamique --> <?php #get the user name $user = new User(); $username = $user->getUserNameById($data['code_user']); $usercomment = $data["text_com"]; echo ' <tr > <td> <div class="container"> <strong><spane class="glyphicon glyphicon-user"></spane> ' . $username . ': </strong> ' . $usercomment . ' </div> </td> <td> <a href="../../actions/commentaire/deleteCommentaire?code=' . $data['code_com'] . '&&id=' . $dataArticle['code_article'] . '" class="btn-sm btn-danger">Supprimer</a> </td> </tr> '; ?> <?php
/** * @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; }