private function getObjectiveExtraDataByEid($eid) { $ExtraData = ''; $Medications = new Medications(); $medications = $Medications->getPatientMedicationsByEid($eid); if (!empty($medications)) { $lis = ''; foreach ($medications as $foo) { $lis .= '<li>' . $foo['STR'] . '</li>'; } $ExtraData .= '<p>Medications:</p>'; $ExtraData .= '<ul class="ProgressNote-ul">' . $lis . '</ul>'; } unset($Medications); $Immunizations = new Immunizations(); $immunizations = $Immunizations->getImmunizationsByEncounterID($eid); if (!empty($immunizations)) { $lis = ''; foreach ($immunizations as $foo) { $lis .= '<li>Vaccine name: ' . $foo['vaccine_name'] . '<br>'; $lis .= 'Vaccine ID: (' . $foo['code_type'] . ')' . $foo['code'] . '<br>'; $lis .= 'Manufacturer: ' . $foo['manufacturer'] . '<br>'; $lis .= 'Lot Number: ' . $foo['lot_number'] . '<br>'; $lis .= 'Dose: ' . $foo['administer_amount'] . ' ' . $foo['administer_units'] . '<br>'; $lis .= 'Administered By: ' . $foo['administered_by'] . ' </li>'; } $ExtraData .= '<p>Immunizations:</p>'; $ExtraData .= '<ul class="ProgressNote-ul">' . $lis . '</ul>'; } unset($Immunizations); $Allergies = new Allergies(); $allergies = $Allergies->getPatientAllergiesByEid($eid); if (!empty($allergies)) { $lis = ''; foreach ($allergies as $foo) { $lis .= '<li>Allergy: ' . $foo['allergy'] . ' (' . $foo['allergy_type'] . ')<br>'; $lis .= 'Reaction: ' . $foo['reaction'] . '<br>'; $lis .= 'Severity: ' . $foo['severity'] . '<br>'; $lis .= 'Location: ' . $foo['location'] . '<br>'; $lis .= 'Active?: ' . ($foo['end_date'] != null ? 'Yes' : 'No') . '</li>'; } $ExtraData .= '<p>Allergies:</p>'; $ExtraData .= '<ul class="ProgressNote-ul">' . $lis . '</ul>'; } unset($Allergies); /** * Active Problems found in this Encounter */ $ActiveProblems = new ActiveProblems(); $activeProblems = $ActiveProblems->getPatientActiveProblemByEid($eid); if (!empty($activeProblems)) { $lis = ''; foreach ($activeProblems as $foo) { $lis .= '<li>[' . $foo['code'] . '] - ' . $foo['code_text'] . ' </li>'; } $ExtraData .= '<p>Active Problems:</p>'; $ExtraData .= '<ul class="ProgressNote-ul">' . $lis . '</ul>'; } unset($ActiveProblems); return $ExtraData; }
public function get_EncounterTokensData($eid, $allNeededInfo, $tokens) { $params = new stdClass(); $params->eid = $eid; $encounter = $this->encounter->getEncounter($params); if (!isset($encounter['encounter'])) { return $allNeededInfo; } $encounterCodes = $this->encounter->getEncounterCodes($params); $vitals = end($encounter['encounter']['vitals']); $soap = $encounter['encounter']['soap']; if (isset($encounter['encounter']['reviewofsystemschecks'])) { $rosCks = $encounter['encounter']['reviewofsystemschecks']; unset($rosCks['id'], $rosCks['pid'], $rosCks['eid'], $rosCks['uid'], $rosCks['date']); foreach ($rosCks as $rosc => $num) { if ($num == '' || $num == null || $num == 0) { unset($rosCks[$rosc]); } } } if (isset($encounter['encounter']['reviewofsystems'])) { $reviewofsystems = $encounter['encounter']['reviewofsystems']; unset($reviewofsystems['pid'], $reviewofsystems['eid'], $reviewofsystems['uid'], $reviewofsystems['id'], $reviewofsystems['date']); foreach ($reviewofsystems as $ros => $num) { if ($num == '' || $num == null || $num == 'null') { unset($reviewofsystems[$ros]); } } } $cpt = []; $dx = []; $hcpc = []; $cvx = []; if (isset($encounterCodes['rows'])) { foreach ($encounterCodes['rows'] as $code) { if ($code['code_type'] == 'CPT') { $cpt[] = $code; } elseif ($code['code_type'] == 'ICD' || $code['code_type'] == 'ICD9' || $code['code_type'] == 'ICD10') { $dx[] = $code; } elseif ($code['code_type'] == 'HCPC') { $hcpc[] = $code; } elseif ($code['code_type'] == 'CVX') { $cvx[] = $code; } } } $Medications = new Medications(); $medications = $Medications->getPatientMedicationsByEid($eid); unset($Medications); $Immunizations = new Immunizations(); $immunizations = $Immunizations->getImmunizationsByEid($eid); unset($Immunizations); $Allergies = new Allergies(); $allergies = $Allergies->getPatientAllergiesByEid($eid); unset($Allergies); $ActiveProblems = new ActiveProblems(); $activeProblems = $ActiveProblems->getPatientActiveProblemByEid($eid); unset($ActiveProblems); $encounter = $encounter['encounter']; $encounterInformation = ['[ENCOUNTER_START_DATE]' => $encounter['service_date'], '[ENCOUNTER_END_DATE]' => $encounter['close_date'], '[ENCOUNTER_BRIEF_DESCRIPTION]' => $encounter['brief_description'], '[ENCOUNTER_SENSITIVITY]' => $encounter['priority'], '[ENCOUNTER_WEIGHT_LBS]' => $vitals['weight_lbs'], '[ENCOUNTER_WEIGHT_KG]' => $vitals['weight_kg'], '[ENCOUNTER_HEIGHT_IN]' => $vitals['height_in'], '[ENCOUNTER_HEIGHT_CM]' => $vitals['height_cm'], '[ENCOUNTER_BP_SYSTOLIC]' => $vitals['bp_systolic'], '[ENCOUNTER_BP_DIASTOLIC]' => $vitals['bp_diastolic'], '[ENCOUNTER_PULSE]' => $vitals['pulse'], '[ENCOUNTER_RESPIRATION]' => $vitals['respiration'], '[ENCOUNTER_TEMP_FAHRENHEIT]' => $vitals['temp_f'], '[ENCOUNTER_TEMP_CELSIUS]' => $vitals['temp_c'], '[ENCOUNTER_TEMP_LOCATION]' => $vitals['temp_location'], '[ENCOUNTER_OXYGEN_SATURATION]' => $vitals['oxygen_saturation'], '[ENCOUNTER_HEAD_CIRCUMFERENCE_IN]' => $vitals['head_circumference_in'], '[ENCOUNTER_HEAD_CIRCUMFERENCE_CM]' => $vitals['head_circumference_cm'], '[ENCOUNTER_WAIST_CIRCUMFERENCE_IN]' => $vitals['waist_circumference_in'], '[ENCOUNTER_WAIST_CIRCUMFERENCE_CM]' => $vitals['waist_circumference_cm'], '[ENCOUNTER_BMI]' => $vitals['bmi'], '[ENCOUNTER_BMI_STATUS]' => $vitals['bmi_status'], '[ENCOUNTER_SUBJECTIVE]' => isset($soap['subjective']) ? $soap['subjective'] : '', '[ENCOUNTER_OBJECTIVE]' => isset($soap['objective']) ? $soap['objective'] : '', '[ENCOUNTER_ASSESSMENT]' => isset($soap['assessment']) ? $soap['assessment'] : '', '[ENCOUNTER_PLAN]' => isset($soap['plan']) ? $soap['plan'] : '', '[ENCOUNTER_CPT_CODES]' => $this->tokensForEncountersList($cpt, 1), '[ENCOUNTER_ICD_CODES]' => $this->tokensForEncountersList($dx, 2), '[ENCOUNTER_HCPC_CODES]' => $this->tokensForEncountersList($hcpc, 3), '[ENCOUNTER_ALLERGIES_LIST]' => $this->tokensForEncountersList($allergies, 4), '[ENCOUNTER_MEDICATIONS_LIST]' => $this->tokensForEncountersList($medications, 5), '[ENCOUNTER_ACTIVE_PROBLEMS_LIST]' => $this->tokensForEncountersList($activeProblems, 6), '[ENCOUNTER_IMMUNIZATIONS_LIST]' => $this->tokensForEncountersList($immunizations, 7), '[ENCOUNTER_REVIEWOFSYSTEMSCHECKS]' => isset($rosCks) ? $this->tokensForEncountersList($rosCks, 11) : '', '[ENCOUNTER_REVIEWOFSYSTEMS]' => isset($reviewofsystems) ? $this->tokensForEncountersList($reviewofsystems, 12) : '']; foreach ($tokens as $i => $tok) { if (isset($encounterInformation[$tok]) && ($allNeededInfo[$i] == '' || $allNeededInfo[$i] == null)) { $allNeededInfo[$i] = $encounterInformation[$tok]; } } return $allNeededInfo; }