Django plugin for ohcnetwork/care.
To develop the plug in local environment along with care, follow the steps below:
- Go to the care root directory and clone the plugin repository:
cd care
git clone git@github.com:10bedicu/care_radiology.git- Add the plugin config in plug_config.py
...
care_radiology_plugin = Plug(
name="care_radiology", # Name of the Django app inside the plugin
package_name="/app/care_radiology", # Must be /app/<plugin_folder_name>
version="", # Keep empty for local development
configs={
# Base URL for dcm4che DICOMweb API
"DCM4CHEE_DICOMWEB_BASEURL": "http://arc:8080/dcm4chee-arc/aets/DCM4CHEE",
# Secret used to verify incoming webhooks
"WEBHOOK_SECRET": "RADOMSECRET"
},
)
plugs = [care_radiology_plugin]
...- Tweak the code in plugs/manager.py, install the plugin in editable mode
...
subprocess.check_call(
[sys.executable, "-m", "pip", "install", "-e", *packages] # add -e flag to install in editable mode
)
...- Include the
docker-compose.radiology.yamlin Makefile's up and down targets incareand start the containers- Modify the nginx proxy service's exposed port as required by your setup
...
TELERADIOLOGY_DOCKER_COMPOSE := ./care_radiology/docker-compose.radiology.yaml
...
up:
docker compose -f docker-compose.yaml -f $(docker_config_file) -f $(TELERADIOLOGY_DOCKER_COMPOSE) up -d --wait-
Setting Up DCM4CHEE
- DCM4CHEE is used as the DICOM archive and requires LDAP + Postgres configuration.
- Configure DICOM Storage (MinIO)
- Create a bucket named
dicom-bucketfor the dicom images. - Modify the variables in
docker/dcm4che/bucketconfig.ldifto reflect your setup (if required). - Import the provided LDAP configuration
docker/dcm4che/bucketconfig.ldifinto the LDAP service so DCM4CHEE uses MinIO for object storage.
- Create a bucket named
- Configure the Database:
- Create a dedicated database in Postgres
CREATE DATABASE dicom; - Edit the variables in
docker/dcm4che/Makefileto match your Postgres setup. - Run the target
setup-dicom-dbindocker/dcm4che/Makefile
- Create a dedicated database in Postgres
-
Setting up OHIF
- OHIF is the web-based DICOM viewer and must point to publicly accessible DICOMweb endpoints.
- Update the following keys in
docker/ohif/app-config.jsto point to the publicly accessible URL for dcm4che DICOMweb APIdataSources[0].wadoRootdataSources[0].wadoUriRootdataSources[0].qidoRoot.
- NOTE: These URLs must be reachable from the browser.
- Typically in localhost configurations this will look like
wadoUriRoot: 'http://localhost:32314/dicomweb/dcm4chee-arc/aets/DCM4CHEE/wado',
qidoRoot: 'http://localhost:32314/dicomweb/dcm4chee-arc/aets/DCM4CHEE/rs',
wadoRoot: 'https://localhost:32314/dicomweb/dcm4chee-arc/aets/DCM4CHEE/rs',
Important
Do not push these changes in a PR. These changes are only for local development.
- Clone this repository inside the root directory of the Care backend.
- Add the snippet below to your
plug_config
...
radiology_plug = Plug(
name="care_radiology",
package_name="git+https://github.com/10bedicu/care_radiology.git",
version="@main",
configs={
# can be defined as environment variables in production setup
"DCM4CHEE_DICOMWEB_BASEURL": "http://arc:8080/dcm4chee-arc/aets/DCM4CHEE",
"WEBHOOK_SECRET": "secure-webhook-secret"
},
)
plugs = [radiology_plug]
...Extended Docs on Plug Installation
This plugin was created with Cookiecutter using the ohcnetwork/care-plugin-cookiecutter.