当前位置: 首页>>代码示例>>C#>>正文


C# Patient.Copy方法代码示例

本文整理汇总了C#中OpenDentBusiness.Patient.Copy方法的典型用法代码示例。如果您正苦于以下问题:C# Patient.Copy方法的具体用法?C# Patient.Copy怎么用?C# Patient.Copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenDentBusiness.Patient的用法示例。


在下文中一共展示了Patient.Copy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreatePatient

		public static Patient CreatePatient(string suffix){
			Patient pat=new Patient();
			pat.IsNew=true;
			pat.LName="LName"+suffix;
			pat.FName="FName"+suffix;
			pat.BillingType=PrefC.GetLong(PrefName.PracticeDefaultBillType);
			pat.PriProv=PrefC.GetLong(PrefName.PracticeDefaultProv);//This causes standard fee sched to be 53.
			Patients.Insert(pat,false);
			Patient oldPatient=pat.Copy();
			pat.Guarantor=pat.PatNum;
			Patients.Update(pat,oldPatient);
			return pat;
		}
开发者ID:mnisl,项目名称:OD,代码行数:13,代码来源:PatientT.cs

示例2: GetPatientFolder

		///<summary>Will create folder if needed.  Will validate that folder exists.  It will alter the pat.ImageFolder if needed, but still make sure to pass in a very new Patient because we do not want an invalid patFolder.</summary>
		public static string GetPatientFolder(Patient pat,string AtoZpath) {
			string retVal="";
			if(!PrefC.GetBool(PrefName.AtoZfolderUsed)) {
				return retVal;
			}
			if(pat.ImageFolder=="") {//creates new folder for patient if none present
				string name=pat.LName+pat.FName;
				string folder="";
				for(int i=0;i<name.Length;i++) {
					if(Char.IsLetter(name,i)) {
						folder+=name.Substring(i,1);
					}
				}
				folder+=pat.PatNum.ToString();//ensures unique name
				try {
					Patient PatOld=pat.Copy();
					pat.ImageFolder=folder;
					retVal=ODFileUtils.CombinePaths(AtoZpath,
																		pat.ImageFolder.Substring(0,1).ToUpper(),
																		pat.ImageFolder);
					Directory.CreateDirectory(retVal);
					Patients.Update(pat,PatOld);
				}
				catch {
					throw new Exception(Lans.g("ContrDocs","Error.  Could not create folder for patient. "));
				}
			}
			else {//patient folder already created once
				retVal = ODFileUtils.CombinePaths(AtoZpath,
																	pat.ImageFolder.Substring(0,1).ToUpper(),
																	pat.ImageFolder);
			}
			if(!Directory.Exists(retVal)) {//this makes it more resiliant and allows copies
				//of the opendentaldata folder to be used in read-only situations.
				try {
					Directory.CreateDirectory(retVal);
				}
				catch {
					throw new Exception(Lans.g("ContrDocs","Error.  Could not create folder for patient: ")+retVal);
				}
			}
			return retVal;
		}
开发者ID:mnisl,项目名称:OD,代码行数:44,代码来源:ImageStore.cs

