Ejemplo n.º 1
0
        public void should_Get_Tracing_By_Client()
        {
            var encounters = _clientRepository.GetTracing(_clientId).ToList();

            Assert.True(encounters.Any());
            var details = encounters.SelectMany(x => x.ObsTraceResults).ToList();

            Assert.True(details.Any());
        }
Ejemplo n.º 2
0
        public async Task <IEnumerable <ClientTracingStage> > Extract(Guid?htsClientId = null)
        {
            var subscriber = await _subscriberSystemRepository.GetDefaultAsync();

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

            var encounters = _clientEncounterRepository.GetTracing(htsClientId);

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

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