コード例 #1
0
ファイル: FormEhrCarePlans.cs プロジェクト: mnisl/OD
		private void FillCarePlans() {
			gridCarePlans.BeginUpdate();
			gridCarePlans.Columns.Clear();
			int colDatePixCount=66;
			int variablePixCount=gridCarePlans.Width-10-colDatePixCount;
			int colGoalPixCount=variablePixCount/2;
			int colInstructionsPixCount=variablePixCount-colGoalPixCount;
			gridCarePlans.Columns.Add(new UI.ODGridColumn("Date",colDatePixCount));
			gridCarePlans.Columns.Add(new UI.ODGridColumn("Goal",colGoalPixCount));
			gridCarePlans.Columns.Add(new UI.ODGridColumn("Instructions",colInstructionsPixCount));
			gridCarePlans.EndUpdate();
			gridCarePlans.BeginUpdate();
			gridCarePlans.Rows.Clear();
			_listCarePlans=EhrCarePlans.Refresh(_patCur.PatNum);
			for(int i=0;i<_listCarePlans.Count;i++) {
				UI.ODGridRow row=new UI.ODGridRow();
				row.Cells.Add(_listCarePlans[i].DatePlanned.ToShortDateString());//Date
				Snomed snomedEducation=Snomeds.GetByCode(_listCarePlans[i].SnomedEducation);
				if(snomedEducation==null) {
					row.Cells.Add("");//We allow blank or "NullFlavor" SNOMEDCT codes when exporting CCDAs, so we allow them to be blank when displaying here as well.
				}
				else {
					row.Cells.Add(snomedEducation.Description);//GoalDescript
				}
				row.Cells.Add(_listCarePlans[i].Instructions);//Instructions
				gridCarePlans.Rows.Add(row);
			}
			gridCarePlans.EndUpdate();
		}
コード例 #2
0
		private void FillGridObservations() {
			gridObservations.BeginUpdate();
			gridObservations.Columns.Clear();
			gridObservations.Columns.Add(new UI.ODGridColumn("Observation",200));//0
			gridObservations.Columns.Add(new UI.ODGridColumn("Value Type",200));//1
			gridObservations.Columns.Add(new UI.ODGridColumn("Value",0));//2
			gridObservations.Rows.Clear();
			List<EhrAptObs> listEhrAptObses=EhrAptObses.Refresh(_appt.AptNum);
			for(int i=0;i<listEhrAptObses.Count;i++) {
				EhrAptObs obs=listEhrAptObses[i];
				UI.ODGridRow row=new UI.ODGridRow();
				row.Tag=obs;
				row.Cells.Add(obs.IdentifyingCode.ToString());//0 Observation
				if(obs.ValType==EhrAptObsType.Coded) {
					row.Cells.Add(obs.ValType.ToString()+" - "+obs.ValCodeSystem);//1 Value Type
					if(obs.ValCodeSystem=="LOINC") {
						Loinc loincValue=Loincs.GetByCode(obs.ValReported);
						row.Cells.Add(loincValue.NameShort);//2 Value
					}
					else if(obs.ValCodeSystem=="SNOMEDCT") {
						Snomed snomedValue=Snomeds.GetByCode(obs.ValReported);
						row.Cells.Add(snomedValue.Description);//2 Value
					}
					else if(obs.ValCodeSystem=="ICD9") {
						ICD9 icd9Value=ICD9s.GetByCode(obs.ValReported);
						row.Cells.Add(icd9Value.Description);//2 Value
					}
					else if(obs.ValCodeSystem=="ICD10") {
						Icd10 icd10Value=Icd10s.GetByCode(obs.ValReported);
						row.Cells.Add(icd10Value.Description);//2 Value
					}
				}
				else if(obs.ValType==EhrAptObsType.Address) {
					string sendingFacilityAddress1=PrefC.GetString(PrefName.PracticeAddress);
					string sendingFacilityAddress2=PrefC.GetString(PrefName.PracticeAddress2);
					string sendingFacilityCity=PrefC.GetString(PrefName.PracticeCity);
					string sendingFacilityState=PrefC.GetString(PrefName.PracticeST);
					string sendingFacilityZip=PrefC.GetString(PrefName.PracticeZip);
					if(!PrefC.GetBool(PrefName.EasyNoClinics) && _appt.ClinicNum!=0) {//Using clinics and a clinic is assigned.
						Clinic clinic=Clinics.GetClinic(_appt.ClinicNum);
						sendingFacilityAddress1=clinic.Address;
						sendingFacilityAddress2=clinic.Address2;
						sendingFacilityCity=clinic.City;
						sendingFacilityState=clinic.State;
						sendingFacilityZip=clinic.Zip;
					}
					row.Cells.Add(obs.ValType.ToString());//1 Value Type
					row.Cells.Add(sendingFacilityAddress1+" "+sendingFacilityAddress2+" "+sendingFacilityCity+" "+sendingFacilityState+" "+sendingFacilityZip);//2 Value
				}
				else {
					row.Cells.Add(obs.ValType.ToString());//1 Value Type
					row.Cells.Add(obs.ValReported);//2 Value
				}
				gridObservations.Rows.Add(row);
			}
			gridObservations.EndUpdate();
		}
