Example #1
0
		///<summary></summary>
		public static long Insert(OrionProc orionProc) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				orionProc.OrionProcNum=Meth.GetLong(MethodBase.GetCurrentMethod(),orionProc);
				return orionProc.OrionProcNum;
			}
			return Crud.OrionProcCrud.Insert(orionProc);
		}
Example #2
0
		///<summary></summary>
		public static void Update(OrionProc orionProc) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),orionProc);
				return;
			}
			Crud.OrionProcCrud.Update(orionProc);
		}
Example #3
0
 ///<summary></summary>
 public static void Update(OrionProc orionProc)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), orionProc);
         return;
     }
     Crud.OrionProcCrud.Update(orionProc);
 }
Example #4
0
 ///<summary></summary>
 public static long Insert(OrionProc orionProc)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         orionProc.OrionProcNum = Meth.GetLong(MethodBase.GetCurrentMethod(), orionProc);
         return(orionProc.OrionProcNum);
     }
     return(Crud.OrionProcCrud.Insert(orionProc));
 }
		public static string GetChanges(Procedure procCur, Procedure procOld, OrionProc orionProcCur, OrionProc orionProcOld){
			Changes="";
			if(orionProcOld.DPC != orionProcCur.DPC) {
				if(Changes!="") { Changes+="\r\n"; }
				Changes+="DPC changed from "+POut.String(orionProcOld.DPC.ToString())+" to "+POut.String(orionProcCur.DPC.ToString())+".";
			}
			if(orionProcOld.DPCpost != orionProcCur.DPCpost) {
				if(Changes!=""){ Changes+="\r\n";}
		    Changes+="DPC Post Visit changed from "+POut.String(orionProcOld.DPCpost.ToString())+" to "+POut.String(orionProcCur.DPCpost.ToString())+".";
			}
			//PatNum, AptNum, PlannedAptNum should never change---------------------------------------------------------------------------------------------
			if(procOld.PatNum != procCur.PatNum) {
				if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Patient Num changed from "+procOld.PatNum+" to "+procCur.PatNum+".";
		  }
		  if(procOld.AptNum != procCur.AptNum) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Apt Num changed from "+procOld.AptNum+" to "+procCur.AptNum+".";
		  }
		  if(procOld.PlannedAptNum != procCur.PlannedAptNum) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Planned Apt Num changed from "+procOld.PlannedAptNum+" to "+procCur.PlannedAptNum+".";
			}
			//Date and time related fields------------------------------------------------------------------------------------------------------------------
		  if(procOld.DateEntryC.Date != procCur.DateEntryC.Date) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Date Entry changed from "+procOld.DateEntryC.ToShortDateString()+" to "+procCur.DateEntryC.ToShortDateString()+".";
		  }
		  if(procOld.ProcDate.Date != procCur.ProcDate.Date) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Proc Date changed from "+procOld.ProcDate.ToShortDateString()+" to "+procCur.ProcDate.ToShortDateString()+".";
		  }
		  //if(procOld.StartTime != procCur.StartTime) {
		  //  if(Changes!=""){ Changes+="\r\n";}
		  //  Changes+="Start Time changed from "+procOld.StartTime+" to "+procCur.StartTime+".";
		  //}
		  //if(procOld.StopTime != procCur.StopTime) {
		  //  if(Changes!=""){ Changes+="\r\n";}
		  //  Changes+="Stop Time changed from "+procOld.StopTime+" to "+procCur.StopTime+".";
		  //}
		  if(procOld.ProcTime != procCur.ProcTime) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Procedure Time changed from "
					+(PIn.DateT(procOld.ProcTime.ToString()).ToShortTimeString()=="12:00 AM"?"none":PIn.DateT(procOld.ProcTime.ToString()).ToShortTimeString())
					+" to "+(PIn.DateT(procCur.ProcTime.ToString()).ToShortTimeString()=="12:00 AM"?"none":PIn.DateT(procCur.ProcTime.ToString()).ToShortTimeString())+".";
		  }
		  if(procOld.ProcTimeEnd != procCur.ProcTimeEnd) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Procedure End Time changed from "
					+(PIn.DateT(procOld.ProcTimeEnd.ToString()).ToShortTimeString()=="12:00 AM"?"none":PIn.DateT(procOld.ProcTimeEnd.ToString()).ToShortTimeString())
					+" to "+(PIn.DateT(procCur.ProcTimeEnd.ToString()).ToShortTimeString()=="12:00 AM"?"none":PIn.DateT(procCur.ProcTimeEnd.ToString()).ToShortTimeString())+".";
		  }
			//Procedure, related areas, amount, hide graphics, etc.-----------------------------------------------------------------------------------------
		  if(procOld.CodeNum != procCur.CodeNum) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Procedure changed from "+ProcedureCodes.GetLaymanTerm(procOld.CodeNum)+" to "+ProcedureCodes.GetLaymanTerm(procCur.CodeNum)+".";
		  }
		  if(procOld.ProcFee != procCur.ProcFee) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Proc Fee changed from $"+procOld.ProcFee.ToString("F")+" to $"+procCur.ProcFee.ToString("F")+".";
		  }
		  if(procOld.ToothNum != procCur.ToothNum) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Tooth Num changed from "+procOld.ToothNum+" to "+procCur.ToothNum+".";
		  }
		  if(procOld.Surf != procCur.Surf) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Surface changed from "+procOld.Surf+" to "+procCur.Surf+".";
		  }
		  if(procOld.ToothRange != procCur.ToothRange) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Tooth Range changed from "+procOld.ToothRange+" to "+procCur.ToothRange+".";
		  }
			if(procOld.HideGraphics != procCur.HideGraphics) {
				if(Changes!=""){ Changes+="\r\n";}
				Changes+="Hide Graphics changed from "+(procOld.HideGraphics?"Hide Graphics":"Do Not Hide Graphics")
					+" to "+(procCur.HideGraphics?"Hide Graphics":"Do Not Hide Graphics")+".";
			}
			//Provider, Diagnosis, Priority, Place of Service, Clinic, Site---------------------------------------------------------------------------------
		  if(procOld.ProvNum != procCur.ProvNum) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Provider changed from "+Providers.GetAbbr(procOld.ProvNum)+" to "+Providers.GetAbbr(procCur.ProvNum)+".";
		  }
		  if(procOld.Dx != procCur.Dx) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Diagnosis changed from "+DefC.GetDef(DefCat.Diagnosis,procOld.Dx).ItemName
					+" to "+DefC.GetDef(DefCat.Diagnosis,procCur.Dx).ItemName+".";
		  }
		  if(procOld.Priority != procCur.Priority) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Priority changed from "+((procOld.Priority!=0)?DefC.GetDef(DefCat.TxPriorities,procOld.Priority).ItemName:"no priority")
					+" to "+((procCur.Priority!=0)?DefC.GetDef(DefCat.TxPriorities,procCur.Priority).ItemName:"no priority")+".";
		  }
		  if(procOld.PlaceService != procCur.PlaceService) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Place of Service changed from "+procOld.PlaceService.ToString()+" to "+procCur.PlaceService.ToString()+".";
		  }
		  if(procOld.ClinicNum != procCur.ClinicNum) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Clinic changed from "+Clinics.GetDesc(procOld.ClinicNum)+" to "+Clinics.GetDesc(procCur.ClinicNum)+".";
		  }
		  if(procOld.SiteNum != procCur.SiteNum) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Site changed from "+(procOld.SiteNum==0?"none":Sites.GetDescription(procOld.SiteNum))
					+" to "+(procCur.SiteNum==0?"none":Sites.GetDescription(procCur.SiteNum))+".";
		  }
			//Prosthesis reverse lookup---------------------------------------------------------------------------------------------------------------------
		  if(procOld.Prosthesis != procCur.Prosthesis) {
		    if(Changes!=""){ Changes+="\r\n";}
				string prosthesisOld;
				switch(procOld.Prosthesis.ToString()){
					case "": prosthesisOld="no"; break;
					case "I":	prosthesisOld="Initial"; break;
					case "R": prosthesisOld="Replacement"; break;
					default: prosthesisOld="error"; break;
				}
				string prosthesisCur;
				switch(procCur.Prosthesis.ToString()){
					case "": prosthesisCur="no"; break;
					case "I": prosthesisCur="Initial"; break;
					case "R": prosthesisCur="Replacement"; break;
					default: prosthesisCur="error"; break;
				}
		    Changes+="Prosthesis changed from "+prosthesisOld+" to "+prosthesisCur+".";
		  }
		  if(procOld.DateOriginalProsth.Date != procCur.DateOriginalProsth.Date) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Date of Original Prosthesis changed from "+procOld.DateOriginalProsth.ToShortDateString()
					+" to "+procCur.DateOriginalProsth.ToShortDateString()+".";
		  }
			//Claim Note & Orion Proc Fields----------------------------------------------------------------------------------------------------------------
		  if(procOld.ClaimNote != procCur.ClaimNote) {
		    if(Changes!=""){ Changes+="\r\n";}
				Changes+="Claim Note changed from "+(procOld.ClaimNote==""?"none":"'"+procOld.ClaimNote+"'")
					+" to "+(procCur.ClaimNote==""?"none":"'"+procCur.ClaimNote+"'");
		  }
			if(orionProcOld.OrionProcNum != orionProcCur.OrionProcNum) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Orion Proc Num changed from "+POut.Long(orionProcOld.OrionProcNum)+" to "+POut.Long(orionProcCur.OrionProcNum)+".";
		  }
			if(orionProcOld.ProcNum != orionProcCur.ProcNum) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Proc Num changed from "+POut.Long(orionProcOld.ProcNum)+" to "+POut.Long(orionProcCur.ProcNum)+".";
		  }
			//Orion Status Reverse Lookup for Description----------------------------------//None is equivalent to TP---------------------------------------
			if(orionProcOld.Status2 != orionProcCur.Status2 && !(orionProcOld.Status2==OrionStatus.None && orionProcCur.Status2==OrionStatus.TP)) {
		    if(Changes!=""){ Changes+="\r\n";}
				string[] status2=new string[2];
				string[] status2Desc=new string[2];
				status2[0]=orionProcOld.Status2.ToString();
				status2[1]=orionProcCur.Status2.ToString();
				for(int i=0;i<2;i++){
					switch(status2[i]){
						case "None":		status2Desc[i]="TP-treatment planned"; break;
						case "TP":			status2Desc[i]="TP-treatment planned"; break;
						case "C":				status2Desc[i]="C-completed";	break;
						case "E":				status2Desc[i]="E-existing prior to incarceration"; break;
						case "R":				status2Desc[i]="R-refused treatment"; break;
						case "RO":			status2Desc[i]="RO-referred out to specialist"; break;
						case "CS":			status2Desc[i]="CS-completed by specialist"; break;
						case "CR":			status2Desc[i]="CR-completed by registry"; break;
						case "CA_Tx":		status2Desc[i]="CA_Tx-cancelled, tx plan changed"; break;
						case "CA_EPRD": status2Desc[i]="CA_EPRD-cancelled, eligible parole"; break;
						case "CA_P/D":	status2Desc[i]="CA_P/D--cancelled, parole/discharge"; break;
						case "S":				status2Desc[i]="S-suspended, unacceptable plaque"; break;
						case "ST":			status2Desc[i]="ST-stop clock, multi visit"; break;
						case "W":				status2Desc[i]="W-watch"; break;
						case "A":				status2Desc[i]="A-alternative"; break;
						default:				status2Desc[i]="error"; break;
					}
				}
		    Changes+="Orion Procedure Status changed from "+status2Desc[0]+" to "+status2Desc[1]+".";
		  }
			//Other orion fields----------------------------------------------------------------------------------------------------------------------------
			if(orionProcOld.DateScheduleBy.Date != orionProcCur.DateScheduleBy.Date) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Date Schedule By changed from "+orionProcOld.DateScheduleBy.ToShortDateString()
					+" to "+orionProcCur.DateScheduleBy.ToShortDateString()+".";
		  }
			if(orionProcOld.DateStopClock.Date != orionProcCur.DateStopClock.Date) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Date Stop Clock changed from "+orionProcOld.DateStopClock.ToShortDateString()
					+" to "+orionProcCur.DateStopClock.ToShortDateString()+".";
		  }
			if(orionProcOld.IsOnCall != orionProcCur.IsOnCall) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Is On Call changed from "+(orionProcOld.IsOnCall?"Is On Call":"Is Not On Call")
					+" to "+(orionProcCur.IsOnCall?"Is On Call":"Is Not On Call")+".";
		  }
			if(orionProcOld.IsEffectiveComm != orionProcCur.IsEffectiveComm) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Is Effective Comm changed from "+(orionProcOld.IsEffectiveComm?"Is an Effective Communicator":"Is Not an Effective Communicator")
					+" to "+(orionProcCur.IsEffectiveComm?"Is an Effective Communicator":"Is Not an Effective Communicator")+".";
		  }
			if(orionProcOld.IsRepair != orionProcCur.IsRepair) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Is Repair changed from "+(orionProcOld.IsRepair?"Is a Repair":"Is Not a Repair")
					+" to "+(orionProcCur.IsRepair?"Is a Repair":"Is Not a Repair")+".";
		  }
			//Medical fields--------------------------------------------------------------------------------------------------------------------------------
		  if(procOld.MedicalCode != procCur.MedicalCode) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Medical Code changed from "+(procOld.MedicalCode==""?"none":procOld.MedicalCode)
					+" to "+(procCur.MedicalCode==""?"none":procCur.MedicalCode)+".";
		  }
		  if(procOld.DiagnosticCode != procCur.DiagnosticCode) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Diagnostic Code changed from "+(procOld.DiagnosticCode==""?"none":procOld.DiagnosticCode)
					+" to "+(procCur.DiagnosticCode==""?"none":procCur.DiagnosticCode)+".";
			}
		  if(procOld.IsPrincDiag != procCur.IsPrincDiag) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Is Princ Diag changed from "+(procOld.IsPrincDiag?"Principal Diagnosis":"Not Principal Diagnosis")
					+" to "+(procCur.IsPrincDiag?"Principal Diagnosis":"Not Principal Diagnosis")+".";
		  }
		  //if(procOld.RevCode != procCur.RevCode) {
		  //  if(Changes!=""){ Changes+="\r\n";}
		  //  Changes+="Rev Code changed from "+POut.String(procOld.RevCode)+"' to '"+POut.String(procCur.RevCode)+".";
		  //}
			//Proc status and billing fields----------------------------------------------------------------------------------------------------------------
		  if(procOld.ProcStatus != procCur.ProcStatus) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Procedure Status changed from "+procOld.ProcStatus.ToString()+" to "+procCur.ProcStatus.ToString()+".";
		  }
		  if(procOld.DateTP.Date != procCur.DateTP.Date && procOld.DateTP.Date!=DateTime.MinValue.Date) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Date TP changed from "+procOld.DateTP.ToShortDateString()+" to "+procCur.DateTP.ToShortDateString()+".";
		  }
		  //if(procOld.BillingTypeOne != procCur.BillingTypeOne) {
		  //  if(Changes!=""){ Changes+="\r\n";}
		  //  Changes+="Billing Type One changed from "+(procOld.BillingTypeOne!=0?DefC.GetDef(DefCat.BillingTypes,procOld.BillingTypeOne).ItemName:"none")
			//		+" to "+(procCur.BillingTypeOne!=0?DefC.GetDef(DefCat.BillingTypes,procCur.BillingTypeOne).ItemName:"none")+".";
		  //}
		  //if(procOld.BillingTypeTwo != procCur.BillingTypeTwo) {
		  //  if(Changes!=""){ Changes+="\r\n";}
		  //  Changes+="Billing Type Two changed from "+(procOld.BillingTypeTwo!=0?DefC.GetDef(DefCat.BillingTypes,procOld.BillingTypeTwo).ItemName:"none")
			//		+" to "+(procCur.BillingTypeTwo!=0?DefC.GetDef(DefCat.BillingTypes,procCur.BillingTypeTwo).ItemName:"none")+".";
		  //}
		  if(procOld.ProcNumLab != procCur.ProcNumLab) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Proc Num Lab changed from "+POut.Long(procOld.ProcNumLab)+" to "+POut.Long(procCur.ProcNumLab)+".";
		  }
		  //if(procOld.UnitCode != procCur.UnitCode) {
		  //  if(Changes!=""){ Changes+="\r\n";}
		  //  Changes+="Unit Code changed from "+POut.String(procOld.UnitCode)+" to "+POut.String(procCur.UnitCode)+".";
		  //}
			//UnitQty, Canadian Type Codes, and Note--------------------------------------------------------------------------------------------------------
		  if(procOld.UnitQty != procCur.UnitQty) {
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Unit Quantity changed from "+POut.Int(procOld.UnitQty)+" to "+POut.Int(procCur.UnitQty)+".";
		  }
		  //if(procOld.CanadianTypeCodes != procCur.CanadianTypeCodes) {
		  //  if(Changes!=""){ Changes+="\r\n";}
		  //  Changes+="Canadian Code Type changed from "+POut.String(procOld.CanadianTypeCodes)+" to "+POut.String(procCur.CanadianTypeCodes)+".";
		 // }
			if(procOld.Note != procCur.Note && !(procOld.Note==null && procCur.Note=="")) {//Null note is equivalent to an empty note string.
		    if(Changes!=""){ Changes+="\r\n";}
		    Changes+="Note changed from "+(procOld.Note==""?"none":"'"+procOld.Note+"'")
					+" to "+(procCur.Note==""?"none":"'"+procCur.Note+"'");
		  }
			return Changes;
		}
