Ejemplo n.º 1
0
 public static PARTNER_SCREENING Create(ClientPartnerScreeningStage clientTracingStage)
 {
     return(new PARTNER_SCREENING(
                clientTracingStage.PnsAccepted,
                clientTracingStage.ScreeningDate.ToIqDateOnly(),
                clientTracingStage.IpvScreeningDone.Value,
                clientTracingStage.HurtByPartner.Value,
                clientTracingStage.ThreatByPartner.Value,
                clientTracingStage.SexualAbuseByPartner.Value,
                clientTracingStage.IpvOutcome.Value,
                clientTracingStage.PartnerOccupation,
                clientTracingStage.PartnerRelationship.Value,
                clientTracingStage.LivingWithClient.Value,
                clientTracingStage.HivStatus.Value,
                clientTracingStage.PnsApproach.Value,
                clientTracingStage.EligibleForHts.Value,
                clientTracingStage.BookingDate.ToIqDateOnly()));
 }
        public async Task <IEnumerable <ClientPartnerScreeningStage> > Extract(Guid?htsClientId = null)
        {
            var subscriber = await _subscriberSystemRepository.GetDefaultAsync();

            if (null == subscriber)
            {
                throw new Exception("Default EMR NOT SET");
            }
            var clients = new List <ClientPartnerScreeningStage>();

            var encounters = _clientEncounterRepository.GetPartnerScreening(htsClientId);

            foreach (var encounter in encounters)
            {
                clients.AddRange(ClientPartnerScreeningStage.Create(encounter, subscriber));
            }

            return(clients.Where(x => !x.Id.IsNullOrEmpty()));
        }