Class Observation.Builder

    • Method Detail

      • id

        public Observation.Builder id​(String id)
        The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.
        Overrides:
        id in class DomainResource.Builder
        Parameters:
        id - Logical id of this artifact
        Returns:
        A reference to this Builder instance
      • meta

        public Observation.Builder meta​(Meta meta)
        The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.
        Overrides:
        meta in class DomainResource.Builder
        Parameters:
        meta - Metadata about the resource
        Returns:
        A reference to this Builder instance
      • implicitRules

        public Observation.Builder implicitRules​(Uri implicitRules)
        A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.
        Overrides:
        implicitRules in class DomainResource.Builder
        Parameters:
        implicitRules - A set of rules under which this content was created
        Returns:
        A reference to this Builder instance
      • language

        public Observation.Builder language​(Code language)
        The base language in which the resource is written.
        Overrides:
        language in class DomainResource.Builder
        Parameters:
        language - Language of the resource content
        Returns:
        A reference to this Builder instance
      • text

        public Observation.Builder text​(Narrative text)
        A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.
        Overrides:
        text in class DomainResource.Builder
        Parameters:
        text - Text summary of the resource, for human interpretation
        Returns:
        A reference to this Builder instance
      • contained

        public Observation.Builder contained​(Resource... contained)
        These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.

        Adds new element(s) to the existing list. If any of the elements are null, calling build() will fail.

        Overrides:
        contained in class DomainResource.Builder
        Parameters:
        contained - Contained, inline Resources
        Returns:
        A reference to this Builder instance
      • contained

        public Observation.Builder contained​(Collection<Resource> contained)
        These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.

        Replaces the existing list with a new one containing elements from the Collection. If any of the elements are null, calling build() will fail.

        Overrides:
        contained in class DomainResource.Builder
        Parameters:
        contained - Contained, inline Resources
        Returns:
        A reference to this Builder instance
        Throws:
        NullPointerException - If the passed collection is null
      • extension

        public Observation.Builder extension​(Extension... extension)
        May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.

        Adds new element(s) to the existing list. If any of the elements are null, calling build() will fail.

        Overrides:
        extension in class DomainResource.Builder
        Parameters:
        extension - Additional content defined by implementations
        Returns:
        A reference to this Builder instance
      • extension

        public Observation.Builder extension​(Collection<Extension> extension)
        May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.

        Replaces the existing list with a new one containing elements from the Collection. If any of the elements are null, calling build() will fail.

        Overrides:
        extension in class DomainResource.Builder
        Parameters:
        extension - Additional content defined by implementations
        Returns:
        A reference to this Builder instance
        Throws:
        NullPointerException - If the passed collection is null
      • modifierExtension

        public Observation.Builder modifierExtension​(Extension... modifierExtension)
        May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.

        Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).

        Adds new element(s) to the existing list. If any of the elements are null, calling build() will fail.

        Overrides:
        modifierExtension in class DomainResource.Builder
        Parameters:
        modifierExtension - Extensions that cannot be ignored
        Returns:
        A reference to this Builder instance
      • modifierExtension

        public Observation.Builder modifierExtension​(Collection<Extension> modifierExtension)
        May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.

        Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).

        Replaces the existing list with a new one containing elements from the Collection. If any of the elements are null, calling build() will fail.

        Overrides:
        modifierExtension in class DomainResource.Builder
        Parameters:
        modifierExtension - Extensions that cannot be ignored
        Returns:
        A reference to this Builder instance
        Throws:
        NullPointerException - If the passed collection is null
      • identifier

        public Observation.Builder identifier​(Identifier... identifier)
        A unique identifier assigned to this observation.

        Adds new element(s) to the existing list. If any of the elements are null, calling build() will fail.

        Parameters:
        identifier - Business Identifier for observation
        Returns:
        A reference to this Builder instance
      • identifier

        public Observation.Builder identifier​(Collection<Identifier> identifier)
        A unique identifier assigned to this observation.

        Replaces the existing list with a new one containing elements from the Collection. If any of the elements are null, calling build() will fail.

        Parameters:
        identifier - Business Identifier for observation
        Returns:
        A reference to this Builder instance
        Throws:
        NullPointerException - If the passed collection is null
      • status

        public Observation.Builder status​(ObservationStatus status)
        The status of the result value.

        This element is required.

        Parameters:
        status - registered | preliminary | final | amended +
        Returns:
        A reference to this Builder instance
      • category

        public Observation.Builder category​(CodeableConcept... category)
        A code that classifies the general type of observation being made.

        Adds new element(s) to the existing list. If any of the elements are null, calling build() will fail.

        Parameters:
        category - Classification of type of observation
        Returns:
        A reference to this Builder instance
      • category

        public Observation.Builder category​(Collection<CodeableConcept> category)
        A code that classifies the general type of observation being made.

        Replaces the existing list with a new one containing elements from the Collection. If any of the elements are null, calling build() will fail.

        Parameters:
        category - Classification of type of observation
        Returns:
        A reference to this Builder instance
        Throws:
        NullPointerException - If the passed collection is null
      • code

        public Observation.Builder code​(CodeableConcept code)
        Describes what was observed. Sometimes this is called the observation "name".

        This element is required.

        Parameters:
        code - Type of observation (code / type)
        Returns:
        A reference to this Builder instance
      • subject

        public Observation.Builder subject​(Reference subject)
        The patient, or group of patients, location, or device this observation is about and into whose record the observation is placed. If the actual focus of the observation is different from the subject (or a sample of, part, or region of the subject), the `focus` element or the `code` itself specifies the actual focus of the observation.

        Allowed resource types for this reference:

        Parameters:
        subject - Who and/or what the observation is about
        Returns:
        A reference to this Builder instance
      • focus

        public Observation.Builder focus​(Reference... focus)
        The actual focus of an observation when it is not the patient of record representing something or someone associated with the patient such as a spouse, parent, fetus, or donor. For example, fetus observations in a mother's record. The focus of an observation could also be an existing condition, an intervention, the subject's diet, another observation of the subject, or a body structure such as tumor or implanted device. An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus.

        Adds new element(s) to the existing list. If any of the elements are null, calling build() will fail.

        Parameters:
        focus - What the observation is about, when it is not about the subject of record
        Returns:
        A reference to this Builder instance
      • focus

        public Observation.Builder focus​(Collection<Reference> focus)
        The actual focus of an observation when it is not the patient of record representing something or someone associated with the patient such as a spouse, parent, fetus, or donor. For example, fetus observations in a mother's record. The focus of an observation could also be an existing condition, an intervention, the subject's diet, another observation of the subject, or a body structure such as tumor or implanted device. An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus.

        Replaces the existing list with a new one containing elements from the Collection. If any of the elements are null, calling build() will fail.

        Parameters:
        focus - What the observation is about, when it is not about the subject of record
        Returns:
        A reference to this Builder instance
        Throws:
        NullPointerException - If the passed collection is null
      • encounter

        public Observation.Builder encounter​(Reference encounter)
        The healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made.

        Allowed resource types for this reference:

        Parameters:
        encounter - Healthcare event during which this observation is made
        Returns:
        A reference to this Builder instance
      • effective

        public Observation.Builder effective​(ZonedDateTime effective)
        Convenience method for setting effective with choice type Instant.
        Parameters:
        effective - Clinically relevant time/time-period for observation
        Returns:
        A reference to this Builder instance
        See Also:
        effective(Element)
      • effective

        public Observation.Builder effective​(Element effective)
        The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.

        This is a choice element with the following allowed types:

        Parameters:
        effective - Clinically relevant time/time-period for observation
        Returns:
        A reference to this Builder instance
      • issued

        public Observation.Builder issued​(Instant issued)
        The date and time this version of the observation was made available to providers, typically after the results have been reviewed and verified.
        Parameters:
        issued - Date/Time this version was made available
        Returns:
        A reference to this Builder instance
      • value

        public Observation.Builder value​(String value)
        Convenience method for setting value with choice type String.
        Parameters:
        value - Actual result
        Returns:
        A reference to this Builder instance
        See Also:
        value(Element)
      • value

        public Observation.Builder value​(Boolean value)
        Convenience method for setting value with choice type Boolean.
        Parameters:
        value - Actual result
        Returns:
        A reference to this Builder instance
        See Also:
        value(Element)
      • value

        public Observation.Builder value​(Integer value)
        Convenience method for setting value with choice type Integer.
        Parameters:
        value - Actual result
        Returns:
        A reference to this Builder instance
        See Also:
        value(Element)
      • value

        public Observation.Builder value​(LocalTime value)
        Convenience method for setting value with choice type Time.
        Parameters:
        value - Actual result
        Returns:
        A reference to this Builder instance
        See Also:
        value(Element)
      • dataAbsentReason

        public Observation.Builder dataAbsentReason​(CodeableConcept dataAbsentReason)
        Provides a reason why the expected value in the element Observation.value[x] is missing.
        Parameters:
        dataAbsentReason - Why the result is missing
        Returns:
        A reference to this Builder instance
      • interpretation

        public Observation.Builder interpretation​(CodeableConcept... interpretation)
        A categorical assessment of an observation value. For example, high, low, normal.

        Adds new element(s) to the existing list. If any of the elements are null, calling build() will fail.

        Parameters:
        interpretation - High, low, normal, etc.
        Returns:
        A reference to this Builder instance
      • interpretation

        public Observation.Builder interpretation​(Collection<CodeableConcept> interpretation)
        A categorical assessment of an observation value. For example, high, low, normal.

        Replaces the existing list with a new one containing elements from the Collection. If any of the elements are null, calling build() will fail.

        Parameters:
        interpretation - High, low, normal, etc.
        Returns:
        A reference to this Builder instance
        Throws:
        NullPointerException - If the passed collection is null
      • note

        public Observation.Builder note​(Annotation... note)
        Comments about the observation or the results.

        Adds new element(s) to the existing list. If any of the elements are null, calling build() will fail.

        Parameters:
        note - Comments about the observation
        Returns:
        A reference to this Builder instance
      • note

        public Observation.Builder note​(Collection<Annotation> note)
        Comments about the observation or the results.

        Replaces the existing list with a new one containing elements from the Collection. If any of the elements are null, calling build() will fail.

        Parameters:
        note - Comments about the observation
        Returns:
        A reference to this Builder instance
        Throws:
        NullPointerException - If the passed collection is null
      • bodySite

        public Observation.Builder bodySite​(CodeableConcept bodySite)
        Indicates the site on the subject's body where the observation was made (i.e. the target site).
        Parameters:
        bodySite - Observed body part
        Returns:
        A reference to this Builder instance
      • method

        public Observation.Builder method​(CodeableConcept method)
        Indicates the mechanism used to perform the observation.
        Parameters:
        method - How it was done
        Returns:
        A reference to this Builder instance
      • specimen

        public Observation.Builder specimen​(Reference specimen)
        The specimen that was used when this observation was made.

        Allowed resource types for this reference:

        Parameters:
        specimen - Specimen used for this observation
        Returns:
        A reference to this Builder instance
      • device

        public Observation.Builder device​(Reference device)
        The device used to generate the observation data.

        Allowed resource types for this reference:

        Parameters:
        device - (Measurement) Device
        Returns:
        A reference to this Builder instance
      • referenceRange

        public Observation.Builder referenceRange​(Observation.ReferenceRange... referenceRange)
        Guidance on how to interpret the value by comparison to a normal or recommended range. Multiple reference ranges are interpreted as an "OR". In other words, to represent two distinct target populations, two `referenceRange` elements would be used.

        Adds new element(s) to the existing list. If any of the elements are null, calling build() will fail.

        Parameters:
        referenceRange - Provides guide for interpretation
        Returns:
        A reference to this Builder instance
      • referenceRange

        public Observation.Builder referenceRange​(Collection<Observation.ReferenceRange> referenceRange)
        Guidance on how to interpret the value by comparison to a normal or recommended range. Multiple reference ranges are interpreted as an "OR". In other words, to represent two distinct target populations, two `referenceRange` elements would be used.

        Replaces the existing list with a new one containing elements from the Collection. If any of the elements are null, calling build() will fail.

        Parameters:
        referenceRange - Provides guide for interpretation
        Returns:
        A reference to this Builder instance
        Throws:
        NullPointerException - If the passed collection is null
      • hasMember

        public Observation.Builder hasMember​(Reference... hasMember)
        This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group.

        Adds new element(s) to the existing list. If any of the elements are null, calling build() will fail.

        Allowed resource types for the references:

        Parameters:
        hasMember - Related resource that belongs to the Observation group
        Returns:
        A reference to this Builder instance
      • hasMember

        public Observation.Builder hasMember​(Collection<Reference> hasMember)
        This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group.

        Replaces the existing list with a new one containing elements from the Collection. If any of the elements are null, calling build() will fail.

        Allowed resource types for the references:

        Parameters:
        hasMember - Related resource that belongs to the Observation group
        Returns:
        A reference to this Builder instance
        Throws:
        NullPointerException - If the passed collection is null
      • derivedFrom

        public Observation.Builder derivedFrom​(Reference... derivedFrom)
        The target resource that represents a measurement from which this observation value is derived. For example, a calculated anion gap or a fetal measurement based on an ultrasound image.

        Adds new element(s) to the existing list. If any of the elements are null, calling build() will fail.

        Allowed resource types for the references:

        Parameters:
        derivedFrom - Related measurements the observation is made from
        Returns:
        A reference to this Builder instance
      • component

        public Observation.Builder component​(Observation.Component... component)
        Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same attributes. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations.

        Adds new element(s) to the existing list. If any of the elements are null, calling build() will fail.

        Parameters:
        component - Component results
        Returns:
        A reference to this Builder instance
      • component

        public Observation.Builder component​(Collection<Observation.Component> component)
        Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same attributes. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations.

        Replaces the existing list with a new one containing elements from the Collection. If any of the elements are null, calling build() will fail.

        Parameters:
        component - Component results
        Returns:
        A reference to this Builder instance
        Throws:
        NullPointerException - If the passed collection is null
      • validate

        protected void validate​(Observation observation)