コード例 #1
0
ファイル: AvaTax.cs プロジェクト: ChemBrain/OpenDental
        ///<summary>True if we are in HQ, AvaTax is enabled, we tax the customer's state, and either the customer's tax exempt field is not defined or
        ///they are explicitly not tax exempt.  Executes a small query.</summary>
        public static bool IsTaxable(long patNum)
        {
            if (!IsEnabled())
            {
                return(false);               //Save a few db calls
            }
            Patient pat = Patients.GetPat(patNum);

            if (pat == null)
            {
                return(false);
            }
            PatField taxExempt = null;

            if (TaxExemptPatField != null)
            {
                taxExempt = PatFields.Refresh(patNum).FirstOrDefault(x => x.FieldName == TaxExemptPatField.FieldName);
            }
            if (ListTaxableStates.Count == 0)
            {
                return(false);
            }
            if (!HasTaxableState(pat))               //if they aren't taxable, skip them
            {
                return(false);
            }
            if (taxExempt != null && PIn.Bool(taxExempt.FieldValue))
            {
                return(false);
            }
            return(true);
        }
コード例 #2
0
ファイル: PatFields.cs プロジェクト: mnisl/OD
		///<summary></summary>
		public static long Insert(PatField patField) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				patField.PatFieldNum=Meth.GetLong(MethodBase.GetCurrentMethod(),patField);
				return patField.PatFieldNum;
			}
			return Crud.PatFieldCrud.Insert(patField);
		}
コード例 #3
0
ファイル: AvaTax.cs プロジェクト: ChemBrain/OpenDental
        ///<summary>True if we are in HQ, AvaTax is enabled, we tax the customer's state, and the procedure has a taxable proccode. Note that if the
        ///customer has an invalid zip but all other conditions are met, we will still return true because this procedure is still taxable by our rules
        ///we just know we would get an error back from Avalara. This method returning false will result in the procedure being created as before
        ///but without tax, so we need to return true for an invalid zip and let Avalara produce the error. Can execute two queries.</summary>
        public static bool DoSendProcToAvalara(Procedure proc, bool isSilent = false)
        {
            ProcedureCode procCode = ProcedureCodes.GetProcCode(proc.CodeNum);

            if (!IsEnabled())
            {
                return(false);
            }
            if (proc.ProcFee == 0)          //repeat charges for prepay use ProcFee=0
            {
                return(false);
            }
            Patient patient = Patients.GetPat(proc.PatNum);

            //don't call IsTaxable() here, because that would get pat twice, so duplicating some if its functionality:
            if (patient == null)
            {
                return(false);
            }
            if (ListTaxableStates.Count == 0)
            {
                return(false);               //no taxable states
            }
            if (!HasTaxableState(patient))   //if this patient is not in a taxable state
            {
                return(false);
            }
            if (TaxExemptPatField == null)          //no tax exempt pat field entered in setup
            {
                return(false);
            }
            PatField taxExempt = PatFields.Refresh(patient.PatNum).FirstOrDefault(x => x.FieldName == TaxExemptPatField.FieldName);

            if (taxExempt != null && PIn.Bool(taxExempt.FieldValue)) //patient field exists and is true
            {
                return(false);                                       //so not taxable
            }
            //end of the duplicated functionality from IsTaxable().
            string procTaxCode = GetTaxOverrideIfNeeded(patient, procCode); //could be an avalara code, an override, or a percent

            if (string.IsNullOrWhiteSpace(procTaxCode))                     //if there is no avalara code or percent for this proc/state
            {
                return(false);
            }
            if (!Patients.HasValidUSZipCode(patient))
            {
                if (isSilent)
                {
                    _logger.WriteLine($"Invalid ZipCode for PatNum {proc.PatNum} while running Repeat Charge Tool on {DateTime.Today}", LogLevel.Error);
                }
                else
                {
                    //Remove the message box for now to avoid it from popping up on the server, stopping anyone using middletier to continue
                    //forward, because they can't click OK in the message box.
                    //MessageBox.Show("A valid zip code is required to process sales tax on procedures in this patient's state. "
                    //+"Please update the patient information with a valid zip code before continuing.");
                }
            }
            return(true);
        }
コード例 #4
0
ファイル: PatFields.cs プロジェクト: mnisl/OD
		///<summary></summary>
		public static void Update(PatField patField) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),patField);
				return;
			}
			Crud.PatFieldCrud.Update(patField);
		}
コード例 #5
0
ファイル: PatFields.cs プロジェクト: mnisl/OD
		///<summary></summary>
		public static void Delete(PatField pf) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),pf);
				return;
			}
			string command="DELETE FROM patfield WHERE PatFieldNum ="+POut.Long(pf.PatFieldNum);
			Db.NonQ(command);
		}
コード例 #6
0
 ///<summary></summary>
 public static long Insert(PatField patField)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         patField.PatFieldNum = Meth.GetLong(MethodBase.GetCurrentMethod(), patField);
         return(patField.PatFieldNum);
     }
     return(Crud.PatFieldCrud.Insert(patField));
 }
コード例 #7
0
 ///<summary></summary>
 public static void Update(PatField patField)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), patField);
         return;
     }
     Crud.PatFieldCrud.Update(patField);
 }
コード例 #8
0
ファイル: PatFields.cs プロジェクト: mnisl/OD
		///<summary>Frequently returns null.</summary>
		public static PatField GetByName(string name,PatField[] fieldList){
			//No need to check RemotingRole; no call to db.
			for(int i=0;i<fieldList.Length;i++){
				if(fieldList[i].FieldName==name){
					return fieldList[i];
				}
			}
			return null;
		}
