Skip to content

Add a RADIS_URL setting and an "Open report in RADIS" link on study pages #421

Open

Description

@samuelvkwong

Motivation

A user looking at a study in ADIT -- in the DICOM Explorer, a selective transfer result, a batch query result or a transfer task -- cannot get to the report for that study in RADIS, although both systems know the Study Instance UID and Accession Number. From the September 2026 ADIT/RADIS brainstorming ("Be able to open up a report in RADIS from a study in ADIT ... GENERAL ISSUE IN ADIT"). This is the ADIT half; RADIS gets the lookup URL in openradx/radis#310.

Current behaviour

  • ADIT has no notion of RADIS: no setting, template or URL mentions it. A grep over adit/, docs/, example.env and CLAUDE.md only finds references to the adit-radis-shared library and a dev spec under docs/superpowers/specs/ that cites a RADIS PR as prior art.
  • Both identifiers are already on every study result: adit/core/utils/dicom_operator.py:177-189 always requests StudyInstanceUID and AccessionNumber, and the explorer goes through the same find_studies (adit/dicom_explorer/utils/dicom_data_collector.py:23-24).
  • Where they are shown today: adit/dicom_explorer/templates/dicom_explorer/_study_infos.html:4-15 (both); _studies_table.html:18,25-29 (accession in a cell, UID on the action link); adit/core/templates/core/_transfer_task_detail.html:59-69 (task.study_uid with a "Show in DICOM Explorer" link -- TransferTask has no accession number, adit/core/models.py:465-490); adit/selective_transfer/templates/selective_transfer/_query_results_table.html:23,43 (UID only, in the checkbox value and download link). BatchQueryResult stores both (adit/batch_query/models.py:149,195) but the table hides them (adit/batch_query/tables.py:31-38); only the Excel export has them (adit/batch_query/utils/exporters.py:47-48,90-91).
  • Templates reach settings only through adit_radis_shared.common.site.base_context_processor (adit/settings/base.py:144), which exposes project version, URL and support email. A settings-reading simple_tag exists as precedent (base_url, adit_radis_shared/common/templatetags/common_extras.py:21-34), and explorer_url (adit/dicom_explorer/templatetags/dicom_explorer_extras.py:9-15) is the in-app cross-link precedent.

Proposal

  1. RADIS_URL = env.str("RADIS_URL", default="") in adit/settings/base.py, next to the other deployment settings (CALLING_AE_TITLE :389, EXCLUDE_MODALITIES :517); documented in example.env, the "Environment Variables" section of docs/user-docs/admin-guide.md (:18) and CLAUDE.md (:165).
  2. A simple_tag radis_report_url(study_uid, accession_number=None) in adit/core/templatetags/core_extras.py that returns "" when RADIS_URL is unset and otherwise <RADIS_URL>/reports/lookup/?study_instance_uid=...&accession_number=... (values URL-encoded; the parameter names are the contract settled in Add a lookup URL that opens a report by Study Instance UID or Accession Number radis#310).
  3. An "Open report in RADIS" link with target="_blank" rel="noopener noreferrer" (as RADIS's own PACS button does), rendered only when the tag returns a URL, so deployments without RADIS see no change. First in _study_infos.html next to the Study Instance UID and in _transfer_task_detail.html next to the explorer link; the three row/table templates (_studies_table.html, _query_results_table.html, a TemplateColumn in batch_query/tables.py) as a follow-up.

URL contract proposed in openradx/radis#310 (not settled there yet): one match redirects to the report, several show a chooser, none gives a 404, all scoped to the user's active RADIS group.

Open questions

  1. Product-specific RADIS_URL, or a generic external study link setting (a list of {label, url template} with {StudyInstanceUID} / {AccessionNumber} placeholders)? The generic form also serves a PACS web viewer (the "viewer for images" bullet) and mirrors RADIS's generic pacs_link. RADIS_URL is the smaller change and the sibling interoperability items (batch transfer file from a collection, start a transfer from RADIS) can reuse it; recommended for now, the maintainer's view on product coupling decides.
  2. Env setting or admin-editable DicomAppSettings field? Env matches every other deployment setting and needs no migration; there is no precedent for URLs in app settings, but env cannot be changed without a redeploy.
  3. Which pages: the two detail pages only, or also the three tables? A column in batch_query/tables.py also surfaces identifiers the table hides today, and _query_results_table.html may be touched by Add series level search and transfer to SelectiveTransfer #141.
  4. Pass pacs_aet=<server.ae_title> (DicomServer.ae_title, adit/core/models.py:136)? Only useful when the ETL feeding RADIS uses the same AE title string; RADIS treats it as optional narrowing.
  5. Show the link on pseudonymised transfer tasks (TransferTask.pseudonym)? RADIS's own access control applies either way, but the task page is shown to users who may only be allowed pseudonymised data.

Implementation notes

  • Identity is separate: ADIT and RADIS have their own user tables and group models (ADIT groups gate DicomServer access via accessible_by_user, adit/dicom_explorer/views.py:135; RADIS groups gate reports). The link only works for a user who also has a RADIS account whose active group contains the report; RADIS's LoginRequiredMixin preserves the query string across login. Replace django-registration-redux with django-allauth (OIDC login + invitations) adit-radis-shared#244 (OIDC) is what would make this seamless; it is not a prerequisite.
  • Quasi-identifiers in the query string match current practice (explorer_url puts PatientID into the query string, dicom_explorer_extras.py:40-41). rel="noreferrer" keeps the ADIT URL, which may carry PatientID, out of RADIS logs, and the RADIS redirect to /reports/<pk>/ keeps the identifiers out of the final URL.
  • Tests: a template tag test (empty RADIS_URL gives "", a set value gives the encoded URL) and a view test in adit/dicom_explorer/tests/ asserting the link is present or absent under override_settings.

Related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions