Esempio n. 1
0
        public SDefEditor AddFragRef(StructureDefinition sd)
        {
            if (sd.IsFragment() == false)
            {
                throw new Exception("Expected a fragment");
            }

            String fragRef = sd.Url;

            if (String.IsNullOrWhiteSpace(fragRef))
            {
                throw new Exception($"Fragment Url must not be empty");
            }
            this.SDef.Extension.Add(new Extension
            {
                Url   = PreFhirGenerator.FragmentUrl,
                Value = new FhirUrl(fragRef)
            });

            dynamic packet = new JObject();

            packet.LinkType     = "fragment";
            packet.ShowChildren = false;
            packet.LinkTarget   = sd.Url;
            this.SDef.AddExtension(Global.ResourceMapLinkUrl, new FhirString(packet.ToString()));
            return(this);
        }