コード例 #9
0
		///<summary></summary>
		public FormPatFieldPickEdit(PatField field)
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();
			Lan.F(this);
			Field=field;
		}
コード例 #10
0
        ///<summary></summary>
        public PatField Copy()
        {
            PatField p = new PatField();

            p.PatFieldNum = PatFieldNum;
            p.PatNum      = PatNum;
            p.FieldName   = FieldName;
            p.FieldValue  = FieldValue;
            return(p);
        }
コード例 #11
0
ファイル: FormPatFieldDateEdit.cs プロジェクト: mnisl/OD
		///<summary></summary>
		public FormPatFieldDateEdit(PatField field)
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();
			Lan.F(this);
			_fieldCur=field;
			_fieldOld=_fieldCur.Copy();
		}
コード例 #12
0
        ///<summary></summary>
        public static void Delete(PatField pf)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), pf);
                return;
            }
            string command = "DELETE FROM patfield WHERE PatFieldNum =" + POut.Long(pf.PatFieldNum);

            Db.NonQ(command);
        }
コード例 #13
0
 ///<summary></summary>
 public static long Insert(PatField patField)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         patField.PatFieldNum = Meth.GetLong(MethodBase.GetCurrentMethod(), patField);
         return(patField.PatFieldNum);
     }
     //Security.CurUser.UserNum gets set on MT by the DtoProcessor so it matches the user from the client WS.
     patField.SecUserNumEntry = Security.CurUser.UserNum;
     return(Crud.PatFieldCrud.Insert(patField));
 }
コード例 #14
0
ファイル: PatFields.cs プロジェクト: royedwards/DRDNet
 ///<summary></summary>
 public static long Insert(PatField patField)
 {
     if (RemotingClient.RemotingRole != RemotingRole.ServerWeb)
     {
         patField.SecUserNumEntry = Security.CurUser.UserNum;              //must be before normal remoting role check to get user at workstation
     }
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         patField.PatFieldNum = Meth.GetLong(MethodBase.GetCurrentMethod(), patField);
         return(patField.PatFieldNum);
     }
     return(Crud.PatFieldCrud.Insert(patField));
 }
コード例 #15
0
		private void gridPat_CellDoubleClick(object sender,ODGridClickEventArgs e) {
			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();
				}
			}
			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();
				}
			}
			FillPatientData();
		}
コード例 #16
0
ファイル: PatFields.cs プロジェクト: royedwards/DRDNet
 ///<summary>A helper method to make a security log entry for an edit.  Because we have several patient field edit windows, this will allow us to change them all at once.</summary>
 public static void MakeEditLogEntry(PatField patFieldOld, PatField patFieldCur)
 {
     SecurityLogs.MakeLogEntry(Permissions.PatientFieldEdit, patFieldCur.PatNum
                               , "Edited patient field " + patFieldCur.FieldName + "\r\n"
                               + "Old value" + ": \"" + patFieldOld.FieldValue + "\"  New value: \"" + patFieldCur.FieldValue + "\"");
 }
コード例 #17
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;
				}
				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);
		}
コード例 #18
0
		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);
		}
コード例 #19
0
ファイル: PatFields.cs プロジェクト: mnisl/OD
		///<summary>A helper method to make a security log entry for an edit.  Because we have several patient field edit windows, this will allow us to change them all at once.</summary>
		public static void MakeEditLogEntry(PatField patFieldOld,PatField patFieldCur) {
			SecurityLogs.MakeLogEntry(Permissions.PatientFieldEdit,patFieldCur.PatNum
					,"Edited patient field "+patFieldCur.FieldName+"\r\n"
					+"Old value"+": \""+patFieldOld.FieldValue+"\"  New value: \""+patFieldCur.FieldValue+"\"");
		}
コード例 #20
0
ファイル: PatFields.cs プロジェクト: mnisl/OD
		///<summary>A helper method to make a security log entry for deletion.  Because we have several patient field edit windows, this will allow us to change them all at once.</summary>
		public static void MakeDeleteLogEntry(PatField patField) {
			SecurityLogs.MakeLogEntry(Permissions.PatientFieldEdit,patField.PatNum,"Deleted patient field "+patField.FieldName+".  Value before deletion: \""+patField.FieldValue+"\"");
		}
コード例 #21
0
ファイル: FormOrthoChart.cs プロジェクト: nampn/ODental
 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();
         }
     }
     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();
         }
     }
     FillGridPat();
 }
コード例 #22
0
ファイル: ContrAccount.cs プロジェクト: mnisl/OD
		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);
		}
コード例 #23
0
ファイル: FormPatFieldCurrencyEdit.cs プロジェクト: mnisl/OD
		public FormPatFieldCurrencyEdit(PatField field) {
			InitializeComponent();
			Lan.F(this);
			_fieldCur=field;
			_fieldOld=_fieldCur.Copy();
		}
コード例 #24
0
ファイル: PatFields.cs プロジェクト: royedwards/DRDNet
 ///<summary>A helper method to make a security log entry for deletion.  Because we have several patient field edit windows, this will allow us to change them all at once.</summary>
 public static void MakeDeleteLogEntry(PatField patField)
 {
     SecurityLogs.MakeLogEntry(Permissions.PatientFieldEdit, patField.PatNum, "Deleted patient field " + patField.FieldName + ".  Value before deletion: \"" + patField.FieldValue + "\"");
 }
コード例 #25
0
ファイル: ContrChart.cs プロジェクト: nampn/ODental
 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);
 }
コード例 #26
0
 public FormPatFieldCurrencyEdit(PatField field)
 {
     InitializeComponent();
     Lan.F(this);
     Field=field;
 }