{
"description": "The SQLView profile represents a reusable, named SQL query that other queries\\nreference as a virtual table source, analogous to a SQL view. It bundles the\\nSQL and its dependencies for sharing and versioning. Unlike SQLQuery, an\\nSQLView cannot declare parameters.",
"_filename": "StructureDefinition-SQLView.json",
"package_name": "io.health-samurai.core.r4",
"date": "2026-06-16T00:00:00+00:00",
"derivation": "constraint",
"publisher": "Health Samurai",
"fhirVersion": "4.0.1",
"jurisdiction": [ {
"coding": [ {
"code": "001",
"system": "http://unstats.un.org/unsd/methods/m49/m49.htm",
"display": "World"
} ]
} ],
"name": "SQLView",
"mapping": [ {
"uri": "http://hl7.org/fhir/fivews",
"name": "FiveWs Pattern Mapping",
"identity": "w5"
}, {
"uri": "http://hl7.org/v3",
"name": "RIM Mapping",
"identity": "rim"
}, {
"uri": "http://hl7.org/fhir/object-implementation",
"name": "Object Implementation Information",
"identity": "objimpl"
} ],
"abstract": false,
"type": "Library",
"experimental": null,
"resourceType": "StructureDefinition",
"title": "SQL View Library",
"package_version": "0.2606.2",
"extension": [ {
"url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-implements",
"valueUri": "http://hl7.org/fhir/StructureDefinition/MetadataResource"
} ],
"status": "draft",
"id": "884dec9c-798a-46cf-acca-ed193d2809d9",
"kind": "resource",
"url": "https://sql-on-fhir.org/ig/StructureDefinition/SQLView",
"version": "0.2606.2",
"differential": {
"element": [ {
"id": "Library",
"path": "Library",
"constraint": [ {
"key": "sql-must-be-sql-expressions",
"human": "The content of the Library must be SQL expressions.",
"source": "https://sql-on-fhir.org/ig/StructureDefinition/SQLView",
"severity": "error",
"expression": "content.all(contentType.startsWith('application/sql'))"
} ]
}, {
"id": "Library.type",
"path": "Library.type",
"patternCodeableConcept": {
"coding": [ {
"code": "sql-view",
"system": "https://sql-on-fhir.org/ig/CodeSystem/LibraryTypesCodes"
} ]
}
}, {
"id": "Library.parameter",
"max": "0",
"path": "Library.parameter",
"short": "Not permitted (views cannot be parameterised)"
}, {
"id": "Library.relatedArtifact",
"path": "Library.relatedArtifact",
"mustSupport": true
}, {
"id": "Library.relatedArtifact.type",
"path": "Library.relatedArtifact.type",
"short": "depends-on for ViewDefinition or SQLView references",
"mustSupport": true
}, {
"id": "Library.relatedArtifact.label",
"min": 1,
"path": "Library.relatedArtifact.label",
"short": "Table name used in SQL view",
"constraint": [ {
"key": "sql-name",
"human": "Name is limited to letters, numbers, or underscores and cannot start with an\nunderscore -- i.e. with a regular expression of: ^[A-Za-z][A-Za-z0-9_]*$ \n\n\nThis makes it usable as table names in a wide variety of databases.",
"source": "https://sql-on-fhir.org/ig/StructureDefinition/SQLView",
"severity": "error",
"expression": "empty() or matches('^[A-Za-z][A-Za-z0-9_]*$')"
} ],
"mustSupport": true
}, {
"id": "Library.relatedArtifact.resource",
"min": 1,
"path": "Library.relatedArtifact.resource",
"type": [ {
"code": "canonical",
"targetProfile": [ "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition", "https://sql-on-fhir.org/ig/StructureDefinition/SQLView" ]
} ],
"short": "Canonical URL of a ViewDefinition or SQLView",
"mustSupport": true
}, {
"id": "Library.content",
"min": 1,
"path": "Library.content",
"mustSupport": true
}, {
"id": "Library.content.extension:sqlText",
"max": "1",
"min": 0,
"path": "Library.content.extension",
"type": [ {
"code": "Extension",
"profile": [ "https://sql-on-fhir.org/ig/StructureDefinition/sql-text" ]
} ],
"short": "Plain-text SQL for readability",
"sliceName": "sqlText",
"mustSupport": true
}, {
"id": "Library.content.contentType",
"min": 1,
"path": "Library.content.contentType",
"short": "application/sql or application/sql;dialect=...",
"binding": {
"strength": "example",
"valueSet": "https://sql-on-fhir.org/ig/ValueSet/AllSQLContentTypeCodes"
},
"mustSupport": true
}, {
"id": "Library.content.data",
"min": 1,
"path": "Library.content.data",
"short": "SQL view (base64-encoded)",
"mustSupport": true
} ]
},
"contact": [ {
"name": "SQL on FHIR Working Group",
"telecom": [ {
"value": "https://sql-on-fhir.org",
"system": "url"
} ]
} ],
"baseDefinition": "http://hl7.org/fhir/StructureDefinition/Library"
}