/// <summary>Harvest specific summary information from a <see cref="StructureDefinition"/> resource.</summary> /// <returns><c>true</c> if the current target represents a <see cref="StructureDefinition"/> resource, or <c>false</c> otherwise.</returns> /// <remarks>The <see cref="ArtifactSummaryGenerator"/> calls this method from a <see cref="ArtifactSummaryHarvester"/> delegate.</remarks> public static bool Harvest(ISourceNode nav, ArtifactSummaryPropertyBag properties) { if (IsStructureDefinitionSummary(properties)) { // [WMR 20171218] Harvest global core extensions, e.g. MaturityLevel nav.HarvestExtensions(properties, harvestExtension); // Explicit extractor chaining if (ConformanceSummaryProperties.Harvest(nav, properties)) { nav.HarvestValue(properties, FhirVersionKey, "fhirVersion"); nav.HarvestValue(properties, KindKey, "kind"); nav.HarvestValue(properties, ConstrainedTypeKey, "constrainedType"); nav.HarvestValue(properties, ContextTypeKey, "contextType"); // [WMR 20180919] NEW: Extension Context nav.HarvestValues(properties, ContextKey, "context"); nav.HarvestValue(properties, BaseKey, "base"); // [WMR 20180725] Also harvest definition property from (first) root element in snapshot/differential // HL7 FHIR website displays this text as introduction on top of each resource/datatype page var elementNode = nav.Children("snapshot").FirstOrDefault() ?? nav.Children("differential").FirstOrDefault(); if (elementNode != null) { var childNode = elementNode.Children("element").FirstOrDefault(); if (childNode != null && Navigation.ElementDefinitionNavigator.IsRootPath(childNode.Name)) { childNode.HarvestValue(properties, RootDefinitionKey, "definition"); } } } return(true); } return(false); }
/// <summary>Harvest specific summary information from a <see cref="ValueSet"/> resource.</summary> /// <returns><c>true</c> if the current target is a ValueSet, or <c>false</c> otherwise.</returns> /// <remarks>The <see cref="ArtifactSummaryGenerator"/> calls this method from a <see cref="ArtifactSummaryHarvester"/> delegate.</remarks> public static bool Harvest(ISourceNode nav, ArtifactSummaryPropertyBag properties) { if (IsValueSetSummary(properties)) { // Explicit extractor chaining if (ConformanceSummaryProperties.Harvest(nav, properties)) { nav.HarvestValue(properties, SystemKey, "codeSystem", "system"); } return(true); } return(false); }
/// <summary>Harvest specific summary information from a <see cref="StructureDefinition"/> resource.</summary> /// <returns><c>true</c> if the current target represents a <see cref="StructureDefinition"/> resource, or <c>false</c> otherwise.</returns> /// <remarks>The <see cref="ArtifactSummaryGenerator"/> calls this method from a <see cref="ArtifactSummaryHarvester"/> delegate.</remarks> public static bool Harvest(IElementNavigator nav, ArtifactSummaryPropertyBag properties) { if (IsStructureDefinitionSummary(properties)) { // [WMR 20171218] Harvest global core extensions, e.g. MaturityLevel nav.HarvestExtensions(properties, harvestExtension); // Explicit extractor chaining if (ConformanceSummaryProperties.Harvest(nav, properties)) { nav.HarvestValue(properties, FhirVersionKey, "fhirVersion"); nav.HarvestValue(properties, KindKey, "kind"); nav.HarvestValue(properties, ConstrainedTypeKey, "constrainedType"); nav.HarvestValue(properties, ContextTypeKey, "contextType"); nav.HarvestValue(properties, BaseKey, "base"); } return(true); } return(false); }
/// <summary>Harvest specific summary information from a <see cref="ConceptMap"/> resource.</summary> /// <returns><c>true</c> if the current target represents a <see cref="ConceptMap"/> resource, or <c>false</c> otherwise.</returns> /// <remarks>The <see cref="ArtifactSummaryGenerator"/> calls this method from a <see cref="ArtifactSummaryHarvester"/> delegate.</remarks> public static bool Harvest(ISourceNode nav, ArtifactSummaryPropertyBag properties) { if (IsConceptMapSummary(properties)) { // Explicit extractor chaining if (ConformanceSummaryProperties.Harvest(nav, properties)) { if (!nav.HarvestValue(properties, SourceKey, "sourceUri")) { nav.HarvestValue(properties, SourceKey, "sourceReference", "reference"); } if (!nav.HarvestValue(properties, TargetKey, "targetUri")) { nav.HarvestValue(properties, TargetKey, "targetReference", "reference"); } } return(true); } return(false); }