Class ChEmedEprMedicationRequest

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.MedicationRequest
org.projecthusky.fhir.emed.ch.epr.resource.ChEmedEprMedicationRequest
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:
ChEmedEprMedicationRequestPml, ChEmedEprMedicationRequestPre

public abstract class ChEmedEprMedicationRequest extends org.hl7.fhir.r4.model.MedicationRequest implements ChEmedEprEntry
The HAPI custom structure for CH-EMED-EPR MedicationRequest.
Author:
Ronaldo Loureiro
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.hl7.fhir.r4.model.MedicationRequest

    org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestComponent, org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent, org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent, org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntentEnumFactory, org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority, org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriorityEnumFactory, org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus, org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatusEnumFactory, org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestSubstitutionComponent
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected @Nullable ChEmedExtTreatmentPlan
     

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

    authoredOn, AUTHOREDON, basedOn, basedOnTarget, category, CATEGORY, CODE, courseOfTherapyType, DATE, detectedIssue, detectedIssueTarget, dispenseRequest, doNotPerform, dosageInstruction, encounter, ENCOUNTER, encounterTarget, eventHistory, eventHistoryTarget, groupIdentifier, identifier, IDENTIFIER, INCLUDE_ENCOUNTER, INCLUDE_INTENDED_DISPENSER, INCLUDE_INTENDED_PERFORMER, INCLUDE_MEDICATION, INCLUDE_PATIENT, INCLUDE_REQUESTER, INCLUDE_SUBJECT, instantiatesCanonical, instantiatesUri, insurance, insuranceTarget, INTENDED_DISPENSER, INTENDED_PERFORMER, INTENDED_PERFORMERTYPE, intent, INTENT, medication, MEDICATION, note, PATIENT, performer, performerTarget, performerType, priority, PRIORITY, priorPrescription, priorPrescriptionTarget, reasonCode, reasonReference, reasonReferenceTarget, recorder, recorderTarget, reported, requester, REQUESTER, requesterTarget, SP_AUTHOREDON, SP_CATEGORY, SP_CODE, SP_DATE, SP_ENCOUNTER, SP_IDENTIFIER, SP_INTENDED_DISPENSER, SP_INTENDED_PERFORMER, SP_INTENDED_PERFORMERTYPE, SP_INTENT, SP_MEDICATION, SP_PATIENT, SP_PRIORITY, SP_REQUESTER, SP_STATUS, SP_SUBJECT, status, STATUS, statusReason, subject, SUBJECT, subjectTarget, substitution, supportingInformation, supportingInformationTarget

    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
    Constructor
    Description
    Empty constructor for the parser
    Constructor that pre-populates fields.
  • Method Summary

    Modifier and Type
    Method
    Description
    Adds additional entry of the dosage instruction.
     
    org.hl7.fhir.r4.model.MedicationRequest
    addDosageInstruction(org.hl7.fhir.r4.model.Dosage t)
     
    void
    copyValues(org.hl7.fhir.r4.model.MedicationRequest dst)
     
    List<org.hl7.fhir.r4.model.Dosage>
     
     
     
    Gets the treatment plan element.
    @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 the treatment plan reference.
    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 request UUID or throws.
     
     
    Resolves the medication or throws.
    Resolves the reference to the treatment plan entry.
    Resolves the targeted patient.
     
    Resolves the medication request status 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 request UUID.
    Sets the medication reference.
    setPatient(ChCorePatientEpr chCorePatientEpr)
    Set the patient targeted.
    org.hl7.fhir.r4.model.MedicationRequest
    Sets the requester of the medication request.
    Sets the treatment plan reference.

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

    addBasedOn, addBasedOn, addCategory, addCategory, addChild, addDetectedIssue, addDetectedIssue, addDetectedIssueTarget, addEventHistory, addEventHistory, addEventHistoryTarget, addIdentifier, addIdentifier, addInstantiatesCanonical, addInstantiatesCanonicalElement, addInstantiatesUri, addInstantiatesUriElement, addInsurance, addInsurance, addNote, addNote, addReasonCode, addReasonCode, addReasonReference, addReasonReference, addSupportingInformation, addSupportingInformation, copy, equalsDeep, equalsShallow, fhirType, getAuthoredOn, getAuthoredOnElement, getBasedOn, getBasedOnFirstRep, getBasedOnTarget, getCategory, getCategoryFirstRep, getCourseOfTherapyType, getDetectedIssue, getDetectedIssueFirstRep, getDetectedIssueTarget, getDispenseRequest, getDoNotPerform, getDoNotPerformElement, getEncounter, getEncounterTarget, getEventHistory, getEventHistoryFirstRep, getEventHistoryTarget, getGroupIdentifier, getIdentifier, getIdentifierFirstRep, getInstantiatesCanonical, getInstantiatesUri, getInsurance, getInsuranceFirstRep, getInsuranceTarget, getIntent, getIntentElement, getMedication, getMedicationCodeableConcept, getMedicationReference, getNamedProperty, getNote, getNoteFirstRep, getPerformer, getPerformerTarget, getPerformerType, getPriority, getPriorityElement, getPriorPrescription, getPriorPrescriptionTarget, getProperty, getReasonCode, getReasonCodeFirstRep, getReasonReference, getReasonReferenceFirstRep, getReasonReferenceTarget, getRecorder, getRecorderTarget, getReported, getReportedBooleanType, getReportedReference, getRequester, getRequesterTarget, getResourceType, getStatus, getStatusElement, getStatusReason, getSubject, getSubjectTarget, getSubstitution, getSupportingInformation, getSupportingInformationFirstRep, getSupportingInformationTarget, getTypesForProperty, hasAuthoredOn, hasAuthoredOnElement, hasBasedOn, hasCategory, hasCourseOfTherapyType, hasDetectedIssue, hasDispenseRequest, hasDoNotPerform, hasDoNotPerformElement, hasDosageInstruction, hasEncounter, hasEventHistory, hasGroupIdentifier, hasIdentifier, hasInstantiatesCanonical, hasInstantiatesCanonical, hasInstantiatesUri, hasInstantiatesUri, hasInsurance, hasIntent, hasIntentElement, hasMedication, hasMedicationCodeableConcept, hasMedicationReference, hasNote, hasPerformer, hasPerformerType, hasPriority, hasPriorityElement, hasPriorPrescription, hasReasonCode, hasReasonReference, hasRecorder, hasReported, hasReportedBooleanType, hasReportedReference, hasRequester, hasStatus, hasStatusElement, hasStatusReason, hasSubject, hasSubstitution, hasSupportingInformation, isEmpty, listChildren, makeProperty, removeChild, setAuthoredOn, setAuthoredOnElement, setBasedOn, setCategory, setCourseOfTherapyType, setDetectedIssue, setDispenseRequest, setDoNotPerform, setDoNotPerformElement, setDosageInstruction, setEncounter, setEncounterTarget, setEventHistory, setGroupIdentifier, setIdentifier, setInstantiatesCanonical, setInstantiatesUri, setInsurance, setIntent, setIntentElement, setMedication, setNote, setPerformer, setPerformerTarget, setPerformerType, setPriority, setPriorityElement, setPriorPrescription, setPriorPrescriptionTarget, setProperty, setProperty, setReasonCode, setReasonReference, setRecorder, setRecorderTarget, setReported, setRequester, setRequesterTarget, setStatus, setStatusElement, setStatusReason, setSubject, setSubjectTarget, setSubstitution, setSupportingInformation, 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

  • Constructor Details

    • ChEmedEprMedicationRequest

      public ChEmedEprMedicationRequest()
      Empty constructor for the parser
    • ChEmedEprMedicationRequest

      public ChEmedEprMedicationRequest(UUID entryUuid)
      Constructor that pre-populates fields.
      Parameters:
      entryUuid - the medication request id.
  • Method Details

    • getEmedType

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

      @ExpectsValidResource public UUID resolveIdentifier() throws InvalidEmedContentException
      Resolves the medication request UUID or throws.
      Specified by:
      resolveIdentifier in interface ChEmedEprEntry
      Returns:
      the medication request UUID.
      Throws:
      InvalidEmedContentException - if the id is missing.
    • resolveMedication

      Resolves the medication or throws.
      Returns:
      the medication.
      Throws:
      InvalidEmedContentException - if the medication is missing or if it isn't of the right type.
    • resolvePatient

      Resolves the targeted patient.
      Returns:
      the patient.
      Throws:
      InvalidEmedContentException - if the patient is missing or isn't of the right type.
    • 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.
    • resolveMtpReference

      Resolves the reference to the treatment plan entry.
      Returns:
      the reference to the treatment plan entry.
      Throws:
      InvalidEmedContentException - if the reference 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.
    • resolveStatus

      Resolves the medication request status or throws.
      Returns:
      the medication request status PrescriptionStatus.
      Throws:
      InvalidEmedContentException - if the status is missing or not supported.
    • getTreatmentPlanElement

      public ChEmedExtTreatmentPlan getTreatmentPlanElement()
      Gets the treatment plan element. If it doesn't exist, it is created.
      Returns:
      the treatment plan element.
    • setTreatmentPlanElement

      public ChEmedEprMedicationRequest setTreatmentPlanElement(ChEmedExtTreatmentPlan treatmentPlan)
      Sets the treatment plan reference.
      Parameters:
      treatmentPlan - the treatment plan reference.
      Returns:
      this.
    • setIdentifier

      public ChEmedEprMedicationRequest setIdentifier(UUID documentUUID)
      Sets the medication request UUID.
      Parameters:
      documentUUID - The medication request UUID.
      Returns:
      this.
    • setMedicationReference

      public ChEmedEprMedicationRequest setMedicationReference(ChEmedEprMedication chEmedEprMedication)
      Sets the medication reference.
      Parameters:
      chEmedEprMedication - the medication resource.
      Returns:
      this.
    • setPatient

      public ChEmedEprMedicationRequest setPatient(ChCorePatientEpr chCorePatientEpr)
      Set the patient targeted.
      Parameters:
      chCorePatientEpr - the patient.
      Returns:
      this.
    • setDosageBaseEntry

      public ChEmedEprMedicationRequest 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.
    • addDosageAdditionalEntry

      public ChEmedEprMedicationRequest addDosageAdditionalEntry(ChEmedEprDosage dosageAdditionalEntry)
      Adds additional entry of the dosage instruction.
      Parameters:
      dosageAdditionalEntry - additional entry of the dosage instruction.
      Returns:
      this.
    • hasTreatmentPlan

      public boolean hasTreatmentPlan()
      Returns whether the treatment plan reference.
      Returns:
      true if the treatment plan reference 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.
    • getDosageInstruction

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

      public ChEmedEprDosage addDosageInstruction()
      Overrides:
      addDosageInstruction in class org.hl7.fhir.r4.model.MedicationRequest
    • addDosageInstruction

      public org.hl7.fhir.r4.model.MedicationRequest addDosageInstruction(org.hl7.fhir.r4.model.Dosage t)
      Overrides:
      addDosageInstruction in class org.hl7.fhir.r4.model.MedicationRequest
    • getDosageInstructionFirstRep

      public ChEmedEprDosage getDosageInstructionFirstRep()
      Overrides:
      getDosageInstructionFirstRep in class org.hl7.fhir.r4.model.MedicationRequest
      Returns:
      The first repetition of repeating field MedicationRequest.dosageInstruction, 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.
    • resolveSubject

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

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

      public org.hl7.fhir.r4.model.MedicationRequest setRequester(Author author)
      Sets the requester of the medication request. If the author has a timestamp, it sets it as authoredOn field.
      Parameters:
      author - The author to be set as requester.
      Returns:
      this.
    • resolveRequester

      @ExpectsValidResource public Author resolveRequester()
      Returns:
      The requester as an Author, including the authoredOn date as timestamp.
    • resolveAuthoredOn

      @ExpectsValidResource public Instant resolveAuthoredOn()
      Returns:
      Gets the authoredOn date as an Instant.
    • copyValues

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

      @ExpectsValidResource public Author resolveMedicalAuthor()
      Specified by:
      resolveMedicalAuthor in interface ChEmedEprEntry
      Returns:
      The requester as medical Author, including authoredOn as its timestamp.
    • resolveMedicalAuthorshipTimestamp

      @ExpectsValidResource public Instant resolveMedicalAuthorshipTimestamp()
      Specified by:
      resolveMedicalAuthorshipTimestamp in interface ChEmedEprEntry
      Returns:
      The authoredOn date as medical authorship timestamp.
    • hasTreatmentReason

      public boolean hasTreatmentReason()
    • getTreatmentReason

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