예제 #1
0
        public void should_Get_ReferralLinkage_By_Client()
        {
            var encounters = _clientRepository.GetReferralLinkage(_clientId).ToList();

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

            Assert.True(details.Any());
        }
예제 #2
0
        public async Task <IEnumerable <ClientLinkageStage> > Extract(Guid?htsClientId = null)
        {
            var subscriber = await _subscriberSystemRepository.GetDefaultAsync();

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

            var encounters = _clientEncounterRepository.GetReferralLinkage(htsClientId);

            foreach (var encounter in encounters)
            {
                clients.Add(ClientLinkageStage.Create(encounter, subscriber));
            }

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