本文整理汇总了PHP中Firm类的典型用法代码示例。如果您正苦于以下问题:PHP Firm类的具体用法?PHP Firm怎么用?PHP Firm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Firm类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionIsCommonOphthalmic
public function actionIsCommonOphthalmic($id)
{
$firm = Firm::model()->findByPk(Yii::app()->session['selected_firm_id']);
if ($cd = CommonOphthalmicDisorder::model()->find('disorder_id=? and subspecialty_id=?', array($id, $firm->serviceSubspecialtyAssignment->subspecialty_id))) {
echo "<option value=\"{$cd->disorder_id}\" data-order=\"{$cd->display_order}\">" . $cd->disorder->term . "</option>";
}
}
示例2: canCreateEvent
/**
* @param Firm $firm
* @param Episode $episode
* @param EventType $event_type
*
* @return bool
*/
public function canCreateEvent(Firm $firm = null, Episode $episode = null, EventType $event_type = null)
{
if ($event_type) {
if ($event_type->disabled) {
return false;
}
if (!$event_type->support_services && !$firm->getSubspecialtyID()) {
// Can't create a non-support service event for a support-service firm
return false;
}
}
if ($firm && $episode) {
return $this->canEditEpisode($firm, $episode);
}
return true;
}
示例3: actionApplications
public function actionApplications()
{
$date_from = date(Helper::NHS_DATE_FORMAT, strtotime('-1 year'));
$date_to = date(Helper::NHS_DATE_FORMAT);
if (isset($_GET['yt0'])) {
$firm = null;
if (@$_GET['firm_id'] && (int) $_GET['firm_id']) {
$firm_id = (int) $_GET['firm_id'];
if (!($firm = Firm::model()->findByPk($firm_id))) {
throw new CException("Unknown firm {$firm_id}");
}
}
if (@$_GET['date_from'] && date('Y-m-d', strtotime($_GET['date_from']))) {
$date_from = date('Y-m-d', strtotime($_GET['date_from']));
}
if (@$_GET['date_to'] && date('Y-m-d', strtotime($_GET['date_to']))) {
$date_to = date('Y-m-d', strtotime($_GET['date_to']));
}
$results = $this->getApplications($date_from, $date_to, $firm);
$filename = 'therapyapplication_report_' . date('YmdHis') . '.csv';
$this->sendCsvHeaders($filename);
echo $this->array2Csv($results);
} else {
$subspecialty = Subspecialty::model()->find('ref_spec=:ref_spec', array(':ref_spec' => 'MR'));
$context = array('firms' => Firm::model()->getList($subspecialty->id), 'date_from' => $date_from, 'date_to' => $date_to);
$this->render('applications', $context);
}
}
示例4: actionForm
/**
* @param int $patient_id
* @param int $medication_id
*/
public function actionForm($patient_id, $medication_id = null)
{
if ($medication_id == 'adherence') {
$this->renderPartial('adherence_form', array("patient" => $this->fetchModel('Patient', $patient_id)), false, true);
} else {
$this->renderPartial('form', array("patient" => $this->fetchModel('Patient', $patient_id), "medication" => $this->fetchModel('Medication', $medication_id, true), "firm" => Firm::model()->findByPk($this->selectedFirmId)), false, true);
}
}
示例5: setFirmFromSession
/**
* Sets the firm property on the controller from the session
*
* @throws HttpException
*/
protected function setFirmFromSession()
{
if (!($firm_id = Yii::app()->session->get('selected_firm_id'))) {
throw new HttpException('Firm not selected');
}
if (!$this->firm || $this->firm->id != $firm_id) {
$this->firm = Firm::model()->findByPk($firm_id);
}
}
示例6: actionList
public function actionList()
{
$search = $this->request->getParam("search");
$session = new CHttpSession();
$session->open();
$firmId = $this->request->getParam("firm_id");
$subspecialtyId = $this->request->getParam("subspecialty_id");
if ($firmId > 0 && (isset($search['filterid']['subspecialty_id']['value']) && $search['filterid']['subspecialty_id']['value'] > 0)) {
$session['lastSubspecialtyId'] = $search['filterid']['subspecialty_id']['value'];
$this->redirect('/oeadmin/LeafletSubspecialtyFirm/list?search[filterid][firm_id][value]=' . $firmId . '&subspecialty_id=' . $search['filterid']['subspecialty_id']['value']);
}
$lastSubspecialtyId = $session['lastSubspecialtyId'];
// check if it's been already set
if (!($lastSubspecialtyId > 0)) {
if (isset($search['filterid']['subspecialty_id']['value'])) {
$session['lastSubspecialtyId'] = $search['filterid']['subspecialty_id']['value'];
} else {
$session['lastSubspecialtyId'] = Firm::model()->findByPk(Yii::app()->session['selected_firm_id'])->serviceSubspecialtyAssignment->subspecialty_id;
}
}
// || ($this->request->getParam("subspecialty_id")!=$session['lastSubspecialtyId'] && $search['filterid']['firm_id']['value']=="")
if ($subspecialtyId > 0 && $subspecialtyId != $session['lastSubspecialtyId'] && isset($search['filterid']['firm_id']['value']) || $subspecialtyId == $session['lastSubspecialtyId'] && $search['filterid']['firm_id']['value'] == "") {
$session['lastSubspecialtyId'] = "";
$this->redirect('/oeadmin/LeafletSubspecialtyFirm/list?search[filterid][subspecialty_id][value]=' . $subspecialtyId);
}
if (isset($search['filterid']['firm_id']['value']) && $search['filterid']['firm_id']['value'] > 0) {
$excludeSubspecialty = true;
$excludeFirm = false;
$admin = new AdminListAutocomplete(OphTrConsent_Leaflet_Firm::model(), $this);
$admin->setCustomDeleteURL('/oeadmin/LeafletSubspecialtyFirm/deleteFirm');
} else {
$excludeSubspecialty = false;
$excludeFirm = true;
$admin = new AdminListAutocomplete(OphTrConsent_Leaflet_Subspecialty::model(), $this);
$admin->setCustomDeleteURL('/oeadmin/LeafletSubspecialtyFirm/deleteSubspecialty');
}
$admin->setListFields(array('id', 'leaflet.name'));
$admin->setCustomSaveURL('/oeadmin/LeafletSubspecialtyFirm/add');
$admin->setModelDisplayName('Leaflet-Subspecialty-Firm Assignment');
if ($subspecialtyId > 0) {
$defaultSubspecialty = $subspecialtyId;
} else {
$defaultSubspecialty = Firm::model()->findByPk(Yii::app()->session['selected_firm_id'])->serviceSubspecialtyAssignment->subspecialty_id;
}
$admin->setFilterFields(array(array('label' => 'Subspecialty', 'dropDownName' => 'subspecialty_id', 'defaultValue' => $defaultSubspecialty, 'listModel' => Subspecialty::model(), 'listIdField' => 'id', 'listDisplayField' => 'name', 'excludeSearch' => $excludeSubspecialty), array('label' => 'Firm', 'dropDownName' => 'firm_id', 'defaultValue' => null, 'listModel' => Firm::model(), 'listIdField' => 'id', 'listDisplayField' => 'name', 'emptyLabel' => '-- All --', 'dependsOnFilterName' => 'subspecialty_id', 'dependsOnDbFieldName' => 'subspecialty_id', 'dependsOnJoinedTable' => 'serviceSubspecialtyAssignment', 'excludeSearch' => $excludeFirm)));
// we set default search options
if ($this->request->getParam('search') == '') {
$admin->getSearch()->initSearch(array('filterid' => array('subspecialty_id' => Firm::model()->findByPk(Yii::app()->session['selected_firm_id'])->serviceSubspecialtyAssignment->subspecialty_id)));
}
$admin->setAutocompleteField(array('fieldName' => 'leaflet_id', 'allowBlankSearch' => 1, 'jsonURL' => '/oeadmin/LeafletSubspecialtyFirm/search', 'placeholder' => 'search for leaflets'));
//$admin->searchAll();
$admin->listModel();
}
示例7: init
public function init()
{
$modulePath = Yii::app()->assetManager->publish(Yii::getPathOfAlias('application.modules.OphDrPrescription.assets'));
Yii::app()->clientScript->registerScriptFile($modulePath . '/js/report.js', CClientScript::POS_HEAD);
if (!$this->subspecialtyId) {
$firm = Firm::model()->findByPk(Yii::app()->session['selected_firm_id']);
if (isset($firm->serviceSubspecialtyAssignment->subspecialty_id)) {
$this->subspecialtyId = $firm->serviceSubspecialtyAssignment->subspecialty_id;
}
}
if (!$this->siteId) {
$this->siteId = Yii::app()->session['selected_site_id'];
}
}
示例8: actionList
public function actionList()
{
$admin = new AdminListAutocomplete(SiteSubspecialtyDrug::model(), $this);
$admin->setListFields(array('id', 'drugs.name', 'drugs.dose_unit'));
$admin->setCustomDeleteURL('/OphDrPrescription/admin/commondrugsdelete');
$admin->setCustomSaveURL('/OphDrPrescription/admin/commondrugsadd');
$admin->setModelDisplayName('Common Drugs List');
$admin->setFilterFields(array(array('label' => 'Site', 'dropDownName' => 'site_id', 'defaultValue' => Yii::app()->session['selected_site_id'], 'listModel' => Site::model(), 'listIdField' => 'id', 'listDisplayField' => 'short_name'), array('label' => 'Subspecialty', 'dropDownName' => 'subspecialty_id', 'defaultValue' => Firm::model()->findByPk(Yii::app()->session['selected_firm_id'])->serviceSubspecialtyAssignment->subspecialty_id, 'listModel' => Subspecialty::model(), 'listIdField' => 'id', 'listDisplayField' => 'name')));
// we set default search options
if ($this->request->getParam('search') == '') {
$admin->getSearch()->initSearch(array('filterid' => array('site_id' => Yii::app()->session['selected_site_id'], 'subspecialty_id' => Firm::model()->findByPk(Yii::app()->session['selected_firm_id'])->serviceSubspecialtyAssignment->subspecialty_id)));
}
$admin->setAutocompleteField(array('fieldName' => 'drug_id', 'jsonURL' => '/OphDrPrescription/default/DrugList', 'placeholder' => 'search for drugs'));
//$admin->searchAll();
$admin->listModel();
}
示例9: actionList
public function actionList()
{
$admin = new AdminListAutocomplete(SiteSubspecialtyAnaestheticAgentDefault::model(), $this);
$admin->setListFields(array('id', 'agents.name'));
$admin->setCustomDeleteURL('/oeadmin/AnaestheticAgentDefaults/delete');
$admin->setCustomSaveURL('/oeadmin/AnaestheticAgentDefaults/add');
$admin->setModelDisplayName('Operation Note Anaesthetic Agent Defaults');
$admin->setFilterFields(array(array('label' => 'Site', 'dropDownName' => 'site_id', 'defaultValue' => Yii::app()->session['selected_site_id'], 'listModel' => Site::model(), 'listIdField' => 'id', 'listDisplayField' => 'short_name'), array('label' => 'Subspecialty', 'dropDownName' => 'subspecialty_id', 'defaultValue' => Firm::model()->findByPk(Yii::app()->session['selected_firm_id'])->serviceSubspecialtyAssignment->subspecialty_id, 'listModel' => Subspecialty::model(), 'listIdField' => 'id', 'listDisplayField' => 'name')));
// we set default search options
if ($this->request->getParam('search') == '') {
$admin->getSearch()->initSearch(array('filterid' => array('subspecialty_id' => Firm::model()->findByPk(Yii::app()->session['selected_firm_id'])->serviceSubspecialtyAssignment->subspecialty_id, 'site_id' => Yii::app()->session['selected_site_id'])));
}
$admin->setAutocompleteField(array('fieldName' => 'anaesthetic_agent_id', 'allowBlankSearch' => 1, 'jsonURL' => '/oeadmin/AnaestheticAgentDefaults/search', 'placeholder' => 'search for adding anaesthetic agent'));
//$admin->searchAll();
$admin->listModel();
}
示例10: actionList
public function actionList()
{
$admin = new AdminListAutocomplete(OphTrConsent_Leaflet_Subspecialty::model(), $this);
$admin->setListFields(array('id', 'leaflet.name'));
$admin->setCustomDeleteURL('/oeadmin/LeafletSubspecialty/delete');
$admin->setCustomSaveURL('/oeadmin/LeafletSubspecialty/add');
$admin->setModelDisplayName('Leaflet-Subspecialty Assignment');
$admin->setFilterFields(array(array('label' => 'Subspecialty', 'dropDownName' => 'subspecialty_id', 'defaultValue' => Firm::model()->findByPk(Yii::app()->session['selected_firm_id'])->serviceSubspecialtyAssignment->subspecialty_id, 'listModel' => Subspecialty::model(), 'listIdField' => 'id', 'listDisplayField' => 'name')));
// we set default search options
if ($this->request->getParam('search') == '') {
$admin->getSearch()->initSearch(array('filterid' => array('subspecialty_id' => Firm::model()->findByPk(Yii::app()->session['selected_firm_id'])->serviceSubspecialtyAssignment->subspecialty_id)));
}
$admin->setAutocompleteField(array('fieldName' => 'leaflet_id', 'jsonURL' => '/oeadmin/LeafletSubspecialty/search', 'placeholder' => 'search for leaflets'));
//$admin->searchAll();
$admin->listModel();
}
示例11: criteria
public function criteria($count = false)
{
$criteria = new CDbCriteria();
if (@$_REQUEST['hos_num']) {
$criteria->addCondition('`dil`.`patient_number` = :hos_num');
$criteria->params[':hos_num'] = $_REQUEST['hos_num'];
}
if (@$_REQUEST['file_name']) {
$criteria->addCondition('file_name = :file_name');
$criteria->params[':file_name'] = $_REQUEST['file_name'];
}
if (@$_REQUEST['firm_id']) {
$firm = Firm::model()->findByPk($_REQUEST['firm_id']);
$firm_ids = array();
foreach (Firm::model()->findAll('name=?', array($firm->name)) as $firm) {
$firm_ids[] = $firm->id;
}
if (!empty($firm_ids)) {
$criteria->addInCondition('firm_id', $firm_ids);
}
}
if (@$_REQUEST['action']) {
$criteria->addCondition('action_id=:action_id');
$criteria->params[':action_id'] = $_REQUEST['action'];
}
if (@$_REQUEST['target_type']) {
$criteria->addCondition('type_id=:type_id');
$criteria->params[':type_id'] = $_REQUEST['target_type'];
}
if (@$_REQUEST['event_type_id']) {
$criteria->addCondition('event_type_id=:event_type_id');
$criteria->params[':event_type_id'] = $_REQUEST['event_type_id'];
}
if (@$_REQUEST['date_from']) {
$date_from = Helper::convertNHS2MySQL($_REQUEST['date_from']) . ' 00:00:00';
$criteria->addCondition('`t`.created_date >= :date_from');
$criteria->params[':date_from'] = $date_from;
}
if (@$_REQUEST['date_to']) {
$date_to = Helper::convertNHS2MySQL($_REQUEST['date_to']) . ' 23:59:59';
$criteria->addCondition('`t`.created_date <= :date_to');
$criteria->params[':date_to'] = $date_to;
}
// !($count) && $criteria->join = 'left join event on t.event_id = event.id left join event_type on event.event_type_id = event_type.id';
return $criteria;
}
示例12: actionList
public function actionList()
{
$admin = new AdminListAutocomplete(OphTrOperationnote_PostopSiteSubspecialtyDrug::model(), $this);
$admin->setListFields(array('id', 'postopdrugs.name', 'default'));
$admin->setCustomDeleteURL('/oeadmin/PostOpDrugMappings/delete');
$admin->setCustomSaveURL('/oeadmin/PostOpDrugMappings/add');
$admin->setCustomSetDefaultURL('/oeadmin/PostOpDrugMappings/setDefault');
$admin->setCustomRemoveDefaultURL('/oeadmin/PostOpDrugMappings/RemoveDefault');
$admin->setModelDisplayName('Per-operative Drugs Mapping');
$admin->setFilterFields(array(array('label' => 'Site', 'dropDownName' => 'site_id', 'defaultValue' => Yii::app()->session['selected_site_id'], 'listModel' => Site::model(), 'listIdField' => 'id', 'listDisplayField' => 'short_name'), array('label' => 'Subspecialty', 'dropDownName' => 'subspecialty_id', 'defaultValue' => Firm::model()->findByPk(Yii::app()->session['selected_firm_id'])->serviceSubspecialtyAssignment->subspecialty_id, 'listModel' => Subspecialty::model(), 'listIdField' => 'id', 'listDisplayField' => 'name')));
// we set default search options
if ($this->request->getParam('search') == '') {
$admin->getSearch()->initSearch(array('filterid' => array('subspecialty_id' => Firm::model()->findByPk(Yii::app()->session['selected_firm_id'])->serviceSubspecialtyAssignment->subspecialty_id, 'site_id' => Yii::app()->session['selected_site_id'])));
}
$admin->setAutocompleteField(array('fieldName' => 'drug_id', 'jsonURL' => '/oeadmin/PostOpDrugMappings/search', 'placeholder' => 'search for adding per op drug'));
//$admin->searchAll();
$admin->listModel();
}
示例13: run
public function run()
{
if ($this->element) {
$this->class = CHTML::modelName($this->element);
} else {
$this->class = get_class($this);
}
if (empty($_POST) || !array_key_exists($this->class, $_POST)) {
if (empty($this->element->event_id)) {
if ($this->default) {
// It's a new event so fetch the most recent element_diagnosis
$firmId = Yii::app()->session['selected_firm_id'];
$firm = Firm::model()->findByPk($firmId);
if (isset(Yii::app()->getController()->patient)) {
$patientId = Yii::app()->getController()->patient->id;
$episode = Episode::getCurrentEpisodeByFirm($patientId, $firm, true);
if ($episode && ($disorder = $episode->diagnosis)) {
// There is a diagnosis for this episode
$this->value = $disorder->id;
$this->label = $disorder->term;
}
}
}
} else {
if (isset($this->element->disorder)) {
$this->value = $this->element->disorder->id;
$this->label = $this->element->disorder->term;
}
}
} elseif (array_key_exists($this->field, $_POST[$this->class])) {
if (preg_match('/[^\\d]/', $_POST[$this->class][$this->field])) {
if ($disorder = Disorder::model()->find('term=? and specialty_id is not null', array($_POST[$this->class][$this->field]))) {
$this->value = $disorder->id;
$this->label = $disorder->term;
}
} else {
$this->value = $_POST[$this->class][$this->field];
if ($disorder = Disorder::model()->findByPk($this->value)) {
$this->label = $disorder->term;
}
}
}
parent::run();
}
示例14: findWorkflow
/**
* Finds the best matching workflow
* @param integer $firm_id
* @param integer $status_id
* @return OphCiExamination_Workflow
*/
public static function findWorkflow($firm_id, $status_id)
{
$subspecialty_id = null;
if ($firm = \Firm::model()->findByPk($firm_id)) {
$subspecialty_id = $firm->serviceSubspecialtyAssignment ? $firm->serviceSubspecialtyAssignment->subspecialty_id : null;
}
if ($rule = OphCiExamination_Workflow_Rule::model()->find('subspecialty_id=? and firm_id=? and episode_status_id=?', array($subspecialty_id, $firm_id, $status_id))) {
return $rule->workflow;
}
if ($rule = OphCiExamination_Workflow_Rule::model()->find('subspecialty_id=? and episode_status_id=?', array($subspecialty_id, $status_id))) {
return $rule->workflow;
}
if ($rule = OphCiExamination_Workflow_Rule::model()->find('subspecialty_id=?', array($subspecialty_id))) {
return $rule->workflow;
}
if ($rule = OphCiExamination_Workflow_Rule::model()->find('subspecialty_id is null and episode_status_id is null')) {
return $rule->workflow;
}
throw new \CException('Cannot find default workflow rule');
}
示例15: actionCommonDrugs
/**
* @description Common drugs administration page - it lists the common drugs based on site and subspecialty
*
* @return html (rendered page)
*/
public function actionCommonDrugs()
{
/*
* We try to set default values for the selects
*/
if (isset($_GET['site_id'])) {
$activeSite = $_GET['site_id'];
} else {
$activeSite = Yii::app()->session['selected_site_id'];
}
if (isset($_GET['subspecialty_id'])) {
$activeSubspecialty = $_GET['subspecialty_id'];
} else {
$firm = Firm::model()->findByPk(Yii::app()->session['selected_firm_id']);
if (isset($firm->serviceSubspecialtyAssignment->subspecialty_id)) {
$activeSubspecialty = $firm->serviceSubspecialtyAssignment->subspecialty_id;
} else {
$activeSubspecialty = null;
}
}
$this->render('druglist', array('selectedsite' => $activeSite, 'selectedsubspecialty' => $activeSubspecialty, 'site_subspecialty_drugs' => Element_OphDrPrescription_Details::model()->commonDrugsBySiteAndSpec($activeSite, $activeSubspecialty)));
}