示例#1
0
        static ResolvingConflictException ToConceptMapUrlConflictException(this IEnumerable <ArtifactSummary> summaries)
        {
            // Check for duplicate concept map source/target urls
            var duplicates =
                from cm in summaries.OfResourceType(ResourceType.ConceptMap)
                from url in GetConceptMapUrls(cm)
                where url != null
                group cm by url into g
                where g.Count() > 1 // g.Skip(1).Any()
                select g;

            var conflicts = ToConflicts(duplicates);

            return(ResolvingConflictException.ConceptMapUrlConflict(conflicts));
        }
示例#2
0
        static ResolvingConflictException ToValueSetSystemConflictException(this IEnumerable <ArtifactSummary> summaries)
        {
            // Check for duplicate ValueSet.system values
            var duplicates =
                from ns in summaries.OfResourceType(ResourceType.ValueSet)
                let system = ns.GetValueSetSystem()
                             where system != null
                             group ns by system into g
                             where g.Count() > 1 // g.Skip(1).Any()
                             select g;

            var conflicts = ToConflicts(duplicates);

            return(ResolvingConflictException.ValueSetSystemConflict(conflicts));
        }
示例#3
0
        static ResolvingConflictException ToCanonicalUrlConflictException(this IEnumerable <ArtifactSummary> summaries)
        {
            // Check for duplicate canonical urls
            var duplicates =
                from cr in summaries.ConformanceResources()
                let canonical = cr.GetConformanceCanonicalUrl()
                                where canonical != null
                                group cr by canonical into g
                                where g.Count() > 1 // g.Skip(1).Any()
                                select g;

            var conflicts = ToConflicts(duplicates);

            return(ResolvingConflictException.CanonicalUrlConflict(conflicts));
        }
示例#4
0
        static ResolvingConflictException ToNamingSystemUrlConflictException(this IEnumerable <ArtifactSummary> summaries)
        {
            // Check for duplicate NamingSystem.uniqueId values
            var duplicates =
                from ns in summaries.OfResourceType(ResourceType.NamingSystem)
                from ids in ns.GetNamingSystemUniqueId()
                where ids != null
                group ns by ids into g
                where g.Count() > 1 // g.Skip(1).Any()
                select g;

            var conflicts = ToConflicts(duplicates);

            return(ResolvingConflictException.NamingSystemUniqueIdConflict(conflicts));
        }
示例#5
0
        static ResolvingConflictException ToResourceUriConflictException(this IEnumerable <ArtifactSummary> summaries)
        {
            // Check for duplicate resource uris
            var duplicates =
                from s in summaries
                let uri = s.ResourceUri
                          where uri != null
                          group s by uri into g
                          where g.Count() > 1 // g.Skip(1).Any()
                          select g;

            var conflicts = ToConflicts(duplicates);

            return(ResolvingConflictException.ResourceUriConflict(conflicts));
        }