Class ValueSetManager

java.lang.Object
org.projecthusky.valueset.api.ValueSetManager

public class ValueSetManager extends Object
Manages the handling of ValueSets such as download from an URL, save to and load from a file.
Verwaltet die Verarbeitung von ValueSets, z. B. Herunterladen von einer URL, Speichern in und Laden aus einer Datei.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The JSONPath path to extract a value set from the JSON definition file
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static URL
    Build the complete URL to retrieve a value set from ART-DECOR. Erstellt die vollständige URL, um einen Wertesatz von ART-DECOR abzurufen.
    Downloads a value set as defined in the given configuration. Lädt einen Wertesatz herunter wie in der angegebenen Konfiguration definiert.
    byte[]
    Downloads a value set as defined in the given configuration.
    Loads a value set config from the given file. Lädt eine Wertesatzkonfiguration aus der angegebenen Datei
    Loads a value set config from the given stream. Lädt eine Wertesatzkonfiguration aus dem angegebenen Stream
    Loads a value set config from the given file (the given filename must contain the relative or full path to access the file). Lädt eine Wertesatzkonfiguration aus der angegebenen Datei (der angegebene Dateiname muss den relativen oder vollständigen Pfad enthalten, um auf die Datei zuzugreifen)
    Loads a value set from the given file, which is provided in IHE SVS format. Lädt einen Wertesatz aus der angegebenen Datei, die im IHE SVS-Format bereitgestellt wird.
    Loads a value set from the given stream, which is provided in IHE SVS format. Lädt einen Wertesatz aus dem angegebenen Stream, der im IHE-SVS-Format bereitgestellt wird.
    Loads a value set from the given file, which is provided in IHE SVS format (the given filename must contain the relative or full path to access the file). Lädt einen Wertesatz aus der angegebenen Datei, die im IHE SVS-Format bereitgestellt wird (der angegebene Dateiname muss den relativen oder vollständigen Pfad enthalten, um auf die Datei zuzugreifen).
    Loads a value set from the given file, which is provided in JSON format. Lädt einen Wertesatz aus der angegebenen Datei, die im JSON bereitgestellt wird.
    Loads a value set from the given stream, which is provided in JSON format. Lädt einen Wertesatz aus dem angegebenen Stream, der im JSON bereitgestellt wird.
    Loads a value set from the given file, which is provided in JSON format (the given filename must contain the relative or full path to access the file). Lädt einen Wertesatz aus der angegebenen Datei, die im JSON-Format bereitgestellt wird (der angegebene Dateiname muss den relativen oder vollständigen Pfad enthalten, um auf die Datei zuzugreifen).
    Loads a value set from the given file, which is provided in XML format. Lädt einen Wertesatz aus der angegebenen Datei, die im XML-Format bereitgestellt wird.
    Loads a value set from the given stream, which is provided in XML format. Lädt einen Wertesatz aus dem angegebenen Stream, der im XML-Format bereitgestellt wird.
    Loads a value set from the given file, which is provided in XML format (the given filename must contain the relative or full path to access the file). Lädt einen Wertesatz aus der angegebenen Datei, die im XML-Format bereitgestellt wird (der angegebene Dateiname muss den relativen oder vollständigen Pfad enthalten, um auf die Datei zuzugreifen).
    Loads a value set from the given file, which is provided in YAML format. Lädt einen Wertesatz aus der angegebenen Datei, die im YAML-Format bereitgestellt wird.
    Loads a value set from the given stream, which is provided in YAML format. Lädt einen Wertesatz aus dem angegebenen Stream, der im YAML-Format bereitgestellt wird.
    Loads a value set from the given file, which is provided in YAML format (the given filename must contain the relative or full path to access the file). Lädt einen Wertesatz aus der angegebenen Datei, die im YAML-Format bereitgestellt wird (der angegebene Dateiname muss den relativen oder vollständigen Pfad enthalten, um auf die Datei zuzugreifen).
    void
    saveValueSet(ValueSet valueSet, File file)
    Saves the given value set in YAML format to the given file. Speichert den angegebenen Wertesatz im YAML-Format in der angegebenen Datei.
    void
    saveValueSet(ValueSet valueSet, OutputStream outputStream)
    Saves the given value set in YAML format to the given output stream. Speichert den angegebenen Wertesatz im YAML-Format in der angegebenen Datei.
    void
    saveValueSet(ValueSet valueSet, String fileName)
    Saves the given value set in YAML format to the given file (the given filename must contain the relative or full path to access the file). Speichert den angegebenen Wertesatz im YAML-Format in der angegebenen Datei (der angegebene Dateiname muss den relativen oder vollständigen Pfad enthalten, um auf die Datei zuzugreifen).
    void
    saveValueSetConfig(ValueSetConfig valueSetConfig, File file)
    Saves the given value set configuration in YAML format to the given file. Speichert die angegebene Wertesatz-Konfiguration im YAML-Format in der angegebenen Datei.
    void
    saveValueSetConfig(ValueSetConfig valueSetConfig, OutputStream outputStream)
    Saves the given value set configuration in YAML format to the given output stream. Speichert die angegebene Wertesatz-Konfiguration im YAML-Format in der angegebenen Datei.
    void
    saveValueSetConfig(ValueSetConfig valueSetConfig, String fileName)
    Saves the given value set configuration in YAML format to the given file (the given filename must contain the relative or full path to access the file). Speichert die angegebene Wertesatz-Konfiguration im YAML-Format in der angegebenen Datei (der angegebene Dateiname muss den relativen oder vollständigen Pfad enthalten, um auf die Datei zuzugreifen).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • JSON_VALUE_SET_BASE_PATH

      public static final String JSON_VALUE_SET_BASE_PATH
      The JSONPath path to extract a value set from the JSON definition file
      See Also:
  • Constructor Details

    • ValueSetManager

      public ValueSetManager()
  • Method Details

    • buildValueSetArtDecorUrl

      public static URL buildValueSetArtDecorUrl(String baseUrl, IdentificatorBaseType id, Date effectiveDate) throws MalformedURLException
      Build the complete URL to retrieve a value set from ART-DECOR.
      Erstellt die vollständige URL, um einen Wertesatz von ART-DECOR abzurufen.
      Parameters:
      baseUrl - The base URL that includes host, path and prefix.
      id - the id
      effectiveDate - the effective date
      Returns:
      The complete URL to download a value set in JSON format.
      Throws:
      MalformedURLException - When the provided baseUrl is invalid.
    • downloadValueSet

      Downloads a value set as defined in the given configuration.
      Lädt einen Wertesatz herunter wie in der angegebenen Konfiguration definiert.
      Parameters:
      valueSetConfig - the value set config
      Returns:
      the value set
      Throws:
      MalformedURLException - the malformed URL exception
      IOException - Signals that an I/O exception has occurred.
      SAXException
      ParserConfigurationException
      InitializationException
    • downloadValueSetRaw

      public byte[] downloadValueSetRaw(ValueSetConfig valueSetConfig) throws IOException
      Downloads a value set as defined in the given configuration. It will be returned in raw dformat exactly as downloaded.
      Lädt einen Wertesatz herunter wie in der angegebenen Konfiguration definiert. Es wird im Roh-Format genau wie heruntergeladen zurückgegeben.
      Parameters:
      valueSetConfig - the value set config
      Returns:
      the output stream
      Throws:
      IOException
      MalformedURLException
    • loadValueSetConfig

      public ValueSetConfig loadValueSetConfig(File config) throws IOException
      Loads a value set config from the given file.
      Lädt eine Wertesatzkonfiguration aus der angegebenen Datei
      Parameters:
      config - the config
      Returns:
      the value set config
      Throws:
      IOException
    • loadValueSetConfig

      public ValueSetConfig loadValueSetConfig(InputStream inputStream)
      Loads a value set config from the given stream.
      Lädt eine Wertesatzkonfiguration aus dem angegebenen Stream
      Parameters:
      inputStream - the config
      Returns:
      the value set config
    • loadValueSetConfig

      public ValueSetConfig loadValueSetConfig(String fileName) throws IOException
      Loads a value set config from the given file (the given filename must contain the relative or full path to access the file).
      Lädt eine Wertesatzkonfiguration aus der angegebenen Datei (der angegebene Dateiname muss den relativen oder vollständigen Pfad enthalten, um auf die Datei zuzugreifen)
      Parameters:
      fileName - the file name
      Returns:
      the value set config
      Throws:
      IOException
    • loadValueSetIheSvs

      public ValueSet loadValueSetIheSvs(File valueSet) throws IOException, ParserConfigurationException, SAXException
      Loads a value set from the given file, which is provided in IHE SVS format.
      Lädt einen Wertesatz aus der angegebenen Datei, die im IHE SVS-Format bereitgestellt wird.
      Parameters:
      valueSet - the value set
      Returns:
      the value set
      Throws:
      IOException
      SAXException
      ParserConfigurationException
    • loadValueSetIheSvs

      public ValueSet loadValueSetIheSvs(InputStream inputStream) throws IOException, ParserConfigurationException, SAXException
      Loads a value set from the given stream, which is provided in IHE SVS format.
      Lädt einen Wertesatz aus dem angegebenen Stream, der im IHE-SVS-Format bereitgestellt wird.
      Parameters:
      inputStream - the value set
      Returns:
      the value set
      Throws:
      IOException
      SAXException
      ParserConfigurationException
    • loadValueSetIheSvs

      public ValueSet loadValueSetIheSvs(String fileName) throws IOException, ParserConfigurationException, SAXException
      Loads a value set from the given file, which is provided in IHE SVS format (the given filename must contain the relative or full path to access the file).
      Lädt einen Wertesatz aus der angegebenen Datei, die im IHE SVS-Format bereitgestellt wird (der angegebene Dateiname muss den relativen oder vollständigen Pfad enthalten, um auf die Datei zuzugreifen).
      Parameters:
      fileName - the file name
      Returns:
      the value set
      Throws:
      IOException
      SAXException
      ParserConfigurationException
    • loadValueSetJson

      public ValueSet loadValueSetJson(File valueSet) throws IOException
      Loads a value set from the given file, which is provided in JSON format.
      Lädt einen Wertesatz aus der angegebenen Datei, die im JSON bereitgestellt wird.
      Parameters:
      valueSet - the value set
      Returns:
      the value set
      Throws:
      IOException
    • loadValueSetJson

      public ValueSet loadValueSetJson(InputStream inputStream) throws IOException
      Loads a value set from the given stream, which is provided in JSON format.
      Lädt einen Wertesatz aus dem angegebenen Stream, der im JSON bereitgestellt wird.
      Parameters:
      inputStream - the value set
      Returns:
      the value set
      Throws:
      IOException
    • loadValueSetJson

      public ValueSet loadValueSetJson(String fileName) throws IOException
      Loads a value set from the given file, which is provided in JSON format (the given filename must contain the relative or full path to access the file).
      Lädt einen Wertesatz aus der angegebenen Datei, die im JSON-Format bereitgestellt wird (der angegebene Dateiname muss den relativen oder vollständigen Pfad enthalten, um auf die Datei zuzugreifen).
      Parameters:
      fileName - the file name
      Returns:
      the value set
      Throws:
      IOException
    • loadValueSetXml

      public ValueSet loadValueSetXml(File valueSet) throws IOException, ParserConfigurationException, SAXException
      Loads a value set from the given file, which is provided in XML format.
      Lädt einen Wertesatz aus der angegebenen Datei, die im XML-Format bereitgestellt wird.
      Parameters:
      valueSet - the value set
      Returns:
      the value set
      Throws:
      IOException
      SAXException
      ParserConfigurationException
    • loadValueSetXml

      public ValueSet loadValueSetXml(InputStream inputStream) throws IOException, ParserConfigurationException, SAXException
      Loads a value set from the given stream, which is provided in XML format.
      Lädt einen Wertesatz aus dem angegebenen Stream, der im XML-Format bereitgestellt wird.
      Parameters:
      inputStream - the value set
      Returns:
      the value set
      Throws:
      IOException
      SAXException
      ParserConfigurationException
    • loadValueSetXml

      public ValueSet loadValueSetXml(String fileName) throws IOException, ParserConfigurationException, SAXException
      Loads a value set from the given file, which is provided in XML format (the given filename must contain the relative or full path to access the file).
      Lädt einen Wertesatz aus der angegebenen Datei, die im XML-Format bereitgestellt wird (der angegebene Dateiname muss den relativen oder vollständigen Pfad enthalten, um auf die Datei zuzugreifen).
      Parameters:
      fileName - the file name
      Returns:
      the value set
      Throws:
      IOException
      SAXException
      ParserConfigurationException
    • loadValueSetYaml

      public ValueSet loadValueSetYaml(File valueSet) throws IOException
      Loads a value set from the given file, which is provided in YAML format.
      Lädt einen Wertesatz aus der angegebenen Datei, die im YAML-Format bereitgestellt wird.
      Parameters:
      valueSet - the value set
      Returns:
      the value set
      Throws:
      IOException
    • loadValueSetYaml

      public ValueSet loadValueSetYaml(InputStream inputStream)
      Loads a value set from the given stream, which is provided in YAML format.
      Lädt einen Wertesatz aus dem angegebenen Stream, der im YAML-Format bereitgestellt wird.
      Parameters:
      inputStream - the value set
      Returns:
      the value set
    • loadValueSetYaml

      public ValueSet loadValueSetYaml(String fileName) throws IOException
      Loads a value set from the given file, which is provided in YAML format (the given filename must contain the relative or full path to access the file).
      Lädt einen Wertesatz aus der angegebenen Datei, die im YAML-Format bereitgestellt wird (der angegebene Dateiname muss den relativen oder vollständigen Pfad enthalten, um auf die Datei zuzugreifen).
      Parameters:
      fileName - the file name
      Returns:
      the value set
      Throws:
      IOException
    • saveValueSet

      public void saveValueSet(ValueSet valueSet, File file) throws IOException
      Saves the given value set in YAML format to the given file.
      Speichert den angegebenen Wertesatz im YAML-Format in der angegebenen Datei.
      Parameters:
      valueSet - the value set
      file - the file
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • saveValueSet

      public void saveValueSet(ValueSet valueSet, OutputStream outputStream) throws IOException
      Saves the given value set in YAML format to the given output stream.
      Speichert den angegebenen Wertesatz im YAML-Format in der angegebenen Datei.
      Parameters:
      valueSet - the value set
      outputStream - the outputStream
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • saveValueSet

      public void saveValueSet(ValueSet valueSet, String fileName) throws IOException
      Saves the given value set in YAML format to the given file (the given filename must contain the relative or full path to access the file).
      Speichert den angegebenen Wertesatz im YAML-Format in der angegebenen Datei (der angegebene Dateiname muss den relativen oder vollständigen Pfad enthalten, um auf die Datei zuzugreifen).
      Parameters:
      valueSet - the value set
      fileName - the file name
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • saveValueSetConfig

      public void saveValueSetConfig(ValueSetConfig valueSetConfig, File file) throws IOException
      Saves the given value set configuration in YAML format to the given file.
      Speichert die angegebene Wertesatz-Konfiguration im YAML-Format in der angegebenen Datei.
      Parameters:
      valueSetConfig - the value set config
      file - the file
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • saveValueSetConfig

      public void saveValueSetConfig(ValueSetConfig valueSetConfig, OutputStream outputStream) throws IOException
      Saves the given value set configuration in YAML format to the given output stream.
      Speichert die angegebene Wertesatz-Konfiguration im YAML-Format in der angegebenen Datei.
      Parameters:
      valueSetConfig - the value set config
      outputStream - the outputStream
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • saveValueSetConfig

      public void saveValueSetConfig(ValueSetConfig valueSetConfig, String fileName) throws IOException
      Saves the given value set configuration in YAML format to the given file (the given filename must contain the relative or full path to access the file).
      Speichert die angegebene Wertesatz-Konfiguration im YAML-Format in der angegebenen Datei (der angegebene Dateiname muss den relativen oder vollständigen Pfad enthalten, um auf die Datei zuzugreifen).
      Parameters:
      valueSetConfig - the value set config
      fileName - the file name
      Throws:
      IOException - Signals that an I/O exception has occurred.