/// <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 (Identifier != null)
            {
                writer.WritePropertyName("identifier");
                Identifier.SerializeJson(writer, options);
            }

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

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

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

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

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

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

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

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

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

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

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