Skip to main content

Insights Filters

At a broad level, the insights query box works as a SQL-like WHERE clause. In this brief documentation, we will first demonstrate some generic examples, then provide a list of resources that can be used in the query. For a simple example, we can start with the following query which retrieves patients who are older than the age of 50:

patient.demographics.age > 50

If you wanted to supply a simple AND predicate, you can do the following:

patient.demographics.gender = 'male' AND
patient.conditions.code = 'ab123' AND
patient.conditions.system = 'system_here'

We currently support AND, OR, and XOR. Note that joins are all handled by the DSL-engine and do not need to be explicitly stated in the request. For an example of a more complex query, we can do the following:

patient.demographics.age > 40 AND patient.demographics.ethnicity = 'white' AND
(variant.gnosis.clinical_significance = 'Pathogenic' OR
variant.gnosis.clinvar_allele_id = 'abc' OR
(patient.demographics.is_deceased = false AND
patient.demographics.gender = 'female')
)

In order to use a RANGE operator, you can do the following:

variant.gnosis.gene = 'TTN' AND
variant.gnosis.population_allelic_frequency BETWEEN 0, 50

For a common XOR example, we can do the following to find individuals who have never had a condition:

(patient.conditions.code = '1671000' AND
patient.conditions.system = 'http://snomed.info/sct')
XOR patient.all = true

Note, that patient.all = true returns all patient values, which allows this query to find the difference.

In the last example, we can find all patients that died after April 14th 2000:

patient.demographics.deceased > '2000/04/14'

Finally, we can see all of the current items that are supported by the analytics DSL engine below.

Operator Support

  • Equals => item_a = item_b
  • Not equals => item_a != item_b
  • Greater than => item_a > item_b
  • Greater than or Equals => item_a >= item_b
  • Less than => item_a < item_b
  • Less than or equal to => item_a <= item_b
  • Item in => item_a IN 'a', 'b', 'c'
  • Range => item_a BETWEEN 0, 100

Patient Resources

Demographics

  • patient.demographics.age (Integer)
  • patient.demographics.birth_date (Date)
  • patient.demographics.deceased (Date)
  • patient.demographics.is_deceased (boolean)
  • patient.demographics.gender (String)
  • patient.demographics.race (String)
  • patient.demographics.ethnicity (String)
  • patient.demographics.language (String)
  • patient.demographics.marital_status (String)

Conditions

  • patient.conditions.system (String)
  • patient.conditions.code (String)
  • patient.conditions.clinical_status (String)
  • patient.conditions.verification_status (String)
  • patient.conditions.asserted_date (Date)
  • patient.conditions.onset (Date)
  • patient.conditions.asserted_age (Integer)
  • patient.conditions.stage (String)
  • patient.conditions.body_site (String)

Observations

  • patient.observations.system (String)
  • patient.observations.code (String)
  • patient.observations.effective_datetime (Date)
  • patient.observations.effective_age (Integer)

Medications

  • patient.medications.system (String)
  • patient.medications.code (String)
  • patient.medications.effective_period_end (Date)
  • patient.medications.effective_period_start (Date)
  • patient.medications.effective_datetime (Date)
  • patient.medications.effective_age_end (Integer)
  • patient.medications.effective_age_start (Integer)
  • patient.medications.effective_age (Integer)
  • patient.medications.taken (String)

Procedures

  • patient.procedures.system (String)
  • patient.procedures.code (String)
  • patient.procedures.status (String)
  • patient.procedures.performed_datetime (Date)
  • patient.procedures.performed_start (Date)
  • patient.procedures.performed_end (Date)
  • patient.procedures.age (Integer)

Predictions

  • patient.predictions.model_id (String)
  • patient.predictions.effective_datetime (Date)
  • patient.predictions.prediction (Number)

Patients

  • patient.patients (String)
  • patient.samples (String)
  • patient.all (Boolean)

Variants

Knowledge

  • variant.gnosis.chromosome (String)
  • variant.gnosis.position (Number)
  • variant.gnosis.minimum_allele_frequency (Number)
  • variant.gnosis.maximum_allele_frequency (Number)
  • variant.gnosis.population_allele_frequency (Number)
  • variant.gnosis.rs_id (String)
  • variant.gnosis.id (String)
  • variant.gnosis.clinvar_allele_id (String)
  • variant.gnosis.clinical_disease (String)
  • variant.gnosis.clinical_review (String)
  • variant.gnosis.clinical_significance (String)
  • variant.gnosis.cosmic_id (String)
  • variant.gnosis.mutation_status (String)
  • variant.gnosis.histology (String)
  • variant.gnosis.tumor_site (String)
  • variant.gnosis.ebcanon_class (String)
  • variant.gnosis.ebcanon_group (String)
  • variant.gnosis.gene (String)
  • variant.gnosis.impact (String)
  • variant.gnosis.transcript_id (String)
  • variant.gnosis.biotype (String)
  • variant.gnosis.amino_acid_change (String)
  • variant.gnosis.cosmic_sample_count (Number)

Gene Expression

  • gene.samples (String)
  • gene.genes (String)