コード例 #3
0
ファイル: FormEtrans835PickEob.cs プロジェクト: mnisl/OD
		private void FillGridEobs() {
			gridEobs.BeginUpdate();
			gridEobs.Columns.Clear();
			gridEobs.Columns.Add(new UI.ODGridColumn("",0));
			gridEobs.Rows.Clear();
			for(int i=0;i<_listEobTranIds.Count;i++) {
				UI.ODGridRow row=new UI.ODGridRow();
				row.Cells.Add(_listEobTranIds[i]);
				gridEobs.Rows.Add(row);
			}
			gridEobs.EndUpdate();
		}
コード例 #4
0
ファイル: FormEtrans835Print.cs プロジェクト: mnisl/OD
		private void FillGridMain() {
			gridMain.BeginUpdate();
			gridMain.Columns.Clear();
			ResizeGridMain();
			gridMain.Rows.Clear();
			for(int i=0;i<_x835.ListClaimsPaid.Count;i++) {
				Hx835_Claim claimPaid=_x835.ListClaimsPaid[i];
				UI.ODGridRow rowClaim=new UI.ODGridRow();
				//If there is no procedure detail, then the user will need to enter by total, because they will not know the procedure amounts paid.
				if(claimPaid.ListProcs.Count==0) {
					rowClaim.Cells.Add(new UI.ODGridCell("Total"));//EnterBy
				}
				//If there is procedure detail, and there are also claim level adjustments, then the user will need to enter the procedure amounts by procedure and the claim adjustment by total.
				else if(claimPaid.ClaimAdjustmentTotal!=0) {
					rowClaim.Cells.Add(new UI.ODGridCell("Proc &\r\nTotal"));//EnterBy
				}
				//If there is procedure detail, and there are no claim level adjustments, the user will need to enter the payments by procedure only.
				else {
					rowClaim.Cells.Add(new UI.ODGridCell("Proc"));//EnterBy
				}
				string strClaim="Patient: "+claimPaid.PatientName;
				if(claimPaid.SubscriberName!=claimPaid.PatientName) {
					strClaim+="\r\nSubscriber: "+claimPaid.SubscriberName;
				}
				if(claimPaid.ClaimTrackingNumber!="") {
					strClaim+="\r\nClaim Identifier: "+claimPaid.ClaimTrackingNumber;
				}
				if(claimPaid.PayerControlNumber!="") {
					strClaim+="\r\nPayer Control Number: "+claimPaid.PayerControlNumber;
				}
				if(claimPaid.ListProcs.Count>0 && claimPaid.ClaimAdjustmentTotal!=0) {
					//If there is no procedure detail, then the user will need to enter the claim payment by total.  In this case, the user only cares about the InsPaid for the entire claim.  Showing the adjustments would cause user confusion.
					//If there is procedure detail, then we need to show the claim adjustment total, because the user will need to enter this amount by total in addition to any procedure amounts entered.
					strClaim+="\r\nClaim Adjustments: "+claimPaid.ClaimAdjustmentTotal.ToString("f2");
				}
				rowClaim.Cells.Add(new UI.ODGridCell(strClaim));//Claim
				string strDateClaim=claimPaid.DateServiceStart.ToShortDateString();
				if(claimPaid.DateServiceEnd.Year>1880) {
					strDateClaim+=" to \r\n"+claimPaid.DateServiceEnd.ToShortDateString();
				}
				rowClaim.Cells.Add(new UI.ODGridCell(strDateClaim));//Date
				rowClaim.Cells.Add(new UI.ODGridCell(""));//Code
				rowClaim.Cells.Add(new UI.ODGridCell(""));//CodeBilled
				rowClaim.Cells.Add(new UI.ODGridCell(claimPaid.ClaimFee.ToString("f2")));//Billed
				rowClaim.Cells.Add(new UI.ODGridCell(claimPaid.PatientPortion.ToString("f2")));//Deduct
				rowClaim.Cells.Add(new UI.ODGridCell(""));//Allowed
				rowClaim.Cells.Add(new UI.ODGridCell(claimPaid.InsPaid.ToString("f2")));//InsPay
				rowClaim.Cells.Add(new UI.ODGridCell(""));//Writeoff
				gridMain.Rows.Add(rowClaim);
				for(int j=0;j<claimPaid.ListProcs.Count;j++) {
					Hx835_Proc proc=claimPaid.ListProcs[j];
					UI.ODGridRow rowProc=new UI.ODGridRow();
					rowProc.Cells.Add(new UI.ODGridCell(""));//EnterBy
					rowProc.Cells.Add(new UI.ODGridCell(""));//Claim
					string strDateProc=proc.DateServiceStart.ToShortDateString();
					if(proc.DateServiceEnd.Year>1880) {
						strDateProc+=" to \r\n"+proc.DateServiceEnd.ToShortDateString();
					}
					rowProc.Cells.Add(new UI.ODGridCell(strDateProc));//Date
					rowProc.Cells.Add(new UI.ODGridCell(proc.ProcCodeAdjudicated));//Code
					rowProc.Cells.Add(new UI.ODGridCell(proc.ProcCodeBilled));//CodeBilled
					rowProc.Cells.Add(new UI.ODGridCell(proc.ProcFee.ToString("f2")));//Billed
					rowProc.Cells.Add(new UI.ODGridCell(proc.PatientPortion.ToString("f2")));//Deduct
					rowProc.Cells.Add(new UI.ODGridCell(proc.AllowedAmt.ToString("f2")));//Allowed
					rowProc.Cells.Add(new UI.ODGridCell(proc.InsPaid.ToString("f2")));//InsPay
					rowProc.Cells.Add(new UI.ODGridCell(proc.Writeoff.ToString("f2")));//Writeoff
					gridMain.Rows.Add(rowProc);
				}
			}
			gridMain.EndUpdate();
		}
