{
"description": "Export one or more ViewDefinitions, SQLQuery Libraries and SQLView Libraries as a single asynchronous job, using the FHIR Asynchronous Interaction Request Pattern.",
"_filename": "OperationDefinition-SQLExport.json",
"package_name": "hl7.fhir.uv.sql-on-fhir",
"date": "2026-08-14T02:49:31+10:00",
"system": true,
"publisher": "HL7 International / FHIR Infrastructure",
"instance": false,
"jurisdiction": [ {
"coding": [ {
"code": "001",
"system": "http://unstats.un.org/unsd/methods/m49/m49.htm",
"display": "World"
} ]
} ],
"name": "SQLExport",
"type": "false",
"experimental": null,
"resourceType": "OperationDefinition",
"title": "SQL Export",
"package_version": "3.0.0-ballot",
"extension": [ {
"url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
"valueCode": "fhir"
}, {
"url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm",
"valueInteger": 2,
"_valueInteger": {
"extension": [ {
"url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom",
"valueCanonical": "http://hl7.org/fhir/uv/sql-on-fhir/ImplementationGuide/hl7.fhir.uv.sql-on-fhir"
} ]
}
}, {
"url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
"valueCode": "trial-use",
"_valueCode": {
"extension": [ {
"url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom",
"valueCanonical": "http://hl7.org/fhir/uv/sql-on-fhir/ImplementationGuide/hl7.fhir.uv.sql-on-fhir"
} ]
}
} ],
"status": "active",
"id": "9e2cac50-8958-4ce4-9059-3ca1b915a266",
"kind": "operation",
"url": "http://hl7.org/fhir/uv/sql-on-fhir/OperationDefinition/SQLExport",
"code": "sql-export",
"identifier": [ {
"value": "urn:oid:2.16.840.1.113883.4.642.40.77.33.5",
"system": "urn:ietf:rfc:3986"
} ],
"versionAlgorithmString": "semver",
"version": "3.0.0-ballot",
"contact": [ {
"name": "HL7 International / FHIR Infrastructure",
"telecom": [ {
"value": "http://www.hl7.org/Special/committees/fiwg",
"system": "url"
} ]
} ],
"parameter": [ {
"max": "*",
"min": 1,
"use": "in",
"name": "subject",
"part": [ {
"max": "1",
"min": 0,
"use": "in",
"name": "name",
"type": "string",
"documentation": "Name for this subject's output entry in the manifest. Where it is omitted the server uses the subject's own name element, and where the subject declares none, a server-generated identifier. Output names are unique across the job."
}, {
"max": "1",
"min": 0,
"use": "in",
"name": "subjectCanonical",
"type": "canonical",
"documentation": "Canonical URL of the ViewDefinition, SQLQuery Library or SQLView Library to export, optionally with a |version suffix pinning a version. Exactly one of subjectCanonical, subjectReference and subjectResource is supplied in each repetition.",
"targetProfile": [ "http://hl7.org/fhir/StructureDefinition/ViewDefinition", "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/SQLQuery", "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/SQLView" ]
}, {
"max": "1",
"min": 0,
"use": "in",
"name": "subjectReference",
"type": "Reference",
"documentation": "Literal location of the subject to export: a relative URL on this server, or an absolute URL. Not a canonical URL; use subjectCanonical for that. Exactly one of subjectCanonical, subjectReference and subjectResource is supplied in each repetition.",
"targetProfile": [ "http://hl7.org/fhir/StructureDefinition/ViewDefinition", "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/SQLQuery", "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/SQLView" ]
}, {
"max": "1",
"min": 0,
"use": "in",
"name": "subjectResource",
"type": "CanonicalResource",
"documentation": "Inline ViewDefinition, SQLQuery Library or SQLView Library to export. Exactly one of subjectCanonical, subjectReference and subjectResource is supplied in each repetition. The declared type is CanonicalResource because ViewDefinition is a logical model rather than a FHIR resource; see Common Operation Behavior (operations-common.html#declared-type).",
"targetProfile": [ "http://hl7.org/fhir/StructureDefinition/ViewDefinition", "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/SQLQuery", "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/SQLView" ]
}, {
"max": "1",
"min": 0,
"use": "in",
"name": "parameters",
"type": "Parameters",
"documentation": "Input parameter values for this subject, bound by name to the parameters the Library declares (Library.parameter.name). Permitted only where this repetition's subject is a SQLQuery or SQLView; supplying it where the subject is a ViewDefinition is rejected with 400 Bad Request, because a ViewDefinition declares no parameters."
} ],
"documentation": "One or more artifacts to export, in any mixture of ViewDefinitions, SQLQuery Libraries and SQLView Libraries. Each repetition names a single subject and produces exactly one output entry in the manifest. A request supplying no subject is rejected with 400 Bad Request, as is a request in which two repetitions would produce the same output name."
}, {
"max": "*",
"min": 0,
"use": "in",
"name": "context",
"type": "CanonicalResource",
"documentation": "Supporting artifacts the server cannot itself resolve, supplied inline and matched by canonical URL against the dependencies in the subjects' transitive relatedArtifact graphs. Applies to the job as a whole rather than to one subject, so an artifact several subjects depend on is supplied once. Accepts inline resources only; there is no context by canonical URL, because a URL is exactly what the server has already failed to resolve. A context entry produces no output entry. See Common Operation Behavior (operations-common.html#context).",
"targetProfile": [ "http://hl7.org/fhir/StructureDefinition/ViewDefinition", "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/SQLView" ]
}, {
"max": "1",
"min": 0,
"use": "in",
"name": "clientTrackingId",
"type": "string",
"documentation": "Client-provided tracking identifier for the export job, echoed in the manifest."
}, {
"max": "1",
"min": 0,
"use": "in",
"name": "_format",
"type": "code",
"binding": {
"strength": "extensible",
"valueSet": "http://hl7.org/fhir/uv/sql-on-fhir/ValueSet/ExportOutputFormatCodes"
},
"documentation": "Output format for the exported files (csv, ndjson, parquet, json). Optional; if omitted, the server uses ndjson irrespective of Accept. Requesting fhir is rejected with 400 Bad Request, because an export produces flat files. See Common Operation Behavior (operations-common.html)."
}, {
"max": "1",
"min": 0,
"use": "in",
"name": "header",
"type": "boolean",
"documentation": "Include CSV headers (default true). Applies only when csv output is requested."
}, {
"max": "*",
"min": 0,
"use": "in",
"name": "patient",
"type": "Reference",
"documentation": "Restrict the FHIR resources feeding every subject in the job, before projection, to the supplied patient(s). Where a subject is a SQLQuery or SQLView, that means before the SQL executes. An unresolvable patient is rejected with 400 Bad Request. See Common Operation Behavior (operations-common.html#patient-filter)."
}, {
"max": "*",
"min": 0,
"use": "in",
"name": "group",
"type": "Reference",
"documentation": "Restrict the FHIR resources feeding every subject in the job, before projection, to members of the supplied group(s). Where a subject is a SQLQuery or SQLView, that means before the SQL executes. An unresolvable group is rejected with 400 Bad Request. See Common Operation Behavior (operations-common.html#group-filter)."
}, {
"max": "1",
"min": 0,
"use": "in",
"name": "_since",
"type": "instant",
"documentation": "Include only resources whose state changed after this instant. See Common Operation Behavior (operations-common.html#since-filter)."
}, {
"max": "1",
"min": 0,
"use": "in",
"name": "source",
"type": "string",
"documentation": "External data source to read from instead of the server's own data (for example a URI or bucket name). Where a subject is a SQLQuery or SQLView, this is where the ViewDefinition tables the query selects from are found."
}, {
"max": "1",
"min": 1,
"use": "out",
"name": "exportId",
"type": "string",
"documentation": "Server-generated identifier assigned to the export job."
}, {
"max": "1",
"min": 0,
"use": "out",
"name": "clientTrackingId",
"type": "string",
"documentation": "Echoed client tracking identifier when provided."
}, {
"max": "1",
"min": 1,
"use": "out",
"name": "status",
"type": "code",
"binding": {
"strength": "required",
"valueSet": "http://hl7.org/fhir/uv/sql-on-fhir/ValueSet/ExportStatusCodes"
},
"documentation": "Status of the export (accepted, in-progress, completed, cancelled, failed)."
}, {
"max": "1",
"min": 1,
"use": "out",
"name": "location",
"type": "uri",
"documentation": "URL to poll for export status updates."
}, {
"max": "1",
"min": 0,
"use": "out",
"name": "cancelUrl",
"type": "uri",
"documentation": "Optional URL for cancelling the export."
}, {
"max": "1",
"min": 0,
"use": "out",
"name": "_format",
"type": "code",
"binding": {
"strength": "extensible",
"valueSet": "http://hl7.org/fhir/uv/sql-on-fhir/ValueSet/ExportOutputFormatCodes"
},
"documentation": "Format of the exported files (echoed from input if supplied)."
}, {
"max": "1",
"min": 0,
"use": "out",
"name": "exportStartTime",
"type": "instant",
"documentation": "Timestamp when the export job began."
}, {
"max": "1",
"min": 0,
"use": "out",
"name": "exportEndTime",
"type": "instant",
"documentation": "Timestamp when the export job completed."
}, {
"max": "1",
"min": 0,
"use": "out",
"name": "exportDuration",
"type": "integer",
"documentation": "Duration of the export in seconds."
}, {
"max": "1",
"min": 0,
"use": "out",
"name": "estimatedTimeRemaining",
"type": "integer",
"documentation": "Estimated seconds remaining until completion. Interim polling responses only."
}, {
"max": "*",
"min": 0,
"use": "out",
"name": "output",
"part": [ {
"max": "1",
"min": 1,
"use": "out",
"name": "name",
"type": "string",
"documentation": "Name assigned to this subject's output, derived from subject.name, else the subject's own name element, else a server-generated identifier."
}, {
"max": "*",
"min": 1,
"use": "out",
"name": "location",
"type": "uri",
"documentation": "Download URL(s) for the exported file(s)."
} ],
"documentation": "Output information for each exported subject. Exactly one entry per subject repetition, and none for a context entry. Neither manifest order nor computation order is guaranteed; clients correlate entries by name."
} ]
}