Example #1
0
            public override IDeepCopyable CopyTo(IDeepCopyable other)
            {
                var dest = other as MedicationPrescriptionDosageInstructionComponent;

                if (dest != null)
                {
                    base.CopyTo(dest);
                    if (TextElement != null)
                    {
                        dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy();
                    }
                    if (AdditionalInstructions != null)
                    {
                        dest.AdditionalInstructions = (Hl7.Fhir.Model.CodeableConcept)AdditionalInstructions.DeepCopy();
                    }
                    if (Timing != null)
                    {
                        dest.Timing = (Hl7.Fhir.Model.Element)Timing.DeepCopy();
                    }
                    if (AsNeeded != null)
                    {
                        dest.AsNeeded = (Hl7.Fhir.Model.Element)AsNeeded.DeepCopy();
                    }
                    if (Site != null)
                    {
                        dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopy();
                    }
                    if (Route != null)
                    {
                        dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopy();
                    }
                    if (Method != null)
                    {
                        dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy();
                    }
                    if (DoseQuantity != null)
                    {
                        dest.DoseQuantity = (Hl7.Fhir.Model.Quantity)DoseQuantity.DeepCopy();
                    }
                    if (Rate != null)
                    {
                        dest.Rate = (Hl7.Fhir.Model.Ratio)Rate.DeepCopy();
                    }
                    if (MaxDosePerPeriod != null)
                    {
                        dest.MaxDosePerPeriod = (Hl7.Fhir.Model.Ratio)MaxDosePerPeriod.DeepCopy();
                    }
                    return(dest);
                }
                else
                {
                    throw new ArgumentException("Can only copy to an object of the same type", "other");
                }
            }
Example #2
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)
            {
                writer.WritePropertyName("type");
                Type.SerializeJson(writer, options);
            }

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

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

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

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

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

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
            public override ErrorList Validate()
            {
                var result = new ErrorList();

                result.AddRange(base.Validate());

                if (DosageInstructionsTextElement != null)
                {
                    result.AddRange(DosageInstructionsTextElement.Validate());
                }
                if (AdditionalInstructions != null)
                {
                    result.AddRange(AdditionalInstructions.Validate());
                }
                if (Timing != null)
                {
                    result.AddRange(Timing.Validate());
                }
                if (Site != null)
                {
                    result.AddRange(Site.Validate());
                }
                if (Route != null)
                {
                    result.AddRange(Route.Validate());
                }
                if (Method != null)
                {
                    result.AddRange(Method.Validate());
                }
                if (DoseQuantity != null)
                {
                    result.AddRange(DoseQuantity.Validate());
                }
                if (Rate != null)
                {
                    result.AddRange(Rate.Validate());
                }
                if (MaxDosePerPeriod != null)
                {
                    result.AddRange(MaxDosePerPeriod.Validate());
                }

                return(result);
            }
