Skip to main content

OpenAPI reference

This page is generated by npm run docs:prepare from route-level OpenAPI comments.

Download the published OpenAPI JSON from https://deepphe.github.io/dphe-data-api/openapi.json, or run the API and open http://localhost:3333/docs.

Generated content

Do not edit this page directly. Update the OpenAPI comments in src/routes/ and rerun npm run docs:prepare.

DeepPhe

GET /v1/deepphe-api/deepphe/attributes/classes

Get all unique attribute classes

Returns list of unique attribute class names

Responses

StatusDescription
200List of attribute class names
500Internal server error

GET /v1/deepphe-api/deepphe/attributes/instances

Get all attribute instances for a specific class

Returns list of attribute objects for a specific class (without patient identifier arrays)

Parameters

NameInRequiredTypeDescription
groupnamequeryyesstringGroup name

Responses

StatusDescription
200List of attributes
400Missing required parameters
404No attributes found for this class
500Internal server error

GET /v1/deepphe-api/deepphe/attributes/instances/patient/{patientId}

Get attribute instances for a specific class and patient

Returns attribute rows where the specified patient appears

Parameters

NameInRequiredTypeDescription
patientIdpathyesstringPatient ID
groupnamequeryyesstringGroup name

Responses

StatusDescription
200List of matching attributes
400Missing required parameters
404No attributes found for this class and patient
500Internal server error

GET /v1/deepphe-api/deepphe/attributes/instances/patients

Get all attribute instances for a specific class including patient identifiers

Returns list of attribute objects for a specific class with patient identifier arrays

Parameters

NameInRequiredTypeDescription
groupnamequeryyesstringGroup name

Responses

StatusDescription
200List of attributes with patient identifier arrays
400Missing required parameters
404No attributes found for this class
500Internal server error

GET /v1/deepphe-api/deepphe/attributes/summary

Get all attribute classes and instances in one response

Returns attribute classes with instances grouped by class, with optional patient identifier data

Parameters

NameInRequiredTypeDescription
includePatientIdsquerynobooleanWhen false, omit patient identifier arrays from instance rows

Responses

StatusDescription
200Attribute summary payload
500Internal server error

GET /v1/deepphe-api/deepphe/cancers/classes

Get all unique cancer classes

Returns list of unique cancer class classUri values

Responses

StatusDescription
200List of cancer class classUri values
500Internal server error

GET /v1/deepphe-api/deepphe/cancers/instances

Get all cancer instances for a specific class

Returns list of cancer objects for a specific class (without patient identifier arrays)

Parameters

NameInRequiredTypeDescription
classUriqueryyesstringClass URI

Responses

StatusDescription
200List of cancers
400Missing required parameters
404No cancers found for this class
500Internal server error

GET /v1/deepphe-api/deepphe/cancers/instances/patient/{patientId}

Get cancer instances for a specific class and patient

Returns cancer rows where the specified patient appears

Parameters

NameInRequiredTypeDescription
patientIdpathyesstringPatient ID
classUriqueryyesstringClass URI

Responses

StatusDescription
200List of matching cancers
400Missing required parameters
404No cancers found for this class and patient
500Internal server error

GET /v1/deepphe-api/deepphe/cancers/instances/patients

Get all cancer instances for a specific class including patient identifiers

Returns list of cancer objects for a specific class with patient identifier arrays

Parameters

NameInRequiredTypeDescription
classUriqueryyesstringClass URI

Responses

StatusDescription
200List of cancers with patient identifier arrays
400Missing required parameters
404No cancers found for this class
500Internal server error

GET /v1/deepphe-api/deepphe/cancers/summary

Get all cancer classes and instances in one response

Returns cancer classes with instances grouped by class, with optional patient identifier data

Parameters

NameInRequiredTypeDescription
includePatientIdsquerynobooleanWhen false, omit patient identifier arrays from instance rows

Responses

StatusDescription
200Cancer summary payload
500Internal server error

