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

            if (!string.IsNullOrEmpty(Eye))
            {
                writer.WriteString("eye", (string)Eye !);
            }

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

            if (Sphere != null)
            {
                writer.WriteNumber("sphere", (decimal)Sphere !);
            }

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

            if (Cylinder != null)
            {
                writer.WriteNumber("cylinder", (decimal)Cylinder !);
            }

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

            if (Axis != null)
            {
                writer.WriteNumber("axis", (int)Axis !);
            }

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

                foreach (VisionPrescriptionLensSpecificationPrism valPrism in Prism)
                {
                    valPrism.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (Add != null)
            {
                writer.WriteNumber("add", (decimal)Add !);
            }

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

            if (Power != null)
            {
                writer.WriteNumber("power", (decimal)Power !);
            }

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

            if (BackCurve != null)
            {
                writer.WriteNumber("backCurve", (decimal)BackCurve !);
            }

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

            if (Diameter != null)
            {
                writer.WriteNumber("diameter", (decimal)Diameter !);
            }

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

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

            if (!string.IsNullOrEmpty(Color))
            {
                writer.WriteString("color", (string)Color !);
            }

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

            if (!string.IsNullOrEmpty(Brand))
            {
                writer.WriteString("brand", (string)Brand !);
            }

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

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

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

                writer.WriteEndArray();
            }

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