java.lang.Object
org.projecthusky.fhir.emed.ch.epr.model.emediplan.chmed23a.ChMed23AExtension
All Implemented Interfaces:
ChMed23AExtendable, EMediplanExtendable<ChMed23AExtension>, EMediplanObject

public class ChMed23AExtension extends Object implements ChMed23AExtendable, EMediplanObject
Extensions can be used to include additional information within an eMediplan that is not explicitly modelled by the ChMed specification.
  • Field Details

    • EXTENSIONS_FIELD_NAME

      public static final String EXTENSIONS_FIELD_NAME
      See Also:
    • name

      protected String name
      Name of the field. Mandatory.
    • value

      protected @Nullable String value
      The value of the field. Optional.
    • schema

      protected String schema
      The Schema. It can be any string and can be used to determine how to interpret the extension. It is mandatory.
    • extensions

      protected @Nullable List<@NonNull ChMed23AExtension> extensions
      The list of nested extensions. Optional if empty.
  • Constructor Details

    • ChMed23AExtension

      public ChMed23AExtension()
  • Method Details

    • getExtensions

      public List<@NonNull ChMed23AExtension> getExtensions()
      Description copied from interface: EMediplanExtendable
      Gets the list of this object's extensions.
      Specified by:
      getExtensions in interface EMediplanExtendable<ChMed23AExtension>
      Returns:
      The list of extensions.
    • validate

      public ValidationResult validate(@Nullable String basePath)
      Description copied from interface: EMediplanObject
      Validates the eMediplan object, without any further context than its JSON path and its own content, against the eMediplan specs.
      Specified by:
      validate in interface EMediplanObject
      Parameters:
      basePath - The JSON path of this object. If null, 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.
    • hasExtensions

      public boolean hasExtensions(boolean inDepth)
      Description copied from interface: EMediplanObject
      Whether the eMediplan object has any extension or not.
      Specified by:
      hasExtensions in interface EMediplanObject
      Parameters:
      inDepth - If true, the called object, and all its children objects, are subject to the check. If false, only the called object is checked for extensions.
      Returns:
      true if the object contains any extensions; false otherwise.
    • findExtension

      @ExpectsValidResource public static @Nullable ChMed23AExtension findExtension(@Nullable List<@NonNull ChMed23AExtension> extensions, String schema, String name)
      Finds an extension within the provided list of extensions whose schema and name match the provided ones. If the list of extensions is null or empty, or if no match is found, null is returned.
      Parameters:
      extensions - The list of extensions within to perform the search.
      schema - The schema to be matched.
      name - The field name to be matched.
      Returns:
      The matching extension, if any, null otherwise.