コード例 #5
0
ファイル: FormEhrVaccinePatEdit.cs プロジェクト: mnisl/OD
		private void FillObservations() {
			gridObservations.BeginUpdate();
			gridObservations.Columns.Clear();
			gridObservations.Columns.Add(new UI.ODGridColumn("Question",150));
			gridObservations.Columns.Add(new UI.ODGridColumn("Value",0));
			gridObservations.EndUpdate();
			gridObservations.BeginUpdate();
			gridObservations.Rows.Clear();
			for(int i=0;i<_listVaccineObservations.Count;i++) {
				VaccineObs vaccineObs=_listVaccineObservations[i];
				UI.ODGridRow row=new UI.ODGridRow();
				row.Tag=vaccineObs;
				row.Cells.Add(new UI.ODGridCell(vaccineObs.IdentifyingCode.ToString()));
				row.Cells.Add(new UI.ODGridCell(vaccineObs.ValReported));
				gridObservations.Rows.Add(row);
			}
			if(_listVaccineObservationGroups==null) {
				_listVaccineObservationGroups=new List<VaccineObs>();
				for(int i=0;i<_listVaccineObservations.Count;i++) {
					VaccineObs vaccineObs=_listVaccineObservations[i];
					if(vaccineObs.VaccineObsNumGroup==0 || vaccineObs.VaccineObsNumGroup==vaccineObs.VaccineObsNum) {
						_listVaccineObservationGroups.Add(vaccineObs);
					}
					else {
						for(int j=0;j<_listVaccineObservations.Count;j++) {
							if(j!=i && _listVaccineObservations[j].VaccineObsNum==_listVaccineObservations[i].VaccineObsNumGroup) {
								_listVaccineObservationGroups.Add(_listVaccineObservations[j]);
								break;
							}
						}
					}
				}
			}
			gridObservations.EndUpdate();
		}
