You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`datetime`|`VARCHAR(50)`| Preserves partial datetimes and timezones |
329
+
|`instant`|`VARCHAR(50)`| Preserves full ISO8601 format |
330
+
|`time`|`VARCHAR(20)`| Preserves partial times |
331
+
|`string`, `markdown`, `code`|`NVARCHAR(MAX)`| Unicode-capable text |
332
+
|`uri`, `url`, `canonical`|`NVARCHAR(MAX)`| Can contain Unicode (IRIs) |
333
+
|`uuid`|`VARCHAR(100)`|ASCIIUUID format |
334
+
|`oid`|`VARCHAR(255)`|ASCIIOID format |
335
+
|`base64binary`|`VARBINARY(MAX)`| Binary data |
336
+
337
+
**Design principle:** Default mappings use `VARCHAR`for temporal and numeric types to preserve FHIRsemantics (partial dates, arbitrary precision decimals) rather than forcing conversion to SQL native types.
338
+
339
+
#### Using type hints
340
+
341
+
You can override default type mappings using the `tag` array on column definitions. Two tag types are supported:
342
+
343
+
**`tsql/type`- Direct T-SQL type specification:**
344
+
345
+
```json
346
+
{
347
+
"name": "birth_date",
348
+
"path": "birthDate",
349
+
"type": "date",
350
+
"tag": [
351
+
{ "name": "tsql/type", "value": "DATE" }
352
+
]
353
+
}
295
354
```
296
355
356
+
This generates a CAST expression:`CAST(JSON_VALUE(r.json, '$.birthDate') AS DATE) AS [birth_date]`
357
+
358
+
**`ansi/type`-ANSI/ISOSQL standard types (automatically converted to T-SQL):**
359
+
360
+
```json
361
+
{
362
+
"name": "age",
363
+
"path": "age",
364
+
"type": "integer",
365
+
"tag": [
366
+
{ "name": "ansi/type", "value": "INTEGER" }
367
+
]
368
+
}
369
+
```
370
+
371
+
The ANSI type `INTEGER` is automatically converted to T-SQL`INT`.
372
+
373
+
```json
374
+
{
375
+
"name": "active",
376
+
"path": "active",
377
+
"type": "boolean",
378
+
"tag": [
379
+
{ "name": "ansi/type", "value": "BOOLEAN" }
380
+
]
381
+
}
382
+
```
383
+
384
+
The ANSI type `BOOLEAN` is automatically converted to T-SQL`BIT`.
385
+
386
+
**Type precedence:**`tsql/type`>`ansi/type`>FHIR type defaults
387
+
388
+
**Supported ANSI types:**
389
+
- Character:`CHARACTER`, `CHARACTER VARYING`, `NATIONAL CHARACTER VARYING`
0 commit comments