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

    Fields
    Modifier and Type
    Field
    Description
    protected @Nullable org.hl7.fhir.r4.model.CodeableConcept
    Whether 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, subjectTarget

    Fields inherited from class org.hl7.fhir.r4.model.DomainResource

    contained, extension, modifierExtension, text

    Fields inherited from class org.hl7.fhir.r4.model.Resource

    id, implicitRules, language, meta

    Fields inherited from interface org.hl7.fhir.instance.model.api.IAnyResource

    RES_ID, SP_RES_ID

    Fields inherited from interface org.hl7.fhir.instance.model.api.IBaseResource

    INCLUDE_ALL, WILDCARD_ALL_SET
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Empty constructor for the parser.
    protected
    Constructor that pre-populates fields.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    org.hl7.fhir.r4.model.MedicationStatement
    addDosage(org.hl7.fhir.r4.model.Dosage t)
     
    Adds additional entry of the dosage instruction.
    void
    copyValues(org.hl7.fhir.r4.model.MedicationStatement dst)
     
    List<org.hl7.fhir.r4.model.Dosage>
     
     
     
    org.hl7.fhir.r4.model.CodeableConcept
    Gets the substitution element in the medication statement.
    @Nullable String
    Gets the treatment reason if available.
    boolean
    Returns whether additional entry of the dosage instruction.
    boolean
    Returns whether the base entry of the dosage instruction.
    boolean
    Returns whether substitution code exists.
    boolean
     
    Resolves 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 a ChCorePatientEpr.
    Gets the substitution code in the medication statement.
    Sets the base entry of the dosage instruction.
    setIdentifier(UUID documentUUID)
    Sets the medication statement UUID.
    Sets the information source (medical author) of the statement.
    Sets the substitution code in the medication statement.
    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, typedCopy

    Methods 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, setText

    Methods 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, setMeta

    Methods inherited from class org.hl7.fhir.r4.model.BaseResource

    getStructureFhirVersionEnum, isResource, setId

    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, 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.IAnyResource

    getId, getIdElement, getLanguageElement, getUserData, setId, setUserData

    Methods inherited from interface org.hl7.fhir.instance.model.api.IBase

    fhirType, getFormatCommentsPost, getFormatCommentsPre, hasFormatComment, isEmpty

    Methods 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 substitution
      Whether 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

      protected ChEmedEprMedicationStatement(UUID entryUuid)
      Constructor that pre-populates fields.
      Parameters:
      entryUuid - the medication statement id.
  • Method Details

    • getEmedType

      public EmedEntryType getEmedType()
      Specified by:
      getEmedType in interface ChEmedEprEntry
    • getSubstitution

      public org.hl7.fhir.r4.model.CodeableConcept getSubstitution()
      Gets the substitution element in the medication statement.
      Returns:
      the substitution element.
    • resolveSubstitution

      Gets the substitution code in the medication statement.
      Returns:
      the substitution code.
      Throws:
      InvalidEmedContentException - if the substitution code is invalid.
    • resolveMedication

      Returns the medication or throws.
      Returns:
      the medication.
      Throws:
      InvalidEmedContentException - if the medication is missing or invalid.
    • resolveIdentifier

      @ExpectsValidResource public UUID resolveIdentifier() throws InvalidEmedContentException
      Resolves the medication statement UUID or throws.
      Specified by:
      resolveIdentifier in interface ChEmedEprEntry
      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

      public List<ChEmedEprDosage> 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

      public @Nullable String getTreatmentReason()
      Gets the treatment reason if available.
      Returns:
      the treatment reason or null.
    • setTreatmentReason

      public ChEmedEprMedicationStatement setTreatmentReason(String treatmentReason)
      Sets the treatment reason. If the treatment reason already exists, it's replaced.
      Parameters:
      treatmentReason - the treatment reason
      Returns:
      this.
    • setIdentifier

      public ChEmedEprMedicationStatement setIdentifier(UUID documentUUID)
      Sets the medication statement UUID.
      Parameters:
      documentUUID - The medication statement UUID.
      Returns:
      this.
    • setDosageBaseEntry

      public ChEmedEprMedicationStatement setDosageBaseEntry(ChEmedEprDosage dosageBaseEntry)
      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.
      Parameters:
      value - the substitution code.
      Returns:
      this.
    • addDosageAdditionalEntry

      public ChEmedEprMedicationStatement addDosageAdditionalEntry(ChEmedEprDosage dosageAdditionalEntry)
      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:
      true if the substitution code exists, false otherwise.
    • hasDosageBaseEntry

      public boolean hasDosageBaseEntry()
      Returns whether the base entry of the dosage instruction.
      Returns:
      true if the base entry of the dosage instruction exists, false otherwise.
    • hasDosageAdditionalEntry

      public boolean hasDosageAdditionalEntry()
      Returns whether additional entry of the dosage instruction.
      Returns:
      true if additional entry of the dosage instruction exists, false otherwise.
    • getDosage

      public List<org.hl7.fhir.r4.model.Dosage> getDosage()
      Overrides:
      getDosage in class org.hl7.fhir.r4.model.MedicationStatement
      Returns:
      MedicationStatement.dosage (Indicates how the medication is/was or should be taken by the patient.)
    • addDosage

      public ChEmedEprDosage addDosage()
      Overrides:
      addDosage in class org.hl7.fhir.r4.model.MedicationStatement
    • addDosage

      public org.hl7.fhir.r4.model.MedicationStatement addDosage(org.hl7.fhir.r4.model.Dosage t)
      Overrides:
      addDosage in class org.hl7.fhir.r4.model.MedicationStatement
    • getDosageFirstRep

      public ChEmedEprDosage getDosageFirstRep()
      Overrides:
      getDosageFirstRep in class org.hl7.fhir.r4.model.MedicationStatement
      Returns:
      The first repetition of repeating field MedicationStatement.dosage, creating it if it does not already exist
    • resolveEffectiveDosageInstructions

      @ExpectsValidResource public EffectiveDosageInstructions resolveEffectiveDosageInstructions()
      Converts the main and additional dosages into a read-only model, containing the effective dosage instructions.
    • resolveInformationSource

      @ExpectsValidResource public Author resolveInformationSource()
      Resolves the information source.
      Returns:
      the information source or null.
    • resolveSubject

      @ExpectsValidResource public ChCorePatientEpr resolveSubject()
      Resolves the subject as a ChCorePatientEpr.
      Returns:
      the subject.
    • copyValues

      public void copyValues(org.hl7.fhir.r4.model.MedicationStatement dst)
      Overrides:
      copyValues in class org.hl7.fhir.r4.model.MedicationStatement
    • setInformationSource

      public ChEmedEprMedicationStatement setInformationSource(Author author)
      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

      @ExpectsValidResource public Instant resolveAsserted()
      Returns:
      The asserted date as an Instant.
    • resolveMedicalAuthor

      @ExpectsValidResource public Author resolveMedicalAuthor()
      Specified by:
      resolveMedicalAuthor in interface ChEmedEprEntry
      Returns:
      The information source as Author and the asserted timestamp as its time.
    • resolveMedicalAuthorshipTimestamp

      @ExpectsValidResource public Instant resolveMedicalAuthorshipTimestamp()
      Specified by:
      resolveMedicalAuthorshipTimestamp in interface ChEmedEprEntry
      Returns:
      The asserted timestamp.