示例3: Allocate

		/// <summary>Only Called only from FormPayment.butOK click.  Only called if the user did not enter any splits.  Usually just adds one split for the current patient.  But if that would take the balance negative, then it loops through all other family members and creates splits for them.  It might still take the current patient negative once all other family members are zeroed out.</summary>
		public static List<PaySplit> Allocate(Payment pay){//double amtTot,int patNum,Payment payNum){
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				return Meth.GetObject<List<PaySplit>>(MethodBase.GetCurrentMethod(),pay);
			}
			string command= 
				"SELECT Guarantor FROM patient "
				+"WHERE PatNum = "+POut.Long(pay.PatNum);
 			DataTable table=Db.GetTable(command);
			if(table.Rows.Count==0){
				return new List<PaySplit>();
			}
			command= 
				"SELECT patient.PatNum,EstBalance,PriProv,SUM(InsPayEst)+SUM(Writeoff) insEst_ "
				+"FROM patient "
				+"LEFT JOIN claimproc ON patient.PatNum=claimproc.PatNum "
				+"AND Status=0 "//NotReceived
				+"WHERE Guarantor = "+table.Rows[0][0].ToString()+" "
				+"GROUP BY  patient.PatNum,EstBalance,PriProv";
				//+" ORDER BY PatNum!="+POut.PInt(pay.PatNum);//puts current patient in position 0 //Oracle does not allow
 			table=Db.GetTable(command);
			List<Patient> pats=new List<Patient>();
			Patient pat;
			//first, put the current patient at position 0.
			for(int i=0;i<table.Rows.Count;i++) {
				if(table.Rows[i]["PatNum"].ToString()==pay.PatNum.ToString()){
					pat=new Patient();
					pat.PatNum    = PIn.Long(table.Rows[i][0].ToString());
					pat.EstBalance= PIn.Double(table.Rows[i][1].ToString());
					if(!PrefC.GetBool(PrefName.BalancesDontSubtractIns)){
						pat.EstBalance-=PIn.Double(table.Rows[i]["insEst_"].ToString());
					}
					pat.PriProv   = PIn.Long(table.Rows[i][2].ToString());
					pats.Add(pat.Copy());
				}
			}
			//then, do all the rest of the patients.
			for(int i=0;i<table.Rows.Count;i++){
				if(table.Rows[i]["PatNum"].ToString()==pay.PatNum.ToString()){
					continue;
				}
				pat=new Patient();
				pat.PatNum    = PIn.Long   (table.Rows[i][0].ToString());
				pat.EstBalance= PIn.Double(table.Rows[i][1].ToString());
				if(!PrefC.GetBool(PrefName.BalancesDontSubtractIns)){
					pat.EstBalance-=PIn.Double(table.Rows[i]["insEst_"].ToString());
				}
				pat.PriProv   = PIn.Long   (table.Rows[i][2].ToString());
				pats.Add(pat.Copy());
			}
			//first calculate all the amounts
			double amtRemain=pay.PayAmt;//start off with the full amount
			double[] amtSplits=new double[pats.Count];
			//loop through each family member, starting with current
			for(int i=0;i<pats.Count;i++){
				if(pats[i].EstBalance==0 || pats[i].EstBalance<0){
					continue;//don't apply paysplits to anyone with a negative balance
				}
				if(amtRemain<pats[i].EstBalance){//entire remainder can be allocated to this patient
					amtSplits[i]=amtRemain;
					amtRemain=0;
					break;
				}
				else{//amount remaining is more than or equal to the estBal for this family member
					amtSplits[i]=pats[i].EstBalance;
					amtRemain-=pats[i].EstBalance;
				}
			}
			//add any remainder to the split for this patient
			amtSplits[0]+=amtRemain;
			//now create a split for each non-zero amount
			PaySplit PaySplitCur;
			List<PaySplit> retVal=new List<PaySplit>();
			for(int i=0;i<pats.Count;i++){
				if(amtSplits[i]==0){
					continue;
				}
				PaySplitCur=new PaySplit();
				PaySplitCur.PatNum=pats[i].PatNum;
				PaySplitCur.PayNum=pay.PayNum;
				PaySplitCur.ProcDate=pay.PayDate;
				PaySplitCur.DatePay=pay.PayDate;
				PaySplitCur.ClinicNum=pay.ClinicNum;
				PaySplitCur.ProvNum=Patients.GetProvNum(pats[i]);
				PaySplitCur.SplitAmt=Math.Round(amtSplits[i],CultureInfo.CurrentCulture.NumberFormat.CurrencyDecimalDigits);
				//PaySplitCur.InsertOrUpdate(true);
				retVal.Add(PaySplitCur);
			}
			//finally, adjust each EstBalance, but no need to do current patient
			//This no longer works here.  Must do it when closing payment window somehow
			/*for(int i=1;i<pats.Length;i++){
				if(amtSplits[i]==0){
					continue;
				}
				command="UPDATE patient SET EstBalance=EstBalance-"+POut.PDouble(amtSplits[i])
					+" WHERE PatNum="+POut.PInt(pats[i].PatNum);
				Db.NonQ(command);
			}*/
			return retVal;
		}
开发者ID:mnisl,项目名称:OD,代码行数:100,代码来源:Payments.cs

示例4: SetProvBarSched

		/*
		///<summary>Only used in GetSearchResults.  All times between start and stop get set to true in provBarSched.</summary>
		private static void SetProvBarSched(ref bool[] provBarSched,TimeSpan timeStart,TimeSpan timeStop){
			int startI=GetProvBarIndex(timeStart);
			int stopI=GetProvBarIndex(timeStop);
			for(int i=startI;i<=stopI;i++){
				provBarSched[i]=true;
			}
		}

		private static int GetProvBarIndex(TimeSpan time) {
			return (int)(((double)time.Hours*(double)60/(double)PrefC.GetLong(PrefName.AppointmentTimeIncrement)//aptTimeIncr=minutesPerIncr
				+(double)time.Minutes/(double)PrefC.GetLong(PrefName.AppointmentTimeIncrement))
				*(double)ApptDrawing.LineH*ApptDrawing.RowsPerIncr)
				/ApptDrawing.LineH;//rounds down
		}*/

		///<summary>Used by UI when it needs a recall appointment placed on the pinboard ready to schedule.  This method creates the appointment and attaches all appropriate procedures.  It's up to the calling class to then place the appointment on the pinboard.  If the appointment doesn't get scheduled, it's important to delete it.  If a recallNum is not 0 or -1, then it will create an appt of that recalltype.</summary>
		public static Appointment CreateRecallApt(Patient patCur,List<Procedure> procList,List<InsPlan> planList,long recallNum,List<InsSub> subList){
			List<Recall> recallList=Recalls.GetList(patCur.PatNum);
			Recall recallCur=null;
			if(recallNum>0) {
				recallCur=Recalls.GetRecall(recallNum);
			}
			else{
				for(int i=0;i<recallList.Count;i++){
					if(recallList[i].RecallTypeNum==RecallTypes.PerioType || recallList[i].RecallTypeNum==RecallTypes.ProphyType){
						if(!recallList[i].IsDisabled){
							recallCur=recallList[i];
						}
						break;
					}
				}
			}
			if(recallCur==null){// || recallCur.DateDue.Year<1880){
				throw new ApplicationException(Lan.g("AppointmentL","No special type recall is due."));//Typically never happens because everyone has a recall.  However, it can happen when patients have custom recalls due
			}
			if(recallCur.DateScheduled.Date>DateTime.Today) {
				throw new ApplicationException(Lan.g("AppointmentL","Recall has already been scheduled for ")+recallCur.DateScheduled.ToShortDateString());
			}
			Appointment aptCur=new Appointment();
			List<string> procs=RecallTypes.GetProcs(recallCur.RecallTypeNum);
			List<Procedure> listProcs=Appointments.FillAppointmentForRecall(aptCur,recallCur,recallList,patCur,procs,planList,subList);
			for(int i=0;i<listProcs.Count;i++) {
				if(Programs.UsingOrion) {
					FormProcEdit FormP=new FormProcEdit(listProcs[i],patCur.Copy(),Patients.GetFamily(patCur.PatNum));
					FormP.IsNew=true;
					FormP.ShowDialog();
					if(FormP.DialogResult==DialogResult.Cancel) {
						//any created claimprocs are automatically deleted from within procEdit window.
						try {
							Procedures.Delete(listProcs[i].ProcNum);//also deletes the claimprocs
						}
						catch(Exception ex) {
							MessageBox.Show(ex.Message);
						}
					}
					else {
						//Do not synch. Recalls based on ScheduleByDate reports in Orion mode.
						//Recalls.Synch(PatCur.PatNum);
					}
				}
			}
			return aptCur;
		}