Example #4
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Immunization;

            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.MedicationAdministrationStatus>)StatusElement.DeepCopy();
                }
                if (DateElement != null)
                {
                    dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy();
                }
                if (VaccineCode != null)
                {
                    dest.VaccineCode = (Hl7.Fhir.Model.CodeableConcept)VaccineCode.DeepCopy();
                }
                if (Patient != null)
                {
                    dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy();
                }
                if (WasNotGivenElement != null)
                {
                    dest.WasNotGivenElement = (Hl7.Fhir.Model.FhirBoolean)WasNotGivenElement.DeepCopy();
                }
                if (ReportedElement != null)
                {
                    dest.ReportedElement = (Hl7.Fhir.Model.FhirBoolean)ReportedElement.DeepCopy();
                }
                if (Performer != null)
                {
                    dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy();
                }
                if (Requester != null)
                {
                    dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopy();
                }
                if (Encounter != null)
                {
                    dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy();
                }
                if (Manufacturer != null)
                {
                    dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopy();
                }
                if (Location != null)
                {
                    dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy();
                }
                if (LotNumberElement != null)
                {
                    dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopy();
                }
                if (ExpirationDateElement != null)
                {
                    dest.ExpirationDateElement = (Hl7.Fhir.Model.Date)ExpirationDateElement.DeepCopy();
                }
                if (Site != null)
                {
                    dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopy();
                }
                if (Route != null)
                {
                    dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopy();
                }
                if (DoseQuantity != null)
                {
                    dest.DoseQuantity = (Hl7.Fhir.Model.SimpleQuantity)DoseQuantity.DeepCopy();
                }
                if (Note != null)
                {
                    dest.Note = new List <Hl7.Fhir.Model.Annotation>(Note.DeepCopy());
                }
                if (Explanation != null)
                {
                    dest.Explanation = (Hl7.Fhir.Model.Immunization.ExplanationComponent)Explanation.DeepCopy();
                }
                if (Reaction != null)
                {
                    dest.Reaction = new List <Hl7.Fhir.Model.Immunization.ReactionComponent>(Reaction.DeepCopy());
                }
                if (VaccinationProtocol != null)
                {
                    dest.VaccinationProtocol = new List <Hl7.Fhir.Model.Immunization.VaccinationProtocolComponent>(VaccinationProtocol.DeepCopy());
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }
        public override ErrorList Validate()
        {
            var result = new ErrorList();

            result.AddRange(base.Validate());

            if (DateElement != null)
            {
                result.AddRange(DateElement.Validate());
            }
            if (VaccineType != null)
            {
                result.AddRange(VaccineType.Validate());
            }
            if (Subject != null)
            {
                result.AddRange(Subject.Validate());
            }
            if (RefusedIndicatorElement != null)
            {
                result.AddRange(RefusedIndicatorElement.Validate());
            }
            if (ReportedElement != null)
            {
                result.AddRange(ReportedElement.Validate());
            }
            if (Performer != null)
            {
                result.AddRange(Performer.Validate());
            }
            if (Requester != null)
            {
                result.AddRange(Requester.Validate());
            }
            if (Manufacturer != null)
            {
                result.AddRange(Manufacturer.Validate());
            }
            if (Location != null)
            {
                result.AddRange(Location.Validate());
            }
            if (LotNumberElement != null)
            {
                result.AddRange(LotNumberElement.Validate());
            }
            if (ExpirationDateElement != null)
            {
                result.AddRange(ExpirationDateElement.Validate());
            }
            if (Site != null)
            {
                result.AddRange(Site.Validate());
            }
            if (Route != null)
            {
                result.AddRange(Route.Validate());
            }
            if (DoseQuantity != null)
            {
                result.AddRange(DoseQuantity.Validate());
            }
            if (Explanation != null)
            {
                result.AddRange(Explanation.Validate());
            }
            if (Reaction != null)
            {
                Reaction.ForEach(elem => result.AddRange(elem.Validate()));
            }
            if (VaccinationProtocol != null)
            {
                result.AddRange(VaccinationProtocol.Validate());
            }

            return(result);
        }
Example #6
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Immunization;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (Identifier != null)
                {
                    dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
                }
                if (DateElement != null)
                {
                    dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy();
                }
                if (VaccineType != null)
                {
                    dest.VaccineType = (Hl7.Fhir.Model.CodeableConcept)VaccineType.DeepCopy();
                }
                if (Subject != null)
                {
                    dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy();
                }
                if (RefusedIndicatorElement != null)
                {
                    dest.RefusedIndicatorElement = (Hl7.Fhir.Model.FhirBoolean)RefusedIndicatorElement.DeepCopy();
                }
                if (ReportedElement != null)
                {
                    dest.ReportedElement = (Hl7.Fhir.Model.FhirBoolean)ReportedElement.DeepCopy();
                }
                if (Performer != null)
                {
                    dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy();
                }
                if (Requester != null)
                {
                    dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopy();
                }
                if (Manufacturer != null)
                {
                    dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopy();
                }
                if (Location != null)
                {
                    dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy();
                }
                if (LotNumberElement != null)
                {
                    dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopy();
                }
                if (ExpirationDateElement != null)
                {
                    dest.ExpirationDateElement = (Hl7.Fhir.Model.Date)ExpirationDateElement.DeepCopy();
                }
                if (Site != null)
                {
                    dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopy();
                }
                if (Route != null)
                {
                    dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopy();
                }
                if (DoseQuantity != null)
                {
                    dest.DoseQuantity = (Hl7.Fhir.Model.Quantity)DoseQuantity.DeepCopy();
                }
                if (Explanation != null)
                {
                    dest.Explanation = (Hl7.Fhir.Model.Immunization.ImmunizationExplanationComponent)Explanation.DeepCopy();
                }
                if (Reaction != null)
                {
                    dest.Reaction = new List <Hl7.Fhir.Model.Immunization.ImmunizationReactionComponent>(Reaction.DeepCopy());
                }
                if (VaccinationProtocol != null)
                {
                    dest.VaccinationProtocol = new List <Hl7.Fhir.Model.Immunization.ImmunizationVaccinationProtocolComponent>(VaccinationProtocol.DeepCopy());
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }