예제 #1
0
파일: ChartViews.cs 프로젝트: mnisl/OD
		///<summary></summary>
		public static void Update(ChartView chartView) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),chartView);
				return;
			}
			Crud.ChartViewCrud.Update(chartView);
		}
예제 #2
0
파일: ChartViews.cs 프로젝트: mnisl/OD
		///<summary></summary>
		public static long Insert(ChartView chartView) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				chartView.ChartViewNum=Meth.GetLong(MethodBase.GetCurrentMethod(),chartView);
				return chartView.ChartViewNum;
			}
			return Crud.ChartViewCrud.Insert(chartView);
		}
예제 #3
0
		private void SetChartView(ChartView chartView) {
			ChartViewCurDisplay=chartView;
			labelCustView.Visible=false;
			chartCustViewChanged=false;
			FillProgNotes();
		}
예제 #4
0
		private void FillProgNotes(bool retainSelection){
			Plugins.HookAddCode(this,"ContrChart.FillProgNotes_begin");
			//ArrayList selectedTeeth=new ArrayList();//integers 1-32
			//for(int i=0;i<toothChart.SelectedTeeth.Count;i++) {
			//	selectedTeeth.Add(Tooth.ToInt(toothChart.SelectedTeeth[i]));
			//}
			//List<string> selectedTeeth=new List<string>(toothChart.SelectedTeeth);
			if(Programs.UsingOrion){
				listProcStatusCodes.Visible=true;
				if(listProcStatusCodes.Items.Count==0) {
					string[] statusNames=Enum.GetNames(typeof(OrionStatus));
					for(int i=1;i<statusNames.Length;i++) {
						listProcStatusCodes.Items.Add(statusNames[i]);
					}
				}
			}
			gridProg.BeginUpdate();
			gridProg.Columns.Clear();
			ODGridColumn col;
			List<DisplayField> fields;
			//DisplayFields.RefreshCache();
			if(gridChartViews.Rows.Count==0) {//No chart views, Use default values.
				fields=DisplayFields.GetDefaultList(DisplayFieldCategory.None);
				gridProg.Title="Progress Notes";
				if(!chartCustViewChanged) {
					checkSheets.Checked=true;
					checkTasks.Checked=true;
					checkEmail.Checked=true;
					checkCommFamily.Checked=true;
					checkAppt.Checked=true;
					checkLabCase.Checked=true;
					checkRx.Checked=true;
					checkComm.Checked=true;
					checkShowTP.Checked=true;
					checkShowC.Checked=true;
					checkShowE.Checked=true;
					checkShowR.Checked=true;
					checkShowCn.Checked=true;
					checkNotes.Checked=true;
					checkNotes.Checked=true;
					checkShowTeeth.Checked=false;
					checkAudit.Checked=false;
					textShowDateRange.Text="All Dates";
				}
			}
			else {
				if(ChartViewCurDisplay==null) {
					ChartViewCurDisplay=ChartViews.Listt[0];
				}
				fields=DisplayFields.GetForChartView(ChartViewCurDisplay.ChartViewNum);
				gridProg.Title=ChartViewCurDisplay.Description;
				if(!chartCustViewChanged) {
					checkSheets.Checked=(ChartViewCurDisplay.ObjectTypes & ChartViewObjs.Sheets)==ChartViewObjs.Sheets;
					checkTasks.Checked=(ChartViewCurDisplay.ObjectTypes & ChartViewObjs.Tasks)==ChartViewObjs.Tasks;
					checkEmail.Checked=(ChartViewCurDisplay.ObjectTypes & ChartViewObjs.Email)==ChartViewObjs.Email;
					checkCommFamily.Checked=(ChartViewCurDisplay.ObjectTypes & ChartViewObjs.CommLogFamily)==ChartViewObjs.CommLogFamily;
					checkAppt.Checked=(ChartViewCurDisplay.ObjectTypes & ChartViewObjs.Appointments)==ChartViewObjs.Appointments;
					checkLabCase.Checked=(ChartViewCurDisplay.ObjectTypes & ChartViewObjs.LabCases)==ChartViewObjs.LabCases;
					checkRx.Checked=(ChartViewCurDisplay.ObjectTypes & ChartViewObjs.Rx)==ChartViewObjs.Rx;
					checkComm.Checked=(ChartViewCurDisplay.ObjectTypes & ChartViewObjs.CommLog)==ChartViewObjs.CommLog;
					checkShowTP.Checked=(ChartViewCurDisplay.ProcStatuses & ChartViewProcStat.TP)==ChartViewProcStat.TP;
					checkShowC.Checked=(ChartViewCurDisplay.ProcStatuses & ChartViewProcStat.C)==ChartViewProcStat.C;
					checkShowE.Checked=(ChartViewCurDisplay.ProcStatuses & ChartViewProcStat.EC)==ChartViewProcStat.EC;
					checkShowR.Checked=(ChartViewCurDisplay.ProcStatuses & ChartViewProcStat.R)==ChartViewProcStat.R;
					checkShowCn.Checked=(ChartViewCurDisplay.ProcStatuses & ChartViewProcStat.Cn)==ChartViewProcStat.Cn;
					checkShowTeeth.Checked=ChartViewCurDisplay.SelectedTeethOnly;
					checkNotes.Checked=ChartViewCurDisplay.ShowProcNotes;
					checkAudit.Checked=ChartViewCurDisplay.IsAudit;
					SetDateRange();
					FillDateRange();
					gridChartViews.SetSelected(ChartViewCurDisplay.ItemOrder,true);
					if(IsDistributorKey) {
						gridCustomerViews.SetSelected(ChartViewCurDisplay.ItemOrder,true);
					}
					if(Programs.UsingOrion) {
						listProcStatusCodes.ClearSelected();
						if((ChartViewCurDisplay.OrionStatusFlags & OrionStatus.TP)==OrionStatus.TP) {
							listProcStatusCodes.SetSelected(0,true);
						}
						if((ChartViewCurDisplay.OrionStatusFlags & OrionStatus.C)==OrionStatus.C) {
							listProcStatusCodes.SetSelected(1,true);
						}
						if((ChartViewCurDisplay.OrionStatusFlags & OrionStatus.E)==OrionStatus.E) {
							listProcStatusCodes.SetSelected(2,true);
						}
						if((ChartViewCurDisplay.OrionStatusFlags & OrionStatus.R)==OrionStatus.R) {
							listProcStatusCodes.SetSelected(3,true);
						}
						if((ChartViewCurDisplay.OrionStatusFlags & OrionStatus.RO)==OrionStatus.RO) {
							listProcStatusCodes.SetSelected(4,true);
						}
						if((ChartViewCurDisplay.OrionStatusFlags & OrionStatus.CS)==OrionStatus.CS) {
							listProcStatusCodes.SetSelected(5,true);
						}
						if((ChartViewCurDisplay.OrionStatusFlags & OrionStatus.CR)==OrionStatus.CR) {
							listProcStatusCodes.SetSelected(6,true);
						}
						if((ChartViewCurDisplay.OrionStatusFlags & OrionStatus.CA_Tx)==OrionStatus.CA_Tx) {
							listProcStatusCodes.SetSelected(7,true);
						}
						if((ChartViewCurDisplay.OrionStatusFlags & OrionStatus.CA_EPRD)==OrionStatus.CA_EPRD) {
							listProcStatusCodes.SetSelected(8,true);
						}
						if((ChartViewCurDisplay.OrionStatusFlags & OrionStatus.CA_PD)==OrionStatus.CA_PD) {
							listProcStatusCodes.SetSelected(9,true);
						}
						if((ChartViewCurDisplay.OrionStatusFlags & OrionStatus.S)==OrionStatus.S) {
							listProcStatusCodes.SetSelected(10,true);
						}
						if((ChartViewCurDisplay.OrionStatusFlags & OrionStatus.ST)==OrionStatus.ST) {
							listProcStatusCodes.SetSelected(11,true);
						}
						if((ChartViewCurDisplay.OrionStatusFlags & OrionStatus.W)==OrionStatus.W) {
							listProcStatusCodes.SetSelected(12,true);
						}
						if((ChartViewCurDisplay.OrionStatusFlags & OrionStatus.A)==OrionStatus.A) {
							listProcStatusCodes.SetSelected(13,true);
						}
					}
				}
				else {
					gridChartViews.SetSelected(false);
					if(IsDistributorKey) {
						gridCustomerViews.SetSelected(false);
					}
				}
			}
			DataSetMain=null;
			if(PatCur!=null){
				if(UsingEcwTight()) {//ecw customers
					ChartModuleComponentsToLoad componentsToLoad = new ChartModuleComponentsToLoad(
					checkAppt.Checked,				        //showAppointments
					checkComm.Checked,								//showCommLog.  The button is in a different toolbar.
					checkShowC.Checked,               //showCompleted
					checkShowCn.Checked,              //showConditions
					false, //checkEmail.Checked,      //showEmail
					checkShowE.Checked,               //showExisting
					false, //checkCommFamily.Checked,	//showFamilyCommLog
					false,														//showFormPat
					checkLabCase.Checked,			        //showLabCases
					checkNotes.Checked,				        //showProcNotes
					checkShowR.Checked,				        //showReferred
					checkRx.Checked,					        //showRX
					checkSheets.Checked,			        //showSheets, consent
					false, //checkTasks.Checked,			//showTasks (for now)
					checkShowTP.Checked);			        //showTreatPlan
					DataSetMain=ChartModules.GetAll(PatCur.PatNum,checkAudit.Checked,componentsToLoad);//showConditions
				}
				else {//all other customers and ecw full users
					//DataSetMain=ChartModules.GetAll(PatCur.PatNum,checkAudit.Checked);
					DataSetMain=ChartModules.GetAll(PatCur.PatNum,checkAudit.Checked,new ChartModuleComponentsToLoad(
						checkAppt.Checked,				//showAppointments
						checkComm.Checked,				//showCommLog
						checkShowC.Checked,				//showCompleted
						checkShowCn.Checked,			//showConditions
						checkEmail.Checked,				//showEmail
						checkShowE.Checked,				//showExisting
						checkCommFamily.Checked,	//showFamilyCommLog
						true,											//showFormPat
						checkLabCase.Checked,			//showLabCases
						checkNotes.Checked,				//showProcNotes
						checkShowR.Checked,				//showReferred
						checkRx.Checked,					//showRX
						checkSheets.Checked,			//showSheets, consent
						checkTasks.Checked,				//showTasks
						checkShowTP.Checked)			//showTreatPlan
					);
				}
			}
			for(int i=0;i<fields.Count;i++){
				if(fields[i].Description==""){
					col=new ODGridColumn(fields[i].InternalName,fields[i].ColumnWidth);
				}
				else{
					col=new ODGridColumn(fields[i].Description,fields[i].ColumnWidth);
				}
				if(fields[i].InternalName=="Th"){
					col.SortingStrategy=GridSortingStrategy.ToothNumberParse;
				}
				if(fields[i].InternalName=="Date"){
					col.SortingStrategy=GridSortingStrategy.DateParse;
				}
				if(fields[i].InternalName=="Amount"){
					col.SortingStrategy=GridSortingStrategy.AmountParse;
					col.TextAlign=HorizontalAlignment.Right;
				}
				if(fields[i].InternalName=="ADA Code"
					|| fields[i].InternalName=="User"
					|| fields[i].InternalName=="Signed"
					|| fields[i].InternalName=="Locked")
				{
					col.TextAlign=HorizontalAlignment.Center;
				}
				gridProg.Columns.Add(col);
			}
			if(gridProg.Columns.Count<3){//0 wouldn't be possible.
				gridProg.NoteSpanStart=0;
				gridProg.NoteSpanStop=gridProg.Columns.Count-1;
			}
			else{
				gridProg.NoteSpanStart=2;
				if(gridProg.Columns.Count>7) {
					gridProg.NoteSpanStop=7;
				}
				else{
					gridProg.NoteSpanStop=gridProg.Columns.Count-1;
				}
			}
			gridProg.Rows.Clear();
			ODGridRow row;
			//Type type;
			if(DataSetMain==null) {
				gridProg.EndUpdate();
				FillToothChart(false);//?
				return;
			}
			DataTable table=DataSetMain.Tables["ProgNotes"];
			List<ProcGroupItem> procGroupItems=ProcGroupItems.Refresh(PatCur.PatNum);
			ProcList=new List<DataRow>();
			List<long> procNumList=new List<long>();//a list of all procNums of procs that will be visible
			bool showGroupNote;
			if(checkShowTeeth.Checked) {
				//we will want to see groupnotes that are attached to any procs that should be visible.
				for(int i=0;i<table.Rows.Count;i++){//loop through all rows in table.
					if(table.Rows[i]["ProcNum"].ToString()=="0") {//if this is not a procedure
						continue;
					}
					if(table.Rows[i]["ProcCode"].ToString()==ProcedureCodes.GroupProcCode) {
						continue;//skip procgroups
					}
					if(ShouldDisplayProc(table.Rows[i])){
						procNumList.Add(PIn.Long(table.Rows[i]["ProcNum"].ToString()));//remember that procnum
					}
				}
			}
			for(int i=0;i<table.Rows.Count;i++){
				if(table.Rows[i]["ProcNum"].ToString()!="0"){//if this is a procedure 
					//if it's a group note and we are viewing by tooth number
					if(table.Rows[i]["ProcCode"].ToString()==ProcedureCodes.GroupProcCode && checkShowTeeth.Checked) {
						//consult the list of previously obtained procedures and ProcGroupItems to see if this procgroup should be visible.
						showGroupNote=false;
						for(int j=0;j<procGroupItems.Count;j++) {//loop through all procGroupItems for the patient. 
							if(procGroupItems[j].GroupNum==PIn.Long(table.Rows[i]["ProcNum"].ToString())) {//if this item is associated with this group note
								for(int k=0;k<procNumList.Count;k++) {//check all of the visible procs
									if(procNumList[k]==procGroupItems[j].ProcNum) {//if this group note is associated with a visible proc
										showGroupNote=true;
									}
								}
							}
						}
						if(!showGroupNote) {
							continue;//don't show it in the grid
						}
					}
					else {//procedure or group note, not viewing by tooth number
						if(ShouldDisplayProc(table.Rows[i])) {
							ProcList.Add(table.Rows[i]);//show it in the graphical tooth chart
							//show it in the grid below
						}
						else {
							continue;//don't show it in the grid
						}
					}
				}
				else if(table.Rows[i]["CommlogNum"].ToString()!="0"){//if this is a commlog
					if(!checkComm.Checked) {
						continue;
					}
					if(table.Rows[i]["PatNum"].ToString()!=PatCur.PatNum.ToString()){//if this is a different family member
						if(!checkCommFamily.Checked) {
							continue;
						}
					}
				}
				else if(table.Rows[i]["RxNum"].ToString()!="0") {//if this is an Rx
					if(!checkRx.Checked){
						continue;
					}
				}
				else if(table.Rows[i]["LabCaseNum"].ToString()!="0") {//if this is a LabCase
					if(!checkLabCase.Checked) {
						continue;
					}
				}
				else if(table.Rows[i]["TaskNum"].ToString()!="0") {//if this is a TaskItem
					if(!checkTasks.Checked) {
						continue;
					}
					if(table.Rows[i]["PatNum"].ToString()!=PatCur.PatNum.ToString()){//if this is a different family member
						if(!checkCommFamily.Checked) { //uses same check box as commlog
							continue;
						}
					}
				}
				else if(table.Rows[i]["EmailMessageNum"].ToString()!="0") {//if this is an Email
					if(!checkEmail.Checked) {
						continue;
					}
				}
				else if(table.Rows[i]["AptNum"].ToString()!="0") {//if this is an Appointment
					if(!checkAppt.Checked) {
						continue;
					}
				}
				else if(table.Rows[i]["SheetNum"].ToString()!="0") {//if this is a sheet
					if(!checkSheets.Checked) {
						continue;
					}
				}
				if(ShowDateStart.Year>1880 && ((DateTime)(table.Rows[i]["ProcDate"])).Date < ShowDateStart.Date) {
					continue;
				}
				if(ShowDateEnd.Year>1880 && ((DateTime)(table.Rows[i]["ProcDate"])).Date > ShowDateEnd.Date) {
					continue;
				}
				row=new ODGridRow();
				row.ColorLborder=Color.Black;
				//remember that columns that start with lowercase are already altered for display rather than being raw data.
				for(int f=0;f<fields.Count;f++) {
					switch(fields[f].InternalName){
						case "Date":
							row.Cells.Add(table.Rows[i]["procDate"].ToString());
							break;
						case "Time":
							row.Cells.Add(table.Rows[i]["procTime"].ToString());
							break;
						case "Th":
							row.Cells.Add(table.Rows[i]["toothNum"].ToString());
							break;
						case "Surf":
							row.Cells.Add(table.Rows[i]["surf"].ToString());
							break;
						case "Dx":
							row.Cells.Add(table.Rows[i]["dx"].ToString());
							break;
						case "Description":
							row.Cells.Add(table.Rows[i]["description"].ToString());
							break;
						case "Stat":
							row.Cells.Add(table.Rows[i]["procStatus"].ToString());
							break;
						case "Prov":
							row.Cells.Add(table.Rows[i]["prov"].ToString());
							break;
						case "Amount":
							row.Cells.Add(table.Rows[i]["procFee"].ToString());
							break;
						case "ADA Code":
							row.Cells.Add(table.Rows[i]["ProcCode"].ToString());
							break;
						case "User":
							row.Cells.Add(table.Rows[i]["user"].ToString());
							break;
						case "Signed":
							row.Cells.Add(table.Rows[i]["signature"].ToString());
							break;
						case "Priority":
							row.Cells.Add(table.Rows[i]["priority"].ToString());
							break;
						case "Date Entry":
							row.Cells.Add(table.Rows[i]["dateEntryC"].ToString());
							break;
						case "Prognosis":
							row.Cells.Add(table.Rows[i]["prognosis"].ToString());
							break;
						case "Date TP":
							row.Cells.Add(table.Rows[i]["dateTP"].ToString());
							break;
						case "End Time":
							row.Cells.Add(table.Rows[i]["procTimeEnd"].ToString());
							break;
						case "Quadrant":
							row.Cells.Add(table.Rows[i]["quadrant"].ToString());
							break;
						case "Schedule By":
							row.Cells.Add(table.Rows[i]["orionDateScheduleBy"].ToString());
							break;
						case "Stop Clock":
							row.Cells.Add(table.Rows[i]["orionDateStopClock"].ToString());
							break;
						case "DPC":
							row.Cells.Add(table.Rows[i]["orionDPC"].ToString());
							break;
						case "Effective Comm":
							row.Cells.Add(table.Rows[i]["orionIsEffectiveComm"].ToString());
							break;
						case "On Call":
							row.Cells.Add(table.Rows[i]["orionIsOnCall"].ToString());
							break;
						case "Stat 2":
							row.Cells.Add(table.Rows[i]["orionStatus2"].ToString());
							break;
						case "DPCpost":
							row.Cells.Add(table.Rows[i]["orionDPCpost"].ToString());
							break;
						case "Length":
							row.Cells.Add(table.Rows[i]["length"].ToString());
							break;
						case "Abbr":
							row.Cells.Add(table.Rows[i]["AbbrDesc"].ToString());
							break;
						case "Locked":
							row.Cells.Add(table.Rows[i]["isLocked"].ToString());
							break;
						default:
							row.Cells.Add("");
							break;
					}
				}				
				if(checkNotes.Checked){
					row.Note=table.Rows[i]["note"].ToString();
				}
				row.ColorText=Color.FromArgb(PIn.Int(table.Rows[i]["colorText"].ToString()));
				row.ColorBackG=Color.FromArgb(PIn.Int(table.Rows[i]["colorBackG"].ToString()));
				row.Tag=table.Rows[i];
				gridProg.Rows.Add(row);
			}
			ChartLayoutHelper.SetGridProgWidth(gridProg,ClientSize,panelEcw,textTreatmentNotes,toothChart);
			gridProg.EndUpdate();
			if(Chartscrollval==0) {
				gridProg.ScrollToEnd();
			}
			else {
				gridProg.ScrollValue=Chartscrollval;
				Chartscrollval=0;
			}
			FillToothChart(retainSelection);
		}