private void butUp_Click(object sender, EventArgs e) { int idx = gridMain.GetSelectedIndex(); if (idx == -1) { MsgBox.Show(this, "Please select a fee schedule first."); return; } if (idx == 0) { return; } //swap the orders. This makes it work no matter which types are being viewed. int order1 = FeeSchedsForType[idx - 1].ItemOrder; int order2 = FeeSchedsForType[idx].ItemOrder; FeeSchedsForType[idx - 1].ItemOrder = order2; FeeScheds.Update(FeeSchedsForType[idx - 1]); FeeSchedsForType[idx].ItemOrder = order1; FeeScheds.Update(FeeSchedsForType[idx]); changed = true; FillGrid(); gridMain.SetSelected(idx - 1, true); }
private void butOK_Click(object sender, System.EventArgs e) { if (textDescription.Text == "") { MsgBox.Show(this, "Description cannot be blank."); return; } FeeSchedCur.Description = textDescription.Text; FeeSchedCur.FeeSchedType = (FeeScheduleType)listType.SelectedIndex; FeeSchedCur.IsHidden = checkIsHidden.Checked; try{ if (FeeSchedCur.IsNew) { FeeScheds.Insert(FeeSchedCur); } else { FeeScheds.Update(FeeSchedCur); } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } DialogResult = DialogResult.OK; }
///<summary>Returns feeSchedNum</summary> public static long CreateFeeSched(FeeScheduleType feeSchedType, string suffix, bool isGlobal = true) { FeeSched feeSched = GetNewFeeSched(feeSchedType, suffix, isGlobal); FeeScheds.RefreshCache(); return(feeSched.FeeSchedNum); }
private void RefreshModuleScreen() { if (PatCur == null) { return; } if (PIn.Bool(ProgramProperties.GetPropVal(ProgramName.eClinicalWorks, "FeeSchedulesSetManually"))) { comboFeeSched.Enabled = true; } else { comboFeeSched.Enabled = false; } comboFeeSched.Items.Clear(); comboFeeSched.Items.Add(Lan.g(this, "none")); comboFeeSched.SelectedIndex = 0; _listFeeSchedShort = FeeScheds.GetDeepCopy(true); for (int i = 0; i < _listFeeSchedShort.Count; i++) { comboFeeSched.Items.Add(_listFeeSchedShort[i].Description); if (_listFeeSchedShort[i].FeeSchedNum == PatCur.FeeSched) { comboFeeSched.SelectedIndex = i + 1; } } }
public void FeeSchedTools_ImportCanada() { string canadianCodes = Properties.Resources.canadianprocedurecodes; //If we need to import these procedures codes, do so foreach (string line in canadianCodes.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None)) { string[] properties = line.Split('\t'); if (properties.Count() != 10) { continue; } if (ProcedureCodes.GetCodeNum(properties[0]) != 0) { continue; } ProcedureCode procCode = new ProcedureCode() { ProcCode = properties[0], Descript = properties[1], ProcTime = properties[8], AbbrDesc = properties[9], }; ProcedureCodes.Insert(procCode); } //Now import the fees string feeData = Properties.Resources.BC_BCDA_2018_GPOOC; FeeSched feeSched = FeeSchedT.GetNewFeeSched(FeeScheduleType.Normal, MethodBase.GetCurrentMethod().Name, isGlobal: false); List <Fee> listNewFees = FeeScheds.ImportCanadaFeeSchedule2(feeSched, feeData, 0, 0, out int numImported, out int numSkipped); Assert.IsTrue(DoAmountsMatch(listNewFees, feeSched.FeeSchedNum, 0, 0)); }
private void butHideUnused_Click(object sender, EventArgs e) { if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Hide fee schedules that are not in use by insurance plans, patients, or providers?\r\n" + "A backup of the database will be made first.")) { return; } bool hasChanged = FeeScheds.Sync(_listFeeScheds, _listFeeSchedsOld); Action actionProgress = ODProgress.Show(ODEventType.HideUnusedFeeSchedules, startingMessage: Lans.g(this, "Backing up database...")); try { MiscData.MakeABackup(); } catch (Exception ex) { actionProgress?.Invoke(); FriendlyException.Show(Lans.g(this, "Unable to make a backup. No fee schedules have been altered."), ex); return; } ODEvent.Fire(ODEventType.HideUnusedFeeSchedules, Lans.g(this, "Hiding unused fee schedules...")); long countChanged = FeeScheds.HideUnusedScheds(); if (hasChanged || countChanged > 0) { DataValid.SetInvalid(InvalidType.FeeScheds); } actionProgress?.Invoke(); MessageBox.Show(countChanged.ToString() + " " + Lans.g(this, "unused fee schedules hidden.")); _listFeeScheds = FeeScheds.GetDeepCopy(_isSelectionMode); _listFeeSchedsOld = _listFeeScheds.Select(x => x.Copy()).ToList(); FillGrid(); }
public static string ClearDb() { string command = @" DELETE FROM appointment; DELETE FROM carrier; DELETE FROM claim; DELETE FROM claimproc; DELETE FROM clockevent; DELETE FROM employee; DELETE FROM fee; DELETE FROM feesched WHERE FeeSchedNum !=53; /*because this is the default fee schedule for providers*/ DELETE FROM hl7def; DELETE FROM hl7msg; DELETE FROM insplan; DELETE FROM patient; DELETE FROM patplan; DELETE FROM payperiod; DELETE FROM procedurelog; DELETE FROM provider WHERE ProvNum>2; DELETE FROM timeadjust; DELETE FROM timecardrule; " ; DataCore.NonQ(command); Providers.RefreshCache(); FeeScheds.RefreshCache(); return("Database cleared of old data.\r\n"); }
public void FeeSchedTools_CopyFeeSched_Concurrency() { //Make sure there are no duplicate fees already present within the database. string dbmResult = DatabaseMaintenances.FeeDeleteDuplicates(true, DbmMode.Check); if (dbmResult.Trim() != _feeDeleteDuplicatesExpectedResult) { DatabaseMaintenances.FeeDeleteDuplicates(true, DbmMode.Fix); } //Create two fee schedules; from and to FeeSched feeSchedFrom = FeeSchedT.GetNewFeeSched(FeeScheduleType.Normal, MethodBase.GetCurrentMethod().Name + "_FROM"); FeeSched feeSchedTo = FeeSchedT.GetNewFeeSched(FeeScheduleType.Normal, MethodBase.GetCurrentMethod().Name + "_TO"); //Create a single fee and associate it to the "from" fee schedule. FeeT.CreateFee(feeSchedFrom.FeeSchedNum, _listProcCodes[_rand.Next(_listProcCodes.Count - 1)].CodeNum, _defaultFeeAmt); //Create a helper action that will simply copy the "from" schedule into the "to" schedule for the given fee cache passed in. Action actionCopyFromTo = new Action(() => { FeeScheds.CopyFeeSchedule(feeSchedFrom, 0, 0, feeSchedTo, null, 0); }); //Mimic each user clicking the "Copy" button from within the Fee Tools window one right after the other (before they click OK). actionCopyFromTo(); actionCopyFromTo(); //Make sure that there was NOT a duplicate fee inserted into the database. dbmResult = DatabaseMaintenances.FeeDeleteDuplicates(true, DbmMode.Check); Assert.AreEqual(dbmResult.Trim(), _feeDeleteDuplicatesExpectedResult, "Duplicate fees detected due to concurrent copying."); }
public void FeeSchedTools_CopyFeeSched_Clinics() { //Make sure there are no duplicate fees already present within the database. string dbmResult = DatabaseMaintenances.FeeDeleteDuplicates(true, DbmMode.Check); if (dbmResult.Trim() != _feeDeleteDuplicatesExpectedResult) { DatabaseMaintenances.FeeDeleteDuplicates(true, DbmMode.Fix); } //Make sure that there are more than six clinics ClinicT.ClearClinicTable(); for (int i = 0; i < 10; i++) { ClinicT.CreateClinic(MethodBase.GetCurrentMethod().Name + "_" + i); } //Create two fee schedules; from and to FeeSched feeSchedNumFrom = FeeSchedT.GetNewFeeSched(FeeScheduleType.Normal, MethodBase.GetCurrentMethod().Name + "_FROM"); FeeSched feeSchedNumTo = FeeSchedT.GetNewFeeSched(FeeScheduleType.Normal, MethodBase.GetCurrentMethod().Name + "_TO"); //Create a fee for every single procedure code in the database and associate it to the "from" fee schedule. foreach (ProcedureCode code in _listProcCodes) { FeeT.CreateFee(feeSchedNumFrom.FeeSchedNum, code.CodeNum, _rand.Next(5000)); } //Copy the "from" fee schedule into the "to" fee schedule and do it for at least seven clinics. FeeScheds.CopyFeeSchedule(feeSchedNumFrom, 0, 0, feeSchedNumTo, Clinics.GetDeepCopy(true).Select(x => x.ClinicNum).ToList(), 0); //Make sure that there was NOT a duplicate fee inserted into the database. dbmResult = DatabaseMaintenances.FeeDeleteDuplicates(true, DbmMode.Check); Assert.AreEqual(dbmResult.Trim(), _feeDeleteDuplicatesExpectedResult, "Duplicate fees detected due to concurrent copying."); }
private void FormRpProcCodes_Load(object sender, System.EventArgs e) { _listFeeScheds = FeeScheds.GetDeepCopy(true); _listProviders = Providers.GetListReports(); _listClinics = Clinics.GetDeepCopy(true); for (int i = 0; i < _listFeeScheds.Count; i++) { listBoxFeeSched.Items.Add(_listFeeScheds[i].Description); } listBoxFeeSched.SelectedIndex = 0; listBoxClinics.Items.Add(Lan.g(this, "Default")); if (PrefC.HasClinicsEnabled) { for (int i = 0; i < _listClinics.Count; i++) { listBoxClinics.Items.Add(_listClinics[i].Abbr); } } listBoxClinics.SelectedIndex = 0; listBoxProviders.Items.Add(Lan.g(this, "Default")); for (int i = 0; i < _listProviders.Count; i++) { listBoxProviders.Items.Add(_listProviders[i].Abbr); } listBoxProviders.SelectedIndex = 0; }
private void FormFeeSchedules_FormClosing(object sender, FormClosingEventArgs e) { //When user rearranges while using Type filters _listFeeSched has not been sorted by item order yet, see FillGrid(...) _listFeeScheds.Sort(CompareItemOrder); //Renumber itemorder for the entire list before closing, this is defensive to prevent duplicate itemorder values //Changes in the form using Up and Down affect ListFeeScheds, so the order of the list is the order that the user made. for (int i = 0; i < _listFeeScheds.Count; i++) { if (_listFeeScheds[i].ItemOrder != i) { _listFeeScheds[i].ItemOrder = i; } } try { //Only send a signal if changes were made during the sync. Changes can't be made if in selection mode. if (!_isSelectionMode && FeeScheds.Sync(_listFeeScheds, _listFeeSchedsOld)) { DataValid.SetInvalid(InvalidType.FeeScheds); } } catch (Exception ex) { string errMsg = Lans.g(this, "Error saving fee schedules."); if (ex is System.Web.Services.Protocols.SoapException && RemotingClient.RemotingRole == RemotingRole.ClientWeb) { //Middle tier users can get this error when their payload is too large. This is done rare enough we can ask them to do a direct connect. errMsg += " " + Lans.g(this, "Try making a direct connection to the database and performing this action again."); } FriendlyException.Show(errMsg, ex); } }
///<summary>Makes the "Before" and "After" columns human-readable for certain logs.</summary> private void TranslateBeforeAndAfter() { foreach (InsEditLog logCur in _listLogs) { long beforeKey = PIn.Long(logCur.OldValue, false); long afterKey = PIn.Long(logCur.NewValue, false); switch (logCur.FieldName) { case "CarrierNum": if (logCur.LogType == InsEditLogType.Carrier) { break; } string carrierNameBefore = Carriers.GetCarrier(beforeKey).CarrierName; string carrierNameAfter = Carriers.GetCarrier(afterKey).CarrierName; if (logCur.LogType == InsEditLogType.InsPlan && carrierNameBefore == carrierNameAfter) //Edits to carrier. { break; //Don't translate CarrierNum to CarrierName when both carriers have the same name, loses too much useful detail. } logCur.OldValue = beforeKey == 0 ? logCur.OldValue : carrierNameBefore; logCur.NewValue = afterKey == 0 ? logCur.NewValue : carrierNameAfter; break; case "EmployerNum": if (logCur.LogType == InsEditLogType.Employer) { break; } logCur.OldValue = beforeKey == 0 ? logCur.OldValue : Employers.GetName(beforeKey); logCur.NewValue = afterKey == 0 ? logCur.NewValue : Employers.GetName(afterKey); break; case "FeeSched": case "CopayFeeSched": case "AllowedFeeSched": logCur.OldValue = beforeKey == 0 ? logCur.OldValue : FeeScheds.GetDescription(beforeKey); logCur.NewValue = afterKey == 0 ? logCur.NewValue : FeeScheds.GetDescription(afterKey); break; case "BenefitType": logCur.OldValue = beforeKey == 0 ? logCur.OldValue : Enum.GetName(typeof(InsBenefitType), beforeKey); logCur.NewValue = afterKey == 0 ? logCur.NewValue : Enum.GetName(typeof(InsBenefitType), afterKey); break; case "CovCatNum": logCur.OldValue = beforeKey == 0 ? logCur.OldValue : CovCats.GetDesc(beforeKey); logCur.NewValue = afterKey == 0 ? logCur.NewValue : CovCats.GetDesc(afterKey); break; case "CodeNum": logCur.OldValue = beforeKey == 0 ? logCur.OldValue : ProcedureCodes.GetStringProcCode(beforeKey); logCur.NewValue = afterKey == 0 ? logCur.NewValue : ProcedureCodes.GetStringProcCode(afterKey); break; default: break; } } }
private void ControlDone(object sender, EventArgs e) { if (_isChanged) { FeeScheds.Sync(_listFeeScheds, _listFeeSchedsOld); DataValid.SetInvalid(InvalidType.FeeScheds); } }
private void butFeeSched_Click(object sender,EventArgs e) { //No need to check security because we are launching the form in selection mode. FormFeeScheds FormFS=new FormFeeScheds(true); FormFS.SelectedFeeSchedNum=(_feeSchedCur==null ? 0 : _feeSchedCur.FeeSchedNum); if(FormFS.ShowDialog()==DialogResult.OK) { _feeSchedCur=FeeScheds.GetFirst(x => x.FeeSchedNum==FormFS.SelectedFeeSchedNum); textFeeSched.Text=_feeSchedCur.Description; } }
private void FillGrid() { FeeScheds.RefreshCache(); if (listType.SelectedIndex == 0) { FeeSchedsForType = new List <FeeSched>(FeeSchedC.ListLong); //synch the itemorders just in case bool outOfSynch = false; for (int i = 0; i < FeeSchedsForType.Count; i++) { if (FeeSchedsForType[i].ItemOrder != i) { FeeSchedsForType[i].ItemOrder = i; FeeScheds.Update(FeeSchedsForType[i]); outOfSynch = true; changed = true; } } if (outOfSynch) { FeeScheds.RefreshCache(); FeeSchedsForType = new List <FeeSched>(FeeSchedC.ListLong); } } else { FeeSchedsForType = FeeScheds.GetListForType((FeeScheduleType)(listType.SelectedIndex - 1), true); } gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g("TableFeeScheds", "Description"), 145); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableFeeScheds", "Type"), 70); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableFeeScheds", "Hidden"), 60, HorizontalAlignment.Center); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; for (int i = 0; i < FeeSchedsForType.Count; i++) { row = new ODGridRow(); row.Cells.Add(FeeSchedsForType[i].Description); row.Cells.Add(FeeSchedsForType[i].FeeSchedType.ToString()); if (FeeSchedsForType[i].IsHidden) { row.Cells.Add("X"); } else { row.Cells.Add(""); } gridMain.Rows.Add(row); } gridMain.EndUpdate(); }
public static string ClearDb() { string command = @" DELETE FROM alertitem; DELETE FROM appointment; DELETE FROM apptreminderrule; DELETE FROM asapcomm; DELETE FROM carrier; DELETE FROM claim; DELETE FROM claimproc; DELETE FROM clinic; DELETE FROM clockevent; DELETE FROM confirmationrequest; DELETE FROM creditcard; DELETE FROM eclipboardsheetdef; DELETE FROM emailmessage; DELETE FROM employee; DELETE FROM fee; DELETE FROM feesched WHERE FeeSchedNum !=53; /*because this is the default fee schedule for providers*/ DELETE FROM hl7def; DELETE FROM hl7msg; DELETE FROM insplan; DELETE FROM mobileappdevice; DELETE FROM operatory; DELETE FROM patient; DELETE FROM patientportalinvite; DELETE FROM patientrace; DELETE FROM patplan; DELETE FROM payment; DELETE FROM paysplit; DELETE FROM payperiod; DELETE FROM payplan; DELETE FROM payplancharge; DELETE FROM pharmacy; DELETE FROM procedurelog; DELETE FROM provider WHERE ProvNum>2; DELETE FROM recall; DELETE FROM schedule; DELETE FROM sheet; DELETE FROM sheetdef; DELETE FROM sheetfield; DELETE FROM sheetfielddef; DELETE FROM smsphone; DELETE FROM smstomobile; DELETE FROM smsfrommobile; DELETE FROM timeadjust; DELETE FROM timecardrule; DELETE FROM userweb; " ; DataCore.NonQ(command); Providers.RefreshCache(); FeeScheds.RefreshCache(); PharmacyT.CreatePharmacies(); return("Database cleared of old data.\r\n"); }
///<summary>Returns feeSchedNum</summary> public static long CreateFeeSched(FeeScheduleType feeSchedType, string suffix) { FeeSched feeSched = new FeeSched(); feeSched.FeeSchedType = feeSchedType; feeSched.Description = "FeeSched" + suffix; FeeScheds.Insert(feeSched); FeeScheds.RefreshCache(); return(feeSched.FeeSchedNum); }
public static FeeSched GetNewFeeSched(FeeScheduleType feeSchedType, string suffix, bool isGlobal = true) { FeeSched feeSched = new FeeSched(); feeSched.FeeSchedType = feeSchedType; feeSched.Description = "FeeSched" + suffix; feeSched.IsGlobal = isGlobal; FeeScheds.Insert(feeSched); return(feeSched); }
private void FormDiscountPlanEdit_Load(object sender, EventArgs e) { textDescript.Text = DiscountPlanCur.Description; _listPatNames = DiscountPlans.GetPatsForPlan(DiscountPlanCur.DiscountPlanNum) .Select(x => x.LName + ", " + x.FName) .Distinct() .OrderBy(x => x) .ToList(); _feeSchedCur = FeeScheds.GetFirstOrDefault(x => x.FeeSchedNum == DiscountPlanCur.FeeSchedNum, true); textFeeSched.Text = _feeSchedCur != null ? _feeSchedCur.Description : ""; _listAdjTypeDefs = Defs.GetDiscountPlanAdjTypes().ToList(); for (int i = 0; i < _listAdjTypeDefs.Count; i++) { comboBoxAdjType.Items.Add(_listAdjTypeDefs[i].ItemName); if (_listAdjTypeDefs[i].DefNum == DiscountPlanCur.DefNum) { comboBoxAdjType.SelectedIndex = i; } } //populate patient information int countPats = _listPatNames.Count; textNumPatients.Text = countPats.ToString(); if (countPats > 10000) //10,000 per Nathan. copied from FormInsPlan.cs { comboPatient.Visible = false; butListPatients.Visible = true; butListPatients.Location = comboPatient.Location; } else { comboPatient.Visible = true; butListPatients.Visible = false; comboPatient.Items.Clear(); comboPatient.Items.AddRange(_listPatNames.ToArray()); if (_listPatNames.Count > 0) { comboPatient.SelectedIndex = 0; } } checkHidden.Checked = DiscountPlanCur.IsHidden; if (!Security.IsAuthorized(Permissions.InsPlanEdit, true)) //User may be able to get here if FormDiscountPlans is not in selection mode. { textDescript.ReadOnly = true; comboBoxAdjType.Enabled = false; butFeeSched.Enabled = false; butOK.Enabled = false; checkHidden.Enabled = false; } if (IsSelectionMode) { butDrop.Visible = true; } }
private void butCleanUp_Click(object sender, EventArgs e) { if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Delete allowed fee schedules that are not in use or that are attached to hidden insurance plans?")) { return; } long changed = FeeScheds.CleanupAllowedScheds(); MessageBox.Show(changed.ToString() + Lan.g(this, " unused fee schedules deleted.")); FillGrid(); }
///<summary>Makes the "Before" and "After" columns human-readable for certain logs.</summary> private void TranslateBeforeAndAfter() { foreach (InsEditLog logCur in _listLogs) { long beforeKey = PIn.Long(logCur.OldValue, false); long afterKey = PIn.Long(logCur.NewValue, false); switch (logCur.FieldName) { case "CarrierNum": if (logCur.LogType == InsEditLogType.Carrier) { break; } logCur.OldValue = beforeKey == 0 ? logCur.OldValue : Carriers.GetCarrier(beforeKey).CarrierName; logCur.NewValue = afterKey == 0 ? logCur.NewValue : Carriers.GetCarrier(afterKey).CarrierName; break; case "EmployerNum": if (logCur.LogType == InsEditLogType.Employer) { break; } logCur.OldValue = beforeKey == 0 ? logCur.OldValue : Employers.GetName(beforeKey); logCur.NewValue = afterKey == 0 ? logCur.NewValue : Employers.GetName(afterKey); break; case "FeeSched": case "CopayFeeSched": case "AllowedFeeSched": logCur.OldValue = beforeKey == 0 ? logCur.OldValue : FeeScheds.GetDescription(beforeKey); logCur.NewValue = afterKey == 0 ? logCur.NewValue : FeeScheds.GetDescription(afterKey); break; case "BenefitType": logCur.OldValue = beforeKey == 0 ? logCur.OldValue : Enum.GetName(typeof(InsBenefitType), beforeKey); logCur.NewValue = afterKey == 0 ? logCur.NewValue : Enum.GetName(typeof(InsBenefitType), afterKey); break; case "CovCatNum": logCur.OldValue = beforeKey == 0 ? logCur.OldValue : CovCats.GetDesc(beforeKey); logCur.NewValue = afterKey == 0 ? logCur.NewValue : CovCats.GetDesc(afterKey); break; case "CodeNum": logCur.OldValue = beforeKey == 0 ? logCur.OldValue : ProcedureCodes.GetStringProcCode(beforeKey); logCur.NewValue = afterKey == 0 ? logCur.NewValue : ProcedureCodes.GetStringProcCode(afterKey); break; default: break; } } }
///<summary>Supply in format UPIN^LastName^FirstName^MI. If UPIN(abbr) does not exist, provider gets created. If name has changed, provider gets updated. ProvNum is returned. If blank, then returns 0. If field is NULL, returns 0.</summary> public static long ProvProcess(FieldHL7 field) { if (field == null) { return(0); } string eID = field.GetComponentVal(0); eID = eID.Trim(); if (eID == "") { return(0); } Provider prov = Providers.GetProvByEcwID(eID); bool isNewProv = false; bool provChanged = false; if (prov == null) { isNewProv = true; prov = new Provider(); prov.Abbr = eID; //They can manually change this later. prov.EcwID = eID; prov.FeeSched = FeeScheds.GetFirst(true).FeeSchedNum; } if (prov.LName != field.GetComponentVal(1)) { provChanged = true; prov.LName = field.GetComponentVal(1); } if (prov.FName != field.GetComponentVal(2)) { provChanged = true; prov.FName = field.GetComponentVal(2); } if (prov.MI != field.GetComponentVal(3)) { provChanged = true; prov.MI = field.GetComponentVal(3); } if (isNewProv) { Providers.Insert(prov); Providers.RefreshCache(); } else if (provChanged) { Providers.Update(prov); Providers.RefreshCache(); } return(prov.ProvNum); }
private void FormFeeEdit_Load(object sender, System.EventArgs e) { FeeSched feeSched = FeeScheds.GetFirstOrDefault(x => x.FeeSchedNum == FeeCur.FeeSched); if (!FeeL.CanEditFee(feeSched, FeeCur.ProvNum, FeeCur.ClinicNum)) { DialogResult = DialogResult.Cancel; Close(); return; } Location = new Point(Location.X - 190, Location.Y - 20); textFee.Text = FeeCur.Amount.ToString("F"); }
private void butFeeSched_Click(object sender, EventArgs e) { //No need to check security because we are launching the form in selection mode. FormFeeScheds FormFS = new FormFeeScheds(true); FormFS.SelectedFeeSchedNum = (_feeSchedCur == null ? 0 : _feeSchedCur.FeeSchedNum); if (FormFS.ShowDialog() != DialogResult.OK) { return; } _feeSchedCur = FeeScheds.GetFirstOrDefault(x => x.FeeSchedNum == FormFS.SelectedFeeSchedNum, true); //Hidden FeeSched are invalid selections. textFeeSched.Text = (_feeSchedCur?.Description ?? ""); //Null check on OK click will force the user to make a FeeSched selection if null. }
/// <summary>Will return 0 if string cannot be parsed to a number. Will return 0 if the fee schedule passed in does not exactly match the description of a regular fee schedule.</summary> public static long FeeScheduleParse(string str) { if (str == "") { return(0); } FeeSched feeSched = FeeScheds.GetByExactName(str, FeeScheduleType.Normal); if (feeSched == null) { return(0); } return(feeSched.FeeSchedNum); }
private void FilterFeeSchedGroups() { List <FeeSched> listFilteredFeeScheds = FeeScheds.GetWhere(x => x.Description.ToLower().Contains(textFeeSched.Text.ToLower())); //Clinic filter will be either a list of all clinics or a list containing only the selected clinic List <Clinic> listFilteredClinics = (comboClinic.SelectedIndex == 0) ? _listAllClinics : _listAllClinics[comboClinic.SelectedIndex - 1].SingleItemToList(); //This filter should return everything if both filters are empty. _listFeeSchedGroupsFiltered = _listFeeSchedGroups .Where(x => x.FeeSchedNum.In(listFilteredFeeScheds.Select(y => y.FeeSchedNum))) .Where(x => x.ListClinicNumsAll.Any(y => y.In(listFilteredClinics.Select(z => z.ClinicNum)))) .ToList(); FillGridGroups(); FillGridClinics(); }
private void butCleanUp_Click(object sender, EventArgs e) { if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Delete allowed fee schedules that are not in use or that are attached to hidden insurance plans?")) { return; } long changed = FeeScheds.CleanupAllowedScheds(); MessageBox.Show(changed.ToString() + " " + Lan.g(this, "unused fee schedules deleted.")); FeeScheds.RefreshCache(); _listFeeScheds = FeeScheds.GetDeepCopy(_isSelectionMode); //After deletion, refresh in-memory copy to continue editing. _listFeeSchedsOld = _listFeeScheds.Select(x => x.Copy()).ToList(); FillGrid(); }
private void butEditFee_Click(object sender, EventArgs e) { //only allow once user has at least one valid fee schedule. if (_listFeeScheds.Count(x => x.Description.ToLower() != "default") == 0) { MsgBox.Show(this, "At least one fee schedule is required before moving on to entering and editing fees."); } FeeScheds.Sync(_listFeeScheds, _listFeeSchedsOld); DataValid.SetInvalid(InvalidType.FeeScheds); _listFeeSchedsOld = _listFeeScheds.Select(x => x.Copy()).ToList(); FormProcCodes FormPC = new FormProcCodes(); FormPC.ShowDialog(); }
private long GlobalUpdateWriteoffs(long clinicNum) { List <long> listWriteoffClinics = new List <long>() { clinicNum }; ODProgressExtended progress = new ODProgressExtended(ODEventType.FeeSched, new FeeSchedEvent(), new System.Windows.Forms.Form(), tag: new ProgressBarHelper(Lans.g(this, "Write-off Update Progress"), progressBarEventType: ProgBarEventType.Header), cancelButtonText: Lans.g(this, "Close")); progress.Fire(ODEventType.FeeSched, new ProgressBarHelper("", "0%" , 0, 100, ProgBarStyle.Blocks, "WriteoffProgress")); return(FeeScheds.GlobalUpdateWriteoffs(listWriteoffClinics, progress)); }
private void butChangePlanFrom_Click(object sender, EventArgs e) { FormDiscountPlans FormDPs = new FormDiscountPlans(); FormDPs.IsSelectionMode = true; if (FormDPs.ShowDialog() == DialogResult.OK) { _planFrom = FormDPs.SelectedPlan; textDescriptionFrom.Text = _planFrom.Description; textFeeSchedFrom.Text = FeeScheds.GetDescription(_planFrom.FeeSchedNum); textAdjTypeFrom.Text = Defs.GetName(DefCat.AdjTypes, _planFrom.DefNum); } CheckUIState(); }