public BeneficiaryDTO GetBeneficiary(int beneficiaryId) { try { //Requires.NotNegative("beneficiaryId", beneficiaryId); log.Debug("beneficiaryId: " + beneficiaryId + " "); // get R_Beneficiary t = Repository.GetBeneficiary(beneficiaryId); BeneficiaryDTO dto = new BeneficiaryDTO(t); log.Debug(BeneficiaryDTO.FormatBeneficiaryDTO(dto)); return(dto); } catch (System.Exception e) { // error log.Error(e.ToString()); throw; } }
public PaymentModel GetPaymentObject(string patientCid) { PaymentModel payment = new PaymentModel(); var ben = _beneficiaryRepository.GetBeneficiary(patientCid); var patient = _patientRepository.GetPatient(patientCid); var companion = _companionRepository.GetCompanion(ben?.CompanionCID); if (patient != null && ben != null) { payment.IsActive = patient.IsActive; payment.PatientCID = patientCid; payment.PatientFName = patient.PatientFName; payment.PatientLName = patient.PatientLName; payment.PatientMName = patient.PatientMName; payment.Agency = patient.Agency; payment.Hospital = patient.Hospital; payment.CompanionCID = ben.CompanionCID; payment.CompanionFName = companion?.CompanionFName; payment.CompanionLName = companion?.CompanionLName; payment.CompanionMName = companion?.CompanionMName; payment.BeneficiaryMName = ben.BeneficiaryFName; payment.BeneficiaryBank = ben.BankName; payment.BeneficiaryIBan = ben.IBan; payment.BeneficiaryCID = ben.BeneficiaryCID; payment.BeneficiaryFName = ben.BeneficiaryFName; payment.BeneficiaryLName = ben.BeneficiaryLName; //Todo: This should be done a better way payment.Payments = GetPaymentsByPatientCid(patientCid)?.OrderByDescending(p => p.CreatedDate).ToList(); payment.PayRates = _payRateRepository.GetPayRatesList(); payment.PatientPayRate = _domainObjectRepository.Get <PayRate>(c => c.PayRateID == 1).PatientRate; payment.CompanionPayRate = !String.IsNullOrEmpty(ben.CompanionCID) ? _domainObjectRepository.Get <PayRate>(c => c.PayRateID == 1).CompanionRate : 0; } return(payment); }
public void GetBeneficiaryTest() { string patientCid = "333432901010";//333432901010 var benList = _beneficiaryRepository.GetBeneficiary(patientCid); }