Documentation / Under the hood

How profiling and rules run

SQL over JSON, samples, rule evaluation, drift.

  1. A job lists the resource types and a sample size. Types are processed one at a time; progress is polled by the page.
  2. For each type the current satellite JSON is flattened into element paths (arrays become name[]). The counts, distinct values, patterns (digits become 9, letters a/A), lengths, numeric statistics and top values are computed with SQL aggregates.
  3. Built-in and custom rules are compiled to SQL jsonb_path expressions and evaluated per resource: passed, failed or not applicable. Uniqueness rules compute a key per resource and count resources sharing a key.
  4. Integrity compares the link tables with the hubs and current satellites.
  5. Results are stored in the profiler schema. A snapshot copies them under a name for comparison.

Rules from a profile. The Profiler reads the StructureDefinition (snapshot, otherwise differential), looks up value sets and code systems in the loaded artifacts only, and maps constraints to the same rule kinds as hand-made rules (see Quality rules). From simplifier.net it uses the FHIR® package-registry protocol (download of the .tgz of the configured package only) and unpacks it in memory; nothing is stored except the rules you create and the ValueSets and CodeSystems you load from hl7.org (written to the vault with the standard loader procedure load_fhir_resource, so they get hub, satellite and reference links like any other resource), which keep the profile, element and constraint they came from.

CarefulA sample describes only the sampled resources; the percentages are estimates for the whole type. Use All resources for exact numbers.