public function actionList() { $admin = new AdminListAutocomplete(CommonMedications::model(), $this); $admin->setModelDisplayName('Common Medications List'); $admin->setListFields(array('id', 'medication_drug.name')); $admin->setCustomDeleteURL('/oeadmin/CommonMedications/delete'); $admin->setCustomSaveURL('/oeadmin/CommonMedications/add'); $admin->setAutocompleteField(array('fieldName' => 'medication_id', 'jsonURL' => '/oeadmin/CommonMedications/search', 'placeholder' => 'search for medication drug')); $admin->listModel(); }
public function actionList() { $admin = new AdminListAutocomplete(CommonSystemicDisorder::model(), $this); $admin->setListFields(array('id', 'disorder.fully_specified_name')); $admin->setCustomDeleteURL('/oeadmin/CommonSystemicDisorder/delete'); $admin->setCustomSaveURL('/oeadmin/CommonSystemicDisorder/add'); $admin->setModelDisplayName('Common Systemic Disorders'); $admin->setAutocompleteField(array('fieldName' => 'disorder_id', 'jsonURL' => '/oeadmin/CommonSystemicDisorder/search', 'placeholder' => 'search for systemic disorders')); //$admin->searchAll(); $admin->listModel(); }
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(); }
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(); }
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(); }
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(); }
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(); }