Esempio n. 1
0
        ElementTreeNode GetSnapNodeOriginal(StructureDefinition sDef,
                                            ElementTreeLoader l)
        {
            const String fcn = "LoadBase";

            lock (originalNodes)
            {
                if (originalNodes.TryGetValue(sDef.BaseDefinition, out ElementTreeNode retVal) == true)
                {
                    return(retVal);
                }

                StructureDefinition SBaseDef = FhirStructureDefinitions.Self.GetResource(sDef.BaseDefinition);
                if (SBaseDef == null)
                {
                    info.ConversionError(this.GetType().Name,
                                         fcn,
                                         $"Error loading StructureDef '{sDef.Name}'. BaseDefinition {sDef.BaseDefinition} not found ");
                    return(null);
                }

                if (SBaseDef.Snapshot == null)
                {
                    SnapshotCreator.Create(SBaseDef);
                }
                retVal = l.Create(SBaseDef.Snapshot.Element);;
                originalNodes.Add(sDef.BaseDefinition, retVal);
                return(retVal);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Check if item is compatible.
        /// </summary>
        public bool CheckCompatible(ProcessItem mergeItem,
                                    IConversionInfo conversionInfo)
        {
            const String fcn = "CheckCompatible";

            bool retVal = true;

            if (DoCheckCompatible(mergeItem, conversionInfo) == false)
            {
                conversionInfo.ConversionError(this.GetType().Name,
                                               fcn,
                                               $"    {this.Resource.GetUrl()}.");
                return(false);
            }

            return(retVal);
        }
Esempio n. 3
0
        bool DoCheckCompatible(ProcessItem mergeItem,
                               IConversionInfo conversionInfo)
        {
            const String fcn = "CheckCompatible";

            if (this.incompatibleFragments.Contains(mergeItem.Resource.GetUrl()))
            {
                conversionInfo.ConversionError(this.GetType().Name,
                                               fcn,
                                               $"Fragment {mergeItem.Resource.GetUrl()} is not compatible with {this.Resource.GetUrl()}.");
                return(false);
            }

            foreach (ProcessItem includedFragment in this.includedFragments)
            {
                if (includedFragment.CheckCompatible(mergeItem, conversionInfo) == false)
                {
                    return(false);
                }
            }
            return(true);
        }