开发者ID:mnisl,项目名称:OD,代码行数:65,代码来源:AppointmentL.cs

示例5: FormPayPlan

		///<summary>The supplied payment plan should already have been saved in the database.</summary>
		public FormPayPlan(Patient patCur,PayPlan payPlanCur){
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();
			PatCur=patCur.Copy();
			PayPlanCur=payPlanCur.Copy();
			FamCur=Patients.GetFamily(PatCur.PatNum);
			SubList=InsSubs.RefreshForFam(FamCur);
			InsPlanList=InsPlans.RefreshForSubList(SubList);
			FormPayPlanOpts=new FormPaymentPlanOptions(PayPlanCur.PaySchedule);
			_formPayPlanRecalculate=new FormPayPlanRecalculate();
			Lan.F(this);
		}
开发者ID:mnisl,项目名称:OD,代码行数:15,代码来源:FormPayPlan.cs

示例6: CreatePatients

		/// <summary>For testing only</summary>
		private static void CreatePatients(int PatientCount) {
			for(int i=0;i<PatientCount;i++) {
				Patient newPat=new Patient();
				newPat.LName="Mathew"+i;
				newPat.FName="Dennis"+i;
				newPat.Address="Address Line 1.Address Line 1___"+i;
				newPat.Address2="Address Line 2. Address Line 2__"+i;
				newPat.AddrNote="Lives off in far off Siberia Lives off in far off Siberia"+i;
				newPat.AdmitDate=new DateTime(1985,3,3).AddDays(i);
				newPat.ApptModNote="Flies from Siberia on specially chartered flight piloted by goblins:)"+i;
				newPat.AskToArriveEarly=1555;
				newPat.BillingType=3;
				newPat.ChartNumber="111111"+i;
				newPat.City="NL";
				newPat.ClinicNum=i;
				newPat.CreditType="A";
				newPat.DateFirstVisit=new DateTime(1985,3,3).AddDays(i);
				newPat.Email="[email protected]";
				newPat.HmPhone="416-222-5678";
				newPat.WkPhone="416-222-5678";
				newPat.Zip="M3L 2L9";
				newPat.WirelessPhone="416-222-5678";
				newPat.Birthdate=new DateTime(1970,3,3).AddDays(i);
				Patients.Insert(newPat,false);
				//set Guarantor field the same as PatNum
				Patient patOld=newPat.Copy();
				newPat.Guarantor=newPat.PatNum;
				Patients.Update(newPat,patOld);
			}
		}
开发者ID:romeroyonatan,项目名称:opendental,代码行数:31,代码来源:FormMobile.cs

示例7: FormPatientEdit

 ///<summary></summary>
 public FormPatientEdit(Patient patCur,Family famCur)
 {
     InitializeComponent();// Required for Windows Form Designer support
     PatCur=patCur;
     FamCur=famCur;
     PatOld=patCur.Copy();
     listEmps=new ListBox();
     listEmps.Location=new Point(textEmployer.Left,textEmployer.Bottom);
     listEmps.Size=new Size(textEmployer.Width,100);
     listEmps.Visible=false;
     listEmps.Click += new System.EventHandler(listEmps_Click);
     listEmps.DoubleClick += new System.EventHandler(listEmps_DoubleClick);
     listEmps.MouseEnter += new System.EventHandler(listEmps_MouseEnter);
     listEmps.MouseLeave += new System.EventHandler(listEmps_MouseLeave);
     Controls.Add(listEmps);
     listEmps.BringToFront();
     listCounties=new ListBox();
     listCounties.Location=new Point(groupPH.Left+textCounty.Left
         ,groupPH.Top+textCounty.Bottom);
     listCounties.Size=new Size(textCounty.Width,100);
     listCounties.Visible=false;
     listCounties.Click += new System.EventHandler(listCounties_Click);
     //listCounties.DoubleClick += new System.EventHandler(listCars_DoubleClick);
     listCounties.MouseEnter += new System.EventHandler(listCounties_MouseEnter);
     listCounties.MouseLeave += new System.EventHandler(listCounties_MouseLeave);
     Controls.Add(listCounties);
     listCounties.BringToFront();
     listSites=new ListBox();
     listSites.Location=new Point(groupPH.Left+textSite.Left,groupPH.Top+textSite.Bottom);
     listSites.Size=new Size(textSite.Width,100);
     listSites.Visible=false;
     listSites.Click += new System.EventHandler(listSites_Click);
     listSites.MouseEnter += new System.EventHandler(listSites_MouseEnter);
     listSites.MouseLeave += new System.EventHandler(listSites_MouseLeave);
     Controls.Add(listSites);
     listSites.BringToFront();
     Lan.F(this);
     if(CultureInfo.CurrentCulture.Name.EndsWith("CA")) {//Canadian. en-CA or fr-CA
         labelSSN.Text="SIN";
         labelZip.Text="Postal Code";
         labelST.Text="Province";
         butEditZip.Text="Edit Postal Code";
         labelCanadianEligibilityCode.Visible=true;
         comboCanadianEligibilityCode.Visible=true;
         radioStudentN.Visible=false;
         radioStudentP.Visible=false;
         radioStudentF.Visible=false;
     }
     if(CultureInfo.CurrentCulture.Name.EndsWith("GB")){//en-GB
         //labelSSN.Text="?";
         labelZip.Text="Postcode";
         labelST.Text="";//no such thing as state in GB
         butEditZip.Text="Edit Postcode";
     }
 }
