Data types
Inside Clinia's systems, data is persisted and exchanged using a set of common data types. These data types can be simple primitive types or composite data types, which are more complex data structures with many attributes. This section defined what we call the well known types. They are the basis for all data contained inside Resources.
Primitive Data Types
Base64Binary
A collection of bytes
representing a Base64 encoded chain of characters.
Boolean
Can has two possible values: true
or false
Code
A simple chain of characters. What differiantes it from a Symbol is that the value stored in a Code
is taken from a set of controlled strings defined elsewhere (see Value Set). Technically, a code is restricted to a string which has at least one character and no leading or trailing whitespace, and where there is no whitespace other than single spaces in the contents.
Date
A gegorian calendar date value without timezone information. It contains information on the year, the month and the day of a date. The accepted format is ISO 8601's date format: YYYY-MM-dd
.
DateTime
A gegorian calendar date value with timezone information. It contains information on the year, the month and the day of a date and the hours, minutes and seconds of the time of the day. The accepted format is ISO 8601's datetime format: YYYY-MM-ddTHH:mm:ss+zz:zz
.
Decimal
A rational number with a decimal representation. That number can be any value between -79,228,162,514,264,337,593,543,950,335 and 79,228,162,514,264,337,593,543,950,335. This type is ideal for storing monetary values.
Instant
A specific instant on the global timeline. It is defined by an integral number of "ticks" since the Unix epoch (typically described as January 1st 1970, midnight, UTC, ISO calendar), where a tick is equal to 100 nanoseconds. An Instant
has no concept of timezone. The accepted format is ISO 8601's format: YYYY-MM-ddTHH:mm:ssZ
Integer
A simple whole number. That number can be any value between -9,223,372,036,854,775,808 and 9,223,372,036,854,775,807.
Markdown
A simple chain of formatted characters. This data type will preserve any formatting done to the value.
Struct
A Struct
is used to store dynamic values, where the content of the value may not be known up front, or may be dynamic. The underlying data structure supporting this data type is a collection of key-value pairs where every key is unique. A Struct
can contain complex dictionary-like objects with multiple level of nested sub-objects.
A typical use case where the Struct
data type is useful is to store json-like values while making sure the format of the keys and values is preserved, independently of the serialization process used by the different systems handling the data.
Symbol
A simple chain of characters, what in many programming languages is known as a string
.
Time
A specific time during the day. It contains information on hours, minutes and seconds of the time of the day. The accepted format is ISO 8601's time format: HH:mm:ss
.
URI
A uniform resource identifier. The value should follow the RFC3986 specification.
URL
A uniform resource locator. The value should follow the RFC1738 specification.
XHtml
A chain of characters representing a XHTML fragment.
Composite Data Types
Address
An address expressed using postal conventions, it usually defines a physical location that can be visited.
Field | Required | Type | Description |
---|---|---|---|
unit | Optional | Symbol | Suite, door, appartment number. |
streetNumber | Optional | Symbol | Street number. |
route | Optional | Symbol | Street name. |
postalCode | Required | Symbol | Postal code. |
neighborhood | Optional | Symbol | Neighborhood. |
locality | Optional | Symbol | Locality. |
place | Required | Symbol | City. |
district | Optional | Symbol | District. |
regionCode | Required | Symbol | ISO 3166-2 region code. |
countryCode | Required | Symbol | ISO 3166 country code |
{
"unit": "1B",
"streetNumber": "5841",
"route": "av. De Lorimier",
"postalCode": "H2G2N8",
"district": "31st",
"neighborhood": "Maple Heights",
"locality": "Rosemont-La Petite-Patrie",
"place": "Montreal",
"regionCode": "QC",
"countryCode": "CA"
}
Coding
A representation of a defined concept using a code from a defined Code System. The meaning of a coding is defined by its code
.
It is possible for user-defined code to exists outside code systems. This is why the system
and version
attributes are optional. In all other cases, the code system information should be supplied when manipulating the Coding
data type.
Field | Required | Type | Description |
---|---|---|---|
system | Optional | Symbol | Code system in which the code is defined. |
version | Optional | Symbol | Version of the code system the code is defined in. |
value | Required | Code | Code value. |
displayName | Required | Array<Translation> | Display names for the code. |
{
"system": "country",
"version": "1",
"value": "CA",
"displayName": [
{
"code": "en",
"value": "Canada"
},
{
"code": "fr",
"value": "Canada"
}
]
}
Composite
The composite data type is used to hold custom data structures within a single property. A composite data type contains children properties to form a complex object that is different from the known data types.
ContactPoint
A point of contact which can either be a phone, a fax, a pager, a url or an email.
Field | Required | Type | Description |
---|---|---|---|
system | Required | Symbol | Type of contact point. Possible values are: phone , fax , pager , url , email |
value | Required | Symbol | Value of the contact point. The format of the value will depend on the system |
use | Optional | Symbol | Purpose of the contact point. |
extension | Optional | Symbol | Extension for phone numbers |
// Phone
{
"system": "phone",
"value": "5141234567",
"use": "reception",
"extensions": "123"
}
// Fax
{
"system": "fax",
"value": "5141234567",
"use": "main",
"extensions": null
}
// Pager
{
"system": "pager",
"value": "5141234567",
"use": "work",
"extensions": null
}
// Email
{
"system": "email",
"value": "support@clinia.com",
"use": "info",
"extensions": null
}
// Url
{
"system": "url",
"value": "https://booking.clinia.com",
"use": "booking",
"extensions": null
}
EmailContactPoint
An email point of contact.
Field | Required | Type | Description |
---|---|---|---|
system | Required | Symbol | Type of contact point. Will always be set to email |
value | Required | Symbol | Email address. |
use | Optional | Symbol | Purpose of the contact point. |
{
"system": "email",
"value": "support@clinia.com",
"use": "info"
}
FaxContactPoint
A fax point of contact.
Field | Required | Type | Description |
---|---|---|---|
system | Required | Symbol | Type of contact point. Will always be set to fax |
value | Required | Symbol | Fax number. |
use | Optional | Symbol | Purpose of the contact point. |
{
"system": "fax",
"value": "5141234567",
"use": "main"
}
GeoBoundingBox
A bounded geographic area.
Field | Required | Type | Description |
---|---|---|---|
northEast | Required | GeoPoint | The geo point located at the north-east corner. |
southWest | Required | GeoPoint | The geo point located at the south-westcorner. |
{
"northEast": {
"latitude": 45.70479,
"longitude": -73.474295
},
"southWest": {
"latitude": 45.417321,
"longitude": -73.972206
}
}
GeoPoint
A geographic location represented as a latitude/longitude pair.
Field | Required | Type | Description |
---|---|---|---|
longitude | Required | Decimal | Longitude |
latitude | Required | Decimal | Latitude |
{
"latitude": 45.5017,
"longitude": -73.5673
}
GeoShape
A complex polygonial geographic area represented as a collection of latitude/longitude pairs. A polygon should start and end with the same coordinates in order to form a closed off shape.
Field | Required | Type | Description |
---|---|---|---|
coordinates | Required | Array\<GeoPoint> | Coordinates defining the outer limit of the polygon. |
{
"coordinates": [
{
"latitude": 42.9278655,
"longitude": -72.2834516
},
{
"latitude": 42.9279676,
"longitude": -72.2762632
},
{
"latitude": 42.9250217,
"longitude": -72.2831726
},
{
"latitude": 42.9278655,
"longitude": -72.2834641
}
]
}
HumanName
A name of a human.
Field | Required | Type | Description |
---|---|---|---|
fistName | Required | Symbol | First name. |
middleName | Optional | Symbol | Middle name. |
lastName | Required | Symbol | Last name. |
{
"firstname": "Jacques",
"middleName": "Omer",
"lastName": "Plante"
}
Identifier
A numeric or alphanumeric chain of characters that is associated with a single object or entity within a given system. The value should be unique within the defined system and have a consistent meaning wherever it appears. Identifiers can also be represented as a simple string
, by concatening the system
and the value
like so: system:value
Field | Required | Type | Description |
---|---|---|---|
system | Required | Symbol | System within which the value exists. |
use | Required | Symbol | Purpose of the identifier |
value | Required | Symbol | Value of the identifier |
// clinia:c107efd9-6d61-4c0e-a5f2-9487e9a30902
{
"system": "clinia",
"use": "secondary",
"value": "c107efd9-6d61-4c0e-a5f2-9487e9a30902"
}
PhoneContactPoint
A phone point of contact.
Field | Required | Type | Description |
---|---|---|---|
system | Required | Symbol | Type of contact point. Will always be set to phone |
value | Required | Symbol | Phone number. |
use | Optional | Symbol | Purpose of the contact point. |
{
"system": "phone",
"value": "5141234567",
"use": "reception"
}
PagerContactPoint
A pager point of contact.
Field | Required | Type | Description |
---|---|---|---|
system | Required | Symbol | Type of contact point. Will always be set to pager |
value | Required | Symbol | Pager number. |
use | Optional | Symbol | Purpose of the contact point. |
{
"system": "pager",
"value": "5141234567",
"use": "work"
}
Reference
Defines a relationship between resources. References are always defined and represented in one direction - from one resource (source) to another (target). The source resource is implicit and will depend on where the reference data type is used. The target resource is what is defined by the content of the data type.
Field | Required | Type | Description |
---|---|---|---|
referenceType | Required | Symbol | Type of the target resource. |
id | Required | Symbol | Identifier of the target resource. |
{
"referenceType": "practitioner",
"id": "32d21cc1-569a-4b81-bd69-c75e0700a6e3"
}
TimeSlot
Defines a time interval within a day.
Field | Required | Type | Description |
---|---|---|---|
start | Required | Time | Start time of the interval. |
end | Required | Time | End time of the interval. |
day | Required | Integer | Day of the week. Possible values range from 1 (Monday) to 7 (Sunday) |
{
"start": "08:00:00",
"end": "17:00:00",
"day": 1
}
Translation
Represent a pair of ISO 639-1 language code and chain of characters. The value of a Translation
can be either a Symbol, a Markdown or a XHtml.
Field | Required | Type | Description |
---|---|---|---|
code | Required | Code | ISO 639-1 language code |
value | Required | Symbol | Markdown | XHtml | Value of the translation. |
{
"code": "en",
"value": "My english label"
}
UrlContactPoint
A url point of contact, like a website.
Field | Required | Type | Description |
---|---|---|---|
system | Required | Symbol | Type of contact point. Will always be set to url |
value | Required | Symbol | Url. |
use | Optional | Symbol | Purpose of the contact point. |
{
"system": "url",
"value": "https://booking.clinia.com",
"use": "booking"
}