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)); }
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)); }
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)); }
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)); }
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)); }