Ejemplo n.º 1
0
            public override IDeepCopyable CopyTo(IDeepCopyable other)
            {
                var dest = other as ParticipantComponent;

                if (dest == null)
                {
                    throw new ArgumentException("Can only copy to an object of the same type", "other");
                }

                base.CopyTo(dest);
                if (Role != null)
                {
                    dest.Role = new List <Hl7.Fhir.Model.CodeableConcept>(Role.DeepCopy());
                }
                if (Member != null)
                {
                    dest.Member = (Hl7.Fhir.Model.ResourceReference)Member.DeepCopy();
                }
                if (OnBehalfOf != null)
                {
                    dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopy();
                }
                if (Period != null)
                {
                    dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy();
                }
                return(dest);
            }
Ejemplo n.º 2
0
            public override IDeepCopyable CopyTo(IDeepCopyable other)
            {
                var dest = other as AgentComponent;

                if (dest == null)
                {
                    throw new ArgumentException("Can only copy to an object of the same type", "other");
                }

                base.CopyTo(dest);
                if (Role != null)
                {
                    dest.Role = new List <Hl7.Fhir.Model.CodeableConcept>(Role.DeepCopy());
                }
                if (Who != null)
                {
                    dest.Who = (Hl7.Fhir.Model.DataType)Who.DeepCopy();
                }
                if (OnBehalfOf != null)
                {
                    dest.OnBehalfOf = (Hl7.Fhir.Model.DataType)OnBehalfOf.DeepCopy();
                }
                if (RelatedAgentType != null)
                {
                    dest.RelatedAgentType = (Hl7.Fhir.Model.CodeableConcept)RelatedAgentType.DeepCopy();
                }
                return(dest);
            }
        public static signingonbehalfof ToSigningonbehalfof(this OnBehalfOf onBehalfOf)
        {
            switch (onBehalfOf)
            {
            case OnBehalfOf.Self:
                return(signingonbehalfof.SELF);

            case OnBehalfOf.Other:
                return(signingonbehalfof.OTHER);

            default:
                throw new ArgumentOutOfRangeException(nameof(onBehalfOf), onBehalfOf, null);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Serialize to a JSON object
        /// </summary>
        public new void SerializeJson(Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true)
        {
            if (includeStartObject)
            {
                writer.WriteStartObject();
            }

            ((Fhir.R4.Models.BackboneElement) this).SerializeJson(writer, options, false);

            if (Type != null)
            {
                writer.WritePropertyName("type");
                Type.SerializeJson(writer, options);
            }

            if ((Role != null) && (Role.Count != 0))
            {
                writer.WritePropertyName("role");
                writer.WriteStartArray();

                foreach (CodeableConcept valRole in Role)
                {
                    valRole.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (Who != null)
            {
                writer.WritePropertyName("who");
                Who.SerializeJson(writer, options);
            }

            if (OnBehalfOf != null)
            {
                writer.WritePropertyName("onBehalfOf");
                OnBehalfOf.SerializeJson(writer, options);
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
Ejemplo n.º 5
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Signature;

            if (dest == null)
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }

            base.CopyTo(dest);
            if (Type != null)
            {
                dest.Type = new List <Hl7.Fhir.Model.Coding>(Type.DeepCopy());
            }
            if (WhenElement != null)
            {
                dest.WhenElement = (Hl7.Fhir.Model.Instant)WhenElement.DeepCopy();
            }
            if (Who != null)
            {
                dest.Who = (Hl7.Fhir.Model.ResourceReference)Who.DeepCopy();
            }
            if (OnBehalfOf != null)
            {
                dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopy();
            }
            if (TargetFormatElement != null)
            {
                dest.TargetFormatElement = (Hl7.Fhir.Model.Code)TargetFormatElement.DeepCopy();
            }
            if (SigFormatElement != null)
            {
                dest.SigFormatElement = (Hl7.Fhir.Model.Code)SigFormatElement.DeepCopy();
            }
            if (DataElement != null)
            {
                dest.DataElement = (Hl7.Fhir.Model.Base64Binary)DataElement.DeepCopy();
            }
            return(dest);
        }
Ejemplo n.º 6
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Signature;

            if (dest == null)
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }

            base.CopyTo(dest);
            if (Type != null)
            {
                dest.Type = new List <Hl7.Fhir.Model.Coding>(Type.DeepCopy());
            }
            if (WhenElement != null)
            {
                dest.WhenElement = (Hl7.Fhir.Model.Instant)WhenElement.DeepCopy();
            }
            if (Who != null)
            {
                dest.Who = (Hl7.Fhir.Model.DataType)Who.DeepCopy();
            }
            if (OnBehalfOf != null)
            {
                dest.OnBehalfOf = (Hl7.Fhir.Model.DataType)OnBehalfOf.DeepCopy();
            }
            if (ContentTypeElement != null)
            {
                dest.ContentTypeElement = (Hl7.Fhir.Model.Code)ContentTypeElement.DeepCopy();
            }
            if (BlobElement != null)
            {
                dest.BlobElement = (Hl7.Fhir.Model.Base64Binary)BlobElement.DeepCopy();
            }
            return(dest);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Serialize to a JSON object
        /// </summary>
        public new void SerializeJson(Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true)
        {
            if (includeStartObject)
            {
                writer.WriteStartObject();
            }
            ((fhirCsR4.Models.BackboneElement) this).SerializeJson(writer, options, false);

            if (Who != null)
            {
                writer.WritePropertyName("who");
                Who.SerializeJson(writer, options);
            }

            if (OnBehalfOf != null)
            {
                writer.WritePropertyName("onBehalfOf");
                OnBehalfOf.SerializeJson(writer, options);
            }

            if (CommunicationMethod != null)
            {
                writer.WritePropertyName("communicationMethod");
                CommunicationMethod.SerializeJson(writer, options);
            }

            if (!string.IsNullOrEmpty(Date))
            {
                writer.WriteString("date", (string)Date !);
            }

            if (_Date != null)
            {
                writer.WritePropertyName("_date");
                _Date.SerializeJson(writer, options);
            }

            if (!string.IsNullOrEmpty(SourceIdentityCertificate))
            {
                writer.WriteString("sourceIdentityCertificate", (string)SourceIdentityCertificate !);
            }

            if (_SourceIdentityCertificate != null)
            {
                writer.WritePropertyName("_sourceIdentityCertificate");
                _SourceIdentityCertificate.SerializeJson(writer, options);
            }

            if (!string.IsNullOrEmpty(ProxyIdentityCertificate))
            {
                writer.WriteString("proxyIdentityCertificate", (string)ProxyIdentityCertificate !);
            }

            if (_ProxyIdentityCertificate != null)
            {
                writer.WritePropertyName("_proxyIdentityCertificate");
                _ProxyIdentityCertificate.SerializeJson(writer, options);
            }

            if (ProxySignature != null)
            {
                writer.WritePropertyName("proxySignature");
                ProxySignature.SerializeJson(writer, options);
            }

            if (SourceSignature != null)
            {
                writer.WritePropertyName("sourceSignature");
                SourceSignature.SerializeJson(writer, options);
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Serialize to a JSON object
        /// </summary>
        public new void SerializeJson(Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true)
        {
            if (includeStartObject)
            {
                writer.WriteStartObject();
            }

            ((Fhir.R4.Models.Element) this).SerializeJson(writer, options, false);

            if ((Type != null) && (Type.Count != 0))
            {
                writer.WritePropertyName("type");
                writer.WriteStartArray();

                foreach (Coding valType in Type)
                {
                    valType.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (!string.IsNullOrEmpty(When))
            {
                writer.WriteString("when", (string)When !);
            }

            if (_When != null)
            {
                writer.WritePropertyName("_when");
                _When.SerializeJson(writer, options);
            }

            if (Who != null)
            {
                writer.WritePropertyName("who");
                Who.SerializeJson(writer, options);
            }

            if (OnBehalfOf != null)
            {
                writer.WritePropertyName("onBehalfOf");
                OnBehalfOf.SerializeJson(writer, options);
            }

            if (!string.IsNullOrEmpty(TargetFormat))
            {
                writer.WriteString("targetFormat", (string)TargetFormat !);
            }

            if (_TargetFormat != null)
            {
                writer.WritePropertyName("_targetFormat");
                _TargetFormat.SerializeJson(writer, options);
            }

            if (!string.IsNullOrEmpty(SigFormat))
            {
                writer.WriteString("sigFormat", (string)SigFormat !);
            }

            if (_SigFormat != null)
            {
                writer.WritePropertyName("_sigFormat");
                _SigFormat.SerializeJson(writer, options);
            }

            if (!string.IsNullOrEmpty(Data))
            {
                writer.WriteString("data", (string)Data !);
            }

            if (_Data != null)
            {
                writer.WritePropertyName("_data");
                _Data.SerializeJson(writer, options);
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }