Skip to content

Detailed Usage

Felix Naumann edited this page Aug 3, 2023 · 3 revisions

This page contains detailed explanations and examples on how to send files to the server and how to access them later. The server uses HTTP request to communicate. Currently two options, create and read are implemented.

Create

Setup

For now the server only works with proprietary file formats. Internally it uses the wsi_dicomizer library so it understands anything the library understands. DICOM WSI (either as plain DICOM files or as FHIR resources) is currently not supported for uploading.

The server expects the files to be encoded in a specific way. Every WSI file requires to be put into a folder. This folder is then archived (.tar) and compressed (`.gz). This is also known as a tarball. The tarball is then base-64 encoded and written into the FHIR DocumentReference resource.

The image content is now ready to be sent. However, due to the usage of tarballs, the user has to supply additional information where the file that is relevant for OpenSlide exists. An extension for the FHIR DocumentReference resource was created for that. It has the name PathInTarball and expects a primitive string value. Additional DICOM attributes may be supplied through the same mechanism, though they are a little bit more complex since they are nested. See the example at the bottom of the page to get more familiar with its structure.

Send

The FHIR server can be accessed through http://localhost:8081 on a local machine. The server expects a FHIR DocumentReference resource, therefore the REST API endpoint should be http://localhost:8081/fhir/DocumentReference. The server is secured by Keycloak and requires an existing user with the necessary role create_resource in their Keycloack account. The pre-existing account user (name: user, password: user) has the role by default. Converting the files to DICOM may take some time (in some cases several minutes). For that reason the server does not wait for the conversion before responding back. Instead a UUID is generated upon receiving the FHIR resource. The UUID is wrapped into a FHIR OperationOutcome resource. Alongside the resource the HTTP status code 202 (accepted for processing, but not completed (yet)) is returned to the user.

What happens on the server

The image below describes the steps that start once a WSI file is uploaded.

upload seq(6)

Example

Read

Clone this wiki locally