Esempio n. 1
0
		///<summary>Converts the text for one plan into an object which will then be processed as needed.</summary>
		public static TrojanObject ProcessTextToObject(string text){
			string[] lines=text.Split(new string[] { "\r\n" },StringSplitOptions.RemoveEmptyEntries);
			string line;
			string[] fields;
			int percent;
			double amt;
			string rowVal;
			TrojanObject troj=new TrojanObject();
			troj.BenefitList=new List<Benefit>();
			troj.BenefitNotes="";
			bool usesAnnivers=false;
			Benefit ben;
			Benefit benCrownMajor=null;
			Benefit benCrownOnly=null;
      for(int i=0;i<lines.Length;i++){
				line=lines[i];
				fields=line.Split(new char[] {'\t'});
				if(fields.Length!=3){
					continue;
				}
				//remove any trailing or leading spaces:
				fields[0]=fields[0].Trim();
				fields[1]=fields[1].Trim();
				fields[2]=fields[2].Trim();
				rowVal=fields[2].Trim();
				if(fields[2]==""){
					continue;
				}
				else{//as long as there is data, add it to the notes
					if(troj.BenefitNotes!="") {
						troj.BenefitNotes+="\r\n";
					}
					troj.BenefitNotes+=fields[1]+": "+fields[2];
					if(fields.Length==4) {
						troj.BenefitNotes+=" "+fields[3];
					}
				}
				switch(fields[0]){
					//default://for all rows that are not handled below
					case "TROJANID":
						troj.TROJANID=fields[2];
						break;
					case "ENAME":
						troj.ENAME=fields[2];
						break;
					case "PLANDESC":
						troj.PLANDESC=fields[2];
						break;
					case "ELIGPHONE":
						troj.ELIGPHONE=fields[2];
						break;
					case "POLICYNO":
						troj.POLICYNO=fields[2];
						break;
					case "ECLAIMS":
						if(fields[2]=="YES") {//accepts eclaims
							troj.ECLAIMS=true;
						}
						else {
							troj.ECLAIMS=false;
						}
						break;
					case "PAYERID":
						troj.PAYERID=fields[2];
						break;
					case "MAILTO":
						troj.MAILTO=fields[2];
						break;
					case "MAILTOST":
						troj.MAILTOST=fields[2];
						break;
					case "MAILCITYONLY":
						troj.MAILCITYONLY=fields[2];
						break;
					case "MAILSTATEONLY":
						troj.MAILSTATEONLY=fields[2];
						break;
					case "MAILZIPONLY":
						troj.MAILZIPONLY=fields[2];
						break;
					case "PLANMAX"://eg $3000 per person per year
						if(!fields[2].StartsWith("$"))
							break;
						fields[2]=fields[2].Remove(0,1);
						fields[2]=fields[2].Split(new char[] { ' ' })[0];
						if(CovCatC.ListShort.Count>0) {
							ben=new Benefit();
							ben.BenefitType=InsBenefitType.Limitations;
							ben.CovCatNum=CovCats.GetForEbenCat(EbenefitCategory.General).CovCatNum;
							ben.MonetaryAmt=PIn.Double(fields[2]);
							ben.TimePeriod=BenefitTimePeriod.CalendarYear;
							ben.CoverageLevel=BenefitCoverageLevel.Individual;
							troj.BenefitList.Add(ben.Copy());
						}
						break;
					case "PLANYR"://eg Calendar year or Anniversary year
						if(fields[2]!="Calendar year") {
							usesAnnivers=true;
							//MessageBox.Show("Warning.  Plan uses Anniversary year rather than Calendar year.  Please verify the Plan Start Date.");
						}
						break;
					case "DEDUCT"://eg There is no deductible
						if(!fields[2].StartsWith("$")) {
							amt=0;
						}
						else {
							fields[2]=fields[2].Remove(0,1);
							fields[2]=fields[2].Split(new char[] { ' ' })[0];
							amt=PIn.Double(fields[2]);
						}
						ben=new Benefit();
						ben.BenefitType=InsBenefitType.Deductible;
						ben.CovCatNum=CovCats.GetForEbenCat(EbenefitCategory.General).CovCatNum;
						ben.TimePeriod=BenefitTimePeriod.CalendarYear;
						ben.MonetaryAmt=amt;
						ben.CoverageLevel=BenefitCoverageLevel.Individual;
						troj.BenefitList.Add(ben.Copy());
						ben=new Benefit();
						ben.BenefitType=InsBenefitType.Deductible;
						ben.CovCatNum=CovCats.GetForEbenCat(EbenefitCategory.Diagnostic).CovCatNum;
						ben.TimePeriod=BenefitTimePeriod.CalendarYear;
						ben.MonetaryAmt=0;//amt;
						ben.CoverageLevel=BenefitCoverageLevel.Individual;
						troj.BenefitList.Add(ben.Copy());
						ben=new Benefit();
						ben.BenefitType=InsBenefitType.Deductible;
						ben.CovCatNum=CovCats.GetForEbenCat(EbenefitCategory.RoutinePreventive).CovCatNum;
						ben.TimePeriod=BenefitTimePeriod.CalendarYear;
						ben.MonetaryAmt=0;//amt;
						ben.CoverageLevel=BenefitCoverageLevel.Individual;
						troj.BenefitList.Add(ben.Copy());
						break;
					case "PREV"://eg 100% or 'Incentive begins at 70%' or '80% Endo Major see notes'
						if(rowVal.ToLower()=="not covered") {
							percent=0;
						}
						else {
							percent=ConvertPercentToInt(rowVal);//remove %
						}
						if(percent<0 || percent>100) {
							break;
						}
						ben=new Benefit();
						ben.BenefitType=InsBenefitType.CoInsurance;
						ben.CovCatNum=CovCats.GetForEbenCat(EbenefitCategory.Diagnostic).CovCatNum;
						ben.Percent=percent;
						ben.TimePeriod=BenefitTimePeriod.CalendarYear;
						troj.BenefitList.Add(ben.Copy());
						ben=new Benefit();
						ben.BenefitType=InsBenefitType.CoInsurance;
						ben.CovCatNum=CovCats.GetForEbenCat(EbenefitCategory.RoutinePreventive).CovCatNum;
						ben.Percent=percent;
						ben.TimePeriod=BenefitTimePeriod.CalendarYear;
						troj.BenefitList.Add(ben.Copy());
						break;
					case "BASIC":
						if(rowVal.ToLower()=="not covered") {
							percent=0;
						}
						else {
							percent=ConvertPercentToInt(rowVal);//remove %
						}
						if(percent<0 || percent>100) {
							break;
						}
						ben=new Benefit();
						ben.BenefitType=InsBenefitType.CoInsurance;
						ben.CovCatNum=CovCats.GetForEbenCat(EbenefitCategory.Restorative).CovCatNum;
						ben.Percent=percent;
						ben.TimePeriod=BenefitTimePeriod.CalendarYear;
						troj.BenefitList.Add(ben.Copy());
						ben=new Benefit();
						ben.BenefitType=InsBenefitType.CoInsurance;
						ben.CovCatNum=CovCats.GetForEbenCat(EbenefitCategory.Endodontics).CovCatNum;
						ben.Percent=percent;
						ben.TimePeriod=BenefitTimePeriod.CalendarYear;
						troj.BenefitList.Add(ben.Copy());
						ben=new Benefit();
						ben.BenefitType=InsBenefitType.CoInsurance;
						ben.CovCatNum=CovCats.GetForEbenCat(EbenefitCategory.Periodontics).CovCatNum;
						ben.Percent=percent;
						ben.TimePeriod=BenefitTimePeriod.CalendarYear;
						troj.BenefitList.Add(ben.Copy());
						ben=new Benefit();
						ben.BenefitType=InsBenefitType.CoInsurance;
						ben.CovCatNum=CovCats.GetForEbenCat(EbenefitCategory.OralSurgery).CovCatNum;
						ben.Percent=percent;
						ben.TimePeriod=BenefitTimePeriod.CalendarYear;
						troj.BenefitList.Add(ben.Copy());
						break;
					case "MAJOR":
						if(rowVal.ToLower()=="not covered") {
							percent=0;
						}
						else {
							percent=ConvertPercentToInt(rowVal);//remove %
						}
						if(percent<0 || percent>100) {
							break;
						}
						ben=new Benefit();
						ben.BenefitType=InsBenefitType.CoInsurance;
						ben.CovCatNum=CovCats.GetForEbenCat(EbenefitCategory.Prosthodontics).CovCatNum;
						ben.Percent=percent;
						ben.TimePeriod=BenefitTimePeriod.CalendarYear;
						troj.BenefitList.Add(ben.Copy());
						benCrownMajor=new Benefit();
						benCrownMajor.BenefitType=InsBenefitType.CoInsurance;
						benCrownMajor.CovCatNum=CovCats.GetForEbenCat(EbenefitCategory.Crowns).CovCatNum;
						benCrownMajor.Percent=percent;
						benCrownMajor.TimePeriod=BenefitTimePeriod.CalendarYear;
						//troj.BenefitList.Add(ben.Copy());//later
						break;
					case "CROWNS"://Examples: Paid Major, or 80%.  We will only process percentages.
						if(rowVal.ToLower()=="not covered") {
							percent=0;
						}
						else {
							percent=ConvertPercentToInt(rowVal);//remove %
						}
						if(percent<0 || percent>100) {
							break;
						}
						benCrownOnly=new Benefit();
						benCrownOnly.BenefitType=InsBenefitType.CoInsurance;
						benCrownOnly.CovCatNum=CovCats.GetForEbenCat(EbenefitCategory.Crowns).CovCatNum;
						benCrownOnly.Percent=percent;
						benCrownOnly.TimePeriod=BenefitTimePeriod.CalendarYear;
						//troj.BenefitList.Add(ben.Copy());
						break;
					case "ORMAX"://eg $3500 lifetime
						if(!fields[2].StartsWith("$")) {
							break;
						}
						fields[2]=fields[2].Remove(0,1);
						fields[2]=fields[2].Split(new char[] { ' ' })[0];
						if(CovCatC.ListShort.Count>0) {
							ben=new Benefit();
							ben.BenefitType=InsBenefitType.Limitations;
							ben.CovCatNum=CovCats.GetForEbenCat(EbenefitCategory.Orthodontics).CovCatNum;
							ben.MonetaryAmt=PIn.Double(fields[2]);
							ben.TimePeriod=BenefitTimePeriod.CalendarYear;
							troj.BenefitList.Add(ben.Copy());
						}
						break;
					case "ORPCT":
						if(rowVal.ToLower()=="not covered") {
							percent=0;
						}
						else {
							percent=ConvertPercentToInt(rowVal);//remove %
						}
						if(percent<0 || percent>100) {
							break;
						}
						ben=new Benefit();
						ben.BenefitType=InsBenefitType.CoInsurance;
						ben.CovCatNum=CovCats.GetForEbenCat(EbenefitCategory.Orthodontics).CovCatNum;
						ben.Percent=percent;
						ben.TimePeriod=BenefitTimePeriod.CalendarYear;
						troj.BenefitList.Add(ben.Copy());
						break;
					/*case "FEE":
						if(!ProcedureCodes.IsValidCode(fields[1])) {
							break;//skip
						}
						if(textTrojanID.Text==""){
							break;
						}
						feeSchedNum=Fees.ImportTrojan(fields[1],PIn.PDouble(fields[3]),textTrojanID.Text);
						//the step above probably created a new feeschedule, requiring a reset of the three listboxes.
						resetFeeSched=true;
						break;*/
					case "NOTES"://typically multiple instances
						if(troj.PlanNote!=null && troj.PlanNote!="") {
							troj.PlanNote+="\r\n";
						}
						troj.PlanNote+=fields[2];
						break;
				}//switch
			}//for
			//Set crowns
			if(benCrownOnly!=null){
				troj.BenefitList.Add(benCrownOnly.Copy());
			}
			else if(benCrownMajor!=null){
				troj.BenefitList.Add(benCrownMajor.Copy());
			}
			//set calendar vs serviceyear
			if(usesAnnivers) {
				for(int i=0;i<troj.BenefitList.Count;i++) {
					troj.BenefitList[i].TimePeriod=BenefitTimePeriod.ServiceYear;
				}
			}
			return troj;
		}
