Interface EMediplanObject
- All Known Subinterfaces:
DurationBoundRepeatable
,NumberBoundRepeatable
- All Known Implementing Classes:
Application
,ApplicationAtTime
,ApplicationInSegment
,CyclicDosage
,DailyDosage
,DaySegmentsDosage
,DaysOfMonthDosage
,DosageSequenceElement
,DoseOnlyDosage
,EmbeddableTimedDosage
,EMediplan
,EMediplanDose
,EMediplanExtension
,EMediplanHealthcareOrganization
,EMediplanHealthcarePerson
,EMediplanMedicament
,EMediplanPatient
,EMediplanPatientId
,EMediplanPatientMedicalData
,EMediplanPosology
,EMediplanPostalAddress
,EMediplanRisk
,EMediplanRiskList
,FreeTextDosage
,IntervalDosage
,IntervalDose
,Pause
,PosologyDetail
,PreciseTimesDosage
,RangeDose
,Repetition
,RepetitionDuration
,RepetitionNumber
,RepetitionNumberAndDuration
,SequenceDosage
,SequenceElement
,SimpleDose
,SingleDosage
,TimedDosage
,WeekDaysDosage
public interface EMediplanObject
Abstraction of an eMediplan (JSON) object. Declares common methods to all eMediplan objects and provides a default
implementation for some of them.
-
Method Summary
Modifier and TypeMethodDescriptiondefault String
getFieldValidationPath
(@Nullable String basePath, String field) Convenience method to get a specific field's validation path, that is, the path to be used to produce aValidationIssue
.default String
getFieldValidationPath
(@Nullable String basePath, String field, int index) Convenience method to get a specific field's validation path when the field is actually an element of a list/array.default ValidationIssue
getIgnoredFieldValidationIssue
(String path, String message) Convenience method to get a validation issue of severityOperationOutcome.IssueSeverity.WARNING
and typeOperationOutcome.IssueType.INVALID
with the specified issue path and message.default ValidationIssue
getRequiredFieldValidationIssue
(String path, String message) Convenience method to get a validation issue of severityOperationOutcome.IssueSeverity.ERROR
and typeOperationOutcome.IssueType.REQUIRED
with the specified issue path and message.default ValidationIssue
getValidationIssue
(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity severity, org.hl7.fhir.r4.model.OperationOutcome.IssueType type, String path, String message) Convenience method to produce a validation issue by providing only severity, type, path and message.default void
trim()
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.default ValidationResult
validate()
Validates the eMediplan object, without any further context than its own content, against the eMediplan specs.Validates the eMediplan object, without any further context than its JSON path and its own content, against the eMediplan specs.
-
Method Details
-
trim
default void trim()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. -
validate
Validates the eMediplan object, without any further context than its own content, against the eMediplan specs.- Returns:
- The validation result containing all the encountered validation issues, if any.
-
validate
Validates the eMediplan object, without any further context than its JSON path and its own content, against the eMediplan specs.- 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.
-
getRequiredFieldValidationIssue
Convenience method to get a validation issue of severityOperationOutcome.IssueSeverity.ERROR
and typeOperationOutcome.IssueType.REQUIRED
with the specified issue path and message. This issue is to be used for eMediplan mandatory fields/objects that are however missing within the object being validated.- Parameters:
path
- The path of the issue. Where the issue was encountered.message
- The message describing the issue.- Returns:
- The produced validation issue.
-
getValidationIssue
default ValidationIssue getValidationIssue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity severity, org.hl7.fhir.r4.model.OperationOutcome.IssueType type, String path, String message) Convenience method to produce a validation issue by providing only severity, type, path and message.- Parameters:
severity
- The severity of the issue.type
- The type of issue.path
- The path of the issue. Where the issue was encountered.message
- The message describing the issue.- Returns:
- The produced validation issue.
-
getIgnoredFieldValidationIssue
Convenience method to get a validation issue of severityOperationOutcome.IssueSeverity.WARNING
and typeOperationOutcome.IssueType.INVALID
with the specified issue path and message. This issue is to be produced when a field is specified by the eMediplan specification not to be provided and to be ignored if encountered (on the specified conditions).- Parameters:
path
- The path of the issue. Where the issue was encountered.message
- The message describing the issue.- Returns:
- The produced validation issue.
-
getFieldValidationPath
Convenience method to get a specific field's validation path, that is, the path to be used to produce aValidationIssue
.- Parameters:
basePath
- The base path of the object being validated and containing the field triggering the validation issue.field
- The name of the field triggering the validation issue.- Returns:
- The path for the specified field within the specified object as to be used for a validation issue.
-
getFieldValidationPath
Convenience method to get a specific field's validation path when the field is actually an element of a list/array. For instance, if the element failing to pass validation is the value 1 within the JSON{"mylist": [1, 2]}
; then this method can be called asgetFieldValidationPath(null, "mylist", 0)
to get a path for this element to be used to produce a validation issue.- Parameters:
basePath
- The base path of the object being validated and containing the field triggering the validation issue.field
- The name of the field triggering the validation issue.index
- The index of the list/array element that failed to pass validation.- Returns:
- The resulting field validation path.
-