开发者ID:nampn,项目名称:ODental,代码行数:56,代码来源:FormPatientEdit.cs

示例8: AutomaticallyGetTrophyFolder

		///<summary>Guaranteed to always return a valid foldername unless major error or user chooses to exit.  This also saves the TrophyFolder value to this patient in the db.</summary>
		private static string AutomaticallyGetTrophyFolder(Patient pat,string storagePath) {
			string retVal="";
			//try to find the correct trophy folder
			string rvgPortion=pat.LName.Substring(0,1)+".rvg";
			string alphaPath=ODFileUtils.CombinePaths(storagePath,rvgPortion);
			if(!Directory.Exists(alphaPath)) {
				throw new ApplicationException("Could not find expected path: "+alphaPath+".  The enhanced Trophy bridge assumes that folders already exist with that naming convention.");
			}
			DirectoryInfo dirInfo=new DirectoryInfo(alphaPath);
			DirectoryInfo[] dirArray=dirInfo.GetDirectories();
			List<TrophyFolder> listMatchesNot=new List<TrophyFolder>();//list of all patients found, all with same first letter of last name.
			List<TrophyFolder> listMatchesName=new List<TrophyFolder>();//list of all perfect matches for name but not birthdate.
			TrophyFolder folder;
			string maxFolderName="";
			string datafilePath;
			string[] datafileLines;
			string date;
			//loop through each folder.
			for(int i=0;i<dirArray.Length;i++) {
				if(String.Compare(dirArray[i].Name,maxFolderName) > 0) {//eg, if G0000035 > G0000024
					maxFolderName=dirArray[i].Name;
				}
				datafilePath=ODFileUtils.CombinePaths(dirArray[i].FullName,"FILEDATA.txt");
				if(!File.Exists(datafilePath)){
					continue;//fail silently.
				}
				//if this folder is already in use by some other patient, then skip
				if(Patients.IsTrophyFolderInUse(dirArray[i].Name)) {
					continue;
				}
				folder=new TrophyFolder();
				folder.FolderName=dirArray[i].Name;
				datafileLines=File.ReadAllLines(datafilePath);
				if(datafileLines.Length<2) {
					continue;
				}
				folder.FName=GetValueFromLines("PRENOM",datafileLines);
				folder.LName=GetValueFromLines("NOM",datafileLines);
				date=GetValueFromLines("DATE",datafileLines);
				try{
					folder.BirthDate=DateTime.ParseExact(date,"yyyyMMdd",CultureInfo.CurrentCulture.DateTimeFormat);
				}
				catch{}
				if(pat.LName.ToUpper()==folder.LName.ToUpper() && pat.FName.ToUpper()==folder.FName.ToUpper()) {
					if(pat.Birthdate==folder.BirthDate) {
						//We found a perfect match here, so do not display any dialog to user.
						[email protected]"\"+dirArray[i].Name;
					}
					else{//name is perfect match, but not birthdate.  Maybe birthdate was not entered in one system or the other.
						listMatchesName.Add(folder);
					}
				}
				listMatchesNot.Add(folder);
			}
			if(retVal=="") {//perfect match not found
				if(listMatchesName.Count==1) {//exactly one name matched even though birthdays did not
					[email protected]"\"+listMatchesName[0].FolderName;
				}
				else{//no or multiple matches
					FormTrophyNamePick formPick=new FormTrophyNamePick();
					formPick.ListMatches=listMatchesNot;
					formPick.ShowDialog();
					if(formPick.DialogResult!=DialogResult.OK) {
						return "";//triggers total exit
					}
					if(formPick.PickedName=="") {//Need to generate new folder name
						int maxInt=0;
						if(maxFolderName!="") {
							maxInt=PIn.Int(maxFolderName.Substring(1));//It will crash here if can't parse the int.
						}
						maxInt++;
						string paddedInt=maxInt.ToString().PadLeft(7,'0');
						[email protected]"\"+pat.LName.Substring(0,1).ToUpper()+paddedInt;
					}
					else {
						[email protected]"\"+formPick.PickedName;
					}
				}
			}
			Patient patOld=pat.Copy();
			pat.TrophyFolder=retVal;
			Patients.Update(pat,patOld);
			return retVal;
		}