GET /v1/deepphe-api/deepphe/concepts/classes

Get all unique concept classes

Returns list of unique concept class dpheGroup values

Responses

StatusDescription
200List of concept class dpheGroup values
500Internal server error

GET /v1/deepphe-api/deepphe/concepts/instances

Get all concept instances for a specific class

Returns list of concept objects for a specific class (without patient identifier arrays)

Parameters

NameInRequiredTypeDescription
dpheGroupqueryyesstringDPHE Group

Responses

StatusDescription
200List of concepts
400Missing required parameters
404No concepts found for this class
500Internal server error

GET /v1/deepphe-api/deepphe/concepts/instances/patient/{patientId}

Get concept instances for a specific class and patient

Returns concept rows where the specified patient appears

Parameters

NameInRequiredTypeDescription
patientIdpathyesstringPatient ID
dpheGroupqueryyesstringDPHE Group

Responses

StatusDescription
200List of matching concepts
400Missing required parameters
404No concepts found for this class and patient
500Internal server error

GET /v1/deepphe-api/deepphe/concepts/instances/patients

Get all concept instances for a specific class including patient identifiers

Returns list of concept objects for a specific class with patient identifier arrays

Parameters

NameInRequiredTypeDescription
dpheGroupqueryyesstringDPHE Group

Responses

StatusDescription
200List of concepts with patient identifier arrays
400Missing required parameters
404No concepts found for this class
500Internal server error

GET /v1/deepphe-api/deepphe/concepts/summary

Get all concept classes and instances in one response

Returns concept classes with instances grouped by class, with optional patient identifier data

Parameters

NameInRequiredTypeDescription
includePatientIdsquerynobooleanWhen false, omit patient identifier arrays from instance rows

Responses

StatusDescription
200Concept summary payload
500Internal server error

GET /v1/deepphe-api/deepphe/patient/{patientId}

Get patient documents with text excluded by default

Returns list of DocumentXn objects for a specific patient, with the text field excluded.

Parameters

NameInRequiredTypeDescription
patientIdpathyesstringPatient ID

Responses

StatusDescription
200List of DocumentXn objects without text
400Missing or invalid patientId
404Patient not found

GET /v1/deepphe-api/deepphe/patient/{patientId}/cancers

Get the cancers file for a patient

Returns the raw parsed JSON from the {patientId}_Cancers.json key-value entry in the database.

Parameters

NameInRequiredTypeDescription
patientIdpathyesstringPatient ID

Responses

StatusDescription
200Cancers data for the patient
400Missing patientId
404Cancers file not found for this patient
500Internal server error

GET /v1/deepphe-api/deepphe/patient/{patientId}/concepts

Get the concepts file for a patient

Returns the raw parsed JSON from the {patientId}_Concepts.json key-value entry in the database.

Parameters

NameInRequiredTypeDescription
patientIdpathyesstringPatient ID

Responses

StatusDescription
200Concepts data for the patient
400Missing patientId
404Concepts file not found for this patient
500Internal server error

GET /v1/deepphe-api/deepphe/patient/{patientId}/documents

Get all documents for a patient

Returns list of all DocumentXn objects for a specific patient with optional property exclusions.

Parameters

NameInRequiredTypeDescription
patientIdpathyesstringPatient ID
documentIdsquerynostringComma-separated list of document IDs to filter by. Only documents matching these IDs will be returned.
excludePropertiesquerynostringComma-separated list of DocumentXn properties to exclude from results (e.g., "mentions,mentionRelations,sections"). Valid properties: id, name, type, date, episode, text, mentions, mentionRelations, sections

Responses

StatusDescription
200List of DocumentXn objects with all properties
400Missing or invalid patientId
404Patient not found

GET /v1/deepphe-api/deepphe/patient/{patientId}/documents/episodes

Get episode counts for patient documents

Returns an object keyed by normalized episode type with counts for the patient's documents.