Example #6
0
		///<summary>ONLY run on startup. Fills the basic controls, except not the ones in the upper left panel which are handled in SetControlsUpperLeft.</summary>
		private void FillControlsOnStartup(){
			comboProcStatus.Items.Clear();
			comboProcStatus.Items.Add(Lan.g(this,"Treatment Planned"));
			comboProcStatus.Items.Add(Lan.g(this,"Complete"));
			if(!PrefC.GetBool(PrefName.EasyHideClinical)) {
				comboProcStatus.Items.Add(Lan.g(this,"Existing-Current Prov"));
				comboProcStatus.Items.Add(Lan.g(this,"Existing-Other Prov"));
				comboProcStatus.Items.Add(Lan.g(this,"Referred Out"));
				//comboProcStatus.Items.Add(Lan.g(this,"Deleted"));
				comboProcStatus.Items.Add(Lan.g(this,"Condition"));
			}
			if(ProcCur.ProcStatus==ProcStat.TP){
				comboProcStatus.SelectedIndex=0;
			}
			if(ProcCur.ProcStatus==ProcStat.C) {
				comboProcStatus.SelectedIndex=1;
			}
			if(!PrefC.GetBool(PrefName.EasyHideClinical)) {
				if(ProcCur.ProcStatus==ProcStat.EC) {
					comboProcStatus.SelectedIndex=2;
				}
				if(ProcCur.ProcStatus==ProcStat.EO) {
					comboProcStatus.SelectedIndex=3;
				}
				if(ProcCur.ProcStatus==ProcStat.R) {
					comboProcStatus.SelectedIndex=4;
				}
				if(ProcCur.ProcStatus==ProcStat.Cn) {
					comboProcStatus.SelectedIndex=5;
				}
			}
			if(ProcCur.ProcStatus==ProcStat.D && ProcCur.IsLocked){//an invalidated proc
				comboProcStatus.Items.Clear();
				comboProcStatus.Items.Add(Lan.g(this,"Invalidated"));
				comboProcStatus.SelectedIndex=0;
				comboProcStatus.Enabled=false;
				butInvalidate.Visible=false;
				butOK.Enabled=false;
				butDelete.Enabled=false;
				butChange.Enabled=false;
				butEditAnyway.Enabled=false;
				butSetComplete.Enabled=false;
				butAddEstimate.Enabled=false;
				butAddAdjust.Enabled=false;
			}
			//if clinical is hidden, then there's a chance that no item is selected at this point.
			comboDx.Items.Clear();
			for(int i=0;i<DefC.Short[(int)DefCat.Diagnosis].Length;i++){
				comboDx.Items.Add(DefC.Short[(int)DefCat.Diagnosis][i].ItemName);
				if(DefC.Short[(int)DefCat.Diagnosis][i].DefNum==ProcCur.Dx)
					comboDx.SelectedIndex=i;
			}
			comboPrognosis.Items.Clear();
			comboPrognosis.Items.Add(Lan.g(this,"no prognosis"));
			comboPrognosis.SelectedIndex=0;
			for(int i=0;i<DefC.Short[(int)DefCat.Prognosis].Length;i++) {
				comboPrognosis.Items.Add(DefC.Short[(int)DefCat.Prognosis][i].ItemName);
				if(DefC.Short[(int)DefCat.Prognosis][i].DefNum==ProcCur.Prognosis)
					comboPrognosis.SelectedIndex=i+1;
			}
			checkHideGraphics.Checked=ProcCur.HideGraphics;
			if(Programs.UsingOrion && this.IsNew && !OrionDentist){
				ProcCur.ProvNum=Providers.GetOrionProvNum(ProcCur.ProvNum);//Returns 0 if logged in as non provider.
			}//ProvNum of 0 will be required to change before closing form.
			comboProvNum.Items.Clear();
			for(int i=0;i<ProviderC.ListShort.Count;i++){
				comboProvNum.Items.Add(ProviderC.ListShort[i].Abbr);
				if(ProviderC.ListShort[i].ProvNum==ProcCur.ProvNum) {
					comboProvNum.SelectedIndex=i;
				}
			}
			comboPriority.Items.Clear();
			comboPriority.Items.Add(Lan.g(this,"no priority"));
			comboPriority.SelectedIndex=0;
			for(int i=0;i<DefC.Short[(int)DefCat.TxPriorities].Length;i++){
				comboPriority.Items.Add(DefC.Short[(int)DefCat.TxPriorities][i].ItemName);
				if(DefC.Short[(int)DefCat.TxPriorities][i].DefNum==ProcCur.Priority)
					comboPriority.SelectedIndex=i+1;
			}
			comboBillingTypeOne.Items.Clear();
			comboBillingTypeOne.Items.Add(Lan.g(this,"none"));
			comboBillingTypeOne.SelectedIndex=0;
			for(int i=0;i<DefC.Short[(int)DefCat.BillingTypes].Length;i++) {
				comboBillingTypeOne.Items.Add(DefC.Short[(int)DefCat.BillingTypes][i].ItemName);
				if(DefC.Short[(int)DefCat.BillingTypes][i].DefNum==ProcCur.BillingTypeOne)
					comboBillingTypeOne.SelectedIndex=i+1;
			}
			comboBillingTypeTwo.Items.Clear();
			comboBillingTypeTwo.Items.Add(Lan.g(this,"none"));
			comboBillingTypeTwo.SelectedIndex=0;
			for(int i=0;i<DefC.Short[(int)DefCat.BillingTypes].Length;i++) {
				comboBillingTypeTwo.Items.Add(DefC.Short[(int)DefCat.BillingTypes][i].ItemName);
				if(DefC.Short[(int)DefCat.BillingTypes][i].DefNum==ProcCur.BillingTypeTwo)
					comboBillingTypeTwo.SelectedIndex=i+1;
			}
			textBillingNote.Text=ProcCur.BillingNote;
			textNotes.Text=ProcCur.Note;
			textNotes.Select(textNotes.Text.Length,0);
			CheckForCompleteNote();
			comboPlaceService.Items.Clear();
			comboPlaceService.Items.AddRange(Enum.GetNames(typeof(PlaceOfService)));
			comboPlaceService.SelectedIndex=(int)ProcCur.PlaceService;
			//checkHideGraphical.Checked=ProcCur.HideGraphical;
			if(PrefC.GetBool(PrefName.EasyNoClinics)) {
				comboClinic.Visible=false;
				labelClinic.Visible=false;
			}
			else {
				comboClinic.Items.Add("none");
				comboClinic.SelectedIndex=0;
				for(int i=0;i<Clinics.List.Length;i++) {
					comboClinic.Items.Add(Clinics.List[i].Description);
					if(Clinics.List[i].ClinicNum==ProcCur.ClinicNum) {
						comboClinic.SelectedIndex=i+1;
					}
				}
			}
			textSite.Text=Sites.GetDescription(ProcCur.SiteNum);
			if(CultureInfo.CurrentCulture.Name.EndsWith("CA")) {//Canadian. en-CA or fr-CA
				if(ProcCur.CanadianTypeCodes==null || ProcCur.CanadianTypeCodes=="") {
					checkTypeCodeX.Checked=true;
				}
				else {
					if(ProcCur.CanadianTypeCodes.Contains("A")) {
						checkTypeCodeA.Checked=true;
					}
					if(ProcCur.CanadianTypeCodes.Contains("B")) {
						checkTypeCodeB.Checked=true;
					}
					if(ProcCur.CanadianTypeCodes.Contains("C")) {
						checkTypeCodeC.Checked=true;
					}
					if(ProcCur.CanadianTypeCodes.Contains("E")) {
						checkTypeCodeE.Checked=true;
					}
					if(ProcCur.CanadianTypeCodes.Contains("L")) {
						checkTypeCodeL.Checked=true;
					}
					if(ProcCur.CanadianTypeCodes.Contains("S")) {
						checkTypeCodeS.Checked=true;
					}
					if(ProcCur.CanadianTypeCodes.Contains("X")) {
						checkTypeCodeX.Checked=true;
					}
				}
			}
			else{
				if(ProcedureCode2.IsProsth){
					listProsth.Items.Add(Lan.g(this,"No"));
					listProsth.Items.Add(Lan.g(this,"Initial"));
					listProsth.Items.Add(Lan.g(this,"Replacement"));
					switch(ProcCur.Prosthesis){
						case "":
							listProsth.SelectedIndex=0;
							break;
						case "I":
							listProsth.SelectedIndex=1;
							break;
						case "R":
							listProsth.SelectedIndex=2;
							break;
					}
					if(ProcCur.DateOriginalProsth.Year>1880){
						textDateOriginalProsth.Text=ProcCur.DateOriginalProsth.ToShortDateString();
					}
				}
				else{
					groupProsth.Visible=false;
				}
			}
			//medical
			textMedicalCode.Text=ProcCur.MedicalCode;
			textDiagnosticCode.Text=ProcCur.DiagnosticCode;
			checkIsPrincDiag.Checked=ProcCur.IsPrincDiag;
			textCodeMod1.Text = ProcCur.CodeMod1;
			textCodeMod2.Text = ProcCur.CodeMod2;
			textCodeMod3.Text = ProcCur.CodeMod3;
			textCodeMod4.Text = ProcCur.CodeMod4;
			textUnitQty.Text = ProcCur.UnitQty.ToString();
			comboUnitType.Items.Clear();
			_snomedBodySite=Snomeds.GetByCode(ProcCur.SnomedBodySite);
			if(_snomedBodySite==null) {
				textSnomedBodySite.Text="";
			}
			else {
				textSnomedBodySite.Text=_snomedBodySite.Description;
			}
			for(int i=0;i<Enum.GetNames(typeof(ProcUnitQtyType)).Length;i++) {
				comboUnitType.Items.Add(Enum.GetNames(typeof(ProcUnitQtyType))[i]);
			}
			comboUnitType.SelectedIndex=(int)ProcCur.UnitQtyType;
			textRevCode.Text = ProcCur.RevCode;
			//DrugNDC is handled in SetControlsUpperLeft
			comboDrugUnit.Items.Clear();
			for(int i=0;i<Enum.GetNames(typeof(EnumProcDrugUnit)).Length;i++){
				comboDrugUnit.Items.Add(Enum.GetNames(typeof(EnumProcDrugUnit))[i]);
			}
			comboDrugUnit.SelectedIndex=(int)ProcCur.DrugUnit;
			if(ProcCur.DrugQty!=0){
				textDrugQty.Text=ProcCur.DrugQty.ToString();
			}
			textClaimNote.Text=ProcCur.ClaimNote;
			textUser.Text=Userods.GetName(ProcCur.UserNum);//might be blank. Will change automatically if user changes note or alters sig.
			labelInvalidSig.Visible=false;
			sigBox.Visible=true;
			if(ProcCur.SigIsTopaz) {
				if(ProcCur.Signature!="") {
					//if(allowTopaz){
					sigBox.Visible=false;
					sigBoxTopaz.Visible=true;
					CodeBase.TopazWrapper.ClearTopaz(sigBoxTopaz);
					CodeBase.TopazWrapper.SetTopazCompressionMode(sigBoxTopaz,0);
					CodeBase.TopazWrapper.SetTopazEncryptionMode(sigBoxTopaz,0);
					CodeBase.TopazWrapper.SetTopazKeyString(sigBoxTopaz,"0000000000000000");
					CodeBase.TopazWrapper.SetTopazEncryptionMode(sigBoxTopaz,2);//high encryption
					CodeBase.TopazWrapper.SetTopazCompressionMode(sigBoxTopaz,2);//high compression
					CodeBase.TopazWrapper.SetTopazSigString(sigBoxTopaz,ProcCur.Signature);
					//older notes may have been signed with zeros due to a bug.  We still want to show the sig in that case.
					//but if a sig is not showing, then set the key string to try to get it to show.
					if(CodeBase.TopazWrapper.GetTopazNumberOfTabletPoints(sigBoxTopaz)==0) {
						CodeBase.TopazWrapper.SetTopazAutoKeyData(sigBoxTopaz,ProcCur.Note+ProcCur.UserNum.ToString());
						CodeBase.TopazWrapper.SetTopazSigString(sigBoxTopaz,ProcCur.Signature);
					}
					//If sig is not showing, then try encryption mode 3 for signatures signed with old SigPlusNet.dll.
					if(CodeBase.TopazWrapper.GetTopazNumberOfTabletPoints(sigBoxTopaz)==0) {
						CodeBase.TopazWrapper.SetTopazEncryptionMode(sigBoxTopaz,3);//Unknown mode (told to use via TopazSystems)
						CodeBase.TopazWrapper.SetTopazSigString(sigBoxTopaz,ProcCur.Signature);
					}
					//if still not showing, then it must be invalid
					if(CodeBase.TopazWrapper.GetTopazNumberOfTabletPoints(sigBoxTopaz)==0) {
						labelInvalidSig.Visible=true;
					}
					CodeBase.TopazWrapper.SetTopazState(sigBoxTopaz,0);
					//}
				}
			}
			else {
				if(ProcCur.Signature!=null && ProcCur.Signature!="") {
					sigBox.Visible=true;
					if(sigBoxTopaz!=null) {
						sigBoxTopaz.Visible=false;
					}
					sigBox.ClearTablet();
					//sigBox.SetSigCompressionMode(0);
					//sigBox.SetEncryptionMode(0);
					sigBox.SetKeyString("0000000000000000");
					sigBox.SetAutoKeyData(ProcCur.Note+ProcCur.UserNum.ToString());
					//sigBox.SetEncryptionMode(2);//high encryption
					//sigBox.SetSigCompressionMode(2);//high compression
					sigBox.SetSigString(ProcCur.Signature);
					if(sigBox.NumberOfTabletPoints()==0) {
						labelInvalidSig.Visible=true;
					}
					sigBox.SetTabletState(0);//not accepting input.  To accept input, change the note, or clear the sig.
				}
			}
			if(Programs.UsingOrion) {//panelOrion.Visible) {
				comboDPC.Items.Clear();
				//comboDPC.Items.AddRange(Enum.GetNames(typeof(OrionDPC)));
				comboDPC.Items.Add("Not Specified");
				comboDPC.Items.Add("None");
				comboDPC.Items.Add("1A-within 1 day");
				comboDPC.Items.Add("1B-within 30 days");
				comboDPC.Items.Add("1C-within 60 days");
				comboDPC.Items.Add("2-within 120 days");
				comboDPC.Items.Add("3-within 1 year");
				comboDPC.Items.Add("4-no further treatment/appt");
				comboDPC.Items.Add("5-no appointment needed");
				comboDPCpost.Items.Clear();
				comboDPCpost.Items.Add("Not Specified");
				comboDPCpost.Items.Add("None");
				comboDPCpost.Items.Add("1A-within 1 day");
				comboDPCpost.Items.Add("1B-within 30 days");
				comboDPCpost.Items.Add("1C-within 60 days");
				comboDPCpost.Items.Add("2-within 120 days");
				comboDPCpost.Items.Add("3-within 1 year");
				comboDPCpost.Items.Add("4-no further treatment/appt");
				comboDPCpost.Items.Add("5-no appointment needed");
				comboStatus.Items.Clear();
				comboStatus.Items.Add("TP-treatment planned");
				comboStatus.Items.Add("C-completed");
				comboStatus.Items.Add("E-existing prior to incarceration");
				comboStatus.Items.Add("R-refused treatment");
				comboStatus.Items.Add("RO-referred out to specialist");
				comboStatus.Items.Add("CS-completed by specialist");
				comboStatus.Items.Add("CR-completed by registry");
				comboStatus.Items.Add("CA_Tx-cancelled, tx plan changed");
				comboStatus.Items.Add("CA_EPRD-cancelled, eligible parole");
				comboStatus.Items.Add("CA_P/D-cancelled, parole/discharge");
				comboStatus.Items.Add("S-suspended, unacceptable plaque");
				comboStatus.Items.Add("ST-stop clock, multi visit");
				comboStatus.Items.Add("W-watch");
				comboStatus.Items.Add("A-alternative");
				comboStatus.SelectedIndex=0;
				ProcedureCode pc=ProcedureCodes.GetProcCodeFromDb(ProcCur.CodeNum);
				checkIsRepair.Visible=pc.IsProsth;
				//DateTP doesn't get set sometimes and calculations are made based on the DateTP. So set it to the current date as fail-safe.
				if(ProcCur.DateTP.Year<1880) {
					textDateTP.Text=MiscData.GetNowDateTime().ToShortDateString();
				}
				else {
					textDateTP.Text=ProcCur.DateTP.ToShortDateString();
				}
				BitArray ba=new BitArray(new int[] { (int)OrionProcCur.Status2 });//should nearly always be non-zero
				for(int i=0;i<ba.Length;i++) {
					if(ba[i]) {
						comboStatus.SelectedIndex=i;
						break;
					}
				}
				if(!IsNew) {
					OrionProcOld=OrionProcCur.Copy();
					comboDPC.SelectedIndex=(int)OrionProcCur.DPC;
					comboDPCpost.SelectedIndex=(int)OrionProcCur.DPCpost;
					if(OrionProcCur.DPC==OrionDPC.NotSpecified ||
						OrionProcCur.DPC==OrionDPC.None ||
						OrionProcCur.DPC==OrionDPC._4 ||
						OrionProcCur.DPC==OrionDPC._5) {
						labelScheduleBy.Visible=true;
					}
					if(OrionProcCur.DateScheduleBy.Year>1880) {
						textDateScheduled.Text=OrionProcCur.DateScheduleBy.ToShortDateString();
					}
					if(OrionProcCur.DateStopClock.Year>1880) {
						textDateStop.Text=OrionProcCur.DateStopClock.ToShortDateString();
					}
					checkIsOnCall.Checked=OrionProcCur.IsOnCall;
					checkIsEffComm.Checked=OrionProcCur.IsEffectiveComm;
					checkIsRepair.Checked=OrionProcCur.IsRepair;
				}
				else {
					labelScheduleBy.Visible=true;
					comboDPC.SelectedIndex=0;
					comboDPCpost.SelectedIndex=0;
					textDateStop.Text="";
				}
			}
		}
