private void gridPat_CellDoubleClick(object sender, ODGridClickEventArgs e) { PatField field = PatFields.GetByName(PatFieldDefs.List[e.Row].FieldName, listPatientFields); if (field == null) { field = new PatField(); field.PatNum = PatCur.PatNum; field.FieldName = PatFieldDefs.List[e.Row].FieldName; if (PatFieldDefs.List[e.Row].FieldType == PatFieldType.Text) { FormPatFieldEdit FormPF = new FormPatFieldEdit(field); FormPF.IsNew = true; FormPF.ShowDialog(); } if (PatFieldDefs.List[e.Row].FieldType == PatFieldType.PickList) { FormPatFieldPickEdit FormPF = new FormPatFieldPickEdit(field); FormPF.IsNew = true; FormPF.ShowDialog(); } if (PatFieldDefs.List[e.Row].FieldType == PatFieldType.Date) { FormPatFieldDateEdit FormPF = new FormPatFieldDateEdit(field); FormPF.IsNew = true; FormPF.ShowDialog(); } if (PatFieldDefs.List[e.Row].FieldType == PatFieldType.Checkbox) { FormPatFieldCheckEdit FormPF = new FormPatFieldCheckEdit(field); FormPF.IsNew = true; FormPF.ShowDialog(); } if (PatFieldDefs.List[e.Row].FieldType == PatFieldType.Currency) { FormPatFieldCurrencyEdit FormPF = new FormPatFieldCurrencyEdit(field); FormPF.IsNew = true; FormPF.ShowDialog(); } } else { if (PatFieldDefs.List[e.Row].FieldType == PatFieldType.Text) { FormPatFieldEdit FormPF = new FormPatFieldEdit(field); FormPF.ShowDialog(); } if (PatFieldDefs.List[e.Row].FieldType == PatFieldType.PickList) { FormPatFieldPickEdit FormPF = new FormPatFieldPickEdit(field); FormPF.ShowDialog(); } if (PatFieldDefs.List[e.Row].FieldType == PatFieldType.Date) { FormPatFieldDateEdit FormPF = new FormPatFieldDateEdit(field); FormPF.ShowDialog(); } if (PatFieldDefs.List[e.Row].FieldType == PatFieldType.Checkbox) { FormPatFieldCheckEdit FormPF = new FormPatFieldCheckEdit(field); FormPF.ShowDialog(); } if (PatFieldDefs.List[e.Row].FieldType == PatFieldType.Currency) { FormPatFieldCurrencyEdit FormPF = new FormPatFieldCurrencyEdit(field); FormPF.ShowDialog(); } } FillGridPat(); }
///<summary>Opens the appropriate form to edit the patient field. The patField argument can be null or the patFieldDef argument can be null, ///but they cannot both be null.</summary> public static void OpenPatField(PatField patField, PatFieldDef patFieldDef, long patNum, bool isForOrtho = false) { if (patFieldDef != null) { if (patField == null) { patField = new PatField(); patField.PatNum = patNum; patField.FieldName = patFieldDef.FieldName; if (patFieldDef.FieldType == PatFieldType.Text) { FormPatFieldEdit FormPF = new FormPatFieldEdit(patField); FormPF.IsLaunchedFromOrtho = isForOrtho; FormPF.IsNew = true; FormPF.ShowDialog(); } if (patFieldDef.FieldType == PatFieldType.PickList) { FormPatFieldPickEdit FormPF = new FormPatFieldPickEdit(patField); FormPF.IsNew = true; FormPF.ShowDialog(); } if (patFieldDef.FieldType == PatFieldType.Date) { FormPatFieldDateEdit FormPF = new FormPatFieldDateEdit(patField); FormPF.IsNew = true; FormPF.ShowDialog(); } if (patFieldDef.FieldType == PatFieldType.Checkbox) { FormPatFieldCheckEdit FormPF = new FormPatFieldCheckEdit(patField); FormPF.IsNew = true; FormPF.ShowDialog(); } if (patFieldDef.FieldType == PatFieldType.Currency) { FormPatFieldCurrencyEdit FormPF = new FormPatFieldCurrencyEdit(patField); FormPF.IsNew = true; FormPF.ShowDialog(); } if (patFieldDef.FieldType == PatFieldType.InCaseOfEmergency) { //Deprecated } } else //edit existing patfield { if (patFieldDef.FieldType == PatFieldType.Text) { FormPatFieldEdit FormPF = new FormPatFieldEdit(patField); FormPF.IsLaunchedFromOrtho = isForOrtho; FormPF.ShowDialog(); } if (patFieldDef.FieldType == PatFieldType.PickList) { FormPatFieldPickEdit FormPF = new FormPatFieldPickEdit(patField); FormPF.ShowDialog(); } if (patFieldDef.FieldType == PatFieldType.Date) { FormPatFieldDateEdit FormPF = new FormPatFieldDateEdit(patField); FormPF.ShowDialog(); } if (patFieldDef.FieldType == PatFieldType.Checkbox) { FormPatFieldCheckEdit FormPF = new FormPatFieldCheckEdit(patField); FormPF.ShowDialog(); } if (patFieldDef.FieldType == PatFieldType.Currency) { FormPatFieldCurrencyEdit FormPF = new FormPatFieldCurrencyEdit(patField); FormPF.ShowDialog(); } if (patFieldDef.FieldType == PatFieldType.InCaseOfEmergency) { //Deprecated } } } else if (patField != null) //PatField for a PatFieldDef that no longer exists { FormPatFieldEdit FormPF = new FormPatFieldEdit(patField); FormPF.IsLaunchedFromOrtho = isForOrtho; FormPF.ShowDialog(); } }
private void gridPatInfo_CellDoubleClick(object sender,ODGridClickEventArgs e) { if(TerminalActives.PatIsInUse(PatCur.PatNum)) { MsgBox.Show(this,"Patient is currently entering info at a reception terminal. Please try again later."); return; } if(gridPatInfo.Rows[e.Row].Tag!=null) { //patfield string tag=gridPatInfo.Rows[e.Row].Tag.ToString(); tag=tag.Substring(8);//strips off all but the number: PatField1 int index=PIn.Int(tag); PatField field=PatFields.GetByName(PatFieldDefs.List[index].FieldName,_patFieldList); if(field==null) { field=new PatField(); field.PatNum=PatCur.PatNum; field.FieldName=PatFieldDefs.List[index].FieldName; if(PatFieldDefs.List[index].FieldType==PatFieldType.Text) { FormPatFieldEdit FormPF=new FormPatFieldEdit(field); FormPF.IsNew=true; FormPF.ShowDialog(); } if(PatFieldDefs.List[index].FieldType==PatFieldType.PickList) { FormPatFieldPickEdit FormPF=new FormPatFieldPickEdit(field); FormPF.IsNew=true; FormPF.ShowDialog(); } if(PatFieldDefs.List[index].FieldType==PatFieldType.Date) { FormPatFieldDateEdit FormPF=new FormPatFieldDateEdit(field); FormPF.IsNew=true; FormPF.ShowDialog(); } if(PatFieldDefs.List[index].FieldType==PatFieldType.Checkbox) { FormPatFieldCheckEdit FormPF=new FormPatFieldCheckEdit(field); FormPF.IsNew=true; FormPF.ShowDialog(); } if(PatFieldDefs.List[index].FieldType==PatFieldType.Currency) { FormPatFieldCurrencyEdit FormPF=new FormPatFieldCurrencyEdit(field); FormPF.IsNew=true; FormPF.ShowDialog(); } } else { if(PatFieldDefs.List[index].FieldType==PatFieldType.Text) { FormPatFieldEdit FormPF=new FormPatFieldEdit(field); FormPF.ShowDialog(); } if(PatFieldDefs.List[index].FieldType==PatFieldType.PickList) { FormPatFieldPickEdit FormPF=new FormPatFieldPickEdit(field); FormPF.ShowDialog(); } if(PatFieldDefs.List[index].FieldType==PatFieldType.Date) { FormPatFieldDateEdit FormPF=new FormPatFieldDateEdit(field); FormPF.ShowDialog(); } if(PatFieldDefs.List[index].FieldType==PatFieldType.Checkbox) { FormPatFieldCheckEdit FormPF=new FormPatFieldCheckEdit(field); FormPF.ShowDialog(); } if(PatFieldDefs.List[index].FieldType==PatFieldType.Currency) { FormPatFieldCurrencyEdit FormPF=new FormPatFieldCurrencyEdit(field); FormPF.ShowDialog(); } } } else { FormPatientEdit FormP=new FormPatientEdit(PatCur,FamCur); FormP.IsNew=false; FormP.ShowDialog(); if(FormP.DialogResult==DialogResult.OK) { OnPatientSelected(PatCur); } } ModuleSelected(PatCur.PatNum); }
private void gridPat_CellDoubleClick(object sender,ODGridClickEventArgs e) { if(Plugins.HookMethod(this,"ContrFamily.gridPat_CellDoubleClick",PatCur)) { return; } if(TerminalActives.PatIsInUse(PatCur.PatNum)){ MsgBox.Show(this,"Patient is currently entering info at a reception terminal. Please try again later."); return; } if(gridPat.Rows[e.Row].Tag!=null){ if(gridPat.Rows[e.Row].Tag.ToString()=="Referral"){ //RefAttach refattach=(RefAttach)gridPat.Rows[e.Row].Tag; FormReferralsPatient FormRE=new FormReferralsPatient(); FormRE.PatNum=PatCur.PatNum; FormRE.ShowDialog(); } else if(gridPat.Rows[e.Row].Tag.ToString()=="References") { FormReference FormR=new FormReference(); FormR.ShowDialog(); if(FormR.GotoPatNum!=0) { Patient pat=Patients.GetPat(FormR.GotoPatNum); OnPatientSelected(pat); GotoModule.GotoFamily(FormR.GotoPatNum); return; } if(FormR.DialogResult!=DialogResult.OK) { return; } for(int i=0;i<FormR.SelectedCustRefs.Count;i++) { CustRefEntry custEntry=new CustRefEntry(); custEntry.DateEntry=DateTime.Now; custEntry.PatNumCust=PatCur.PatNum; custEntry.PatNumRef=FormR.SelectedCustRefs[i].PatNum; CustRefEntries.Insert(custEntry); } } else if(gridPat.Rows[e.Row].Tag.GetType()==typeof(CustRefEntry)) { FormReferenceEntryEdit FormRE=new FormReferenceEntryEdit((CustRefEntry)gridPat.Rows[e.Row].Tag); FormRE.ShowDialog(); } else if(gridPat.Rows[e.Row].Tag.ToString().Equals("Payor Types")) { FormPayorTypes FormPT = new FormPayorTypes(); FormPT.PatCur=PatCur; FormPT.ShowDialog(); } else {//patfield string tag=gridPat.Rows[e.Row].Tag.ToString(); tag=tag.Substring(8);//strips off all but the number: PatField1 int index=PIn.Int(tag); PatField field=PatFields.GetByName(PatFieldDefs.List[index].FieldName,PatFieldList); if(field==null) { field=new PatField(); field.PatNum=PatCur.PatNum; field.FieldName=PatFieldDefs.List[index].FieldName; if(PatFieldDefs.List[index].FieldType==PatFieldType.Text) { FormPatFieldEdit FormPF=new FormPatFieldEdit(field); FormPF.IsNew=true; FormPF.ShowDialog(); } if(PatFieldDefs.List[index].FieldType==PatFieldType.PickList) { FormPatFieldPickEdit FormPF=new FormPatFieldPickEdit(field); FormPF.IsNew=true; FormPF.ShowDialog(); } if(PatFieldDefs.List[index].FieldType==PatFieldType.Date) { FormPatFieldDateEdit FormPF=new FormPatFieldDateEdit(field); FormPF.IsNew=true; FormPF.ShowDialog(); } if(PatFieldDefs.List[index].FieldType==PatFieldType.Checkbox) { FormPatFieldCheckEdit FormPF=new FormPatFieldCheckEdit(field); FormPF.IsNew=true; FormPF.ShowDialog(); } if(PatFieldDefs.List[index].FieldType==PatFieldType.Currency) { FormPatFieldCurrencyEdit FormPF=new FormPatFieldCurrencyEdit(field); FormPF.IsNew=true; FormPF.ShowDialog(); } } else { if(PatFieldDefs.List[index].FieldType==PatFieldType.Text) { FormPatFieldEdit FormPF=new FormPatFieldEdit(field); FormPF.ShowDialog(); } if(PatFieldDefs.List[index].FieldType==PatFieldType.PickList) { FormPatFieldPickEdit FormPF=new FormPatFieldPickEdit(field); FormPF.ShowDialog(); } if(PatFieldDefs.List[index].FieldType==PatFieldType.Date) { FormPatFieldDateEdit FormPF=new FormPatFieldDateEdit(field); FormPF.ShowDialog(); } if(PatFieldDefs.List[index].FieldType==PatFieldType.Checkbox) { FormPatFieldCheckEdit FormPF=new FormPatFieldCheckEdit(field); FormPF.ShowDialog(); } if(PatFieldDefs.List[index].FieldType==PatFieldType.Currency) { FormPatFieldCurrencyEdit FormPF=new FormPatFieldCurrencyEdit(field); FormPF.ShowDialog(); } } } } else{ string email=PatCur.Email; long siteNum=PatCur.SiteNum; // FormPatientEdit FormP=new FormPatientEdit(PatCur,FamCur); FormP.IsNew=false; FormP.ShowDialog(); //there are many things which may have changed that need to trigger refresh: //FName, LName, MiddleI, Preferred, SiteNum, or ChartNumber should refresh title bar. //Email change should change email but enabled. //Instead of checking for each of those: /* if(email!=PatCur.Email){//PatCur.EmailChanged){//do it this way later OnPatientSelected(PatCur.PatNum,PatCur.GetNameLF(),PatCur.Email!="",PatCur.ChartNumber); } if(siteNum!=PatCur.SiteNum){ OnPatientSelected(PatCur.PatNum,PatCur.GetNameLF(),PatCur.Email!="",PatCur.ChartNumber); }*/ if(FormP.DialogResult==DialogResult.OK) { OnPatientSelected(PatCur); } } ModuleSelected(PatCur.PatNum); }
private void gridPat_CellDoubleClick(object sender,ODGridClickEventArgs e) { PatField field=PatFields.GetByName(PatFieldDefs.List[e.Row].FieldName,_arrayPatientFields); if(field==null) { field=new PatField(); field.PatNum=_patCur.PatNum; field.FieldName=PatFieldDefs.List[e.Row].FieldName; if(PatFieldDefs.List[e.Row].FieldType==PatFieldType.Text) { FormPatFieldEdit FormPF=new FormPatFieldEdit(field); FormPF.IsLaunchedFromOrtho=true; FormPF.IsNew=true; FormPF.ShowDialog(); } if(PatFieldDefs.List[e.Row].FieldType==PatFieldType.PickList) { FormPatFieldPickEdit FormPF=new FormPatFieldPickEdit(field); FormPF.IsNew=true; FormPF.ShowDialog(); } if(PatFieldDefs.List[e.Row].FieldType==PatFieldType.Date) { FormPatFieldDateEdit FormPF=new FormPatFieldDateEdit(field); FormPF.IsNew=true; FormPF.ShowDialog(); } if(PatFieldDefs.List[e.Row].FieldType==PatFieldType.Checkbox) { FormPatFieldCheckEdit FormPF=new FormPatFieldCheckEdit(field); FormPF.IsNew=true; FormPF.ShowDialog(); } if(PatFieldDefs.List[e.Row].FieldType==PatFieldType.Currency) { FormPatFieldCurrencyEdit FormPF=new FormPatFieldCurrencyEdit(field); FormPF.IsNew=true; FormPF.ShowDialog(); } } else { if(PatFieldDefs.List[e.Row].FieldType==PatFieldType.Text) { FormPatFieldEdit FormPF=new FormPatFieldEdit(field); FormPF.ShowDialog(); } if(PatFieldDefs.List[e.Row].FieldType==PatFieldType.PickList) { FormPatFieldPickEdit FormPF=new FormPatFieldPickEdit(field); FormPF.ShowDialog(); } if(PatFieldDefs.List[e.Row].FieldType==PatFieldType.Date) { FormPatFieldDateEdit FormPF=new FormPatFieldDateEdit(field); FormPF.ShowDialog(); } if(PatFieldDefs.List[e.Row].FieldType==PatFieldType.Checkbox) { FormPatFieldCheckEdit FormPF=new FormPatFieldCheckEdit(field); FormPF.ShowDialog(); } if(PatFieldDefs.List[e.Row].FieldType==PatFieldType.Currency) { FormPatFieldCurrencyEdit FormPF=new FormPatFieldCurrencyEdit(field); FormPF.ShowDialog(); } } FillGridPat(); }