Class Media.Builder
- java.lang.Object
-
- org.linuxforhealth.fhir.model.builder.AbstractBuilder<Resource>
-
- org.linuxforhealth.fhir.model.resource.Resource.Builder
-
- org.linuxforhealth.fhir.model.resource.DomainResource.Builder
-
- org.linuxforhealth.fhir.model.resource.Media.Builder
-
- Enclosing class:
- Media
public static class Media.Builder extends DomainResource.Builder
-
-
Field Summary
-
Fields inherited from class org.linuxforhealth.fhir.model.resource.DomainResource.Builder
contained, extension, modifierExtension, text
-
Fields inherited from class org.linuxforhealth.fhir.model.resource.Resource.Builder
id, implicitRules, language, meta
-
Fields inherited from class org.linuxforhealth.fhir.model.builder.AbstractBuilder
validating
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Media.Builder
basedOn(java.util.Collection<Reference> basedOn)
A procedure that is fulfilled in whole or in part by the creation of this media.Media.Builder
basedOn(Reference... basedOn)
A procedure that is fulfilled in whole or in part by the creation of this media.Media.Builder
bodySite(CodeableConcept bodySite)
Indicates the site on the subject's body where the observation was made (i.e.Media
build()
Build theMedia
Media.Builder
contained(java.util.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.Media.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.Media.Builder
content(Attachment content)
The actual content of the media - inline or by direct reference to the media source file.Media.Builder
created(Element created)
The date and time(s) at which the media was collected.Media.Builder
device(Reference device)
The device used to collect the media.Media.Builder
deviceName(java.lang.String deviceName)
Convenience method for settingdeviceName
.Media.Builder
deviceName(String deviceName)
The name of the device / manufacturer of the device that was used to make the recording.Media.Builder
duration(Decimal duration)
The duration of the recording in seconds - for audio and video.Media.Builder
encounter(Reference encounter)
The encounter that establishes the context for this media.Media.Builder
extension(java.util.Collection<Extension> extension)
May be used to represent additional information that is not part of the basic definition of the resource.Media.Builder
extension(Extension... extension)
May be used to represent additional information that is not part of the basic definition of the resource.Media.Builder
frames(PositiveInt frames)
The number of frames in a photo.protected Media.Builder
from(Media media)
Media.Builder
height(PositiveInt height)
Height of the image in pixels (photo/video).Media.Builder
id(java.lang.String id)
The logical id of the resource, as used in the URL for the resource.Media.Builder
identifier(java.util.Collection<Identifier> identifier)
Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g.Media.Builder
identifier(Identifier... identifier)
Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g.Media.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.Media.Builder
issued(java.time.ZonedDateTime issued)
Convenience method for settingissued
.Media.Builder
issued(Instant issued)
The date and time this version of the media was made available to providers, typically after having been reviewed.Media.Builder
language(Code language)
The base language in which the resource is written.Media.Builder
meta(Meta meta)
The metadata about the resource.Media.Builder
modality(CodeableConcept modality)
Details of the type of the media - usually, how it was acquired (what type of device).Media.Builder
modifierExtension(java.util.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.Media.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.Media.Builder
note(java.util.Collection<Annotation> note)
Comments made about the media by the performer, subject or other participants.Media.Builder
note(Annotation... note)
Comments made about the media by the performer, subject or other participants.Media.Builder
operator(Reference operator)
The person who administered the collection of the image.Media.Builder
partOf(java.util.Collection<Reference> partOf)
A larger event of which this particular event is a component or step.Media.Builder
partOf(Reference... partOf)
A larger event of which this particular event is a component or step.Media.Builder
reasonCode(java.util.Collection<CodeableConcept> reasonCode)
Describes why the event occurred in coded or textual form.Media.Builder
reasonCode(CodeableConcept... reasonCode)
Describes why the event occurred in coded or textual form.Media.Builder
status(MediaStatus status)
The current state of the {{title}}.Media.Builder
subject(Reference subject)
Who/What this Media is a record of.Media.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.Media.Builder
type(CodeableConcept type)
A code that classifies whether the media is an image, video or audio recording or some other media category.protected void
validate(Media media)
Media.Builder
view(CodeableConcept view)
The name of the imaging view e.g.Media.Builder
width(PositiveInt width)
Width of the image in pixels (photo/video).-
Methods inherited from class org.linuxforhealth.fhir.model.resource.DomainResource.Builder
from, validate
-
Methods inherited from class org.linuxforhealth.fhir.model.resource.Resource.Builder
from, validate
-
Methods inherited from class org.linuxforhealth.fhir.model.builder.AbstractBuilder
isValidating, setValidating
-
-
-
-
Method Detail
-
id
public Media.Builder id(java.lang.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 Media.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 Media.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 Media.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 Media.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 Media.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 classDomainResource.Builder
- Parameters:
contained
- Contained, inline Resources- Returns:
- A reference to this Builder instance
-
contained
public Media.Builder contained(java.util.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 classDomainResource.Builder
- Parameters:
contained
- Contained, inline Resources- Returns:
- A reference to this Builder instance
- Throws:
java.lang.NullPointerException
- If the passed collection is null
-
extension
public Media.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 classDomainResource.Builder
- Parameters:
extension
- Additional content defined by implementations- Returns:
- A reference to this Builder instance
-
extension
public Media.Builder extension(java.util.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 classDomainResource.Builder
- Parameters:
extension
- Additional content defined by implementations- Returns:
- A reference to this Builder instance
- Throws:
java.lang.NullPointerException
- If the passed collection is null
-
modifierExtension
public Media.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 classDomainResource.Builder
- Parameters:
modifierExtension
- Extensions that cannot be ignored- Returns:
- A reference to this Builder instance
-
modifierExtension
public Media.Builder modifierExtension(java.util.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 classDomainResource.Builder
- Parameters:
modifierExtension
- Extensions that cannot be ignored- Returns:
- A reference to this Builder instance
- Throws:
java.lang.NullPointerException
- If the passed collection is null
-
identifier
public Media.Builder identifier(Identifier... identifier)
Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers.Adds new element(s) to the existing list. If any of the elements are null, calling
build()
will fail.- Parameters:
identifier
- Identifier(s) for the image- Returns:
- A reference to this Builder instance
-
identifier
public Media.Builder identifier(java.util.Collection<Identifier> identifier)
Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers.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
- Identifier(s) for the image- Returns:
- A reference to this Builder instance
- Throws:
java.lang.NullPointerException
- If the passed collection is null
-
basedOn
public Media.Builder basedOn(Reference... basedOn)
A procedure that is fulfilled in whole or in part by the creation of this media.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:
basedOn
- Procedure that caused this media to be created- Returns:
- A reference to this Builder instance
-
basedOn
public Media.Builder basedOn(java.util.Collection<Reference> basedOn)
A procedure that is fulfilled in whole or in part by the creation of this media.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:
basedOn
- Procedure that caused this media to be created- Returns:
- A reference to this Builder instance
- Throws:
java.lang.NullPointerException
- If the passed collection is null
-
partOf
public Media.Builder partOf(Reference... partOf)
A larger event of which this particular event is a component or step.Adds new element(s) to the existing list. If any of the elements are null, calling
build()
will fail.- Parameters:
partOf
- Part of referenced event- Returns:
- A reference to this Builder instance
-
partOf
public Media.Builder partOf(java.util.Collection<Reference> partOf)
A larger event of which this particular event is a component or step.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:
partOf
- Part of referenced event- Returns:
- A reference to this Builder instance
- Throws:
java.lang.NullPointerException
- If the passed collection is null
-
status
public Media.Builder status(MediaStatus status)
The current state of the {{title}}.This element is required.
- Parameters:
status
- preparation | in-progress | not-done | on-hold | stopped | completed | entered-in-error | unknown- Returns:
- A reference to this Builder instance
-
type
public Media.Builder type(CodeableConcept type)
A code that classifies whether the media is an image, video or audio recording or some other media category.- Parameters:
type
- Classification of media as image, video, or audio- Returns:
- A reference to this Builder instance
-
modality
public Media.Builder modality(CodeableConcept modality)
Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality.- Parameters:
modality
- The type of acquisition equipment/process- Returns:
- A reference to this Builder instance
-
view
public Media.Builder view(CodeableConcept view)
The name of the imaging view e.g. Lateral or Antero-posterior (AP).- Parameters:
view
- Imaging view, e.g. Lateral or Antero-posterior- Returns:
- A reference to this Builder instance
-
subject
public Media.Builder subject(Reference subject)
Who/What this Media is a record of.Allowed resource types for this reference:
- Parameters:
subject
- Who/What this Media is a record of- Returns:
- A reference to this Builder instance
-
encounter
public Media.Builder encounter(Reference encounter)
The encounter that establishes the context for this media.Allowed resource types for this reference:
- Parameters:
encounter
- Encounter associated with media- Returns:
- A reference to this Builder instance
-
created
public Media.Builder created(Element created)
The date and time(s) at which the media was collected.This is a choice element with the following allowed types:
- Parameters:
created
- When Media was collected- Returns:
- A reference to this Builder instance
-
issued
public Media.Builder issued(java.time.ZonedDateTime issued)
Convenience method for settingissued
.- Parameters:
issued
- Date/Time this version was made available- Returns:
- A reference to this Builder instance
- See Also:
issued(org.linuxforhealth.fhir.model.type.Instant)
-
issued
public Media.Builder issued(Instant issued)
The date and time this version of the media was made available to providers, typically after having been reviewed.- Parameters:
issued
- Date/Time this version was made available- Returns:
- A reference to this Builder instance
-
operator
public Media.Builder operator(Reference operator)
The person who administered the collection of the image.Allowed resource types for this reference:
- Parameters:
operator
- The person who generated the image- Returns:
- A reference to this Builder instance
-
reasonCode
public Media.Builder reasonCode(CodeableConcept... reasonCode)
Describes why the event occurred in coded or textual form.Adds new element(s) to the existing list. If any of the elements are null, calling
build()
will fail.- Parameters:
reasonCode
- Why was event performed?- Returns:
- A reference to this Builder instance
-
reasonCode
public Media.Builder reasonCode(java.util.Collection<CodeableConcept> reasonCode)
Describes why the event occurred in coded or textual form.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:
reasonCode
- Why was event performed?- Returns:
- A reference to this Builder instance
- Throws:
java.lang.NullPointerException
- If the passed collection is null
-
bodySite
public Media.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
-
deviceName
public Media.Builder deviceName(java.lang.String deviceName)
Convenience method for settingdeviceName
.- Parameters:
deviceName
- Name of the device/manufacturer- Returns:
- A reference to this Builder instance
- See Also:
deviceName(org.linuxforhealth.fhir.model.type.String)
-
deviceName
public Media.Builder deviceName(String deviceName)
The name of the device / manufacturer of the device that was used to make the recording.- Parameters:
deviceName
- Name of the device/manufacturer- Returns:
- A reference to this Builder instance
-
device
public Media.Builder device(Reference device)
The device used to collect the media.Allowed resource types for this reference:
- Parameters:
device
- Observing Device- Returns:
- A reference to this Builder instance
-
height
public Media.Builder height(PositiveInt height)
Height of the image in pixels (photo/video).- Parameters:
height
- Height of the image in pixels (photo/video)- Returns:
- A reference to this Builder instance
-
width
public Media.Builder width(PositiveInt width)
Width of the image in pixels (photo/video).- Parameters:
width
- Width of the image in pixels (photo/video)- Returns:
- A reference to this Builder instance
-
frames
public Media.Builder frames(PositiveInt frames)
The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.- Parameters:
frames
- Number of frames if > 1 (photo)- Returns:
- A reference to this Builder instance
-
duration
public Media.Builder duration(Decimal duration)
The duration of the recording in seconds - for audio and video.- Parameters:
duration
- Length in seconds (audio / video)- Returns:
- A reference to this Builder instance
-
content
public Media.Builder content(Attachment content)
The actual content of the media - inline or by direct reference to the media source file.This element is required.
- Parameters:
content
- Actual Media - reference or data- Returns:
- A reference to this Builder instance
-
note
public Media.Builder note(Annotation... note)
Comments made about the media by the performer, subject or other participants.Adds new element(s) to the existing list. If any of the elements are null, calling
build()
will fail.- Parameters:
note
- Comments made about the media- Returns:
- A reference to this Builder instance
-
note
public Media.Builder note(java.util.Collection<Annotation> note)
Comments made about the media by the performer, subject or other participants.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 made about the media- Returns:
- A reference to this Builder instance
- Throws:
java.lang.NullPointerException
- If the passed collection is null
-
build
public Media build()
-
validate
protected void validate(Media media)
-
from
protected Media.Builder from(Media media)
-
-