A FHIR API Frontend to dicom4ortho.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
- About The Project
- Building
- Getting Started
- Usage
- API Endpoints
- Known Issues
- Roadmap
- Contributing
- Building the FHIR Bundle
- License
- Contact
- Acknowledgements
TODO
- dicom4ortho
- [fhir.resource]
- [fastapi]
poetry install
Poetry
# Install Poetry
curl -sSL https://install.python-poetry.org | python3 -
# or install with pipx
# Install dependencies
poetry install
# Activate the virtual environment
poetry shell
docker run -d \
--env-file ./test/env-dev \
-p 127.0.0.1:8203:8000 \
-v ./tasks.sqlite:/app/tasks.sqlite \
--name fhir2dicom4ortho \
cr.medoco.health/open-ortho/fhir2dicom4ortho:latest
There is the docker-compose.yml
you can use as example.
The fhir2dicom4ortho
project implements a partial set of FHIR API endpoints to interact with DICOM Orthodontic imaging studies. Below are the currently implemented endpoints along with their functionalities and references to the official FHIR documentation.
Description:
Accepts a FHIR Bundle
containing Task
, ImagingStudy
, and Binary
resources. Processes the bundle by scheduling the creation and sending of a DICOM image to the PACS server.
Functionality:
- Validates the incoming Bundle for required resources.
- Updates the
Task
status to "received". - Schedules the job using APScheduler.
- Returns the updated
Task
resource.
FHIR Documentation:
Description:
Retrieves the status of a specific Task by its task_id
.
Functionality:
- Fetches the
Task
resource corresponding to the providedtask_id
. - Returns the
Task
resource if found. - Returns an
OperationOutcome
if theTask
is not found.
FHIR Documentation:
Description:
Retrieves all existing Tasks.
Functionality:
- Fetches all
Task
resources. - Returns a FHIR
Bundle
containing the list of Tasks.
FHIR Documentation:
Note:
The current implementation includes only the above endpoints. Additional endpoints and functionalities could be planned for future releases to provide better support for FHIR operations.
Please check the Implementation Status document.
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Before development,
poetry update
to update all dependencies;- Run all tests and fix issues caused by update dependecies;
- Continue development;
The requirements.txt
file is only used for Dependabot, which i think works off of that and not poetry.lock
. However, the project's dependencies are managed by poetry.
Building a new docker image should trigger the generation of a new requirements.txt
, which you should then safely commit.
To operate this API, you need to construct a FHIR Bundle containing specific resources. Below is an example of how to build the required FHIR Bundle, using fhir2dicom4ortho.Bundle.json
as a reference.
See test/fhir2dicom4ortho.Bundle.json
for a full example implementation.
The FHIR Bundle should contain the following resources:
- Task: Describes the task to be performed.
- ImagingStudy: Contains information about the imaging study.
- Binary (DICOM MWL): Contains the DICOM Modality Worklist (MWL) data.
- Binary (Image File): Contains the image file data.
The Task resource describes the task to be performed, including references to the Binary and ImagingStudy resources.
{
"resourceType": "Task",
"id": "task-id",
"status": "requested",
"intent": "order",
"description": "Process DICOM MWL and Image Input",
"authoredOn": "2024-06-16T14:00:00Z",
"requester": {
"reference": "Practitioner/456",
"display": "Dr. John Doe"
},
"for": {
"reference": "Patient/123",
"display": "Patient Example"
},
"input": [
{
"type": {
"text": "DICOM MWL"
},
"valueReference": {
"reference": "Binary/dicom-mwl-id"
}
},
{
"type": {
"text": "Image File"
},
"valueReference": {
"reference": "Binary/image-file-id"
}
},
{
"type": {
"text": "Image Study"
},
"valueReference": {
"reference": "ImagingStudy/imaging-study-id"
}
}
]
}
The ImagingStudy resource contains information about the imaging study, including series and instances.
{
"resourceType": "ImagingStudy",
"id": "imaging-study-id",
"status": "available",
"subject": {
"reference": "Patient/123",
"display": "Patient Example"
},
"started": "2024-06-16T14:00:00Z",
"numberOfSeries": 1,
"numberOfInstances": 1,
"series": [
{
"uid": "series-uid",
"number": 7,
"modality": {
"coding": [
{
"system": "http://dicom.nema.org/resources/ontology/DCM",
"code": "XC",
"display": "External-camera Photography"
}
]
},
"started": "2024-06-16T14:00:00Z",
"description": "Sample XC Series",
"numberOfInstances": 1,
"instance": [
{
"uid": "instance-uid",
"sopClass": {
"system": "https://dicom.nema.org/medical/dicom/current/output/chtml/part04/sect_B.5.html#table_B.5-1",
"code": "1.2.840.10008.5.1.4.1.1.77.1.4.1",
"display": "VL Photographic Image Storage"
},
"number": 100,
"title": "Sample Orthodontic Image"
}
]
}
]
}
The Binary resource containing the DICOM Modality Worklist (MWL) data.
{
"resourceType": "Binary",
"id": "dicom-mwl-id",
"contentType": "application/dicom",
"data": "base64-encoded-dicom-mwl-data"
}
The Binary resource containing the image file data.
{
"resourceType": "Binary",
"id": "image-file-id",
"contentType": "image/png",
"data": "base64-encoded-image-data"
}
Combine the above resources into a single FHIR Bundle.
{
"resourceType": "Bundle",
"type": "batch",
"entry": [
{
"fullUrl": "urn:uuid:task-id",
"resource": { /* Task resource */ },
"request": {
"method": "POST",
"url": "http://fhir2dicom4ortho/fhir/Bundle"
}
},
{
"fullUrl": "urn:uuid:imaging-study-id",
"resource": { /* ImagingStudy resource */ },
"request": {
"method": "POST",
"url": "http://fhir2dicom4ortho/fhir/Bundle"
}
},
{
"fullUrl": "urn:uuid:dicom-mwl-id",
"resource": { /* Binary (DICOM MWL) resource */ },
"request": {
"method": "POST",
"url": "http://fhir2dicom4ortho/fhir/Bundle"
}
},
{
"fullUrl": "urn:uuid:image-file-id",
"resource": { /* Binary (Image File) resource */ },
"request": {
"method": "POST",
"url": "http://fhir2dicom4ortho/fhir/Bundle"
}
}
]
}
This FHIR Bundle can then be sent to the API to process the DICOM MWL and image input.
Distributed under the MIT License. See LICENSE for more information.
Toni Magni- @zgypa - [email protected]
Project Link: https://github.com/open-ortho/fhir2dicom4ortho