java.lang.Object
org.projecthusky.fhir.emed.ch.epr.model.emediplan.chmed16a.ChMed16AExtension
All Implemented Interfaces:
ChMed16AExtendable, EMediplanExtendable<ChMed16AExtension>, EMediplanObject

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

    • NAME_FIELD_NAME

      protected static final String NAME_FIELD_NAME
      See Also:
    • 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.
    • extensions

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

    • ChMed16AExtension

      public ChMed16AExtension()
  • Method Details

    • getExtensions

      public List<@NonNull ChMed16AExtension> getExtensions()
      Description copied from interface: EMediplanExtendable
      Gets the list of this object's extensions.
      Specified by:
      getExtensions in interface EMediplanExtendable<ChMed16AExtension>
      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 ChMed16AExtension findExtension(@Nullable List<@NonNull ChMed16AExtension> extensions, 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.
      name - The field name to be matched.
      Returns:
      The matching extension, if any, null otherwise.