开发者ID:mnisl,项目名称:OD,代码行数:85,代码来源:TrophyEnhanced.cs

示例9: FormPayPlan

 ///<summary>The supplied payment plan should already have been saved in the database.</summary>
 public FormPayPlan(Patient patCur,PayPlan payPlanCur)
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     PatCur=patCur.Copy();
     PayPlanCur=payPlanCur.Copy();
     FamCur=Patients.GetFamily(PatCur.PatNum);
     SubList=InsSubs.RefreshForFam(FamCur);
     InsPlanList=InsPlans.RefreshForSubList(SubList);
     Lan.F(this);
 }
开发者ID:nampn,项目名称:ODental,代码行数:14,代码来源:FormPayPlan.cs

示例10: butAddPt_Click

		///<summary>Remember, this button is not even visible if SelectionModeOnly.</summary>
		private void butAddPt_Click(object sender, System.EventArgs e){
			#if(TRIALONLY)
				MsgBox.Show(this,"Trial version.  Maximum 30 patients");
				if(Patients.GetNumberPatients()>30){
					MsgBox.Show(this,"Maximum reached");
					return;
				}
			#endif
			if(textLName.Text=="" && textFName.Text=="" && textChartNumber.Text==""){
				MessageBox.Show(Lan.g(this,"Not allowed to add a new patient until you have done a search to see if that patient already exists. Hint: just type a few letters into the Last Name box above.")); 
				return;
			}
			Patient PatCur=new Patient();
			if(textLName.Text.Length>1){//eg Sp
				PatCur.LName=textLName.Text.Substring(0,1).ToUpper()+textLName.Text.Substring(1);
			}
			if(textFName.Text.Length>1){
				PatCur.FName=textFName.Text.Substring(0,1).ToUpper()+textFName.Text.Substring(1);
			}
			PatCur.PatStatus=PatientStatus.Patient;
			PatCur.BillingType=PrefC.GetLong(PrefName.PracticeDefaultBillType);
			PatCur.PriProv=PrefC.GetLong(PrefName.PracticeDefaultProv);
			if(PrefC.GetBool(PrefName.ShowFeatureEhr)) {
				PatCur.Gender=PatientGender.Unknown;
			}
			PatCur.ClinicNum=Security.CurUser.ClinicNum;
			Patients.Insert(PatCur,false);
			CustReference custRef=new CustReference();
			custRef.PatNum=PatCur.PatNum;
			CustReferences.Insert(custRef);
			Patient PatOld=PatCur.Copy();
			PatCur.Guarantor=PatCur.PatNum;
			Patients.Update(PatCur,PatOld);
			Family FamCur=Patients.GetFamily(PatCur.PatNum);
			FormPatientEdit FormPE=new FormPatientEdit(PatCur,FamCur);
			FormPE.IsNew=true;
			FormPE.ShowDialog();
			if(FormPE.DialogResult==DialogResult.OK){
				NewPatientAdded=true;
				SelectedPatNum=PatCur.PatNum;
				DialogResult=DialogResult.OK;
			}
		}
开发者ID:romeroyonatan,项目名称:opendental,代码行数:44,代码来源:FormPatientSelect.cs