Esempio n. 2
0
		private void butIapFind_Click(object sender,System.EventArgs e) {
			//If SubCur is null, this button is not visible to click.
			FormIap FormI=new FormIap();
			FormI.ShowDialog();
			if(FormI.DialogResult==DialogResult.Cancel) {
				return;
			}
			Benefit ben;
			//clear exising benefits from screen, not db:
			benefitList=new List<Benefit>();
			string plan=FormI.selectedPlan;
			string field=null;
			string[] splitField;//if a field is a sentence with more than one word, we can split it for analysis
			int percent;
			try {
				Iap.ReadRecord(plan);
				for(int i=1;i<122;i++) {
					field=Iap.ReadField(i);
					if(field==null){
						field="";
					}
					switch(i) {
						default:
							//do nothing
							break;
						case Iap.Employer:
							if(SubCur.BenefitNotes!="") {
								SubCur.BenefitNotes+="\r\n";
							}
							SubCur.BenefitNotes+="Employer: "+field;
							textEmployer.Text=field;
							break;
						case Iap.Phone:
							SubCur.BenefitNotes+="\r\n"+"Phone: "+field;
							break;
						case Iap.InsUnder:
							SubCur.BenefitNotes+="\r\n"+"InsUnder: "+field;
							break;
						case Iap.Carrier:
							SubCur.BenefitNotes+="\r\n"+"Carrier: "+field;
							textCarrier.Text=field;
							break;
						case Iap.CarrierPh:
							SubCur.BenefitNotes+="\r\n"+"CarrierPh: "+field;
							textPhone.Text=field;
							break;
						case Iap.Group://seems to be used as groupnum
							SubCur.BenefitNotes+="\r\n"+"Group: "+field;
							textGroupNum.Text=field;
							break;
						case Iap.MailTo://the carrier name again
							SubCur.BenefitNotes+="\r\n"+"MailTo: "+field;
							break;
						case Iap.MailTo2://address
							SubCur.BenefitNotes+="\r\n"+"MailTo2: "+field;
							textAddress.Text=field;
							break;
						case Iap.MailTo3://address2
							SubCur.BenefitNotes+="\r\n"+"MailTo3: "+field;
							textAddress2.Text=field;
							break;
						case Iap.EClaims:
							SubCur.BenefitNotes+="\r\n"+"EClaims: "+field;//this contains the PayorID at the end, but also a bunch of other drivel.
							int payorIDloc=field.LastIndexOf("Payor ID#:");
							if(payorIDloc!=-1 && field.Length>payorIDloc+10) {
								textElectID.Text=field.Substring(payorIDloc+10);
							}
							break;
						case Iap.FAXClaims:
							SubCur.BenefitNotes+="\r\n"+"FAXClaims: "+field;
							break;
						case Iap.DMOOption:
							SubCur.BenefitNotes+="\r\n"+"DMOOption: "+field;
							break;
						case Iap.Medical:
							SubCur.BenefitNotes+="\r\n"+"Medical: "+field;
							break;
						case Iap.GroupNum://not used.  They seem to use the group field instead
							SubCur.BenefitNotes+="\r\n"+"GroupNum: "+field;
							break;
						case Iap.Phone2://?
							SubCur.BenefitNotes+="\r\n"+"Phone2: "+field;
							break;
						case Iap.Deductible:
							SubCur.BenefitNotes+="\r\n"+"Deductible: "+field;
							if(field.StartsWith("$")) {
								splitField=field.Split(new char[] { ' ' });
								ben=new Benefit();
								ben.BenefitType=InsBenefitType.Deductible;
								ben.CovCatNum=CovCats.GetForEbenCat(EbenefitCategory.General).CovCatNum;
								ben.PlanNum=PlanCur.PlanNum;
								ben.TimePeriod=BenefitTimePeriod.CalendarYear;
								ben.MonetaryAmt=PIn.Double(splitField[0].Remove(0,1));//removes the $
								benefitList.Add(ben.Copy());
							}
							break;
						case Iap.FamilyDed:
							SubCur.BenefitNotes+="\r\n"+"FamilyDed: "+field;
							break;
						case Iap.Maximum:
							SubCur.BenefitNotes+="\r\n"+"Maximum: "+field;
							if(field.StartsWith("$")) {
								splitField=field.Split(new char[] { ' ' });
								ben=new Benefit();
								ben.BenefitType=InsBenefitType.Limitations;
								ben.CovCatNum=CovCats.GetForEbenCat(EbenefitCategory.General).CovCatNum;
								ben.PlanNum=PlanCur.PlanNum;
								ben.TimePeriod=BenefitTimePeriod.CalendarYear;
								ben.MonetaryAmt=PIn.Double(splitField[0].Remove(0,1));//removes the $
								benefitList.Add(ben.Copy());
							}
							break;
						case Iap.BenefitYear://text is too complex to parse
							SubCur.BenefitNotes+="\r\n"+"BenefitYear: "+field;
							break;
						case Iap.DependentAge://too complex to parse
							SubCur.BenefitNotes+="\r\n"+"DependentAge: "+field;
							break;
						case Iap.Preventive:
							SubCur.BenefitNotes+="\r\n"+"Preventive: "+field;
							splitField=field.Split(new char[] { ' ' });
							if(splitField.Length==0 || !splitField[0].EndsWith("%")) {
								break;
							}
							splitField[0]=splitField[0].Remove(splitField[0].Length-1,1);//remove %
							percent=PIn.Int(splitField[0]);
							if(percent<0 || percent>100) {
								break;
							}
							ben=new Benefit();
							ben.BenefitType=InsBenefitType.CoInsurance;
							ben.CovCatNum=CovCats.GetForEbenCat(EbenefitCategory.RoutinePreventive).CovCatNum;
							ben.PlanNum=PlanCur.PlanNum;
							ben.TimePeriod=BenefitTimePeriod.CalendarYear;
							ben.Percent=percent;
							benefitList.Add(ben.Copy());
							break;
						case Iap.Basic:
							SubCur.BenefitNotes+="\r\n"+"Basic: "+field;
							splitField=field.Split(new char[] { ' ' });
							if(splitField.Length==0 || !splitField[0].EndsWith("%")) {
								break;
							}
							splitField[0]=splitField[0].Remove(splitField[0].Length-1,1);//remove %
							percent=PIn.Int(splitField[0]);
							if(percent<0 || percent>100) {
								break;
							}
							ben=new Benefit();
							ben.BenefitType=InsBenefitType.CoInsurance;
							ben.CovCatNum=CovCats.GetForEbenCat(EbenefitCategory.Restorative).CovCatNum;
							ben.PlanNum=PlanCur.PlanNum;
							ben.TimePeriod=BenefitTimePeriod.CalendarYear;
							ben.Percent=percent;
							benefitList.Add(ben.Copy());
							ben=new Benefit();
							ben.BenefitType=InsBenefitType.CoInsurance;
							ben.CovCatNum=CovCats.GetForEbenCat(EbenefitCategory.Endodontics).CovCatNum;
							ben.PlanNum=PlanCur.PlanNum;
							ben.TimePeriod=BenefitTimePeriod.CalendarYear;
							ben.Percent=percent;
							benefitList.Add(ben.Copy());
							ben=new Benefit();
							ben.BenefitType=InsBenefitType.CoInsurance;
							ben.CovCatNum=CovCats.GetForEbenCat(EbenefitCategory.Periodontics).CovCatNum;
							ben.PlanNum=PlanCur.PlanNum;
							ben.TimePeriod=BenefitTimePeriod.CalendarYear;
							ben.Percent=percent;
							benefitList.Add(ben.Copy());
							ben=new Benefit();
							ben.BenefitType=InsBenefitType.CoInsurance;
							ben.CovCatNum=CovCats.GetForEbenCat(EbenefitCategory.OralSurgery).CovCatNum;
							ben.PlanNum=PlanCur.PlanNum;
							ben.TimePeriod=BenefitTimePeriod.CalendarYear;
							ben.Percent=percent;
							benefitList.Add(ben.Copy());
							break;
						case Iap.Major:
							SubCur.BenefitNotes+="\r\n"+"Major: "+field;
							splitField=field.Split(new char[] { ' ' });
							if(splitField.Length==0 || !splitField[0].EndsWith("%")) {
								break;
							}
							splitField[0]=splitField[0].Remove(splitField[0].Length-1,1);//remove %
							percent=PIn.Int(splitField[0]);
							if(percent<0 || percent>100) {
								break;
							}
							ben=new Benefit();
							ben.BenefitType=InsBenefitType.CoInsurance;
							ben.CovCatNum=CovCats.GetForEbenCat(EbenefitCategory.Prosthodontics).CovCatNum;//includes crowns?
							ben.PlanNum=PlanCur.PlanNum;
							ben.TimePeriod=BenefitTimePeriod.CalendarYear;
							ben.Percent=percent;
							benefitList.Add(ben.Copy());
							break;
						case Iap.InitialPlacement:
							SubCur.BenefitNotes+="\r\n"+"InitialPlacement: "+field;
							break;
						case Iap.ExtractionClause:
							SubCur.BenefitNotes+="\r\n"+"ExtractionClause: "+field;
							break;
						case Iap.Replacement:
							SubCur.BenefitNotes+="\r\n"+"Replacement: "+field;
							break;
						case Iap.Other:
							SubCur.BenefitNotes+="\r\n"+"Other: "+field;
							break;
						case Iap.Orthodontics:
							SubCur.BenefitNotes+="\r\n"+"Orthodontics: "+field;
							splitField=field.Split(new char[] { ' ' });
							if(splitField.Length==0 || !splitField[0].EndsWith("%")) {
								break;
							}
							splitField[0]=splitField[0].Remove(splitField[0].Length-1,1);//remove %
							percent=PIn.Int(splitField[0]);
							if(percent<0 || percent>100) {
								break;
							}
							ben=new Benefit();
							ben.BenefitType=InsBenefitType.CoInsurance;
							ben.CovCatNum=CovCats.GetForEbenCat(EbenefitCategory.Orthodontics).CovCatNum;
							ben.PlanNum=PlanCur.PlanNum;
							ben.TimePeriod=BenefitTimePeriod.CalendarYear;
							ben.Percent=percent;
							benefitList.Add(ben.Copy());
							break;
						case Iap.Deductible2:
							SubCur.BenefitNotes+="\r\n"+"Deductible2: "+field;
							break;
						case Iap.Maximum2://ortho Max
							SubCur.BenefitNotes+="\r\n"+"Maximum2: "+field;
							if(field.StartsWith("$")) {
								splitField=field.Split(new char[] { ' ' });
								ben=new Benefit();
								ben.BenefitType=InsBenefitType.Limitations;
								ben.CovCatNum=CovCats.GetForEbenCat(EbenefitCategory.Orthodontics).CovCatNum;
								ben.PlanNum=PlanCur.PlanNum;
								ben.TimePeriod=BenefitTimePeriod.CalendarYear;
								ben.MonetaryAmt=PIn.Double(splitField[0].Remove(0,1));//removes the $
								benefitList.Add(ben.Copy());
							}
							break;
						case Iap.PymtSchedule:
							SubCur.BenefitNotes+="\r\n"+"PymtSchedule: "+field;
							break;
						case Iap.AgeLimit:
							SubCur.BenefitNotes+="\r\n"+"AgeLimit: "+field;
							break;
						case Iap.SignatureonFile:
							SubCur.BenefitNotes+="\r\n"+"SignatureonFile: "+field;
							break;
						case Iap.StandardADAForm:
							SubCur.BenefitNotes+="\r\n"+"StandardADAForm: "+field;
							break;
						case Iap.CoordinationRule:
							SubCur.BenefitNotes+="\r\n"+"CoordinationRule: "+field;
							break;
						case Iap.CoordinationCOB:
							SubCur.BenefitNotes+="\r\n"+"CoordinationCOB: "+field;
							break;
						case Iap.NightguardsforBruxism:
							SubCur.BenefitNotes+="\r\n"+"NightguardsforBruxism: "+field;
							break;
						case Iap.OcclusalAdjustments:
							SubCur.BenefitNotes+="\r\n"+"OcclusalAdjustments: "+field;
							break;
						case Iap.XXXXXX:
							SubCur.BenefitNotes+="\r\n"+"XXXXXX: "+field;
							break;
						case Iap.TMJNonSurgical:
							SubCur.BenefitNotes+="\r\n"+"TMJNonSurgical: "+field;
							break;
						case Iap.Implants:
							SubCur.BenefitNotes+="\r\n"+"Implants: "+field;
							break;
						case Iap.InfectionControl:
							SubCur.BenefitNotes+="\r\n"+"InfectionControl: "+field;
							break;
						case Iap.Cleanings:
							SubCur.BenefitNotes+="\r\n"+"Cleanings: "+field;
							break;
						case Iap.OralEvaluation:
							SubCur.BenefitNotes+="\r\n"+"OralEvaluation: "+field;
							break;
						case Iap.Fluoride1200s:
							SubCur.BenefitNotes+="\r\n"+"Fluoride1200s: "+field;
							break;
						case Iap.Code0220:
							SubCur.BenefitNotes+="\r\n"+"Code0220: "+field;
							break;
						case Iap.Code0272_0274:
							SubCur.BenefitNotes+="\r\n"+"Code0272_0274: "+field;
							break;
						case Iap.Code0210:
							SubCur.BenefitNotes+="\r\n"+"Code0210: "+field;
							break;
						case Iap.Code0330:
							SubCur.BenefitNotes+="\r\n"+"Code0330: "+field;
							break;
						case Iap.SpaceMaintainers:
							SubCur.BenefitNotes+="\r\n"+"SpaceMaintainers: "+field;
							break;
						case Iap.EmergencyExams:
							SubCur.BenefitNotes+="\r\n"+"EmergencyExams: "+field;
							break;
						case Iap.EmergencyTreatment:
							SubCur.BenefitNotes+="\r\n"+"EmergencyTreatment: "+field;
							break;
						case Iap.Sealants1351:
							SubCur.BenefitNotes+="\r\n"+"Sealants1351: "+field;
							break;
						case Iap.Fillings2100:
							SubCur.BenefitNotes+="\r\n"+"Fillings2100: "+field;
							break;
						case Iap.Extractions:
							SubCur.BenefitNotes+="\r\n"+"Extractions: "+field;
							break;
						case Iap.RootCanals:
							SubCur.BenefitNotes+="\r\n"+"RootCanals: "+field;
							break;
						case Iap.MolarRootCanal:
							SubCur.BenefitNotes+="\r\n"+"MolarRootCanal: "+field;
							break;
						case Iap.OralSurgery:
							SubCur.BenefitNotes+="\r\n"+"OralSurgery: "+field;
							break;
						case Iap.ImpactionSoftTissue:
							SubCur.BenefitNotes+="\r\n"+"ImpactionSoftTissue: "+field;
							break;
						case Iap.ImpactionPartialBony:
							SubCur.BenefitNotes+="\r\n"+"ImpactionPartialBony: "+field;
							break;
						case Iap.ImpactionCompleteBony:
							SubCur.BenefitNotes+="\r\n"+"ImpactionCompleteBony: "+field;
							break;
						case Iap.SurgicalProceduresGeneral:
							SubCur.BenefitNotes+="\r\n"+"SurgicalProceduresGeneral: "+field;
							break;
						case Iap.PerioSurgicalPerioOsseous:
							SubCur.BenefitNotes+="\r\n"+"PerioSurgicalPerioOsseous: "+field;
							break;
						case Iap.SurgicalPerioOther:
							SubCur.BenefitNotes+="\r\n"+"SurgicalPerioOther: "+field;
							break;
						case Iap.RootPlaning:
							SubCur.BenefitNotes+="\r\n"+"RootPlaning: "+field;
							break;
						case Iap.Scaling4345:
							SubCur.BenefitNotes+="\r\n"+"Scaling4345: "+field;
							break;
						case Iap.PerioPx:
							SubCur.BenefitNotes+="\r\n"+"PerioPx: "+field;
							break;
						case Iap.PerioComment:
							SubCur.BenefitNotes+="\r\n"+"PerioComment: "+field;
							break;
						case Iap.IVSedation:
							SubCur.BenefitNotes+="\r\n"+"IVSedation: "+field;
							break;
						case Iap.General9220:
							SubCur.BenefitNotes+="\r\n"+"General9220: "+field;
							break;
						case Iap.Relines5700s:
							SubCur.BenefitNotes+="\r\n"+"Relines5700s: "+field;
							break;
						case Iap.StainlessSteelCrowns:
							SubCur.BenefitNotes+="\r\n"+"StainlessSteelCrowns: "+field;
							break;
						case Iap.Crowns2700s:
							SubCur.BenefitNotes+="\r\n"+"Crowns2700s: "+field;
							break;
						case Iap.Bridges6200:
							SubCur.BenefitNotes+="\r\n"+"Bridges6200: "+field;
							break;
						case Iap.Partials5200s:
							SubCur.BenefitNotes+="\r\n"+"Partials5200s: "+field;
							break;
						case Iap.Dentures5100s:
							SubCur.BenefitNotes+="\r\n"+"Dentures5100s: "+field;
							break;
						case Iap.EmpNumberXXX:
							SubCur.BenefitNotes+="\r\n"+"EmpNumberXXX: "+field;
							break;
						case Iap.DateXXX:
							SubCur.BenefitNotes+="\r\n"+"DateXXX: "+field;
							break;
						case Iap.Line4://city state
							SubCur.BenefitNotes+="\r\n"+"Line4: "+field;
							field=field.Replace("  "," ");//get rid of double space before zip
							splitField=field.Split(new char[] { ' ' });
							if(splitField.Length<3) {
								break;
							}
							textCity.Text=splitField[0].Replace(",","");//gets rid of the comma on the end of city
							textState.Text=splitField[1];
							textZip.Text=splitField[2];
							break;
						case Iap.Note:
							SubCur.BenefitNotes+="\r\n"+"Note: "+field;
							break;
						case Iap.Plan://?
							SubCur.BenefitNotes+="\r\n"+"Plan: "+field;
							break;
						case Iap.BuildUps:
							SubCur.BenefitNotes+="\r\n"+"BuildUps: "+field;
							break;
						case Iap.PosteriorComposites:
							SubCur.BenefitNotes+="\r\n"+"PosteriorComposites: "+field;
							break;
					}
				}
				Iap.CloseDatabase();
				butBenefitNotes.Enabled=true;
			}
			catch(ApplicationException ex) {
				Iap.CloseDatabase();
				MessageBox.Show(ex.Message);
			}
			catch(Exception ex) {
				Iap.CloseDatabase();
				MessageBox.Show("Error: "+ex.Message);
			}
			FillBenefits();
		}