Class EMediplanPatient
java.lang.Object
org.projecthusky.fhir.emed.ch.epr.model.emediplan.EMediplanPatient
- All Implemented Interfaces:
EMediplanExtendable,EMediplanObject
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected EMediplanPostalAddressPostal address of the patient.protected LocalDateDate of birth, day precision.List of email addresses.protected @Nullable List<@NonNull EMediplanExtension>The list of extensions.protected StringFirst name.protected GenderGender of the patient.protected List<EMediplanPatientId>List of patient identifiers.protected StringThe patient's language (ISO 639-16 language code) (e.g.protected StringLast name.protected static final Stringprotected @Nullable EMediplanPatientMedicalDataMedical data information.List of phone numbers. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable StringTranslates a code value from a FHIR language coding to an eMediplan language code.static EMediplanPatientfromEprFhir(ChCorePatientEpr eprFhirPatient, @Nullable org.hl7.fhir.r4.model.Observation weightObservation) Gets an EMediplanPatient from an CH EPR patient.List<@NonNull EMediplanExtension>Gets the list of this object's extensions.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.validate(@Nullable String basePath, EMediplanType mediplanType, Instant timestamp) Validates the patient object taking into account which type of eMediplan document it belongs to.protected ValidationResultvalidateBase(@Nullable String basePath, boolean contextAwareCaller) Base validation that performs or skips certain validation checks depending on whether the caller is context-aware or not.Methods 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.EMediplanExtendable
addExtension, findExtensionMethods inherited from interface org.projecthusky.fhir.emed.ch.epr.model.emediplan.EMediplanObject
getFieldValidationPath, getFieldValidationPath, getIgnoredFieldValidationIssue, getRequiredFieldValidationIssue, getValidationIssue, validate
-
Field Details
-
MEDICAL_DATA_FIELD_NAME
- See Also:
-
firstName
First name. -
lastName
Last name. -
birthDate
Date of birth, day precision. Format: yyyy-mm-dd (ISO 86013 Date) -
gender
Gender of the patient. The terms gender and sex are considered synonyms in ChMed23A. -
address
Postal address of the patient. -
languageCode
The patient's language (ISO 639-16 language code) (e.g. de). Note that while the lowercase version is preferred, the codes are also valid in uppercase (e.g. DE). -
ids
List of patient identifiers. -
extensions
The list of extensions. Optional if empty. -
medicalData
Medical data information. -
phones
List of phone numbers. -
emails
List of email addresses.
-
-
Constructor Details
-
EMediplanPatient
public EMediplanPatient()
-
-
Method Details
-
getExtensions
Description copied from interface:EMediplanExtendableGets the list of this object's extensions.- Specified by:
getExtensionsin interfaceEMediplanExtendable- Returns:
- The list of extensions.
-
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- 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.
-
validateBase
Base validation that performs or skips certain validation checks depending on whether the caller is context-aware or not. This prevents redundant validation checks when the caller is context-aware and will also call children context-aware validation methods instead of their basic counterparts, that will be skipped by this method.- Parameters:
basePath- The object's JSON path.contextAwareCaller- Whether caller is context aware or not. If true, some validation checks might be skipped.- Returns:
- The validation result.
-
validate
public ValidationResult validate(@Nullable String basePath, EMediplanType mediplanType, Instant timestamp) Validates the patient object taking into account which type of eMediplan document it belongs to. It performs the basic check done byvalidate(String)plus extra validation taking into account the document type.- Parameters:
basePath- The base path of the JSON object.mediplanType- The type of eMediplan document.timestamp- The timestamp of the eMediplan document creation.- Returns:
- The validation 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 interfaceEMediplanObject
-
fromEprFhir
public static EMediplanPatient fromEprFhir(ChCorePatientEpr eprFhirPatient, @Nullable org.hl7.fhir.r4.model.Observation weightObservation) Gets an EMediplanPatient from an CH EPR patient.- Parameters:
eprFhirPatient- The CH EPR patient to be converted.- Returns:
- The eMediplan patient.
-
fhirLanguageCodeToEMediplanLanguageCode
Translates a code value from a FHIR language coding to an eMediplan language code.It expects a language code that would be either a 2-character ISO language code or one of the 5 characters long Swiss variants (e.g. fr-CH). Matching is not case-sensitive. A 5-character language code will be shortened to a 2 character code to comply with eMediplan specifications.
- Parameters:
code- The language code.- Returns:
- The eMediplan language code.
-