/// <summary> /// Gets the total amount. /// </summary> /// <param name="pricerDll">The pricer DLL.</param> /// <returns></returns> private double GetTotalAmount(NetPrcM5 pricerDll) { double amount = 0.0; if (!string.IsNullOrEmpty(PaymentTypeMedicareIp.Formula)) { List <string> formulaProperties = PaymentTypeMedicareIp.Formula.Replace(Constants.Space, string.Empty).Split('+').ToList(); List <string> availableProperties = GetAvailableFormulaProperties(); bool isAllPropertySelected = (formulaProperties.Count == availableProperties.Count) && !formulaProperties.Except(availableProperties).Any(); if (isAllPropertySelected) { amount = pricerDll.TotalPayment; } else { Applyformula(formulaProperties, ref amount, pricerDll); } } return(amount); }
private static void Applyformula(IEnumerable <string> formulaProperties, ref double amount, NetPrcM5 pricerDll) { foreach (string formula in formulaProperties) { switch (formula.Trim()) { case Constants.Fsp: amount += pricerDll.FSP; break; case Constants.Hsp: amount += pricerDll.HSP; break; case Constants.Co: amount += pricerDll.CostOutlier; break; case Constants.Ime: amount += pricerDll.IME; break; case Constants.Dsh: amount += pricerDll.DSH; break; case Constants.PassThru: amount += pricerDll.PassThru; break; case Constants.TechAddOnPayment: amount += pricerDll.TechAddOnPayment; break; case Constants.LowVolumeAddOn: amount += pricerDll.LowVolumeAddOn; break; case Constants.Hrr: amount += pricerDll.HRR; break; case Constants.Vbp: amount += pricerDll.VBP; break; case Constants.Ucc: amount += pricerDll.UCC; break; case Constants.Hac: amount += pricerDll.HACReduction; break; case Constants.Cap: amount += pricerDll.CapitalPayment; break; case Constants.CapDsh: amount += pricerDll.Capital_DSH_Amt; break; case Constants.CapExceptionsAmount: amount += pricerDll.Capital_Exceptions_Amt; break; case Constants.CapFsp: amount += pricerDll.Capital_FSP_Amt; break; case Constants.CapHsp: amount += pricerDll.Capital_HSP_Amt; break; case Constants.CapIme: amount += pricerDll.Capital_IME_Amt; break; case Constants.CapOldHarm: amount += pricerDll.Capital_OldHarm_Amt; break; case Constants.CapOutlier: amount += pricerDll.Capital_Outlier_Amt; break; } } }
private MedicareInPatientResult GetMedicareInPatientResult(IEvaluateableClaim claim) { MedicareInPatientResult medicareInPatientResult = new MedicareInPatientResult(); MedicareInPatient medicarePatient = claim.MedicareInPatient; _pricerDll = new NetPrcM5 { Provider = medicarePatient.Npi, DDate = medicarePatient.DischargeDate.ToString(CultureInfo.InvariantCulture), DRG = medicarePatient.Drg, DStat = medicarePatient.DischargeStatus }; _pricerDll.ReviewCode = _pricerDll.DStat; _pricerDll.LOS = medicarePatient.LengthOfStay; _pricerDll.Charges = medicarePatient.Charges; //A string of diagnosis codes formatted as 7-Byte values. //Each code is left justified and blank filled to a length of 7 bytes. //Any decimal point in the diagnosis code should be removed before passing the code to PRICERActive. _pricerDll.DiagnosisCodes = GetDiagnosisCodeString(claim.DiagnosisCodes, claim.StatementThru); //A string of procedure codes formatted as 7-Byte values. //Each code is left justified and blank filled to a length of 7 bytes. //Any decimal point in the procedure code should be removed before passing the code to PRICERActive. _pricerDll.ProcedureCodes = GetProcedureCodeString(claim.ProcedureCodes, claim.StatementThru); //If statementThru Date is equal to or greater than 10/01/2015, then we pass "0" as ICDVersion10 else "9" as ICDVersion 9 _pricerDll.ICDVersion = claim.StatementThru >= DateTime.Parse(Constants.IcdVersionDate, CultureInfo.InvariantCulture) ? Constants.IcdVersion10 : Constants.IcdVersion9; _pricerDll.DeviceCreditAmount = Constants.DeviceCreditAmount; // 0; // Source unknown. _pricerDll.DIFICIDOnClaim = Constants.DificidOnClaim; // false; _pricerDll.HMOClaim = Constants.HmoClaim; // false; _pricerDll.IncludePassthru = Constants.IncludePassthru; //false; _pricerDll.AllowTerminatedProvider = Constants.AllowTerminatedProvider; // false; _pricerDll.AdjustmentFactor = Constants.AdjustmentFactor; // 1; _pricerDll.AdjustmentOption = Constants.AdjustmentOption; // 0; if (GlobalConfigVariable.IsMicrodynLogEnabled) { XmlSerializer xsSubmit = new XmlSerializer(typeof(NetPrcM5)); StringWriter sww = new StringWriter(); XmlWriter writer = XmlWriter.Create(sww); xsSubmit.Serialize(writer, _pricerDll); var xml = sww.ToString(); Log.LogInfo("MedicareInPatient Input : \n" + xml, "MicrodynPriceInputData"); } if (GlobalConfigVariable.IsMicrodynEnabled) { _pricerDll.PRICERCalc(); string message = string.Empty; medicareInPatientResult.TotalPaymentAmount = _pricerDll.PRICERSuccess ? GetTotalAmount(_pricerDll) : 0.00; medicareInPatientResult.IsSucess = _pricerDll.PRICERSuccess; message = GetPricerReturnValue(_pricerDll.ReturnCode, message, _pricerDll.PRICERSuccess); medicareInPatientResult.ClaimId = claim.ClaimId; medicareInPatientResult.ReturnCode = _pricerDll.ReturnCode; medicareInPatientResult.Message = message; if (GlobalConfigVariable.IsMicrodynLogEnabled) { Log.LogInfo( string.Format(CultureInfo.InvariantCulture, Constants.MedicareIpClaimIdLog, medicareInPatientResult.Message, medicareInPatientResult.ClaimId), Constants.MicrodynInPatientMessage); } } else { medicareInPatientResult.ReturnCode = 0; medicareInPatientResult.TotalPaymentAmount = 0; medicareInPatientResult.Message = Constants.MessageMicrodyneOff; medicareInPatientResult.IsSucess = true; } //After processing, destroy the Reimbursement DLL object _pricerDll.Dispose(); return(medicareInPatientResult); }