Parameters

NameInRequiredTypeDescription
patientIdpathyesstringPatient ID
documentIdsquerynostringOptional comma-separated list of document IDs to include in the count.

Responses

StatusDescription
200Episode counts keyed by episode type
400Missing or invalid patientId
500Internal server error

Filter

POST /v1/deepphe-api/deepphe/filter/count

Count patients matching multi-criteria filters

Accepts an array of filter items. Each item specifies a data type
(omop, attributes, cancers, concepts), a class within that type,
and one or more instance values.
Within an item the instances are OR'd: a patient matches if they
have any of the listed values.
Across items the results are AND'd: a patient must satisfy
every filter item.
Timing metrics are always returned so callers can monitor performance.

Parameters

NameInRequiredTypeDescription
includePatientIdsquerynobooleanWhen true, also return the list of matching patient IDs
autoIncludeThresholdquerynointegerAutomatically include patient IDs when the matching count is
below this threshold, even when includePatientIds is false.
Set to 0 to disable auto-inclusion.

Request body: required (application/json)

Responses

StatusDescription
200Patient count with timing metrics
400Validation error
500Internal server error

POST /v1/deepphe-api/deepphe/filter/count/batch

Batch count patients for multiple independent filter queries

Accepts an array of independent filter queries and returns a result for
each in positional order. All queries are executed concurrently on the
server, replacing N sequential HTTP round trips with a single request.
Each query uses the same filter schema as POST /count. Per-query errors
are captured and returned inline rather than failing the entire batch.

Request body: required (application/json)

Responses

StatusDescription
200Array of per-query results in positional order
400Validation error
500Internal server error

POST /v1/deepphe-api/deepphe/filter/summary

Get patient summaries for a list of patient IDs

Accepts a set of patient IDs and returns matching patient summaries
from patient_summaries with uncompressed json_text payloads.

Request body: required (application/json)

Responses

StatusDescription
200List of patient summaries with uncompressed json_text
400Validation error
500Internal server error

OMOP

GET /v1/deepphe-api/omop/classes

Get all supported OMOP classes

Returns list of OMOP class names available for OMOP instances queries

Responses

StatusDescription
200List of OMOP class names
500Internal server error

GET /v1/deepphe-api/omop/instances

Get all OMOP instances for a specific class

Returns OMOP rows from one of the OMOP tables by class (without patient identifier arrays)

Parameters

NameInRequiredTypeDescription
attributequeryyes`AGE_AT_DXETHNICITY

Responses

StatusDescription
200OMOP class rows
400Missing or invalid required parameters
404No OMOP rows found for this class
500Internal server error

GET /v1/deepphe-api/omop/instances/patient/{patientId}

Get OMOP instances for a specific class and patient

Returns OMOP rows where the specified patient appears

Parameters

NameInRequiredTypeDescription
patientIdpathyesstringPatient ID
attributequeryyes`AGE_AT_DXETHNICITY

Responses

StatusDescription
200Matching OMOP class rows for the patient
400Missing or invalid required parameters
404No OMOP rows found for this class and patient
500Internal server error

GET /v1/deepphe-api/omop/instances/patients

Get all OMOP instances for a specific class including patient identifiers

Returns OMOP rows from one of the OMOP tables by class with patient identifier arrays

Parameters

NameInRequiredTypeDescription
attributequeryyes`AGE_AT_DXETHNICITY

Responses

StatusDescription
200OMOP class rows with patient identifier arrays
400Missing or invalid required parameters
404No OMOP rows found for this class
500Internal server error

GET /v1/deepphe-api/omop/summary

Get all OMOP classes and instances in one response

Returns OMOP classes with instances grouped by class, with optional patient identifier data

Parameters

NameInRequiredTypeDescription
includePatientIdsquerynobooleanWhen false, omit patient identifier arrays from instance rows

Responses

StatusDescription
200OMOP summary payload
500Internal server error