Exemple #1
0
		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;
			}
		}
Exemple #2
0
        ///<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 SaveAllowedFees()
        {
            //if no allowed fees entered, then nothing to do
            bool allowedFeesEntered = false;

            for (int i = 0; i < gridMain.ListGridRows.Count; i++)
            {
                if (gridMain.ListGridRows[i].Cells[gridMain.ListGridColumns.GetIndex(Lan.g("TableClaimProc", "Allowed"))].Text != "")
                {
                    allowedFeesEntered = true;
                    break;
                }
            }
            if (!allowedFeesEntered)
            {
                return;
            }
            //if no allowed fee schedule, then nothing to do
            InsPlan plan = InsPlans.GetPlan(ClaimProcsToEdit[0].PlanNum, PlanList);

            if (plan.AllowedFeeSched == 0)          //no allowed fee sched
            //plan.PlanType!="p" && //not ppo, and
            {
                return;
            }
            //ask user if they want to save the fees
            if (!MsgBox.Show(this, true, "Save the allowed amounts to the allowed fee schedule?"))
            {
                return;
            }
            //select the feeSchedule
            long feeSched = -1;

            //if(plan.PlanType=="p"){//ppo
            //	feeSched=plan.FeeSched;
            //}
            //else if(plan.AllowedFeeSched!=0){//an allowed fee schedule exists
            feeSched = plan.AllowedFeeSched;
            //}
            if (FeeScheds.GetIsHidden(feeSched))
            {
                MsgBox.Show(this, "Allowed fee schedule is hidden, so no changes can be made.");
                return;
            }
            Fee              FeeCur = null;
            long             codeNum;
            List <Procedure> ProcList = Procedures.Refresh(PatCur.PatNum);
            Procedure        proc;
            List <long>      invalidFeeSchedNums = new List <long>();

            for (int i = 0; i < ClaimProcsToEdit.Length; i++)
            {
                proc    = Procedures.GetProcFromList(ProcList, ClaimProcsToEdit[i].ProcNum);
                codeNum = proc.CodeNum;
                //ProcNum not found or 0 for payments
                if (codeNum == 0)
                {
                    continue;
                }
                if (gridMain.ListGridRows[i].Cells[gridMain.ListGridColumns.GetIndex(Lan.g("TableClaimProc", "Allowed"))].Text.Trim() == "" &&         //Nothing is entered in allowed
                    _listClaimProcsOld[i].AllowedOverride == -1)                      //And there was not originally a value in the allowed column
                {
                    continue;
                }
                DateTime datePrevious = DateTime.MinValue;
                FeeCur = Fees.GetFee(codeNum, feeSched, proc.ClinicNum, proc.ProvNum);
                if (FeeCur == null)
                {
                    FeeSched feeSchedObj = FeeScheds.GetFirst(x => x.FeeSchedNum == feeSched);
                    FeeCur           = new Fee();
                    FeeCur.FeeSched  = feeSched;
                    FeeCur.CodeNum   = codeNum;
                    FeeCur.ClinicNum = (feeSchedObj.IsGlobal) ? 0 : proc.ClinicNum;
                    FeeCur.ProvNum   = (feeSchedObj.IsGlobal) ? 0 : proc.ProvNum;
                    FeeCur.Amount    = PIn.Double(gridMain.ListGridRows[i].Cells[gridMain.ListGridColumns.GetIndex(Lan.g("TableClaimProc", "Allowed"))].Text);
                    Fees.Insert(FeeCur);
                }
                else
                {
                    datePrevious  = FeeCur.SecDateTEdit;
                    FeeCur.Amount = PIn.Double(gridMain.ListGridRows[i].Cells[gridMain.ListGridColumns.GetIndex(Lan.g("TableClaimProc", "Allowed"))].Text);
                    Fees.Update(FeeCur);
                }
                SecurityLogs.MakeLogEntry(Permissions.ProcFeeEdit, 0, Lan.g(this, "Procedure") + ": " + ProcedureCodes.GetStringProcCode(FeeCur.CodeNum)
                                          + ", " + Lan.g(this, "Fee") + ": " + FeeCur.Amount.ToString("c") + ", " + Lan.g(this, "Fee Schedule") + " " + FeeScheds.GetDescription(FeeCur.FeeSched)
                                          + ". " + Lan.g(this, "Automatic change to allowed fee in Enter Payment window.  Confirmed by user."), FeeCur.CodeNum, DateTime.MinValue);
                SecurityLogs.MakeLogEntry(Permissions.LogFeeEdit, 0, Lan.g(this, "Fee Updated"), FeeCur.FeeNum, datePrevious);
                invalidFeeSchedNums.Add(FeeCur.FeeSched);
            }
        }
Exemple #4
0
        ///<summary>Used by eCW.  This will locate a provider by EcwID and update the FName, LName, and MI if necessary.  If no provider is found by EcwID, than a new provider is inserted and the FName, LName, and MI are set.  Supply in format UPIN^LastName^FirstName^MI (PV1 or AIP) or UPIN^LastName, FirstName MI (AIG).  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. For PV1, the provider.LName field will hold "LastName, FirstName MI". They can manually change later.</summary>
        public static long ProvProcessEcw(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 (field.Components.Count == 4)           //PV1 segment in format UPIN^LastName^FirstName^MI
            {
                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);
                }
            }
            else if (field.Components.Count == 2)           //AIG segment in format UPIN^LastName, FirstName MI
            {
                string[] components = field.GetComponentVal(1).Split(' ');
                if (components.Length > 0)
                {
                    components[0] = components[0].TrimEnd(',');
                    if (prov.LName != components[0])
                    {
                        provChanged = true;
                        prov.LName  = components[0];
                    }
                }
                if (components.Length > 1 && prov.FName != components[1])
                {
                    provChanged = true;
                    prov.FName  = components[1];
                }
                if (components.Length > 2 && prov.MI != components[2])
                {
                    provChanged = true;
                    prov.MI     = components[2];
                }
            }
            if (isNewProv)
            {
                Providers.Insert(prov);
                Providers.RefreshCache();
            }
            else if (provChanged)
            {
                Providers.Update(prov);
                Providers.RefreshCache();
            }
            return(prov.ProvNum);
        }