コード例 #6
0
ファイル: FormEmailInbox.cs プロジェクト: mnisl/OD
		///<summary>Gets new emails and also shows older emails from the database.</summary>
		private void FillGridEmailMessages() {
			//Remember current email selections.
			List<long> listEmailMessageNumsSelected=new List<long>();
			for(int i=0;i<gridEmailMessages.SelectedIndices.Length;i++) {
				EmailMessage emailMessage=(EmailMessage)gridEmailMessages.Rows[gridEmailMessages.SelectedIndices[i]].Tag;
				listEmailMessageNumsSelected.Add(emailMessage.EmailMessageNum);
			}
			//Refresh the list and grid from the database.
			ListEmailMessages=EmailMessages.GetInboxForAddress(AddressInbox.EmailUsername,Security.CurUser.ProvNum);
			gridEmailMessages.BeginUpdate();
			gridEmailMessages.Rows.Clear();
			gridEmailMessages.Columns.Clear();
			int colReceivedDatePixCount=140;
			int colMessageTypePixCount=120;
			int colFromPixCount=200;
			int colSigPixCount=24;
			int colPatientPixCount=140;
			int variableWidth=gridEmailMessages.Width-10-colFromPixCount-colReceivedDatePixCount-colMessageTypePixCount-colSigPixCount-colPatientPixCount;
			gridEmailMessages.Columns.Add(new UI.ODGridColumn(Lan.g(this,"From"),colFromPixCount,HorizontalAlignment.Left));//0
			gridEmailMessages.Columns[gridEmailMessages.Columns.Count-1].SortingStrategy=UI.GridSortingStrategy.StringCompare;
			gridEmailMessages.Columns.Add(new UI.ODGridColumn(Lan.g(this,"Subject"),variableWidth,HorizontalAlignment.Left));//1
			gridEmailMessages.Columns[gridEmailMessages.Columns.Count-1].SortingStrategy=UI.GridSortingStrategy.StringCompare;
			gridEmailMessages.Columns.Add(new UI.ODGridColumn(Lan.g(this,"Date Received"),colReceivedDatePixCount,HorizontalAlignment.Center));//2
			gridEmailMessages.Columns[gridEmailMessages.Columns.Count-1].SortingStrategy=UI.GridSortingStrategy.DateParse;
			gridEmailMessages.Columns.Add(new UI.ODGridColumn(Lan.g(this,"MessageType"),colMessageTypePixCount,HorizontalAlignment.Center));//3
			gridEmailMessages.Columns[gridEmailMessages.Columns.Count-1].SortingStrategy=UI.GridSortingStrategy.StringCompare;
			gridEmailMessages.Columns.Add(new UI.ODGridColumn(Lan.g(this,"Sig"),colSigPixCount,HorizontalAlignment.Center));//4
			gridEmailMessages.Columns[gridEmailMessages.Columns.Count-1].SortingStrategy=UI.GridSortingStrategy.StringCompare;
			gridEmailMessages.Columns.Add(new UI.ODGridColumn(Lan.g(this,"Patient"),colPatientPixCount,HorizontalAlignment.Left));//5
			gridEmailMessages.Columns[gridEmailMessages.Columns.Count-1].SortingStrategy=UI.GridSortingStrategy.StringCompare;			
			for(int i=0;i<ListEmailMessages.Count;i++) {
				EmailMessage emailMessage=ListEmailMessages[i];
				UI.ODGridRow row=new UI.ODGridRow();
				row.Tag=emailMessage;//Used to locate the correct email message if the user decides to sort the grid.
				if(emailMessage.SentOrReceived==EmailSentOrReceived.Received || emailMessage.SentOrReceived==EmailSentOrReceived.WebMailReceived
					|| emailMessage.SentOrReceived==EmailSentOrReceived.ReceivedEncrypted || emailMessage.SentOrReceived==EmailSentOrReceived.ReceivedDirect) {
					row.Bold=true;//unread
				}
				row.Cells.Add(new UI.ODGridCell(emailMessage.FromAddress));//0 From
				row.Cells.Add(new UI.ODGridCell(emailMessage.Subject));//1 Subject
				row.Cells.Add(new UI.ODGridCell(emailMessage.MsgDateTime.ToString()));//2 ReceivedDate
				row.Cells.Add(new UI.ODGridCell(EmailMessages.GetEmailSentOrReceivedDescript(emailMessage.SentOrReceived)));//3 MessageType
				string sigTrust="";//Blank for no signature, N for untrusted signature, Y for trusted signature.
				for(int j=0;j<emailMessage.Attachments.Count;j++) {
					if(emailMessage.Attachments[j].DisplayedFileName.ToLower()!="smime.p7s") {
						continue;//Not a digital signature.
					}
					sigTrust="N";
					//A more accurate way to test for trust would be to read the subject name from the certificate, then check the trust for the subject name instead of the from address.
					//We use the more accurate way inside FormEmailDigitalSignature.  However, we cannot use the accurate way inside the inbox because it would cause the inbox to load very slowly.
					if(EmailMessages.IsAddressTrusted(emailMessage.FromAddress)) {
						sigTrust="Y";
					}
					break;
				}
				row.Cells.Add(new UI.ODGridCell(sigTrust));//4 Sig
				long patNumRegardingPatient=emailMessage.PatNum;
				//Webmail messages should list the patient as the PatNumSubj, which means "the patient whom this message is regarding".
				if(emailMessage.SentOrReceived==EmailSentOrReceived.WebMailReceived || emailMessage.SentOrReceived==EmailSentOrReceived.WebMailRecdRead) {
					patNumRegardingPatient=emailMessage.PatNumSubj;
				}
				if(patNumRegardingPatient==0) {
					row.Cells.Add(new UI.ODGridCell(""));//5 Patient
				}
				else {
					Patient pat=Patients.GetPat(patNumRegardingPatient);
					row.Cells.Add(new UI.ODGridCell(pat.GetNameLF()));//5 Patient
				}
				gridEmailMessages.Rows.Add(row);
			}
			gridEmailMessages.EndUpdate();
			//Selection must occur after EndUpdate().
			for(int i=0;i<gridEmailMessages.Rows.Count;i++) {
				EmailMessage emailMessage=(EmailMessage)gridEmailMessages.Rows[i].Tag;
				if(listEmailMessageNumsSelected.Contains(emailMessage.EmailMessageNum)) {
					gridEmailMessages.SetSelected(i,true);
				}
			}
		}
