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 + contact_type. The 14 rows cover two periods, three synthetic hospitals, and both final and provisional reporting status. 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 contact_type: text
  column reporting_status: 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
  column hospital_type: text
  column ownership: 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 hospital.hospital_type as hospital_type
  select contact.diagnosis_group as diagnosis_group
  select contact.age_group as age_group
  select contact.sex as sex
  select contact.contact_type as contact_type
  select contact.reporting_status as reporting_status
  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 the 11 synthetic J00-J99 rows with period, age/sex group, contact type, and reporting status; the I00-I99 and C00-D49 rows are filtered out.
  5. For local AI help, choose Question for local AI, then use Suggest a Request… or Add project facts, code & schema to Request. 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 or quality. A rate requires at least a compatible population denominator, the same period, age/sex and contact-type scope, and a documented formula. Provisional values may be revised; small counts, data breaks, changing registration rules, organization changes, 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.