///<summary>Inserts this claimform into database and retrieves the new primary key.</summary> public static long Insert(ClaimForm cf) { if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) { cf.ClaimFormNum=Meth.GetLong(MethodBase.GetCurrentMethod(),cf); return cf.ClaimFormNum; } return Crud.ClaimFormCrud.Insert(cf); }
///<summary>Returns a copy of the claimform including the Items. Only used in FormClaimForms.butCopy_Click.</summary> public ClaimForm Copy() { ClaimForm cf = (ClaimForm)this.MemberwiseClone(); cf.Items = (ClaimFormItem[])Items.Clone(); return(cf); }
///<summary></summary> public static void Update(ClaimForm cf){ if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(),cf); return; } Crud.ClaimFormCrud.Update(cf); }
///<summary>Updates all claimforms with this unique id including all attached items.</summary> public static void UpdateByUniqueID(ClaimForm cf) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(), cf); return; } //first get a list of the ClaimFormNums with this UniqueId string command = "SELECT ClaimFormNum FROM claimform WHERE UniqueID ='" + cf.UniqueID.ToString() + "'"; DataTable table = Db.GetTable(command); long[] claimFormNums = new long[table.Rows.Count]; for (int i = 0; i < table.Rows.Count; i++) { claimFormNums[i] = PIn.Long(table.Rows[i][0].ToString()); } //loop through each matching claimform for (int i = 0; i < claimFormNums.Length; i++) { cf.ClaimFormNum = claimFormNums[i]; Update(cf); command = "DELETE FROM claimformitem " + "WHERE ClaimFormNum = '" + POut.Long(claimFormNums[i]) + "'"; Db.NonQ(command); for (int j = 0; j < cf.Items.Length; j++) { cf.Items[j].ClaimFormNum = claimFormNums[i]; ClaimFormItems.Insert(cf.Items[j]); } } }
///<summary> Called when cancelling out of creating a new claimform, and from the claimform window when clicking delete. Returns true if successful or false if dependencies found.</summary> public static bool Delete(ClaimForm cf) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { return(Meth.GetBool(MethodBase.GetCurrentMethod(), cf)); } //first, do dependency testing string command = "SELECT * FROM insplan WHERE claimformnum = '" + cf.ClaimFormNum.ToString() + "' "; command += DbHelper.LimitAnd(1); DataTable table = Db.GetTable(command); if (table.Rows.Count == 1) { return(false); } //Then, delete the claimform command = "DELETE FROM claimform " + "WHERE ClaimFormNum = '" + POut.Long(cf.ClaimFormNum) + "'"; Db.NonQ(command); command = "DELETE FROM claimformitem " + "WHERE ClaimFormNum = '" + POut.Long(cf.ClaimFormNum) + "'"; Db.NonQ(command); return(true); }
///<summary>Can be called externally as part of the conversion sequence. Surround with try catch. ///Returns the claimform object from the xml file or xml data passed in that can then be inserted if needed. ///If xmlData is provided then path will be ignored. If xmlData is not provided, a valid path is required.</summary> public static ClaimForm DeserializeClaimForm(string path, string xmlData) { //No need to check RemotingRole; no call to db. ClaimForm tempClaimForm = new ClaimForm(); XmlSerializer serializer = new XmlSerializer(typeof(ClaimForm)); if (xmlData == "") //use path { if (!File.Exists(path)) { throw new ApplicationException(Lans.g("FormClaimForm", "File does not exist.")); } try { using (TextReader reader = new StreamReader(path)) { tempClaimForm = (ClaimForm)serializer.Deserialize(reader); } } catch { throw new ApplicationException(Lans.g("FormClaimForm", "Invalid file format")); } } else //use xmlData { try { using (TextReader reader = new StringReader(xmlData)) { tempClaimForm = (ClaimForm)serializer.Deserialize(reader); } } catch { throw new ApplicationException(Lans.g("FormClaimForm", "Invalid file format")); } } return(tempClaimForm); }
///<summary></summary> public static void Update(ClaimForm cf) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(), cf); return; } Crud.ClaimFormCrud.Update(cf); }
///<summary>Inserts this claimform into database and retrieves the new primary key.</summary> public static long Insert(ClaimForm cf) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { cf.ClaimFormNum = Meth.GetLong(MethodBase.GetCurrentMethod(), cf); return(cf.ClaimFormNum); } return(Crud.ClaimFormCrud.Insert(cf)); }
///<summary>Returns a copy of the claimform including the Items.</summary> public ClaimForm Copy() { ClaimForm cf = (ClaimForm)this.MemberwiseClone(); List <ClaimFormItem> claimFormItemCopies = new List <ClaimFormItem>(); for (int i = 0; i < cf.Items.Count; i++) { claimFormItemCopies.Add(cf.Items[i].Copy()); } cf.Items = claimFormItemCopies; return(cf); }
///<summary></summary> public static void Update(ClaimForm cf) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(), cf); return; } //Synch the claim form items associated to this claim form first. ClaimFormItems.DeleteAllForClaimForm(cf.ClaimFormNum); foreach (ClaimFormItem item in cf.Items) { ClaimFormItems.Insert(item); } //Now we can update any information specific to the claim form itself. Crud.ClaimFormCrud.Update(cf); }
///<summary>Returns a copy of the claimform including the Items. Only used in FormClaimForms.butCopy_Click.</summary> public ClaimForm Copy() { ClaimForm cf = new ClaimForm(); cf.ClaimFormNum = ClaimFormNum; cf.Description = Description; cf.IsHidden = IsHidden; cf.FontName = FontName; cf.FontSize = FontSize; cf.UniqueID = UniqueID; cf.PrintImages = PrintImages; cf.OffsetX = OffsetX; cf.OffsetY = OffsetY; cf.Items = (ClaimFormItem[])Items.Clone(); //Items.CopyTo(cf.Items,0); return(cf); }
///<summary>Inserts this claimform into database and retrieves the new primary key. ///Assigns all claimformitems to the claimform and inserts them if the bool is true.</summary> public static long Insert(ClaimForm cf, bool includeClaimFormItems) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { return(Meth.GetLong(MethodBase.GetCurrentMethod(), cf, includeClaimFormItems)); } long retVal = Crud.ClaimFormCrud.Insert(cf); if (includeClaimFormItems) { foreach (ClaimFormItem claimFormItemCur in cf.Items) { claimFormItemCur.ClaimFormNum = cf.ClaimFormNum; //so even though the ClaimFormNum is wrong, this line fixes it. ClaimFormItems.Insert(claimFormItemCur); } } return(retVal); }
///<summary>Returns a list of all internal claims within the OpenDentBusiness resources. Throws exceptions.</summary> public static List <ClaimForm> GetInternalClaims() { //No need to check RemotingRole; no call to db. List <ClaimForm> listInternalClaimForms = new List <ClaimForm>(); ResourceSet resources = OpenDentBusiness.Properties.Resources.ResourceManager.GetResourceSet(CultureInfo.CurrentUICulture, true, true); foreach (DictionaryEntry item in resources) { if (!item.Key.ToString().StartsWith("ClaimForm")) { continue; } //Resources that start with ClaimForm are serialized ClaimForm objects in XML. ClaimForm cfCur = ClaimForms.DeserializeClaimForm("", item.Value.ToString()); cfCur.IsInternal = true; listInternalClaimForms.Add(cfCur); } return(listInternalClaimForms); }
///<summary> Called when cancelling out of creating a new claimform, and from the claimform window when clicking delete. Returns true if successful or false if dependencies found.</summary> public static bool Delete(ClaimForm cf){ if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) { return Meth.GetBool(MethodBase.GetCurrentMethod(),cf); } //first, do dependency testing string command="SELECT * FROM insplan WHERE claimformnum = '" +cf.ClaimFormNum.ToString()+"' "; command+=DbHelper.LimitAnd(1); DataTable table=Db.GetTable(command); if(table.Rows.Count==1){ return false; } //Then, delete the claimform command="DELETE FROM claimform " +"WHERE ClaimFormNum = '"+POut.Long(cf.ClaimFormNum)+"'"; Db.NonQ(command); command="DELETE FROM claimformitem " +"WHERE ClaimFormNum = '"+POut.Long(cf.ClaimFormNum)+"'"; Db.NonQ(command); return true; }
//steven's change ///<summary>Only called from external forms without ever loading this form. Prints without showing any print preview. Returns true if printed successfully. Make sure to call PrinterL.SetPrinter() before calling this method so that a printer name is set for when printing batch claims.</summary> public bool PrintImmediate(PrinterSettings ps, PrintController pc = null) { if(PrintBlank) { //Get the default claim form for the practice. ClaimFormCur=ClaimForms.GetClaimForm(PrefC.GetLong(PrefName.DefaultClaimForm)); if(ClaimFormCur==null) {//Could happen if printing a blank form and no default claim form is set. MsgBox.Show(this,"No default claim form set. Set a default in Setup | Family / Insurance | Claim Forms."); return false; } } pd2=new PrintDocument(); pd2.PrinterSettings=ps; if (pc != null) pd2.PrintController = pc; //Test use //pd2.PrintController = new System.Windows.Forms.PrintControllerWithStatusDialog(new XPSPrinterController(PrintSituation.Claim, this.PatNumCur)); // pagesPrinted=0; pd2.OriginAtMargins=true; pd2.DefaultPageSettings.Margins=new Margins(0,0,0,0); if(pd2.DefaultPageSettings.PrintableArea.Width==0 || pd2.DefaultPageSettings.PrintableArea.Height<400) {//some printers report page size of 0. //prevents bug in some printers that do not specify paper size pd2.DefaultPageSettings.PaperSize=new PaperSize("default",850,1100); } pd2.PrintPage+=new PrintPageEventHandler(this.pd2_PrintPage); try{ pd2.Print(); } catch(Exception ex){ MessageBox.Show(ex.Message);//Lan.g("Printer","Printer not available")); return false; } return true; }
private void butAdd_Click(object sender, System.EventArgs e) { ClaimForm ClaimFormCur=new ClaimForm(); ClaimForms.Insert(ClaimFormCur); FormClaimFormEdit FormCFE=new FormClaimFormEdit(); FormCFE.ClaimFormCur=ClaimFormCur; FormCFE.IsNew=true; FormCFE.ShowDialog(); if(FormCFE.DialogResult!=DialogResult.OK){ return; } changed=true; //ClaimFormItems refreshed within FormCFE FillList(); }
///<summary>Can be called externally as part of the conversion sequence. Surround with try catch. Always returns the ClaimFormNum of the claimform. If using xmlData, path will be ignored, so leave it blank.</summary> public static long ImportForm(string path,bool isUpdateSequence,string xmlData) { ClaimForm tempClaimForm=new ClaimForm(); XmlSerializer serializer=new XmlSerializer(typeof(ClaimForm)); if(xmlData==""){//use path if(!File.Exists(path)) { throw new ApplicationException(Lan.g("FormClaimForm","File does not exist.")); } try { using(TextReader reader=new StreamReader(path)) { tempClaimForm=(ClaimForm)serializer.Deserialize(reader); } } catch { throw new ApplicationException(Lan.g("FormClaimForm","Invalid file format")); } } else{//use xmlData try { using(TextReader reader=new StringReader(xmlData)) { tempClaimForm=(ClaimForm)serializer.Deserialize(reader); } } catch { throw new ApplicationException(Lan.g("FormClaimForm","Invalid file format")); } } long retVal=0; bool isNew=true; if(isUpdateSequence){ ClaimFormItems.RefreshCache(); ClaimForms.RefreshCache(); } if(tempClaimForm.UniqueID!=""){//if it's blank, it's always inserted. for(int i=0;i<ClaimForms.ListLong.Length;i++){ if(ClaimForms.ListLong[i].UniqueID==tempClaimForm.UniqueID){ isNew=false; retVal=ClaimForms.ListLong[i].ClaimFormNum; } } } if(isNew){ ClaimForms.Insert(tempClaimForm);//now we have a primary key. retVal=tempClaimForm.ClaimFormNum; for(int j=0;j<tempClaimForm.Items.Length;j++){ tempClaimForm.Items[j].ClaimFormNum=tempClaimForm.ClaimFormNum;//so even though the ClaimFormNum is wrong, this line fixes it. ClaimFormItems.Insert(tempClaimForm.Items[j]); } } else{ if(!isUpdateSequence){ if(MessageBox.Show(tempClaimForm.Description+" already exists. Replace?","", MessageBoxButtons.OKCancel)!=DialogResult.OK) { return 0; } } ClaimForms.UpdateByUniqueID(tempClaimForm); } return retVal; }
///<summary>Gets all necessary info from db based on ThisPatNum and ThisClaimNum. Then fills displayStrings with the actual text that will display on claim. The isRenaissance flag is very temporary.</summary> private void FillDisplayStrings(bool isRenaissance){ if(PrintBlank){ if(CultureInfo.CurrentCulture.Name.EndsWith("CA")) {//Canadian. en-CA or fr-CA ClaimFormCur=ClaimForms.GetClaimFormByUniqueId("OD6");//CDA claim form } else { //Assume USA ClaimFormCur=ClaimForms.GetClaimFormByUniqueId("OD8");//ADA claim form } //ClaimFormItems.GetListForForm(ClaimFormCur.ClaimFormNum); displayStrings=new string[ClaimFormCur.Items.Length]; ListClaimProcs=new List<ClaimProc>(); return; } Family FamCur=Patients.GetFamily(PatNumCur); Patient PatCur=FamCur.GetPatient(PatNumCur); List<Claim> ClaimList=Claims.Refresh(PatCur.PatNum); ClaimCur=Claims.GetFromList(ClaimList,ClaimNumCur); //((Claim)Claims.HList[ThisClaimNum]).Clone(); ListInsSub2=InsSubs.RefreshForFam(FamCur); ListInsPlan=InsPlans.RefreshForSubList(ListInsSub2); ListPatPlans=PatPlans.Refresh(ClaimCur.PatNum); InsPlan otherPlan=InsPlans.GetPlan(ClaimCur.PlanNum2,ListInsPlan); InsSub otherSub=InsSubs.GetSub(ClaimCur.InsSubNum2,ListInsSub2); if(otherPlan==null){ otherPlan=new InsPlan();//easier than leaving it null } Carrier otherCarrier=new Carrier(); if(otherPlan.PlanNum!=0){ otherCarrier=Carriers.GetCarrier(otherPlan.CarrierNum); } //Employers.GetEmployer(otherPlan.EmployerNum); //Employer otherEmployer=Employers.Cur;//not actually used //then get the main plan subCur=InsSubs.GetSub(ClaimCur.InsSubNum,ListInsSub2); planCur=InsPlans.GetPlan(ClaimCur.PlanNum,ListInsPlan); Clinic clinic=Clinics.GetClinic(ClaimCur.ClinicNum); carrier=Carriers.GetCarrier(planCur.CarrierNum); //Employers.GetEmployer(InsPlans.Cur.EmployerNum); Patient subsc; if(FamCur.GetIndex(subCur.Subscriber)==-1) {//from another family subsc=Patients.GetPat(subCur.Subscriber); //Patients.Cur; //Patients.GetFamily(ThisPatNum);//return to current family } else{ subsc=FamCur.ListPats[FamCur.GetIndex(subCur.Subscriber)]; } Patient otherSubsc=new Patient(); if(otherPlan.PlanNum!=0){//if secondary insurance exists if(FamCur.GetIndex(otherSub.Subscriber)==-1) {//from another family otherSubsc=Patients.GetPat(otherSub.Subscriber); //Patients.Cur; //Patients.GetFamily(ThisPatNum);//return to current family } else{ otherSubsc=FamCur.ListPats[FamCur.GetIndex(otherSub.Subscriber)]; } } if(ClaimCur.ReferringProv>0){ ClaimReferral=Referrals.GetReferral(ClaimCur.ReferringProv); } ListProc=Procedures.Refresh(PatCur.PatNum); List<ToothInitial> initialList=ToothInitials.Refresh(PatCur.PatNum); //List<ClaimProc> ClaimProcList=ClaimProcs.Refresh(PatCur.PatNum); ClaimProcsForPat=ClaimProcs.Refresh(ClaimCur.PatNum); ClaimProcsForClaim=ClaimProcs.RefreshForClaim(ClaimCur.ClaimNum); ListClaimProcs=new List<ClaimProc>(); bool includeThis; Procedure proc; for(int i=0;i<ClaimProcsForClaim.Count;i++){//fill the arraylist if(ClaimProcsForClaim[i].ProcNum==0){ continue;//skip payments } if(CultureInfo.CurrentCulture.Name.EndsWith("CA")) {//Canadian. en-CA or fr-CA proc=Procedures.GetProcFromList(ListProc,ClaimProcsForClaim[i].ProcNum); if(proc.ProcNumLab!=0) { //This is a lab fee procedure. continue;//skip lab fee procedures in Canada, because they will show up on the same line as the procedure that they are attached to. } } includeThis=true; for(int j=0;j<ListClaimProcs.Count;j++){//loop through existing claimprocs if(ListClaimProcs[j].ProcNum==ClaimProcsForClaim[i].ProcNum){ includeThis=false;//skip duplicate procedures } } if(includeThis){ ListClaimProcs.Add(ClaimProcsForClaim[i]); } } List<string> missingTeeth=ToothInitials.GetMissingOrHiddenTeeth(initialList); ProcedureCode procCode; for(int j=missingTeeth.Count-1;j>=0;j--) {//loop backwards to keep index accurate as items are removed //if the missing tooth is missing because of an extraction being billed here, then exclude it for(int p=0;p<ListClaimProcs.Count;p++) { proc=Procedures.GetProcFromList(ListProc,ListClaimProcs[p].ProcNum); procCode=ProcedureCodes.GetProcCode(proc.CodeNum); if(procCode.PaintType==ToothPaintingType.Extraction && proc.ToothNum==missingTeeth[j]) { missingTeeth.RemoveAt(j); break; } } } //diagnoses--------------------------------------------------------------------------------------- diagnoses=new string[4]; for(int i=0;i<4;i++){ diagnoses[i]=""; } for(int i=0;i<ListClaimProcs.Count;i++){ proc=Procedures.GetProcFromList(ListProc,ListClaimProcs[i].ProcNum); if(proc.DiagnosticCode==""){ continue; } for(int d=0;d<4;d++){ if(diagnoses[d]==proc.DiagnosticCode){ break;//if it's already been added } if(diagnoses[d]==""){//we're at the end of the list of existing diagnoses, and no match diagnoses[d]=proc.DiagnosticCode;//so add it. break; } } //There's still a chance that the diagnosis didn't get added, if there were more than 4. } Provider treatDent=ProviderC.ListLong[Providers.GetIndexLong(ClaimCur.ProvTreat)]; if(ClaimFormCur==null){ if(ClaimCur.ClaimForm>0){ ClaimFormCur=ClaimForms.GetClaimForm(ClaimCur.ClaimForm); } else { ClaimFormCur=ClaimForms.GetClaimForm(planCur.ClaimFormNum); } } List<PatPlan> patPlans=null; displayStrings=new string[ClaimFormCur.Items.Length]; //a value is set for every item, but not every case will have a matching claimform item. for(int i=0;i<ClaimFormCur.Items.Length;i++){ if(ClaimFormCur.Items[i]==null){//Renaissance does not use [0] displayStrings[i]=""; continue; } switch(ClaimFormCur.Items[i].FieldName){ default://image. or procedure which gets filled in FillProcStrings. displayStrings[i]=""; break; case "FixedText": displayStrings[i]=ClaimFormCur.Items[i].FormatString; break; case "IsPreAuth": if(ClaimCur.ClaimType=="PreAuth") { displayStrings[i]="X"; } break; case "IsStandardClaim": if(ClaimCur.ClaimType!="PreAuth") { displayStrings[i]="X"; } break; case "ShowPreauthorizationIfPreauth": if(ClaimCur.ClaimType=="PreAuth") { displayStrings[i]="Preauthorization"; } break; case "IsMedicaidClaim"://this should later be replaced with an insplan field. if(PatCur.MedicaidID!="") { displayStrings[i]="X"; } break; case "IsGroupHealthPlan": string eclaimcode=InsFilingCodes.GetEclaimCode(planCur.FilingCode); if(PatCur.MedicaidID=="" && eclaimcode != "MC"//medicaid && eclaimcode != "CH"//champus && eclaimcode != "VA")//veterans //&& eclaimcode != ""//medicare? { displayStrings[i]="X"; } break; case "PreAuthString": displayStrings[i]=ClaimCur.PreAuthString; break; case "PriorAuthString": displayStrings[i]=ClaimCur.PriorAuthorizationNumber; break; case "PriInsCarrierName": displayStrings[i]=carrier.CarrierName; break; case "PriInsAddress": displayStrings[i]=carrier.Address; break; case "PriInsAddress2": displayStrings[i]=carrier.Address2; break; case "PriInsAddressComplete": displayStrings[i]=carrier.Address+" "+carrier.Address2; break; case "PriInsCity": displayStrings[i]=carrier.City; break; case "PriInsST": displayStrings[i]=carrier.State; break; case "PriInsZip": displayStrings[i]=carrier.Zip; break; case "OtherInsExists": if(otherPlan.PlanNum!=0) { displayStrings[i]="X"; } break; case "OtherInsNotExists": if(otherPlan.PlanNum==0) { displayStrings[i]="X"; } break; case "OtherInsExistsDent": if(otherPlan.PlanNum!=0) { if(!otherPlan.IsMedical) { displayStrings[i]="X"; } } break; case "OtherInsExistsMed": if(otherPlan.PlanNum!=0) { if(otherPlan.IsMedical) { displayStrings[i]="X"; } } break; case "OtherInsSubscrLastFirst": if(otherPlan.PlanNum!=0) { displayStrings[i]=otherSubsc.LName+", "+otherSubsc.FName+" "+otherSubsc.MiddleI; } break; case "OtherInsSubscrDOB": if(otherPlan.PlanNum!=0) { if(ClaimFormCur.Items[i].FormatString=="") { displayStrings[i]=otherSubsc.Birthdate.ToShortDateString(); } else { displayStrings[i]=otherSubsc.Birthdate.ToString(ClaimFormCur.Items[i].FormatString); } } break; case "OtherInsSubscrIsMale": if(otherPlan.PlanNum!=0 && otherSubsc.Gender==PatientGender.Male) { displayStrings[i]="X"; } break; case "OtherInsSubscrIsFemale": if(otherPlan.PlanNum!=0 && otherSubsc.Gender==PatientGender.Female) { displayStrings[i]="X"; } break; case "OtherInsSubscrID": if(otherPlan.PlanNum!=0) { displayStrings[i]=otherSub.SubscriberID; } break; //if(otherPlan.PlanNum!=0 && otherSubsc.SSN.Length==9){ // displayStrings[i]=otherSubsc.SSN.Substring(0,3) // +"-"+otherSubsc.SSN.Substring(3,2) // +"-"+otherSubsc.SSN.Substring(5); //} //break; case "OtherInsGroupNum": if(otherPlan.PlanNum!=0) { displayStrings[i]=otherPlan.GroupNum; } break; case "OtherInsRelatIsSelf": if(otherPlan.PlanNum!=0 && ClaimCur.PatRelat2==Relat.Self) { displayStrings[i]="X"; } break; case "OtherInsRelatIsSpouse": if(otherPlan.PlanNum!=0 && ClaimCur.PatRelat2==Relat.Spouse) { displayStrings[i]="X"; } break; case "OtherInsRelatIsChild": if(otherPlan.PlanNum!=0 && ClaimCur.PatRelat2==Relat.Child) { displayStrings[i]="X"; } break; case "OtherInsRelatIsOther": if(otherPlan.PlanNum!=0 && ( ClaimCur.PatRelat2==Relat.Dependent || ClaimCur.PatRelat2==Relat.Employee || ClaimCur.PatRelat2==Relat.HandicapDep || ClaimCur.PatRelat2==Relat.InjuredPlaintiff || ClaimCur.PatRelat2==Relat.LifePartner || ClaimCur.PatRelat2==Relat.SignifOther )) displayStrings[i]="X"; break; case "OtherInsCarrierName": if(otherPlan.PlanNum!=0) { displayStrings[i]=otherCarrier.CarrierName; } break; case "OtherInsAddress": if(otherPlan.PlanNum!=0) { displayStrings[i]=otherCarrier.Address; } break; case "OtherInsCity": if(otherPlan.PlanNum!=0) { displayStrings[i]=otherCarrier.City; } break; case "OtherInsST": if(otherPlan.PlanNum!=0) { displayStrings[i]=otherCarrier.State; } break; case "OtherInsZip": if(otherPlan.PlanNum!=0) { displayStrings[i]=otherCarrier.Zip; } break; case "SubscrLastFirst": displayStrings[i]=subsc.LName+", "+subsc.FName+" "+subsc.MiddleI; break; case "SubscrAddress": displayStrings[i]=subsc.Address; break; case "SubscrAddress2": displayStrings[i]=subsc.Address2; break; case "SubscrAddressComplete": displayStrings[i]=subsc.Address+" "+subsc.Address2; break; case "SubscrCity": displayStrings[i]=subsc.City; break; case "SubscrST": displayStrings[i]=subsc.State; break; case "SubscrZip": displayStrings[i]=subsc.Zip; break; case "SubscrPhone"://needs work. Only used for 1500 if(isRenaissance) { //Expecting (XXX)XXX-XXXX displayStrings[i]=subsc.HmPhone; if(subsc.HmPhone.Length>14) {//Might have a note following the number. displayStrings[i]=subsc.HmPhone.Substring(0,14); } } else { string phone=subsc.HmPhone.Replace("(",""); phone=phone.Replace(")"," "); phone=phone.Replace("-"," "); displayStrings[i]=phone; } break; case "SubscrDOB": if(ClaimFormCur.Items[i].FormatString=="") { displayStrings[i]=subsc.Birthdate.ToShortDateString();//MM/dd/yyyy } else { displayStrings[i]=subsc.Birthdate.ToString(ClaimFormCur.Items[i].FormatString); } break; case "SubscrIsMale": if(subsc.Gender==PatientGender.Male) { displayStrings[i]="X"; } break; case "SubscrIsFemale": if(subsc.Gender==PatientGender.Female) { displayStrings[i]="X"; } break; case "SubscrGender": if(subsc.Gender==PatientGender.Male) { displayStrings[i]="M"; } else { displayStrings[i]="F"; } break; case "SubscrIsMarried": if(subsc.Position==PatientPosition.Married) { displayStrings[i]="X"; } break; case "SubscrIsSingle": if(subsc.Position==PatientPosition.Single || subsc.Position==PatientPosition.Child || subsc.Position==PatientPosition.Widowed) { displayStrings[i]="X"; } break; case "SubscrID": patPlans=PatPlans.Refresh(PatNumCur); string patID=PatPlans.GetPatID(subCur.InsSubNum,patPlans); if(patID=="") { displayStrings[i]=subCur.SubscriberID; } else { displayStrings[i]=patID; } break; case "SubscrIDStrict": displayStrings[i]=subCur.SubscriberID; break; case "SubscrIsFTStudent": if(subsc.StudentStatus=="F") { displayStrings[i]="X"; } break; case "SubscrIsPTStudent": if(subsc.StudentStatus=="P") { displayStrings[i]="X"; } break; case "GroupName": displayStrings[i]=planCur.GroupName; break; case "GroupNum": displayStrings[i]=planCur.GroupNum; break; case "DivisionNo": displayStrings[i]=planCur.DivisionNo; break; case "EmployerName": displayStrings[i]=Employers.GetEmployer(planCur.EmployerNum).EmpName;; break; case "RelatIsSelf": if(ClaimCur.PatRelat==Relat.Self) { displayStrings[i]="X"; } break; case "RelatIsSpouse": if(ClaimCur.PatRelat==Relat.Spouse) { displayStrings[i]="X"; } break; case "RelatIsChild": if(ClaimCur.PatRelat==Relat.Child) { displayStrings[i]="X"; } break; case "RelatIsOther": if(ClaimCur.PatRelat==Relat.Dependent || ClaimCur.PatRelat==Relat.Employee || ClaimCur.PatRelat==Relat.HandicapDep || ClaimCur.PatRelat==Relat.InjuredPlaintiff || ClaimCur.PatRelat==Relat.LifePartner || ClaimCur.PatRelat==Relat.SignifOther) { displayStrings[i]="X"; } break; case "Relationship": if(CultureInfo.CurrentCulture.Name.EndsWith("CA")) {//Canadian. en-CA or fr-CA if(ClaimCur.PatRelat==Relat.Self) { displayStrings[i]="Self"; } else if(ClaimCur.PatRelat==Relat.Spouse) { displayStrings[i]="Spouse"; } else if(ClaimCur.PatRelat==Relat.Child) { displayStrings[i]="Child"; } else if(ClaimCur.PatRelat==Relat.SignifOther || ClaimCur.PatRelat==Relat.LifePartner) { displayStrings[i]="Common Law Spouse"; } else { displayStrings[i]="Other"; } } else { displayStrings[i]=ClaimCur.PatRelat.ToString(); } break; case "IsFTStudent": if(PatCur.StudentStatus=="F") { displayStrings[i]="X"; } break; case "IsPTStudent": if(PatCur.StudentStatus=="P") { displayStrings[i]="X"; } break; case "IsStudent": if(PatCur.StudentStatus=="P" || PatCur.StudentStatus=="F") { displayStrings[i]="X"; } break; case "CollegeName": displayStrings[i]=PatCur.SchoolName; break; case "PatientLastFirst": displayStrings[i]=PatCur.LName+", "+PatCur.FName+" "+PatCur.MiddleI; break; case "PatientFirstMiddleLast": displayStrings[i]=PatCur.FName+" "+PatCur.MiddleI+" "+PatCur.LName; break; case "PatientFirstName": displayStrings[i] = PatCur.FName; break; case "PatientMiddleName": displayStrings[i] = PatCur.MiddleI; break; case "PatientLastName": displayStrings[i] = PatCur.LName; break; case "PatientAddress": displayStrings[i]=PatCur.Address; break; case "PatientAddress2": displayStrings[i]=PatCur.Address2; break; case "PatientAddressComplete": displayStrings[i]=PatCur.Address+" "+PatCur.Address2; break; case "PatientCity": displayStrings[i]=PatCur.City; break; case "PatientST": displayStrings[i]=PatCur.State; break; case "PatientZip": displayStrings[i]=PatCur.Zip; break; case "PatientPhone"://needs work. Only used for 1500 if(isRenaissance) { //Expecting (XXX)XXX-XXXX displayStrings[i]=PatCur.HmPhone; if(PatCur.HmPhone.Length>14) {//Might have a note following the number. displayStrings[i]=PatCur.HmPhone.Substring(0,14); } } else { string phonep=PatCur.HmPhone.Replace("(",""); phonep=phonep.Replace(")"," "); phonep=phonep.Replace("-"," "); displayStrings[i]=phonep; } break; case "PatientDOB": if(ClaimFormCur.Items[i].FormatString=="") { displayStrings[i]=PatCur.Birthdate.ToShortDateString();//MM/dd/yyyy } else { displayStrings[i]=PatCur.Birthdate.ToString (ClaimFormCur.Items[i].FormatString); } break; case "PatientIsMale": if(PatCur.Gender==PatientGender.Male) { displayStrings[i]="X"; } break; case "PatientIsFemale": if(PatCur.Gender==PatientGender.Female) { displayStrings[i]="X"; } break; case "PatientGender": if(PatCur.Gender==PatientGender.Male) { displayStrings[i]="Male"; } else if(PatCur.Gender==PatientGender.Female) { displayStrings[i]="Female"; } break; case "PatientGenderLetter": if(subsc.Gender==PatientGender.Male) { displayStrings[i]="M"; } else { displayStrings[i]="F"; } break; case "PatientIsMarried": if(PatCur.Position==PatientPosition.Married) { displayStrings[i]="X"; } break; case "PatientIsSingle": if(PatCur.Position==PatientPosition.Single || PatCur.Position==PatientPosition.Child || PatCur.Position==PatientPosition.Widowed) { displayStrings[i]="X"; } break; case "PatIDFromPatPlan": //Dependant Code for Canada patPlans=PatPlans.Refresh(PatNumCur); if(CultureInfo.CurrentCulture.Name.EndsWith("CA")) {//Canadian. en-CA or fr-CA if(carrier.ElectID=="000064") { //Pacific Blue Cross (PBC) displayStrings[i]=subCur.SubscriberID+"-"+PatPlans.GetPatID(subCur.InsSubNum,patPlans); } } else { displayStrings[i]=PatPlans.GetPatID(subCur.InsSubNum,patPlans); } break; case "PatientSSN": if(PatCur.SSN.Length==9) { displayStrings[i]=PatCur.SSN.Substring(0,3) +"-"+PatCur.SSN.Substring(3,2) +"-"+PatCur.SSN.Substring(5); } else { displayStrings[i]=PatCur.SSN; } break; case "PatientMedicaidID": displayStrings[i]=PatCur.MedicaidID; break; case "PatientID-MedicaidOrSSN": if(PatCur.MedicaidID!="") { displayStrings[i]=PatCur.MedicaidID; } else { displayStrings[i]=PatCur.SSN; } break; case "PatientChartNum": displayStrings[i]=PatCur.ChartNumber; break; case "PatientPatNum": displayStrings[i]=PatCur.PatNum.ToString(); break; case "Diagnosis1": if(ClaimFormCur.Items[i].FormatString=="") { displayStrings[i]=diagnoses[0]; } else if(ClaimFormCur.Items[i].FormatString=="NoDec") { displayStrings[i]=diagnoses[0].Replace(".",""); } break; case "Diagnosis2": if(ClaimFormCur.Items[i].FormatString=="") { displayStrings[i]=diagnoses[1]; } else if(ClaimFormCur.Items[i].FormatString=="NoDec") { displayStrings[i]=diagnoses[1].Replace(".",""); } break; case "Diagnosis3": if(ClaimFormCur.Items[i].FormatString=="") { displayStrings[i]=diagnoses[2]; } else if(ClaimFormCur.Items[i].FormatString=="NoDec") { displayStrings[i]=diagnoses[2].Replace(".",""); } break; case "Diagnosis4": if(ClaimFormCur.Items[i].FormatString=="") { displayStrings[i]=diagnoses[3]; } else if(ClaimFormCur.Items[i].FormatString=="NoDec") { displayStrings[i]=diagnoses[3].Replace(".",""); } break; //this is where the procedures used to be case "Miss1": if(missingTeeth.Contains("1")) { displayStrings[i]="X"; } break; case "Miss2": if(missingTeeth.Contains("2")) { displayStrings[i]="X"; } break; case "Miss3": if(missingTeeth.Contains("3")) { displayStrings[i]="X"; } break; case "Miss4": if(missingTeeth.Contains("4")) { displayStrings[i]="X"; } break; case "Miss5": if(missingTeeth.Contains("5")) { displayStrings[i]="X"; } break; case "Miss6": if(missingTeeth.Contains("6")) { displayStrings[i]="X"; } break; case "Miss7": if(missingTeeth.Contains("7")) { displayStrings[i]="X"; } break; case "Miss8": if(missingTeeth.Contains("8")) { displayStrings[i]="X"; } break; case "Miss9": if(missingTeeth.Contains("9")) { displayStrings[i]="X"; } break; case "Miss10": if(missingTeeth.Contains("10")) { displayStrings[i]="X"; } break; case "Miss11": if(missingTeeth.Contains("11")) { displayStrings[i]="X"; } break; case "Miss12": if(missingTeeth.Contains("12")) { displayStrings[i]="X"; } break; case "Miss13": if(missingTeeth.Contains("13")) { displayStrings[i]="X"; } break; case "Miss14": if(missingTeeth.Contains("14")) { displayStrings[i]="X"; } break; case "Miss15": if(missingTeeth.Contains("15")) { displayStrings[i]="X"; } break; case "Miss16": if(missingTeeth.Contains("16")) { displayStrings[i]="X"; } break; case "Miss17": if(missingTeeth.Contains("17")) { displayStrings[i]="X"; } break; case "Miss18": if(missingTeeth.Contains("18")) { displayStrings[i]="X"; } break; case "Miss19": if(missingTeeth.Contains("19")) { displayStrings[i]="X"; } break; case "Miss20": if(missingTeeth.Contains("20")) { displayStrings[i]="X"; } break; case "Miss21": if(missingTeeth.Contains("21")) { displayStrings[i]="X"; } break; case "Miss22": if(missingTeeth.Contains("22")) { displayStrings[i]="X"; } break; case "Miss23": if(missingTeeth.Contains("23")) { displayStrings[i]="X"; } break; case "Miss24": if(missingTeeth.Contains("24")) { displayStrings[i]="X"; } break; case "Miss25": if(missingTeeth.Contains("25")) { displayStrings[i]="X"; } break; case "Miss26": if(missingTeeth.Contains("26")) { displayStrings[i]="X"; } break; case "Miss27": if(missingTeeth.Contains("27")) { displayStrings[i]="X"; } break; case "Miss28": if(missingTeeth.Contains("28")) { displayStrings[i]="X"; } break; case "Miss29": if(missingTeeth.Contains("29")) { displayStrings[i]="X"; } break; case "Miss30": if(missingTeeth.Contains("30")) { displayStrings[i]="X"; } break; case "Miss31": if(missingTeeth.Contains("31")) { displayStrings[i]="X"; } break; case "Miss32": if(missingTeeth.Contains("32")) { displayStrings[i]="X"; } break; case "Remarks": displayStrings[i]=""; if(CultureInfo.CurrentCulture.Name.EndsWith("CA")) {//Canadian. en-CA or fr-CA if(carrier.ElectID=="000064") { //Pacific Blue Cross (PBC) if(ClaimCur.ClaimType=="PreAuth") { displayStrings[i]+="Predetermination only."+Environment.NewLine; } else { if(subCur.AssignBen) { displayStrings[i]+="Please pay provider."+Environment.NewLine; } else { displayStrings[i]+="Please pay patient."+Environment.NewLine; } } } } if(ClaimCur.AttachmentID!="" && !ClaimCur.ClaimNote.StartsWith(ClaimCur.AttachmentID)){ displayStrings[i]=ClaimCur.AttachmentID+" "; } displayStrings[i]+=ClaimCur.ClaimNote; break; case "PatientRelease": if(subCur.ReleaseInfo) { displayStrings[i]="Signature on File"; } break; case "PatientReleaseDate": if(subCur.ReleaseInfo && ClaimCur.DateSent.Year > 1860) { if(ClaimFormCur.Items[i].FormatString=="") { displayStrings[i]=ClaimCur.DateSent.ToShortDateString(); } else { displayStrings[i]=ClaimCur.DateSent.ToString(ClaimFormCur.Items[i].FormatString); } } break; case "PatientAssignment": if(subCur.AssignBen) { displayStrings[i]="Signature on File"; } break; case "PatientAssignmentDate": if(subCur.AssignBen && ClaimCur.DateSent.Year > 1860) { if(ClaimFormCur.Items[i].FormatString=="") { displayStrings[i]=ClaimCur.DateSent.ToShortDateString(); } else { displayStrings[i]=ClaimCur.DateSent.ToString(ClaimFormCur.Items[i].FormatString); } } break; case "PlaceIsOffice": if(ClaimCur.PlaceService==PlaceOfService.Office) { displayStrings[i]="X"; } break; case "PlaceIsHospADA2002": if(ClaimCur.PlaceService==PlaceOfService.InpatHospital || ClaimCur.PlaceService==PlaceOfService.OutpatHospital) { displayStrings[i]="X"; } break; case "PlaceIsExtCareFacilityADA2002": if(ClaimCur.PlaceService==PlaceOfService.CustodialCareFacility || ClaimCur.PlaceService==PlaceOfService.SkilledNursFac) { displayStrings[i]="X"; } break; case "PlaceIsOtherADA2002": if(ClaimCur.PlaceService==PlaceOfService.PatientsHome || ClaimCur.PlaceService==PlaceOfService.OtherLocation) { displayStrings[i]="X"; } break; case "PlaceIsInpatHosp": if(ClaimCur.PlaceService==PlaceOfService.InpatHospital) { displayStrings[i]="X"; } break; case "PlaceIsOutpatHosp": if(ClaimCur.PlaceService==PlaceOfService.OutpatHospital) { displayStrings[i]="X"; } break; case "PlaceIsAdultLivCareFac": if(ClaimCur.PlaceService==PlaceOfService.CustodialCareFacility) { displayStrings[i]="X"; } break; case "PlaceIsSkilledNursFac": if(ClaimCur.PlaceService==PlaceOfService.SkilledNursFac) { displayStrings[i]="X"; } break; case "PlaceIsPatientsHome": if(ClaimCur.PlaceService==PlaceOfService.PatientsHome) { displayStrings[i]="X"; } break; case "PlaceIsOtherLocation": if(ClaimCur.PlaceService==PlaceOfService.OtherLocation) { displayStrings[i]="X"; } break; case "PlaceNumericCode": displayStrings[i]=GetPlaceOfServiceNum(ClaimCur.PlaceService); break; case "IsRadiographsAttached": if(ClaimCur.Radiographs>0) { displayStrings[i]="X"; } break; case "RadiographsNumAttached": displayStrings[i]=ClaimCur.Radiographs.ToString(); break; case "RadiographsNotAttached": if(ClaimCur.Radiographs==0) { displayStrings[i]="X"; } break; case "IsEnclosuresAttached": if(ClaimCur.Radiographs>0 || ClaimCur.AttachedImages>0 || ClaimCur.AttachedModels>0) { displayStrings[i]="X"; } break; case "AttachedImagesNum": displayStrings[i]=ClaimCur.AttachedImages.ToString(); break; case "AttachedModelsNum": displayStrings[i]=ClaimCur.AttachedModels.ToString(); break; case "IsNotOrtho": if(!ClaimCur.IsOrtho) { displayStrings[i]="X"; } break; case "IsOrtho": if(ClaimCur.IsOrtho) { displayStrings[i]="X"; } break; case "DateOrthoPlaced": if(ClaimCur.OrthoDate.Year > 1880){ if(ClaimFormCur.Items[i].FormatString=="") { displayStrings[i]=ClaimCur.OrthoDate.ToShortDateString(); } else { displayStrings[i]=ClaimCur.OrthoDate.ToString(ClaimFormCur.Items[i].FormatString); } } break; case "MonthsOrthoRemaining": if(ClaimCur.OrthoRemainM > 0) { displayStrings[i]=ClaimCur.OrthoRemainM.ToString(); } break; case "IsNotProsth": if(ClaimCur.IsProsthesis=="N") { displayStrings[i]="X"; } break; case "IsInitialProsth": if(ClaimCur.IsProsthesis=="I") { displayStrings[i]="X"; } break; case "IsNotReplacementProsth": if(ClaimCur.IsProsthesis!="R") {//=='I'nitial or 'N'o displayStrings[i]="X"; } break; case "IsReplacementProsth": if(ClaimCur.IsProsthesis=="R") { displayStrings[i]="X"; } break; case "DatePriorProsthPlaced": if(ClaimCur.PriorDate.Year > 1860){ if(ClaimFormCur.Items[i].FormatString=="") { displayStrings[i]=ClaimCur.PriorDate.ToShortDateString(); } else { displayStrings[i]=ClaimCur.PriorDate.ToString(ClaimFormCur.Items[i].FormatString); } } break; case "IsOccupational": if(ClaimCur.AccidentRelated=="E") { displayStrings[i]="X"; } break; case "IsNotOccupational": if(ClaimCur.AccidentRelated!="E") { displayStrings[i]="X"; } break; case "IsAutoAccident": if(ClaimCur.AccidentRelated=="A") { displayStrings[i]="X"; } break; case "IsNotAutoAccident": if(ClaimCur.AccidentRelated!="A") { displayStrings[i]="X"; } break; case "IsOtherAccident": if(ClaimCur.AccidentRelated=="O") { displayStrings[i]="X"; } break; case "IsNotOtherAccident": if(ClaimCur.AccidentRelated!="O") { displayStrings[i]="X"; } break; case "IsNotAccident": if(ClaimCur.AccidentRelated!="O" && ClaimCur.AccidentRelated!="A") { displayStrings[i]="X"; } break; case "IsAccident": if(ClaimCur.AccidentRelated!="") { displayStrings[i]="X"; } break; case "AccidentDate": if(ClaimCur.AccidentDate.Year > 1860){ if(ClaimFormCur.Items[i].FormatString=="") { displayStrings[i]=ClaimCur.AccidentDate.ToShortDateString(); } else { displayStrings[i]=ClaimCur.AccidentDate.ToString(ClaimFormCur.Items[i].FormatString); } } break; case "AccidentST": displayStrings[i]=ClaimCur.AccidentST; break; case "BillingDentist": Provider P=ProviderC.ListLong[Providers.GetIndexLong(ClaimCur.ProvBill)]; displayStrings[i]=P.FName+" "+P.MI+" "+P.LName+" "+P.Suffix; break; //case "BillingDentistAddress": // if(PrefC.GetBool(PrefName.UseBillingAddressOnClaims)){ // displayStrings[i]=PrefC.GetString(PrefName.PracticeBillingAddress); // } // else if(clinic==null) { // displayStrings[i]=PrefC.GetString(PrefName.PracticeAddress); // } // else { // displayStrings[i]=clinic.Address; // } // break; //case "BillingDentistAddress2": // if(PrefC.GetBool(PrefName.UseBillingAddressOnClaims)) { // displayStrings[i]=PrefC.GetString(PrefName.PracticeBillingAddress2); // } // else if(clinic==null) { // displayStrings[i]=PrefC.GetString(PrefName.PracticeAddress2); // } // else { // displayStrings[i]=clinic.Address2; // } // break; //case "BillingDentistCity": // if(PrefC.GetBool(PrefName.UseBillingAddressOnClaims)) { // displayStrings[i]=PrefC.GetString(PrefName.PracticeBillingCity); // } // else if(clinic==null) { // displayStrings[i]=PrefC.GetString(PrefName.PracticeCity); // } // else { // displayStrings[i]=clinic.City; // } // break; //case "BillingDentistST": // if(PrefC.GetBool(PrefName.UseBillingAddressOnClaims)) { // displayStrings[i]=PrefC.GetString(PrefName.PracticeBillingST); // } // else if(clinic==null) { // displayStrings[i]=PrefC.GetString(PrefName.PracticeST); // } // else { // displayStrings[i]=clinic.State; // } // break; //case "BillingDentistZip": // if(PrefC.GetBool(PrefName.UseBillingAddressOnClaims)) { // displayStrings[i]=PrefC.GetString(PrefName.PracticeBillingZip); // } // else if(clinic==null) { // displayStrings[i]=PrefC.GetString(PrefName.PracticeZip); // } // else { // displayStrings[i]=clinic.Zip; // } // break; case "BillingDentistMedicaidID": displayStrings[i]=ProviderC.ListLong[Providers.GetIndexLong(ClaimCur.ProvBill)].MedicaidID; break; case "BillingDentistProviderID": ProviderIdent[] provIdents=ProviderIdents.GetForPayor(ClaimCur.ProvBill,carrier.ElectID); if(provIdents.Length>0){ displayStrings[i]=provIdents[0].IDNumber;//just use the first one we find } break; case "BillingDentistNPI": displayStrings[i]=ProviderC.ListLong[Providers.GetIndexLong(ClaimCur.ProvBill)].NationalProvID; if(CultureInfo.CurrentCulture.Name.EndsWith("CA") && //Canadian. en-CA or fr-CA carrier.ElectID=="000064" && //Pacific Blue Cross (PBC) ProviderC.ListLong[Providers.GetIndexLong(ClaimCur.ProvBill)].NationalProvID!= ProviderC.ListLong[Providers.GetIndexLong(ClaimCur.ProvTreat)].NationalProvID && //Billing and treating providers are different displayStrings[i].Length==9) { //Only for provider numbers which have been entered correctly (to prevent and indexing exception). displayStrings[i]="00"+displayStrings[i].Substring(2,5)+"00"; } break; case "BillingDentistLicenseNum": displayStrings[i]=ProviderC.ListLong[Providers.GetIndexLong(ClaimCur.ProvBill)].StateLicense; break; case "BillingDentistSSNorTIN": displayStrings[i]=ProviderC.ListLong[Providers.GetIndexLong(ClaimCur.ProvBill)].SSN; break; case "BillingDentistNumIsSSN": if(!ProviderC.ListLong[Providers.GetIndexLong(ClaimCur.ProvBill)].UsingTIN) { displayStrings[i]="X"; } break; case "BillingDentistNumIsTIN": if(ProviderC.ListLong[Providers.GetIndexLong(ClaimCur.ProvBill)].UsingTIN) { displayStrings[i]="X"; } break; case "BillingDentistPh123": if(clinic==null){ if(PrefC.GetString(PrefName.PracticePhone).Length==10){ displayStrings[i]=PrefC.GetString(PrefName.PracticePhone).Substring(0,3); } } else{ if(clinic.Phone.Length==10){ displayStrings[i]=clinic.Phone.Substring(0,3); } } break; case "BillingDentistPh456": if(clinic==null){ if(PrefC.GetString(PrefName.PracticePhone).Length==10){ displayStrings[i]=PrefC.GetString(PrefName.PracticePhone).Substring(3,3); } } else{ if(clinic.Phone.Length==10){ displayStrings[i]=clinic.Phone.Substring(3,3); } } break; case "BillingDentistPh78910": if(clinic==null){ if(PrefC.GetString(PrefName.PracticePhone).Length==10){ displayStrings[i]=PrefC.GetString(PrefName.PracticePhone).Substring(6); } } else{ if(clinic.Phone.Length==10){ displayStrings[i]=clinic.Phone.Substring(6); } } break; case "BillingDentistPhoneFormatted": if(clinic==null){ if(PrefC.GetString(PrefName.PracticePhone).Length==10){ displayStrings[i]="("+PrefC.GetString(PrefName.PracticePhone).Substring(0,3) +")"+PrefC.GetString(PrefName.PracticePhone).Substring(3,3) +"-"+PrefC.GetString(PrefName.PracticePhone).Substring(6); } } else{ if(clinic.Phone.Length==10){ displayStrings[i]="("+clinic.Phone.Substring(0,3) +")"+clinic.Phone.Substring(3,3) +"-"+clinic.Phone.Substring(6); } } break; case "BillingDentistPhoneRaw": if(clinic==null) { displayStrings[i]=PrefC.GetString(PrefName.PracticePhone); } else { displayStrings[i]=clinic.Phone; } break; case "PayToDentistAddress": //Behaves just like the old BillingDentistAddress field, but is overridden by the Pay-To address if the Pay-To address has been specified. if(PrefC.GetString(PrefName.PracticePayToAddress)!="") { //All Pay-To address fields are used in 5010 eclaims when Pay-To address line 1 is not blank. displayStrings[i]=PrefC.GetString(PrefName.PracticePayToAddress); } else if(PrefC.GetBool(PrefName.UseBillingAddressOnClaims)){ displayStrings[i]=PrefC.GetString(PrefName.PracticeBillingAddress); } else if(clinic==null) { displayStrings[i]=PrefC.GetString(PrefName.PracticeAddress); } else { displayStrings[i]=clinic.Address; } break; case "PayToDentistAddress2": //Behaves just like the old BillingDentistAddress2 field, but is overridden by the Pay-To address if the Pay-To address has been specified. if(PrefC.GetString(PrefName.PracticePayToAddress)!="") { //All Pay-To address fields are used in 5010 eclaims when Pay-To address line 1 is not blank. displayStrings[i]=PrefC.GetString(PrefName.PracticePayToAddress2); } else if(PrefC.GetBool(PrefName.UseBillingAddressOnClaims)){ displayStrings[i]=PrefC.GetString(PrefName.PracticeBillingAddress2); } else if(clinic==null) { displayStrings[i]=PrefC.GetString(PrefName.PracticeAddress2); } else { displayStrings[i]=clinic.Address2; } break; case "PayToDentistCity": //Behaves just like the old BillingDentistCity field, but is overridden by the Pay-To address if the Pay-To address has been specified. if(PrefC.GetString(PrefName.PracticePayToAddress)!="") { //All Pay-To address fields are used in 5010 eclaims when Pay-To address line 1 is not blank. displayStrings[i]=PrefC.GetString(PrefName.PracticePayToCity); } else if(PrefC.GetBool(PrefName.UseBillingAddressOnClaims)) { displayStrings[i]=PrefC.GetString(PrefName.PracticeBillingCity); } else if(clinic==null) { displayStrings[i]=PrefC.GetString(PrefName.PracticeCity); } else { displayStrings[i]=clinic.City; } break; case "PayToDentistST": //Behaves just like the old BillingDentistST field, but is overridden by the Pay-To address if the Pay-To address has been specified. if(PrefC.GetString(PrefName.PracticePayToAddress)!="") { //All Pay-To address fields are used in 5010 eclaims when Pay-To address line 1 is not blank. displayStrings[i]=PrefC.GetString(PrefName.PracticePayToST); } else if(PrefC.GetBool(PrefName.UseBillingAddressOnClaims)) { displayStrings[i]=PrefC.GetString(PrefName.PracticeBillingST); } else if(clinic==null) { displayStrings[i]=PrefC.GetString(PrefName.PracticeST); } else { displayStrings[i]=clinic.State; } break; case "PayToDentistZip": //Behaves just like the old BillingDentistZip field, but is overridden by the Pay-To address if the Pay-To address has been specified. if(PrefC.GetString(PrefName.PracticePayToAddress)!="") { //All Pay-To address fields are used in 5010 eclaims when Pay-To address line 1 is not blank. displayStrings[i]=PrefC.GetString(PrefName.PracticePayToZip); } else if(PrefC.GetBool(PrefName.UseBillingAddressOnClaims)) { displayStrings[i]=PrefC.GetString(PrefName.PracticeBillingZip); } else if(clinic==null) { displayStrings[i]=PrefC.GetString(PrefName.PracticeZip); } else { displayStrings[i]=clinic.Zip; } break; case "TreatingDentistFName": displayStrings[i]=treatDent.FName; break; case "TreatingDentistLName": displayStrings[i]=treatDent.LName; break; case "TreatingDentistSignature": if(treatDent.SigOnFile){ if(PrefC.GetBool(PrefName.ClaimFormTreatDentSaysSigOnFile)){ displayStrings[i]="Signature on File"; } else{ displayStrings[i]=treatDent.FName+" "+treatDent.MI+" "+treatDent.LName+" "+treatDent.Suffix; } } break; case "TreatingDentistSigDate": if(treatDent.SigOnFile && ClaimCur.DateSent.Year > 1860){ if(ClaimFormCur.Items[i].FormatString=="") { displayStrings[i]=ClaimCur.DateSent.ToShortDateString(); } else { displayStrings[i]=ClaimCur.DateSent.ToString(ClaimFormCur.Items[i].FormatString); } } break; case "TreatingDentistMedicaidID": displayStrings[i]=treatDent.MedicaidID; break; case "TreatingDentistProviderID": provIdents=ProviderIdents.GetForPayor(ClaimCur.ProvTreat,carrier.ElectID); if(provIdents.Length>0) { displayStrings[i]=provIdents[0].IDNumber;//just use the first one we find } break; case "TreatingDentistNPI": displayStrings[i]=treatDent.NationalProvID; break; case "TreatingDentistLicense": displayStrings[i]=treatDent.StateLicense; break; case "TreatingDentistAddress": if(clinic==null) { displayStrings[i]=PrefC.GetString(PrefName.PracticeAddress); } else { displayStrings[i]=clinic.Address; } break; case "TreatingDentistCity": if(clinic==null) { displayStrings[i]=PrefC.GetString(PrefName.PracticeCity); } else { displayStrings[i]=clinic.City; } break; case "TreatingDentistST": if(clinic==null) { displayStrings[i]=PrefC.GetString(PrefName.PracticeST); } else { displayStrings[i]=clinic.State; } break; case "TreatingDentistZip": if(clinic==null) { displayStrings[i]=PrefC.GetString(PrefName.PracticeZip); } else { displayStrings[i]=clinic.Zip; } break; case "TreatingDentistPh123": if(clinic==null){ if(PrefC.GetString(PrefName.PracticePhone).Length==10){ displayStrings[i]=PrefC.GetString(PrefName.PracticePhone).Substring(0,3); } } else{ if(clinic.Phone.Length==10){ displayStrings[i]=clinic.Phone.Substring(0,3); } } break; case "TreatingDentistPh456": if(clinic==null){ if(PrefC.GetString(PrefName.PracticePhone).Length==10){ displayStrings[i]=PrefC.GetString(PrefName.PracticePhone).Substring(3,3); } } else{ if(clinic.Phone.Length==10){ displayStrings[i]=clinic.Phone.Substring(3,3); } } break; case "TreatingDentistPh78910": if(clinic==null){ if(PrefC.GetString(PrefName.PracticePhone).Length==10){ displayStrings[i]=PrefC.GetString(PrefName.PracticePhone).Substring(6); } } else{ if(clinic.Phone.Length==10){ displayStrings[i]=clinic.Phone.Substring(6); } } break; case "TreatingProviderSpecialty": displayStrings[i]=X12Generator.GetTaxonomy (ProviderC.ListLong[Providers.GetIndexLong(ClaimCur.ProvTreat)]); break; case "TotalPages": displayStrings[i]="";//totalPages.ToString();//bugs with this field that we can't fix since we didn't write that code. break; case "ReferringProvNPI": if(ClaimReferral==null){ displayStrings[i]=""; } else{ displayStrings[i]=ClaimReferral.NationalProvID; } break; case "ReferringProvNameFL": if(ClaimReferral==null){ displayStrings[i]=""; } else{ displayStrings[i]=ClaimReferral.GetNameFL(); } break; case "MedUniformBillType": displayStrings[i]=ClaimCur.UniformBillType; break; case "MedAdmissionTypeCode": displayStrings[i]=ClaimCur.AdmissionTypeCode; break; case "MedAdmissionSourceCode": displayStrings[i]=ClaimCur.AdmissionSourceCode; break; case "MedPatientStatusCode": displayStrings[i]=ClaimCur.PatientStatusCode; break; case "MedAccidentCode": //For UB04. if(ClaimCur.AccidentRelated=="A") { //Auto accident displayStrings[i]="01"; } else if(ClaimCur.AccidentRelated=="E") { //Employment related accident displayStrings[i]="04"; } break; }//switch if(CultureInfo.CurrentCulture.Name=="nl-BE" && displayStrings[i]==""){//Dutch Belgium displayStrings[i]="* * *"; } //Renaissance eclaims only: Remove newlines from display strings to prevent formatting issues, because the .rss file format requires each field on a single line. if(isRenaissance && displayStrings[i]!=null) { displayStrings[i]=displayStrings[i].Replace("\r","").Replace("\n",""); } }//for }
///<summary>Updates all claimforms with this unique id including all attached items.</summary> public static void UpdateByUniqueID(ClaimForm cf){ if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(),cf); return; } //first get a list of the ClaimFormNums with this UniqueId string command= "SELECT ClaimFormNum FROM claimform WHERE UniqueID ='"+cf.UniqueID.ToString()+"'"; DataTable table=Db.GetTable(command); long[] claimFormNums=new long[table.Rows.Count]; for(int i=0;i<table.Rows.Count;i++){ claimFormNums[i]=PIn.Long (table.Rows[i][0].ToString()); } //loop through each matching claimform for(int i=0;i<claimFormNums.Length;i++){ cf.ClaimFormNum=claimFormNums[i]; Update(cf); command="DELETE FROM claimformitem " +"WHERE ClaimFormNum = '"+POut.Long(claimFormNums[i])+"'"; Db.NonQ(command); for(int j=0;j<cf.Items.Length;j++){ cf.Items[j].ClaimFormNum=claimFormNums[i]; ClaimFormItems.Insert(cf.Items[j]); } } }
///<summary></summary> public FormClaimInstEdit(Claim claimCur,Patient patCur,Family famCur) { PatCur=patCur; FamCur=famCur; ClaimCur=claimCur; if(ClaimCur.ClaimForm != 0){ ClaimFormCur=ClaimForms.GetClaimForm(ClaimCur.ClaimForm); ClaimValCodes=ClaimValCodeLogs.GetValCodes(ClaimCur.ClaimNum); CurCondCodeLog=ClaimCondCodeLogs.GetOne(ClaimCur.ClaimNum); } InitializeComponent();// Required for Windows Form Designer support //tbPay.CellDoubleClicked += new OpenDental.ContrTable.CellEventHandler(tbPay_CellDoubleClicked); //tbProc.CellClicked += new OpenDental.ContrTable.CellEventHandler(tbProc_CellClicked); //tbPay.CellClicked += new OpenDental.ContrTable.CellEventHandler(tbPay_CellClicked); Lan.F(this); }