コード例 #7
0
ファイル: EmailPreviewControl.cs プロジェクト: mnisl/OD
		public void FillAttachments() {
			_listEmailAttachDisplayed=new List<EmailAttach>();
			if(!_isComposing) {
				SetSig(null);
			}
			gridAttachments.BeginUpdate();
			gridAttachments.Rows.Clear();
			gridAttachments.Columns.Clear();
			gridAttachments.Columns.Add(new OpenDental.UI.ODGridColumn("",0));//No name column, since there is only one column.
			for(int i=0;i<_emailMessage.Attachments.Count;i++) {
				if(_emailMessage.Attachments[i].DisplayedFileName.ToLower()=="smime.p7s") {
					if(!_isComposing) {
						string smimeP7sFilePath=ODFileUtils.CombinePaths(EmailAttaches.GetAttachPath(),_emailMessage.Attachments[i].ActualFileName);
						SetSig(EmailMessages.GetEmailSignatureFromSmimeP7sFile(smimeP7sFilePath));
					}
					//Do not display email signatures in the attachment list, because "smime.p7s" has no meaning to a user
					//Also, Windows will install the smime.p7s into an useless place in the Windows certificate store.
					continue;
				}
				OpenDental.UI.ODGridRow row=new UI.ODGridRow();
				row.Cells.Add(_emailMessage.Attachments[i].DisplayedFileName);
				gridAttachments.Rows.Add(row);
				_listEmailAttachDisplayed.Add(_emailMessage.Attachments[i]);
			}
			gridAttachments.EndUpdate();
			if(gridAttachments.Rows.Count>0) {
				gridAttachments.SetSelected(0,true);
			}
		}
