/// <summary> /// Translates the specified clinical payor coverage. /// </summary> /// <param name="clinicalPayorCoverage">The clinical payor coverage.</param> /// <returns>A billing PayorCoverage.</returns> public PayorCoverage Translate(PayorCoverageCache clinicalPayorCoverage) { if (clinicalPayorCoverage == null) { return null; } var payor = _payorRepository.GetByKey ( clinicalPayorCoverage.PayorCache.Key ); var clinicalPayorSubscriber = clinicalPayorCoverage.PayorSubscriberCache; var payorSubscriberRelationshipType = _lookupValueRepository.GetLookupByWellKnownName<PayorSubscriberRelationshipType> ( clinicalPayorSubscriber.PayorSubscriberRelationshipCacheType.WellKnownName ); var payorSubscriber = new PayorSubscriber ( clinicalPayorSubscriber.Address, clinicalPayorSubscriber.BirthDate, clinicalPayorSubscriber.AdministrativeGender, clinicalPayorSubscriber.Name, payorSubscriberRelationshipType ); var payorCoverageType = _lookupValueRepository.GetLookupByWellKnownName<PayorCoverageType> ( clinicalPayorCoverage.PayorCoverageCacheType.WellKnownName ); var billingPayorCoverage = new PayorCoverage ( payor, payorSubscriber, clinicalPayorCoverage.MemberNumber, clinicalPayorCoverage.EffectiveDateRange, payorCoverageType); return billingPayorCoverage; }
/// <summary> /// Translates the specified clinical payor coverage. /// </summary> /// <param name="clinicalPayorCoverage">The clinical payor coverage.</param> /// <returns>A billing PayorCoverage.</returns> public PayorCoverage Translate(PayorCoverageCache clinicalPayorCoverage) { if (clinicalPayorCoverage == null) { return(null); } var payor = _payorRepository.GetByKey(clinicalPayorCoverage.PayorCache.Key); var clinicalPayorSubscriber = clinicalPayorCoverage.PayorSubscriberCache; var payorSubscriberRelationshipType = _lookupValueRepository.GetLookupByWellKnownName <PayorSubscriberRelationshipType> ( clinicalPayorSubscriber.PayorSubscriberRelationshipCacheType.WellKnownName); var payorSubscriber = new PayorSubscriber( clinicalPayorSubscriber.Address, clinicalPayorSubscriber.BirthDate, clinicalPayorSubscriber.AdministrativeGender, clinicalPayorSubscriber.Name, payorSubscriberRelationshipType); var payorCoverageType = _lookupValueRepository.GetLookupByWellKnownName <PayorCoverageType> (clinicalPayorCoverage.PayorCoverageCacheType.WellKnownName); var billingPayorCoverage = new PayorCoverage( payor, payorSubscriber, clinicalPayorCoverage.MemberNumber, clinicalPayorCoverage.EffectiveDateRange, payorCoverageType); return(billingPayorCoverage); }
/// <summary> /// Initializes a new instance of the <see cref="PayorCoverage"/> class. /// </summary> /// <param name="payor">The payor.</param> /// <param name="payorSubscriber">The payor subscriber.</param> /// <param name="memberNumber">The member number.</param> /// <param name="effectiveCoverageDateRange">The effective coverage date range.</param> /// <param name="payorCoverageType">Type of the payor coverage.</param> public PayorCoverage(Payor payor, PayorSubscriber payorSubscriber, string memberNumber, DateRange effectiveCoverageDateRange, PayorCoverageType payorCoverageType ) { Check.IsNotNull ( payor, ()=> Payor ); Check.IsNotNull ( payorSubscriber, () => PayorSubscriber ); Check.IsNotNull ( memberNumber, () => MemberNumber ); Check.IsNotNull ( effectiveCoverageDateRange, () => EffectiveCoverageDateRange ); Check.IsNotNull ( payorCoverageType, () => PayorCoverageType ); Payor = payor; MemberNumber = memberNumber; EffectiveCoverageDateRange = effectiveCoverageDateRange; PayorSubscriber = payorSubscriber; PayorCoverageType = payorCoverageType; }