///<summary></summary> public static void Update(Referral refer) { if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(),refer); return; } Crud.ReferralCrud.Update(refer); }
///<summary>Includes title like DMD on the end.</summary> public static string GetNameLF(long referralNum) { //No need to check RemotingRole; no call to db. if (referralNum == 0) { return(""); } Referral referral = GetFromList(referralNum); if (referral == null) { return(""); } string retVal = referral.LName; if (referral.FName != "") { retVal += ", " + referral.FName + " " + referral.MName; } if (referral.Title != "") { retVal += ", " + referral.Title; } //specialty seems to wordy to add here return(retVal); }
///<summary></summary> public static long Insert(Referral refer) { if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) { refer.ReferralNum=Meth.GetLong(MethodBase.GetCurrentMethod(),refer); return refer.ReferralNum; } return Crud.ReferralCrud.Insert(refer); }
///<summary>Returns a copy of this Referral.</summary> public Referral Copy() { Referral r = new Referral(); r.ReferralNum = ReferralNum; r.LName = LName; r.FName = FName; r.MName = MName; r.SSN = SSN; r.UsingTIN = UsingTIN; r.Specialty = Specialty; r.ST = ST; r.Telephone = Telephone; r.Address = Address; r.Address2 = Address2; r.City = City; r.Zip = Zip; r.Note = Note; r.Phone2 = Phone2; r.IsHidden = IsHidden; r.NotPerson = NotPerson; r.Title = Title; r.EMail = EMail; r.PatNum = PatNum; return(r); }
///<summary></summary> public static long Insert(Referral refer) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { refer.ReferralNum = Meth.GetLong(MethodBase.GetCurrentMethod(), refer); return(refer.ReferralNum); } return(Crud.ReferralCrud.Insert(refer)); }
///<summary></summary> public static void Update(Referral refer) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(), refer); return; } Crud.ReferralCrud.Update(refer); }
///<summary></summary> public static void Delete(Referral refer) { if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(),refer); return; } string command= "DELETE FROM referral " +"WHERE referralnum = '"+refer.ReferralNum+"'"; Db.NonQ(command); }
///<summary></summary> public static void Delete(Referral refer) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(), refer); return; } string command = "DELETE FROM referral " + "WHERE referralnum = '" + refer.ReferralNum + "'"; Db.NonQ(command); }
///<summary>Gets Referral info from memory. Does not make a call to the database unless needed. ///Returns the true if the referral for the passed in referralNum could be found and sets the out parameter accordingly. ///Otherwise returns false and referral will be null.</summary> public static bool TryGetReferral(long referralNum, out Referral referral) { //No need to check RemotingRole; uses out parameter. referral = null; try { referral = GetReferral(referralNum); } catch (Exception ex) { ex.DoNothing(); } return(referral != null); }
///<summary></summary> public FormReferralEdit(Referral refCur){ InitializeComponent(); RefCur=refCur; if(refCur.PatNum>0){ IsPatient=true; } Lan.F(this); if(CultureInfo.CurrentCulture.Name.EndsWith("CA")) {//Canadian. en-CA or fr-CA groupSSN.Text=Lan.g(this,"CDA Number"); radioSSN.Visible=false; radioTIN.Visible=false; } }
///<summary>Includes title, such as DMD.</summary> public static string GetNameFL(long referralNum) { //No need to check RemotingRole; no call to db. if (referralNum == 0) { return(""); } Referral referral = GetFromList(referralNum); if (referral == null) { return(""); } return(referral.GetNameFL()); }
///<summary></summary> public static string GetPhone(long referralNum) { //No need to check RemotingRole; no call to db. Referral referral = GetFirstOrDefault(x => x.ReferralNum == referralNum); if (referral != null) { if (referral.Telephone.Length == 10) { return(referral.Telephone.Substring(0, 3) + "-" + referral.Telephone.Substring(3, 3) + "-" + referral.Telephone.Substring(6)); } return(referral.Telephone); } return(""); }
///<summary>Gets Referral info from memory. Does not make a call to the database unless needed. ///Returns the first referral matching the referralNum passed in, null if 0 is passed in, or throws an exception if no match found.</summary> private static Referral GetReferral(long referralNum) { //No need to check RemotingRole; no call to db. if (referralNum == 0) { return(null); } Referral referral = GetFirstOrDefault(x => x.ReferralNum == referralNum); if (referral == null) { throw new ApplicationException("Error. Referral not found: " + referralNum.ToString()); } return(referral); }
private void butAdd_Click(object sender,System.EventArgs e) { Referral refCur=new Referral(); bool referralIsNew=true; if(MessageBox.Show(Lan.g(this,"Is the referral source an existing patient?"),"" ,MessageBoxButtons.YesNo)==DialogResult.Yes) { FormPatientSelect FormPS=new FormPatientSelect(); FormPS.SelectionModeOnly=true; FormPS.ShowDialog(); if(FormPS.DialogResult!=DialogResult.OK) { return; } refCur.PatNum=FormPS.SelectedPatNum; for(int i=0;i<Referrals.List.Length;i++) { if(Referrals.List[i].PatNum==FormPS.SelectedPatNum) {//referral already existed refCur=Referrals.List[i]; referralIsNew=false; break; } } } FormReferralEdit FormRE2=new FormReferralEdit(refCur);//the ReferralNum must be added here FormRE2.IsNew=referralIsNew; FormRE2.ShowDialog(); if(FormRE2.DialogResult==DialogResult.Cancel) { return; } if(IsSelectionMode) { SelectedReferral=FormRE2.RefCur; DialogResult=DialogResult.OK; return; } else { FillTable(); for(int i=0;i<listRef.Count;i++) { if(listRef[i].ReferralNum==FormRE2.RefCur.ReferralNum) { gridMain.SetSelected(i,true); } } } }
///<summary>Replaces all patient's referral "From" and "IsDoctor" fields in the given message. Returns the resulting string. ///Replaces: [ReferredFromProvInitialReferralNum], [ReferredFromProvInitialNameF],etc.</summary> public static string ReplaceRefProvider(string message, Patient pat) { if (pat == null) { return(message); } List <Referral> listRefFrom = Referrals.GetIsDoctorReferralsForPat(pat.PatNum); if (listRefFrom.Count == 0) { return(message); } string retVal = message; //The oldest referral 'From". Referral refOldest = listRefFrom.FirstOrDefault(); retVal = retVal.Replace("[ReferredFromProvInitialReferralNum]", refOldest.ReferralNum.ToString()); retVal = retVal.Replace("[ReferredFromProvInitialNameF]", refOldest.FName); retVal = retVal.Replace("[ReferredFromProvInitialNameL]", refOldest.LName); retVal = retVal.Replace("[ReferredFromProvInitialPhone]", refOldest.Telephone); retVal = retVal.Replace("[ReferredFromProvInitialAddress]", refOldest.Address); retVal = retVal.Replace("[ReferredFromProvInitialAddress2]", refOldest.Address2); retVal = retVal.Replace("[ReferredFromProvInitialCity]", refOldest.City); retVal = retVal.Replace("[ReferredFromProvInitialState]", refOldest.ST); retVal = retVal.Replace("[ReferredFromProvInitialZip]", refOldest.Zip); //The most recent referral "From". Referral refNewest = listRefFrom.LastOrDefault(); retVal = retVal.Replace("[ReferredFromProvMostRecentReferralNum]", refNewest.ReferralNum.ToString()); retVal = retVal.Replace("[ReferredFromProvMostRecentNameF]", refNewest.FName); retVal = retVal.Replace("[ReferredFromProvMostRecentNameL]", refNewest.LName); retVal = retVal.Replace("[ReferredFromProvMostRecentPhone]", refNewest.Telephone); retVal = retVal.Replace("[ReferredFromProvMostRecentAddress]", refNewest.Address); retVal = retVal.Replace("[ReferredFromProvMostRecentAddress2]", refNewest.Address2); retVal = retVal.Replace("[ReferredFromProvMostRecentCity]", refNewest.City); retVal = retVal.Replace("[ReferredFromProvMostRecentState]", refNewest.ST); retVal = retVal.Replace("[ReferredFromProvMostRecentZip]", refNewest.Zip); return(retVal); }
///<summary></summary> public static void Delete(Referral refer) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(), refer); return; } if (RefAttaches.IsReferralAttached(refer.ReferralNum)) { throw new ApplicationException(Lans.g("FormReferralEdit", "Cannot delete Referral because it is attached to patients")); } if (Claims.IsReferralAttached(refer.ReferralNum)) { throw new ApplicationException(Lans.g("FormReferralEdit", "Cannot delete Referral because it is attached to claims")); } if (Procedures.IsReferralAttached(refer.ReferralNum)) { throw new ApplicationException(Lans.g("FormReferralEdit", "Cannot delete Referral because it is attached to procedures")); } string command = "DELETE FROM referral " + "WHERE ReferralNum = '" + POut.Long(refer.ReferralNum) + "'"; Db.NonQ(command); }
private static void FillFieldsForLabelReferral(Sheet sheet,Referral refer) { foreach(SheetField field in sheet.SheetFields) { switch(field.FieldName) { case "nameFL": field.FieldValue=Referrals.GetNameFL(refer.ReferralNum); break; case "address": field.FieldValue=refer.Address; if(refer.Address2!="") { field.FieldValue+="\r\n"+refer.Address2; } break; case "cityStateZip": field.FieldValue=refer.City+", "+refer.ST+" "+refer.Zip; break; } } }
private static void FillFieldsForReferralLetter(Sheet sheet,Patient pat,Referral refer) { foreach(SheetField field in sheet.SheetFields) { switch(field.FieldName) { case "PracticeTitle": field.FieldValue=PrefC.GetString(PrefName.PracticeTitle); break; case "PracticeAddress": field.FieldValue=PrefC.GetString(PrefName.PracticeAddress); if(PrefC.GetString(PrefName.PracticeAddress2) != ""){ field.FieldValue+="\r\n"+PrefC.GetString(PrefName.PracticeAddress2); } break; case "practiceCityStateZip": field.FieldValue=PrefC.GetString(PrefName.PracticeCity)+", " +PrefC.GetString(PrefName.PracticeST)+" " +PrefC.GetString(PrefName.PracticeZip); break; case "referral.phone": field.FieldValue=""; if(refer.Telephone.Length==10) { field.FieldValue="("+refer.Telephone.Substring(0,3)+")" +refer.Telephone.Substring(3,3)+"-" +refer.Telephone.Substring(6); } break; case "referral.phone2": field.FieldValue=refer.Phone2; break; case "referral.nameFL": field.FieldValue=Referrals.GetNameFL(refer.ReferralNum); break; case "referral.address": field.FieldValue=refer.Address; if(refer.Address2!="") { field.FieldValue+="\r\n"+refer.Address2; } break; case "referral.cityStateZip": field.FieldValue=refer.City+", "+refer.ST+" "+refer.Zip; break; case "today.DayDate": field.FieldValue=DateTime.Today.ToString("dddd")+", "+DateTime.Today.ToShortDateString(); break; case "patient.nameFL": field.FieldValue=pat.GetNameFL(); break; case "referral.salutation": field.FieldValue="Dear "+refer.FName+":"; break; case "patient.priProvNameFL": field.FieldValue=Providers.GetFormalName(pat.PriProv); break; } } }
///<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 }
private void butOK_Click(object sender,System.EventArgs e) { if(IsSelectionMode) { if(gridMain.GetSelectedIndex()==-1) { MsgBox.Show(this,"Please select a referral first"); return; } SelectedReferral=(Referral)listRef[gridMain.GetSelectedIndex()]; } DialogResult=DialogResult.OK; }
private void butOK_Click(object sender,EventArgs e) { if( textBirthdate1.errorProvider1.GetError(textBirthdate1)!="" || textBirthdate2.errorProvider1.GetError(textBirthdate2)!="" || textBirthdate3.errorProvider1.GetError(textBirthdate3)!="" || textBirthdate4.errorProvider1.GetError(textBirthdate4)!="" || textBirthdate5.errorProvider1.GetError(textBirthdate5)!="" ){ MsgBox.Show(this,"Please fix data entry errors first."); return; } //no validation on birthdate reasonableness. if(textLName1.Text=="" || textFName1.Text==""){ MsgBox.Show(this,"Guarantor name must be entered."); return; } // Validate Insurance subscribers-------------------------------------------------------------------------------------------------------- if((comboSubscriber1.SelectedIndex==2 || comboSubscriber2.SelectedIndex==2) && (textFName2.Text=="" || textLName2.Text=="")){ MsgBox.Show(this,"Subscriber must have name entered."); return; } if((comboSubscriber1.SelectedIndex==3 || comboSubscriber2.SelectedIndex==3) && (textFName3.Text=="" || textLName3.Text=="")){ MsgBox.Show(this,"Subscriber must have name entered."); return; } if((comboSubscriber1.SelectedIndex==4 || comboSubscriber2.SelectedIndex==4) && (textFName4.Text=="" || textLName4.Text=="")){ MsgBox.Show(this,"Subscriber must have name entered."); return; } if((comboSubscriber1.SelectedIndex==5 || comboSubscriber2.SelectedIndex==5) && (textFName5.Text=="" || textLName5.Text=="")){ MsgBox.Show(this,"Subscriber must have name entered."); return; } // Validate Insurance Plans-------------------------------------------------------------------------------------------------------------- bool insComplete1=false; bool insComplete2=false; if(comboSubscriber1.SelectedIndex>0 && textSubscriberID1.Text!="" && textCarrier1.Text!="") { insComplete1=true; } if(comboSubscriber2.SelectedIndex>0 && textSubscriberID2.Text!="" && textCarrier2.Text!="") { insComplete2=true; } //test for insurance having only some of the critical fields filled in if(comboSubscriber1.SelectedIndex>0 || textSubscriberID1.Text!="" || textCarrier1.Text!="") { if(!insComplete1){ MsgBox.Show(this,"Subscriber, Subscriber ID, and Carrier are all required fields if adding insurance."); return; } } if(comboSubscriber2.SelectedIndex>0 || textSubscriberID2.Text!="" || textCarrier2.Text!="") { if(!insComplete2){ MsgBox.Show(this,"Subscriber, Subscriber ID, and Carrier are all required fields if adding insurance."); return; } } if(checkInsOne1.Checked || checkInsOne2.Checked || checkInsOne3.Checked || checkInsOne4.Checked || checkInsOne5.Checked) { if(!insComplete1){ MsgBox.Show(this,"Subscriber, Subscriber ID, and Carrier are all required fields if adding insurance."); return; } } if(checkInsTwo1.Checked || checkInsTwo2.Checked || checkInsTwo3.Checked || checkInsTwo4.Checked || checkInsTwo5.Checked) { if(!insComplete2){ MsgBox.Show(this,"Subscriber, Subscriber ID, and Carrier are all required fields if adding insurance."); return; } } //Validate Insurance subscriptions--------------------------------------------------------------------------------------------------- if(insComplete1){ if(!checkInsOne1.Checked && !checkInsOne2.Checked && !checkInsOne3.Checked && !checkInsOne4.Checked && !checkInsOne5.Checked) { MsgBox.Show(this,"Insurance information has been filled in, but has not been assigned to any patients."); return; } if(checkInsOne1.Checked && (textLName1.Text=="" || textFName1.Text=="")//Insurance1 assigned to invalid patient1 || checkInsOne2.Checked && (textLName2.Text=="" || textFName2.Text=="")//Insurance1 assigned to invalid patient2 || checkInsOne3.Checked && (textLName3.Text=="" || textFName3.Text=="")//Insurance1 assigned to invalid patient3 || checkInsOne4.Checked && (textLName4.Text=="" || textFName4.Text=="")//Insurance1 assigned to invalid patient4 || checkInsOne5.Checked && (textLName5.Text=="" || textFName5.Text=="")) //Insurance1 assigned to invalid patient5 { MsgBox.Show(this,"Insurance information 1 has been filled in, but has been assigned to a patient with no name."); return; } } if(insComplete2){ if(!checkInsTwo1.Checked && !checkInsTwo2.Checked && !checkInsTwo3.Checked && !checkInsTwo4.Checked && !checkInsTwo5.Checked) { MsgBox.Show(this,"Insurance information 2 has been filled in, but has not been assigned to any patients."); return; } if(checkInsTwo1.Checked && (textLName1.Text=="" || textFName1.Text=="")//Insurance2 assigned to invalid patient1 || checkInsTwo2.Checked && (textLName2.Text=="" || textFName2.Text=="")//Insurance2 assigned to invalid patient2 || checkInsTwo3.Checked && (textLName3.Text=="" || textFName3.Text=="")//Insurance2 assigned to invalid patient3 || checkInsTwo4.Checked && (textLName4.Text=="" || textFName4.Text=="")//Insurance2 assigned to invalid patient4 || checkInsTwo5.Checked && (textLName5.Text=="" || textFName5.Text=="")) //Insurance2 assigned to invalid patient5 { MsgBox.Show(this,"Insurance information 2 has been filled in, but has been assigned to a patient with no name."); return; } } //End of validation------------------------------------------------------------------------------------------ //Create Guarantor------------------------------------------------------------------------------------------- Patient guar=new Patient(); guar.LName=textLName1.Text; guar.FName=textFName1.Text; if(listGender1.SelectedIndex==0){ guar.Gender=PatientGender.Male; } else{ guar.Gender=PatientGender.Female; } if(listPosition1.SelectedIndex==0){ guar.Position=PatientPosition.Single; } else{ guar.Position=PatientPosition.Married; } guar.Birthdate=PIn.Date(textBirthdate1.Text); guar.BillingType=PrefC.GetLong(PrefName.PracticeDefaultBillType); guar.PatStatus=PatientStatus.Patient; guar.PriProv=ProviderC.ListShort[comboPriProv1.SelectedIndex].ProvNum; if(comboSecProv1.SelectedIndex>0){ guar.SecProv=ProviderC.ListShort[comboSecProv1.SelectedIndex-1].ProvNum; } guar.HmPhone=textHmPhone.Text; guar.Address=textAddress.Text; guar.Address2=textAddress2.Text; guar.City=textCity.Text; guar.State=textState.Text; guar.Zip=textZip.Text; guar.AddrNote=textAddrNotes.Text; guar.ClinicNum=Security.CurUser.ClinicNum; Patients.Insert(guar,false); Patient guarOld=guar.Copy(); guar.Guarantor=guar.PatNum; Patients.Update(guar,guarOld); RefAttach refAttach; if(textReferral.Text!=""){ //selectedReferral will already be set if user picked from list. //but, if selectedReferral doesn't match data in boxes, then clear it. if(selectedReferral!=null && (selectedReferral.LName!=textReferral.Text || selectedReferral.FName!=textReferralFName.Text)) { selectedReferral=null; } if(selectedReferral==null){ selectedReferral=new Referral(); selectedReferral.LName=textReferral.Text; selectedReferral.FName=textReferralFName.Text; Referrals.Insert(selectedReferral); } //Now we will always have a valid referral to attach. We will use it again for the other family members. refAttach=new RefAttach(); refAttach.IsFrom=true; refAttach.RefDate=DateTime.Today; refAttach.ReferralNum=selectedReferral.ReferralNum; refAttach.PatNum=guar.PatNum; RefAttaches.Insert(refAttach); } //Patient #2----------------------------------------------------------------------------------------------------- Patient pat2=null; if(textFName2.Text!="" && textLName2.Text!=""){ pat2=new Patient(); pat2.LName=textLName2.Text; pat2.FName=textFName2.Text; if(listGender2.SelectedIndex==0){ pat2.Gender=PatientGender.Male; } else{ pat2.Gender=PatientGender.Female; } if(listPosition2.SelectedIndex==0){ pat2.Position=PatientPosition.Single; } else{ pat2.Position=PatientPosition.Married; } pat2.Birthdate=PIn.Date(textBirthdate2.Text); pat2.BillingType=PrefC.GetLong(PrefName.PracticeDefaultBillType); pat2.PatStatus=PatientStatus.Patient; pat2.PriProv=ProviderC.ListShort[comboPriProv2.SelectedIndex].ProvNum; if(comboSecProv2.SelectedIndex>0){ pat2.SecProv=ProviderC.ListShort[comboSecProv2.SelectedIndex-1].ProvNum; } pat2.HmPhone=textHmPhone.Text; pat2.Address=textAddress.Text; pat2.Address2=textAddress2.Text; pat2.City=textCity.Text; pat2.State=textState.Text; pat2.Zip=textZip.Text; pat2.AddrNote=textAddrNotes.Text; pat2.ClinicNum=Security.CurUser.ClinicNum; pat2.Guarantor=guar.Guarantor; Patients.Insert(pat2,false); if(textReferral.Text!=""){ //selectedReferral will already have been set in the guarantor loop refAttach=new RefAttach(); refAttach.IsFrom=true; refAttach.RefDate=DateTime.Today; refAttach.ReferralNum=selectedReferral.ReferralNum; refAttach.PatNum=pat2.PatNum; RefAttaches.Insert(refAttach); } } //Patient #3----------------------------------------------------------------------------------------------------- Patient pat3=null; if(textFName3.Text!="" && textLName3.Text!=""){ pat3=new Patient(); pat3.LName=textLName3.Text; pat3.FName=textFName3.Text; if(listGender3.SelectedIndex==0){ pat3.Gender=PatientGender.Male; } else{ pat3.Gender=PatientGender.Female; } pat3.Position=PatientPosition.Child; pat3.Birthdate=PIn.Date(textBirthdate3.Text); pat3.BillingType=PrefC.GetLong(PrefName.PracticeDefaultBillType); pat3.PatStatus=PatientStatus.Patient; pat3.PriProv=ProviderC.ListShort[comboPriProv3.SelectedIndex].ProvNum; if(comboSecProv3.SelectedIndex>0){ pat3.SecProv=ProviderC.ListShort[comboSecProv3.SelectedIndex-1].ProvNum; } pat3.HmPhone=textHmPhone.Text; pat3.Address=textAddress.Text; pat3.Address2=textAddress2.Text; pat3.City=textCity.Text; pat3.State=textState.Text; pat3.Zip=textZip.Text; pat3.AddrNote=textAddrNotes.Text; pat3.ClinicNum=Security.CurUser.ClinicNum; pat3.Guarantor=guar.Guarantor; Patients.Insert(pat3,false); if(textReferral.Text!=""){ //selectedReferral will already have been set in the guarantor loop refAttach=new RefAttach(); refAttach.IsFrom=true; refAttach.RefDate=DateTime.Today; refAttach.ReferralNum=selectedReferral.ReferralNum; refAttach.PatNum=pat3.PatNum; RefAttaches.Insert(refAttach); } } //Patient #4----------------------------------------------------------------------------------------------------- Patient pat4=null; if(textFName4.Text!="" && textLName4.Text!=""){ pat4=new Patient(); pat4.LName=textLName4.Text; pat4.FName=textFName4.Text; if(listGender4.SelectedIndex==0){ pat4.Gender=PatientGender.Male; } else{ pat4.Gender=PatientGender.Female; } pat4.Position=PatientPosition.Child; pat4.Birthdate=PIn.Date(textBirthdate4.Text); pat4.BillingType=PrefC.GetLong(PrefName.PracticeDefaultBillType); pat4.PatStatus=PatientStatus.Patient; pat4.PriProv=ProviderC.ListShort[comboPriProv4.SelectedIndex].ProvNum; if(comboSecProv4.SelectedIndex>0){ pat4.SecProv=ProviderC.ListShort[comboSecProv4.SelectedIndex-1].ProvNum; } pat4.HmPhone=textHmPhone.Text; pat4.Address=textAddress.Text; pat4.Address2=textAddress2.Text; pat4.City=textCity.Text; pat4.State=textState.Text; pat4.Zip=textZip.Text; pat4.AddrNote=textAddrNotes.Text; pat4.ClinicNum=Security.CurUser.ClinicNum; pat4.Guarantor=guar.Guarantor; Patients.Insert(pat4,false); if(textReferral.Text!=""){ //selectedReferral will already have been set in the guarantor loop refAttach=new RefAttach(); refAttach.IsFrom=true; refAttach.RefDate=DateTime.Today; refAttach.ReferralNum=selectedReferral.ReferralNum; refAttach.PatNum=pat4.PatNum; RefAttaches.Insert(refAttach); } } //Patient #5----------------------------------------------------------------------------------------------------- Patient pat5=null; if(textFName5.Text!="" && textLName5.Text!=""){ pat5=new Patient(); pat5.LName=textLName5.Text; pat5.FName=textFName5.Text; if(listGender5.SelectedIndex==0){ pat5.Gender=PatientGender.Male; } else{ pat5.Gender=PatientGender.Female; } pat5.Position=PatientPosition.Child; pat5.Birthdate=PIn.Date(textBirthdate5.Text); pat5.BillingType=PrefC.GetLong(PrefName.PracticeDefaultBillType); pat5.PatStatus=PatientStatus.Patient; pat5.PriProv=ProviderC.ListShort[comboPriProv5.SelectedIndex].ProvNum; if(comboSecProv5.SelectedIndex>0){ pat5.SecProv=ProviderC.ListShort[comboSecProv5.SelectedIndex-1].ProvNum; } pat5.HmPhone=textHmPhone.Text; pat5.Address=textAddress.Text; pat5.Address2=textAddress2.Text; pat5.City=textCity.Text; pat5.State=textState.Text; pat5.Zip=textZip.Text; pat5.AddrNote=textAddrNotes.Text; pat5.ClinicNum=Security.CurUser.ClinicNum; pat5.Guarantor=guar.Guarantor; Patients.Insert(pat5,false); if(textReferral.Text!=""){ //selectedReferral will already have been set in the guarantor loop refAttach=new RefAttach(); refAttach.IsFrom=true; refAttach.RefDate=DateTime.Today; refAttach.ReferralNum=selectedReferral.ReferralNum; refAttach.PatNum=pat5.PatNum; RefAttaches.Insert(refAttach); } } //Insurance------------------------------------------------------------------------------------------------------------ InsSub sub1=null; InsSub sub2=null; if(selectedPlan1!=null){ //validate the ins fields. If they don't match perfectly, then set it to null if(Employers.GetName(selectedPlan1.EmployerNum)!=textEmployer1.Text || Carriers.GetName(selectedPlan1.CarrierNum)!=textCarrier1.Text || selectedPlan1.GroupName!=textGroupName1.Text || selectedPlan1.GroupNum!=textGroupNum1.Text) { selectedPlan1=null; } } if(selectedPlan2!=null){ if(Employers.GetName(selectedPlan2.EmployerNum)!=textEmployer2.Text || Carriers.GetName(selectedPlan2.CarrierNum)!=textCarrier2.Text || selectedPlan2.GroupName!=textGroupName2.Text || selectedPlan2.GroupNum!=textGroupNum2.Text) { selectedPlan2=null; } } if(selectedCarrier1!=null){ //validate the carrier fields. If they don't match perfectly, then set it to null if(selectedCarrier1.CarrierName!=textCarrier1.Text || selectedCarrier1.Phone!=textPhone1.Text) { selectedCarrier1=null; } } if(selectedCarrier2!=null){ if(selectedCarrier2.CarrierName!=textCarrier2.Text || selectedCarrier2.Phone!=textPhone2.Text) { selectedCarrier2=null; } } if(insComplete1){ if(selectedCarrier1==null){ //get a carrier, possibly creating a new one if needed. selectedCarrier1=Carriers.GetByNameAndPhone(textCarrier1.Text,textPhone1.Text); } long empNum1=Employers.GetEmployerNum(textEmployer1.Text); if(selectedPlan1==null){ //don't try to get a copy of an existing plan. Instead, start from scratch. selectedPlan1=new InsPlan(); selectedPlan1.EmployerNum=empNum1; selectedPlan1.CarrierNum=selectedCarrier1.CarrierNum; selectedPlan1.GroupName=textGroupName1.Text; selectedPlan1.GroupNum=textGroupNum1.Text; selectedPlan1.PlanType=""; InsPlans.Insert(selectedPlan1); Benefit ben; for(int i=0;i<CovCatC.ListShort.Count;i++){ if(CovCatC.ListShort[i].DefaultPercent==-1){ continue; } ben=new Benefit(); ben.BenefitType=InsBenefitType.CoInsurance; ben.CovCatNum=CovCatC.ListShort[i].CovCatNum; ben.PlanNum=selectedPlan1.PlanNum; ben.Percent=CovCatC.ListShort[i].DefaultPercent; ben.TimePeriod=BenefitTimePeriod.CalendarYear; ben.CodeNum=0; Benefits.Insert(ben); } } sub1=new InsSub(); sub1.PlanNum=selectedPlan1.PlanNum; sub1.AssignBen=true; sub1.ReleaseInfo=true; sub1.DateEffective=DateTime.MinValue; sub1.DateTerm=DateTime.MinValue; if(comboSubscriber1.SelectedIndex==1){ sub1.Subscriber=guar.PatNum; } if(comboSubscriber1.SelectedIndex==2){ sub1.Subscriber=pat2.PatNum; } if(comboSubscriber1.SelectedIndex==3){ sub1.Subscriber=pat3.PatNum; } if(comboSubscriber1.SelectedIndex==4){ sub1.Subscriber=pat4.PatNum; } if(comboSubscriber1.SelectedIndex==5){ sub1.Subscriber=pat5.PatNum; } sub1.SubscriberID=textSubscriberID1.Text; InsSubs.Insert(sub1); } if(insComplete2){ if(selectedCarrier2==null){ selectedCarrier2=Carriers.GetByNameAndPhone(textCarrier2.Text,textPhone2.Text); } long empNum2=Employers.GetEmployerNum(textEmployer2.Text); if(selectedPlan2==null){ //don't try to get a copy of an existing plan. Instead, start from scratch. selectedPlan2=new InsPlan(); selectedPlan2.EmployerNum=empNum2; selectedPlan2.CarrierNum=selectedCarrier2.CarrierNum; selectedPlan2.GroupName=textGroupName2.Text; selectedPlan2.GroupNum=textGroupNum2.Text; selectedPlan2.PlanType=""; InsPlans.Insert(selectedPlan2); Benefit ben; for(int i=0;i<CovCatC.ListShort.Count;i++){ if(CovCatC.ListShort[i].DefaultPercent==-1){ continue; } ben=new Benefit(); ben.BenefitType=InsBenefitType.CoInsurance; ben.CovCatNum=CovCatC.ListShort[i].CovCatNum; ben.PlanNum=selectedPlan2.PlanNum; ben.Percent=CovCatC.ListShort[i].DefaultPercent; ben.TimePeriod=BenefitTimePeriod.CalendarYear; ben.CodeNum=0; Benefits.Insert(ben); } } sub2=new InsSub(); sub2.PlanNum=selectedPlan2.PlanNum; sub2.AssignBen=true; sub2.ReleaseInfo=true; sub2.DateEffective=DateTime.MinValue; sub2.DateTerm=DateTime.MinValue; if(comboSubscriber2.SelectedIndex==1){ sub2.Subscriber=guar.PatNum; } if(comboSubscriber2.SelectedIndex==2){ sub2.Subscriber=pat2.PatNum; } if(comboSubscriber2.SelectedIndex==3){ sub2.Subscriber=pat3.PatNum; } if(comboSubscriber2.SelectedIndex==4){ sub2.Subscriber=pat4.PatNum; } if(comboSubscriber2.SelectedIndex==5){ sub2.Subscriber=pat5.PatNum; } sub2.SubscriberID=textSubscriberID2.Text; InsSubs.Insert(sub2); } PatPlan patplan; //attach insurance to subscriber-------------------------------------------------------------------------------- if(checkInsOne1.Checked){ patplan=new PatPlan(); //the only situation where ordinal would be 2 is if ins2 has this patient as the subscriber. if(comboSubscriber2.SelectedIndex==1){ patplan.Ordinal=2; } else{ patplan.Ordinal=1; } patplan.PatNum=guar.PatNum; patplan.InsSubNum=sub1.InsSubNum; if(comboSubscriber1.SelectedIndex==1){ patplan.Relationship=Relat.Self; } else if(comboSubscriber1.SelectedIndex==2){ patplan.Relationship=Relat.Spouse; } else{ //the subscriber would never be a child } PatPlans.Insert(patplan); } if(checkInsTwo1.Checked){ patplan=new PatPlan(); //the only situations where ordinal would be 1 is if ins1 is not checked or if ins2 has this patient as subscriber. if(comboSubscriber2.SelectedIndex==1){ patplan.Ordinal=1; } else if(!checkInsOne1.Checked){ patplan.Ordinal=1; } else{ patplan.Ordinal=2; } patplan.PatNum=guar.PatNum; patplan.InsSubNum=sub2.InsSubNum; if(comboSubscriber2.SelectedIndex==1){ patplan.Relationship=Relat.Self; } else if(comboSubscriber2.SelectedIndex==2){ patplan.Relationship=Relat.Spouse; } else{ //the subscriber would never be a child } PatPlans.Insert(patplan); } //attach insurance to patient 2, the other parent---------------------------------------------------------------------- if(checkInsOne2.Checked){ patplan=new PatPlan(); //the only situation where ordinal would be 2 is if ins2 has this patient as the subscriber. if(comboSubscriber2.SelectedIndex==2){ patplan.Ordinal=2; } else{ patplan.Ordinal=1; } patplan.PatNum=pat2.PatNum; patplan.InsSubNum=sub1.InsSubNum; if(comboSubscriber1.SelectedIndex==2){ patplan.Relationship=Relat.Self; } else if(comboSubscriber1.SelectedIndex==1){ patplan.Relationship=Relat.Spouse; } else{ //the subscriber would never be a child } PatPlans.Insert(patplan); } if(checkInsTwo2.Checked){ patplan=new PatPlan(); //the only situations where ordinal would be 1 is if ins1 is not checked or if ins2 has this patient as subscriber. if(comboSubscriber2.SelectedIndex==2){ patplan.Ordinal=1; } else if(!checkInsOne2.Checked){ patplan.Ordinal=1; } else{ patplan.Ordinal=2; } patplan.PatNum=pat2.PatNum; patplan.InsSubNum=sub2.InsSubNum; if(comboSubscriber2.SelectedIndex==2){ patplan.Relationship=Relat.Self; } else if(comboSubscriber2.SelectedIndex==1){ patplan.Relationship=Relat.Spouse; } else{ //the subscriber would never be a child } PatPlans.Insert(patplan); } //attach insurance to patient 3, a child---------------------------------------------------------------------- if(checkInsOne3.Checked){ patplan=new PatPlan(); patplan.Ordinal=1; patplan.PatNum=pat3.PatNum; patplan.InsSubNum=sub1.InsSubNum; patplan.Relationship=Relat.Child; PatPlans.Insert(patplan); } if(checkInsTwo3.Checked){ patplan=new PatPlan(); //the only situation where ordinal would be 1 is if ins1 is not checked. if(!checkInsOne3.Checked){ patplan.Ordinal=1; } else{ patplan.Ordinal=2; } patplan.PatNum=pat3.PatNum; patplan.InsSubNum=sub2.InsSubNum; patplan.Relationship=Relat.Child; PatPlans.Insert(patplan); } //attach insurance to patient 4, a child---------------------------------------------------------------------- if(checkInsOne4.Checked){ patplan=new PatPlan(); patplan.Ordinal=1; patplan.PatNum=pat4.PatNum; patplan.InsSubNum=sub1.InsSubNum; patplan.Relationship=Relat.Child; PatPlans.Insert(patplan); } if(checkInsTwo4.Checked){ patplan=new PatPlan(); //the only situation where ordinal would be 1 is if ins1 is not checked. if(!checkInsOne4.Checked){ patplan.Ordinal=1; } else{ patplan.Ordinal=2; } patplan.PatNum=pat4.PatNum; patplan.InsSubNum=sub2.InsSubNum; patplan.Relationship=Relat.Child; PatPlans.Insert(patplan); } //attach insurance to patient 5, a child---------------------------------------------------------------------- if(checkInsOne5.Checked){ patplan=new PatPlan(); patplan.Ordinal=1; patplan.PatNum=pat5.PatNum; patplan.InsSubNum=sub1.InsSubNum; patplan.Relationship=Relat.Child; PatPlans.Insert(patplan); } if(checkInsTwo5.Checked){ patplan=new PatPlan(); //the only situation where ordinal would be 1 is if ins1 is not checked. if(!checkInsOne5.Checked){ patplan.Ordinal=1; } else{ patplan.Ordinal=2; } patplan.PatNum=pat5.PatNum; patplan.InsSubNum=sub2.InsSubNum; patplan.Relationship=Relat.Child; PatPlans.Insert(patplan); } SelectedPatNum=guar.PatNum; MessageBox.Show("Done"); DialogResult=DialogResult.OK; }
private void FormReferralEdit_Load(object sender, System.EventArgs e) { listSpecialty.Items.Clear(); for(int i=0;i<Enum.GetNames(typeof(DentalSpecialty)).Length;i++){ listSpecialty.Items.Add(Lan.g("enumDentalSpecialty",Enum.GetNames(typeof(DentalSpecialty))[i])); } if(IsPatient){ if(IsNew){ Text=Lan.g(this,"Add Referral"); Family FamCur=Patients.GetFamily(RefCur.PatNum); Patient PatCur=FamCur.GetPatient(RefCur.PatNum); RefCur.Address=PatCur.Address; RefCur.Address2=PatCur.Address2; RefCur.City=PatCur.City; RefCur.EMail=PatCur.Email; RefCur.FName=PatCur.FName; RefCur.LName=PatCur.LName; RefCur.MName=PatCur.MiddleI; //RefCur.PatNum=Patients.Cur.PatNum;//already handled RefCur.SSN=PatCur.SSN; RefCur.Telephone=TelephoneNumbers.FormatNumbersExactTen(PatCur.HmPhone); if(PatCur.WkPhone==""){ RefCur.Phone2=PatCur.WirelessPhone; } else{ RefCur.Phone2=PatCur.WkPhone; } RefCur.ST=PatCur.State; RefCur.Zip=PatCur.Zip; } labelPatient.Visible=true; textLName.ReadOnly=true; textFName.ReadOnly=true; textMName.ReadOnly=true; textTitle.ReadOnly=true; textAddress.ReadOnly=true; textAddress2.ReadOnly=true; textCity.ReadOnly=true; textST.ReadOnly=true; textZip.ReadOnly=true; checkNotPerson.Enabled=false; textPhone1.ReadOnly=true; textPhone2.ReadOnly=true; textPhone3.ReadOnly=true; textSSN.ReadOnly=true; radioTIN.Enabled=false; textEmail.ReadOnly=true; listSpecialty.Enabled=false; listSpecialty.SelectedIndex=-1; checkIsDoctor.Enabled=false; textNotes.Select(); } else{//non patient if(IsNew){ this.Text=Lan.g(this,"Add Referral"); RefCur=new Referral(); RefCur.Specialty=DentalSpecialty.General; } listSpecialty.SelectedIndex=(int)RefCur.Specialty; textLName.Select(); } checkIsDoctor.Checked=RefCur.IsDoctor; checkNotPerson.Checked=RefCur.NotPerson; checkHidden.Checked=RefCur.IsHidden; textLName.Text=RefCur.LName; textFName.Text=RefCur.FName; textMName.Text=RefCur.MName; textTitle.Text=RefCur.Title; textAddress.Text=RefCur.Address; textAddress2.Text=RefCur.Address2; textCity.Text=RefCur.City; textST.Text=RefCur.ST; textZip.Text=RefCur.Zip; string phone=RefCur.Telephone; if(phone!=null && phone.Length==10){ textPhone1.Text=phone.Substring(0,3); textPhone2.Text=phone.Substring(3,3); textPhone3.Text=phone.Substring(6); } textSSN.Text=RefCur.SSN; if(RefCur.UsingTIN){ radioTIN.Checked=true; } else{ radioSSN.Checked=true; } textNationalProvID.Text=RefCur.NationalProvID; textOtherPhone.Text=RefCur.Phone2; textEmail.Text=RefCur.EMail; textNotes.Text=RefCur.Note; //Patients using: string[] patsTo =RefAttaches.GetPats(RefCur.ReferralNum,false); string[] patsFrom=RefAttaches.GetPats(RefCur.ReferralNum,true); textPatientsNumTo.Text =patsTo.Length.ToString(); textPatientsNumFrom.Text=patsFrom.Length.ToString(); comboPatientsTo.Items.Clear(); comboPatientsFrom.Items.Clear(); for(int i=0;i<patsTo.Length;i++){ comboPatientsTo.Items.Add(patsTo[i]); } for(int i=0;i<patsFrom.Length;i++){ comboPatientsFrom.Items.Add(patsFrom[i]); } if(patsTo.Length>0){ comboPatientsTo.SelectedIndex=0; } if(patsFrom.Length>0){ comboPatientsFrom.SelectedIndex=0; } comboSlip.Items.Add(Lan.g(this,"Default")); comboSlip.SelectedIndex=0; SlipList=SheetDefs.GetCustomForType(SheetTypeEnum.ReferralSlip); for(int i=0;i<SlipList.Count;i++){ comboSlip.Items.Add(SlipList[i].Description); if(RefCur.Slip==SlipList[i].SheetDefNum){ comboSlip.SelectedIndex=i+1; } } }
///<summary>Fills the referral fields based on the specified referralNum.</summary> private void FillReferral(long referralNum) { selectedReferral=Referrals.GetReferral(referralNum); textReferral.Text=selectedReferral.LName; textReferralFName.Text=selectedReferral.FName; }
private static void FillFieldsForReferralSlip(Sheet sheet,Patient pat,Referral refer) { foreach(SheetField field in sheet.SheetFields) { switch(field.FieldName) { case "referral.nameFL": field.FieldValue=Referrals.GetNameFL(refer.ReferralNum); break; case "referral.address": field.FieldValue=refer.Address; if(refer.Address2!="") { field.FieldValue+="\r\n"+refer.Address2; } break; case "referral.cityStateZip": field.FieldValue=refer.City+", "+refer.ST+" "+refer.Zip; break; case "referral.phone": field.FieldValue=""; if(refer.Telephone.Length==10){ field.FieldValue="("+refer.Telephone.Substring(0,3)+")" +refer.Telephone.Substring(3,3)+"-" +refer.Telephone.Substring(6); } break; case "referral.phone2": field.FieldValue=refer.Phone2; break; case "patient.nameFL": field.FieldValue=pat.GetNameFL(); break; case "dateTime.Today": field.FieldValue=DateTime.Today.ToShortDateString(); break; case "patient.WkPhone": field.FieldValue=pat.WkPhone; break; case "patient.HmPhone": field.FieldValue=pat.HmPhone; break; case "patient.WirelessPhone": field.FieldValue=pat.WirelessPhone; break; case "patient.address": field.FieldValue=pat.Address; if(pat.Address2!="") { field.FieldValue+="\r\n"+pat.Address2; } break; case "patient.cityStateZip": field.FieldValue=pat.City+", "+pat.State+" "+pat.Zip; break; case "patient.provider": field.FieldValue=Providers.GetProv(Patients.GetProvNum(pat)).GetFormalName(); break; //case "notes"://an input field } } }