/// <summary> /// The issuances are saved in a single DrugManager. /// The drugManager associated the prescribed drug and the patient registry /// </summary> /// <param name="prescibedMedication">List of drug Issuances . /// drug inssuance consist of drug,administration,dosage and frequency</param> public void savePrescribedMedication(List <DrugIssuance> prescibedMedication) { DrugIssuance drugIssuance; DrugManager drugManager = new DrugManager { Clinic_registry_manager = SingletonClinicRegistry.GetInstance(db) }; foreach (DrugIssuance issuance in prescibedMedication) { drugIssuance = new DrugIssuance { IssuedDrug = db.Drugs.Find(issuance.IssuedDrug.Drug_id), Medication_administration = db.DrugAdministrations.Find(issuance.Medication_administration.Administration_Id), Medication_dosage = db.DrugDosages.Find(issuance.Medication_dosage.Dosage_id), Medication_frequency = db.DrugFrequencies.Find(issuance.Medication_frequency.Frequency_id), Medication_end_date = issuance.Medication_end_date, Medication_start_date = issuance.Medication_start_date, Medication_manager = drugManager }; db.DrugInssuances.Add(drugIssuance); } db.SaveChanges(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "") { IQCareMsgBox.Show("SessionExpired", this); Response.Redirect("~/frmlogin.aspx", true); } IDrugMst DrugManager; try { if (!IsPostBack) { //(Master.FindControl("lblRoot") as Label).Text = " » Customize Lists"; //(Master.FindControl("lblMark") as Label).Visible = false; //(Master.FindControl("lblheader") as Label).Text = "TB Regimen"; (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Text = "Customize Lists"; (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text = " >> TB Regimen"; DrugManager = (IDrugMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDrugMst, BusinessProcess.Administration"); DataSet theDS = DrugManager.GetAllTBRegimenGeneric(); MakeRegimenGenericList(theDS);//11Mar08 } } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareMsgBox.Show("#C1", theBuilder, this); return; } finally { DrugManager = null; } }
public static Dictionary <string, Trigger> CreateTriggersDict() { // Create our triggers menu Dictionary <string, Trigger> triggersDict = new Dictionary <string, Trigger>(); triggersDict.Add("Filler/First", new Trigger { type = Trigger.Type.FIRST }); triggersDict.Add("Filler/Random", new Trigger { type = Trigger.Type.RANDOM }); triggersDict.Add("Events/Special/Cute Sneeze", new CuteSneezeTrigger()); triggersDict.Add("Events/Overdose/Any", new Trigger { type = Trigger.Type.OVERDOSE }); foreach (string drug in DrugManager.GetDrugs()) { triggersDict.Add("Events/Low Dose/" + drug, new DrugTrigger(drug)); triggersDict.Add("Events/Medium Dose/" + drug, new DrugTrigger(drug, 5)); triggersDict.Add("Events/High Dose/" + drug, new DrugTrigger(drug, 10)); triggersDict.Add("Events/Overnight Change/" + drug, new OvernightChangeTrigger(drug)); triggersDict.Add("Events/Overdose/" + drug, new OverdoseTrigger(drug)); } return(triggersDict); }
protected void Page_Load(object sender, EventArgs e) { IDrugMst DrugManager; try { if (!IsPostBack) { (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Text = "Customize Lists"; (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text = " >> Regimen"; DrugManager = (IDrugMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDrugMst, BusinessProcess.Administration"); DataSet theDS = DrugManager.GetAllRegimenGeneric(); MakeRegimenGenericList(theDS);//11Mar08 } } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareMsgBox.Show("#C1", theBuilder, this); return; } finally { DrugManager = null; } }
//药品明细对话框 public static void CreateDrugEditControl(Drug d) { XtraDialogArgs xda = new XtraDialogArgs() { Caption = "药品明细框", Content = new DrugEditControl(d), Buttons = new DialogResult[] { DialogResult.OK, DialogResult.Cancel } }; xda.Showing += (s, e) => { e.Buttons[DialogResult.OK].Text = "保存"; e.Buttons[DialogResult.Cancel].Text = "取消"; e.Buttons[DialogResult.OK].Click += (x, y) => { DrugEditControl dec = xda.Content as DrugEditControl; Drug dd = dec.GetDrug(); int count = new DrugManager().Update(dd); if (count > 0) { XtraMessageBox.Show("更新成功", "信息提示"); } }; }; XtraDialog.Show(xda); }
void CreateDrugsMenu() { // Create our triggers menu drugsMenu = new GenericMenu(); foreach (string drug in DrugManager.GetDrugs()) { drugsMenu.AddItem(new GUIContent(drug), false, clickHandler, drug); } }
private void gridView1_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e) { Drug drug = e.Row as Drug; int count = new DrugManager().Update(drug); if (count > 0) { MessageBox.Show("更新成功"); } }
public static bool ApiCreateNewDrugForUser(ApiDrugPost model) { return(DrugManager.AddDrugForUser(model.user_id, model.doctor_id, model.drug_type, model.frequency_admission, model.features_reception, model.name, model.period, model.time)); }
public int ImportDrug(string filePath) { DataTable dtDrug = ExcelHelper.ImportExceltoDt(filePath); List <Drug> allDrug = new DrugManager().GetAll(); List <Drug> li = DataTableToModel.ToListModel <Drug>(dtDrug).Where(item => !allDrug.Contains(item)).ToList(); PinyinHelper ph = new PinyinHelper(); li.ForEach(item => item.searchcode = ph.GetFirstLetter(item.name)); int count = new DrugManager().Insert(li); return(count); }
public void BindControl(int id) { IDrugMst DrugManager; BindFunctions BindManager = new BindFunctions(); DrugManager = (IDrugMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDrugMst, BusinessProcess.Administration"); DataSet theDS = DrugManager.GetRegimenGeneric(id); if (theDS.Tables[0].Rows.Count > 0) { DataTable SelectedDataTable = MakeSelectedTable(); foreach (DataRow r in theDS.Tables[0].Rows) { DataRow theDR; theDR = SelectedDataTable.NewRow(); theDR[0] = Convert.ToInt32(r["GenericID"].ToString()); if (r["GenericAbbrevation"].ToString() != "") { theDR[1] = r["GenericName"].ToString() + "-[" + r["GenericAbbrevation"] + "]"; } else { theDR[1] = r["GenericName"].ToString(); } SelectedDataTable.Rows.Add(theDR); } ViewState["SelGeneric"] = SelectedDataTable; DataTable theDT = theDS.Tables[0]; txtRegimenCode.Text = Convert.ToString(theDS.Tables[0].Rows[0]["RegimenCode"]); txtRegimenName.Text = Convert.ToString(theDS.Tables[0].Rows[0]["RegimenName"]); ddStage.SelectedValue = Convert.ToString(theDS.Tables[0].Rows[0]["stage"]); txtSeqNo.Text = Convert.ToString(theDS.Tables[0].Rows[0]["SRNo"]); if (theDS.Tables[0].Rows[0]["Status"].ToString() == "Active") { ddStatus.SelectedValue = "0"; } else if (theDS.Tables[0].Rows[0]["Status"].ToString() == "In-Active") { ddStatus.SelectedValue = "1"; } BindManager.BindList(lstGeneric, theDT, "GenericName", "GenericID"); txtRegimenName.Enabled = false; txtRegimenCode.Enabled = false; lstGeneric.Enabled = false; ddStage.Enabled = true; btnAddGeneric.Enabled = true; btnSave.Text = "Update"; } }
///////////////////////////////////////////////////////////////////// // Code Written By : Sanjay Rana // Written Date : 25th July 2006 // Modification Date : // Description : Drug List // /// ///////////////////////////////////////////////////////////////// protected void Page_Load(object sender, EventArgs e) { IDrugMst DrugManager; try { if (!IsPostBack) { //(Master.FindControl("lblRoot") as Label).Text = " » Customize Lists"; //(Master.FindControl("lblMark") as Label).Visible = false; //(Master.FindControl("lblheader") as Label).Text = "Drugs"; (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Text = "Customize Lists >> "; (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text = "Drugs"; DrugManager = (IDrugMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDrugMst, BusinessProcess.Administration"); //pr_Admin_SelectDrug_Constella DataSet theDS = DrugManager.GetDrug(); MakeDrugList(theDS);//11Mar08 //--------- 11Mar08--------- //string theStr; //foreach (DataRow theDR in theDS.Tables[0].Rows) //{ // theStr = theDR["DrugGeneric"].ToString(); // if (theStr.IndexOf("/") != -1) // theStr = theStr.Replace("/", "/ "); // theDR["DrugGeneric"] = theStr; // theStr = theDR["GenericAbbv"].ToString(); // if (theStr.IndexOf("/") != -1) // theStr = theStr.Replace("/", "/ "); // theDR["GenericAbbv"] = theStr; //} //grdMasterDrugs.DataSource = theDS.Tables[0]; //BindGrid(); //-------------------------- } } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareMsgBox.Show("#C1", theBuilder, this); return; } finally { DrugManager = null; } }
public DrugUserControl() { InitializeComponent(); List <string> sss = checkedComboBoxEdit1.Properties.Items.GetCheckedValues().ConvertAll(item => Convert.ToString(item)); List <Drug> drugs = new DrugManager().GetAll().Where(item => sss.Contains(item.cate)).ToList();; this.pagerNavigator1.GC = this.gridControl1; this.pagerNavigator1.SetData(drugs); this.gridView1.RowClick += (s, e) => { if (e.Clicks == 2) { Drug drug = gridView1.GetRow(e.RowHandle) as Drug; DialogFactory.CreateDrugEditControl(drug); } }; #region 单击查询按钮 btnQuery.Click += (s, e) => { Drug drug = new Drug() { name = buttonEdit1.Text, address = textEdit2.Text, form = textEdit3.Text }; List <string> checkedValue = checkedComboBoxEdit1.Properties.Items.GetCheckedValues().ConvertAll(item => Convert.ToString(item)); List <Drug> li = new DrugManager().GetList(drug).Where(item => checkedValue.Contains(item.cate)).ToList(); // gridControl1.DataSource = li; this.pagerNavigator1.SetData(li); }; #endregion #region 单击查询全部按钮 btnQueryAll.Click += (s, e) => { checkedComboBoxEdit1.CheckAll(); List <Drug> li = new DrugManager().GetAll(); // gridControl1.DataSource = li; this.pagerNavigator1.SetData(li); }; #endregion #region 单击重置按钮 btnReset.Click += (s, e) => { buttonEdit1.Text = textEdit2.Text = textEdit3.Text = string.Empty; }; #endregion }
private void GetMasters() { IDrugMst DrugManager; try { DataSet theDSXML = new DataSet(); theDSXML.ReadXml(MapPath("..\\XMLFiles\\DrugMasters.con")); if (theDSXML.Tables["Mst_DrugType"] != null)//10Mar08 -- put conditios { DataView theDrugTypeView = new DataView(theDSXML.Tables["Mst_DrugType"].Copy()); theDrugTypeView.Sort = "DrugTypeName asc"; theMasterDS.Tables.Add(theDrugTypeView.ToTable()); // table 0 DrugManager = (IDrugMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDrugMst, BusinessProcess.Administration"); DataSet theDS = new DataSet(); theDS = (DataSet)DrugManager.GetAllDropDowns();//pr_Admin_GetDrugDropDowns_Constella //all GenID,GenName,GenAbbr,DrugTypeID,DelFlag DataView theDV; DataTable theDT; // incase of add OR Active if ((Request.QueryString["Status"] == null) || (Request.QueryString["Status"].ToString() == "Active")) { theDV = new DataView(theDS.Tables[0]); theDV.RowFilter = "DeleteFlag=0"; theDT = theDV.Table; theMasterDS.Tables.Add(theDT.Copy());//get only active generics // table 1 } else if (Request.QueryString["Status"].ToString() == "InActive") { theMasterDS.Tables.Add(theDS.Tables[0].Copy()); // get list of all generics // table 1 } theMasterDS.Tables.Add(theDSXML.Tables["Mst_Strength"].Copy()); // table 2 theMasterDS.Tables.Add(theDSXML.Tables["Mst_Frequency"].Copy()); // table 3 theMasterDS.Tables.Add(theDSXML.Tables["Mst_DrugSchedule"].Copy()); // table 4 } } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareMsgBox.Show("#C1", theBuilder, this); } finally { DrugManager = null; } }
protected void Page_Load(object sender, EventArgs e) { if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "") { IQCareMsgBox.Show("SessionExpired", this); Response.Redirect("~/frmlogin.aspx", true); } IDrugMst DrugManager; try { if (!IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["Fid"])) { ViewState["FID"] = Request.QueryString["Fid"].ToString(); } DrugManager = (IDrugMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDrugMst, BusinessProcess.Administration"); DataSet theDS = DrugManager.GetDrug(0); MakeDrugList(theDS); AuthenticationManager Authentication = new AuthenticationManager(); if (Authentication.HasFunctionRight(22, FunctionAccess.Add, (DataTable)Session["UserRight"]) == false) { btnAdd.Enabled = false; } } } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareMsgBox.Show("#C1", theBuilder, this); return; } finally { DrugManager = null; } }
private void Init_Page() { DataTable dt = new DataTable(); if (Page.IsPostBack != true) { GetMasters(); FillDropDowns(); if (Request.QueryString["name"] == "Add") { lblH2.Text = "Add Drug"; Session["ExistDrugId"] = 0; } else if (Request.QueryString["name"] == "Edit") { IDrugMst DrugManager; BindFunctions BindManager = new BindFunctions(); lblH2.Text = "Edit Drug"; int drug_pk = Convert.ToInt32(Request.QueryString["DrugId"]); Session["ExistDrugId"] = drug_pk; DrugManager = (IDrugMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDrugMst, BusinessProcess.Administration"); DataSet theDS = DrugManager.GetDrug(drug_pk); dt = theDS.Tables[0]; ddlDrugType.SelectedValue = dt.Rows[0]["DrugTypeId"].ToString(); txtDrugName.Text = dt.Rows[0]["DrugName"].ToString(); txtDrugAbbre.Text = dt.Rows[0]["GenericAbbrevation"].ToString(); ddlPurchaseUnit.SelectedValue = dt.Rows[0]["PurchaseUnit"].ToString(); txtPurchaseUnitQty.Text = dt.Rows[0]["QtyPerPurchaseUnit"].ToString(); ddlDispensingUnit.SelectedValue = dt.Rows[0]["DispensingUnit"].ToString(); ddlIsSyrup.SelectedValue = dt.Rows[0]["Syrup"].ToString(); ddStatus.Text = dt.Rows[0]["Status"].ToString(); } } }
/// <summary> /// 绑定主药下拉框 /// </summary> /// <param name="dataSource"></param> private void BindMainDrug() { // 绑定主药 var drugIds = list.Select(s => s.ydrug_id).Distinct().ToList(); DrugManager drugManager = new DrugManager(); var drugList = drugManager.GetAll(s => drugIds.Contains(s.drug_code)) .OrderBy(s => s.drug_name) .ThenBy(s => s.drug_form) .ThenBy(s => s.drug_spec) .Select(s => new { ydrug_id = s.drug_code, ydrug_name = s.drug_name + " " + s.drug_spec + " " + s.drug_form }).ToList(); //var drugList = dataSource.GroupBy(m => new { m.ydrug_name, m.ydrug_spec }).Select(a => new { ydrug_name = string.Format("{0}({1})", a.Key.ydrug_name, a.Key.ydrug_spec), ydrug_id = string.Format("{0}|{1}", a.Key.ydrug_name, a.Key.ydrug_spec) }).ToList(); drugList.Insert(0, new { ydrug_id = "", ydrug_name = "全部" }); this.cb_drug.DisplayMemberPath = "ydrug_name"; this.cb_drug.SelectedValuePath = "ydrug_id"; this.cb_drug.ItemsSource = drugList; this.cb_drug.SelectedIndex = 0; }
///////////////////////////////////////////////////////////////////// // Code Written By : Sanjay Rana // Written Date : 25th July 2006 // Modification Date : // Description : Drug List // /// ///////////////////////////////////////////////////////////////// protected void Page_Load(object sender, EventArgs e) { if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "") { IQCareMsgBox.Show("SessionExpired", this); Response.Redirect("~/frmlogin.aspx", true); } IDrugMst DrugManager; try { if (!IsPostBack) { //(Master.FindControl("lblRoot") as Label).Text = " » Customize Lists"; //(Master.FindControl("lblMark") as Label).Visible = false; //(Master.FindControl("lblheader") as Label).Text = "Drugs"; //(Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Text = "Customize Lists >> "; //(Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text = "Drugs"; //checking the NULL condition, if user close the page without doing anything...... //ViewState["FID"] = Request.QueryString["Fid"].ToString(); commented on 23 Jan 2014 if (!string.IsNullOrEmpty(Request.QueryString["Fid"])) { ViewState["FID"] = Request.QueryString["Fid"].ToString(); } DrugManager = (IDrugMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDrugMst, BusinessProcess.Administration"); //pr_Admin_SelectDrug_Constella DataSet theDS = DrugManager.GetDrug(); MakeDrugList(theDS);//11Mar08 //--------- 11Mar08--------- //string theStr; //foreach (DataRow theDR in theDS.Tables[0].Rows) //{ // theStr = theDR["DrugGeneric"].ToString(); // if (theStr.IndexOf("/") != -1) // theStr = theStr.Replace("/", "/ "); // theDR["DrugGeneric"] = theStr; // theStr = theDR["GenericAbbv"].ToString(); // if (theStr.IndexOf("/") != -1) // theStr = theStr.Replace("/", "/ "); // theDR["GenericAbbv"] = theStr; //} //grdMasterDrugs.DataSource = theDS.Tables[0]; //BindGrid(); //-------------------------- AuthenticationManager Authentication = new AuthenticationManager(); if (Authentication.HasFunctionRight(22, FunctionAccess.Add, (DataTable)Session["UserRight"]) == false) { btnAdd.Enabled = false; } //if (Authentication.HasFunctionRight(Convert.ToInt32(ViewState["FID"]), FunctionAccess.Add, (DataTable)Session["UserRight"]) == false) //{ // btnAdd.Enabled = false; //} } } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareMsgBox.Show("#C1", theBuilder, this); return; } finally { DrugManager = null; } }
void Awake() { instance = this; }
public static List <DrugModel> ApiGetDrugListForUser(int userId) { return(DrugManager.GetDrugListForUser(userId)); }
private List <DrugIssuance> GetListIssuances(DrugManager manager) { return((db.DrugInssuances.Where(x => x.Medication_manager.MedicationManager_id == manager.MedicationManager_id)).ToList()); }