Class Encounter.Builder
- java.lang.Object
-
- com.ibm.fhir.model.builder.AbstractBuilder<Resource>
-
- com.ibm.fhir.model.resource.Resource.Builder
-
- com.ibm.fhir.model.resource.DomainResource.Builder
-
- com.ibm.fhir.model.resource.Encounter.Builder
-
- Enclosing class:
- Encounter
public static class Encounter.Builder extends DomainResource.Builder
-
-
Field Summary
-
Fields inherited from class com.ibm.fhir.model.resource.DomainResource.Builder
contained, extension, modifierExtension, text
-
Fields inherited from class com.ibm.fhir.model.resource.Resource.Builder
id, implicitRules, language, meta
-
Fields inherited from class com.ibm.fhir.model.builder.AbstractBuilder
validating
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Encounter.Builder
account(Reference... account)
The set of accounts that may be used for billing for this Encounter.Encounter.Builder
account(Collection<Reference> account)
The set of accounts that may be used for billing for this Encounter.Encounter.Builder
appointment(Reference... appointment)
The appointment that scheduled this encounter.Encounter.Builder
appointment(Collection<Reference> appointment)
The appointment that scheduled this encounter.Encounter.Builder
basedOn(Reference... basedOn)
The request this encounter satisfies (e.g.Encounter.Builder
basedOn(Collection<Reference> basedOn)
The request this encounter satisfies (e.g.Encounter
build()
Build theEncounter
Encounter.Builder
classHistory(Encounter.ClassHistory... classHistory)
The class history permits the tracking of the encounters transitions without needing to go through the resource history.Encounter.Builder
classHistory(Collection<Encounter.ClassHistory> classHistory)
The class history permits the tracking of the encounters transitions without needing to go through the resource history.Encounter.Builder
clazz(Coding clazz)
Concepts representing classification of patient encounter such as ambulatory (outpatient), inpatient, emergency, home health or others due to local variations.Encounter.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.Encounter.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.Encounter.Builder
diagnosis(Encounter.Diagnosis... diagnosis)
The list of diagnosis relevant to this encounter.Encounter.Builder
diagnosis(Collection<Encounter.Diagnosis> diagnosis)
The list of diagnosis relevant to this encounter.Encounter.Builder
episodeOfCare(Reference... episodeOfCare)
Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used.Encounter.Builder
episodeOfCare(Collection<Reference> episodeOfCare)
Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used.Encounter.Builder
extension(Extension... extension)
May be used to represent additional information that is not part of the basic definition of the resource.Encounter.Builder
extension(Collection<Extension> extension)
May be used to represent additional information that is not part of the basic definition of the resource.protected Encounter.Builder
from(Encounter encounter)
Encounter.Builder
hospitalization(Encounter.Hospitalization hospitalization)
Details about the admission to a healthcare service.Encounter.Builder
id(String id)
The logical id of the resource, as used in the URL for the resource.Encounter.Builder
identifier(Identifier... identifier)
Identifier(s) by which this encounter is known.Encounter.Builder
identifier(Collection<Identifier> identifier)
Identifier(s) by which this encounter is known.Encounter.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.Encounter.Builder
language(Code language)
The base language in which the resource is written.Encounter.Builder
length(Duration length)
Quantity of time the encounter lasted.Encounter.Builder
location(Encounter.Location... location)
List of locations where the patient has been during this encounter.Encounter.Builder
location(Collection<Encounter.Location> location)
List of locations where the patient has been during this encounter.Encounter.Builder
meta(Meta meta)
The metadata about the resource.Encounter.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.Encounter.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.Encounter.Builder
participant(Encounter.Participant... participant)
The list of people responsible for providing the service.Encounter.Builder
participant(Collection<Encounter.Participant> participant)
The list of people responsible for providing the service.Encounter.Builder
partOf(Reference partOf)
Another Encounter of which this encounter is a part of (administratively or in time).Encounter.Builder
period(Period period)
The start and end time of the encounter.Encounter.Builder
priority(CodeableConcept priority)
Indicates the urgency of the encounter.Encounter.Builder
reasonCode(CodeableConcept... reasonCode)
Reason the encounter takes place, expressed as a code.Encounter.Builder
reasonCode(Collection<CodeableConcept> reasonCode)
Reason the encounter takes place, expressed as a code.Encounter.Builder
reasonReference(Reference... reasonReference)
Reason the encounter takes place, expressed as a code.Encounter.Builder
reasonReference(Collection<Reference> reasonReference)
Reason the encounter takes place, expressed as a code.Encounter.Builder
serviceProvider(Reference serviceProvider)
The organization that is primarily responsible for this Encounter's services.Encounter.Builder
serviceType(CodeableConcept serviceType)
Broad categorization of the service that is to be provided (e.g.Encounter.Builder
status(EncounterStatus status)
planned | arrived | triaged | in-progress | onleave | finished | cancelled +.Encounter.Builder
statusHistory(Encounter.StatusHistory... statusHistory)
The status history permits the encounter resource to contain the status history without needing to read through the historical versions of the resource, or even have the server store them.Encounter.Builder
statusHistory(Collection<Encounter.StatusHistory> statusHistory)
The status history permits the encounter resource to contain the status history without needing to read through the historical versions of the resource, or even have the server store them.Encounter.Builder
subject(Reference subject)
The patient or group present at the encounter.Encounter.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.Encounter.Builder
type(CodeableConcept... type)
Specific type of encounter (e.g.Encounter.Builder
type(Collection<CodeableConcept> type)
Specific type of encounter (e.g.protected void
validate(Encounter encounter)
-
Methods inherited from class com.ibm.fhir.model.resource.DomainResource.Builder
from, validate
-
Methods inherited from class com.ibm.fhir.model.resource.Resource.Builder
from, validate
-
Methods inherited from class com.ibm.fhir.model.builder.AbstractBuilder
isValidating, setValidating
-
-
-
-
Method Detail
-
id
public Encounter.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 classDomainResource.Builder
- Parameters:
id
- Logical id of this artifact- Returns:
- A reference to this Builder instance
-
meta
public Encounter.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 classDomainResource.Builder
- Parameters:
meta
- Metadata about the resource- Returns:
- A reference to this Builder instance
-
implicitRules
public Encounter.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 classDomainResource.Builder
- Parameters:
implicitRules
- A set of rules under which this content was created- Returns:
- A reference to this Builder instance
-
language
public Encounter.Builder language(Code language)
The base language in which the resource is written.- Overrides:
language
in classDomainResource.Builder
- Parameters:
language
- Language of the resource content- Returns:
- A reference to this Builder instance
-
text
public Encounter.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 classDomainResource.Builder
- Parameters:
text
- Text summary of the resource, for human interpretation- Returns:
- A reference to this Builder instance
-
contained
public Encounter.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
- Overrides:
contained
in classDomainResource.Builder
- Parameters:
contained
- Contained, inline Resources- Returns:
- A reference to this Builder instance
-
contained
public Encounter.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
- Overrides:
contained
in classDomainResource.Builder
- Parameters:
contained
- Contained, inline Resources- Returns:
- A reference to this Builder instance
-
extension
public Encounter.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
- Overrides:
extension
in classDomainResource.Builder
- Parameters:
extension
- Additional content defined by implementations- Returns:
- A reference to this Builder instance
-
extension
public Encounter.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
- Overrides:
extension
in classDomainResource.Builder
- Parameters:
extension
- Additional content defined by implementations- Returns:
- A reference to this Builder instance
-
modifierExtension
public Encounter.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
- Overrides:
modifierExtension
in classDomainResource.Builder
- Parameters:
modifierExtension
- Extensions that cannot be ignored- Returns:
- A reference to this Builder instance
-
modifierExtension
public Encounter.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
- Overrides:
modifierExtension
in classDomainResource.Builder
- Parameters:
modifierExtension
- Extensions that cannot be ignored- Returns:
- A reference to this Builder instance
-
identifier
public Encounter.Builder identifier(Identifier... identifier)
Identifier(s) by which this encounter is known.Adds new element(s) to the existing list
- Parameters:
identifier
- Identifier(s) by which this encounter is known- Returns:
- A reference to this Builder instance
-
identifier
public Encounter.Builder identifier(Collection<Identifier> identifier)
Identifier(s) by which this encounter is known.Replaces the existing list with a new one containing elements from the Collection
- Parameters:
identifier
- Identifier(s) by which this encounter is known- Returns:
- A reference to this Builder instance
-
status
public Encounter.Builder status(EncounterStatus status)
planned | arrived | triaged | in-progress | onleave | finished | cancelled +.This element is required.
- Parameters:
status
- planned | arrived | triaged | in-progress | onleave | finished | cancelled +- Returns:
- A reference to this Builder instance
-
statusHistory
public Encounter.Builder statusHistory(Encounter.StatusHistory... statusHistory)
The status history permits the encounter resource to contain the status history without needing to read through the historical versions of the resource, or even have the server store them.Adds new element(s) to the existing list
- Parameters:
statusHistory
- List of past encounter statuses- Returns:
- A reference to this Builder instance
-
statusHistory
public Encounter.Builder statusHistory(Collection<Encounter.StatusHistory> statusHistory)
The status history permits the encounter resource to contain the status history without needing to read through the historical versions of the resource, or even have the server store them.Replaces the existing list with a new one containing elements from the Collection
- Parameters:
statusHistory
- List of past encounter statuses- Returns:
- A reference to this Builder instance
-
clazz
public Encounter.Builder clazz(Coding clazz)
Concepts representing classification of patient encounter such as ambulatory (outpatient), inpatient, emergency, home health or others due to local variations.This element is required.
- Parameters:
clazz
- Classification of patient encounter- Returns:
- A reference to this Builder instance
-
classHistory
public Encounter.Builder classHistory(Encounter.ClassHistory... classHistory)
The class history permits the tracking of the encounters transitions without needing to go through the resource history. This would be used for a case where an admission starts of as an emergency encounter, then transitions into an inpatient scenario. Doing this and not restarting a new encounter ensures that any lab/diagnostic results can more easily follow the patient and not require re-processing and not get lost or cancelled during a kind of discharge from emergency to inpatient.Adds new element(s) to the existing list
- Parameters:
classHistory
- List of past encounter classes- Returns:
- A reference to this Builder instance
-
classHistory
public Encounter.Builder classHistory(Collection<Encounter.ClassHistory> classHistory)
The class history permits the tracking of the encounters transitions without needing to go through the resource history. This would be used for a case where an admission starts of as an emergency encounter, then transitions into an inpatient scenario. Doing this and not restarting a new encounter ensures that any lab/diagnostic results can more easily follow the patient and not require re-processing and not get lost or cancelled during a kind of discharge from emergency to inpatient.Replaces the existing list with a new one containing elements from the Collection
- Parameters:
classHistory
- List of past encounter classes- Returns:
- A reference to this Builder instance
-
type
public Encounter.Builder type(CodeableConcept... type)
Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).Adds new element(s) to the existing list
- Parameters:
type
- Specific type of encounter- Returns:
- A reference to this Builder instance
-
type
public Encounter.Builder type(Collection<CodeableConcept> type)
Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).Replaces the existing list with a new one containing elements from the Collection
- Parameters:
type
- Specific type of encounter- Returns:
- A reference to this Builder instance
-
serviceType
public Encounter.Builder serviceType(CodeableConcept serviceType)
Broad categorization of the service that is to be provided (e.g. cardiology).- Parameters:
serviceType
- Specific type of service- Returns:
- A reference to this Builder instance
-
priority
public Encounter.Builder priority(CodeableConcept priority)
Indicates the urgency of the encounter.- Parameters:
priority
- Indicates the urgency of the encounter- Returns:
- A reference to this Builder instance
-
subject
public Encounter.Builder subject(Reference subject)
The patient or group present at the encounter.Allowed resource types for this reference:
- Parameters:
subject
- The patient or group present at the encounter- Returns:
- A reference to this Builder instance
-
episodeOfCare
public Encounter.Builder episodeOfCare(Reference... episodeOfCare)
Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem. The association is recorded on the encounter as these are typically created after the episode of care and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years).Adds new element(s) to the existing list
Allowed resource types for the references:
- Parameters:
episodeOfCare
- Episode(s) of care that this encounter should be recorded against- Returns:
- A reference to this Builder instance
-
episodeOfCare
public Encounter.Builder episodeOfCare(Collection<Reference> episodeOfCare)
Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem. The association is recorded on the encounter as these are typically created after the episode of care and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years).Replaces the existing list with a new one containing elements from the Collection
Allowed resource types for the references:
- Parameters:
episodeOfCare
- Episode(s) of care that this encounter should be recorded against- Returns:
- A reference to this Builder instance
-
basedOn
public Encounter.Builder basedOn(Reference... basedOn)
The request this encounter satisfies (e.g. incoming referral or procedure request).Adds new element(s) to the existing list
Allowed resource types for the references:
- Parameters:
basedOn
- The ServiceRequest that initiated this encounter- Returns:
- A reference to this Builder instance
-
basedOn
public Encounter.Builder basedOn(Collection<Reference> basedOn)
The request this encounter satisfies (e.g. incoming referral or procedure request).Replaces the existing list with a new one containing elements from the Collection
Allowed resource types for the references:
- Parameters:
basedOn
- The ServiceRequest that initiated this encounter- Returns:
- A reference to this Builder instance
-
participant
public Encounter.Builder participant(Encounter.Participant... participant)
The list of people responsible for providing the service.Adds new element(s) to the existing list
- Parameters:
participant
- List of participants involved in the encounter- Returns:
- A reference to this Builder instance
-
participant
public Encounter.Builder participant(Collection<Encounter.Participant> participant)
The list of people responsible for providing the service.Replaces the existing list with a new one containing elements from the Collection
- Parameters:
participant
- List of participants involved in the encounter- Returns:
- A reference to this Builder instance
-
appointment
public Encounter.Builder appointment(Reference... appointment)
The appointment that scheduled this encounter.Adds new element(s) to the existing list
Allowed resource types for the references:
- Parameters:
appointment
- The appointment that scheduled this encounter- Returns:
- A reference to this Builder instance
-
appointment
public Encounter.Builder appointment(Collection<Reference> appointment)
The appointment that scheduled this encounter.Replaces the existing list with a new one containing elements from the Collection
Allowed resource types for the references:
- Parameters:
appointment
- The appointment that scheduled this encounter- Returns:
- A reference to this Builder instance
-
period
public Encounter.Builder period(Period period)
The start and end time of the encounter.- Parameters:
period
- The start and end time of the encounter- Returns:
- A reference to this Builder instance
-
length
public Encounter.Builder length(Duration length)
Quantity of time the encounter lasted. This excludes the time during leaves of absence.- Parameters:
length
- Quantity of time the encounter lasted (less time absent)- Returns:
- A reference to this Builder instance
-
reasonCode
public Encounter.Builder reasonCode(CodeableConcept... reasonCode)
Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.Adds new element(s) to the existing list
- Parameters:
reasonCode
- Coded reason the encounter takes place- Returns:
- A reference to this Builder instance
-
reasonCode
public Encounter.Builder reasonCode(Collection<CodeableConcept> reasonCode)
Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.Replaces the existing list with a new one containing elements from the Collection
- Parameters:
reasonCode
- Coded reason the encounter takes place- Returns:
- A reference to this Builder instance
-
reasonReference
public Encounter.Builder reasonReference(Reference... reasonReference)
Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.Adds new element(s) to the existing list
Allowed resource types for the references:
- Parameters:
reasonReference
- Reason the encounter takes place (reference)- Returns:
- A reference to this Builder instance
-
reasonReference
public Encounter.Builder reasonReference(Collection<Reference> reasonReference)
Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.Replaces the existing list with a new one containing elements from the Collection
Allowed resource types for the references:
- Parameters:
reasonReference
- Reason the encounter takes place (reference)- Returns:
- A reference to this Builder instance
-
diagnosis
public Encounter.Builder diagnosis(Encounter.Diagnosis... diagnosis)
The list of diagnosis relevant to this encounter.Adds new element(s) to the existing list
- Parameters:
diagnosis
- The list of diagnosis relevant to this encounter- Returns:
- A reference to this Builder instance
-
diagnosis
public Encounter.Builder diagnosis(Collection<Encounter.Diagnosis> diagnosis)
The list of diagnosis relevant to this encounter.Replaces the existing list with a new one containing elements from the Collection
- Parameters:
diagnosis
- The list of diagnosis relevant to this encounter- Returns:
- A reference to this Builder instance
-
account
public Encounter.Builder account(Reference... account)
The set of accounts that may be used for billing for this Encounter.Adds new element(s) to the existing list
Allowed resource types for the references:
- Parameters:
account
- The set of accounts that may be used for billing for this Encounter- Returns:
- A reference to this Builder instance
-
account
public Encounter.Builder account(Collection<Reference> account)
The set of accounts that may be used for billing for this Encounter.Replaces the existing list with a new one containing elements from the Collection
Allowed resource types for the references:
- Parameters:
account
- The set of accounts that may be used for billing for this Encounter- Returns:
- A reference to this Builder instance
-
hospitalization
public Encounter.Builder hospitalization(Encounter.Hospitalization hospitalization)
Details about the admission to a healthcare service.- Parameters:
hospitalization
- Details about the admission to a healthcare service- Returns:
- A reference to this Builder instance
-
location
public Encounter.Builder location(Encounter.Location... location)
List of locations where the patient has been during this encounter.Adds new element(s) to the existing list
- Parameters:
location
- List of locations where the patient has been- Returns:
- A reference to this Builder instance
-
location
public Encounter.Builder location(Collection<Encounter.Location> location)
List of locations where the patient has been during this encounter.Replaces the existing list with a new one containing elements from the Collection
- Parameters:
location
- List of locations where the patient has been- Returns:
- A reference to this Builder instance
-
serviceProvider
public Encounter.Builder serviceProvider(Reference serviceProvider)
The organization that is primarily responsible for this Encounter's services. This MAY be the same as the organization on the Patient record, however it could be different, such as if the actor performing the services was from an external organization (which may be billed seperately) for an external consultation. Refer to the example bundle showing an abbreviated set of Encounters for a colonoscopy.Allowed resource types for this reference:
- Parameters:
serviceProvider
- The organization (facility) responsible for this encounter- Returns:
- A reference to this Builder instance
-
partOf
public Encounter.Builder partOf(Reference partOf)
Another Encounter of which this encounter is a part of (administratively or in time).Allowed resource types for this reference:
- Parameters:
partOf
- Another Encounter this encounter is part of- Returns:
- A reference to this Builder instance
-
build
public Encounter build()
- Specified by:
build
in interfaceBuilder<Resource>
- Specified by:
build
in classDomainResource.Builder
- Returns:
- An immutable object of type
Encounter
- Throws:
IllegalStateException
- if the current state cannot be built into a valid Encounter per the base specification
-
validate
protected void validate(Encounter encounter)
-
from
protected Encounter.Builder from(Encounter encounter)
-
-