示例11: SetInitialPatients

		public static string SetInitialPatients() {
			Patient pat;
			Patient oldPatient;
			InsPlan plan;
			InsSub sub;
			PatPlan patplan;
			pat=new Patient();
			pat.PatStatus=PatientStatus.Patient;
			pat.Position=PatientPosition.Single;
			pat.Gender=PatientGender.Female;
			pat.Birthdate=new DateTime(1960,04,12);
			pat.LName="Fête";
			pat.FName="Lisa";
			pat.MiddleI="Ç";
			pat.Address="124 - 1500 Rue";
			pat.City="Montréal";
			pat.State="QC";
			pat.Zip="H1C2D4";
			pat.Language="fr";
			pat.CanadianEligibilityCode=2;//disabled
			Patients.Insert(pat,false);
			PatNum1=pat.PatNum;
			oldPatient=pat.Copy();
			pat.Guarantor=pat.PatNum;
			Patients.Update(pat,oldPatient);
			//Extractions
			ProcTC.SetExtracted("23",new DateTime(1995,2,7),pat.PatNum);
			ProcTC.SetExtracted("26",new DateTime(1996,11,13),pat.PatNum);
			//Missing teeth
			plan=new InsPlan();
			plan.CarrierNum=CarrierTC.GetCarrierNumById("666666");
			plan.GroupNum="PLAN012";
			plan.DentaideCardSequence=3;
			plan.CanadianPlanFlag="";
			plan.ClaimFormNum=7;//Canadian claim form
			InsPlans.Insert(plan);
			sub=new InsSub();
			sub.PlanNum=plan.PlanNum;
			sub.Subscriber=pat.PatNum;
			sub.SubscriberID="AB123C4G";
			InsSubs.Insert(sub);
			patplan=new PatPlan();
			patplan.PatNum=pat.PatNum;
			patplan.InsSubNum=sub.InsSubNum;
			patplan.Relationship=Relat.Self;//1
			patplan.PatID="00";
			patplan.Ordinal=1;
			PatPlans.Insert(patplan);
			//PATIENT 2==================================================================
			pat=new Patient();
			pat.PatStatus=PatientStatus.Patient;
			pat.Position=PatientPosition.Married;
			pat.Gender=PatientGender.Male;
			pat.Birthdate=new DateTime(1948,3,2);
			pat.LName="Smith";
			pat.FName="John";
			pat.MiddleI="";
			pat.CanadianEligibilityCode=4;//code not applicable
			pat.Address="P.O. Box 1500";
			pat.Address2="Little Field Estates";
			pat.City="East Westchester";
			pat.State="ON";
			pat.Zip="M7F2J9";
			pat.Language="en";
			Patients.Insert(pat,false);
			PatNum2=pat.PatNum;
			oldPatient=pat.Copy();
			pat.Guarantor=pat.PatNum;
			Patients.Update(pat,oldPatient);
			//plan1
			plan=new InsPlan();
			plan.CarrierNum=CarrierTC.GetCarrierNumById("666666");
			plan.GroupNum="PLAN02";
			plan.DivisionNo="1542B";
			plan.DentaideCardSequence=0;
			plan.CanadianPlanFlag="";
			plan.ClaimFormNum=7;//Canadian claim form
			InsPlans.Insert(plan);
			long planNum_pat2_pri=plan.PlanNum;
			sub=new InsSub();
			sub.PlanNum=plan.PlanNum;
			sub.Subscriber=pat.PatNum;
			sub.SubscriberID="123432145222";
			InsSubs.Insert(sub);
			long subNum_pat2_pri=sub.InsSubNum;
			patplan=new PatPlan();
			patplan.PatNum=pat.PatNum;
			patplan.InsSubNum=sub.InsSubNum;
			patplan.Relationship=Relat.Self;//1
			patplan.PatID="00";
			patplan.Ordinal=1;
			PatPlans.Insert(patplan);
			//plan2
			plan=new InsPlan();
			plan.CarrierNum=CarrierTC.GetCarrierNumById("777777");
			plan.GroupNum="P9902";
			plan.DivisionNo="";
			plan.DentaideCardSequence=0;
			plan.CanadianPlanFlag="";
			plan.ClaimFormNum=7;//Canadian claim form
//.........这里部分代码省略.........
开发者ID:mnisl,项目名称:OD,代码行数:101,代码来源:PatientTC.cs

示例12: SendData

		/// <summary></summary>
		public static void SendData(Program ProgramCur,Patient pat) {
			if(pat==null) {
				MsgBox.Show("Guru","Please select a patient first.");
				return;
			}
			int errorNum=MVStart();
			if(errorNum != 0) {
				MsgBox.Show("Guru","An error has occured.");
				return;
			}
			MVPatient mvPatient = new MVPatient();
			mvPatient.LastName = Tidy(pat.LName,64);
			mvPatient.FirstName = Tidy(pat.FName,64);
			if(pat.Gender == PatientGender.Male) {
				mvPatient.Sex = Tidy("M",1);
			}
			else if(pat.Gender == PatientGender.Female) {
				mvPatient.Sex = Tidy("F",1);
			}
			else if(pat.Gender == PatientGender.Unknown) {
				mvPatient.Sex = Tidy("0",1);
			}
			mvPatient.BirthDate = Tidy(pat.Birthdate.ToString("MMddyyyy"),8);
			if(ProgramProperties.GetPropVal(ProgramCur.ProgramNum,"Enter 0 to use PatientNum, or 1 to use ChartNum")=="0") {
				mvPatient.ID=Tidy(pat.PatNum.ToString(),64);
			}
			else {
				mvPatient.ID=Tidy(pat.ChartNumber.ToString(),64);
			}
			if(pat.ImageFolder=="") {//Could happen if the images module has not been visited for a new patient.
				Patient patOld=pat.Copy();
				pat.ImageFolder=pat.LName+pat.FName+pat.PatNum;
				Patients.Update(pat,patOld);
			}
			string imagePath=CodeBase.ODFileUtils.CombinePaths(ProgramProperties.GetPropVal(ProgramCur.ProgramNum,"Guru image path"),pat.ImageFolder);
			mvPatient.Directory = Tidy(imagePath,259);
			if(MVSendPatient(mvPatient) != 0) {
				MsgBox.Show("Guru","An error has occured.");
			}
		}
开发者ID:romeroyonatan,项目名称:opendental,代码行数:41,代码来源:Guru.cs

示例13: FormSheetImport_Load

		private void FormSheetImport_Load(object sender,EventArgs e) {
			if(SheetCur!=null) {
				PatCur=Patients.GetPat(SheetCur.PatNum);
				PatOld=PatCur.Copy();
			}
			else {
				#region Acro
				throw new NotImplementedException();//js this broke with the move to dot net 4.0.
				/*
				pat=Patients.GetPat(DocCur.PatNum);
				CAcroApp acroApp=null;
				try {
					acroApp=new AcroAppClass();//Initialize Acrobat by creating App object
				}
				catch {
					MsgBox.Show(this,"Requires Acrobat 9 Pro to be installed on this computer.");
					DialogResult=DialogResult.Cancel;
					return;
				}
				//acroApp.Show();// Show Acrobat Viewer
				//acroApp.Hide();//This is annoying if Acrobat is already open for some other reason.
				CAcroAVDoc avDoc=new AcroAVDocClass();
				string pathToPdf=CodeBase.ODFileUtils.CombinePaths(ImageStore.GetPatientFolder(pat),DocCur.FileName);
				if(!avDoc.Open(pathToPdf,"")){
					MessageBox.Show(Lan.g(this,"Could not open")+" "+pathToPdf);
					DialogResult=DialogResult.Cancel;
					return;
				}
				IAFormApp formApp=new AFormAppClass();//Create a IAFormApp object so we can access the form fields in the open document
				IFields myFields=(IFields)formApp.Fields;// Get the IFields object associated with the form
				IEnumerator myEnumerator = myFields.GetEnumerator();// Get the IEnumerator object for myFields
				dictAcrobatFields=new Dictionary<string,string>();
				IField myField;
				string nameClean;
				string valClean;
				while(myEnumerator.MoveNext()) {
					myField=(IField)myEnumerator.Current;// Get the IField object
					if(myField.Value==null){
						continue;
					}
					//if the form was designed in LiveCycle, the names will look like this: topmostSubform[0].page1[0].SSN[0]
					//Whereas, if it was designed in Acrobat, the names will look like this: SSN
					//So...
					nameClean=myField.Name;
					if(nameClean.Contains("[") && nameClean.Contains(".")) {
						nameClean=nameClean.Substring(nameClean.LastIndexOf(".")+1);
						nameClean=nameClean.Substring(0,nameClean.IndexOf("["));
					}
					if(nameClean=="misc") {
						int suffix=1;
						nameClean=nameClean+suffix.ToString();
						while(dictAcrobatFields.ContainsKey(nameClean)) {//untested.
							suffix++;
							nameClean=nameClean+suffix.ToString();
						}
					}
					valClean=myField.Value;
					if(valClean=="Off") {
						valClean="";
					}
					//myField.Type//possible values include text,radiobutton,checkbox
					//MessageBox.Show("Raw:"+myField.Name+"  Name:"+nameClean+"  Value:"+myField.Value);
					if(dictAcrobatFields.ContainsKey(nameClean)) {
						continue;
					}
					dictAcrobatFields.Add(nameClean,valClean);
					//name:topmostSubform[0].page1[0].SSN[0]
				}
				//acroApp.Hide();//Doesn't work well enough
				//this.BringToFront();//Doesn't work
				//acroApp.Minimize();
				acroApp.Exit();
				acroApp=null;
				*/
				#endregion
			}
			Fam=Patients.GetFamily(PatCur.PatNum);
			AddressSameForFam=true;
			for(int i=0;i<Fam.ListPats.Length;i++) {
				if(PatCur.HmPhone!=Fam.ListPats[i].HmPhone
					|| PatCur.Address!=Fam.ListPats[i].Address
					|| PatCur.Address2!=Fam.ListPats[i].Address2
					|| PatCur.City!=Fam.ListPats[i].City
					|| PatCur.State!=Fam.ListPats[i].State
					|| PatCur.Zip!=Fam.ListPats[i].Zip) 
				{
					AddressSameForFam=false;
					break;
				}
			}
			PatPlanList=PatPlans.Refresh(PatCur.PatNum);
			SubList=InsSubs.RefreshForFam(Fam);
			PlanList=InsPlans.RefreshForSubList(SubList);
			if(PatPlanList.Count==0) {
				PatPlan1=null;
				Plan1=null;
				Sub1=null;
				Ins1Relat=null;
				Carrier1=null;
			}
//.........这里部分代码省略.........
开发者ID:romeroyonatan,项目名称:opendental,代码行数:101,代码来源:FormSheetImport.cs

示例14: GetCloneAndNonClone

		///<summary>Finds any patients with the same first name, last name, and birthdate.  The birthdate must be a valid date, not 0001-01-01.
		///<para>If patCur has all-caps first and last names and there is exactly one matching patient who does not have all-caps first and last names, then patClone is set to patCur, patNonClone is set to the matching patient, and listAmbiguousMatches will be an empty list.</para>
		///<para>If the matching patient has an all-caps first and last name and patCur does not, then patClone will be set to the matching patient, patNonClone will be set to patCur, and listAmbiguousMatches will be an empty list.</para>
		///<para>If there are no matching patients, patClone and patNonClone will be null and listAmbiguousMatches will be an empty list.</para>
		///<para>If more than one patient has the same first and last name and birthdate, patClone and patNonClone will be null and listAmbiguousMatches will contain all the matching patients.</para>
		///<para>If there is one match, but there is not an all-caps to not all-caps relationship (meaning both are all-caps or both are mixed case or both are lower), patClone and patNonClone will be null and listAmbiguousMatches will contain the matching patient.</para></summary>
		public static void GetCloneAndNonClone(Patient patCur,out Patient patClone,out Patient patNonClone,out List<Patient> listAmbiguousMatches) {
			//No need to check RemotingRole; no call to db.
			//if niether patClone or patNonClone is set after this method, the patient does not have a clone and is also not a clone
			patClone=null;
			patNonClone=null;
			listAmbiguousMatches=new List<Patient>();
			if(patCur==null) {
				return;
			}
			if(patCur.Birthdate.Year<1880) {
				return;//in order to clone a patient or synch two patients, the birthdate for the patients must be a valid date
			}
			//listAllMatches should only contain 0 or 1 patient
			//if more than 1 other patient has the same first and last name and birthdate, then there is ambiguity that has to be fixed manually
			List<Patient> listAllMatches=GetListByNameAndBirthdate(patCur.PatNum,patCur.LName,patCur.FName,patCur.Birthdate);
			if(listAllMatches.Count==0) {
				return;//no matches, not a clone and does not have a clone
			}
			if(listAllMatches.Count>1) {
				for(int i=0;i<listAllMatches.Count;i++) {
					listAmbiguousMatches.Add(listAllMatches[i]);
				}
				return;//more than one match, cannot determine which is supposed to be linked, return the list of patients to notify the user that there is ambiguity and to fix manually
			}
			//there must be one and only one match, so determine if patCur is the clone or the non-clone
			//if patCur has all-caps first and last name, and the patient found does not, then patCur is the clone and the patient found is the non-clone
			if(patCur.LName.ToUpper()==patCur.LName
				&& patCur.FName.ToUpper()==patCur.FName
				&& (listAllMatches[0].LName.ToUpper()!=listAllMatches[0].LName || listAllMatches[0].FName.ToUpper()!=listAllMatches[0].FName))//using an or here so a patient name A Smith can be cloned to A SMITH and found based on first names both being upper case, but last names not or vice versa
			{
				patClone=patCur.Copy();
				patNonClone=listAllMatches[0].Copy();
			}
			//if patCur does not have all-caps first and last name, but the patient found does, then the patient found is the clone and patCur is the non-clone
			else if((patCur.LName.ToUpper()!=patCur.LName || patCur.FName.ToUpper()!=patCur.FName)//using an or here so original can have all uppercase first or last name but not both.  So A Smith can be cloned to A SMITH and both uppercase A first names will be ok.
				&& listAllMatches[0].LName.ToUpper()==listAllMatches[0].LName
				&& listAllMatches[0].FName.ToUpper()==listAllMatches[0].FName)
			{
				patNonClone=patCur.Copy();
				patClone=listAllMatches[0].Copy();
			}
			else {
				//either both patCur and the patient found have all-caps first and last names or both have mixed case or all lower case first and last names
				//either way, we do not know if patCur is a clone or has a clone, there is ambiguity
				//populate the ambiguous list with the patient found to notify user to fix manually if it is supposed to be linked
				listAmbiguousMatches.Add(listAllMatches[0]);
			}
		}
开发者ID:mnisl,项目名称:OD,代码行数:54,代码来源:Patients.cs

示例15: butAddPt_Click

		///<summary>Remember, this button is not even visible if SelectionModeOnly.</summary>
		private void butAddPt_Click(object sender, System.EventArgs e){
			#if(TRIALONLY)
				MsgBox.Show(this,"Trial version.  Maximum 30 patients");
				if(Patients.GetNumberPatients()>30){
					MsgBox.Show(this,"Maximum reached");
					return;
				}
			#endif
			if(textLName.Text=="" && textFName.Text=="" && textChartNumber.Text==""){
				MessageBox.Show(Lan.g(this,"Not allowed to add a new patient until you have done a search to see if that patient already exists. Hint: just type a few letters into the Last Name box above.")); 
				return;
			}
			Patient PatCur=new Patient();
			if(textLName.Text.Length>1){//eg Sp
				PatCur.LName=textLName.Text.Substring(0,1).ToUpper()+textLName.Text.Substring(1);
			}
			if(textFName.Text.Length>1){
				PatCur.FName=textFName.Text.Substring(0,1).ToUpper()+textFName.Text.Substring(1);
			}
			PatCur.PatStatus=PatientStatus.Patient;
			PatCur.BillingType=PrefC.GetLong(PrefName.PracticeDefaultBillType);
			//Explicitly use the combo clinic instead of FormOpenDental.ClinicNum becuase the combo box should default to that clinic unless manually changed by the user.
			if(!PrefC.GetBool(PrefName.EasyNoClinics) && comboClinic.SelectedIndex!=0) {//not no clinics and all isn't selected
				//Set the patients primary provider to the clinic default provider.
				PatCur.PriProv=Providers.GetDefaultProvider(_listClinics[comboClinic.SelectedIndex-1].ClinicNum).ProvNum;
			}
			else {
				//Set the patients primary provider to the practice default provider.
				PatCur.PriProv=Providers.GetDefaultProvider().ProvNum;
			}
			if(PrefC.GetBool(PrefName.ShowFeatureEhr)) {
				PatCur.Gender=PatientGender.Unknown;
			}
			PatCur.ClinicNum=FormOpenDental.ClinicNum;
			Patients.Insert(PatCur,false);
			CustReference custRef=new CustReference();
			custRef.PatNum=PatCur.PatNum;
			CustReferences.Insert(custRef);
			Patient PatOld=PatCur.Copy();
			PatCur.Guarantor=PatCur.PatNum;
			Patients.Update(PatCur,PatOld);
			Family FamCur=Patients.GetFamily(PatCur.PatNum);
			FormPatientEdit FormPE=new FormPatientEdit(PatCur,FamCur);
			FormPE.IsNew=true;
			FormPE.ShowDialog();
			if(FormPE.DialogResult==DialogResult.OK){
				NewPatientAdded=true;
				SelectedPatNum=PatCur.PatNum;
				DialogResult=DialogResult.OK;
			}
		}
开发者ID:mnisl,项目名称:OD,代码行数:52,代码来源:FormPatientSelect.cs


注:本文中的OpenDentBusiness.Patient.Copy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。