Conformance specs
A conformance spec says what your interface actually requires, in a form that passes or fails a message rather than describing it in prose. It reads like a document, behaves like a test suite, and is one YAML file.
What a spec is
Base HL7v2 says PID-3 is an identifier. It does not say that yours must carry an MRN from a particular assigning authority, that PV1-2 is only ever I or O, or that a missing PID-5 is the bug that pages someone at 2am. That knowledge usually lives in a PDF nobody opens and in the heads of two people.
A spec is that knowledge written as rules a machine can apply. Every rule has a location, a constraint, and - if you write one - a rationale saying why it exists, which is the part a PDF is actually bad at keeping.
Create one
Go to /specs and pick New spec. You can start blank, or infer one from messages you already have. The second is usually the right call: point it at a folder, a zip, or a single file holding thousands, and it reads what your interface actually does rather than what the standard permits.
What inference gives you that a blank page cannot:
The five views
Rules
A rule targets a segment, a field, or a component within a field, and applies one constraint. The common ones:
MSH-9 equals ADT means "this is an ADT message" without addressing MSH-9.1. When the position matters, target the component explicitly.Examples as regression tests
In Studio, save a message against the spec and mark what you expect: a production sample should pass, a counter-example should fail. Both are stored in the spec and re-evaluated every time it changes.
This is the part that makes a spec hold up over time. A rule you tighten six months from now will tell you immediately if it breaks a message you already agreed was valid - which is exactly the failure a prose document cannot catch.
Draft and production
A spec has a draft you are editing and, once you publish, a production version. They are separate on purpose: anything enforcing your spec - CI, the validation API, a Bridge agent - always evaluates the production version, so editing a rule cannot change what a vendor is being held to until you decide it should.
Publish from the Publish view. You give the release a version and optional release notes, and that snapshot becomes what the outside world sees.
Versions and revisions
Every publish is kept. You can see the history, read what changed, and restore an earlier revision if a release turns out to be wrong. Share portals expose a version history tab so the vendor on the other end can see the same thing.
Callers can pin a version rather than tracking production - append @1.2.3 to the spec slug in the CLI, pass ?version=1.2.3 to the validation API, or set version on a Bridge listener. That is how you hold a vendor to the spec you both agreed to while you keep working on the next one.
Enforcing a spec
The YAML file
A spec is one file. Export it from the Publish view, keep it in your repository next to the interface it describes, and review changes to it in a pull request like any other code. Import brings a file back in.
# Sketch of the shape - the Source view shows the real thing
slug: adt-strict
name: ADT inbound (strict)
version: 1.2.0
messageTypes:
- ADT
rules:
- id: pid-5-required
selector: { kind: field, segment: PID, field: 5 }
constraint: { kind: required }
rationale: >
Downstream registration rejects a patient with no name, and the
rejection is silent, so we catch it here instead.
examples:
- name: Standard admit
expect: pass
raw: "MSH|^~\\&|..."Limits
Authoring and testing a spec in the browser is free and unmetered. What the plans govern is saving them, sharing them, and validating against them from outside the browser. See pricing.