Example #7
0
		private void FormProcInfo_Load(object sender,System.EventArgs e) {
			//Set the title bar to show the patient's name much like the main screen does.
			this.Text+=" - "+PatCur.GetNameLF();
			//richTextBox1.Text="This is a test of the functions of a rich text box.";
			//webBrowser1.
			//richTextBox1.Select(10,4);
			//richTextBox1.SelectionFont=new Font(FontFamily.GenericMonospace,8);
			//richTextBox1.Select(22,9);
			//richTextBox1.SelectionFont=new Font(FontFamily.GenericMonospace,8,FontStyle.Underline);
			textDateEntry.Text=ProcCur.DateEntryC.ToShortDateString();
			if(PrefC.GetBool(PrefName.EasyHidePublicHealth)){
				labelPlaceService.Visible=false;
				comboPlaceService.Visible=false;
				labelSite.Visible=false;
				textSite.Visible=false;
				butPickSite.Visible=false;
			}
			if(PrefC.GetLong(PrefName.UseInternationalToothNumbers)==1){
				listBoxTeeth.Items.Clear();
				listBoxTeeth.Items.AddRange(new string[] {"18","17","16","15","14","13","12","11","21","22","23","24","25","26","27","28"});
				listBoxTeeth2.Items.Clear();
				listBoxTeeth2.Items.AddRange(new string[] {"48","47","46","45","44","43","42","41","31","32","33","34","35","36","37","38"});
			}
			if(PrefC.GetLong(PrefName.UseInternationalToothNumbers)==3){
				listBoxTeeth.Items.Clear();
				listBoxTeeth.Items.AddRange(new string[] {"8","7","6","5","4","3","2","1","1","2","3","4","5","6","7","8"});
				listBoxTeeth2.Items.Clear();
				listBoxTeeth2.Items.AddRange(new string[] {"8","7","6","5","4","3","2","1","1","2","3","4","5","6","7","8"});
			}
			if(!Security.IsAuthorized(Permissions.ProcEditShowFee,true)){
				labelAmount.Visible=false;
				textProcFee.Visible=false;
			}
			if(!Security.IsAuthorized(Permissions.ProcedureNote,true)) {
				textNotes.Enabled=false;
				buttonUseAutoNote.Enabled=false;
			}
			ClaimList=Claims.Refresh(PatCur.PatNum);
			ProcedureCode2=ProcedureCodes.GetProcCode(ProcCur.CodeNum);
			if(ProcCur.ProcStatus==ProcStat.C && PrefC.GetBool(PrefName.ProcLockingIsAllowed) && !ProcCur.IsLocked) {
				butLock.Visible=true;
			}
			else {
				butLock.Visible=false;
			}
			if(IsNew){
				if(ProcCur.ProcStatus==ProcStat.C){
					if(!Security.IsAuthorized(Permissions.ProcComplCreate)){
						DialogResult=DialogResult.Cancel;
						return;
					}
				}
				//SetControls();
				//return;
			}
			else{
				if(ProcCur.ProcStatus==ProcStat.C){
					if(ProcCur.IsLocked) {//Whether locking is currently allowed, this proc may have been locked previously.
						butOK.Enabled=false;//use this state to cascade permission to any form opened from here
						butDelete.Enabled=false;
						butChange.Enabled=false;
						butEditAnyway.Enabled=false;
						butSetComplete.Enabled=false;
						butSnomedBodySiteSelect.Enabled=false;
						butNoneSnomedBodySite.Enabled=false;
						labelLocked.Visible=true;
						butAppend.Visible=true;
						textNotes.ReadOnly=true;//just for visual cue.  No way to save changes, anyway.
						textNotes.BackColor=SystemColors.Control;
						butInvalidate.Visible=true;
						butInvalidate.Location=butLock.Location;
					}
					else{
						butInvalidate.Visible=false;
						//because islocked overrides security:
						if(!Security.IsAuthorized(Permissions.ProcComplEdit,ProcCur.DateEntryC)){
							butOK.Enabled=false;//use this state to cascade permission to any form opened from here
							butDelete.Enabled=false;
							butChange.Enabled=false;
							butEditAnyway.Enabled=false;
							butSetComplete.Enabled=false;
						}
					}
				}
			}
			//ClaimProcList=ClaimProcs.Refresh(PatCur.PatNum);
			ClaimProcsForProc=ClaimProcs.RefreshForProc(ProcCur.ProcNum);
			PatPlanList=PatPlans.Refresh(PatCur.PatNum);
			BenefitList=Benefits.Refresh(PatPlanList,SubList);
			if(Procedures.IsAttachedToClaim(ProcCur,ClaimProcsForProc)){
				StartedAttachedToClaim=true;
				//however, this doesn't stop someone from creating a claim while this window is open,
				//so this is checked at the end, too.
				panel1.Enabled=false;
				comboProcStatus.Enabled=false;
				checkNoBillIns.Enabled=false;
				butChange.Enabled=false;
				butDelete.Enabled=false;
				butEditAnyway.Visible=true;
				labelClaim.Visible=true;
				butSetComplete.Enabled=false;
			}
			if(PrefC.GetBool(PrefName.EasyHideClinical)){
				labelDx.Visible=false;
				comboDx.Visible=false;
				labelPrognosis.Visible=false;
				comboPrognosis.Visible=false;
			}
			if(PrefC.GetBool(PrefName.EasyHideMedicaid)) {
				comboBillingTypeOne.Visible=false;
				labelBillingTypeOne.Visible=false;
				comboBillingTypeTwo.Visible=false;
				labelBillingTypeTwo.Visible=false;
			}
			if(CultureInfo.CurrentCulture.Name.EndsWith("CA")) {//Canadian. en-CA or fr-CA
				//groupCanadianProcType.Location=new Point(106,301);
				groupProsth.Visible=false;
				labelClaimNote.Visible=false;
				textClaimNote.Visible=false;
				butBF.Text=Lan.g(this,"B/V");//vestibular instead of facial
				butV.Text=Lan.g(this,"5");
				if(ProcedureCode2.IsCanadianLab) { //Prevent lab fees from having lab fees attached.
					labelCanadaLabFee1.Visible=false;
					textCanadaLabFee1.Visible=false;
					labelCanadaLabFee2.Visible=false;
					textCanadaLabFee2.Visible=false;
				}
				else {
					canadaLabFees=Procedures.GetCanadianLabFees(ProcCur.ProcNum);
					if(canadaLabFees.Count>0) {
						textCanadaLabFee1.Text=canadaLabFees[0].ProcFee.ToString("n");
						if(canadaLabFees[0].ProcStatus==ProcStat.C) {
							textCanadaLabFee1.ReadOnly=true;
						}
					}
					if(canadaLabFees.Count>1) {
						textCanadaLabFee2.Text=canadaLabFees[1].ProcFee.ToString("n");
						if(canadaLabFees[1].ProcStatus==ProcStat.C) {
							textCanadaLabFee2.ReadOnly=true;
						}
					}
				}
			}
			else {
				tabControl.Controls.Remove(tabPageCanada);
				//groupCanadianProcType.Visible=false;
			}
			if(Programs.UsingOrion) {
				if(IsNew) {
					OrionProcCur=new OrionProc();
					OrionProcCur.ProcNum=ProcCur.ProcNum;
					if(ProcCur.ProcStatus==ProcStat.EO) {
						OrionProcCur.Status2=OrionStatus.E;
					}
					else {
						OrionProcCur.Status2=OrionStatus.TP;
					}
				}
				else {
					OrionProcCur=OrionProcs.GetOneByProcNum(ProcCur.ProcNum);
					if(ProcCur.DateTP<MiscData.GetNowDateTime().Date && 
						(OrionProcCur.Status2==OrionStatus.CA_EPRD
						|| OrionProcCur.Status2==OrionStatus.CA_PD
						|| OrionProcCur.Status2==OrionStatus.CA_Tx
						|| OrionProcCur.Status2==OrionStatus.R)) {//Not allowed to edit procedures with these statuses that are older than a day.
						MsgBox.Show(this,"You cannot edit refused or cancelled procedures.");
						DialogResult=DialogResult.Cancel;
					}
					if(OrionProcCur.Status2==OrionStatus.C || OrionProcCur.Status2==OrionStatus.CR || OrionProcCur.Status2==OrionStatus.CS) {
						textNotes.Enabled=false;
					}
				}
				textDateTP.ReadOnly=true;
				//panelOrion.Visible=true;
				butAddEstimate.Visible=false;
				checkNoBillIns.Visible=false;
				gridIns.Visible=false;
				butAddAdjust.Visible=false;
				tbPay.Visible=false;
				tbAdj.Visible=false;
				comboProcStatus.Enabled=false;
				labelAmount.Visible=false;
				textProcFee.Visible=false;
				labelPriority.Visible=false;
				comboPriority.Visible=false;
				butSetComplete.Visible=false;
				labelSetComplete.Visible=false;
			}
			else {
				tabControl.Controls.Remove(tabPageOrion);
			}
			if(Programs.UsingOrion || PrefC.GetBool(PrefName.ShowFeatureMedicalInsurance)) {
				labelEndTime.Visible=true;
				textTimeEnd.Visible=true;
				butNow.Visible=true;
				labelTimeFinal.Visible=true;
				textTimeFinal.Visible=true;
			}
			if(PrefC.GetBool(PrefName.ShowFeatureEhr)) {
				textNotes.HideSelection=false;//When text is selected programmatically using our Search function, this causes the selection to be visible to the users.
			}
			else {
				butSearch.Visible=false;
			}
			IsStartingUp=true;
			FillControlsOnStartup();
			SetControlsUpperLeft();
			FillReferral();
			FillIns(false);
			FillPayments();
			FillAdj();
			IsStartingUp=false;
			//string retVal=ProcCur.Note+ProcCur.UserNum.ToString();
			//MsgBoxCopyPaste msgb=new MsgBoxCopyPaste(retVal);
			//msgb.ShowDialog();
		}		
