From a hospital's file to records.
The Bridge turns a hospital’s file into records in the pod. Each file format has an adapter, which describes the format as data, with no code. An engine runs the adapter. One specification keeps every adapter and engine compatible.
An example
One allergy, in and out.
Meridian sends Alex’s penicillin allergy as FHIR. The FHIR R4 adapter turns it into two small records in her pod: the record itself, and the version of it Meridian sent.
In: Meridian’s FHIR
{
"resourceType": "AllergyIntolerance",
"code": {
"coding": [
{
"system": "http://www.nlm.nih.gov/research/umls/rxnorm",
"code": "7980",
"display": "Penicillin G"
}
],
"text": "Penicillin G"
},
"patient": {
"reference": "Patient/pat-conformance-1"
},
"criticality": "high",
"id": "alg-pcn-1"
}Out: records in the pod
# The record: what it is, and Meridian's own id for it
<urn:uuid:6996…> a cascade:AllergyOrIntolerance ;
cascade:sourceRecordId "alg-pcn-1" .
# This version of it: what Meridian said, kept as sent
<ni:///sha-256;wC0O…>
prov:specializationOf <urn:uuid:6996…> ;
cascade:allergenName "Penicillin G" ;
cascade:allergenCode rxnorm:7980 ;
cascade:allergyCriticality "high" .Each line of the output comes from a rule in the adapter. This is the whole rule for criticality, two lines of SPARQL:
?resource xyz:criticality ?o . BIND (cascade:allergyCriticality AS ?p)
Every record also says who sent it (Meridian Health System), when it was retrieved, and which adapter and engine wrote it; those lines are left out above. Shortened ids end in “…”, and the prefixes are left out. This exact case, in the adapter’s tests ↗
Sources
Each source, and where its adapter stands.
| Source | Adapter | Stage | Explorer | Cases |
|---|---|---|---|---|
| FHIR R4 | cascade-bridge-adapter-fhir-r4 | In the protocol today | Explorer ↗ | Cases ↗ |
| C-CDA R2.1 | cascade-bridge-adapter-ccda | In the protocol today | Explorer ↗ | Cases ↗ |
| Apple Health readings | None yet | Planned | None yet | None yet |
| Google Health Connect | None yet | Planned | None yet | None yet |
| Wearables | None yet | Planned | None yet | None yet |
| Medical imaging | None yet | Planned | None yet | None yet |
Each source's name links its detail and its documentation on the sources page.
Add a format
A new format is a new adapter.
Copy the template
Start from the specification’s synthetic adapter, which has every required file in place.
Write the rules and the cases
A short SPARQL rule for each part of the format, like the one above, and a test case for each: an input file and the records it must produce.
Run the tests, then share it
The engine’s test command runs your cases. Open a pull request; every engine must pass your adapter’s cases.
For authors
For adapter and engine authors.
The rest of this page is the detail: how the specification keeps every adapter and engine compatible, what is built to it so far, and where each file lives.
The contract
One set of rules for adapters and engines.
FHIR R4 explorer ↗: open a source path like a folder to see what it becomes, what is not carried and why, and the test case beside each mapping.
An adapter is held to the specification by a check of its package. An engine is held to it by the specification's own cases. The two are held to each other by the adapter's test manifest, which every engine must pass on every adapter.
An adapter is data.
An adapter is a package of data for one source format, with no code in it. One file, an RO-Crate, describes every other file. Its mappings are SPARQL CONSTRUCT queries, each one saying how a part of the source becomes Cascade terms. Its cases are a test manifest: a source document, and the graph and findings it must produce. Its source accounting goes through the source path by path, and what the adapter does not carry is reported with its reason.
An engine runs any adapter.
An engine loads an adapter, lifts the source document into RDF, runs the adapter's queries over it and writes the Cascade records that result. It offers three commands: test runs an adapter's manifest and writes an EARL report, convert turns one document into a graph of records and its findings, and library runs the specification's own cases. Because the adapter holds no code, anyone can read what it does with a source, and a second engine can run the same adapter.
LimitThe specification's lift and versioning vectors are run by an engine's own tests, not by the shared check. One engine is built, so the claim that any engine runs any adapter has been shown for one engine. The specification is a draft: no compatibility is promised before Cascade Protocol v2’s first stable release.
What is built
Two adapters and one engine are built to it.
Each box links to its repository and to what is published from it. All three repositories run the checks above on every pull request and every night, each against the others' default branch: nothing pins one to a commit of another.
The sources page says what each source is and where its own documentation lives. The Standards page lists the standards the Bridge is built on and where Cascade defines its own terms.
Where to look
Where to look, by what it shows.
Each of these is a file in one of the repositories above, or a page the hub builds from their default branches. A hub page names the commit it was built from.
Show all the places to look
What an adapter maps
- One fact, three formsOne allergy as it arrives in three source files, and the one record all three become.Hub ↗
- FHIR R4, as the adapter sees itWhat a record is in FHIR R4 JSON, read from HL7's specification.GitHub ↗
- C-CDA, as the adapter sees itWhat a record is in a C-CDA document.GitHub ↗
What is not carried yet
- FHIR R4 gapsEach gap the adapter reports, in a sentence: a value it does not map, or a fact Cascade has no term for.Hub ↗
- C-CDA gapsThe same, for C-CDA.Hub ↗
- FHIR R4 source accountingEvery source path with its verdict, and the gap it names. The explorer is built from the source file.Hub ↗
- C-CDA source accountingThe same, for C-CDA.Hub ↗
- The engine's statusWhat cascade-bridge-rs has not built yet.GitHub ↗
Whether an engine passes
- The engine's testsWhat the
cascade-bridgecommand and its Node host do, written as a specification.Hub ↗ - The specification's testsEach requirement of the adapter profile and each rule of the shared check, with the test that holds it.Hub ↗
- Every test reportEach repository's report, and the same results as a file for a tool.This site
The cases themselves
- How a case is judgedEach type of test and its rule, in the specification's vocabulary.Hub ↗
- The library casesThe specification's own cases for an engine, run over its synthetic adapters.GitHub ↗
Building an adapter or an engine
- Building an adapterWhat a package holds, each requirement as one file, and a synthetic adapter to copy.GitHub ↗
- Building an engineThe lift to reproduce, the commands to offer, and the smallest engine that meets them.GitHub ↗
- CompatibilityWhich version of each repository a run uses, and the CI workflow an adapter and an engine both copy.GitHub ↗
- Engine buildsThe command for Linux and the WebAssembly package, published for every commit of the default branch.GitHub ↗