Verisyntax — User Manual (prototype 0.1)

Recipe: aggregated health data

The included <example-project> project is a synthetic, non-diagnostic teaching example inspired by the contact-oriented structure described by the Danish Health Data Authority for the National Patient Register. It is not an official extract and contains no real patients, hospital counts, or organization names.

Its grain is one aggregated row per period + hospital_code + diagnosis_group + age_group + sex. contacts is a contact count—not unique patients, disease risk, prevalence, or quality. There are no personal identifiers, clinical notes, or individual diagnoses.

database health:
  engine sqlite
  path "health_contacts.sqlite"

source hospital_contacts:
  database health
  table "hospital_contacts"
  column row_id: integer
  column period: text
  column hospital_code: text
  column diagnosis_group: text
  column age_group: text
  column sex: text
  column contacts: integer
  primary_key row_id
  provenance row

source hospitals:
  database health
  table "hospitals"
  column hospital_code: text
  column hospital_name: text
  column region: text
  primary_key hospital_code
  provenance row

dataset respiratory_contacts:
  from hospital_contacts as contact
  inner join hospitals as hospital on contact.hospital_code = hospital.hospital_code
  select contact.period as period
  select hospital.hospital_name as hospital_name
  select hospital.region as region
  select contact.age_group as age_group
  select contact.sex as sex
  select contact.contacts as contacts
  where contact.diagnosis_group = "J00-J99"
  1. Open <example-project>, click Check, and initialize database health.
  2. Import hospital_contacts.csv into hospital_contacts with create.
  3. Import hospitals.csv into hospitals with create.
  4. Select respiratory_contacts, then compile, build, and run. The result contains only the three synthetic J00-J99 rows; the I00-I99 row is filtered out.
  5. For local AI help, choose Question for local AI → Use current program and data schema and request a complete program that preserves the existing declarations and filters a declared diagnosis group. The model must not invent code meanings or clinical conclusions.

Do not compare raw contacts between regions as risk. A rate requires at least a compatible population denominator, the same period and age/sex scope, and a documented formula. Small counts, data breaks, changing registration rules, and coding practices must be assessed before publication. Use person-level register data only with the required legal basis, controlled access environment, and data protection; this example is deliberately synthetic and aggregated.