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);
            }
Exemple #2
0
            public override IDeepCopyable CopyTo(IDeepCopyable other)
            {
                var dest = other as MedicationOrderDosageInstructionComponent;

                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.Timing)Timing.DeepCopy();
                    }
                    if (AsNeeded != null)
                    {
                        dest.AsNeeded = (Hl7.Fhir.Model.Element)AsNeeded.DeepCopy();
                    }
                    if (Site != null)
                    {
                        dest.Site = (Hl7.Fhir.Model.Element)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 (Dose != null)
                    {
                        dest.Dose = (Hl7.Fhir.Model.Element)Dose.DeepCopy();
                    }
                    if (Rate != null)
                    {
                        dest.Rate = (Hl7.Fhir.Model.Element)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");
                }
            }