0.2.0 - ci-build

ONCOnnectTumorboardIG - Local Development build (v0.2.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

File Attachments

If you want to attach files to a registration, you need to upload them in a second step after POSTing the registration.

Preparation

The API endpoint for uploading files is https://tumorboards.staging.test.ccc-onconnect.de/api/serviceRequest/<serviceRequestId>/documents/. To find the serviceRequestId, you can either look it up in the response of your POST request that created the registration:

// ...
{
	"response": {
		"status": "201",
		"location": "http://localhost:8080/fhir/ServiceRequest/DGKXANMME47X3QV7/_history/3",
		"etag": "W/\"3\"", //                                  ^^^^^^^^^^^^^^^^
		"lastModified": "2025-09-17T09:31:01.214Z",
	},
}
// ...

or you use the ONCOnnect webpage, where you can find the serviceRequestId at the end of the URL of any registration:

https://tumorboards.staging.test.ccc-onconnect.de/de/requests/DGKXANMME47X3QV7
                                                              ^^^^^^^^^^^^^^^^

Request Format

The request must be a POST request with the header Content-Type: multipart/form-data. The body of the request can contain multiple files, which need to be provided through file{x} fields, where x is a number starting from 1 (file1, file2, …). Each file should have a descriptive filename. Each file must have an accompanying type type{x}, which contains a LOINC code in FSH syntax specifying the contents of the file from this CodeSystem. Additionally you can provide a description{x} field (description1, description2, …) for each file, if you want to add further details. You don't need to provide a description for each file, but make sure that the indices match.

As with the registration bundle, you need to provide an Authorization header with a valid bearer API token.

Example

const formData = new FormData();
files.forEach((file, index) => {
	formData.append(`file${index + 1}`, file);
	formData.append(
		`type${index + 1}`,
		'http://loinc.org#11526-1 "Pathology study report"',
	);
	if (descriptions[index]) {
		formData.append(`description${index + 1}`, descriptions[index]);
	}
});
const response = await fetch(
	`https://tumorboards.staging.test.ccc-onconnect.de/api/serviceRequest/${serviceRequestId}/documents/`,
	{
		method: 'POST',
		headers: {
			Authorization: `Bearer ${apiToken}`,
		},
		body: formData,
	},
);

Limitations

Currently, the maximum file size is limited to 50 MB. The following file types are supported:

  • PDF (application/pdf)
  • JPEG images (image/jpeg)
  • PNG images (image/png)
  • GIF images (image/gif)
  • Microsoft Word documents (application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
  • Plain text files (text/plain)
  • Microsoft Excel spreadsheets (application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)

This list may be extended in the future. If you need to upload files of a different type, please contact us.

As of now, the file API does not lock the registration while files are being uploaded yet. Therefore, to avoid conflicts, please make sure that no other changes are made to the registration while files are being uploaded.

Deleting Files

To delete files again through the API, you can send a DELETE request to the same endpoint as above https://tumorboards.staging.test.ccc-onconnect.de/api/serviceRequest/<serviceRequestId>/documents/. Send all the documentIds you want to delete in the body of the request as a JSON array. You can find the documentIds in the response when uploading files or on the ONCOnnect webpage when viewing the registration.

Example

const response = await fetch(
	`https://tumorboards.staging.test.ccc-onconnect.de/api/serviceRequest/${serviceRequestId}/documents/`,
	{
		method: 'DELETE',
		headers: {
			'Content-Type': 'application/json',
			Authorization: `Bearer ${apiToken}`,
		},
		body: JSON.stringify(['documentId1', 'documentId2']),
	},
);