Imaging

Default imaging module

The default GNU Health imaging module (health_imaging) provides basic imaging support and workflow. Only basic, non-DICOM images are supported. No DICOM viewer is provided.

Creating a request

  1. Create draft request

    • Wizard under Imaging → Dx Imaging - New’’

    • Fill in:

      • Patient

      • Urgent or not

      • Specific test(s)

      • Requesting doctor

    • Click Request

  2. Generate order
    • Find draft requests under Imaging → Dx Imaging - New → Draft

    • Click Request button on the draft request in the detailed view

      • Request will now be under the Requested tab

Generating results

  1. Click Generate Results button on the form (under Dx Imaging Requests)

  2. Fill in data (available under the Dx Imaging - Results menu item)

    • Add images under the Images tab

    • Add comments under the Comment tab

View results

Results are found under the Imaging → Dx Imaging - Results menu item.

Configuring available tests

Available tests can be configured under the Configuration → Dx Imaging menu item.

There are two sub-sections:

  • Dx Imaging Test Types (MRI, Ultrasound, etc)

  • Dx Imaging Tests (available tests)

Orthanc Integration

Introduction

This module (health_orthanc) provides a light integration between Orthanc DICOM servers and GNU Health. The module uses the robust REST API provided by Orthanc to synchronize patient and study information in GNU Health. Put simply, the code asks the Orthanc REST API what studies and patients it has and then saves that information locally in GNU Health. No image files are saved. No DICOM viewer provided.

Usage

A new dropdown menu titled Orthanc is available under Health → Imaging.

The menu has 2 sub-sections:

  • Patients

  • Studies

These sub-sections provide the list of studies and patients on the known Orthanc servers. You can filter and search normally. The views are generally read-only. On the list of Orthanc patients, however, some patients will be linked to local patients if the remote and local MRN/PUID match. Otherwise, Orthanc patients can be manually linked to a local patient by updating their patient field.

Note

When an imaging request is completed, the result can be directly linked to Orthanc studies through the new Studies tab under the Imaging → Dx Imaging - Results entry.

Worklists

Setup worklist template

  1. Open: Health > Configuration > Orthanc > Worklist template

  2. Set encoding field.

    At the moment, it is used to generate dump2dcm dumpfile-in text file by script:

    script/orthanc/update_worklists_database.py
    

    This field should work well with (0008,0005) dicom tag of worklist template, for example: if (0008,0005) = [ISO_IR 192], encoding should be “utf-8”, if (0008,0005) = [GBK], encoding should be “gbk”.

  3. Create worklist templates.

    In most situation, a type of modality should to create a template, template use python genshi syntax and used to generate dump2dcm dumpfile-in text file (dump2dcm is a command of dcmtk package).

    At the moment, template support the following variables and most of them use dicom tag nicknames.

    1. AccessionNumber

    2. RequestedProcedureID

    3. StudyInstanceUID

    4. PatientName

    5. PatientID

    6. PatientAge

    7. PatientBirthDate

    8. PatientSex

    9. RequestingPhysician

    10. RequestingService

    11. ReferringPhysicianName

    12. InstitutionName

    13. RequestedProcedureDescription

    14. ScheduledProcedureStepStartDate

    15. ScheduledProcedureStepStartTime

    16. TimezoneOffsetFromUTC

    17. ScheduledStationAETitle

    18. Modality

    Two special variables are supported:

    1. my: this variable refer to ‘gnuhealth.imaging.test.request’ model.

    2. MergeID: Merge Id is used to merge orthanc studies to health imaging result, in most situation, we do not use this variable for we use StudyInstanceUID as merge id, if modality workstation has bug and can not handle StudyInstanceUID properly, user can use other dicom tags to tranfer merge id, more details can be found in get_merge_id method in gnuhealth.orthanc.study model. but, this is a hack way, do not use unless absolutely necessary.

    if user would like to support new worklist template variables, extend get_worklist_template_data method in gnuhealth.imaging.test.request model is a good way.

    Note: Creating a template for a modality may need more work, user should know which tags should be set up properly with the help of Dicom Conformance Statement of this modality, user can use wlmscpfs of dcmtk to create a test worklist server to know which tags will be sent to worklist server from modality. user can try:

    script/orthanc/worklists_service_demo.sh
    
  4. Setup fields of Medical Imaging Studies.

    (Health > Configuration > Medical Imaging > Medical Imaging Studies)

    1. Type: the code of this field is used as Modality (0008,0060) tag of worklist, so make sure its code use the value of Dicom Modality (0008,0060) tag, more details can be found at:

      https://www.dicomlibrary.com/dicom/modality/

    2. AETitle: this field is used as ScheduledStationAETitle (0040,0001) tag of worklist.

    3. Worklist Template.

View worklist text of a imaging request

  1. Open form: Medical Imaging > Medical Imaging Requests

  2. Click worklist field of a request

Generate worklists wl files

  1. Let orthanc enable worklists plugin, please read:

    https://book.orthanc-server.com/plugins/worklists-plugin.html

  2. Install dcmtk package in orthanc machine.

  3. Run the below command in orthanc machine, it will get worklist text from gnuhealth and generate a wl file (dicom file used by orthanc worklist server) with the help of dump2dcm command in dcmtk package, -w argument should set to the Database config of worklists plugin.

    $ python3 script/orthanc/update_worklists_database.py -d <gnuhealth-db> -u <gnuhealth-user> -P <password> -w <orthanc-worklist-db-dir>
    

    More arguments can be found by run:

    $ python3 script/orthanc/update_worklists_database.py -h
    

Sync orthanc studies to gnuhealth imaging results.

Just run:

$ python3 script/orthanc/sync_orthanc_server.py

Administration

Server configuration

A new dropdown menu titled Orthanc is available under Health → Configuration

The menu has 2 sub-sections:

  • Add Orthanc Server

  • Servers

To add a new remote server click Add Orthanc Server. This will open a wizard that guides the user through adding a server:

  • Fill in the label (must be unique), full domain, username, and password.

  • Click Begin

After a short time, a success message should appear.

In case of invalid domains or credentials, there will be an error page instead of a success page.

The Servers page lists the current servers. Clicking on a specific server will show its credentials, validated status, and other important information. Of note, updating the domain, username, or password will trigger a background, remote check to validate the newly updated information.

Synchronization

The module provides a trytond-cron job which by default synchronizes all validated servers every 15 minutes. This can be changed through the Scheduled Actions configuration under Administration → Scheduler.

Servers can by manually synchronized by clicking the Sync button on their individual view.

Troubleshooting

Server(s) not automatically synchronizing

Make sure trytond-cron is running.