/// <summary> /// Gets the type of the payment. /// </summary> /// <param name="contractServiceTypeId">The contract service type identifier.</param> /// <param name="dtPaymentTypeMedicareIp">The dt payment type medicare ip.</param> /// <returns></returns> public static PaymentTypeMedicareIp GetPaymentType(long contractServiceTypeId, DataTable dtPaymentTypeMedicareIp) { PaymentTypeMedicareIp paymentTypeMedicareIp = null; if (dtPaymentTypeMedicareIp != null && dtPaymentTypeMedicareIp.Rows.Count > 0) { paymentTypeMedicareIp = (from DataRow medicareIpRow in dtPaymentTypeMedicareIp.Rows where (medicareIpRow["contractServiceTypeId"] != DBNull.Value && Convert.ToInt64(medicareIpRow["contractServiceTypeId"]) == contractServiceTypeId) select new PaymentTypeMedicareIp { ContractId = DBNull.Value == medicareIpRow["ContractId"] ? (long?)null : Convert.ToInt64( medicareIpRow["ContractId"]), ServiceTypeId = DBNull.Value == medicareIpRow["ContractServiceTypeID"] ? (long?)null : Convert.ToInt64( medicareIpRow["ContractServiceTypeID"]), InPatient = DBNull.Value == medicareIpRow["InPatient"] ? (double?)null : Convert.ToDouble( medicareIpRow["InPatient"]), PaymentTypeDetailId = Convert.ToInt64(medicareIpRow["PaymentTypeDetailID"]), PaymentTypeId = (byte)Enums.PaymentTypeCodes.MedicareIp, Formula = DBNull.Value == medicareIpRow["Formula"] ? string.Empty : Convert.ToString(medicareIpRow["Formula"]) }).FirstOrDefault(); } return(paymentTypeMedicareIp); }
public JsonResult AddEditPaymentTypeMedicareIp(PaymentTypeMedicareIpPaymentViewModel paymentTypeMedicareIp) { PaymentTypeMedicareIp medicareIpPayment = AutoMapper.Mapper.Map <PaymentTypeMedicareIpPaymentViewModel, PaymentTypeMedicareIp>(paymentTypeMedicareIp); //Get the Name of User logged in medicareIpPayment.UserName = GetCurrentUserName(); long medicareIpId = PostApiResponse <long>(Constants.PaymentTypeMedicareIp, Constants.AddEditPaymentTypeMedicareIpDetails, medicareIpPayment); return(medicareIpId > 0 ? Json(new { sucess = true, Id = medicareIpId }) : Json(new { sucess = false, Id = 0 })); }
public void AddEditPaymentTypeMedicareIpPaymentIfNotNull() { //Arrange Mock <IPaymentTypeMedicareIpRepository> mockAddEditPaymentTypeMedicareIpPayment = new Mock <IPaymentTypeMedicareIpRepository>(); mockAddEditPaymentTypeMedicareIpPayment.Setup(f => f.AddEditPaymentTypeMedicareIpPayment(It.IsAny <PaymentTypeMedicareIp>())).Returns(1); PaymentTypeMedicareIpLogic target = new PaymentTypeMedicareIpLogic(mockAddEditPaymentTypeMedicareIpPayment.Object); PaymentTypeMedicareIp objAddEditPaymentTypeMedicareIpPayment = new PaymentTypeMedicareIp { PaymentTypeDetailId = 1 }; //Act long actual = target.AddEditPaymentType(objAddEditPaymentTypeMedicareIpPayment); //Assert Assert.AreEqual(1, actual); }
public void GetPaymentTypeMedicareIpDetailsTest() { //Arrange PaymentTypeMedicareIp objAddEditPaymentTypeMedicareIpPayment = new PaymentTypeMedicareIp { PaymentTypeDetailId = 1, PaymentTypeId = 4, ContractId = 234, ServiceTypeId = null }; Mock <IPaymentTypeMedicareIpRepository> mockGetPaymentTypeStopLoss = new Mock <IPaymentTypeMedicareIpRepository>(); PaymentTypeMedicareIp result = new PaymentTypeMedicareIp(); mockGetPaymentTypeStopLoss.Setup(f => f.GetPaymentTypeMedicareIpPayment(objAddEditPaymentTypeMedicareIpPayment)).Returns(result); PaymentTypeMedicareIpLogic target = new PaymentTypeMedicareIpLogic(mockGetPaymentTypeStopLoss.Object); //Act PaymentTypeMedicareIp actual = (PaymentTypeMedicareIp)target.GetPaymentType(null); //Assert Assert.AreEqual(null, actual); }
/// <summary> /// Get PaymentType Medicare IP Payment /// </summary> /// <param name="paymentTypeMedicareIpPayment"></param> /// <returns>paymentTypeMedicareIPPaymentID</returns> public PaymentTypeMedicareIp GetPaymentTypeMedicareIpPayment(PaymentTypeMedicareIp paymentTypeMedicareIpPayment) { try { // Initialize the Stored Procedure _command = _database.GetStoredProcCommand("GetServiceLinesandPaymentTypes"); // Pass parameters to Stored Procedure(i.e., @ParamName), add values for _database.AddInParameter(_command, "@PaymentTypeID ", DbType.Int64, paymentTypeMedicareIpPayment.PaymentTypeId); _database.AddInParameter(_command, "@ContractID", DbType.Int64, paymentTypeMedicareIpPayment.ContractId); _database.AddInParameter(_command, "@ContractServiceTypeID", DbType.Int64, paymentTypeMedicareIpPayment.ServiceTypeId); _database.AddInParameter(_command, "@ServiceLineTypeId", DbType.Int64, 0); _database.AddInParameter(_command, "@UserName", DbType.String, paymentTypeMedicareIpPayment.UserName); // Retrieve the results of the Stored Procedure in Data set DataSet paymentTypeMedicareIpDataSet = _database.ExecuteDataSet(_command); if (paymentTypeMedicareIpDataSet.IsTableDataPopulated(0)) { //populating MedicareIp data if (paymentTypeMedicareIpDataSet.Tables[0].Rows != null && paymentTypeMedicareIpDataSet.Tables[0] != null && paymentTypeMedicareIpDataSet.Tables[0].Rows.Count > 0) { PaymentTypeMedicareIp paymentTypeIpPayment = new PaymentTypeMedicareIp { InPatient = DBNull.Value == paymentTypeMedicareIpDataSet.Tables[0].Rows[0]["InPatient"] ? (double?)null : Convert.ToDouble(paymentTypeMedicareIpDataSet.Tables[0].Rows[0]["InPatient"]), PaymentTypeDetailId = Convert.ToInt64(paymentTypeMedicareIpDataSet.Tables[0].Rows[0]["PaymentTypeDetailID"]), Formula = DBNull.Value == paymentTypeMedicareIpDataSet.Tables[0].Rows[0]["Formula"] ? string.Empty : Convert.ToString(paymentTypeMedicareIpDataSet.Tables[0].Rows[0]["Formula"]) }; return(paymentTypeIpPayment); } } } catch (Exception ex) { Log.LogError(string.Empty, string.Empty, ex); } //returns response to Business layer return(null); }
public ActionResult PaymentTypeMedicareIp(long?contractId, long?serviceTypeId, int paymentTypeId, bool isEdit) { PaymentTypeMedicareIpPaymentViewModel paymentTypeMedicareIpViewModel = new PaymentTypeMedicareIpPaymentViewModel(); // Getting the list of Medicare ip options List <MedicareIpAcuteOption> medicareIpAcuteOptions = GetApiResponse <List <MedicareIpAcuteOption> >(Constants.MedicareIpAcuteOption, Constants.GetMedicareIpAcuteOptions); if (isEdit) { PaymentTypeMedicareIp paymentTypeMedicareIp = new PaymentTypeMedicareIp { ServiceTypeId = serviceTypeId, ContractId = contractId, PaymentTypeId = paymentTypeId, //Get the Name of User logged in UserName = GetCurrentUserName() }; paymentTypeMedicareIpViewModel = AutoMapper.Mapper.Map <PaymentTypeMedicareIp, PaymentTypeMedicareIpPaymentViewModel>( PostApiResponse <PaymentTypeMedicareIp>(Constants.PaymentTypeMedicareIp, Constants.GetPaymentTypeMedicareIpDetails, paymentTypeMedicareIp)); } paymentTypeMedicareIpViewModel.ContractId = contractId; paymentTypeMedicareIpViewModel.ServiceTypeId = serviceTypeId; paymentTypeMedicareIpViewModel.PaymentTypeId = paymentTypeId; paymentTypeMedicareIpViewModel.IsEdit = isEdit; paymentTypeMedicareIpViewModel.MedicareIpAcuteOptions = new List <MedicareIpAcuteOptionViewModel>(); foreach (MedicareIpAcuteOption medicareIpAcuteOption in medicareIpAcuteOptions) { paymentTypeMedicareIpViewModel.MedicareIpAcuteOptions.Add( AutoMapper.Mapper.Map <MedicareIpAcuteOption, MedicareIpAcuteOptionViewModel>(medicareIpAcuteOption)); } return(View(paymentTypeMedicareIpViewModel)); }
/// <summary> /// AddEdit PaymentType Medicare IP Payment /// </summary> /// <param name="paymentTypeMedicareIpPayment"></param> /// <returns>paymentTypeMedicareIPPaymentID</returns> public long AddEditPaymentTypeMedicareIpPayment(PaymentTypeMedicareIp paymentTypeMedicareIpPayment) { long paymentTypeMedicareIpPaymentId = 0; //Checks if input request is not null if (paymentTypeMedicareIpPayment != null) { // Initialize the Stored Procedure _command = _database.GetStoredProcCommand("AddEditMedicareIPPayment"); // Pass parameters to Stored Procedure(i.e., @ParamName), add values for _database.AddInParameter(_command, "@PaymentTypeDetailID", DbType.Int64, paymentTypeMedicareIpPayment.PaymentTypeDetailId); _database.AddInParameter(_command, "@InPatient ", DbType.Decimal, paymentTypeMedicareIpPayment.InPatient); _database.AddInParameter(_command, "@Formula", DbType.String, paymentTypeMedicareIpPayment.Formula); _database.AddInParameter(_command, "@PaymentTypeID ", DbType.Int64, paymentTypeMedicareIpPayment.PaymentTypeId); _database.AddInParameter(_command, "@ContractID", DbType.Int64, paymentTypeMedicareIpPayment.ContractId); _database.AddInParameter(_command, "@ContractServiceTypeID", DbType.Int64, paymentTypeMedicareIpPayment.ServiceTypeId); _database.AddInParameter(_command, "@UserName", DbType.String, paymentTypeMedicareIpPayment.UserName); // Retrieve the results of the Stored Procedure in Datatable paymentTypeMedicareIpPaymentId = long.Parse(_database.ExecuteScalar(_command).ToString()); } //returns response to Business layer return(paymentTypeMedicareIpPaymentId); }
public PaymentTypeMedicareIp GetPaymentTypeMedicareIpDetails(PaymentTypeMedicareIp paymentTypeMedicareIpPayment) { return((PaymentTypeMedicareIp)_medicareIpDetailsLogic.GetPaymentType(paymentTypeMedicareIpPayment)); }
public long AddEditPaymentTypeMedicareIpDetails(PaymentTypeMedicareIp paymentTypeMedicareIpPayment) { return(_medicareIpDetailsLogic.AddEditPaymentType(paymentTypeMedicareIpPayment)); }
public void EvaluateForIcd10ProcedureCodeNotNull() { //Arrange List <PaymentResult> paymentResults = new List <PaymentResult> { new PaymentResult { ClaimId = 123, Line = 1, AdjudicatedValue = null, ServiceTypeId = 1, ContractId = 1 }, new PaymentResult { ClaimId = 123, AdjudicatedValue = null, ServiceTypeId = 1, ContractId = 1 }, }; PaymentTypeMedicareIp paymentTypeMedicareIp = new PaymentTypeMedicareIp { PayAtClaimLevel = true, ValidLineIds = new List <int> { 1, 2, 3, 4, 5, 6 }, Conditions = new List <ICondition> { new Condition { ConditionOperator = (byte)Enums.ConditionOperation.EqualTo, LeftOperands = new List <string> { "300" }, OperandType = (byte)Enums.OperandIdentifier.HcpcsCode, RightOperand = "300" } }, ContractId = 1, HcpcsCode = "300", ServiceTypeId = 1, IsMedicareIpAcuteEnabled = true }; Mock <IContractServiceTypeLogic> mockContractServiceTypeLogic = new Mock <IContractServiceTypeLogic>(); Mock <IPaymentResultLogic> mockPaymentResultLogic = new Mock <IPaymentResultLogic>(); mockPaymentResultLogic.Setup( x => x.Evaluate(It.IsAny <EvaluateableClaim>(), It.IsAny <List <PaymentResult> >(), It.IsAny <bool>(), It.IsAny <bool>())).Returns(paymentResults); Mock <IPaymentTypeMedicareIpRepository> paymentTypeMedicareIpRepository = new Mock <IPaymentTypeMedicareIpRepository>(); paymentTypeMedicareIpRepository.Setup(x => x.GetPaymentTypeMedicareIpPayment(It.IsAny <PaymentTypeMedicareIp>())) .Returns(paymentTypeMedicareIp); var target = new PaymentTypeMedicareIpLogic(paymentTypeMedicareIpRepository.Object) { PaymentTypeBase = paymentTypeMedicareIp }; IEvaluateableClaim evaluateableClaim = new EvaluateableClaim(); evaluateableClaim.ClaimId = 123; evaluateableClaim.StatementThru = DateTime.Parse("10/01/2015 12:00:00 AM"); evaluateableClaim.MedicareInPatient = new MedicareInPatient { Charges = 10, ClaimId = 123, Npi = "1003814971", Drg = "070", DischargeDate = DateTime.Now.AddDays(-20), DischargeStatus = "01", LengthOfStay = 10 }; evaluateableClaim.ClaimTotal = 100; evaluateableClaim.ClaimCharges = new List <ClaimCharge> { new ClaimCharge { Line = 1, Amount = 20, HcpcsCode = "300" }, new ClaimCharge { Line = 2, Amount = 20, HcpcsCode = "301" }, new ClaimCharge { Line = 3, Amount = 20, HcpcsCode = "302" }, new ClaimCharge { Line = 4, Amount = 20, HcpcsCode = "303" }, new ClaimCharge { Line = 5, Amount = 20, HcpcsCode = "304" }, new ClaimCharge { Line = 6, Amount = 20, HcpcsCode = "305" } }; evaluateableClaim.ProcedureCodes = new List <ProcedureCode> { new ProcedureCode { ClaimId = 123, Instance = "O", IcdpCode = "256369" }, new ProcedureCode { ClaimId = 123, Instance = "O", IcdpCode = "25636.256" } }; List <PaymentResult> updatedPaymentResults = new List <PaymentResult> { new PaymentResult { ClaimId = 123, ContractId = 1, AdjudicatedValue = 110 }, new PaymentResult { ClaimId = 123, Line = 1, ContractId = 1, AdjudicatedValue = 110 } }; Mock <ContractBaseLogic> mockContractBaseLogic = new Mock <ContractBaseLogic>(); mockContractServiceTypeLogic.Setup(x => x.IsValidServiceType()).Returns(true); mockContractServiceTypeLogic.Setup(x => x.Evaluate(evaluateableClaim, paymentResults, false, false)) .Returns(updatedPaymentResults); mockContractBaseLogic.SetupAllProperties(); //Act List <PaymentResult> actual = target.EvaluatePaymentType(evaluateableClaim, paymentResults, false, false); // Assert Assert.AreEqual(3, actual.Count); var firstOrDefault = paymentResults.FirstOrDefault(x => x.AdjudicatedValue != null); Assert.IsNull(firstOrDefault); }