Class ChEmedEprMedicationStatement
java.lang.Object
org.hl7.fhir.r4.model.Base
org.hl7.fhir.r4.model.BaseResource
org.hl7.fhir.r4.model.Resource
org.hl7.fhir.r4.model.DomainResource
org.hl7.fhir.r4.model.MedicationStatement
org.projecthusky.fhir.emed.ch.epr.resource.ChEmedEprMedicationStatement
- All Implemented Interfaces:
ca.uhn.fhir.model.api.IElement,Serializable,org.hl7.fhir.instance.model.api.IAnyResource,org.hl7.fhir.instance.model.api.IBase,org.hl7.fhir.instance.model.api.IBaseHasExtensions,org.hl7.fhir.instance.model.api.IBaseHasModifierExtensions,org.hl7.fhir.instance.model.api.IBaseResource,org.hl7.fhir.instance.model.api.IDomainResource,ChEmedEprEntry
- Direct Known Subclasses:
ChEmedEprMedicationStatementChanged,ChEmedEprMedicationStatementMtp,ChEmedEprMedicationStatementPmlBase
public abstract class ChEmedEprMedicationStatement
extends org.hl7.fhir.r4.model.MedicationStatement
implements ChEmedEprEntry
The HAPI custom structure for CH-EMED-EPR MedicationStatement.
- Author:
- Quentin Ligier
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.hl7.fhir.r4.model.MedicationStatement
org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus, org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatusEnumFactory -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected @Nullable org.hl7.fhir.r4.model.CodeableConceptWhether the dispenser can substitute the prescribed medicine/package by another that is deemed equivalent, for medical or logistical reasons.Fields inherited from class org.hl7.fhir.r4.model.MedicationStatement
basedOn, basedOnTarget, category, CATEGORY, CODE, context, CONTEXT, contextTarget, dateAsserted, derivedFrom, derivedFromTarget, dosage, effective, EFFECTIVE, identifier, IDENTIFIER, INCLUDE_CONTEXT, INCLUDE_MEDICATION, INCLUDE_PART_OF, INCLUDE_PATIENT, INCLUDE_SOURCE, INCLUDE_SUBJECT, informationSource, informationSourceTarget, medication, MEDICATION, note, PART_OF, partOf, partOfTarget, PATIENT, reasonCode, reasonReference, reasonReferenceTarget, SOURCE, SP_CATEGORY, SP_CODE, SP_CONTEXT, SP_EFFECTIVE, SP_IDENTIFIER, SP_MEDICATION, SP_PART_OF, SP_PATIENT, SP_SOURCE, SP_STATUS, SP_SUBJECT, status, STATUS, statusReason, subject, SUBJECT, subjectTargetFields inherited from class org.hl7.fhir.r4.model.DomainResource
contained, extension, modifierExtension, textFields inherited from class org.hl7.fhir.r4.model.Resource
id, implicitRules, language, metaFields inherited from interface org.hl7.fhir.instance.model.api.IAnyResource
RES_ID, SP_RES_IDFields inherited from interface org.hl7.fhir.instance.model.api.IBaseResource
INCLUDE_ALL, WILDCARD_ALL_SET -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEmpty constructor for the parser.protectedChEmedEprMedicationStatement(UUID entryUuid) Constructor that pre-populates fields. -
Method Summary
Modifier and TypeMethodDescriptionorg.hl7.fhir.r4.model.MedicationStatementaddDosage(org.hl7.fhir.r4.model.Dosage t) addDosageAdditionalEntry(ChEmedEprDosage dosageAdditionalEntry) Adds additional entry of the dosage instruction.voidcopyValues(org.hl7.fhir.r4.model.MedicationStatement dst) List<org.hl7.fhir.r4.model.Dosage>org.hl7.fhir.r4.model.CodeableConceptGets the substitution element in the medication statement.@Nullable StringGets the treatment reason if available.booleanReturns whether additional entry of the dosage instruction.booleanReturns whether the base entry of the dosage instruction.booleanReturns whether substitution code exists.booleanResolves additional entries of the dosage instruction.Resolves the base entry of the dosage instruction.Converts the main and additional dosages into a read-only model, containing the effective dosage instructions.Resolves the medication statement UUID or throws.Resolves the information source.Returns the medication or throws.Resolves the subject as aChCorePatientEpr.Gets the substitution code in the medication statement.setDosageBaseEntry(ChEmedEprDosage dosageBaseEntry) Sets the base entry of the dosage instruction.setIdentifier(UUID documentUUID) Sets the medication statement UUID.setInformationSource(Author author) Sets the information source (medical author) of the statement.Sets the substitution code in the medication statement, with an English display name.setSubstitution(SubstanceAdministrationSubstitutionCode value, LanguageCode languageCode) Sets the substitution code in the medication statement, with a display name in the requested language.setSubstitutionElement(org.hl7.fhir.r4.model.CodeableConcept value) Sets the substitution element in the medication statement.setTreatmentReason(String treatmentReason) Sets the treatment reason.Methods inherited from class org.hl7.fhir.r4.model.MedicationStatement
addBasedOn, addBasedOn, addChild, addDerivedFrom, addDerivedFrom, addIdentifier, addIdentifier, addNote, addNote, addPartOf, addPartOf, addReasonCode, addReasonCode, addReasonReference, addReasonReference, addStatusReason, addStatusReason, copy, equalsDeep, equalsShallow, fhirType, getBasedOn, getBasedOnFirstRep, getBasedOnTarget, getCategory, getContext, getContextTarget, getDateAsserted, getDateAssertedElement, getDerivedFrom, getDerivedFromFirstRep, getDerivedFromTarget, getEffective, getEffectiveDateTimeType, getEffectivePeriod, getIdentifier, getIdentifierFirstRep, getInformationSource, getInformationSourceTarget, getMedication, getMedicationCodeableConcept, getMedicationReference, getNamedProperty, getNote, getNoteFirstRep, getPartOf, getPartOfFirstRep, getPartOfTarget, getProperty, getReasonCode, getReasonCodeFirstRep, getReasonReference, getReasonReferenceFirstRep, getReasonReferenceTarget, getResourceType, getStatus, getStatusElement, getStatusReason, getStatusReasonFirstRep, getSubject, getSubjectTarget, getTypesForProperty, hasBasedOn, hasCategory, hasContext, hasDateAsserted, hasDateAssertedElement, hasDerivedFrom, hasDosage, hasEffective, hasEffectiveDateTimeType, hasEffectivePeriod, hasIdentifier, hasInformationSource, hasMedication, hasMedicationCodeableConcept, hasMedicationReference, hasNote, hasPartOf, hasReasonCode, hasReasonReference, hasStatus, hasStatusElement, hasStatusReason, hasSubject, isEmpty, listChildren, makeProperty, removeChild, setBasedOn, setCategory, setContext, setContextTarget, setDateAsserted, setDateAssertedElement, setDerivedFrom, setDosage, setEffective, setIdentifier, setInformationSource, setInformationSourceTarget, setMedication, setNote, setPartOf, setProperty, setProperty, setReasonCode, setReasonReference, setStatus, setStatusElement, setStatusReason, setSubject, setSubjectTarget, typedCopyMethods inherited from class org.hl7.fhir.r4.model.DomainResource
addContained, addExtension, addExtension, addExtension, addModifierExtension, addModifierExtension, checkNoModifiers, copyValues, getContained, getExtension, getExtensionByUrl, getExtensionsByUrl, getModifierExtension, getModifierExtensionsByUrl, getText, hasContained, hasExtension, hasExtension, hasModifierExtension, hasText, setContained, setExtension, setModifierExtension, setTextMethods inherited from class org.hl7.fhir.r4.model.Resource
copyValues, getId, getIdBase, getIdElement, getIdPart, getImplicitRules, getImplicitRulesElement, getLanguage, getLanguage, getLanguageElement, getMeta, hasId, hasIdElement, hasImplicitRules, hasImplicitRulesElement, hasLanguage, hasLanguageElement, hasMeta, setId, setIdBase, setIdElement, setImplicitRules, setImplicitRulesElement, setLanguage, setLanguageElement, setMetaMethods inherited from class org.hl7.fhir.r4.model.BaseResource
getStructureFhirVersionEnum, isResource, setIdMethods 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, listChildrenByName, listChildrenByName, primitiveValue, setUserData, setUserDataINNMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hl7.fhir.instance.model.api.IAnyResource
getId, getIdElement, getLanguageElement, getUserData, setId, setUserDataMethods inherited from interface org.hl7.fhir.instance.model.api.IBase
fhirType, getFormatCommentsPost, getFormatCommentsPre, hasFormatComment, isEmptyMethods inherited from interface org.hl7.fhir.instance.model.api.IBaseResource
getMeta, getStructureFhirVersionEnum, isDeleted, setId
-
Field Details
-
substitution
protected @Nullable org.hl7.fhir.r4.model.CodeableConcept substitutionWhether the dispenser can substitute the prescribed medicine/package by another that is deemed equivalent, for medical or logistical reasons. By default, substitution is authorized.
-
-
Constructor Details
-
ChEmedEprMedicationStatement
protected ChEmedEprMedicationStatement()Empty constructor for the parser. -
ChEmedEprMedicationStatement
Constructor that pre-populates fields.- Parameters:
entryUuid- the medication statement id.
-
-
Method Details
-
getEmedType
- Specified by:
getEmedTypein interfaceChEmedEprEntry
-
getSubstitution
public org.hl7.fhir.r4.model.CodeableConcept getSubstitution()Gets the substitution element in the medication statement.- Returns:
- the substitution element.
-
resolveSubstitution
@ExpectsValidResource public SubstanceAdministrationSubstitutionCode resolveSubstitution() throws InvalidEmedContentExceptionGets the substitution code in the medication statement.- Returns:
- the substitution code.
- Throws:
InvalidEmedContentException- if the substitution code is invalid.
-
resolveMedication
@ExpectsValidResource public ChEmedEprMedication resolveMedication() throws InvalidEmedContentExceptionReturns the medication or throws.- Returns:
- the medication.
- Throws:
InvalidEmedContentException- if the medication is missing or invalid.
-
resolveIdentifier
Resolves the medication statement UUID or throws.- Specified by:
resolveIdentifierin interfaceChEmedEprEntry- Returns:
- the medication statement UUID.
- Throws:
InvalidEmedContentException- if the id is missing.
-
resolveBaseDosage
Resolves the base entry of the dosage instruction.- Returns:
- the base entry of the dosage instruction
- Throws:
InvalidEmedContentException- if the base entry of the dosage instruction is missing.
-
resolveAdditionalDosage
Resolves additional entries of the dosage instruction. The list may be empty.- Returns:
- additional entries of the dosage instruction.
-
hasTreatmentReason
public boolean hasTreatmentReason() -
getTreatmentReason
Gets the treatment reason if available.- Returns:
- the treatment reason or
null.
-
setTreatmentReason
Sets the treatment reason. If the treatment reason already exists, it's replaced.- Parameters:
treatmentReason- the treatment reason- Returns:
- this.
-
setIdentifier
Sets the medication statement UUID.- Parameters:
documentUUID- The medication statement UUID.- Returns:
- this.
-
setDosageBaseEntry
Sets the base entry of the dosage instruction. If it already exists, it will be replaced.- Parameters:
dosageBaseEntry- the base entry of the dosage instruction.- Returns:
- this.
-
setSubstitutionElement
public ChEmedEprMedicationStatement setSubstitutionElement(org.hl7.fhir.r4.model.CodeableConcept value) Sets the substitution element in the medication statement.- Parameters:
value- the substitution element.- Returns:
- this.
-
setSubstitution
Sets the substitution code in the medication statement, with an English display name.- Parameters:
value- the substitution code.- Returns:
- this.
-
setSubstitution
public ChEmedEprMedicationStatement setSubstitution(SubstanceAdministrationSubstitutionCode value, LanguageCode languageCode) Sets the substitution code in the medication statement, with a display name in the requested language.- Parameters:
value- the substitution code.languageCode- the requested language for the display name.- Returns:
- this.
-
addDosageAdditionalEntry
Adds additional entry of the dosage instruction.- Parameters:
dosageAdditionalEntry- additional entry of the dosage instruction.- Returns:
- this.
-
hasSubstitution
public boolean hasSubstitution()Returns whether substitution code exists.- Returns:
trueif the substitution code exists,falseotherwise.
-
hasDosageBaseEntry
public boolean hasDosageBaseEntry()Returns whether the base entry of the dosage instruction.- Returns:
trueif the base entry of the dosage instruction exists,falseotherwise.
-
hasDosageAdditionalEntry
public boolean hasDosageAdditionalEntry()Returns whether additional entry of the dosage instruction.- Returns:
trueif additional entry of the dosage instruction exists,falseotherwise.
-
getDosage
- Overrides:
getDosagein classorg.hl7.fhir.r4.model.MedicationStatement- Returns:
MedicationStatement.dosage(Indicates how the medication is/was or should be taken by the patient.)
-
addDosage
- Overrides:
addDosagein classorg.hl7.fhir.r4.model.MedicationStatement
-
addDosage
public org.hl7.fhir.r4.model.MedicationStatement addDosage(org.hl7.fhir.r4.model.Dosage t) - Overrides:
addDosagein classorg.hl7.fhir.r4.model.MedicationStatement
-
getDosageFirstRep
- Overrides:
getDosageFirstRepin classorg.hl7.fhir.r4.model.MedicationStatement- Returns:
- The first repetition of repeating field
MedicationStatement.dosage, creating it if it does not already exist
-
resolveEffectiveDosageInstructions
Converts the main and additional dosages into a read-only model, containing the effective dosage instructions. -
resolveInformationSource
Resolves the information source.- Returns:
- the information source or
null.
-
resolveSubject
Resolves the subject as aChCorePatientEpr.- Returns:
- the subject.
-
copyValues
public void copyValues(org.hl7.fhir.r4.model.MedicationStatement dst) - Overrides:
copyValuesin classorg.hl7.fhir.r4.model.MedicationStatement
-
setInformationSource
Sets the information source (medical author) of the statement. It creates a reference from the received author and sets it as information source. If the author has a timestamp, it sets the asserted field.- Parameters:
author- The medical author of the statement.- Returns:
- this.
-
resolveAsserted
- Returns:
- The asserted date as an Instant.
-
resolveMedicalAuthor
- Specified by:
resolveMedicalAuthorin interfaceChEmedEprEntry- Returns:
- The information source as Author and the asserted timestamp as its time.
-
resolveMedicalAuthorshipTimestamp
- Specified by:
resolveMedicalAuthorshipTimestampin interfaceChEmedEprEntry- Returns:
- The asserted timestamp.
-