public function getPersona(Procedure &$pro, int $personaid) { $p = Persona::persistence(); $persona = $pro->declare_var('per', new RowType($p)); $pro->select($p->id, $p->nombre, $p->apellido)->from($p)->where(c($p->id = $personaid))->into($persona); return $persona; }
/** * The Procedure for the logping function * * @param Menu $backMenu The Menu for return * * @return void */ function logPingProcedure(Menu $backMenu) { $procedure = new Procedure(); $choice = "0"; $procedure->showReturnChoice($choice); $qt_hostname = $procedure->createQuestion("Hostname [default localhost]: ", "localhost"); $hostname = $procedure->askQuestion($qt_hostname); if ($hostname === $choice) { $procedure->clearScreen(); $procedure->showMenu($backMenu, true); exit; } $qt_dir = $procedure->createQuestion("File directory [default /var/log/ping]: ", "/var/log/ping"); $dir = $procedure->askQuestion($qt_dir); $qt_output = $procedure->createQuestion("Output file [default {$hostname}.log]: ", "{$hostname}.log"); $output = $procedure->askQuestion($qt_output); echo "\n"; logPing($hostname, $output, $dir); }
public function actionComplications($id) { if (!Procedure::model()->findByPk($id)) { throw new Exception("Unknown procedure: {$id}"); } $complications = array(); foreach (Yii::app()->db->createCommand()->select("b.name")->from("complication b")->join("procedure_complication pb", "pb.complication_id = b.id")->where("pb.proc_id = {$id} and b.active = 1")->order("b.name asc")->queryAll() as $row) { $complications[] = $row['name']; } echo json_encode($complications); }
private function getSource() { $owner = $this->getTableOwner(); $objectName = $this->getTableName(); $remote = true; switch ($this->sourceType) { case "FUNCTION": $sourceObject = new DBFunction($this->dbConnection, $objectName, "{$objectName}@{$owner}", $remote); $sourceObject->getObjectSql(); break; case "PROCEDURE": $sourceObject = new Procedure($this->dbConnection, $objectName, "{$objectName}@{$owner}", $remote); $sourceObject->getObjectSql(); break; case "PACKAGE": $sourceObject = new Package($this->dbConnection, $objectName, "{$objectName}@{$owner}", $remote); $sourceObject->getPackageSql(); break; } $this->sourceObject = $sourceObject; }
/** * The Procedure for the rotatebinlogs function * * @param Menu $backMenu The Menu for return * * @return void */ function rotateBinlogsProcedure(Menu $backMenu) { $procedure = new Procedure(); $choice = "0"; $procedure->showReturnChoice($choice); $qt_userAdminDB = $procedure->createQuestion("MySQL username: "******"MySQL user password: "******"BinLogs directory [default /var/log/mysql]: ", "/var/log/mysql"); $binLogsDir = $procedure->askQuestion($qt_binLogsDir); $qt_binLogIndexFilename = $procedure->createQuestion("BinLog index filename [default log-bin.index]: ", "log-bin.index"); $binLogIndexFilename = $procedure->askQuestion($qt_binLogIndexFilename); $qt_backupDir = $procedure->createQuestion("Backup directory [default /mbbackup/binlogs]: ", "/mbbackup/binlogs"); $backupDir = $procedure->askQuestion($qt_backupDir); echo "\n"; rotateBinlogs($userAdminDB, $passAdminDB, $binLogsDir, $binLogIndexFilename, $backupDir); }
/** * The Procedure for the tuning-primer Shell script * * @param Menu $backMenu The Menu for return * * @return void */ function tuningPrimerProcedure(Menu $backMenu) { $procedure = new Procedure(); echo "Select a mode:\n\n"; echo "[1] All (perform all checks) [default]\n"; echo "[2] Prompt (prompt for login credintials and socket and execution mode)\n"; echo "[3] Memory (run checks for tunable options which effect memory usage)\n"; echo "[4] Disk, file (run checks for options which effect i/o performance or file handle limits)\n"; echo "[5] InnoDB (run InnoDB checks)\n"; echo "[6] Misc (run checks for that don't categorise" . " well Slow Queries, Binary logs, Used Connections and Worker Threads)\n"; echo "[7] Banner (show banner info)\n"; echo "-------------------------------------------------------------------------------\n"; $choice = "0"; $procedure->showReturnChoice($choice); $qt_mode = $procedure->createQuestion("\nSelected mode: "); $mode = $procedure->askQuestion($qt_mode); switch ($mode) { case "1": $mode = "all"; break; case "2": $mode = "prompt"; break; case "3": $mode = "memory"; break; case "4": $mode = "file"; break; case "5": $mode = "innodb"; break; case "6": $mode = "misc"; break; case "7": $mode = "banner"; break; case "": $mode = "all"; break; case $choice: $procedure->clearScreen(); $procedure->showMenu($backMenu, true); default: $procedure->clearScreen(); cecho("Incorrect input", "red"); echo "\n"; setupProcedure($backMenu); } echo "\n"; echo shell_exec("sh " . dirname(__FILE__) . "/tuning-primer.sh " . $mode) . "\n"; }
/** * The Procedure for the loguptime function * * @param Menu $backMenu The Menu for return * * @return void */ function logUptimeProcedure(Menu $backMenu) { $procedure = new Procedure(); $choice = "0"; $procedure->showReturnChoice($choice); $qt_hostname = $procedure->createQuestion("Hostname [default localhost]: ", "localhost"); $hostname = $procedure->askQuestion($qt_hostname); if ($hostname === $choice) { $procedure->clearScreen(); $procedure->showMenu($backMenu, true); exit; } $qt_file = $procedure->createQuestion("File (target for log) [default /var/log/uptime.log]: ", "/var/log/uptime.log"); $file = $procedure->askQuestion($qt_file); echo "\n"; logUptime($file, $hostname); }
/** * The Procedure for the genMasterKey function * * @param Menu $backMenu The Menu for return * * @return void */ function genMasterKeyProcedure($backMenu) { $procedure = new Procedure(); $choice = "0"; $procedure->showReturnChoice($choice); $qt_dirKey = $procedure->createQuestion("\nEnter the directory to create in a recursively way (ie /var/.mediboard/): "); $dirKey = $procedure->askQuestion($qt_dirKey); if ($dirKey === $choice) { $procedure->clearScreen(); $procedure->showMenu($backMenu, true); exit; } $qt_apacheGrp = $procedure->createQuestion("\nApache user's group [default www-data]: ", "www-data"); $apacheGrp = $procedure->askQuestion($qt_apacheGrp); echo "\n"; genMasterKey($dirKey, $apacheGrp); }
/** * Get any relevant warnings. * * @return array */ public function getProcessWarnings() { $warnings = array(); $el_diag = $this->getElement('Element_OphCoTherapyapplication_Therapydiagnosis'); $sides = array(); if ($el_diag->hasLeft()) { $sides[] = 'left'; } if ($el_diag->hasRight()) { $sides[] = 'right'; } if ($api = Yii::app()->moduleAPI->get('OphCiExamination')) { $missing_sides = array(); foreach ($sides as $side) { if (!$api->getInjectionManagementComplexInEpisodeForDisorder($this->event->episode->patient, $this->event->episode, $side, $el_diag->{$side . '_diagnosis1_id'}, $el_diag->{$side . '_diagnosis2_id'})) { $missing_sides[] = $side; } } foreach ($missing_sides as $missing) { $warnings[] = 'No Injection Management has been created for ' . $missing . ' diagnosis.'; } // if the application doesn't have a given side, the VA value can be NR (e.g. eye missing etc) // but if it does, then we need an actual VA value. if (!$api->getLetterVisualAcuityForEpisodeLeft($this->event->episode, !$el_diag->hasLeft(), $this->event->event_date)) { $warnings[] = 'Visual acuity not found for left eye.'; } if (!$api->getLetterVisualAcuityForEpisodeRight($this->event->episode, !$el_diag->hasRight(), $this->event->event_date)) { $warnings[] = 'Visual acuity not found for right eye.'; } } if ($api = Yii::app()->moduleAPI->get('OphTrConsent')) { $procedures = Procedure::model()->findAll(array('condition' => 'snomed_code = :snomed or snomed_code = :snomed2 ', 'params' => array(':snomed' => $this::SNOMED_INTRAVITREAL_INJECTION, ':snomed2' => $this::SNOMED_PDT))); foreach ($sides as $side) { $sideHasConsent = false; foreach ($procedures as $procedure) { if ($api->hasConsentForProcedure($this->event->episode, $procedure, $side)) { $sideHasConsent = true; break; } } if (!$sideHasConsent) { $warnings[] = 'Consent form is required for ' . $side . ' eye.'; } } } return $warnings; }
public static function getProcedure($object, ReflectionMethod $method) { $procedure = new Procedure($method->getName()); $args = $method->getParameters(); $list = array(&$procedure); foreach ($args as $key => $arg) { if ($key > 0) { $type = $arg->getClass(); array_push($list, $type->newInstanceArgs(array($arg->getName()))); $typ = constant($type->name); $procedure->args(array('name' => $arg->getName(), 'type' => $typ, 'default' => $arg->isOptional() ? $arg->getDefaultValue() : null)); } } $return = $method->invokeArgs($object, $list); if (!$return instanceof Query) { $returns = $procedure->findType($return); $procedure->returns($returns); if ($returns instanceof RowType) { $return = new RowVal($return); } } $procedure->return_val($return); return $procedure; }
/** * The Procedure for the request function * * @param Menu $backMenu The Menu for return * * @return void */ function requestProcedure(Menu $backMenu) { $procedure = new Procedure(); $choice = "0"; $procedure->showReturnChoice($choice); $qt_rootURL = $procedure->createQuestion("Root URL (ie https://localhost/mediboard): "); $rootURL = $procedure->askQuestion($qt_rootURL); if ($rootURL === $choice) { $procedure->clearScreen(); $procedure->showMenu($backMenu, true); exit; } $qt_username = $procedure->createQuestion("Username (ie cron): "); $username = $procedure->askQuestion($qt_username); $password = prompt_silent(); $qt_params = $procedure->createQuestion("Params (ie m=dPpatients&tab=vw_medecins): "); $params = $procedure->askQuestion($qt_params); $qt_times = $procedure->createQuestion("Times (number of repetitions) [default 1]: ", 1); $times = $procedure->askQuestion($qt_times); $qt_delay = $procedure->createQuestion("Delay (time between each repetition) [default 1]: ", 1); $delay = $procedure->askQuestion($qt_delay); $qt_file = $procedure->createQuestion("File (file for the output, ie log.txt) [default no file]: "); $file = $procedure->askQuestion($qt_file); echo "\n"; request($rootURL, $username, $password, $params, $times, $delay, $file); }
/** * The Procedure for the update function * * @param Menu $backMenu The Menu for return * * @return void */ function updateProcedure(Menu $backMenu) { $procedure = new Procedure(); echo "Action to perform:\n\n"; echo "[1] Show the update log\n"; echo "[2] Perform the actual update\n"; echo "--------------------------------\n"; $choice = "0"; $procedure->showReturnChoice($choice); $qt_action = $procedure->createQuestion("\nSelected action: "); $action = $procedure->askQuestion($qt_action); switch ($action) { case "1": $action = "info"; break; case "2": $action = "real"; break; case $choice: $procedure->clearScreen(); $procedure->showMenu($backMenu, true); default: $procedure->clearScreen(); cecho("Incorrect input", "red"); echo "\n"; setupProcedure($backMenu); } $qt_revision = $procedure->createQuestion("\nRevision number [default HEAD]: ", "HEAD"); $revision = $procedure->askQuestion($qt_revision); echo "\n"; update($action, $revision); }
public function description() { $description = 'Operations'; if ($this->surgeon_id) { $description .= ' by ' . User::model()->find($this->surgeon_id)->fullName; } $description .= ' between ' . date('j M Y', strtotime($this->date_from)) . ' and ' . date('j M Y', strtotime($this->date_to)); if (!empty($this->Procedures_procs)) { $description .= "\nwith procedures: "; foreach ($this->Procedures_procs as $i => $proc_id) { if ($i) { $description .= ', '; } $description .= Procedure::model()->findByPk($proc_id)->term; } } if (!empty($this->complications)) { $description .= "\nwith cataract complications: "; foreach ($this->complications as $i => $complication_id) { if ($i) { $description .= ', '; } $description .= OphTrOperationnote_CataractComplications::model()->findByPk($complication_id)->name; } } return $description; }
/** * @param Element_OphTrOperationnote_ProcedureList $element * @param $data * @param $index */ protected function setComplexAttributes_Element_OphTrOperationnote_ProcedureList($element, $data, $index) { $procs = array(); if (isset($data['Procedures_procs'])) { foreach ($data['Procedures_procs'] as $proc_id) { $procs[] = Procedure::model()->findByPk($proc_id); } } $element->procedures = $procs; }
/** * The Procedure for the setup function * * @param Menu $backMenu The Menu for return * * @return void */ function setupProcedure(Menu $backMenu) { $procedure = new Procedure(); $choice = "0"; $procedure->showReturnChoice($choice); echo "Select an optional sub directory [default none]:\n\n"; echo "[1] modules\n"; echo "[2] style\n"; echo "[3] No sub directory\n"; $qt_subDir = $procedure->createQuestion("\nSelected sub directory: "); $subDir = $procedure->askQuestion($qt_subDir); switch ($subDir) { case "1": $subDir = "modules"; break; case "2": $subDir = "style"; break; case $choice: $procedure->clearScreen(); $procedure->showMenu($backMenu, true); exit; } $qt_apacheGrp = $procedure->createQuestion("\nApache user's group [optional]: "); $apacheGrp = $procedure->askQuestion($qt_apacheGrp); echo "\n"; setup($subDir, $apacheGrp); }
/** * Deletes rows for the model. */ public function actionDelete() { $admin = new Admin(Procedure::model(), $this); $admin->deleteModel(); }
/** * @return array */ protected function cataractProcedures() { $cataractProcedures = array(); $cataractElement = \ElementType::model()->findByAttributes(array('name' => 'Cataract')); if ($cataractElement) { $procedure = new \Procedure(); $cataractProcedures = $procedure->getProceduresByOpNote($cataractElement['id']); } return $cataractProcedures; }
protected function encounters_view($eid, $pid, $practice_id, $modal = false, $addendum = false) { $encounterInfo = Encounters::find($eid); $data['patientInfo'] = Demographics::find($pid); $data['eid'] = $eid; $data['encounter_DOS'] = date('F jS, Y; h:i A', $this->human_to_unix($encounterInfo->encounter_DOS)); $data['encounter_provider'] = $encounterInfo->encounter_provider; $data['date_signed'] = date('F jS, Y; h:i A', $this->human_to_unix($encounterInfo->date_signed)); $data['age1'] = $encounterInfo->encounter_age; $data['dob'] = date('F jS, Y', $this->human_to_unix($data['patientInfo']->DOB)); $data['age'] = $this->current_age($pid); if ($data['patientInfo']->sex == 'm') { $data['gender'] = 'Male'; } if ($data['patientInfo']->sex == 'f') { $data['gender'] = 'Female'; } if ($data['patientInfo']->sex == 'u') { $data['gender'] = 'Undifferentiated'; } $data['encounter_cc'] = nl2br($encounterInfo->encounter_cc); $practiceInfo = Practiceinfo::find($practice_id); $hpiInfo = Hpi::find($eid); if ($hpiInfo) { if (!is_null($hpiInfo->hpi) && $hpiInfo->hpi != '') { $data['hpi'] = '<br><h4>History of Present Illness:</h4><p class="view">'; $data['hpi'] .= nl2br($hpiInfo->hpi); $data['hpi'] .= '</p>'; } if (!is_null($hpiInfo->situation) && $hpiInfo->situation != '') { $data['hpi'] = '<br><h4>Situation:</h4><p class="view">'; $data['hpi'] .= nl2br($hpiInfo->situation); $data['hpi'] .= '</p>'; } } else { $data['hpi'] = ''; } $rosInfo = Ros::find($eid); if ($rosInfo) { $data['ros'] = '<br><h4>Review of Systems:</h4><p class="view">'; if ($rosInfo->ros_gen != '') { $data['ros'] .= '<strong>General: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_gen); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_eye != '') { $data['ros'] .= '<strong>Eye: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_eye); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_ent != '') { $data['ros'] .= '<strong>Ears, Nose, Throat: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_ent); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_resp != '') { $data['ros'] .= '<strong>Respiratory: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_resp); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_cv != '') { $data['ros'] .= '<strong>Cardiovascular: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_cv); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_gi != '') { $data['ros'] .= '<strong>Gastrointestinal: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_gi); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_gu != '') { $data['ros'] .= '<strong>Genitourinary: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_gu); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_mus != '') { $data['ros'] .= '<strong>Musculoskeletal: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_mus); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_neuro != '') { $data['ros'] .= '<strong>Neurological: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_neuro); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_psych != '') { $data['ros'] .= '<strong>Psychological: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_psych); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_heme != '') { $data['ros'] .= '<strong>Hematological, Lymphatic: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_heme); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_endocrine != '') { $data['ros'] .= '<strong>Endocrine: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_endocrine); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_skin != '') { $data['ros'] .= '<strong>Skin: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_skin); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_wcc != '') { $data['ros'] .= '<strong>Well Child Check: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_wcc); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_psych1 != '') { $data['ros'] .= '<strong>Depression: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_psych1); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_psych2 != '') { $data['ros'] .= '<strong>Anxiety: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_psych2); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_psych3 != '') { $data['ros'] .= '<strong>Bipolar: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_psych3); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_psych4 != '') { $data['ros'] .= '<strong>Mood Disorders: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_psych4); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_psych5 != '') { $data['ros'] .= '<strong>ADHD: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_psych5); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_psych6 != '') { $data['ros'] .= '<strong>PTSD: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_psych6); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_psych7 != '') { $data['ros'] .= '<strong>Substance Related Disorder: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_psych7); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_psych8 != '') { $data['ros'] .= '<strong>Obsessive Compulsive Disorder: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_psych8); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_psych9 != '') { $data['ros'] .= '<strong>Social Anxiety Disorder: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_psych9); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_psych10 != '') { $data['ros'] .= '<strong>Autistic Disorder: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_psych10); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_psych11 != '') { $data['ros'] .= "<strong>Asperger's Disorder: </strong>"; $data['ros'] .= nl2br($rosInfo->ros_psych11); $data['ros'] .= '<br /><br />'; } $data['ros'] .= '</p>'; } else { $data['ros'] = ''; } $ohInfo = DB::table('other_history')->where('eid', '=', $eid)->first(); if ($ohInfo) { $data['oh'] = '<br><h4>Other Pertinent History:</h4><p class="view">'; if ($ohInfo->oh_pmh != '') { $data['oh'] .= '<strong>Past Medical History: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_pmh); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_psh != '') { $data['oh'] .= '<strong>Past Surgical History: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_psh); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_fh != '') { $data['oh'] .= '<strong>Family History: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_fh); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_sh != '') { $data['oh'] .= '<strong>Social History: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_sh); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_etoh != '') { $data['oh'] .= '<strong>Alcohol Use: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_etoh); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_tobacco != '') { $data['oh'] .= '<strong>Tobacco Use: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_tobacco); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_drugs != '') { $data['oh'] .= '<strong>Illicit Drug Use: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_drugs); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_employment != '') { $data['oh'] .= '<strong>Employment: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_employment); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_psychosocial != '') { $data['oh'] .= '<strong>Psychosocial: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_psychosocial); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_developmental != '') { $data['oh'] .= '<strong>Developmental: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_developmental); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_medtrials != '') { $data['oh'] .= '<strong>Past Medication Trials: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_medtrials); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_meds != '') { $data['oh'] .= '<strong>Medications: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_meds); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_supplements != '') { $data['oh'] .= '<strong>Supplements: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_supplements); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_allergies != '') { $data['oh'] .= '<strong>Allergies: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_allergies); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_results != '') { $data['oh'] .= '<strong>Reviewed Results: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_results); $data['oh'] .= '<br /><br />'; } $data['oh'] .= '</p>'; } else { $data['oh'] = ''; } $vitalsInfo1 = Vitals::where('eid', '=', $eid)->get(); if (count($vitalsInfo1) > 0) { foreach ($vitalsInfo1 as $vitalsInfo) { $data['vitals'] = '<br><h4>Vital Signs:</h4><p class="view">'; $data['vitals'] .= '<strong>Date/Time:</strong>'; $data['vitals'] .= $vitalsInfo->vitals_date . '<br>'; if ($vitalsInfo->weight != '') { $data['vitals'] .= '<strong>Weight: </strong>'; $data['vitals'] .= $vitalsInfo->weight . ' ' . $practiceInfo->weight_unit . '<br>'; } else { $data['vitals'] .= ''; } if ($vitalsInfo->height != '') { $data['vitals'] .= '<strong>Height: </strong>'; $data['vitals'] .= $vitalsInfo->height . ' ' . $practiceInfo->height_unit . '<br>'; } else { $data['vitals'] .= ''; } if ($vitalsInfo->headcircumference != '') { $data['vitals'] .= '<strong>Head Circumference: </strong>'; $data['vitals'] .= $vitalsInfo->headcircumference . ' ' . $practiceInfo->hc_unit . '<br>'; } else { $data['vitals'] .= ''; } if ($vitalsInfo->BMI != '') { $data['vitals'] .= '<strong>Body Mass Index: </strong>'; $data['vitals'] .= $vitalsInfo->BMI . '<br>'; } else { $data['vitals'] .= ''; } if ($vitalsInfo->temp != '') { $data['vitals'] .= '<strong>Temperature: </strong>'; $data['vitals'] .= $vitalsInfo->temp . ' ' . $practiceInfo->temp_unit . ', ' . $vitalsInfo->temp_method . '<br>'; } else { $data['vitals'] .= ''; } if ($vitalsInfo->bp_systolic != '' && $vitalsInfo->bp_diastolic != '') { $data['vitals'] .= '<strong>Blood Pressure: </strong>'; $data['vitals'] .= $vitalsInfo->bp_systolic . '/' . $vitalsInfo->bp_diastolic . ', ' . $vitalsInfo->bp_position . '<br>'; } else { $data['vitals'] .= ''; } if ($vitalsInfo->pulse != '') { $data['vitals'] .= '<strong>Pulse: </strong>'; $data['vitals'] .= $vitalsInfo->pulse . '<br>'; } else { $data['vitals'] .= ''; } if ($vitalsInfo->respirations != '') { $data['vitals'] .= '<strong>Respirations: </strong>'; $data['vitals'] .= $vitalsInfo->respirations . '<br>'; } else { $data['vitals'] .= ''; } if ($vitalsInfo->o2_sat != '') { $data['vitals'] .= '<strong>Oxygen Saturations: </strong>'; $data['vitals'] .= $vitalsInfo->o2_sat . '<br>'; } else { $data['vitals'] .= ''; } if ($vitalsInfo->vitals_other != '') { $data['vitals'] .= '<strong>Notes: </strong>'; $data['vitals'] .= nl2br($vitalsInfo->vitals_other) . '<br>'; } $data['vitals'] .= '</p>'; } } else { $data['vitals'] = ''; } $peInfo = Pe::find($eid); if ($peInfo) { $data['pe'] = '<br><h4>Physical Exam:</h4><p class="view">'; if ($peInfo->pe_gen1 != '') { $data['pe'] .= '<strong>General: </strong>'; $data['pe'] .= nl2br($peInfo->pe_gen1); $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_eye1 != '' || $peInfo->pe_eye2 != '' || $peInfo->pe_eye3 != '') { $data['pe'] .= '<strong>Eye:</strong>'; if ($peInfo->pe_eye1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_eye1); } if ($peInfo->pe_eye2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_eye2); } if ($peInfo->pe_eye3 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_eye3); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_ent1 != '' || $peInfo->pe_ent2 != '' || $peInfo->pe_ent3 != '' || $peInfo->pe_ent4 != '' || $peInfo->pe_ent5 != '' || $peInfo->pe_ent6 != '') { $data['pe'] .= '<strong>Ears, Nose, Throat:</strong>'; if ($peInfo->pe_ent1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ent1); } if ($peInfo->pe_ent2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ent2); } if ($peInfo->pe_ent3 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ent3); } if ($peInfo->pe_ent4 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ent4); } if ($peInfo->pe_ent5 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ent5); } if ($peInfo->pe_ent6 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ent6); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_neck1 != '' || $peInfo->pe_neck2 != '') { $data['pe'] .= '<strong>Neck:</strong>'; if ($peInfo->pe_neck1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_neck1); } if ($peInfo->pe_neck2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_neck2); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_resp1 != '' || $peInfo->pe_resp2 != '' || $peInfo->pe_resp3 != '' || $peInfo->pe_resp4 != '') { $data['pe'] .= '<strong>Respiratory:</strong>'; if ($peInfo->pe_resp1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_resp1); } if ($peInfo->pe_resp2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_resp2); } if ($peInfo->pe_resp3 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_resp3); } if ($peInfo->pe_resp4 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_resp4); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_cv1 != '' || $peInfo->pe_cv2 != '' || $peInfo->pe_cv3 != '' || $peInfo->pe_cv4 != '' || $peInfo->pe_cv5 != '' || $peInfo->pe_cv6 != '') { $data['pe'] .= '<strong>Cardiovascular:</strong>'; if ($peInfo->pe_cv1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_cv1); } if ($peInfo->pe_cv2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_cv2); } if ($peInfo->pe_cv3 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_cv3); } if ($peInfo->pe_cv4 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_cv4); } if ($peInfo->pe_cv5 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_cv5); } if ($peInfo->pe_cv6 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_cv6); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_ch1 != '' || $peInfo->pe_ch2 != '') { $data['pe'] .= '<strong>Chest:</strong>'; if ($peInfo->pe_ch1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ch1); } if ($peInfo->pe_ch2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ch2); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_gi1 != '' || $peInfo->pe_gi2 != '' || $peInfo->pe_gi3 != '' || $peInfo->pe_gi4 != '') { $data['pe'] .= '<strong>Gastrointestinal:</strong>'; if ($peInfo->pe_gi1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gi1); } if ($peInfo->pe_gi2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gi2); } if ($peInfo->pe_gi3 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gi3); } if ($peInfo->pe_gi4 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gi4); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_gu1 != '' || $peInfo->pe_gu2 != '' || $peInfo->pe_gu3 != '' || $peInfo->pe_gu4 != '' || $peInfo->pe_gu5 != '' || $peInfo->pe_gu6 != '' || $peInfo->pe_gu7 != '' || $peInfo->pe_gu8 != '' || $peInfo->pe_gu9 != '') { $data['pe'] .= '<strong>Genitourinary:</strong>'; if ($peInfo->pe_gu1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gu1); } if ($peInfo->pe_gu2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gu2); } if ($peInfo->pe_gu3 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gu3); } if ($peInfo->pe_gu4 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gu4); } if ($peInfo->pe_gu5 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gu5); } if ($peInfo->pe_gu6 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gu6); } if ($peInfo->pe_gu7 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gu7); } if ($peInfo->pe_gu8 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gu8); } if ($peInfo->pe_gu9 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gu9); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_lymph1 != '' || $peInfo->pe_lymph2 != '' || $peInfo->pe_lymph3 != '') { $data['pe'] .= '<strong>Lymphatic:</strong>'; if ($peInfo->pe_lymph1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_lymph1); } if ($peInfo->pe_lymph2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_lymph2); } if ($peInfo->pe_lymph3 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_lymph3); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_ms1 != '' || $peInfo->pe_ms2 != '' || $peInfo->pe_ms3 != '' || $peInfo->pe_ms4 != '' || $peInfo->pe_ms5 != '' || $peInfo->pe_ms6 != '' || $peInfo->pe_ms7 != '' || $peInfo->pe_ms8 != '' || $peInfo->pe_ms9 != '' || $peInfo->pe_ms10 != '' || $peInfo->pe_ms11 != '' || $peInfo->pe_ms12 != '') { $data['pe'] .= '<strong>Musculoskeletal:</strong>'; if ($peInfo->pe_ms1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ms1); } if ($peInfo->pe_ms2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ms2); } if ($peInfo->pe_ms3 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ms3); } if ($peInfo->pe_ms4 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ms4); } if ($peInfo->pe_ms5 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ms5); } if ($peInfo->pe_ms6 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ms6); } if ($peInfo->pe_ms7 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ms7); } if ($peInfo->pe_ms8 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ms8); } if ($peInfo->pe_ms9 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ms9); } if ($peInfo->pe_ms10 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ms10); } if ($peInfo->pe_ms11 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ms11); } if ($peInfo->pe_ms12 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ms12); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_skin1 != '' || $peInfo->pe_skin2 != '') { $data['pe'] .= '<strong>Skin:</strong>'; if ($peInfo->pe_skin1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_skin1); } if ($peInfo->pe_skin2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_skin2); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_neuro1 != '' || $peInfo->pe_neuro2 != '' || $peInfo->pe_neuro3 != '') { $data['pe'] .= '<strong>Neurologic:</strong>'; if ($peInfo->pe_neuro1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_neuro1); } if ($peInfo->pe_neuro2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_neuro2); } if ($peInfo->pe_neuro3 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_neuro3); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_psych1 != '' || $peInfo->pe_psych2 != '' || $peInfo->pe_psych3 != '' || $peInfo->pe_psych4 != '') { $data['pe'] .= '<strong>Psychiatric:</strong>'; if ($peInfo->pe_psych1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_psych1); } if ($peInfo->pe_psych2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_psych2); } if ($peInfo->pe_psych3 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_psych3); } if ($peInfo->pe_psych4 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_psych4); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_constitutional1 != '') { $data['pe'] .= '<strong>Constitutional: </strong>'; $data['pe'] .= nl2br($peInfo->pe_constitutional1); $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_mental1 != '') { $data['pe'] .= '<strong>Mental Status Examination: </strong>'; $data['pe'] .= nl2br($peInfo->pe_mental1); $data['pe'] .= '<br /><br />'; } $data['pe'] .= '</p>'; } else { $data['pe'] = ''; } $imagesInfo = DB::table('image')->where('eid', '=', $eid)->get(); $html = ''; if ($imagesInfo) { $data['images'] = '<br><h4>Images:</h4><p class="view">'; $k = 0; foreach ($imagesInfo as $imagesInfo_row) { $directory = $practiceInfo->documents_dir . $pid . "/"; $new_directory = __DIR__ . '/../../public/temp/'; $new_directory1 = '/temp/'; $file_path = str_replace($directory, $new_directory, $imagesInfo_row->image_location); $file_path1 = str_replace($directory, $new_directory1, $imagesInfo_row->image_location); copy($imagesInfo_row->image_location, $file_path); if ($k != 0) { $data['images'] .= '<br><br>'; } $data['images'] .= HTML::image($file_path1, 'Image', array('border' => '0')); if ($imagesInfo_row->image_description != '') { $data['images'] .= '<br>' . $imagesInfo_row->image_description . '<br>'; } $k++; } } else { $data['images'] = ''; } $labsInfo = Labs::find($eid); if ($labsInfo) { $data['labs'] = '<br><h4>Laboratory Testing:</h4><p class="view">'; if ($labsInfo->labs_ua_urobili != '' || $labsInfo->labs_ua_bilirubin != '' || $labsInfo->labs_ua_ketones != '' || $labsInfo->labs_ua_glucose != '' || $labsInfo->labs_ua_protein != '' || $labsInfo->labs_ua_nitrites != '' || $labsInfo->labs_ua_leukocytes != '' || $labsInfo->labs_ua_blood != '' || $labsInfo->labs_ua_ph != '' || $labsInfo->labs_ua_spgr != '' || $labsInfo->labs_ua_color != '' || $labsInfo->labs_ua_clarity != '') { $data['labs'] .= '<strong>Dipstick Urinalysis:</strong><br /><table>'; if ($labsInfo->labs_ua_urobili != '') { $data['labs'] .= '<tr><th align=\\"left\\">Urobilinogen:</th><td align=\\"left\\">' . $labsInfo->labs_ua_urobili . '</td></tr>'; } if ($labsInfo->labs_ua_bilirubin != '') { $data['labs'] .= '<tr><th align=\\"left\\">Bilirubin:</th><td align=\\"left\\">' . $labsInfo->labs_ua_bilirubin . '</td></tr>'; } if ($labsInfo->labs_ua_ketones != '') { $data['labs'] .= '<tr><th align=\\"left\\">Ketones:</th><td align=\\"left\\">' . $labsInfo->labs_ua_ketones . '</td></tr>'; } if ($labsInfo->labs_ua_glucose != '') { $data['labs'] .= '<tr><th align=\\"left\\">Glucose:</th><td align=\\"left\\">' . $labsInfo->labs_ua_glucose . '</td></tr>'; } if ($labsInfo->labs_ua_protein != '') { $data['labs'] .= '<tr><th align=\\"left\\">Protein:</th><td align=\\"left\\">' . $labsInfo->labs_ua_protein . '</td></tr>'; } if ($labsInfo['labs_ua_nitrites'] != '') { $data['labs'] .= '<tr><th align=\\"left\\">Nitrites:</th><td align=\\"left\\">' . $labsInfo->labs_ua_nitrites . '</td></tr>'; } if ($labsInfo->labs_ua_leukocytes != '') { $data['labs'] .= '<tr><th align=\\"left\\">Leukocytes:</th><td align=\\"left\\">' . $labsInfo->labs_ua_leukocytes . '</td></tr>'; } if ($labsInfo->labs_ua_blood != '') { $data['labs'] .= '<tr><th align=\\"left\\">Blood:</th><td align=\\"left\\">' . $labsInfo->labs_ua_blood . '</td></tr>'; } if ($labsInfo->labs_ua_ph != '') { $data['labs'] .= '<tr><th align=\\"left\\">pH:</th><td align=\\"left\\">' . $labsInfo->labs_ua_ph . '</td></tr>'; } if ($labsInfo->labs_ua_spgr != '') { $data['labs'] .= '<tr><th align=\\"left\\">Specific gravity:</th><td align=\\"left\\">' . $labsInfo->labs_ua_spgr . '</td></tr>'; } if ($labsInfo->labs_ua_color != '') { $data['labs'] .= '<tr><th align=\\"left\\">Color:</th><td align=\\"left\\">' . $labsInfo->labs_ua_color . '</td></tr>'; } if ($labsInfo->labs_ua_clarity != '') { $data['labs'] .= '<tr><th align=\\"left\\">Clarity:</th><td align=\\"left\\">' . $labsInfo->labs_ua_clarity . '</td></tr>'; } $data['labs'] .= '</table>'; } if ($labsInfo->labs_upt != '') { $data['labs'] .= '<strong>Urine HcG: </strong>'; $data['labs'] .= $labsInfo->labs_upt; $data['labs'] .= '<br /><br />'; } if ($labsInfo->labs_strep != '') { $data['labs'] .= '<strong>Rapid Strep: </strong>'; $data['labs'] .= $labsInfo->labs_strep; $data['labs'] .= '<br /><br />'; } if ($labsInfo->labs_mono != '') { $data['labs'] .= '<strong>Mono Spot: </strong>'; $data['labs'] .= $labsInfo->labs_mono; $data['labs'] .= '<br>'; } if ($labsInfo->labs_flu != '') { $data['labs'] .= '<strong>Rapid Influenza: </strong>'; $data['labs'] .= $labsInfo->labs_flu; $data['labs'] .= '<br /><br />'; } if ($labsInfo->labs_microscope != '') { $data['labs'] .= '<strong>Micrscopy: </strong>'; $data['labs'] .= nl2br($labsInfo->labs_microscope); $data['labs'] .= '<br /><br />'; } if ($labsInfo->labs_glucose != '') { $data['labs'] .= '<strong>Fingerstick Glucose: </strong>'; $data['labs'] .= $labsInfo->labs_glucose; $data['labs'] .= '<br /><br />'; } if ($labsInfo->labs_other != '') { $data['labs'] .= '<strong>Other: </strong>'; $data['labs'] .= nl2br($labsInfo->labs_other); $data['labs'] .= '<br /><br />'; } $data['labs'] .= '</p>'; } else { $data['labs'] = ''; } $procedureInfo = Procedure::find($eid); if ($procedureInfo) { $data['procedure'] = '<br><h4>Procedures:</h4><p class="view">'; if ($procedureInfo->proc_type != '') { $data['procedure'] .= '<strong>Procedure: </strong>'; $data['procedure'] .= nl2br($procedureInfo->proc_type); $data['procedure'] .= '<br /><br />'; } if ($procedureInfo->proc_description != '') { $data['procedure'] .= '<strong>Description of Procedure: </strong>'; $data['procedure'] .= nl2br($procedureInfo->proc_description); $data['procedure'] .= '<br /><br />'; } if ($procedureInfo->proc_complications != '') { $data['procedure'] .= '<strong>Complications: </strong>'; $data['procedure'] .= nl2br($procedureInfo->proc_complications); $data['procedure'] .= '<br /><br />'; } if ($procedureInfo->proc_ebl != '') { $data['procedure'] .= '<strong>Estimated Blood Loss: </strong>'; $data['procedure'] .= nl2br($procedureInfo->proc_ebl); $data['procedure'] .= '<br /><br />'; } $data['procedure'] .= '</p>'; } else { $data['procedure'] = ''; } $assessmentInfo = Assessment::find($eid); if ($assessmentInfo) { $data['assessment'] = '<br><h4>Assessment:</h4><p class="view">'; if ($assessmentInfo->assessment_1 != '') { $data['assessment'] .= '<strong>' . $assessmentInfo->assessment_1 . '</strong><br />'; if ($assessmentInfo->assessment_2 == '') { $data['assessment'] .= '<br />'; } } if ($assessmentInfo->assessment_2 != '') { $data['assessment'] .= '<strong>' . $assessmentInfo->assessment_2 . '</strong><br />'; if ($assessmentInfo->assessment_3 == '') { $data['assessment'] .= '<br />'; } } if ($assessmentInfo->assessment_3 != '') { $data['assessment'] .= '<strong>' . $assessmentInfo->assessment_3 . '</strong><br />'; if ($assessmentInfo->assessment_4 == '') { $data['assessment'] .= '<br />'; } } if ($assessmentInfo->assessment_4 != '') { $data['assessment'] .= '<strong>' . $assessmentInfo->assessment_4 . '</strong><br />'; if ($assessmentInfo->assessment_5 == '') { $data['assessment'] .= '<br />'; } } if ($assessmentInfo->assessment_5 != '') { $data['assessment'] .= '<strong>' . $assessmentInfo->assessment_5 . '</strong><br />'; if ($assessmentInfo->assessment_6 == '') { $data['assessment'] .= '<br />'; } } if ($assessmentInfo->assessment_6 != '') { $data['assessment'] .= '<strong>' . $assessmentInfo->assessment_6 . '</strong><br />'; if ($assessmentInfo->assessment_7 == '') { $data['assessment'] .= '<br />'; } } if ($assessmentInfo->assessment_7 != '') { $data['assessment'] .= '<strong>' . $assessmentInfo->assessment_7 . '</strong><br />'; if ($assessmentInfo->assessment_8 == '') { $data['assessment'] .= '<br />'; } } if ($assessmentInfo->assessment_8 != '') { $data['assessment'] .= '<strong>' . $assessmentInfo->assessment_8 . '</strong><br /><br />'; } if ($assessmentInfo->assessment_other != '') { if ($encounterInfo->encounter_template == 'standardmtm') { $data['assessment'] .= '<strong>SOAP Note: </strong>'; } else { $data['assessment'] .= '<strong>Additional Diagnoses: </strong>'; } $data['assessment'] .= nl2br($assessmentInfo->assessment_other); $data['assessment'] .= '<br /><br />'; } if ($assessmentInfo->assessment_ddx != '') { if ($encounterInfo->encounter_template == 'standardmtm') { $data['assessment'] .= '<strong>MAP2: </strong>'; } else { $data['assessment'] .= '<strong>Differential Diagnoses Considered: </strong>'; } $data['assessment'] .= nl2br($assessmentInfo->assessment_ddx); $data['assessment'] .= '<br /><br />'; } if ($assessmentInfo->assessment_notes != '') { if ($encounterInfo->encounter_template == 'standardmtm') { $data['assessment'] .= '<strong>Pharmacist Note: </strong>'; } else { $data['assessment'] .= '<strong>Assessment Discussion: </strong>'; } $data['assessment'] .= nl2br($assessmentInfo->assessment_notes); $data['assessment'] .= '<br /><br />'; } $data['assessment'] .= '</p>'; } else { $data['assessment'] = ''; } $ordersInfo1 = Orders::where('eid', '=', $eid)->get(); if (count($ordersInfo1) > 0) { $data['orders'] = '<br><h4>Orders:</h4><p class="view">'; $orders_lab_array = array(); $orders_radiology_array = array(); $orders_cp_array = array(); $orders_referrals_array = array(); foreach ($ordersInfo1 as $ordersInfo) { $address_row1 = Addressbook::find($ordersInfo->address_id); if ($address_row1) { $orders_displayname = $address_row1->displayname; } else { $orders_displayname = 'Unknown'; } if ($ordersInfo->orders_labs != '') { $orders_lab_array[] = 'Orders sent to ' . $orders_displayname . ': ' . nl2br($ordersInfo->orders_labs) . '<br />'; } if ($ordersInfo->orders_radiology != '') { $orders_radiology_array[] = 'Orders sent to ' . $orders_displayname . ': ' . nl2br($ordersInfo->orders_radiology) . '<br />'; } if ($ordersInfo->orders_cp != '') { $orders_cp_array[] = 'Orders sent to ' . $orders_displayname . ': ' . nl2br($ordersInfo->orders_cp) . '<br />'; } if ($ordersInfo->orders_referrals != '') { $orders_referrals_array[] = 'Referral sent to ' . $orders_displayname . ': ' . nl2br($ordersInfo->orders_referrals) . '<br />'; } } if (count($orders_lab_array) > 0) { $data['orders'] .= '<strong>Labs: </strong>'; foreach ($orders_lab_array as $lab_item) { $data['orders'] .= $lab_item; } } if (count($orders_radiology_array) > 0) { $data['orders'] .= '<strong>Imaging: </strong>'; foreach ($orders_radiology_array as $radiology_item) { $data['orders'] .= $radiology_item; } } if (count($orders_cp_array) > 0) { $data['orders'] .= '<strong>Cardiopulmonary: </strong>'; foreach ($orders_cp_array as $cp_item) { $data['orders'] .= $cp_item; } } if (count($orders_referrals_array) > 0) { $data['orders'] .= '<strong>Referrals: </strong>'; foreach ($orders_referrals_array as $referrals_item) { $data['orders'] .= $referrals_item; } } $data['orders'] .= '</p>'; } else { $data['orders'] = ''; } $rxInfo = Rx::find($eid); if ($rxInfo) { $data['rx'] = '<br><h4>Prescriptions and Immunizations:</h4><p class="view">'; if ($rxInfo->rx_rx != '') { $data['rx'] .= '<strong>Prescriptions Given: </strong>'; $data['rx'] .= nl2br($rxInfo->rx_rx); $data['rx'] .= '<br /><br />'; } if ($rxInfo->rx_supplements != '') { $data['rx'] .= '<strong>Supplements Recommended: </strong>'; $data['rx'] .= nl2br($rxInfo->rx_supplements); $data['rx'] .= '<br /><br />'; } if ($rxInfo->rx_immunizations != '') { $data['rx'] .= '<strong>Immunizations Given: </strong>'; $data['rx'] .= 'CDC Vaccine Information Sheets given for each immunization and consent obtained.<br />'; $data['rx'] .= nl2br($rxInfo->rx_immunizations); $data['rx'] .= '<br /><br />'; } $data['rx'] .= '</p>'; } else { $data['rx'] = ''; } $planInfo = Plan::find($eid); if ($planInfo) { $data['plan'] = '<br><h4>Plan:</h4><p class="view">'; if ($planInfo->plan != '') { $data['plan'] .= '<strong>Recommendations: </strong>'; $data['plan'] .= nl2br($planInfo->plan); $data['plan'] .= '<br /><br />'; } if ($planInfo->followup != '') { $data['plan'] .= '<strong>Followup: </strong>'; $data['plan'] .= nl2br($planInfo->followup); $data['plan'] .= '<br /><br />'; } if ($planInfo->goals != '') { $data['plan'] .= '<strong>Goals/Measures: </strong>'; $data['plan'] .= nl2br($planInfo->goals); $data['plan'] .= '<br /><br />'; } if ($planInfo->tp != '') { $data['plan'] .= '<strong>Treatment Plan Notes: </strong>'; $data['plan'] .= nl2br($planInfo->tp); $data['plan'] .= '<br /><br />'; } if ($planInfo->duration != '') { $data['plan'] .= 'Counseling and face-to-face time consists of more than 50 percent of the visit. Total face-to-face time is '; $data['plan'] .= $planInfo->duration . ' minutes.'; $data['plan'] .= '<br /><br />'; } $data['plan'] .= '</p>'; } else { $data['plan'] = ''; } $billing_query = Billing_core::where('eid', '=', $eid)->get(); if ($billing_query) { $data['billing'] = '<p class="view">'; $billing_count = 0; foreach ($billing_query as $billing_row) { if ($billing_count > 0) { $data['billing'] .= ',' . $billing_row->cpt; } else { $data['billing'] .= '<strong>CPT Codes: </strong>'; $data['billing'] .= $billing_row->cpt; } $billing_count++; } if ($encounterInfo->bill_complex != '') { $data['billing'] .= '<br><strong>Medical Complexity: </strong>'; $data['billing'] .= nl2br($encounterInfo->bill_complex); $data['billing'] .= '<br /><br />'; } $data['billing'] .= '</p>'; } else { $data['billing'] = ''; } if ($modal == true) { if ($encounterInfo->encounter_signed == 'No') { $data['status'] = 'Draft'; } else { $data['status'] = 'Signed on ' . date('F jS, Y', $this->human_to_unix($encounterInfo->date_signed)) . '.'; } if ($addendum == true) { $data['addendum'] = true; } else { $data['addendum'] = false; } return View::make('modal_view', $data); } else { return View::make('encounter_view', $data); } }
foreach ($names as $name) { $tree->addDocument($user, $name, "pack_detail.php?Server={$Server}&Packagename={$name}&User={$usernameraw}&" . SID); } } } $pac->destruct(); } else { // insert one object $tree->addFolder($pacs, 0, 0); } } //procedures if ($CF->get("ENABLE_PROCEDURES")) { $procs = $tree->addFolder(${"root" . $Server}, "Procedures", ""); if (!$CF->get("ENABLE_HTML_TREE") || in_array($procs, $tree->opened)) { $proc = new Procedure($Server); $proc->getNames(); foreach ($proc->names as $username => $names) { $usernameraw = rawurlencode($username); $user = $tree->addFolder($procs, $username . " (" . count($names) . ")", "proc_main.php?Server={$Server}&User={$usernameraw}&" . SID); if (is_array($names)) { foreach ($names as $name) { $tree->addDocument($user, $name, "proc_detail.php?Server={$Server}&Procedurename={$name}&User={$usernameraw}&" . SID); } } } $proc->destruct(); } else { // insert one object $tree->addFolder($procs, 0, 0); }
begin : Sam Nov 25 18:08:45 CET 2000 copyright : (C) 2000 by Thomas Fromm email : tf@tfromm.com ***************************************************************************/ /*************************************************************************** * * * 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 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ include "prepend.inc.php"; $Server = getData("Server", "integer"); $User = getData("User"); $proc = new Procedure($Server); $proc->getDatas($User); $html = "<H1> Database " . $DB->Name($Server) . " - Procedure overview of User {$User}</H1>\n"; $html .= "<TABLE BORDER=0>\n<TR><TH>Name</TH><TH>Created</TH><TH>Last Modified</TH><TH>Status</TH></TR>\n"; $x = 0; if (is_array($proc->datas[$User])) { foreach ($proc->datas[$User] as $procedure) { $html .= $x % 2 ? "<tr bgcolor=\"#EEEEEE\" valign=top>" : "<tr bgcolor=\"#CCCCCC\" valign=top>"; $html .= "<td class=data><b>" . $procedure["OBJECT_NAME"] . "</b></td>"; $html .= "<td>" . $procedure["CREATED"] . "</td>"; $html .= "<td>" . $procedure["LASTMODIFIED"] . "</td>"; $html .= "<td>" . $procedure["STATUS"] . "</td>"; $html .= "</tr>"; $x++; } }
/** * AJAX method to check for any duplicate procedure bookings. */ public function actionVerifyProcedures() { $this->setPatient($_REQUEST['patient_id']); $resp = array('previousProcedures' => false); $procs = array(); $procs_by_id = array(); if (isset($_POST['Procedures_procs'])) { foreach ($_POST['Procedures_procs'] as $proc_id) { if ($p = Procedure::model()->findByPk((int) $proc_id)) { $procs[] = $p; $procs_by_id[$p->id] = $p; } } } $eye = Eye::model()->findByPk((int) @$_POST['Element_OphTrOperationbooking_Operation']['eye_id']); if ($eye && count($procs)) { $matched_procedures = array(); // get all the operation elements for this patient from booking events that have not been cancelled if (Yii::app()->params['OphTrOperationbooking_duplicate_proc_warn_all_eps']) { $episodes = $this->patient->episodes; } else { $episodes = array($this->getEpisode()); } foreach ($episodes as $ep) { $events = $ep->getAllEventsByType($this->event_type->id); foreach ($events as $ev) { if ($ev->id == @$_POST['event_id']) { // if we're editing, then don't want to check against that event continue; } $op = Element_OphTrOperationbooking_Operation::model()->findByAttributes(array('event_id' => $ev->id)); // check operation still valid, and that it is for a matching eye. if (!$op->operation_cancellation_date && ($op->eye_id == Eye::BOTH || $eye->id == Eye::BOTH || $op->eye_id == $eye->id)) { foreach ($op->procedures as $existing_proc) { if (in_array($existing_proc->id, array_keys($procs_by_id))) { if (!isset($matched_procedures[$existing_proc->id])) { $matched_procedures[$existing_proc->id] = array(); } $matched_procedures[$existing_proc->id][] = $op; } } } } } // if procedure matches if (count($matched_procedures)) { $resp['previousProcedures'] = true; $resp['message'] = $this->renderPartial('previous_procedures', array('matched_procedures' => $matched_procedures, 'eye' => $eye, 'procs_by_id' => $procs_by_id), true); } } echo \CJSON::encode($resp); }
/** * Sets Laser Procedures. * * @param BaseEventTypeElement $element * @param array $data * @param null $index */ protected function setElementComplexAttributesFromData($element, $data, $index = null) { if (get_class($element) == 'Element_OphTrLaser_Treatment') { $right_procedures = array(); if (isset($data['treatment_right_procedures'])) { foreach ($data['treatment_right_procedures'] as $proc_id) { $right_procedures[] = Procedure::model()->findByPk($proc_id); } } $element->right_procedures = $right_procedures; $left_procedures = array(); if (isset($data['treatment_left_procedures'])) { foreach ($data['treatment_left_procedures'] as $proc_id) { $left_procedures[] = Procedure::model()->findByPk($proc_id); } } $element->left_procedures = $left_procedures; } }
public function testGetList_RestrictUnbooked() { $this->assertEquals(array('Test Procedure'), Procedure::getList('Proc', 'unbooked')); }
/** * The Procedure for the replacebase function * * @param Menu $backMenu The Menu for return * * @return void */ function replacebaseProcedure(Menu $backMenu) { $procedure = new Procedure(); $choice = "0"; $procedure->showReturnChoice($choice); $qt_srcLocation = $procedure->createQuestion("Source location (if localhost 'symlink' instead of 'scp'): "); $srcLocation = $procedure->askQuestion($qt_srcLocation); if ($srcLocation === $choice) { $procedure->clearScreen(); $procedure->showMenu($backMenu, true); exit; } $qt_srcDir = $procedure->createQuestion("Source directory (ie /var/backup): "); $srcDir = $procedure->askQuestion($qt_srcDir); $qt_srcDB = $procedure->createQuestion("Source database (ie mediboard): "); $srcDB = $procedure->askQuestion($qt_srcDB); $qt_tgtDir = $procedure->createQuestion("Target directory (ie /tmp) [default /tmp]: ", "/tmp"); $tgtDir = $procedure->askQuestion($qt_tgtDir); $qt_tgtDB = $procedure->createQuestion("Target database (ie target_mediboard): "); $tgtDB = $procedure->askQuestion($qt_tgtDB); $qt_restart = $procedure->createQuestion("Restart MySQL Server (Warning) (ie for InnoDB) [y or n, default n]? ", "n"); $restart = $procedure->askQuestion($qt_restart); $qt_safeCopy = $procedure->createQuestion("Make a safe copy of existing target database first [y or n, default n]? ", "n"); $safeCopy = $procedure->askQuestion($qt_safeCopy); $qt_mySQLDir = $procedure->createQuestion("MySQL directory where databases are stored [default /var/lib/mysql]: ", "/var/lib/mysql"); $mySQLDir = $procedure->askQuestion($qt_mySQLDir); $qt_port = $procedure->createQuestion("SSH port [default 22]: ", 22); $port = $procedure->askQuestion($qt_port); $qt_localCopy = $procedure->createQuestion("Make a distant copy (scp) [y or n, default y]? ", "y"); $localCopy = $procedure->askQuestion($qt_localCopy); echo "\n"; replaceBase($srcLocation, $srcDir, $srcDB, $tgtDir, $tgtDB, $restart, $safeCopy, $mySQLDir, $port, $localCopy); }
protected function timeline_new() { $pid = Session::get('pid'); $json = array(); $date_arr = array(); $query0 = DB::table('encounters')->where('pid', '=', $pid)->where('addendum', '=', 'n')->get(); if ($query0) { foreach ($query0 as $row0) { $description = ''; $procedureInfo = Procedure::find($row0->eid); if ($procedureInfo) { $description .= '<span class="nosh_bold">Procedures:</span>'; if ($procedureInfo->proc_type != '') { $description .= '<strong>Procedure: </strong>'; $description .= nl2br($procedureInfo->proc_type); } } $assessmentInfo = Assessment::find($row0->eid); if ($assessmentInfo) { if ($assessmentInfo->assessment_1 != '') { $description .= '<span class="nosh_bold">Assessment:</span>'; $description .= '<br><strong>' . $assessmentInfo->assessment_1 . '</strong><br />'; if ($assessmentInfo->assessment_2 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_2 != '') { $description .= '<strong>' . $assessmentInfo->assessment_2 . '</strong><br />'; if ($assessmentInfo->assessment_3 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_3 != '') { $description .= '<strong>' . $assessmentInfo->assessment_3 . '</strong><br />'; if ($assessmentInfo->assessment_4 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_4 != '') { $description .= '<strong>' . $assessmentInfo->assessment_4 . '</strong><br />'; if ($assessmentInfo->assessment_5 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_5 != '') { $description .= '<strong>' . $assessmentInfo->assessment_5 . '</strong><br />'; if ($assessmentInfo->assessment_6 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_6 != '') { $description .= '<strong>' . $assessmentInfo->assessment_6 . '</strong><br />'; if ($assessmentInfo->assessment_7 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_7 != '') { $description .= '<strong>' . $assessmentInfo->assessment_7 . '</strong><br />'; if ($assessmentInfo->assessment_8 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_8 != '') { $description .= '<strong>' . $assessmentInfo->assessment_8 . '</strong><br /><br />'; } if ($assessmentInfo->assessment_other != '') { if ($row0->encounter_template == 'standardmtm') { $description .= '<br /><strong>SOAP Note: </strong>'; } else { $description .= '<br /><strong>Additional Diagnoses: </strong>'; } $description .= nl2br($assessmentInfo->assessment_other); $description .= '<br /><br />'; } if ($assessmentInfo->assessment_ddx != '') { if ($row0->encounter_template == 'standardmtm') { $description .= '<br /><strong>MAP2: </strong>'; } else { $description .= '<br /><strong>Differential Diagnoses Considered: </strong>'; } $description .= nl2br($assessmentInfo->assessment_ddx); $description .= '<br /><br />'; } if ($assessmentInfo->assessment_notes != '') { if ($row0->encounter_template == 'standardmtm') { $description .= '<br /><strong>Pharmacist Note: </strong>'; } else { $description .= '<br /><strong>Assessment Discussion: </strong>'; } $description .= nl2br($assessmentInfo->assessment_notes); $description .= '<br /><br />'; } } $div0 = $this->timeline_item($row0->eid, 'eid', 'Encounter', $this->human_to_unix($row0->encounter_DOS), 'Encounter: ' . $row0->encounter_cc, $description, $row0->encounter_signed); $json[] = array('div' => $div0, 'startDate' => $this->human_to_unix($row0->encounter_DOS)); $date_arr[] = $this->human_to_unix($row0->encounter_DOS); } } $query1 = DB::table('t_messages')->where('pid', '=', $pid)->get(); if ($query1) { foreach ($query1 as $row1) { $div1 = $this->timeline_item($row1->t_messages_id, 't_messages_id', 'Telephone Message', $this->human_to_unix($row1->t_messages_dos), 'Telephone Message', substr($row1->t_messages_message, 0, 500) . '...', $row1->t_messages_signed); $json[] = array('div' => $div1, 'startDate' => $this->human_to_unix($row1->t_messages_dos)); $date_arr[] = $this->human_to_unix($row1->t_messages_dos); } } $query2 = DB::table('rx_list')->where('pid', '=', $pid)->orderBy('rxl_date_active', 'asc')->groupBy('rxl_medication')->get(); if ($query2) { foreach ($query2 as $row2) { $row2a = DB::table('rx_list')->where('rxl_id', '=', $row2->rxl_id)->first(); if ($row2->rxl_sig == '') { $instructions = $row2->rxl_instructions; } else { $instructions = $row2->rxl_sig . ' ' . $row2->rxl_route . ' ' . $row2->rxl_frequency; } $description2 = $row2->rxl_medication . ' ' . $row2->rxl_dosage . ' ' . $row2->rxl_dosage_unit . ', ' . $instructions . ' for ' . $row2->rxl_reason; $div2 = $this->timeline_item($row2->rxl_id, 'rxl_id', 'New Medication', $this->human_to_unix($row2->rxl_date_active), 'New Medication', $description2); $json[] = array('div' => $div2, 'startDate' => $this->human_to_unix($row2->rxl_date_active)); $date_arr[] = $this->human_to_unix($row2->rxl_date_active); } } $query3 = DB::table('issues')->where('pid', '=', $pid)->get(); if ($query3) { foreach ($query3 as $row3) { if ($row3->type == 'Problem List') { $title = 'New Problem'; } if ($row3->type == 'Medical History') { $title = 'New Medical Event'; } if ($row3->type == 'Problem List') { $title = 'New Surgical Event'; } $div3 = $this->timeline_item($row3->issue_id, 'issue_id', $title, $this->human_to_unix($row3->issue_date_active), $title, $row3->issue); $json[] = array('div' => $div3, 'startDate' => $this->human_to_unix($row3->issue_date_active)); $date_arr[] = $this->human_to_unix($row3->issue_date_active); } } $query4 = DB::table('immunizations')->where('pid', '=', $pid)->get(); if ($query4) { foreach ($query4 as $row4) { $div4 = $this->timeline_item($row4->imm_id, 'imm_id', 'Immunization Given', $this->human_to_unix($row4->imm_date), 'Immunization Given', $row4->imm_immunization); $json[] = array('div' => $div4, 'startDate' => $this->human_to_unix($row4->imm_date)); $date_arr[] = $this->human_to_unix($row4->imm_date); } } $query5 = DB::table('rx_list')->where('pid', '=', $pid)->where('rxl_date_inactive', '!=', '0000-00-00 00:00:00')->get(); if ($query5) { foreach ($query5 as $row5) { $row5a = DB::table('rx_list')->where('rxl_id', '=', $row5->rxl_id)->first(); if ($row5->rxl_sig == '') { $instructions5 = $row5->rxl_instructions; } else { $instructions5 = $row5->rxl_sig . ' ' . $row5->rxl_route . ' ' . $row5->rxl_frequency; } $description5 = $row5->rxl_medication . ' ' . $row5->rxl_dosage . ' ' . $row5->rxl_dosage_unit . ', ' . $instructions5 . ' for ' . $row5->rxl_reason; $div5 = $this->timeline_item($row5->rxl_id, 'rxl_id', 'Medication Stopped', $this->human_to_unix($row5->rxl_date_inactive), 'Medication Stopped', $description5); $json[] = array('div' => $div5, 'startDate' => $this->human_to_unix($row5->rxl_date_inactive)); $date_arr[] = $this->human_to_unix($row5->rxl_date_inactive); } } $query6 = DB::table('allergies')->where('pid', '=', $pid)->where('allergies_date_inactive', '=', '0000-00-00 00:00:00')->get(); if ($query6) { foreach ($query6 as $row6) { $div6 = $this->timeline_item($row6->allergies_id, 'allergies_id', 'New Allergy', $this->human_to_unix($row6->allergies_date_active), 'New Allergy', $row6->allergies_med); $json[] = array('div' => $div6, 'startDate' => $this->human_to_unix($row6->allergies_date_active)); $date_arr[] = $this->human_to_unix($row6->allergies_date_active); } } foreach ($json as $key => $value) { $item[$key] = $value['startDate']; } array_multisort($item, SORT_DESC, $json); asort($date_arr); $arr['start'] = reset($date_arr); $arr['end'] = end($date_arr); if ($arr['end'] - $arr['start'] >= 315569260) { $arr['granular'] = 'decade'; } if ($arr['end'] - $arr['start'] > 31556926 && $arr['end'] - $arr['start'] < 315569260) { $arr['granular'] = 'year'; } if ($arr['end'] - $arr['start'] <= 31556926) { $arr['granular'] = 'month'; } $arr['json'] = $json; return $arr; }
/** * The Procedure for the basebackup function * * @param Menu $backMenu The Menu for return * * @return void */ function baseBackupProcedure(Menu $backMenu) { $procedure = new Procedure(); echo "Method:\n\n"; echo "[1] Hotcopy\n"; echo "[2] Dump\n"; echo "--------------------\n"; $choice = "0"; $procedure->showReturnChoice($choice); $qt_method = $procedure->createQuestion("\nSelected method: "); $method = $procedure->askQuestion($qt_method); switch ($method) { case "1": $method = "hotcopy"; break; case "2": $method = "dump"; break; case $choice: $procedure->clearScreen(); $procedure->showMenu($backMenu, true); break; default: $procedure->clearScreen(); cecho("Incorrect input", "red"); echo "\n"; baseBackupProcedure($backMenu); } $qt_username = $procedure->createQuestion("Username (to access database): "); $username = $procedure->askQuestion($qt_username); $password = prompt_silent(); $hostname = ""; $port = ""; $qt_DBBackup = $procedure->createQuestion("Database to backup (ie mediboard): "); $DBBackup = $procedure->askQuestion($qt_DBBackup); $qt_backupPath = $procedure->createQuestion("Backup path (ie /var/backup): "); $backupPath = $procedure->askQuestion($qt_backupPath); $qt_time = $procedure->createQuestion("Time (in days before removal of files) [default 7]: ", 7); $time = $procedure->askQuestion($qt_time); if ($method == "hotcopy") { $qt_binLog = $procedure->createQuestion("Create a binary log index [y or n, default n]? ", "n"); $binLog = $procedure->askQuestion($qt_binLog); } else { $binLog = ""; } $qt_mail = $procedure->createQuestion("Send a mail when diskfull is detected [y or n, default n]? ", "n"); $mail = $procedure->askQuestion($qt_mail); if ($mail == "y") { $qt_usernameMail = $procedure->createQuestion("Username (to send a mail): "); $usernameMail = $procedure->askQuestion($qt_usernameMail); $passwordMail = prompt_silent(); } else { $usernameMail = ""; $passwordMail = ""; } $qt_lock = $procedure->createQuestion("Lock file path (ie /tmp/lock.txt) (leave blank for no lock file): ", null); $lock = $procedure->askQuestion($qt_lock); echo "\n"; baseBackup($method, $username, $password, $hostname, $port, $DBBackup, $backupPath, $time, $binLog, $usernameMail, $passwordMail, $lock); }
public function postCompileBilling() { $eid = Session::get('eid'); $pid = Session::get('pid'); $practice_id = Session::get('practice_id'); $row = Demographics::find($pid); $encounterInfo = Encounters::find($eid); $dos1 = $this->human_to_unix($encounterInfo->encounter_DOS); $dos = date('mdY', $dos1); $dos2 = date('m/d/Y', $dos1); $pos = $encounterInfo->encounter_location; $assessment_data = Assessment::find($eid); $icd_pointer = ''; if ($assessment_data->assessment_1 != '') { $icd_pointer .= "A"; } if ($assessment_data->assessment_2 != '') { $icd_pointer .= "B"; } if ($assessment_data->assessment_3 != '') { $icd_pointer .= "C"; } if ($assessment_data->assessment_4 != '') { $icd_pointer .= "D"; } $labsInfo = Labs::find($eid); if ($labsInfo) { if ($labsInfo->labs_ua_urobili != '' || $labsInfo->labs_ua_bilirubin != '' || $labsInfo->labs_ua_ketones != '' || $labsInfo->labs_ua_glucose != '' || $labsInfo->labs_ua_protein != '' || $labsInfo->labs_ua_nitrites != '' || $labsInfo->labs_ua_leukocytes != '' || $labsInfo->labs_ua_blood != '' || $labsInfo->labs_ua_ph != '' || $labsInfo->labs_ua_spgr != '' || $labsInfo->labs_ua_color != '' || $labsInfo->labs_ua_clarity != '') { $this->compile_procedure_billing('81002', $eid, $pid, $dos2, $icd_pointer, $practice_id); } if ($labsInfo->labs_upt != '') { $this->compile_procedure_billing('81025', $eid, $pid, $dos2, $icd_pointer, $practice_id); } if ($labsInfo->labs_strep != '') { $this->compile_procedure_billing('87880', $eid, $pid, $dos2, $icd_pointer, $practice_id); } if ($labsInfo->labs_mono != '') { $this->compile_procedure_billing('86308', $eid, $pid, $dos2, $icd_pointer, $practice_id); } if ($labsInfo->labs_flu != '') { $this->compile_procedure_billing('87804', $eid, $pid, $dos2, $icd_pointer, $practice_id); } if ($labsInfo->labs_glucose != '') { $this->compile_procedure_billing('82962', $eid, $pid, $dos2, $icd_pointer, $practice_id); } } $result9 = Procedure::find($eid); if ($result9) { $this->compile_procedure_billing($result9->proc_cpt, $eid, $pid, $dos2, $icd_pointer, $practice_id); } $result11 = Immunizations::where('eid', '=', $eid)->get(); if ($result11) { foreach ($result11 as $row11) { $this->compile_procedure_billing($row11->cpt, $eid, $pid, $dos2, $icd_pointer, $practice_id); } } echo 'CPT codes complied from the encounter!'; }
public function run() { if (empty($_POST)) { if (!$this->selected_procedures && $this->element) { $this->selected_procedures = $this->element->{$this->relation}; if ($this->durations) { $this->total_duration = $this->element->total_duration; } } } else { $this->selected_procedures = array(); if (isset($_POST['Procedures_' . $this->identifier]) && is_array($_POST['Procedures_' . $this->identifier])) { foreach ($_POST['Procedures_' . $this->identifier] as $proc_id) { $proc = Procedure::model()->findByPk($proc_id); $this->selected_procedures[] = $proc; if ($this->durations) { $this->total_duration += $proc->default_duration; } } } } $firm = Firm::model()->findByPk(Yii::app()->session['selected_firm_id']); $subspecialty_id = $firm->serviceSubspecialtyAssignment ? $firm->serviceSubspecialtyAssignment->subspecialty_id : null; if ($this->restrict_common === 'unbooked') { $this->subsections = array(); } else { $this->subsections = SubspecialtySubsection::model()->getList($subspecialty_id); } $this->procedures = array(); $this->removed_stack = array(); if (empty($this->subsections)) { foreach (Procedure::model()->getListBySubspecialty($subspecialty_id, $this->restrict_common) as $proc_id => $name) { if (empty($_POST)) { $found = false; if ($this->selected_procedures) { foreach ($this->selected_procedures as $procedure) { if ($procedure->id == $proc_id) { $found = true; break; } } } if (!$found) { $this->procedures[$proc_id] = $name; } else { $this->removed_stack[] = "{id: {$proc_id}, name: '{$name}'}"; } } else { if (!@$_POST['Procedures_' . $this->identifier] || !in_array($proc_id, $_POST['Procedures_' . $this->identifier])) { $this->procedures[$proc_id] = $name; } else { $this->removed_stack[] = "{id: {$proc_id}, name: '{$name}'}"; } } } } else { // Doesn't matter if removed_stack contains non-common procedures as lists are reloaded using ajax on removal if (!empty($this->selected_procedures)) { foreach ($this->selected_procedures as $selected_procedure) { $this->removed_stack[] = "{id: {$selected_procedure->id}, name: '{$selected_procedure->term}'}"; } } } $this->class = get_class($this->element); if ($this->read_only) { $this->render(get_class($this) . '_readonly'); } else { $this->render(get_class($this)); } }
public function postTimeline() { $pid = Session::get('pid'); $json = array(); $date_arr = array(); $query0 = DB::table('encounters')->where('pid', '=', $pid)->where('addendum', '=', 'n')->get(); if ($query0) { foreach ($query0 as $row0) { $description = ''; $procedureInfo = Procedure::find($row0->eid); if ($procedureInfo) { $description .= '<br><h4>Procedures:</h4><p class="view">'; if ($procedureInfo->proc_type != '') { $description .= '<strong>Procedure: </strong>'; $description .= nl2br($procedureInfo->proc_type); $description .= '<br /><br />'; } $description .= '</p>'; } $assessmentInfo = Assessment::find($row0->eid); if ($assessmentInfo) { $description .= '<br><h4>Assessment:</h4><p class="view">'; if ($assessmentInfo->assessment_1 != '') { $description .= '<strong>' . $assessmentInfo->assessment_1 . '</strong><br />'; if ($assessmentInfo->assessment_2 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_2 != '') { $description .= '<strong>' . $assessmentInfo->assessment_2 . '</strong><br />'; if ($assessmentInfo->assessment_3 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_3 != '') { $description .= '<strong>' . $assessmentInfo->assessment_3 . '</strong><br />'; if ($assessmentInfo->assessment_4 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_4 != '') { $description .= '<strong>' . $assessmentInfo->assessment_4 . '</strong><br />'; if ($assessmentInfo->assessment_5 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_5 != '') { $description .= '<strong>' . $assessmentInfo->assessment_5 . '</strong><br />'; if ($assessmentInfo->assessment_6 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_6 != '') { $description .= '<strong>' . $assessmentInfo->assessment_6 . '</strong><br />'; if ($assessmentInfo->assessment_7 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_7 != '') { $description .= '<strong>' . $assessmentInfo->assessment_7 . '</strong><br />'; if ($assessmentInfo->assessment_8 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_8 != '') { $description .= '<strong>' . $assessmentInfo->assessment_8 . '</strong><br /><br />'; } if ($assessmentInfo->assessment_other != '') { if ($row0->encounter_template == 'standardmtm') { $description .= '<strong>SOAP Note: </strong>'; } else { $description .= '<strong>Additional Diagnoses: </strong>'; } $description .= nl2br($assessmentInfo->assessment_other); $description .= '<br /><br />'; } if ($assessmentInfo->assessment_ddx != '') { if ($row0->encounter_template == 'standardmtm') { $description .= '<strong>MAP2: </strong>'; } else { $description .= '<strong>Differential Diagnoses Considered: </strong>'; } $description .= nl2br($assessmentInfo->assessment_ddx); $description .= '<br /><br />'; } if ($assessmentInfo->assessment_notes != '') { if ($row0->encounter_template == 'standardmtm') { $description .= '<strong>Pharmacist Note: </strong>'; } else { $description .= '<strong>Assessment Discussion: </strong>'; } $description .= nl2br($assessmentInfo->assessment_notes); $description .= '<br /><br />'; } $description .= '</p>'; } $json[] = array('title' => "<span class='timeline_event' value='" . $row0->eid . "' type='eid' status='" . $row0->encounter_signed . "'>Encounter: " . $row0->encounter_cc . "</span>", 'description' => $description, 'startDate' => $this->human_to_unix($row0->encounter_DOS)); $date_arr[] = $this->human_to_unix($row0->encounter_DOS); } } $query1 = DB::table('t_messages')->where('pid', '=', $pid)->get(); if ($query1) { foreach ($query1 as $row1) { $json[] = array('title' => "<span class='timeline_event' value='" . $row1->t_messages_id . "' type='t_messages_id' status='" . $row1->t_messages_signed . "'>Message: " . $row1->t_messages_subject . "</span>", 'description' => substr($row1->t_messages_message, 0, 500) . '...', 'startDate' => $this->human_to_unix($row1->t_messages_dos)); $date_arr[] = $this->human_to_unix($row1->t_messages_dos); } } $query2 = DB::table('rx_list')->where('pid', '=', $pid)->orderBy('rxl_date_active', 'asc')->groupBy('rxl_medication')->get(); if ($query2) { foreach ($query2 as $row2) { $row2a = DB::table('rx_list')->where('rxl_id', '=', $row2->rxl_id)->first(); if ($row2->rxl_sig == '') { $instructions = $row2->rxl_instructions; } else { $instructions = $row2->rxl_sig . ' ' . $row2->rxl_route . ' ' . $row2->rxl_frequency; } $description2 = $row2->rxl_medication . ' ' . $row2->rxl_dosage . ' ' . $row2->rxl_dosage_unit . ', ' . $instructions . ' for ' . $row2->rxl_reason; $json[] = array('title' => "<span class='timeline_event' value='" . $row2->rxl_id . "' type='rxl_id'>New Medication Started</span>", 'description' => $description2, 'startDate' => $this->human_to_unix($row2->rxl_date_active)); $date_arr[] = $this->human_to_unix($row2->rxl_date_active); } } $query3 = DB::table('issues')->where('pid', '=', $pid)->get(); if ($query3) { foreach ($query3 as $row3) { if ($row3->type == 'Problem List') { $title = 'New Problem'; } if ($row3->type == 'Medical History') { $title = 'New Medical Event'; } if ($row3->type == 'Problem List') { $title = 'New Surgical Event'; } $json[] = array('title' => "<span class='timeline_event' value='" . $row3->issue_id . "' type='issue_id'>" . $title . "</span>", 'description' => $row3->issue, 'startDate' => $this->human_to_unix($row3->issue_date_active)); $date_arr[] = $this->human_to_unix($row3->issue_date_active); } } $query4 = DB::table('immunizations')->where('pid', '=', $pid)->get(); if ($query4) { foreach ($query4 as $row4) { $json[] = array('title' => "<span class='timeline_event' value='" . $row4->imm_id . "' type='imm_id'>Immunization Given</span>", 'description' => $row4->imm_immunization, 'startDate' => $this->human_to_unix($row4->imm_date)); $date_arr[] = $this->human_to_unix($row4->imm_date); } } $query5 = DB::table('rx_list')->where('pid', '=', $pid)->where('rxl_date_inactive', '!=', '0000-00-00 00:00:00')->get(); if ($query5) { foreach ($query5 as $row5) { $row5a = DB::table('rx_list')->where('rxl_id', '=', $row5->rxl_id)->first(); if ($row5->rxl_sig == '') { $instructions5 = $row5->rxl_instructions; } else { $instructions5 = $row5->rxl_sig . ' ' . $row5->rxl_route . ' ' . $row5->rxl_frequency; } $description5 = $row5->rxl_medication . ' ' . $row5->rxl_dosage . ' ' . $row5->rxl_dosage_unit . ', ' . $instructions5 . ' for ' . $row5->rxl_reason; $json[] = array('title' => "<span class='timeline_event' value='" . $row5->rxl_id . "' type='rxl_id'>Medication Stopped</span>", 'description' => $description5, 'startDate' => $this->human_to_unix($row5->rxl_date_inactive)); $date_arr[] = $this->human_to_unix($row5->rxl_date_inactive); } } $query6 = DB::table('allergies')->where('pid', '=', $pid)->where('allergies_date_inactive', '=', '0000-00-00 00:00:00')->get(); if ($query6) { foreach ($query6 as $row6) { $json[] = array('title' => "<span class='timeline_event' value='" . $row6->allergies_id . "' type='allergies_id'>New Allergy</span>", 'description' => $row6->allergies_med, 'startDate' => $this->human_to_unix($row6->allergies_date_active)); $date_arr[] = $this->human_to_unix($row6->allergies_date_active); } } foreach ($json as $key => $value) { $item[$key] = $value['startDate']; } array_multisort($item, SORT_ASC, $json); asort($date_arr); $arr['start'] = reset($date_arr); $arr['end'] = end($date_arr); if ($arr['end'] - $arr['start'] >= 315569260) { $arr['granular'] = 'decade'; } if ($arr['end'] - $arr['start'] > 31556926 && $arr['end'] - $arr['start'] < 315569260) { $arr['granular'] = 'year'; } if ($arr['end'] - $arr['start'] <= 31556926) { $arr['granular'] = 'month'; } $arr['json'] = $json; echo json_encode($arr); }
/** * The Procedure for the sendfileftp function * * @param Menu $backMenu The Menu for return * * @return void */ function sendFileFTPProcedure(Menu $backMenu) { $procedure = new Procedure(); $choice = "0"; $procedure->showReturnChoice($choice); $qt_hostname = $procedure->createQuestion("Hostname: "); $hostname = $procedure->askQuestion($qt_hostname); if ($hostname === $choice) { $procedure->clearScreen(); $procedure->showMenu($backMenu, true); exit; } $qt_username = $procedure->createQuestion("Username: "******"File: "); $file = $procedure->askQuestion($qt_file); $qt_port = $procedure->createQuestion("Port [default 21]: ", 21); $port = $procedure->askQuestion($qt_port); $qt_passiveMode = $procedure->createQuestion("Switch to passive mode [y or n, default n]? ", "n"); $passiveMode = $procedure->askQuestion($qt_passiveMode); $qt_ASCIIMode = $procedure->createQuestion("Switch to ASCII mode [y or n, default n]? ", "n"); $ASCIIMode = $procedure->askQuestion($qt_ASCIIMode); $commandLine = "php " . dirname(__FILE__) . "/sendFileFTP.php " . $hostname . " " . $username . " " . $password . " " . $file; if ($port != "") { $commandLine .= " -p " . $port; } if ($passiveMode == "y") { $commandLine .= " -m"; } if ($ASCIIMode == "y") { $commandLine .= " -t"; } echo "\n"; echo shell_exec($commandLine) . "\n\n"; }