Ejemplo n.º 1
0
        public static IEnumerable <DwhManifest> Create(IEnumerable <SitePatientProfile> profiles, EmrDto emrDto,
                                                       IEnumerable <Site> sites)
        {
            var list = new List <DwhManifest>();

            if (emrDto.EmrSetup == EmrSetup.SingleFacility)
            {
                var site     = sites.OrderByDescending(x => x.PatientCount).First();
                var manifest = new DwhManifest(site.SiteCode, profiles.Select(x => x.PatientPk).ToList(), site.SiteName, emrDto);
                list.Add(manifest);
                return(list);
            }

            // multi site setup

            foreach (var site in sites)
            {
                var pks = profiles
                          .Where(x => x.SiteCode == site.SiteCode)
                          .Select(x => x.PatientPk)
                          .ToList();
                var manifest = new DwhManifest(site.SiteCode, pks, site.SiteName, emrDto);
                list.Add(manifest);
            }

            return(list);
        }
Ejemplo n.º 2
0
 public DwhManifestMessage(DwhManifest manifest)
 {
     Manifest = manifest;
 }