Class EPrescription
java.lang.Object
org.projecthusky.fhir.emed.ch.epr.model.emediplan.EMediplan<ChMed16AExtension,ChMed16AGender,EPrescriptionMedicament,ChMed16APatientId>
org.projecthusky.fhir.emed.ch.epr.model.emediplan.chmed16a.ChMed16AEMediplan<EPrescriptionMedicament>
org.projecthusky.fhir.emed.ch.epr.model.emediplan.chmed16a.EPrescription
- All Implemented Interfaces:
ChMed16AExtendable,EMediplanExtendable<ChMed16AExtension>,EMediplanHealthcareProCarrier<ChMed16AHealthcarePerson,,ChMed16AHealthcareOrganization> EMediplanObject
public class EPrescription
extends ChMed16AEMediplan<EPrescriptionMedicament>
implements EMediplanHealthcareProCarrier<ChMed16AHealthcarePerson,ChMed16AHealthcareOrganization>
Model according to the specifications of
eMediplan in the context of ePrescription. This extends the base
ChMed16AEMediplan model.
This class is intended for ePrescription following at least revision 2 of the CHMED16A Prescription specs. For
revision 1, just use ChMed16AEMediplan instead.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected ChMed16AHealthcareOrganizationThe healthcare organization in which the HealthcarePerson works.protected ChMed16AHealthcarePersonThe healthcare person (the author of the document).static final intprotected static final intprotected @Nullable IntegerThe revision number of the specification.protected static final Stringprotected static final intFields inherited from class org.projecthusky.fhir.emed.ch.epr.model.emediplan.chmed16a.ChMed16AEMediplan
author, AUTHOR_FIELD_NAME, EMEDIPLAN_TYPE_FIELD_NAME, EMEDIPLAN_VERSION, extensions, EXTENSIONS_SCHEMA_FIELD_NAME, extensionsSchema, id, ID_FIELD_NAME, medicaments, MEDICAMENTS_FIELD_NAME, patient, PATIENT_FIELD_NAME, recommendations, RECOMMENDATIONS_FIELD_NAME, remark, REMARKS_FIELD_NAME, timestamp, TIMESTAMP_FIELD_NAME, type, VALIDATION_TIMESTAMP_FIELD_NAME, validationTimestamp, validator, VALIDATOR_FIELD_NAME, zsr, ZSR_FIELD_NAMEFields inherited from class org.projecthusky.fhir.emed.ch.epr.model.emediplan.EMediplan
EMEDIPLAN_TIMEZONE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic EPrescriptionfromChTransmissionFormat(String chTransmission) Parses an ePrescription from a ChTransmissionFormat String, as specified by eMediplan.booleanhasExtensions(boolean inDepth) Whether the eMediplan object has any extension or not.booleanIn ePrescription, the author is always a professional.voidtrim()Trims the eMediplan object, that is, removes any redundant info and sets to null values that match the default assumed value by the specs, to shorten the serialized result.Validates the eMediplan object, without any further context than its JSON path and its own content, against the eMediplan specs.protected voidvalidateRev3Constraints(@Nullable String basePath, ValidationResult result) This method validates specific constraints added with rev3 of the eMediplan ePrescription exchange format.Methods inherited from class org.projecthusky.fhir.emed.ch.epr.model.emediplan.chmed16a.ChMed16AEMediplan
getChTransmissionFormatPrefix, getEmediplanVersion, getExtensions, getMedicaments, resolveTypeMethods inherited from class org.projecthusky.fhir.emed.ch.epr.model.emediplan.EMediplan
addMedicament, compressJson, getId, getPatient, getRemark, getTimestamp, getType, toChTransmissionFormat, uncompressJsonMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.projecthusky.fhir.emed.ch.epr.model.emediplan.chmed16a.ChMed16AExtendable
findExtension, getExtensionsFieldNameMethods inherited from interface org.projecthusky.fhir.emed.ch.epr.model.emediplan.EMediplanExtendable
addExtension, validateExtensionsMethods inherited from interface org.projecthusky.fhir.emed.ch.epr.model.emediplan.EMediplanHealthcareProCarrier
getHealthcareOrganization, getHealthcarePerson, validateHealtcareProInfoMethods inherited from interface org.projecthusky.fhir.emed.ch.epr.model.emediplan.EMediplanObject
getFieldValidationPath, getFieldValidationPath, getIgnoredFieldValidationIssue, getRequiredFieldValidationIssue, getValidationIssue, validate
-
Field Details
-
REVISION_FIELD_NAME
- See Also:
-
HEALTHCARE_PERSON_FIELD_NAME
- See Also:
-
HEALTHCARE_ORGANIZATION_FIELD_NAME
- See Also:
-
POSTAL_CODE_REV3_MAX_LENGTH
protected static final int POSTAL_CODE_REV3_MAX_LENGTH- See Also:
-
ZSR_REV3_MAX_LENGTH
protected static final int ZSR_REV3_MAX_LENGTH- See Also:
-
LAST_SUPPORTED_REVISION
public static final int LAST_SUPPORTED_REVISION- See Also:
-
revision
The revision number of the specification. If no revision number is specified, it is assumed it uses revision 1 (the eMediplan base spec).- Since:
- CHMED16A Prescription rev 2.
-
healthcarePerson
The healthcare person (the author of the document).- Since:
- CHMED16A Prescription rev 2.
-
healthcareOrganization
The healthcare organization in which the HealthcarePerson works.- Since:
- CHMED16A Prescription rev 2.
-
-
Constructor Details
-
EPrescription
public EPrescription()
-
-
Method Details
-
getHealthcarePersonFieldName
- Specified by:
getHealthcarePersonFieldNamein interfaceEMediplanHealthcareProCarrier<ChMed16AHealthcarePerson,ChMed16AHealthcareOrganization>
-
getHealthcareOrganizationFieldName
- Specified by:
getHealthcareOrganizationFieldNamein interfaceEMediplanHealthcareProCarrier<ChMed16AHealthcarePerson,ChMed16AHealthcareOrganization>
-
isAuthorProfessional
public boolean isAuthorProfessional()In ePrescription, the author is always a professional.- Specified by:
isAuthorProfessionalin interfaceEMediplanHealthcareProCarrier<ChMed16AHealthcarePerson,ChMed16AHealthcareOrganization> - Returns:
true.
-
validate
Description copied from interface:EMediplanObjectValidates the eMediplan object, without any further context than its JSON path and its own content, against the eMediplan specs.- Specified by:
validatein interfaceEMediplanObject- Overrides:
validatein classChMed16AEMediplan<EPrescriptionMedicament>- Parameters:
basePath- The JSON path of this object. Ifnull, the object is considered to be root. Any validation issues produced by the validation will use this path as a base for each issue's path.- Returns:
- The validation result containing all the encountered validation issues, if any.
-
validateRev3Constraints
This method validates specific constraints added with rev3 of the eMediplan ePrescription exchange format.While a different approach of delegating new constraints to the objects themselves would have seemed cleaner, it would have required a refactoring for only a few simple extra checks. For the moment being, the approach of adding a new method per revision to add the newly added checks has been adopted. This decision might be reconsidered at a later stage.
- Parameters:
basePath-result-
-
trim
public void trim()Description copied from interface:EMediplanObjectTrims the eMediplan object, that is, removes any redundant info and sets to null values that match the default assumed value by the specs, to shorten the serialized result.- Specified by:
trimin interfaceEMediplanExtendable<ChMed16AExtension>- Specified by:
trimin interfaceEMediplanObject- Overrides:
trimin classChMed16AEMediplan<EPrescriptionMedicament>
-
hasExtensions
public boolean hasExtensions(boolean inDepth) Description copied from interface:EMediplanObjectWhether the eMediplan object has any extension or not.- Specified by:
hasExtensionsin interfaceEMediplanObject- Overrides:
hasExtensionsin classChMed16AEMediplan<EPrescriptionMedicament>- Parameters:
inDepth- Iftrue, the called object, and all its children objects, are subject to the check. Iffalse, only the called object is checked for extensions.- Returns:
trueif the object contains any extensions;falseotherwise.
-
fromChTransmissionFormat
@ExpectsValidResource public static EPrescription fromChTransmissionFormat(String chTransmission) throws IOException Parses an ePrescription from a ChTransmissionFormat String, as specified by eMediplan.- Parameters:
chTransmission- The transmission content, e.g.CHMED16A1H4sIAAAAAAAAAzWPMU/DMBCFZ/IrolvB0p3b+O6yUSEEEkUM3RCDW7uiQyNE3AFV+e84diN5ed/ze093bdoWPnw6xSFB316zzOD53Z9jlvDihxEeKnxb4PYypvi74M3THARSZkOUH9xlY5pd2MZwOuTUkMb857ME6kQ2X8OcYyfYEWuHa3S3zmLu/n7mNVvI1HwthTe+Krp2+OACd7I3qvFoSOloNAgZF0UcH7yGzpdqeLyk77qKhIjMwqLVqmdYtCuDzljZEfUo/Vrv0faI0Ez/cZpKMywBAAA=- Returns:
- The parsed EPrescription object.
- Throws:
IOException- If there was an I/O parsing error.InvalidEmedContentException- if there were content errors that prevented parsing.
-