Data Types
SQL on FHIR defines what type of data can be stored in each column. This impacts the functions available for each column and is valuable to understand data returned from a query.
Simple Data Types
The following data types are used to describe singular values in a column. They can be further aggregated using super
for more complex data types.
-
varchar
— Variable length character string -
bigint
— 64-bit signed integer -
double
— 64-bit signed double-precision floating point number -
boolean
— Values are true and false -
timestampz
— Date and time, UTC timezone -
date
— Date is in ISO format (YYYY-MM-DD)
Complex Data Types
These complex data types contain collections of simple data types or nested data. Because of the nested nature of FHIR, several columns are represented by the super
data type. You must use different notation to access the individual values inside this complex data type.
Data type |
Description |
---|---|
|
Use this data type to store semistructured data or documents as values. A super data type can either be an Amazon Redshift scalar value (such as a null, a boolean, a number, or string value) or a complex value (such as an array of values or a structure). To unnest this data type, Amazon Redshift uses the PartiQL syntax to iterate over SUPER arrays in the FROM clause of a query. |
For more detailed type information, see the Amazon Redshift documentation.
About Time & Time Zones
SQL on FHIR does not currently support time zone information, but timestamps are stored and processed as UTC. Where there is a timestamp given, such as in the meta.lastUpdated
field of any resource, you can assume it refers to UTC. This applies to the simple data types of timestampz
and date
, either in their own columns or as part of a super
.