Esempio n. 1
0
		///<summary></summary>
		public static void Update(ProcButtonQuick procButtonQuick){
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb){
				Meth.GetVoid(MethodBase.GetCurrentMethod(),procButtonQuick);
				return;
			}
			Crud.ProcButtonQuickCrud.Update(procButtonQuick);
		}
Esempio n. 2
0
		///<summary>Sort by Y values first, then sort by X values.</summary>
		public static int sortYX(ProcButtonQuick p1,ProcButtonQuick p2) {
			//#error Move this to the S class once it is generated.
			if(p1.YPos!=p2.YPos) {
				return p1.YPos.CompareTo(p2.YPos);
			}
			return p1.ItemOrder.CompareTo(p2.ItemOrder);
		}
Esempio n. 3
0
		///<summary></summary>
		public static long Insert(ProcButtonQuick procButtonQuick){
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb){
				procButtonQuick.ProcButtonQuickNum=Meth.GetLong(MethodBase.GetCurrentMethod(),procButtonQuick);
				return procButtonQuick.ProcButtonQuickNum;
			}
			return Crud.ProcButtonQuickCrud.Insert(procButtonQuick);
		}
Esempio n. 4
0
 ///<summary></summary>
 public static void Update(ProcButtonQuick procButtonQuick)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), procButtonQuick);
         return;
     }
     Crud.ProcButtonQuickCrud.Update(procButtonQuick);
 }
Esempio n. 5
0
 ///<summary></summary>
 public static long Insert(ProcButtonQuick procButtonQuick)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         procButtonQuick.ProcButtonQuickNum = Meth.GetLong(MethodBase.GetCurrentMethod(), procButtonQuick);
         return(procButtonQuick.ProcButtonQuickNum);
     }
     return(Crud.ProcButtonQuickCrud.Insert(procButtonQuick));
 }
Esempio n. 6
0
 ///<summary>Sort by Y values first, then sort by X values.</summary>
 public static int sortYX(ProcButtonQuick p1, ProcButtonQuick p2)
 {
     //#error Move this to the S class once it is generated.
     if (p1.YPos != p2.YPos)
     {
         return(p1.YPos.CompareTo(p2.YPos));
     }
     return(p1.ItemOrder.CompareTo(p2.ItemOrder));
 }
Esempio n. 7
0
		private void butDelete_Click(object sender,EventArgs e) {
			if(IsNew) {
				pbqCur=null;
				DialogResult=DialogResult.Cancel;
			}
			else {
				ProcButtonQuicks.Delete(pbqCur.ProcButtonQuickNum);
				pbqCur=null;
				DialogResult=DialogResult.OK;
			}
		}
Esempio n. 8
0
		///<summary>Returns true if all members are equal. This compares member values instead of comparing memory addresses.</summary>
		public bool Equals(ProcButtonQuick other) {
			if(ProcButtonQuickNum==other.ProcButtonQuickNum
				&& Description ==other.Description
				&& CodeValue   ==other.CodeValue  
				&& Surf        ==other.Surf		  
				&& ItemOrder   ==other.ItemOrder		  
				&& YPos        ==other.YPos		  
				&& IsLabel     ==other.IsLabel) {
				return true;
			}
			return false;
		}
Esempio n. 9
0
 ///<summary>Returns true if all members are equal. This compares member values instead of comparing memory addresses.</summary>
 public bool Equals(ProcButtonQuick other)
 {
     if (ProcButtonQuickNum == other.ProcButtonQuickNum &&
         Description == other.Description &&
         CodeValue == other.CodeValue &&
         Surf == other.Surf &&
         ItemOrder == other.ItemOrder &&
         YPos == other.YPos &&
         IsLabel == other.IsLabel)
     {
         return(true);
     }
     return(false);
 }
