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

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

            base.CopyTo(dest);
            if (Event != null)
            {
                dest.Event = (Hl7.Fhir.Model.Coding)Event.DeepCopy();
            }
            if (Destination != null)
            {
                dest.Destination = new List <Hl7.Fhir.Model.MessageHeader.MessageDestinationComponent>(Destination.DeepCopy());
            }
            if (Receiver != null)
            {
                dest.Receiver = (Hl7.Fhir.Model.ResourceReference)Receiver.DeepCopy();
            }
            if (Sender != null)
            {
                dest.Sender = (Hl7.Fhir.Model.ResourceReference)Sender.DeepCopy();
            }
            if (TimestampElement != null)
            {
                dest.TimestampElement = (Hl7.Fhir.Model.Instant)TimestampElement.DeepCopy();
            }
            if (Enterer != null)
            {
                dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopy();
            }
            if (Author != null)
            {
                dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy();
            }
            if (Source != null)
            {
                dest.Source = (Hl7.Fhir.Model.MessageHeader.MessageSourceComponent)Source.DeepCopy();
            }
            if (Responsible != null)
            {
                dest.Responsible = (Hl7.Fhir.Model.ResourceReference)Responsible.DeepCopy();
            }
            if (Reason != null)
            {
                dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy();
            }
            if (Response != null)
            {
                dest.Response = (Hl7.Fhir.Model.MessageHeader.ResponseComponent)Response.DeepCopy();
            }
            if (Focus != null)
            {
                dest.Focus = new List <Hl7.Fhir.Model.ResourceReference>(Focus.DeepCopy());
            }
            return(dest);
        }
        /// <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 !);
            }


            ((Fhir.R4.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 (!string.IsNullOrEmpty(Status))
            {
                writer.WriteString("status", (string)Status !);
            }

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

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

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

                foreach (string valPurpose in Purpose)
                {
                    writer.WriteStringValue(valPurpose);
                }

                writer.WriteEndArray();
            }

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

                foreach (Element val_Purpose in _Purpose)
                {
                    val_Purpose.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

            if (!string.IsNullOrEmpty(ServicedDate))
            {
                writer.WriteString("servicedDate", (string)ServicedDate !);
            }

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

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

            if (!string.IsNullOrEmpty(Created))
            {
                writer.WriteString("created", (string)Created !);
            }

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

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

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

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

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

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

                foreach (CoverageEligibilityRequestSupportingInfo valSupportingInfo in SupportingInfo)
                {
                    valSupportingInfo.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

                foreach (CoverageEligibilityRequestInsurance valInsurance in Insurance)
                {
                    valInsurance.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

                foreach (CoverageEligibilityRequestItem valItem in Item)
                {
                    valItem.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
Exemple #3
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as EligibilityRequest;

            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 (StatusElement != null)
            {
                dest.StatusElement = (Code <Hl7.Fhir.Model.FinancialResourceStatusCodes>)StatusElement.DeepCopy();
            }
            if (Priority != null)
            {
                dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy();
            }
            if (Patient != null)
            {
                dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy();
            }
            if (Serviced != null)
            {
                dest.Serviced = (Hl7.Fhir.Model.Element)Serviced.DeepCopy();
            }
            if (CreatedElement != null)
            {
                dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy();
            }
            if (Enterer != null)
            {
                dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopy();
            }
            if (Provider != null)
            {
                dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy();
            }
            if (Organization != null)
            {
                dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy();
            }
            if (Insurer != null)
            {
                dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy();
            }
            if (Facility != null)
            {
                dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopy();
            }
            if (Coverage != null)
            {
                dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy();
            }
            if (BusinessArrangementElement != null)
            {
                dest.BusinessArrangementElement = (Hl7.Fhir.Model.FhirString)BusinessArrangementElement.DeepCopy();
            }
            if (BenefitCategory != null)
            {
                dest.BenefitCategory = (Hl7.Fhir.Model.CodeableConcept)BenefitCategory.DeepCopy();
            }
            if (BenefitSubCategory != null)
            {
                dest.BenefitSubCategory = (Hl7.Fhir.Model.CodeableConcept)BenefitSubCategory.DeepCopy();
            }
            return(dest);
        }
        /// <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 !);
            }


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

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

            if (!string.IsNullOrEmpty(EventUri))
            {
                writer.WriteString("eventUri", (string)EventUri !);
            }

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

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

                foreach (MessageHeaderDestination valDestination in Destination)
                {
                    valDestination.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

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

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

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

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

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

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

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

                foreach (Reference valFocus in Focus)
                {
                    valFocus.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (!string.IsNullOrEmpty(Definition))
            {
                writer.WriteString("definition", (string)Definition !);
            }

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

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
Exemple #5
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 !);
            }


            ((Fhir.R4.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 ((DefinitionUri != null) && (DefinitionUri.Count != 0))
            {
                writer.WritePropertyName("definitionUri");
                writer.WriteStartArray();

                foreach (string valDefinitionUri in DefinitionUri)
                {
                    writer.WriteStringValue(valDefinitionUri);
                }

                writer.WriteEndArray();
            }

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

                foreach (Element val_DefinitionUri in _DefinitionUri)
                {
                    val_DefinitionUri.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

                foreach (string valDefinitionCanonical in DefinitionCanonical)
                {
                    writer.WriteStringValue(valDefinitionCanonical);
                }

                writer.WriteEndArray();
            }

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

                foreach (Element val_DefinitionCanonical in _DefinitionCanonical)
                {
                    val_DefinitionCanonical.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 ((PartOf != null) && (PartOf.Count != 0))
            {
                writer.WritePropertyName("partOf");
                writer.WriteStartArray();

                foreach (Reference valPartOf in PartOf)
                {
                    valPartOf.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

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

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

            if (!string.IsNullOrEmpty(OccurrenceDateTime))
            {
                writer.WriteString("occurrenceDateTime", (string)OccurrenceDateTime !);
            }

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

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

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

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

                foreach (ChargeItemPerformer valPerformer in Performer)
                {
                    valPerformer.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

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

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

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

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

                foreach (CodeableConcept valBodysite in Bodysite)
                {
                    valBodysite.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (FactorOverride != null)
            {
                writer.WriteNumber("factorOverride", (decimal)FactorOverride !);
            }

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

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

            if (!string.IsNullOrEmpty(OverrideReason))
            {
                writer.WriteString("overrideReason", (string)OverrideReason !);
            }

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

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

            if (!string.IsNullOrEmpty(EnteredDate))
            {
                writer.WriteString("enteredDate", (string)EnteredDate !);
            }

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

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

                foreach (CodeableConcept valReason in Reason)
                {
                    valReason.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

                foreach (Reference valService in Service)
                {
                    valService.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

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

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

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

                foreach (Reference valAccount in Account)
                {
                    valAccount.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 ((SupportingInformation != null) && (SupportingInformation.Count != 0))
            {
                writer.WritePropertyName("supportingInformation");
                writer.WriteStartArray();

                foreach (Reference valSupportingInformation in SupportingInformation)
                {
                    valSupportingInformation.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
Exemple #6
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as ChargeItem;

            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 = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy();
            }
            if (DefinitionElement != null)
            {
                dest.DefinitionElement = new List <Hl7.Fhir.Model.FhirUri>(DefinitionElement.DeepCopy());
            }
            if (StatusElement != null)
            {
                dest.StatusElement = (Code <Hl7.Fhir.Model.ChargeItem.ChargeItemStatus>)StatusElement.DeepCopy();
            }
            if (PartOf != null)
            {
                dest.PartOf = new List <Hl7.Fhir.Model.ResourceReference>(PartOf.DeepCopy());
            }
            if (Code != null)
            {
                dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy();
            }
            if (Subject != null)
            {
                dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy();
            }
            if (Context != null)
            {
                dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy();
            }
            if (Occurrence != null)
            {
                dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy();
            }
            if (Participant != null)
            {
                dest.Participant = new List <Hl7.Fhir.Model.ChargeItem.ParticipantComponent>(Participant.DeepCopy());
            }
            if (PerformingOrganization != null)
            {
                dest.PerformingOrganization = (Hl7.Fhir.Model.ResourceReference)PerformingOrganization.DeepCopy();
            }
            if (RequestingOrganization != null)
            {
                dest.RequestingOrganization = (Hl7.Fhir.Model.ResourceReference)RequestingOrganization.DeepCopy();
            }
            if (Quantity != null)
            {
                dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy();
            }
            if (Bodysite != null)
            {
                dest.Bodysite = new List <Hl7.Fhir.Model.CodeableConcept>(Bodysite.DeepCopy());
            }
            if (FactorOverrideElement != null)
            {
                dest.FactorOverrideElement = (Hl7.Fhir.Model.FhirDecimal)FactorOverrideElement.DeepCopy();
            }
            if (PriceOverride != null)
            {
                dest.PriceOverride = (Hl7.Fhir.Model.Money)PriceOverride.DeepCopy();
            }
            if (OverrideReasonElement != null)
            {
                dest.OverrideReasonElement = (Hl7.Fhir.Model.FhirString)OverrideReasonElement.DeepCopy();
            }
            if (Enterer != null)
            {
                dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopy();
            }
            if (EnteredDateElement != null)
            {
                dest.EnteredDateElement = (Hl7.Fhir.Model.FhirDateTime)EnteredDateElement.DeepCopy();
            }
            if (Reason != null)
            {
                dest.Reason = new List <Hl7.Fhir.Model.CodeableConcept>(Reason.DeepCopy());
            }
            if (Service != null)
            {
                dest.Service = new List <Hl7.Fhir.Model.ResourceReference>(Service.DeepCopy());
            }
            if (Account != null)
            {
                dest.Account = new List <Hl7.Fhir.Model.ResourceReference>(Account.DeepCopy());
            }
            if (Note != null)
            {
                dest.Note = new List <Hl7.Fhir.Model.Annotation>(Note.DeepCopy());
            }
            if (SupportingInformation != null)
            {
                dest.SupportingInformation = new List <Hl7.Fhir.Model.ResourceReference>(SupportingInformation.DeepCopy());
            }
            return(dest);
        }
        public override ErrorList Validate()
        {
            var result = new ErrorList();

            result.AddRange(base.Validate());

            if (IdentifierElement != null)
            {
                result.AddRange(IdentifierElement.Validate());
            }
            if (TimestampElement != null)
            {
                result.AddRange(TimestampElement.Validate());
            }
            if (EventElement != null)
            {
                result.AddRange(EventElement.Validate());
            }
            if (Response != null)
            {
                result.AddRange(Response.Validate());
            }
            if (Source != null)
            {
                result.AddRange(Source.Validate());
            }
            if (Destination != null)
            {
                result.AddRange(Destination.Validate());
            }
            if (Enterer != null)
            {
                result.AddRange(Enterer.Validate());
            }
            if (Author != null)
            {
                result.AddRange(Author.Validate());
            }
            if (Receiver != null)
            {
                result.AddRange(Receiver.Validate());
            }
            if (Responsible != null)
            {
                result.AddRange(Responsible.Validate());
            }
            if (Effective != null)
            {
                result.AddRange(Effective.Validate());
            }
            if (Reason != null)
            {
                result.AddRange(Reason.Validate());
            }
            if (Data != null)
            {
                Data.ForEach(elem => result.AddRange(elem.Validate()));
            }

            return(result);
        }