imaging_api.services_external.data_access ========================================= .. py:module:: imaging_api.services_external.data_access Attributes ---------- .. autoapisummary:: imaging_api.services_external.data_access.DATA_ACCESS_API_URL Classes ------- .. autoapisummary:: imaging_api.services_external.data_access.AccessionIdsRequest Functions --------- .. autoapisummary:: imaging_api.services_external.data_access.get_accession_ids Module Contents --------------- .. py:data:: DATA_ACCESS_API_URL :value: 'http://data-access-api:8000' .. py:class:: AccessionIdsRequest Bases: :py:obj:`pydantic.BaseModel` Request model for the Data Access API to fetch a cohort's accession IDs. .. py:attribute:: encrypted_project_id :type: str .. py:attribute:: query :type: str .. py:function:: get_accession_ids(encrypted_project_id: str, query: str) -> list[str] :async: Calls the data-access-api ``/cohort/accession-ids`` endpoint and returns the list of accession IDs for the cohort. The endpoint projects the cohort query to the ``accession_id`` column server-side, so no other patient attributes leave the trust's data store. :param encrypted_project_id: The encrypted project ID. :type encrypted_project_id: str :param query: The SQL query to execute. :type query: str :returns: The accession IDs returned by the cohort query, in query order. :rtype: list[str] :raises RuntimeError: If the HTTP call to the Data Access API fails (network error or non-2xx response).