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

                if (dest != null)
                {
                    base.CopyTo(dest);
                    if (Code != null)
                    {
                        dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy();
                    }
                    if (Value != null)
                    {
                        dest.Value = (Hl7.Fhir.Model.Element)Value.DeepCopy();
                    }
                    if (DataAbsentReason != null)
                    {
                        dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopy();
                    }
                    if (ReferenceRange != null)
                    {
                        dest.ReferenceRange = new List <Hl7.Fhir.Model.Observation.ObservationReferenceRangeComponent>(ReferenceRange.DeepCopy());
                    }
                    return(dest);
                }
                else
                {
                    throw new ArgumentException("Can only copy to an object of the same type", "other");
                }
            }
Ejemplo n.º 2
0
        public static bool TryParse(string value, out DataAbsentReason result)
        {
            result = default(DataAbsentReason);

            if (value == "unknown")
            {
                result = DataAbsentReason.Unknown;
            }
            else if (value == "asked")
            {
                result = DataAbsentReason.Asked;
            }
            else if (value == "temp")
            {
                result = DataAbsentReason.Temp;
            }
            else if (value == "notasked")
            {
                result = DataAbsentReason.Notasked;
            }
            else if (value == "masked")
            {
                result = DataAbsentReason.Masked;
            }
            else if (value == "unsupported")
            {
                result = DataAbsentReason.Unsupported;
            }
            else if (value == "astext")
            {
                result = DataAbsentReason.Astext;
            }
            else if (value == "error")
            {
                result = DataAbsentReason.Error;
            }
            else
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 3
0
 public static string ToString(DataAbsentReason value)
 {
     if (value == DataAbsentReason.Unknown)
     {
         return("unknown");
     }
     else if (value == DataAbsentReason.Asked)
     {
         return("asked");
     }
     else if (value == DataAbsentReason.Temp)
     {
         return("temp");
     }
     else if (value == DataAbsentReason.Notasked)
     {
         return("notasked");
     }
     else if (value == DataAbsentReason.Masked)
     {
         return("masked");
     }
     else if (value == DataAbsentReason.Unsupported)
     {
         return("unsupported");
     }
     else if (value == DataAbsentReason.Astext)
     {
         return("astext");
     }
     else if (value == DataAbsentReason.Error)
     {
         return("error");
     }
     else
     {
         throw new ArgumentException("Unrecognized DataAbsentReason value: " + value.ToString());
     }
 }
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();
            }
            if (!string.IsNullOrEmpty(ResourceType))
            {
                writer.WriteString("resourceType", (string)ResourceType !);
            }


            ((fhirCsR4.Models.DomainResource) this).SerializeJson(writer, options, false);

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

                foreach (Identifier valIdentifier in Identifier)
                {
                    valIdentifier.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

                foreach (string valInstantiatesCanonical in InstantiatesCanonical)
                {
                    writer.WriteStringValue(valInstantiatesCanonical);
                }

                writer.WriteEndArray();
            }

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

                foreach (Element val_InstantiatesCanonical in _InstantiatesCanonical)
                {
                    val_InstantiatesCanonical.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

                foreach (string valInstantiatesUri in InstantiatesUri)
                {
                    writer.WriteStringValue(valInstantiatesUri);
                }

                writer.WriteEndArray();
            }

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

                foreach (Element val_InstantiatesUri in _InstantiatesUri)
                {
                    val_InstantiatesUri.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (!string.IsNullOrEmpty(Status))
            {
                writer.WriteString("status", (string)Status !);
            }

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

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

            if (Patient != null)
            {
                writer.WritePropertyName("patient");
                Patient.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(Name))
            {
                writer.WriteString("name", (string)Name !);
            }

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

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

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

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

            if (!string.IsNullOrEmpty(BornDate))
            {
                writer.WriteString("bornDate", (string)BornDate !);
            }

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

            if (!string.IsNullOrEmpty(BornString))
            {
                writer.WriteString("bornString", (string)BornString !);
            }

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

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

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

            if (!string.IsNullOrEmpty(AgeString))
            {
                writer.WriteString("ageString", (string)AgeString !);
            }

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

            if (EstimatedAge != null)
            {
                writer.WriteBoolean("estimatedAge", (bool)EstimatedAge !);
            }

            if (DeceasedBoolean != null)
            {
                writer.WriteBoolean("deceasedBoolean", (bool)DeceasedBoolean !);
            }

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

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

            if (!string.IsNullOrEmpty(DeceasedDate))
            {
                writer.WriteString("deceasedDate", (string)DeceasedDate !);
            }

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

            if (!string.IsNullOrEmpty(DeceasedString))
            {
                writer.WriteString("deceasedString", (string)DeceasedString !);
            }

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

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

                foreach (CodeableConcept valReasonCode in ReasonCode)
                {
                    valReasonCode.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

                foreach (Reference valReasonReference in ReasonReference)
                {
                    valReasonReference.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

                foreach (Annotation valNote in Note)
                {
                    valNote.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

                foreach (FamilyMemberHistoryCondition valCondition in Condition)
                {
                    valCondition.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
Ejemplo n.º 5
0
        public static bool TryParse(string value, out DataAbsentReason result)
        {
            result = default(DataAbsentReason);

            if( value=="unknown")
                result = DataAbsentReason.Unknown;
            else if( value=="asked")
                result = DataAbsentReason.Asked;
            else if( value=="temp")
                result = DataAbsentReason.Temp;
            else if( value=="notasked")
                result = DataAbsentReason.Notasked;
            else if( value=="masked")
                result = DataAbsentReason.Masked;
            else if( value=="unsupported")
                result = DataAbsentReason.Unsupported;
            else if( value=="astext")
                result = DataAbsentReason.Astext;
            else if( value=="error")
                result = DataAbsentReason.Error;
            else
                return false;

            return true;
        }
Ejemplo n.º 6
0
 public static string ToString(DataAbsentReason value)
 {
     if( value==DataAbsentReason.Unknown )
         return "unknown";
     else if( value==DataAbsentReason.Asked )
         return "asked";
     else if( value==DataAbsentReason.Temp )
         return "temp";
     else if( value==DataAbsentReason.Notasked )
         return "notasked";
     else if( value==DataAbsentReason.Masked )
         return "masked";
     else if( value==DataAbsentReason.Unsupported )
         return "unsupported";
     else if( value==DataAbsentReason.Astext )
         return "astext";
     else if( value==DataAbsentReason.Error )
         return "error";
     else
         throw new ArgumentException("Unrecognized DataAbsentReason value: " + value.ToString());
 }
Ejemplo n.º 7
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Observation;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (Identifier != null)
                {
                    dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
                }
                if (StatusElement != null)
                {
                    dest.StatusElement = (Code <Hl7.Fhir.Model.Observation.ObservationStatus>)StatusElement.DeepCopy();
                }
                if (Category != null)
                {
                    dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy();
                }
                if (Code != null)
                {
                    dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy();
                }
                if (Subject != null)
                {
                    dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy();
                }
                if (Encounter != null)
                {
                    dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy();
                }
                if (Effective != null)
                {
                    dest.Effective = (Hl7.Fhir.Model.Element)Effective.DeepCopy();
                }
                if (IssuedElement != null)
                {
                    dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopy();
                }
                if (Performer != null)
                {
                    dest.Performer = new List <Hl7.Fhir.Model.ResourceReference>(Performer.DeepCopy());
                }
                if (Value != null)
                {
                    dest.Value = (Hl7.Fhir.Model.Element)Value.DeepCopy();
                }
                if (DataAbsentReason != null)
                {
                    dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopy();
                }
                if (Interpretation != null)
                {
                    dest.Interpretation = (Hl7.Fhir.Model.CodeableConcept)Interpretation.DeepCopy();
                }
                if (CommentsElement != null)
                {
                    dest.CommentsElement = (Hl7.Fhir.Model.FhirString)CommentsElement.DeepCopy();
                }
                if (BodySite != null)
                {
                    dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy();
                }
                if (Method != null)
                {
                    dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy();
                }
                if (Specimen != null)
                {
                    dest.Specimen = (Hl7.Fhir.Model.ResourceReference)Specimen.DeepCopy();
                }
                if (Device != null)
                {
                    dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy();
                }
                if (ReferenceRange != null)
                {
                    dest.ReferenceRange = new List <Hl7.Fhir.Model.Observation.ObservationReferenceRangeComponent>(ReferenceRange.DeepCopy());
                }
                if (Related != null)
                {
                    dest.Related = new List <Hl7.Fhir.Model.Observation.ObservationRelatedComponent>(Related.DeepCopy());
                }
                if (Component != null)
                {
                    dest.Component = new List <Hl7.Fhir.Model.Observation.ObservationComponentComponent>(Component.DeepCopy());
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as FamilyMemberHistory;

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

            base.CopyTo(dest);
            if (Identifier != null)
            {
                dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
            }
            if (InstantiatesCanonicalElement != null)
            {
                dest.InstantiatesCanonicalElement = new List <Hl7.Fhir.Model.Canonical>(InstantiatesCanonicalElement.DeepCopy());
            }
            if (InstantiatesUriElement != null)
            {
                dest.InstantiatesUriElement = new List <Hl7.Fhir.Model.FhirUri>(InstantiatesUriElement.DeepCopy());
            }
            if (StatusElement != null)
            {
                dest.StatusElement = (Code <Hl7.Fhir.Model.FamilyMemberHistory.FamilyHistoryStatus>)StatusElement.DeepCopy();
            }
            if (DataAbsentReason != null)
            {
                dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopy();
            }
            if (Patient != null)
            {
                dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy();
            }
            if (DateElement != null)
            {
                dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy();
            }
            if (NameElement != null)
            {
                dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy();
            }
            if (Relationship != null)
            {
                dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy();
            }
            if (Sex != null)
            {
                dest.Sex = (Hl7.Fhir.Model.CodeableConcept)Sex.DeepCopy();
            }
            if (Born != null)
            {
                dest.Born = (Hl7.Fhir.Model.DataType)Born.DeepCopy();
            }
            if (Age != null)
            {
                dest.Age = (Hl7.Fhir.Model.DataType)Age.DeepCopy();
            }
            if (EstimatedAgeElement != null)
            {
                dest.EstimatedAgeElement = (Hl7.Fhir.Model.FhirBoolean)EstimatedAgeElement.DeepCopy();
            }
            if (Deceased != null)
            {
                dest.Deceased = (Hl7.Fhir.Model.DataType)Deceased.DeepCopy();
            }
            if (ReasonCode != null)
            {
                dest.ReasonCode = new List <Hl7.Fhir.Model.CodeableConcept>(ReasonCode.DeepCopy());
            }
            if (ReasonReference != null)
            {
                dest.ReasonReference = new List <Hl7.Fhir.Model.ResourceReference>(ReasonReference.DeepCopy());
            }
            if (Note != null)
            {
                dest.Note = new List <Hl7.Fhir.Model.Annotation>(Note.DeepCopy());
            }
            if (Condition != null)
            {
                dest.Condition = new List <Hl7.Fhir.Model.FamilyMemberHistory.ConditionComponent>(Condition.DeepCopy());
            }
            return(dest);
        }