Example #8
0
		private void menuItemGroupSelected_Click(object sender,EventArgs e){
			DataRow row;
			if(gridProg.SelectedIndices.Length==0){
				MsgBox.Show(this,"Please select procedures to attach a group note to.");
				return;
			}
			for(int i=0;i<gridProg.SelectedIndices.Length;i++){
				row=(DataRow)gridProg.Rows[gridProg.SelectedIndices[i]].Tag;
				if(row["ProcNum"].ToString()=="0") { //This is not a procedure.
					MsgBox.Show(this,"You may only attach a group note to procedures.");
					return;
				}
			}
			List<Procedure> proclist=new List<Procedure>();
			Procedure proc;
			for(int i=0;i<gridProg.SelectedIndices.Length;i++){//Create proclist from selected items.
				row=(DataRow)gridProg.Rows[gridProg.SelectedIndices[i]].Tag;
				proc=Procedures.GetOneProc(PIn.Long(row["ProcNum"].ToString()),true);
				proclist.Add(proc);
			}
			//Validate the list of procedures------------------------------------------------------------------------------------
			DateTime procDate=proclist[0].ProcDate;
			long clinicNum=proclist[0].ClinicNum;
			long provNum=proclist[0].ProvNum;
			for(int i=0;i<proclist.Count;i++){//starts at 0 to check procStatus
				if(ProcedureCodes.GetStringProcCode(proclist[i].CodeNum)==ProcedureCodes.GroupProcCode){
					MsgBox.Show(this,"You cannot attach a group note to another group note.");
					return;
				}
				if(proclist[i].IsLocked) {
					MsgBox.Show(this,"Procedures cannot be locked.");
					return;
				}
				if(proclist[i].ProcDate!=procDate){
					MsgBox.Show(this,"Procedures must have the same date to attach a group note.");
					return;
				}
				if(proclist[i].ProcStatus!=ProcStat.C){
					MsgBox.Show(this,"Procedures must be complete to attach a group note.");
					return;
				}
				if(proclist[i].ClinicNum!=clinicNum){
					MsgBox.Show(this,"Procedures must have the same clinic to attach a group note.");
					return;
				}
				if(proclist[i].ProvNum!=provNum){
					MsgBox.Show(this,"Procedures must have the same provider to attach a group note.");
					return;
				}
			}
			//Procedures are valid. Create new Procedure "group" and ProcGroupItems-------------------------------------------------------
			Procedure group=new Procedure();
			group.PatNum=PatCur.PatNum;
			group.ProcStatus=ProcStat.EC;
			group.DateEntryC=DateTime.Now;
			group.ProcDate=procDate;
			group.ProvNum=provNum;
			group.ClinicNum=clinicNum;
			group.CodeNum=ProcedureCodes.GetCodeNum(ProcedureCodes.GroupProcCode);
			if(PrefC.GetBool(PrefName.ProcGroupNoteDoesAggregate)) {
				string aggNote="";
				for(int i=0;i<proclist.Count;i++) {
					if(i>0 && proclist[i-1].Note!="") {
						aggNote+="\r\n";
					}
					aggNote+=proclist[i].Note;
				}
				group.Note=aggNote;
			}
			else {
				group.Note=ProcCodeNotes.GetNote(group.ProvNum,group.CodeNum);
			}
			group.IsNew=true;
			Procedures.Insert(group);
			List<ProcGroupItem> groupItemList=new List<ProcGroupItem>();
			ProcGroupItem groupItem;
			for(int i=0;i<proclist.Count;i++){
				groupItem=new ProcGroupItem();
				groupItem.ProcNum=proclist[i].ProcNum;
				groupItem.GroupNum=group.ProcNum;
				ProcGroupItems.Insert(groupItem);
				groupItemList.Add(groupItem);
			}
			if(Programs.UsingOrion) {
				OrionProc op=new OrionProc();
				op.ProcNum=group.ProcNum;
				op.Status2=OrionStatus.C;
				OrionProcs.Insert(op);
			}
			FormProcGroup FormP=new FormProcGroup();
			FormP.GroupCur=group;
			FormP.GroupItemList=groupItemList;
			FormP.ProcList=proclist;
			FormP.ShowDialog();
			if(FormP.DialogResult!=DialogResult.OK){
				return;
			}
			if(PrefC.GetBool(PrefName.ProcGroupNoteDoesAggregate)) {
				//remove the notes from all the attached procs
				for(int i=0;i<proclist.Count;i++) {
					Procedure oldProc=proclist[i].Copy();
					Procedure changedProc=proclist[i].Copy();
					changedProc.Note="";
					Procedures.Update(changedProc,oldProc);
				}
			}
			ModuleSelected(PatCur.PatNum);
		}
Example #9
0
 private void FormProcInfo_Load(object sender, System.EventArgs e)
 {
     //richTextBox1.Text="This is a test of the functions of a rich text box.";
     //webBrowser1.
     //richTextBox1.Select(10,4);
     //richTextBox1.SelectionFont=new Font(FontFamily.GenericMonospace,8);
     //richTextBox1.Select(22,9);
     //richTextBox1.SelectionFont=new Font(FontFamily.GenericMonospace,8,FontStyle.Underline);
     textDateEntry.Text=ProcCur.DateEntryC.ToShortDateString();
     if(PrefC.GetBool(PrefName.EasyHidePublicHealth)){
         labelPlaceService.Visible=false;
         comboPlaceService.Visible=false;
         labelSite.Visible=false;
         textSite.Visible=false;
         butPickSite.Visible=false;
     }
     if(PrefC.GetLong(PrefName.UseInternationalToothNumbers)==1){
         listBoxTeeth.Items.Clear();
         listBoxTeeth.Items.AddRange(new string[] {"18","17","16","15","14","13","12","11","21","22","23","24","25","26","27","28"});
         listBoxTeeth2.Items.Clear();
         listBoxTeeth2.Items.AddRange(new string[] {"48","47","46","45","44","43","42","41","31","32","33","34","35","36","37","38"});
     }
     if(PrefC.GetLong(PrefName.UseInternationalToothNumbers)==3){
         listBoxTeeth.Items.Clear();
         listBoxTeeth.Items.AddRange(new string[] {"8","7","6","5","4","3","2","1","1","2","3","4","5","6","7","8"});
         listBoxTeeth2.Items.Clear();
         listBoxTeeth2.Items.AddRange(new string[] {"8","7","6","5","4","3","2","1","1","2","3","4","5","6","7","8"});
     }
     if(!Security.IsAuthorized(Permissions.ProcEditShowFee,true)){
         labelAmount.Visible=false;
         textProcFee.Visible=false;
     }
     if(!Security.IsAuthorized(Permissions.ProcedureNote,true)) {
         textNotes.Enabled=false;
         buttonUseAutoNote.Enabled=false;
     }
     ClaimList=Claims.Refresh(PatCur.PatNum);
     ProcedureCode2=ProcedureCodes.GetProcCode(ProcCur.CodeNum);
     if(IsNew){
         if(ProcCur.ProcStatus==ProcStat.C){
             if(!Security.IsAuthorized(Permissions.ProcComplCreate)){
                 DialogResult=DialogResult.Cancel;
                 return;
             }
         }
         //SetControls();
         //return;
     }
     else{
         if(ProcCur.ProcStatus==ProcStat.C){
             if(!Security.IsAuthorized(Permissions.ProcComplEdit,ProcCur.DateEntryC)){
                 butOK.Enabled=false;//use this state to cascade permission to any form openned from here
                 butDelete.Enabled=false;
                 butChange.Enabled=false;
                 butEditAnyway.Enabled=false;
                 butSetComplete.Enabled=false;
             }
         }
     }
     //ClaimProcList=ClaimProcs.Refresh(PatCur.PatNum);
     ClaimProcsForProc=ClaimProcs.RefreshForProc(ProcCur.ProcNum);
     PatPlanList=PatPlans.Refresh(PatCur.PatNum);
     BenefitList=Benefits.Refresh(PatPlanList,SubList);
     if(Procedures.IsAttachedToClaim(ProcCur,ClaimProcsForProc)){
         StartedAttachedToClaim=true;
         //however, this doesn't stop someone from creating a claim while this window is open,
         //so this is checked at the end, too.
         panel1.Enabled=false;
         comboProcStatus.Enabled=false;
         checkNoBillIns.Enabled=false;
         butChange.Enabled=false;
         butDelete.Enabled=false;
         butEditAnyway.Visible=true;
         labelClaim.Visible=true;
         butSetComplete.Enabled=false;
     }
     if(PrefC.GetBool(PrefName.EasyHideClinical)){
         labelDx.Visible=false;
         comboDx.Visible=false;
         labelPrognosis.Visible=false;
         comboPrognosis.Visible=false;
     }
     if(PrefC.GetBool(PrefName.EasyHideMedicaid)) {
         comboBillingTypeOne.Visible=false;
         labelBillingTypeOne.Visible=false;
         comboBillingTypeTwo.Visible=false;
         labelBillingTypeTwo.Visible=false;
     }
     if(CultureInfo.CurrentCulture.Name.EndsWith("CA")) {//Canadian. en-CA or fr-CA
         groupProsth.Visible=false;
         labelClaimNote.Visible=false;
         textClaimNote.Visible=false;
         butBF.Text=Lan.g(this,"B/V");//vestibular instead of facial
         butV.Text=Lan.g(this,"5");
     }
     else {
         groupCanadianProcType.Visible=false;
     }
     if(Programs.UsingOrion){
         if(IsNew) {
             OrionProcCur=new OrionProc();
             OrionProcCur.ProcNum=ProcCur.ProcNum;
             if(ProcCur.ProcStatus==ProcStat.EO) {
                 OrionProcCur.Status2=OrionStatus.E;
             }
             else {
                 OrionProcCur.Status2=OrionStatus.TP;
             }
         }
         else {
             OrionProcCur=OrionProcs.GetOneByProcNum(ProcCur.ProcNum);
             if(ProcCur.DateTP<MiscData.GetNowDateTime().Date &&
                 (OrionProcCur.Status2==OrionStatus.CA_EPRD
                 || OrionProcCur.Status2==OrionStatus.CA_PD
                 || OrionProcCur.Status2==OrionStatus.CA_Tx
                 || OrionProcCur.Status2==OrionStatus.R))
             {//Not allowed to edit procedures with these statuses that are older than a day.
                 MsgBox.Show(this,"You cannot edit refused or cancelled procedures.");
                 DialogResult=DialogResult.Cancel;
             }
             if(OrionProcCur.Status2==OrionStatus.C || OrionProcCur.Status2==OrionStatus.CR || OrionProcCur.Status2==OrionStatus.CS){
                 textNotes.Enabled=false;
             }
         }
         textDateTP.ReadOnly=true;
         panelOrion.Visible=true;
         butAddEstimate.Visible=false;
         checkNoBillIns.Visible=false;
         gridIns.Visible=false;
         butAddAdjust.Visible=false;
         tbPay.Visible=false;
         tbAdj.Visible=false;
         comboProcStatus.Enabled=false;
         labelAmount.Visible=false;
         textProcFee.Visible=false;
         labelPriority.Visible=false;
         comboPriority.Visible=false;
         butSetComplete.Visible=false;
         labelSetComplete.Visible=false;
     }
     if(Programs.UsingOrion || PrefC.GetBool(PrefName.ShowFeatureMedicalInsurance)) {
         labelEndTime.Visible=true;
         textTimeEnd.Visible=true;
         butNow.Visible=true;
         labelTimeFinal.Visible=true;
         textTimeFinal.Visible=true;
     }
     IsStartingUp=true;
     FillControlsOnStartup();
     SetControlsUpperLeft();
     FillReferral();
     FillIns(false);
     FillPayments();
     FillAdj();
     IsStartingUp=false;
 }