FHIR © HL7.org  |  FHIRsmith 4.0.1  |  Server Home  |  XIG Home  |  XIG Stats  | 

FHIR IG analytics

Packageio.health-samurai.core.r4b
Resource TypeStructureDefinition
IdStructureDefinition-SQLQuery.json
FHIR VersionR4B

Resources that use this resource

No resources found


Resources that this resource uses

No resources found


Narrative

No narrative content found in resource


Source1

{
  "description": "The SQLQuery profile represents a SQL query that runs against ViewDefinition\ntables. It bundles the SQL, dependencies, and parameters for sharing and\nversioning.",
  "date": "2026-03-31T14:17:59+00:00",
  "derivation": "constraint",
  "publisher": "Health Samurai",
  "fhirVersion": "4.3.0",
  "jurisdiction": [
    {
      "coding": [
        {
          "system": "http://unstats.un.org/unsd/methods/m49/m49.htm",
          "code": "001",
          "display": "World"
        }
      ]
    }
  ],
  "name": "SQLQuery",
  "mapping": [
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "objimpl",
      "uri": "http://hl7.org/fhir/object-implementation",
      "name": "Object Implementation Information"
    }
  ],
  "abstract": false,
  "type": "Library",
  "resourceType": "StructureDefinition",
  "title": "SQL Query Library",
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-implements",
      "valueUri": "http://hl7.org/fhir/StructureDefinition/MetadataResource"
    }
  ],
  "status": "draft",
  "id": "SQLQuery",
  "kind": "resource",
  "url": "https://sql-on-fhir.org/ig/StructureDefinition/SQLQuery",
  "version": "0.2606.2",
  "differential": {
    "element": [
      {
        "id": "Library",
        "path": "Library",
        "constraint": [
          {
            "key": "sql-must-be-sql-expressions",
            "severity": "error",
            "human": "The content of the Library must be SQL expressions.",
            "expression": "content.all(contentType.startsWith('application/sql'))",
            "source": "https://sql-on-fhir.org/ig/StructureDefinition/SQLQuery"
          }
        ]
      },
      {
        "id": "Library.type",
        "path": "Library.type",
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "https://sql-on-fhir.org/ig/CodeSystem/LibraryTypesCodes",
              "code": "sql-query"
            }
          ]
        }
      },
      {
        "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",
        "path": "Library.relatedArtifact.label",
        "short": "Table name used in SQL query",
        "min": 1,
        "constraint": [
          {
            "key": "sql-name",
            "severity": "error",
            "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.",
            "expression": "empty() or matches('^[A-Za-z][A-Za-z0-9_]*[%content%]#39;)",
            "source": "https://sql-on-fhir.org/ig/StructureDefinition/SQLQuery"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Library.relatedArtifact.resource",
        "path": "Library.relatedArtifact.resource",
        "short": "Canonical URL of a ViewDefinition or SQLView",
        "min": 1,
        "type": [
          {
            "code": "canonical",
            "targetProfile": [
              "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition",
              "https://sql-on-fhir.org/ig/StructureDefinition/SQLQuery",
              "https://sql-on-fhir.org/ig/StructureDefinition/SQLView"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Library.parameter",
        "path": "Library.parameter",
        "mustSupport": true
      },
      {
        "id": "Library.parameter.name",
        "path": "Library.parameter.name",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Library.parameter.use",
        "path": "Library.parameter.use",
        "short": "in (query parameters are always input)",
        "mustSupport": true
      },
      {
        "id": "Library.parameter.type",
        "path": "Library.parameter.type",
        "mustSupport": true
      },
      {
        "id": "Library.content",
        "path": "Library.content",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Library.content.extension:sqlText",
        "path": "Library.content.extension",
        "sliceName": "sqlText",
        "short": "Plain-text SQL for readability",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://sql-on-fhir.org/ig/StructureDefinition/sql-text"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Library.content.contentType",
        "path": "Library.content.contentType",
        "short": "application/sql or application/sql;dialect=...",
        "min": 1,
        "mustSupport": true,
        "binding": {
          "strength": "example",
          "valueSet": "https://sql-on-fhir.org/ig/ValueSet/AllSQLContentTypeCodes"
        }
      },
      {
        "id": "Library.content.data",
        "path": "Library.content.data",
        "short": "SQL query (base64-encoded)",
        "min": 1,
        "mustSupport": true
      }
    ]
  },
  "contact": [
    {
      "name": "SQL on FHIR Working Group",
      "telecom": [
        {
          "system": "url",
          "value": "https://sql-on-fhir.org"
        }
      ]
    }
  ],
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Library"
}