public function getBillingFacilities() { if ($this->F == null) { $this->F = MatchaModel::setSenchaModel('App.model.administration.Facility'); } $argumentSQL['SELECT'] = "id AS option_value, `name` AS option_name"; $argumentSQL['WHERE'] = "active = '1' AND billing_location = '1'"; $records = $this->F->buildSQL($argumentSQL)->all(); foreach ($records as $i => $record) { $records[$i]['option_value'] = intval($record['option_value']); } return $records; }
public function getActiveLaboratoryTypes() { $records = []; $sqlStatement['SELECT'] = "id, code_text_short, parent_name, loinc_name"; $sqlStatement['WHERE'] = "id = parent_id AND active = '1'"; $sqlStatement['ORDER'] = "parent_name ASC"; foreach ($this->LO->buildSQL($sqlStatement)->all() as $row) { $row->label = $row->code_text_short == '' || $row->code_text_short == null ? $row->parent_name : $row->code_text_short; $row->fields = $this->getLabObservationFieldsByParentId($row->id); $records[] = $row; } return $records; }