Class ChEmedEprMedication

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.Medication
org.projecthusky.fhir.emed.ch.epr.resource.ChEmedEprMedication
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
Direct Known Subclasses:
ChEmedEprMedicationDis

public class ChEmedEprMedication extends org.hl7.fhir.r4.model.Medication
The HAPI custom structure for CH-EMED-EPR Medication.

Because of the parser limitations, this class can't be extended into DIS and PML flavours. All methods and extensions are included here, be careful and read the JavaDoc when using these new methods.

Author:
Quentin Ligier
See Also:
  • Nested Class Summary

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

    org.hl7.fhir.r4.model.Medication.MedicationBatchComponent, org.hl7.fhir.r4.model.Medication.MedicationIngredientComponent, org.hl7.fhir.r4.model.Medication.MedicationStatus, org.hl7.fhir.r4.model.Medication.MedicationStatusEnumFactory
  • Field Summary

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

    amount, batch, code, CODE, EXPIRATION_DATE, form, FORM, identifier, IDENTIFIER, INCLUDE_INGREDIENT, INCLUDE_MANUFACTURER, ingredient, INGREDIENT, INGREDIENT_CODE, LOT_NUMBER, manufacturer, MANUFACTURER, manufacturerTarget, SP_CODE, SP_EXPIRATION_DATE, SP_FORM, SP_IDENTIFIER, SP_INGREDIENT, SP_INGREDIENT_CODE, SP_LOT_NUMBER, SP_MANUFACTURER, SP_STATUS, status, STATUS

    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.
  • Method Summary

    Modifier and Type
    Method
    Description
    Adds active ingredient.
     
    boolean
    Returns whether ATC code exists.
    boolean
    Returns whether the medication coding contains a code for the specified system.
    boolean
    Returns whether GTIN code exists.
    Resolves the active ingredients
    @Nullable String
     
    @Nullable String
     
    Returns the pharmaceutical dose form or throws.
    @Nullable String
     
    Returns the medication name or throws.
    setAtc(String atc, String displayName)
    Sets the ATC.
    Sets pharmaceutical dose form.
    setGtin(String gtin, String displayName)
    Sets the GTIN.

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

    addChild, addIdentifier, addIdentifier, addIngredient, addIngredient, copyValues, equalsDeep, equalsShallow, fhirType, getAmount, getBatch, getCode, getForm, getIdentifier, getIdentifierFirstRep, getIngredient, getIngredientFirstRep, getManufacturer, getManufacturerTarget, getNamedProperty, getProperty, getResourceType, getStatus, getStatusElement, getTypesForProperty, hasAmount, hasBatch, hasCode, hasForm, hasIdentifier, hasIngredient, hasManufacturer, hasStatus, hasStatusElement, isEmpty, listChildren, makeProperty, removeChild, setAmount, setBatch, setCode, setForm, setIdentifier, setIngredient, setManufacturer, setManufacturerTarget, setProperty, setProperty, setStatus, setStatusElement, 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

    getFormatCommentsPost, getFormatCommentsPre, hasFormatComment

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

    getMeta, getStructureFhirVersionEnum, isDeleted, setId
  • Constructor Details

    • ChEmedEprMedication

      public ChEmedEprMedication()
      Empty constructor for the parser.
  • Method Details

    • resolveGtinCode

      @ExpectsValidResource public @Nullable String resolveGtinCode()
      Returns:
      The gtin code or null.
    • resolveAtcCode

      @ExpectsValidResource public @Nullable String resolveAtcCode()
      Returns:
      The atc code or null.
    • resolveCodeForSystem

      @ExpectsValidResource public @Nullable String resolveCodeForSystem(String system)
      Parameters:
      system - The system for which to resolve the code.
      Returns:
      The code for the specified system or null if no code for that system is present.
    • resolveMedicationName

      @ExpectsValidResource public String resolveMedicationName() throws InvalidEmedContentException
      Returns the medication name or throws.
      Returns:
      The medication name.
      Throws:
      InvalidEmedContentException - if the medication name is missing.
    • setGtin

      public ChEmedEprMedication setGtin(String gtin, String displayName)
      Sets the GTIN. If a code already exists, it's replaced.
      Parameters:
      gtin - The GTIN code.
      displayName - The name associate with GTIN.
      Returns:
      this.
    • setAtc

      public ChEmedEprMedication setAtc(String atc, String displayName)
      Sets the ATC. If a code already exists, it's replaced.
      Parameters:
      atc - The ATC code.
      displayName - The name associate with ATC.
      Returns:
      this.
    • hasGtin

      public boolean hasGtin()
      Returns whether GTIN code exists.
      Returns:
      true if the GTIN code exists, false otherwise.
    • hasAtc

      public boolean hasAtc()
      Returns whether ATC code exists.
      Returns:
      true if the ATC code exists, false otherwise.
    • hasCodeForSystem

      public boolean hasCodeForSystem(String system)
      Returns whether the medication coding contains a code for the specified system.
      Parameters:
      system - The system for which to check if a code exists.
      Returns:
      true if the ATC code exists, false otherwise.
    • resolveForm

      Returns the pharmaceutical dose form or throws.
      Returns:
      the pharmaceutical dose form.
      Throws:
      InvalidEmedContentException - if the pharmaceutical dose form is missing.
    • resolveActiveIngredients

      @ExpectsValidResource public List<ChEmedEprMedicationIngredient> resolveActiveIngredients()
      Resolves the active ingredients
      Returns:
      the lits with active ingredients
    • setForm

      Sets pharmaceutical dose form. If the pharmaceutical dose form already exists, it's replaced.
      Parameters:
      doseForm - the pharmaceutical dose form.
      Returns:
      this.
    • addActiveIngredient

      public ChEmedEprMedication addActiveIngredient(ChEmedEprMedicationIngredient ingredient)
      Adds active ingredient.
      Parameters:
      ingredient - active ingredient.
      Returns:
      this.
    • copy

      public ChEmedEprMedication copy()
      Overrides:
      copy in class org.hl7.fhir.r4.model.Medication