Skip to main content

helios_sof/
canonical.rs

1//! Canonical URLs published by the SQL on FHIR implementation guide.
2//!
3//! Edition 3 (`3.0.0-ballot`) moved the guide to HL7 stewardship, and a change
4//! of stewardship reissues every canonical URL it publishes. The base changed
5//! from `https://sql-on-fhir.org/ig` to [`IG_CANONICAL_BASE`], and the package
6//! identifier from `org.sql-on-fhir.ig` to `hl7.fhir.uv.sql-on-fhir`.
7//!
8//! ViewDefinition is the one exception. It became an *additional resource*
9//! rather than a logical model, so it carries a canonical in the **core FHIR**
10//! namespace ([`VIEW_DEFINITION_STRUCTURE_DEFINITION`]) following the
11//! convention for a resource incubated outside core — not one under this
12//! guide's base.
13//!
14//! The 2.0.0-era URLs are kept alongside as `LEGACY_*` so resources authored
15//! against the previous release still parse. Version 2.0.0 remains published at
16//! its original canonical, and the two releases install side by side, so a
17//! reader accepting both is correct against either.
18
19/// Canonical base for every artifact this guide publishes, except
20/// ViewDefinition itself.
21pub const IG_CANONICAL_BASE: &str = "http://hl7.org/fhir/uv/sql-on-fhir";
22
23/// Canonical base used by version 2.0.0 and the pre-ballot continuous build.
24pub const LEGACY_IG_CANONICAL_BASE: &str = "https://sql-on-fhir.org/ig";
25
26/// FHIR package identifier for the guide.
27pub const IG_PACKAGE_ID: &str = "hl7.fhir.uv.sql-on-fhir";
28
29/// ViewDefinition's StructureDefinition, in the core FHIR namespace because it
30/// is an additional resource rather than an artifact of this guide.
31pub const VIEW_DEFINITION_STRUCTURE_DEFINITION: &str =
32    "http://hl7.org/fhir/StructureDefinition/ViewDefinition";
33
34/// ViewDefinition's 2.0.0 canonical, when it was a logical model. Instances
35/// authored against 2.0.0 carried this string in `resourceType`; 3.0.0
36/// instances carry the plain `ViewDefinition` token instead.
37pub const LEGACY_VIEW_DEFINITION_STRUCTURE_DEFINITION: &str =
38    "https://sql-on-fhir.org/ig/StructureDefinition/ViewDefinition";
39
40/// `Library.type.coding.system` fixed by the SQLQuery and SQLView profiles.
41pub const LIBRARY_TYPES_CODE_SYSTEM: &str =
42    "http://hl7.org/fhir/uv/sql-on-fhir/CodeSystem/LibraryTypesCodes";
43
44/// Pre-ballot `LibraryTypesCodes` system. Accepted on read for back-compat.
45pub const LEGACY_LIBRARY_TYPES_CODE_SYSTEM: &str =
46    "https://sql-on-fhir.org/ig/CodeSystem/LibraryTypesCodes";
47
48/// The `sql-text` extension carrying plain-text SQL alongside the base64
49/// `Attachment.data`.
50pub const SQL_TEXT_EXTENSION: &str =
51    "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/sql-text";
52
53/// Output formats bound by `$sql-run` (`csv`, `ndjson`, `parquet`, `json`,
54/// `fhir`).
55pub const OUTPUT_FORMAT_VALUE_SET: &str =
56    "http://hl7.org/fhir/uv/sql-on-fhir/ValueSet/OutputFormatCodes";
57
58/// Output formats bound by `$sql-export`. Narrower than
59/// [`OUTPUT_FORMAT_VALUE_SET`]: it omits `fhir`, which only a run can produce.
60pub const EXPORT_OUTPUT_FORMAT_VALUE_SET: &str =
61    "http://hl7.org/fhir/uv/sql-on-fhir/ValueSet/ExportOutputFormatCodes";
62
63/// States an asynchronous export passes through.
64pub const EXPORT_STATUS_VALUE_SET: &str =
65    "http://hl7.org/fhir/uv/sql-on-fhir/ValueSet/ExportStatusCodes";
66
67/// `$sql-run` — synchronous evaluation of a single subject.
68pub const SQL_RUN_OPERATION_DEFINITION: &str =
69    "http://hl7.org/fhir/uv/sql-on-fhir/OperationDefinition/SQLRun";
70
71/// `$sql-export` — asynchronous export of one or more subjects as a single job.
72pub const SQL_EXPORT_OPERATION_DEFINITION: &str =
73    "http://hl7.org/fhir/uv/sql-on-fhir/OperationDefinition/SQLExport";
74
75/// The SQLQuery profile on `Library`.
76pub const SQL_QUERY_PROFILE: &str =
77    "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/SQLQuery";
78
79/// The SQLView profile on `Library`.
80pub const SQL_VIEW_PROFILE: &str = "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/SQLView";