Esempio n. 10
0
		/////<summary>If quickbutton, then pass the code in and set procButtonNum to 0.</summary>
		//private void ProcButtonClicked(long procButtonNum,string quickcode) {
		//	ProcButtonClicked(procButtonNum,quickcode,null);
		//}

		///<summary>If quickbutton, then pass the PBQ in and set procButtonNum to 0.</summary>
		private void ProcButtonClicked(long procButtonNum,ProcButtonQuick pbq=null) {
			orionProvNum=0;
			if(newStatus==ProcStat.C){
				if(!Security.IsAuthorized(Permissions.ProcComplCreate,PIn.Date(textDate.Text))){
					return;
				}
			}
			#if TRIALONLY
				if(procButtonNum==0){
					MsgBox.Show(this,"Quick buttons do not work in the trial version because dummy codes are being used instead of real codes.  Just to the left, change to a different category to see other procedure buttons available which do work.");
					return;
				}
			#endif 
			bool isValid;
			TreatmentArea tArea;
			int quadCount=0;//automates quadrant codes.
			long[] codeList;
			long[] autoCodeList;
			if(procButtonNum==0){
				codeList=new long[1];
				codeList[0]=ProcedureCodes.GetCodeNum(pbq.CodeValue);
				if(codeList[0]==0) {
					MessageBox.Show(this,Lan.g(this,"Procedure code does not exist in database")+" : "+pbq.CodeValue);
					return;
				}
				autoCodeList=new long[0];
			}
			else{
				codeList=ProcButtonItems.GetCodeNumListForButton(procButtonNum);
				autoCodeList=ProcButtonItems.GetAutoListForButton(procButtonNum);
				//if(codeList.
			}
			//It is very important that we stop users here before entering any procedures or doing any automation.
			for(int i=0;i<codeList.Length;i++) {
				if(IsToothRangeWithPrimary(codeList[i])) {
					//FormProcEdit does not currently allow you to select primary teeth for a tooth range procedure code.  We don't allow users to create these procedures because they would never be able to edit.
					MsgBox.Show(this,"The tooth range treatment area doesn't allow primary teeth.  Please unselect any primary teeth.");
					return;
				}
			}
			//Do not return past this point---------------------------------------------------------------------------------
			Procedures.SetDateFirstVisit(DateTimeOD.Today,1,PatCur);
			List<string> procCodes=new List<string>();
			Procedure ProcCur=null;
			//"Bug fix" for Dr. Lazar-------------
			bool isPeriapicalSix=false;
			if(codeList.Length==6) {//quick check before checking all codes. So that the program isn't slowed down too much.
				string tempVal="";
				foreach(long code in codeList) {
					tempVal+=ProcedureCodes.GetProcCode(code).AbbrDesc;
				}
				if(tempVal=="PAPA+PA+PA+PA+PA+") {
					isPeriapicalSix = true;
					toothChart.SelectedTeeth.Clear();//set tooth numbers later
				}
			}
			for(int i=0;i<codeList.Length;i++){
				//needs to loop at least once, regardless of whether any teeth are selected.	
				for(int n=0;n==0 || n<toothChart.SelectedTeeth.Count;n++) {//Consider changing to a Do{}While() loop.
					isValid=true;
					ProcCur=new Procedure();//insert, so no need to set CurOld
					ProcCur.CodeNum=ProcedureCodes.GetProcCode(codeList[i]).CodeNum;
					tArea=ProcedureCodes.GetProcCode(ProcCur.CodeNum).TreatArea;
					//"Bug fix" for Dr. Lazar-------------
					if(isPeriapicalSix) {
						//PA code is already set to treatment area mouth by default.
						ProcCur.ToothNum=",8,14,19,24,30".Split(',')[i];//first code has tooth num "";
						if(i==0) {
							tArea=TreatmentArea.Mouth;
						}
						else {
							tArea=TreatmentArea.Tooth;
						}
					}
					if((tArea==TreatmentArea.Arch
						|| tArea==TreatmentArea.Mouth
						|| tArea==TreatmentArea.Quad
						|| tArea==TreatmentArea.Sextant
						|| tArea==TreatmentArea.ToothRange)
						&& n>0){//the only two left are tooth and surf
						continue;//only entered if n=0, so they don't get entered more than once.
					}
					else if(tArea==TreatmentArea.Quad){
						switch(quadCount%4){
							case 0: ProcCur.Surf="UR"; break;
							case 1: ProcCur.Surf="UL"; break;
							case 2: ProcCur.Surf="LL"; break;
							case 3: ProcCur.Surf="LR"; break;
						}
						quadCount++;
						if(pbq!=null && !string.IsNullOrWhiteSpace(pbq.Surf)) {//from quick buttons only.
							ProcCur.Surf=Tooth.SurfTidyFromDisplayToDb(pbq.Surf,ProcCur.ToothNum);
							//ProcCur.Surf=pbq.Surf;
						}
						AddQuick(ProcCur);
					}
					else if(tArea==TreatmentArea.Surf){
						if(toothChart.SelectedTeeth.Count==0){
							isValid=false;
						}
						else{
							ProcCur.ToothNum=toothChart.SelectedTeeth[n];
						}
						if(textSurf.Text=="" && pbq==null){
							isValid=false;// Pre-ODButtonPanel behavior
						}
						else if(pbq!=null && pbq.Surf==""){
							isValid=false; // ODButtonPanel behavior
						}
						else {
							ProcCur.Surf=Tooth.SurfTidyFromDisplayToDb(textSurf.Text,ProcCur.ToothNum);//it's ok if toothnum is not valid.
							if(pbq!=null && !string.IsNullOrWhiteSpace(pbq.Surf)) {//from quick buttons only.
								ProcCur.Surf=Tooth.SurfTidyFromDisplayToDb(pbq.Surf,ProcCur.ToothNum);
								//ProcCur.Surf=pbq.Surf;
							}
						}
						if(isValid){
							AddQuick(ProcCur);
						}
						else{
							AddProcedure(ProcCur);
						}
					}
					else if(tArea==TreatmentArea.Tooth){
						if(isPeriapicalSix) {
							AddQuick(ProcCur);
						}
						else if(toothChart.SelectedTeeth.Count==0) {
							AddProcedure(ProcCur);
						}
						else{
							ProcCur.ToothNum=toothChart.SelectedTeeth[n];
							AddQuick(ProcCur);
						}
					}
					else if(tArea==TreatmentArea.ToothRange){
						if(toothChart.SelectedTeeth.Count==0) {
							AddProcedure(ProcCur);
						}
						else{
							ProcCur.ToothRange="";
							for(int b=0;b<toothChart.SelectedTeeth.Count;b++) {
								if(b!=0) ProcCur.ToothRange+=",";
								ProcCur.ToothRange+=toothChart.SelectedTeeth[b];
							}
							AddQuick(ProcCur);
						}
					}
					else if(tArea==TreatmentArea.Arch){
						if(toothChart.SelectedTeeth.Count==0) {
							AddProcedure(ProcCur);
							continue;
						}
						if(Tooth.IsMaxillary(toothChart.SelectedTeeth[0])){
							ProcCur.Surf="U";
						}
						else{
							ProcCur.Surf="L";
						}
						AddQuick(ProcCur);
					}
					else if(tArea==TreatmentArea.Sextant){
						AddProcedure(ProcCur);
					}
					else{//mouth
						AddQuick(ProcCur);
					}
					procCodes.Add(ProcedureCodes.GetProcCode(ProcCur.CodeNum).ProcCode);
				}//n selected teeth
			}//end Part 1 checking for ProcCodes, now will check for AutoCodes
			string toothNum;
			string surf;
			bool isAdditional;
			//long orionProvNum=0;
			for(int i=0;i<autoCodeList.Length;i++){
				for(int n=0;n==0 || n<toothChart.SelectedTeeth.Count;n++) {
					isValid=true;
					if(toothChart.SelectedTeeth.Count!=0)
						toothNum=toothChart.SelectedTeeth[n];
					else
						toothNum="";
					surf=textSurf.Text;
					isAdditional= n!=0;
					ProcCur=new Procedure();//this will be an insert, so no need to set CurOld
					//Clean to db
					surf=Tooth.SurfTidyFromDisplayToDb(surf,toothNum);
					ProcCur.CodeNum=AutoCodeItems.GetCodeNum(autoCodeList[i],toothNum,surf,isAdditional,PatCur.PatNum,PatCur.Age);
					tArea=ProcedureCodes.GetProcCode(ProcCur.CodeNum).TreatArea;
					if((tArea==TreatmentArea.Arch
						|| tArea==TreatmentArea.Mouth
						|| tArea==TreatmentArea.Quad
						|| tArea==TreatmentArea.Sextant
						|| tArea==TreatmentArea.ToothRange)
						&& n>0){//the only two left are tooth and surf
						continue;//only entered if n=0, so they don't get entered more than once.
					}
					else if(tArea==TreatmentArea.Quad){
						switch(quadCount%4){
							case 0: ProcCur.Surf="UR"; break;
							case 1: ProcCur.Surf="UL"; break;
							case 2: ProcCur.Surf="LL"; break;
							case 3: ProcCur.Surf="LR"; break;
						}
						quadCount++;
						AddQuick(ProcCur);
					}
					else if(tArea==TreatmentArea.Surf){
						if(toothChart.SelectedTeeth.Count==0){
							isValid=false;
						}
						else{
							ProcCur.ToothNum=toothChart.SelectedTeeth[n];
						}
						if(textSurf.Text==""){
							isValid=false;
						}
						else{
							ProcCur.Surf=Tooth.SurfTidyFromDisplayToDb(textSurf.Text,ProcCur.ToothNum);//it's ok if toothnum is invalid
						}
						
						if(isValid){
							AddQuick(ProcCur);
						}
						else{
							AddProcedure(ProcCur);
						}
					}
					else if(tArea==TreatmentArea.Tooth){
						if(toothChart.SelectedTeeth.Count==0) {
							AddProcedure(ProcCur);
						}
						else{
							ProcCur.ToothNum=toothChart.SelectedTeeth[n];
							AddQuick(ProcCur);
						}
					}
					else if(tArea==TreatmentArea.ToothRange){
						if(toothChart.SelectedTeeth.Count==0) {
							AddProcedure(ProcCur);
						}
						else{
							ProcCur.ToothRange="";
							for(int b=0;b<toothChart.SelectedTeeth.Count;b++) {
								if(b!=0) ProcCur.ToothRange+=",";
								ProcCur.ToothRange+=toothChart.SelectedTeeth[b];
							}
							AddQuick(ProcCur);
						}
					}
					else if(tArea==TreatmentArea.Arch){
						if(toothChart.SelectedTeeth.Count==0) {
							AddProcedure(ProcCur);
							continue;
						}
						if(Tooth.IsMaxillary(toothChart.SelectedTeeth[0])){
							ProcCur.Surf="U";
						}
						else{
							ProcCur.Surf="L";
						}
						AddQuick(ProcCur);
					}
					else if(tArea==TreatmentArea.Sextant){
						AddProcedure(ProcCur);
					}
					else{//mouth
						AddQuick(ProcCur);
					}
					procCodes.Add(ProcedureCodes.GetProcCode(ProcCur.CodeNum).ProcCode);
				}//n selected teeth
				//orionProvNum=ProcCur.ProvNum;
			}//for i
			//this was requiring too many irrelevant queries and going too slowly   //ModuleSelected(PatCur.PatNum);			
			ToothInitialList=ToothInitials.Refresh(PatCur.PatNum);
			FillToothChart(false);
			ClearButtons();
			FillProgNotes();
			if(newStatus==ProcStat.C){
				AutomationL.Trigger(AutomationTrigger.CompleteProcedure,procCodes,PatCur.PatNum);
			}
		}