当前位置: 首页>>代码示例>>PHP>>正文


PHP Firm::model方法代码示例

本文整理汇总了PHP中Firm::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Firm::model方法的具体用法?PHP Firm::model怎么用?PHP Firm::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Firm的用法示例。


在下文中一共展示了Firm::model方法的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>";
     }
 }
开发者ID:code-4-england,项目名称:OpenEyes,代码行数:7,代码来源:DisorderController.php

示例2: 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);
     }
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:28,代码来源:ReportController.php

示例3: 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);
     }
 }
开发者ID:openeyeswales,项目名称:OpenEyes,代码行数:12,代码来源:MedicationController.php

示例4: 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);
     }
 }
开发者ID:code-4-england,项目名称:OpenEyes,代码行数:14,代码来源:BaseModuleController.php

示例5: 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();
 }
开发者ID:code-4-england,项目名称:OpenEyes,代码行数:53,代码来源:LeafletSubspecialtyFirmController.php

示例6: 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'];
     }
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:14,代码来源:ReportController.php

示例7: 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();
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:16,代码来源:CommonDrugAdminController.php

示例8: 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();
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:16,代码来源:AnaestheticAgentDefaultsController.php

示例9: 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();
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:16,代码来源:LeafletSubspecialtyController.php

示例10: 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;
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:46,代码来源:DicomLogViewerController.php

示例11: 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();
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:18,代码来源:PostOpDrugMappingsController.php

示例12: 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();
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:44,代码来源:DiagnosisSelection.php

示例13: 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');
 }
开发者ID:across-health,项目名称:OphCiExamination,代码行数:26,代码来源:OphCiExamination_Workflow_Rule.php

示例14: 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)));
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:27,代码来源:AdminController.php

示例15: actionForm

 /**
  * @param int $patientId
  * @param int $medicationId
  */
 public function actionForm($patientId, $medicationId = null, $prescriptionItemId = null)
 {
     if ($medicationId == 'adherence') {
         $this->renderPartial('adherence_form', array('patient' => $this->fetchModel('Patient', $patientId)), false, true);
     } else {
         if ($medicationId) {
             $medication = $this->fetchModel('Medication', $medicationId, true);
         } elseif ($prescriptionItemId) {
             if ($api = Yii::app()->moduleAPI->get('OphDrPrescription')) {
                 $medication = $api->getMedicationForPrescriptionItem($patientId, $prescriptionItemId);
                 if (!$medication) {
                     throw new CHttpException(404, 'Could not get medication for prescription item.');
                 }
             } else {
                 throw new CHttpException(400, 'Missing prescription item or module');
             }
         } else {
             $medication = new Medication();
         }
         $this->renderPartial('form', array('patient' => $this->fetchModel('Patient', $patientId), 'medication' => $medication, 'firm' => Firm::model()->findByPk($this->selectedFirmId)), false, true);
     }
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:26,代码来源:MedicationController.php


注:本文中的Firm::model方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。