Class ChEmedEprObservation<S extends ChEmedEprMedicationStatementChanged,R extends ChEmedEprMedicationRequestChanged>
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.Observation
org.projecthusky.fhir.emed.ch.epr.resource.ChEmedEprObservation<S,R>
- Type Parameters:
S- The type ofChEmedEprMedicationStatementChangedto be returned by resolveMedicationStatementChanged(). This is needed for documents that might contain several subtypes of MedicationStatement, e.g. a PML doc. since the parser cannot discriminate between them and hence these resources might be parsed as a different ChEmedEprMedicationStatement than the PADV attachedChEmedEprMedicationStatementChanged.R- The type ofChEmedEprMedicationRequestChangedto be returned by resolveMedicationRequestChanged(). This is needed for documents that might contain several subtypes of MedicationRequest, e.g. a PML doc. since the parser cannot discriminate between them and hence these resources might be parsed as a different ChEmedEprMedicationRequest than the PADV attachedChEmedEprMedicationRequestChanged.
- 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:
ChEmedEprObservationPadv,ChEmedEprObservationPml
public abstract class ChEmedEprObservation<S extends ChEmedEprMedicationStatementChanged,R extends ChEmedEprMedicationRequestChanged>
extends org.hl7.fhir.r4.model.Observation
implements ChEmedEprEntry
The HAPI custom structure for CH-EMED-EPR Observation.
- Author:
- Ronaldo Loureiro
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.hl7.fhir.r4.model.Observation
org.hl7.fhir.r4.model.Observation.ObservationComponentComponent, org.hl7.fhir.r4.model.Observation.ObservationReferenceRangeComponent, org.hl7.fhir.r4.model.Observation.ObservationStatus, org.hl7.fhir.r4.model.Observation.ObservationStatusEnumFactory -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected @Nullable ChEmedExtDispenseReference to the medication dispense.protected @Nullable org.hl7.fhir.r4.model.ReferenceReference to the changed medication request.protected @Nullable org.hl7.fhir.r4.model.ReferenceReference to the changed medication statement.protected @Nullable ChEmedExtPrescriptionReference to the medication prescription.protected @Nullable ChEmedExtTreatmentPlanReference to the medication treatment plan.Fields inherited from class org.hl7.fhir.r4.model.Observation
BASED_ON, basedOn, basedOnTarget, bodySite, category, CATEGORY, code, CODE, CODE_VALUE_CONCEPT, CODE_VALUE_DATE, CODE_VALUE_QUANTITY, CODE_VALUE_STRING, COMBO_CODE, COMBO_CODE_VALUE_CONCEPT, COMBO_CODE_VALUE_QUANTITY, COMBO_DATA_ABSENT_REASON, COMBO_VALUE_CONCEPT, COMBO_VALUE_QUANTITY, component, COMPONENT_CODE, COMPONENT_CODE_VALUE_CONCEPT, COMPONENT_CODE_VALUE_QUANTITY, COMPONENT_DATA_ABSENT_REASON, COMPONENT_VALUE_CONCEPT, COMPONENT_VALUE_QUANTITY, DATA_ABSENT_REASON, dataAbsentReason, DATE, DERIVED_FROM, derivedFrom, derivedFromTarget, device, DEVICE, deviceTarget, effective, encounter, ENCOUNTER, encounterTarget, focus, FOCUS, focusTarget, HAS_MEMBER, hasMember, hasMemberTarget, identifier, IDENTIFIER, INCLUDE_BASED_ON, INCLUDE_DERIVED_FROM, INCLUDE_DEVICE, INCLUDE_ENCOUNTER, INCLUDE_FOCUS, INCLUDE_HAS_MEMBER, INCLUDE_PART_OF, INCLUDE_PATIENT, INCLUDE_PERFORMER, INCLUDE_SPECIMEN, INCLUDE_SUBJECT, interpretation, issued, method, METHOD, note, PART_OF, partOf, partOfTarget, PATIENT, performer, PERFORMER, performerTarget, referenceRange, SP_BASED_ON, SP_CATEGORY, SP_CODE, SP_CODE_VALUE_CONCEPT, SP_CODE_VALUE_DATE, SP_CODE_VALUE_QUANTITY, SP_CODE_VALUE_STRING, SP_COMBO_CODE, SP_COMBO_CODE_VALUE_CONCEPT, SP_COMBO_CODE_VALUE_QUANTITY, SP_COMBO_DATA_ABSENT_REASON, SP_COMBO_VALUE_CONCEPT, SP_COMBO_VALUE_QUANTITY, SP_COMPONENT_CODE, SP_COMPONENT_CODE_VALUE_CONCEPT, SP_COMPONENT_CODE_VALUE_QUANTITY, SP_COMPONENT_DATA_ABSENT_REASON, SP_COMPONENT_VALUE_CONCEPT, SP_COMPONENT_VALUE_QUANTITY, SP_DATA_ABSENT_REASON, SP_DATE, SP_DERIVED_FROM, SP_DEVICE, SP_ENCOUNTER, SP_FOCUS, SP_HAS_MEMBER, SP_IDENTIFIER, SP_METHOD, SP_PART_OF, SP_PATIENT, SP_PERFORMER, SP_SPECIMEN, SP_STATUS, SP_SUBJECT, SP_VALUE_CONCEPT, SP_VALUE_DATE, SP_VALUE_QUANTITY, SP_VALUE_STRING, specimen, SPECIMEN, specimenTarget, status, STATUS, subject, SUBJECT, subjectTarget, value, VALUE_CONCEPT, VALUE_DATE, VALUE_QUANTITY, VALUE_STRINGFields 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
ConstructorsConstructorDescriptionEmpty constructor for the parser.ChEmedEprObservation(UUID entryUuid, EmedPadvEntryType padvType) Constructor that pre-populates fields.ChEmedEprObservation(UUID entryUuid, EmedPadvEntryType padvType, LanguageCode languageCode) Constructor that pre-populates fields. -
Method Summary
Modifier and TypeMethodDescriptionvoidcopyValues(org.hl7.fhir.r4.model.Observation dst) Gets the medication dispense element.org.hl7.fhir.r4.model.ReferenceGets the reference to the changed medication request.org.hl7.fhir.r4.model.ReferenceGets the reference to the changed medication statement.Gets the prescription element.Gets the treatment plan element.booleanReturns whether the medication dispense reference.booleanReturns whether the changed medication request reference.booleanReturns whether the changed medication statement reference.booleanReturns whether the padv entry type.booleanReturns whether the prescription reference.booleanReturns whether the treatment plan reference.@Nullable EmedReferenceResolves the reference to the dispense entry (if any).Resolves the observation UUID or throws.Resolves the date/time this version was made available.@Nullable RResolves the changed medication request.@Nullable SResolves the changed medication statement.@Nullable EmedReferenceResolves the reference to the treatment plan entry (if any).Resolves the note.Resolves the PADV entry type.@Nullable EmedReferenceResolves the reference to the prescription entry (if any).Resolves the reference to the entry.Resolves the subject as aChCorePatientEpr.setDispenseElement(ChEmedExtDispense dispense) Sets the medication dispense reference.Sets the date/time this version was made available.setMedicationRequestChanged(ChEmedEprMedicationRequestChanged medicationRequest) Sets the changed medication request.setMedicationStatementChanged(ChEmedEprMedicationStatementChanged medicationStatement) Sets the changed medication statement.Sets the note.setPadvEntryType(EmedPadvEntryType padvEntryType) Sets the PADV entry type, with an English display name.setPadvEntryType(EmedPadvEntryType padvEntryType, LanguageCode languageCode) Sets the PADV entry type, with a display name in the requested language.setPrescriptionElement(ChEmedExtPrescription prescription) Sets the prescription reference.setTreatmentPlanElement(ChEmedExtTreatmentPlan treatmentPlan) Sets the treatment plan reference.Methods inherited from class org.hl7.fhir.r4.model.Observation
addBasedOn, addBasedOn, addCategory, addCategory, addChild, addComponent, addComponent, addDerivedFrom, addDerivedFrom, addFocus, addFocus, addHasMember, addHasMember, addIdentifier, addIdentifier, addInterpretation, addInterpretation, addNote, addNote, addPartOf, addPartOf, addPerformer, addPerformer, addReferenceRange, addReferenceRange, copy, equalsDeep, equalsShallow, fhirType, getBasedOn, getBasedOnFirstRep, getBasedOnTarget, getBodySite, getCategory, getCategoryFirstRep, getCode, getComponent, getComponentFirstRep, getDataAbsentReason, getDerivedFrom, getDerivedFromFirstRep, getDerivedFromTarget, getDevice, getDeviceTarget, getEffective, getEffectiveDateTimeType, getEffectiveInstantType, getEffectivePeriod, getEffectiveTiming, getEncounter, getEncounterTarget, getFocus, getFocusFirstRep, getFocusTarget, getHasMember, getHasMemberFirstRep, getHasMemberTarget, getIdentifier, getIdentifierFirstRep, getInterpretation, getInterpretationFirstRep, getIssued, getIssuedElement, getMethod, getNamedProperty, getNote, getNoteFirstRep, getPartOf, getPartOfFirstRep, getPartOfTarget, getPerformer, getPerformerFirstRep, getPerformerTarget, getProperty, getReferenceRange, getReferenceRangeFirstRep, getResourceType, getSpecimen, getSpecimenTarget, getStatus, getStatusElement, getSubject, getSubjectTarget, getTypesForProperty, getValue, getValueBooleanType, getValueCodeableConcept, getValueDateTimeType, getValueIntegerType, getValuePeriod, getValueQuantity, getValueRange, getValueRatio, getValueSampledData, getValueStringType, getValueTimeType, hasBasedOn, hasBodySite, hasCategory, hasCode, hasComponent, hasDataAbsentReason, hasDerivedFrom, hasDevice, hasEffective, hasEffectiveDateTimeType, hasEffectiveInstantType, hasEffectivePeriod, hasEffectiveTiming, hasEncounter, hasFocus, hasHasMember, hasIdentifier, hasInterpretation, hasIssued, hasIssuedElement, hasMethod, hasNote, hasPartOf, hasPerformer, hasReferenceRange, hasSpecimen, hasStatus, hasStatusElement, hasSubject, hasValue, hasValueBooleanType, hasValueCodeableConcept, hasValueDateTimeType, hasValueIntegerType, hasValuePeriod, hasValueQuantity, hasValueRange, hasValueRatio, hasValueSampledData, hasValueStringType, hasValueTimeType, isEmpty, listChildren, makeProperty, removeChild, setBasedOn, setBodySite, setCategory, setCode, setComponent, setDataAbsentReason, setDerivedFrom, setDevice, setDeviceTarget, setEffective, setEncounter, setEncounterTarget, setFocus, setHasMember, setIdentifier, setInterpretation, setIssued, setIssuedElement, setMethod, setNote, setPartOf, setPerformer, setProperty, setProperty, setReferenceRange, setSpecimen, setSpecimenTarget, setStatus, setStatusElement, setSubject, setSubjectTarget, setValue, 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
-
treatmentPlan
Reference to the medication treatment plan. -
prescription
Reference to the medication prescription. -
dispense
Reference to the medication dispense. -
medicationStatementChanged
protected @Nullable org.hl7.fhir.r4.model.Reference medicationStatementChangedReference to the changed medication statement. -
medicationRequestChanged
protected @Nullable org.hl7.fhir.r4.model.Reference medicationRequestChangedReference to the changed medication request.
-
-
Constructor Details
-
ChEmedEprObservation
public ChEmedEprObservation()Empty constructor for the parser. -
ChEmedEprObservation
Constructor that pre-populates fields. The advice type dispay name is in English.- Parameters:
entryUuid- The medication statement id.padvType- The pharmaceutical advice type.
-
ChEmedEprObservation
Constructor that pre-populates fields. The advice type display name is in the requested language.- Parameters:
entryUuid- The medication statement id.padvType- The pharmaceutical advice type.languageCode- The requested language for the display name.
-
-
Method Details
-
getEmedType
- Specified by:
getEmedTypein interfaceChEmedEprEntry
-
resolveIdentifier
Resolves the observation UUID or throws.- Specified by:
resolveIdentifierin interfaceChEmedEprEntry- Returns:
- the observation UUID.
- Throws:
InvalidEmedContentException- if the id is missing.
-
resolveMedicationStatementChanged
@ExpectsValidResource public @Nullable S resolveMedicationStatementChanged() throws InvalidEmedContentExceptionResolves the changed medication statement.- Returns:
- the changed medication statement or
null. - Throws:
InvalidEmedContentException- if the changed medication statement isn't of the right type.
-
getMedicationStatementChangedType
- Returns:
- The class (type) of medication statement resource that is to be returned by resolveMedicationStatementChanged().
-
resolveMedicationRequestChanged
@ExpectsValidResource public @Nullable R resolveMedicationRequestChanged() throws InvalidEmedContentExceptionResolves the changed medication request.- Returns:
- the changed medication request or
null. - Throws:
InvalidEmedContentException- if the changed medication request isn't of the right type.
-
getMedicationRequestChangedType
- Returns:
- The class (type) of medication statement resource that is to be returned by resolveMedicationRequestChanged().
-
resolvePadvEntryType
@ExpectsValidResource public EmedPadvEntryType resolvePadvEntryType() throws InvalidEmedContentExceptionResolves the PADV entry type.- Returns:
- the PADV entry type.
- Throws:
InvalidEmedContentException- if the PADV entry type is missing or invalid.
-
resolveIssued
Resolves the date/time this version was made available.- Returns:
- the date/time this version was made available.
- Throws:
InvalidEmedContentException- if the date/time this version was made available is missing.
-
resolveNote
Resolves the note.- Returns:
- the note.
- Throws:
InvalidEmedContentException- if the note is missing.
-
resolveMtpReference
@ExpectsValidResource public @Nullable EmedReference resolveMtpReference() throws InvalidEmedContentExceptionResolves the reference to the treatment plan entry (if any).- Returns:
- the reference to the treatment plan entry or
null. - Throws:
InvalidEmedContentException- if one of the IDs is missing.
-
resolvePreReference
@ExpectsValidResource public @Nullable EmedReference resolvePreReference() throws InvalidEmedContentExceptionResolves the reference to the prescription entry (if any).- Returns:
- the reference to the prescription entry or
null. - Throws:
InvalidEmedContentException- if one of the IDs is missing.
-
resolveDisReference
@ExpectsValidResource public @Nullable EmedReference resolveDisReference() throws InvalidEmedContentExceptionResolves the reference to the dispense entry (if any).- Returns:
- the reference to the dispense entry or
null. - Throws:
InvalidEmedContentException- if one of the IDs is missing.
-
resolveReference
Resolves the reference to the entry.- Returns:
- the reference to the entry.
- Throws:
InvalidEmedContentException- if there's not a single reference.
-
getTreatmentPlanElement
Gets the treatment plan element. If it doesn't exist, it is created.- Returns:
- the treatment plan element.
-
getPrescriptionElement
Gets the prescription element. If it doesn't exist, it is created.- Returns:
- the prescription element.
-
getDispenseElement
Gets the medication dispense element. If it doesn't exist, it is created.- Returns:
- the medication dispense element.
-
getMedicationStatementChangedReference
public org.hl7.fhir.r4.model.Reference getMedicationStatementChangedReference()Gets the reference to the changed medication statement. If it doesn't exist, it is created.- Returns:
- the reference to the changed medication statement.
-
getMedicationRequestChangedReference
public org.hl7.fhir.r4.model.Reference getMedicationRequestChangedReference()Gets the reference to the changed medication request. If it doesn't exist, it is created.- Returns:
- the reference to the changed medication request.
-
setTreatmentPlanElement
Sets the treatment plan reference.- Parameters:
treatmentPlan- the treatment plan reference.- Returns:
- this.
-
setPrescriptionElement
Sets the prescription reference.- Parameters:
prescription- the prescription reference.- Returns:
- this.
-
setDispenseElement
Sets the medication dispense reference.- Parameters:
dispense- the medication dispense reference.- Returns:
- this.
-
setMedicationStatementChanged
public ChEmedEprObservation<S,R> setMedicationStatementChanged(ChEmedEprMedicationStatementChanged medicationStatement) Sets the changed medication statement.- Parameters:
medicationStatement- the changed medication statement.- Returns:
- this.
-
setMedicationRequestChanged
public ChEmedEprObservation<S,R> setMedicationRequestChanged(ChEmedEprMedicationRequestChanged medicationRequest) Sets the changed medication request.- Parameters:
medicationRequest- the changed medication request.- Returns:
- this.
-
setPadvEntryType
Sets the PADV entry type, with an English display name.- Parameters:
padvEntryType- the PADV entry type.- Returns:
- this.
-
setPadvEntryType
public ChEmedEprObservation<S,R> setPadvEntryType(EmedPadvEntryType padvEntryType, LanguageCode languageCode) Sets the PADV entry type, with a display name in the requested language.- Parameters:
padvEntryType- the PADV entry type.languageCode- the requested language for the display name.- Returns:
- this.
-
setIssued
Sets the date/time this version was made available.- Parameters:
issued- the date/time this version was made available.- Returns:
- this.
-
setNote
Sets the note. If it already exists, it is replaced.- Parameters:
note- the note.- Returns:
- this.
-
hasTreatmentPlan
public boolean hasTreatmentPlan()Returns whether the treatment plan reference.- Returns:
trueif the treatment plan reference exists,falseotherwise.
-
hasPrescription
public boolean hasPrescription()Returns whether the prescription reference.- Returns:
trueif the prescription reference exists,falseotherwise.
-
hasDispense
public boolean hasDispense()Returns whether the medication dispense reference.- Returns:
trueif the medication dispense reference exists,falseotherwise.
-
hasMedicationStatementChanged
public boolean hasMedicationStatementChanged()Returns whether the changed medication statement reference.- Returns:
trueif the changed medication statement reference exists,falseotherwise.
-
hasMedicationRequestChanged
public boolean hasMedicationRequestChanged()Returns whether the changed medication request reference.- Returns:
trueif the changed medication request reference exists,falseotherwise.
-
hasPadvEntryType
public boolean hasPadvEntryType()Returns whether the padv entry type.- Returns:
trueif the padv entry type exists,falseotherwise.
-
resolveSubject
Resolves the subject as aChCorePatientEpr.- Returns:
- the subject.
-
copyValues
public void copyValues(org.hl7.fhir.r4.model.Observation dst) - Overrides:
copyValuesin classorg.hl7.fhir.r4.model.Observation
-
resolveMedicalAuthor
- Specified by:
resolveMedicalAuthorin interfaceChEmedEprEntry- Returns:
- The first performer of type ChEmedEprPractitionerRole, ChCorePatientEpr or ChEmedEprRelatedPerson as an Author with the time set to the medical authorship timestamp, i.e. when issued.
-
resolveMedicalAuthorshipTimestamp
- Specified by:
resolveMedicalAuthorshipTimestampin interfaceChEmedEprEntry- Returns:
- The time of medical authorship, i.e. when issued.
-