Class ChEmedEprDosage
java.lang.Object
org.hl7.fhir.r4.model.Base
org.hl7.fhir.r4.model.Element
org.hl7.fhir.r4.model.Type
org.hl7.fhir.r4.model.BackboneType
org.hl7.fhir.r4.model.Dosage
org.projecthusky.fhir.emed.ch.epr.datatypes.ChEmedEprDosage
- All Implemented Interfaces:
ca.uhn.fhir.model.api.IElement
,Serializable
,org.hl7.fhir.instance.model.api.IBase
,org.hl7.fhir.instance.model.api.IBaseBackboneElement
,org.hl7.fhir.instance.model.api.IBaseDatatype
,org.hl7.fhir.instance.model.api.IBaseElement
,org.hl7.fhir.instance.model.api.IBaseHasExtensions
,org.hl7.fhir.instance.model.api.IBaseHasModifierExtensions
,org.hl7.fhir.instance.model.api.ICompositeType
public class ChEmedEprDosage
extends org.hl7.fhir.r4.model.Dosage
The HAPI custom structure for CH-EMED-Dosage.
- Author:
- Ronaldo Loureiro
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.hl7.fhir.r4.model.Dosage
org.hl7.fhir.r4.model.Dosage.DosageDoseAndRateComponent
-
Field Summary
Fields inherited from class org.hl7.fhir.r4.model.Dosage
additionalInstruction, asNeeded, doseAndRate, maxDosePerAdministration, maxDosePerLifetime, maxDosePerPeriod, method, patientInstruction, route, sequence, site, text, timing
Fields inherited from class org.hl7.fhir.r4.model.BackboneType
modifierExtension
Fields inherited from class org.hl7.fhir.r4.model.Element
extension, id
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddWhen
(TimingEventAmbu timing) Adds an event timing for time period occurrence.copy()
org.hl7.fhir.r4.model.Period
Gets the start and/or end of treatment.@Nullable Instant
Returns the bounds period end time as an inclusive instant, ornull
if it is not specified.@Nullable Instant
Returns the bounds period start time as an inclusive instant, ornull
if it is not specified.@Nullable String
Returns the site text, either the `site.text` element or the first `site.coding.text` that is filled.boolean
Return whether the start and/or end of treatment.boolean
hasWhen()
Return whether a code for time period of occurrence.boolean
Returns whether the dosage is 'as needed'.@Nullable Duration
Resolves the treatment duration, if specified.@Nullable Dose
Resolve the dose.@Nullable AmountQuantity
Returns the resolved max dose per administration, ornull
if it is not specified.@Nullable AmountQuantity
Returns the resolved max dose per lifetime, ornull
if it is not specified.@Nullable AmountPerDuration
Returns the resolved max dose per period, ornull
if it is not specified.@Nullable RouteOfAdministrationEdqm
Resolve the routeOfAdministration of administration.Resolves the list of with event timings.setBoundsPeriod
(org.hl7.fhir.r4.model.Period boundsPeriod) Sets start and/or end of treatment.setDoseQuantity
(ChEmedQuantityWithEmedUnits doseQuantity) Sets the dose quantity.setDoseRange
(ChEmedQuantityWithEmedUnits doseRange) Sets the dose range.setPatientInstruction
(String patientInstruction) Sets patient medication instructions.setRouteOfAdministration
(RouteOfAdministrationEdqm routeOfAdministration) Sets routeOfAdministration of administration.Methods inherited from class org.hl7.fhir.r4.model.Dosage
addAdditionalInstruction, addAdditionalInstruction, addChild, addDoseAndRate, addDoseAndRate, copyValues, equalsDeep, equalsShallow, fhirType, getAdditionalInstruction, getAdditionalInstructionFirstRep, getAsNeeded, getAsNeededBooleanType, getAsNeededCodeableConcept, getDoseAndRate, getDoseAndRateFirstRep, getMaxDosePerAdministration, getMaxDosePerLifetime, getMaxDosePerPeriod, getMethod, getNamedProperty, getPatientInstruction, getPatientInstructionElement, getProperty, getRoute, getSequence, getSequenceElement, getSite, getText, getTextElement, getTiming, getTypesForProperty, hasAdditionalInstruction, hasAsNeeded, hasAsNeededBooleanType, hasAsNeededCodeableConcept, hasDoseAndRate, hasMaxDosePerAdministration, hasMaxDosePerLifetime, hasMaxDosePerPeriod, hasMethod, hasPatientInstruction, hasPatientInstructionElement, hasRoute, hasSequence, hasSequenceElement, hasSite, hasText, hasTextElement, hasTiming, isEmpty, listChildren, makeProperty, removeChild, setAdditionalInstruction, setAsNeeded, setDoseAndRate, setMaxDosePerAdministration, setMaxDosePerLifetime, setMaxDosePerPeriod, setMethod, setPatientInstructionElement, setProperty, setProperty, setRoute, setSequence, setSequenceElement, setSite, setText, setTextElement, setTiming, typedCopy
Methods inherited from class org.hl7.fhir.r4.model.BackboneType
addModifierExtension, addModifierExtension, checkNoModifiers, copyExtensions, copyNewExtensions, copyValues, getExtensionsByUrl, getModifierExtension, getModifierExtensionFirstRep, hasExtension, hasExtension, hasModifierExtension, setModifierExtension
Methods inherited from class org.hl7.fhir.r4.model.Element
addExtension, addExtension, addExtension, copyExtensions, copyNewExtensions, copyValues, getExtension, getExtensionByUrl, getExtensionFirstRep, getExtensionsByUrl, getExtensionString, getId, getIdBase, getIdElement, hasExtension, hasExtension, hasId, hasIdElement, isDisallowExtensions, noExtensions, removeExtension, setDisallowExtensions, setExtension, setId, setIdBase, setIdElement
Methods inherited from class org.hl7.fhir.r4.model.Base
castToAddress, castToAnnotation, castToAttachment, castToBase64Binary, castToBoolean, castToCanonical, castToCode, castToCodeableConcept, castToCoding, castToContactDetail, castToContactPoint, castToContributor, castToDataRequirement, castToDate, castToDateTime, castToDecimal, castToDosage, castToDuration, castToElementDefinition, castToExpression, castToExtension, castToHumanName, castToId, castToIdentifier, castToInstant, castToInteger, castToMarkdown, castToMarketingStatus, castToMeta, castToMoney, castToNarrative, castToOid, castToParameterDefinition, castToPeriod, castToPopulation, castToPositiveInt, castToProdCharacteristic, castToProductShelfLife, castToQuantity, castToRange, castToRatio, castToReference, castToRelatedArtifact, castToResource, castToSampledData, castToSignature, castToSimpleQuantity, castToString, castToSubstanceAmount, castToTime, castToTiming, castToTriggerDefinition, castToType, castToUnsignedInt, castToUri, castToUrl, castToUsageContext, castToXhtml, castToXhtmlString, children, clearUserData, compareDeep, compareDeep, compareDeep, compareDeep, compareValues, compareValues, copyValues, dateTimeValue, equals, getChildByName, getFormatCommentsPost, getFormatCommentsPre, getNamedProperty, getUserData, getUserInt, getUserString, getXhtml, hasFormatComment, hasPrimitiveValue, hasType, hasUserData, isBooleanPrimitive, isDateTime, isMetadataBased, isPrimitive, isResource, listChildrenByName, listChildrenByName, primitiveValue, setUserData, setUserDataINN
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hl7.fhir.instance.model.api.IBase
getFormatCommentsPost, getFormatCommentsPre, getUserData, hasFormatComment, setUserData
Methods inherited from interface org.hl7.fhir.instance.model.api.IBaseElement
getUserData, setUserData
Methods inherited from interface org.hl7.fhir.instance.model.api.IBaseHasExtensions
addExtension, getExtension, hasExtension
-
Constructor Details
-
ChEmedEprDosage
public ChEmedEprDosage()Empty constructor
-
-
Method Details
-
resolveWhen
Resolves the list of with event timings.- Returns:
- the list of with event timings.
- Throws:
InvalidEmedContentException
- if dosage for time period of occurrence is invalid.
-
resolveRouteOfAdministration
@ExpectsValidResource public @Nullable RouteOfAdministrationEdqm resolveRouteOfAdministration() throws InvalidEmedContentExceptionResolve the routeOfAdministration of administration.- Returns:
- the routeOfAdministration of administration or
null
. - Throws:
InvalidEmedContentException
- if the routeOfAdministration of administration is invalid.
-
resolveDose
Resolve the dose.- Returns:
- the dose or
null
if it is not specified. - Throws:
InvalidEmedContentException
-
isAsNeeded
public boolean isAsNeeded()Returns whether the dosage is 'as needed'. -
getBoundsPeriod
public org.hl7.fhir.r4.model.Period getBoundsPeriod()Gets the start and/or end of treatment. If it doesn't exist, it is created.- Returns:
- the start and/or end of treatment.
-
resolveBoundsDuration
Resolves the treatment duration, if specified.- Returns:
- the treatment duration or
null
.
-
setPatientInstruction
Sets patient medication instructions.- Overrides:
setPatientInstruction
in classorg.hl7.fhir.r4.model.Dosage
- Parameters:
patientInstruction
- Instructions in terms that are understood by the patient or consumer.- Returns:
- this.
-
setBoundsPeriod
Sets start and/or end of treatment.- Parameters:
boundsPeriod
- start and/or end of treatment.- Returns:
- this.
-
setRouteOfAdministration
Sets routeOfAdministration of administration.- Parameters:
routeOfAdministration
- the routeOfAdministration of administration.- Returns:
- this.
-
setDoseQuantity
Sets the dose quantity.- Parameters:
doseQuantity
- the dose quantity.- Returns:
- this.
-
setDoseRange
Sets the dose range.- Parameters:
doseRange
- the dose range.- Returns:
- this.
-
addWhen
Adds an event timing for time period occurrence.- Parameters:
timing
- the event timing.- Returns:
- this.
-
hasWhen
public boolean hasWhen()Return whether a code for time period of occurrence.- Returns:
true
if a code for time period of occurrence exists,false
otherwise.
-
hasBoundsPeriod
public boolean hasBoundsPeriod()Return whether the start and/or end of treatment.- Returns:
true
if the start and/or end of treatment exists,false
otherwise.
-
getInclusiveStartTime
Returns the bounds period start time as an inclusive instant, ornull
if it is not specified.- Returns:
- the bounds period start time or
null
.
-
getInclusiveEndTime
Returns the bounds period end time as an inclusive instant, ornull
if it is not specified.- Returns:
- the bounds period end time or
null
. - Implementation Note:
boundsPeriod.getEnd().toInstant()
returns the earliest instant covered by the partial date. Here, we want the latest instant so we use Husky's time utilities.
-
getSiteText
Returns the site text, either the `site.text` element or the first `site.coding.text` that is filled. -
resolveMaxDosePerPeriod
Returns the resolved max dose per period, ornull
if it is not specified. Throws if it is specified but invalid. -
resolveMaxDosePerAdministration
Returns the resolved max dose per administration, ornull
if it is not specified. Throws if it is specified but invalid. -
resolveMaxDosePerLifetime
Returns the resolved max dose per lifetime, ornull
if it is not specified. Throws if it is specified but invalid. -
copy
- Overrides:
copy
in classorg.hl7.fhir.r4.model.Dosage
-