コード例 #8
0
		///<summary>Gets new emails and also shows older emails from the database.</summary>
		private void FillGridEmailMessages() {
			if(AddressInbox==null) {
				ListEmailMessages=new List<EmailMessage>();
			}
			else {
				ListEmailMessages=EmailMessages.GetInboxForAddress(AddressInbox.EmailUsername,Security.CurUser.ProvNum);
			}
			if(gridEmailMessages.Columns.Count==0) {//Columns do not change.  We only need to set them once.
				gridEmailMessages.BeginUpdate();
				gridEmailMessages.Columns.Clear();
				int colReceivedDatePixCount=140;
				int colStatusPixCount=120;
				int colFromPixCount=200;
				int colSubjectPixCount=200;
				int colPatientPixCount=140;
				int colVariablePixCount=gridEmailMessages.Width-22-colReceivedDatePixCount-colStatusPixCount-colFromPixCount-colSubjectPixCount-colPatientPixCount;
				gridEmailMessages.Columns.Add(new UI.ODGridColumn(Lan.g(this,"ReceivedDate"),colReceivedDatePixCount,HorizontalAlignment.Center));
				gridEmailMessages.Columns[gridEmailMessages.Columns.Count-1].SortingStrategy=UI.GridSortingStrategy.DateParse;
				gridEmailMessages.Columns.Add(new UI.ODGridColumn(Lan.g(this,"Sent/Received"),colStatusPixCount,HorizontalAlignment.Center));
				gridEmailMessages.Columns[gridEmailMessages.Columns.Count-1].SortingStrategy=UI.GridSortingStrategy.StringCompare;
				gridEmailMessages.Columns.Add(new UI.ODGridColumn(Lan.g(this,"Subject"),colSubjectPixCount,HorizontalAlignment.Left));
				gridEmailMessages.Columns[gridEmailMessages.Columns.Count-1].SortingStrategy=UI.GridSortingStrategy.StringCompare;
				gridEmailMessages.Columns.Add(new UI.ODGridColumn(Lan.g(this,"From"),colFromPixCount,HorizontalAlignment.Left));
				gridEmailMessages.Columns[gridEmailMessages.Columns.Count-1].SortingStrategy=UI.GridSortingStrategy.StringCompare;
				gridEmailMessages.Columns.Add(new UI.ODGridColumn(Lan.g(this,"Patient"),colPatientPixCount,HorizontalAlignment.Left));
				gridEmailMessages.Columns[gridEmailMessages.Columns.Count-1].SortingStrategy=UI.GridSortingStrategy.StringCompare;
				gridEmailMessages.Columns.Add(new UI.ODGridColumn(Lan.g(this,"Preview"),colVariablePixCount,HorizontalAlignment.Left));
				gridEmailMessages.Columns[gridEmailMessages.Columns.Count-1].SortingStrategy=UI.GridSortingStrategy.StringCompare;
			}
			gridEmailMessages.Rows.Clear();
			for(int i=0;i<ListEmailMessages.Count;i++) {
				UI.ODGridRow row=new UI.ODGridRow();
				row.Tag=ListEmailMessages[i];//Used to locate the correct email message if the user decides to sort the grid.
				if(ListEmailMessages[i].SentOrReceived==EmailSentOrReceived.Received || ListEmailMessages[i].SentOrReceived==EmailSentOrReceived.WebMailReceived
					|| ListEmailMessages[i].SentOrReceived==EmailSentOrReceived.ReceivedEncrypted || ListEmailMessages[i].SentOrReceived==EmailSentOrReceived.ReceivedDirect) {
					row.Bold=true;//unread
				}
				row.Cells.Add(new UI.ODGridCell(ListEmailMessages[i].MsgDateTime.ToString()));//ReceivedDate
				row.Cells.Add(new UI.ODGridCell(ListEmailMessages[i].SentOrReceived.ToString()));//Status
				row.Cells.Add(new UI.ODGridCell(ListEmailMessages[i].Subject));//Subject
				row.Cells.Add(new UI.ODGridCell(ListEmailMessages[i].FromAddress));//From
				long patNumRegardingPatient=ListEmailMessages[i].PatNum;
				//Webmail messages should list the patient as the PatNumSubj, which means "the patient whom this message is regarding".
				if(ListEmailMessages[i].SentOrReceived==EmailSentOrReceived.WebMailReceived || ListEmailMessages[i].SentOrReceived==EmailSentOrReceived.WebMailRecdRead) {
					patNumRegardingPatient=ListEmailMessages[i].PatNumSubj;
				}
				if(patNumRegardingPatient==0) {
					row.Cells.Add(new UI.ODGridCell(""));//Patient
				}
				else {
					Patient pat=Patients.GetPat(patNumRegardingPatient);
					row.Cells.Add(new UI.ODGridCell(pat.GetNameLF()));//Patient
				}
				string preview=ListEmailMessages[i].BodyText.Replace("\r\n"," ").Replace('\n',' ');//Replace newlines with spaces, in order to compress the preview.
				if(preview.Length>50) {
					preview=preview.Substring(0,50)+"...";
				}
				row.Cells.Add(new UI.ODGridCell(preview));//Preview
				gridEmailMessages.Rows.Add(row);
			}
			gridEmailMessages.EndUpdate();
		}