Queries

Hardcoded queries are technical debt with a timer. Every data model change breaks them, and clinical data models change constantly.

Most clinical applications embed their data queries directly in application code. When the underlying data structure evolves — a new field added, an archetype updated, a terminology code changed — those queries break silently or stop returning correct results. Fixing them means a dev sprint, a deployment, and a regression risk.

Atomik takes a different approach: queries are stored as named, versioned data services, created without writing code, discoverable via the REST API, and executable by any authorized client. When you create a query, you're publishing a data service — not embedding logic in an application.

Stored Query

Query Builder

The Query Builder in Atomik's Web Console lets you create, test, and publish queries against live data with a few clicks — no code required. It uses the template metadata already loaded into Atomik, so every condition you build is automatically constrained to valid values for that field. You can't build a query that asks for values the data model doesn't allow.

Supported query result types:

  • composition — full clinical records
  • datavalue — specific data points (e.g. all blood pressure readings for a patient)
  • ehr_status, folder, actor, party_relationship

Criteria support standard conditions ("systolic blood pressure > 140") and boolean operators (AND, OR, NOT). Results can be scoped to a single patient or run as population queries across all EHRs.

SNOMED CT Expressions — no more query maintenance hell

Hardcoding lists of clinical codes in query conditions is a trap. SNOMED CT alone has 118 distinct types of diabetes — and that list changes as the terminology evolves. A query that works today by matching a static code list will miss new subtypes added next year, with no error, no warning, and no way to know results are incomplete.

Atomik query criteria support SNOMED CT expressions as semantic filters. Instead of listing 118 codes, you write one expression:

<< 73211009 | Diabetes mellitus (disorder) |

This expression is resolved at runtime against the live SNOMED CT hierarchy — returning every current subtype automatically. New subtypes added to the terminology are picked up without touching the query. The code list maintains itself.

The same applies to any coded clinical concept: diagnoses, procedures, medications, findings. Write the expression once; let the terminology do the maintenance.

Query management

Queries in Atomik can be created, tested, modified, and organized into Query Groups from the Web Console. Once published, they're available via REST API for any authorized external application to discover and execute — turning your clinical data store into a set of well-defined, reusable data services.

Query List with Groups