Package org.projecthusky.valueset.api
Class ValueSetManager
java.lang.Object
org.projecthusky.valueset.api.ValueSetManager
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
FieldsModifier and TypeFieldDescriptionstatic final String
The JSONPath path to extract a value set from the JSON definition file -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic URL
buildValueSetArtDecorUrl
(String baseUrl, IdentificatorBaseType id, Date effectiveDate) Build the complete URL to retrieve a value set from ART-DECOR. Erstellt die vollständige URL, um einen Wertesatz von ART-DECOR abzurufen.downloadValueSet
(ValueSetConfig valueSetConfig) Downloads a value set as defined in the given configuration. Lädt einen Wertesatz herunter wie in der angegebenen Konfiguration definiert.byte[]
downloadValueSetRaw
(ValueSetConfig valueSetConfig) Downloads a value set as defined in the given configuration.loadValueSetConfig
(File config) Loads a value set config from the given file. Lädt eine Wertesatzkonfiguration aus der angegebenen DateiloadValueSetConfig
(InputStream inputStream) Loads a value set config from the given stream. Lädt eine Wertesatzkonfiguration aus dem angegebenen StreamloadValueSetConfig
(String fileName) 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)loadValueSetIheSvs
(File valueSet) 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.loadValueSetIheSvs
(InputStream inputStream) 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.loadValueSetIheSvs
(String fileName) 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).loadValueSetJson
(File valueSet) 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.loadValueSetJson
(InputStream inputStream) 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.loadValueSetJson
(String fileName) 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).loadValueSetXml
(File valueSet) 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.loadValueSetXml
(InputStream inputStream) 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.loadValueSetXml
(String fileName) 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).loadValueSetYaml
(File valueSet) 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.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.loadValueSetYaml
(String fileName) 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).
-
Field Details
-
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 ideffectiveDate
- the effective date- Returns:
- The complete URL to download a value set in JSON format.
- Throws:
MalformedURLException
- When the provided baseUrl is invalid.
-
downloadValueSet
public ValueSet downloadValueSet(ValueSetConfig valueSetConfig) throws IOException, ParserConfigurationException, SAXException, InitializationException 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 exceptionIOException
- Signals that an I/O exception has occurred.SAXException
ParserConfigurationException
InitializationException
-
downloadValueSetRaw
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
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
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
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
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
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
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
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
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
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
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 setfile
- the file- Throws:
IOException
- Signals that an I/O exception has occurred.
-
saveValueSet
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 setoutputStream
- the outputStream- Throws:
IOException
- Signals that an I/O exception has occurred.
-
saveValueSet
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 setfileName
- the file name- Throws:
IOException
- Signals that an I/O exception has occurred.
-
saveValueSetConfig
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 configfile
- 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 configoutputStream
- the outputStream- Throws:
IOException
- Signals that an I/O exception has occurred.
-
saveValueSetConfig
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 configfileName
- the file name- Throws:
IOException
- Signals that an I/O exception has occurred.
-