private void gridPtInfo_CellDoubleClick(object sender,ODGridClickEventArgs e) {
			if(Plugins.HookMethod(this,"ContrChart.gridPtInfo_CellDoubleClick",PatCur,FamCur,e,PatientNoteCur)) {
				return;
			}
			if(TerminalActives.PatIsInUse(PatCur.PatNum)) {
				MsgBox.Show(this,"Patient is currently entering info at a reception terminal.  Please try again later.");
				return;
			}
			if(gridPtInfo.Rows[e.Row].Tag!=null) {
				if(gridPtInfo.Rows[e.Row].Tag.ToString()=="med") {
					FormMedical FormM=new FormMedical(PatientNoteCur,PatCur);
					FormM.ShowDialog();
					ModuleSelected(PatCur.PatNum);
					return;
				}
				if(gridPtInfo.Rows[e.Row].Tag.GetType()==typeof(RegistrationKey)) {
					FormRegistrationKeyEdit FormR=new FormRegistrationKeyEdit();
					FormR.RegKey=(RegistrationKey)gridPtInfo.Rows[e.Row].Tag;
					FormR.ShowDialog();
					FillPtInfo();
					return;
				}
				if(gridPtInfo.Rows[e.Row].Tag.ToString()=="EhrProvKeys") {
					FormEhrProvKeysCustomer FormPK=new FormEhrProvKeysCustomer();
					FormPK.Guarantor=PatCur.Guarantor;
					FormPK.ShowDialog();
					ModuleSelected(PatCur.PatNum);
					return;
				}
				if(gridPtInfo.Rows[e.Row].Tag.ToString()=="Referral") {
					//RefAttach refattach=(RefAttach)gridPat.Rows[e.Row].Tag;
					FormReferralsPatient FormRE=new FormReferralsPatient();
					FormRE.PatNum=PatCur.PatNum;
					FormRE.ShowDialog();
					ModuleSelected(PatCur.PatNum);
					return;
				}
				if(gridPtInfo.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);
					}
					FillPtInfo();
					return;
				}
				if(gridPtInfo.Rows[e.Row].Tag.ToString()=="Patient Portal") {
					FormPatientPortal FormPP=new FormPatientPortal();
					FormPP.PatCur=PatCur;
					FormPP.ShowDialog();
					if(FormPP.DialogResult==DialogResult.OK) {
						FillPtInfo();
					}
					return;
				}
				if(gridPtInfo.Rows[e.Row].Tag.ToString()=="Payor Types") {
					FormPayorTypes FormPT=new FormPayorTypes();
					FormPT.PatCur=PatCur;
					FormPT.ShowDialog();
					if(FormPT.DialogResult==DialogResult.OK) {
						FillPtInfo();
					}
					return;
				}
				if(gridPtInfo.Rows[e.Row].Tag.GetType()==typeof(CustRefEntry)) {
					FormReferenceEntryEdit FormRE=new FormReferenceEntryEdit((CustRefEntry)gridPtInfo.Rows[e.Row].Tag);
					FormRE.ShowDialog();
					FillPtInfo();
					return;
				}
				else {//patfield
					string tag=gridPtInfo.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();
						}
					}
					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();
						}
					}
				}
			}
			else {
				string email=PatCur.Email;
				long siteNum=PatCur.SiteNum;
				FormPatientEdit FormP=new FormPatientEdit(PatCur,FamCur);
				FormP.IsNew=false;
				FormP.ShowDialog();
				if(FormP.DialogResult==DialogResult.OK) {
					OnPatientSelected(PatCur);
				}
			}
			ModuleSelected(PatCur.PatNum);
		}
Exemple #2
0
 private void gridPtInfo_CellDoubleClick(object sender,ODGridClickEventArgs e)
 {
     if(Plugins.HookMethod(this,"ContrChart.gridPtInfo_CellDoubleClick",PatCur,FamCur,e,PatientNoteCur)) {
         return;
     }
     if(TerminalActives.PatIsInUse(PatCur.PatNum)) {
         MsgBox.Show(this,"Patient is currently entering info at a reception terminal.  Please try again later.");
         return;
     }
     if(gridPtInfo.Rows[e.Row].Tag!=null) {
         if(gridPtInfo.Rows[e.Row].Tag.ToString()=="med") {
             FormMedical FormM=new FormMedical(PatientNoteCur,PatCur);
             FormM.ShowDialog();
             ModuleSelected(PatCur.PatNum);
             return;
         }
         if(gridPtInfo.Rows[e.Row].Tag.GetType()==typeof(RegistrationKey)) {
             FormRegistrationKeyEdit FormR=new FormRegistrationKeyEdit();
             FormR.RegKey=(RegistrationKey)gridPtInfo.Rows[e.Row].Tag;
             FormR.ShowDialog();
             FillPtInfo();
             return;
         }
         if(gridPtInfo.Rows[e.Row].Tag.ToString()=="EhrProvKeys") {
             FormEhrProvKeysCustomer FormPK=new FormEhrProvKeysCustomer();
             FormPK.Guarantor=PatCur.Guarantor;
             FormPK.ShowDialog();
             ModuleSelected(PatCur.PatNum);
             return;
         }
         if(gridPtInfo.Rows[e.Row].Tag.ToString()=="Referral") {
             //RefAttach refattach=(RefAttach)gridPat.Rows[e.Row].Tag;
             FormReferralsPatient FormRE=new FormReferralsPatient();
             FormRE.PatNum=PatCur.PatNum;
             FormRE.ShowDialog();
             ModuleSelected(PatCur.PatNum);
             return;
         }
         else {//patfield
             string tag=gridPtInfo.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();
                 }
             }
             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();
                 }
             }
         }
     }
     else {
         string email=PatCur.Email;
         long siteNum=PatCur.SiteNum;
         FormPatientEdit FormP=new FormPatientEdit(PatCur,FamCur);
         FormP.IsNew=false;
         FormP.ShowDialog();
         if(FormP.DialogResult==DialogResult.OK) {
             OnPatientSelected(PatCur.PatNum,PatCur.GetNameLF(),PatCur.Email!="",PatCur.ChartNumber);
         }
     }
     ModuleSelected(PatCur.PatNum);
 }