From 3b73234c570096cc07a64819db8ed25e0fbed88b Mon Sep 17 00:00:00 2001 From: John Grimes Date: Wed, 7 Feb 2024 14:47:35 +1000 Subject: [PATCH] Add Parquet specification to docs --- site/docs/libraries/encoders/schema.md | 1009 ++++++++++++++---------- 1 file changed, 575 insertions(+), 434 deletions(-) diff --git a/site/docs/libraries/encoders/schema.md b/site/docs/libraries/encoders/schema.md index 2cd29500c2..feab17946a 100644 --- a/site/docs/libraries/encoders/schema.md +++ b/site/docs/libraries/encoders/schema.md @@ -1,7 +1,7 @@ -# Schema specification +# Parquet specification -This specification describes a scheme for encoding resource definitions from the -FHIR specification as a Spark SQL schema. +This specification describes a scheme for representing FHIR resources within a +[Parquet](https://parquet.apache.org/) schema. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", " SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be @@ -25,494 +25,635 @@ All R4 resource types are supported by this specification, except the following: ## Configuration options -There are several options that determine the encoding strategy. Schemas that -have been encoded according to this specification with the same configuration -values SHALL be identical and compatible. +There are several options that determine the structure of the schema. Any two +schemas that conform to this specification with the same configuration values +SHALL be identical and compatible. -| Option | Description | -|----------------------------|-----------------------------------------------------------| -| Maximum nesting level | The maximum depth of nested element data that is encoded. | -| Extension encoding enabled | Whether extension content is included within the schema. | -| Supported open types | The list of types that are encoded for open choice types. | +| Option | Description | +|-----------------------|-------------------------------------------------------------| +| Maximum nesting level | The maximum supported depth of nested element data. | +| Extensions enabled | Whether extension content is included within the schema. | +| Supported open types | The list of types that are supported for open choice types. | ## Out of scope -The following areas are not currently supported by this specification: +The following features are not currently supported by this specification: - Primitive extensions - Profiled resources -## Encoding strategy +## Schema structure -All columns and struct fields SHALL be encoded as nullable, unless otherwise -specified. +All fields SHALL be encoded as `OPTIONAL`, unless otherwise specified. All +groups SHALL be encoded as `REQUIRED`. ### Primitive elements -Each primitive element within a resource definition SHALL be encoded as a column -within the schema with the same name (except where otherwise specified). The -data type SHALL be determined by the element type according to the following +Each primitive element within a resource definition SHALL be represented as a +field within the schema with the same name (except where otherwise specified). +The data type SHALL be determined by the element type according to the following table: -| FHIR type | Spark SQL type | Additional requirements | -|-----------------|----------------|--------------------------------------------------------------------------------------------------| -| boolean | boolean | | -| canonical | string | Compliant with the [FHIR canonical format](https://hl7.org/fhir/R4/datatypes.html#canonical) | -| code | string | Compliant with the [FHIR code format](https://hl7.org/fhir/R4/datatypes.html#code) | -| dateTime | string | Compliant with the [FHIR dateTime format](https://hl7.org/fhir/R4/datatypes.html#dateTime) | -| date | string | Compliant with the [FHIR date format](https://hl7.org/fhir/R4/datatypes.html#date) | -| decimal | decimal(32,6) | See [Decimal encoding](#decimal-encoding) | -| id | string | See [ID encoding](#id-encoding) | -| instant | timestamp | | -| integer | integer | Compliant with the [FHIR integer format](https://hl7.org/fhir/R4/datatypes.html#integer) | -| markdown | string | Compliant with the [FHIR markdown format](https://hl7.org/fhir/R4/datatypes.html#markdown) | -| oid | string | Compliant with the [FHIR oid format](https://hl7.org/fhir/R4/datatypes.html#oid) | -| positiveInt | integer | Compliant with the [FHIR positiveInt format](https://hl7.org/fhir/R4/datatypes.html#positiveInt) | -| string | string | Compliant with the [FHIR string format](https://hl7.org/fhir/R4/datatypes.html#string) | -| time | string | Compliant with the [FHIR time format](https://hl7.org/fhir/R4/datatypes.html#time) | -| unsignedInt | integer | Compliant with the [FHIR unsignedInt format](https://hl7.org/fhir/R4/datatypes.html#unsignedInt) | -| uri | string | Compliant with the [FHIR uri format](https://hl7.org/fhir/R4/datatypes.html#uri) | -| url | string | Compliant with the [FHIR url format](https://hl7.org/fhir/R4/datatypes.html#url) | -| uuid | string | Compliant with the [FHIR uuid format](https://hl7.org/fhir/R4/datatypes.html#uuid) | - -#### Decimal encoding - -An element of type `decimal` SHALL be encoded as a decimal column with a -precision of 32 and a scale of 6. +| FHIR type | Spark SQL type | Additional requirements | +|-------------|----------------|----------------------------------------------------------------------------------------------| +| boolean | BOOLEAN | | +| canonical | BINARY (UTF8) | Compliant with the [FHIR canonical format](https://hl7.org/fhir/R4/datatypes.html#canonical) | +| code | BINARY (UTF8) | Compliant with the [FHIR code format](https://hl7.org/fhir/R4/datatypes.html#code) | +| dateTime | BINARY (UTF8) | Compliant with the [FHIR dateTime format](https://hl7.org/fhir/R4/datatypes.html#dateTime) | +| date | BINARY (UTF8) | Compliant with the [FHIR date format](https://hl7.org/fhir/R4/datatypes.html#date) | +| decimal | DECIMAL(32,6) | See [Decimal type](#decimal-type) | +| id | BINARY (UTF8) | See [ID type](#id-type) | +| instant | INT96 | | +| integer | INT32 | Compliant with the [FHIR integer format](https://hl7.org/fhir/R4/datatypes.html#integer) | +| markdown | BINARY (UTF8) | Compliant with the [FHIR markdown format](https://hl7.org/fhir/R4/datatypes.html#markdown) | +| oid | BINARY (UTF8) | Compliant with the [FHIR oid format](https://hl7.org/fhir/R4/datatypes.html#oid) | +| positiveInt | INT32 | liant with the [FHIR positiveInt format](https://hl7.org/fhir/R4/datatypes.html#positiveInt) | +| string | BINARY (UTF8) | Compliant with the [FHIR string format](https://hl7.org/fhir/R4/datatypes.html#string) | +| time | BINARY (UTF8) | Compliant with the [FHIR time format](https://hl7.org/fhir/R4/datatypes.html#time) | +| unsignedInt | INT32 | liant with the [FHIR unsignedInt format](https://hl7.org/fhir/R4/datatypes.html#unsignedInt) | +| uri | BINARY (UTF8) | Compliant with the [FHIR uri format](https://hl7.org/fhir/R4/datatypes.html#uri) | +| url | BINARY (UTF8) | Compliant with the [FHIR url format](https://hl7.org/fhir/R4/datatypes.html#url) | +| uuid | BINARY (UTF8) | Compliant with the [FHIR uuid format](https://hl7.org/fhir/R4/datatypes.html#uuid) | -In addition to this column, an integer column SHALL be encoded with the -suffix `_scale`. This column SHALL contain the scale of the decimal value from -the original FHIR data. +### Complex and backbone elements -#### ID encoding +Each complex and backbone element within a resource definition SHALL be +represented as a group within the schema with the same name. The group SHALL +contain a fields for each of the child elements. -An element of type `id` SHALL be encoded as a string column. This column SHALL -contain the FHIR resource logical ID. +Each field SHALL be represented as described in +the [Primitive elements](#primitive-elements) and [Choice types](#choice-types) +sections (or this section in the case of a nested complex or backbone element). -In addition to this column, a string column SHALL be encoded with the -suffix `_versioned`. This column SHALL contain a fully qualified logical ID, -including the resource type and the technical version. The data in this column -SHALL follow the format `[resource type]/[logical ID]/_history/[version]`. +If the "extensions enabled" option is set to true, an additional field +SHALL be included with the name `_fid`. This field SHALL have a type of `INT32`. +This field SHALL contain a value that uniquely identifies the complex or +backbone element within the resource. ### Choice types -If the choice type is open (i.e. a type of `*`), the struct SHALL contain a +If the choice type is open (i.e. a type of `*`), the group SHALL contain a field for each type listed in the configuration value "supported open types". -If the choice type is not open, it SHALL be encoded as a struct column with a +If the choice type is not open, it SHALL be represented as a group with a field for each of its valid types. The name of each field SHALL follow the format `value[type]`, where `[type]` is the name of the type in upper camel case. -### Complex and backbone elements +### Decimal type -Each complex and backbone element within a resource definition SHALL be encoded -as a struct column within the schema with the same name. The struct SHALL -contain fields for each of the child elements of the complex or backbone -element. +An element of type `decimal` SHALL be represented as a `DECIMAL` field with a +precision of 32 and a scale of 6. -The encoding rules for each field SHALL follow the same rules as described in -the [primitive elements](#primitive-elements) and [choice types](#choice-types) -section (and this section in the case of nested complex or backbone elements). +In addition, an `INT32` field SHALL be included with the suffix `_scale`. This +field SHALL be used to store the scale of the decimal value from the original +FHIR data. -If the "extension encoding enabled" option is set to true, an additional column -SHALL be encoded with the name `_fid`. This column SHALL have a type of integer. -This column SHALL contain a value that uniquely identifies the complex or -backbone element within the resource. +### ID type + +An element of type `id` SHALL be represented as a `BINARY (UTF8)` field. This +field SHALL be used to store the FHIR resource logical ID. + +In addition to this field, a `BINARY (UTF8)` field SHALL be included with the +suffix `_versioned`. This field SHALL be used to store a fully qualified logical +ID that includes the resource type and the technical version. The data in this +field SHALL follow the format `[resource type]/[logical ID]/_history/[version]`. -#### Quantity encoding +### Quantity type -If the complex element is of +If a complex element is of type [Quantity](https://hl7.org/fhir/R4/datatypes.html#Quantity), an additional -two columns SHALL be encoded as part of the struct. These columns SHALL be +two fields SHALL be included as part of the group. These fields SHALL be named `_value_canonicalized` and `_code_canonicalized`. -The `_value_canonicalized` column SHALL be encoded as a struct with the +The `_value_canonicalized` field SHALL be encoded as a group with the following fields: - `value` with a type of decimal, precision 38 and scale 0. - `scale` with a type of integer. -The `_code_canonicalized` column SHALL be encoded as a string column. +The `_code_canonicalized` field SHALL be encoded as a string field. -Implementations loading data into this schema MAY use these columns to store -canonicalized versions of the `value` and `code` fields from the original FHIR -data, for easier comparison and querying. +These fields MAY be used to store canonicalized versions of the `value` +and `code` fields from the original FHIR data, for easier comparison and +querying. -### Extension encoding +### Extensions -If the "extension encoding enabled" option is set to true, an additional column -SHALL be encoded at the root of the schema named `_extension`. This column SHALL -have a type of map, with an integer key and an array value. +If the "extensions enabled" option is true, an additional field SHALL be +included at the root of the schema named `_extension`. This field SHALL have a +type of `MAP`, with an `INT32` key and a repeated group value. -The array SHALL contain a struct type that is encoded as +The group used for each value in the map SHALL be represented using the [Extension](https://hl7.org/fhir/R4/extensibility.html#extension) type, as described in [Complex and backbone elements](#complex-and-backbone-elements). -Implementations loading data into this schema SHALL use this column to store -extension data from the original FHIR data (except for primitive extensions). -The map SHALL contain a reference to the `_fid` of the element that the -extension is attached to. +If the "extensions enabled" option is true, this field SHALL be used to store +extension data from the original FHIR data (excluding primitive extensions). +Each key within the map SHALL contain a reference to the `_fid` of the element +that the extension is attached to. ## Example -The following schema is an example of the encoding of -the [Patient](https://hl7.org/fhir/R4/patient.html) resource type with the +The following schema is an example of how to represent +the [Patient](https://hl7.org/fhir/R4/patient.html) resource type using the following configuration values: - Maximum nesting level: `3` -- Extension encoding enabled: `true` +- Extensions enabled: `true` - Supported open types: `boolean`, `code`, `date`, `dateTime`, `decimal`, `integer`, `string`, `Coding`, `CodeableConcept`, `Address`, `Identifier`, `Reference` ``` -root - |-- id: string (nullable = true) - |-- id_versioned: string (nullable = true) - |-- meta: struct (nullable = true) - | |-- id: string (nullable = true) - | |-- versionId: string (nullable = true) - | |-- versionId_versioned: string (nullable = true) - | |-- lastUpdated: timestamp (nullable = true) - | |-- source: string (nullable = true) - | |-- profile: array (nullable = true) - | | |-- element: string (containsNull = true) - | |-- security: array (nullable = true) - | | |-- element: struct (containsNull = true) - | | | |-- id: string (nullable = true) - | | | |-- system: string (nullable = true) - | | | |-- version: string (nullable = true) - | | | |-- code: string (nullable = true) - | | | |-- display: string (nullable = true) - | | | |-- userSelected: boolean (nullable = true) - | | | |-- _fid: integer (nullable = true) - | |-- tag: array (nullable = true) - | | |-- element: struct (containsNull = true) - | | | |-- id: string (nullable = true) - | | | |-- system: string (nullable = true) - | | | |-- version: string (nullable = true) - | | | |-- code: string (nullable = true) - | | | |-- display: string (nullable = true) - | | | |-- userSelected: boolean (nullable = true) - | | | |-- _fid: integer (nullable = true) - | |-- _fid: integer (nullable = true) - |-- implicitRules: string (nullable = true) - |-- language: string (nullable = true) - |-- text: struct (nullable = true) - | |-- id: string (nullable = true) - | |-- status: string (nullable = true) - | |-- div: string (nullable = true) - | |-- _fid: integer (nullable = true) - |-- identifier: array (nullable = true) - | |-- element: struct (containsNull = true) - | | |-- id: string (nullable = true) - | | |-- use: string (nullable = true) - | | |-- type: struct (nullable = true) - | | | |-- id: string (nullable = true) - | | | |-- coding: array (nullable = true) - | | | | |-- element: struct (containsNull = true) - | | | | | |-- id: string (nullable = true) - | | | | | |-- system: string (nullable = true) - | | | | | |-- version: string (nullable = true) - | | | | | |-- code: string (nullable = true) - | | | | | |-- display: string (nullable = true) - | | | | | |-- userSelected: boolean (nullable = true) - | | | | | |-- _fid: integer (nullable = true) - | | | |-- text: string (nullable = true) - | | | |-- _fid: integer (nullable = true) - | | |-- system: string (nullable = true) - | | |-- value: string (nullable = true) - | | |-- period: struct (nullable = true) - | | | |-- id: string (nullable = true) - | | | |-- start: string (nullable = true) - | | | |-- end: string (nullable = true) - | | | |-- _fid: integer (nullable = true) - | | |-- assigner: struct (nullable = true) - | | | |-- reference: string (nullable = true) - | | | |-- display: string (nullable = true) - | | | |-- _fid: integer (nullable = true) - | | |-- _fid: integer (nullable = true) - |-- active: boolean (nullable = true) - |-- name: array (nullable = true) - | |-- element: struct (containsNull = true) - | | |-- id: string (nullable = true) - | | |-- use: string (nullable = true) - | | |-- text: string (nullable = true) - | | |-- family: string (nullable = true) - | | |-- given: array (nullable = true) - | | | |-- element: string (containsNull = true) - | | |-- prefix: array (nullable = true) - | | | |-- element: string (containsNull = true) - | | |-- suffix: array (nullable = true) - | | | |-- element: string (containsNull = true) - | | |-- period: struct (nullable = true) - | | | |-- id: string (nullable = true) - | | | |-- start: string (nullable = true) - | | | |-- end: string (nullable = true) - | | | |-- _fid: integer (nullable = true) - | | |-- _fid: integer (nullable = true) - |-- telecom: array (nullable = true) - | |-- element: struct (containsNull = true) - | | |-- id: string (nullable = true) - | | |-- system: string (nullable = true) - | | |-- value: string (nullable = true) - | | |-- use: string (nullable = true) - | | |-- rank: integer (nullable = true) - | | |-- period: struct (nullable = true) - | | | |-- id: string (nullable = true) - | | | |-- start: string (nullable = true) - | | | |-- end: string (nullable = true) - | | | |-- _fid: integer (nullable = true) - | | |-- _fid: integer (nullable = true) - |-- gender: string (nullable = true) - |-- birthDate: string (nullable = true) - |-- deceasedBoolean: boolean (nullable = true) - |-- deceasedDateTime: string (nullable = true) - |-- address: array (nullable = true) - | |-- element: struct (containsNull = true) - | | |-- id: string (nullable = true) - | | |-- use: string (nullable = true) - | | |-- type: string (nullable = true) - | | |-- text: string (nullable = true) - | | |-- line: array (nullable = true) - | | | |-- element: string (containsNull = true) - | | |-- city: string (nullable = true) - | | |-- district: string (nullable = true) - | | |-- state: string (nullable = true) - | | |-- postalCode: string (nullable = true) - | | |-- country: string (nullable = true) - | | |-- period: struct (nullable = true) - | | | |-- id: string (nullable = true) - | | | |-- start: string (nullable = true) - | | | |-- end: string (nullable = true) - | | | |-- _fid: integer (nullable = true) - | | |-- _fid: integer (nullable = true) - |-- maritalStatus: struct (nullable = true) - | |-- id: string (nullable = true) - | |-- coding: array (nullable = true) - | | |-- element: struct (containsNull = true) - | | | |-- id: string (nullable = true) - | | | |-- system: string (nullable = true) - | | | |-- version: string (nullable = true) - | | | |-- code: string (nullable = true) - | | | |-- display: string (nullable = true) - | | | |-- userSelected: boolean (nullable = true) - | | | |-- _fid: integer (nullable = true) - | |-- text: string (nullable = true) - | |-- _fid: integer (nullable = true) - |-- multipleBirthBoolean: boolean (nullable = true) - |-- multipleBirthInteger: integer (nullable = true) - |-- photo: array (nullable = true) - | |-- element: struct (containsNull = true) - | | |-- id: string (nullable = true) - | | |-- contentType: string (nullable = true) - | | |-- language: string (nullable = true) - | | |-- data: binary (nullable = true) - | | |-- url: string (nullable = true) - | | |-- size: integer (nullable = true) - | | |-- hash: binary (nullable = true) - | | |-- title: string (nullable = true) - | | |-- creation: string (nullable = true) - | | |-- _fid: integer (nullable = true) - |-- contact: array (nullable = true) - | |-- element: struct (containsNull = true) - | | |-- id: string (nullable = true) - | | |-- relationship: array (nullable = true) - | | | |-- element: struct (containsNull = true) - | | | | |-- id: string (nullable = true) - | | | | |-- coding: array (nullable = true) - | | | | | |-- element: struct (containsNull = true) - | | | | | | |-- id: string (nullable = true) - | | | | | | |-- system: string (nullable = true) - | | | | | | |-- version: string (nullable = true) - | | | | | | |-- code: string (nullable = true) - | | | | | | |-- display: string (nullable = true) - | | | | | | |-- userSelected: boolean (nullable = true) - | | | | | | |-- _fid: integer (nullable = true) - | | | | |-- text: string (nullable = true) - | | | | |-- _fid: integer (nullable = true) - | | |-- name: struct (nullable = true) - | | | |-- id: string (nullable = true) - | | | |-- use: string (nullable = true) - | | | |-- text: string (nullable = true) - | | | |-- family: string (nullable = true) - | | | |-- given: array (nullable = true) - | | | | |-- element: string (containsNull = true) - | | | |-- prefix: array (nullable = true) - | | | | |-- element: string (containsNull = true) - | | | |-- suffix: array (nullable = true) - | | | | |-- element: string (containsNull = true) - | | | |-- period: struct (nullable = true) - | | | | |-- id: string (nullable = true) - | | | | |-- start: string (nullable = true) - | | | | |-- end: string (nullable = true) - | | | | |-- _fid: integer (nullable = true) - | | | |-- _fid: integer (nullable = true) - | | |-- telecom: array (nullable = true) - | | | |-- element: struct (containsNull = true) - | | | | |-- id: string (nullable = true) - | | | | |-- system: string (nullable = true) - | | | | |-- value: string (nullable = true) - | | | | |-- use: string (nullable = true) - | | | | |-- rank: integer (nullable = true) - | | | | |-- period: struct (nullable = true) - | | | | | |-- id: string (nullable = true) - | | | | | |-- start: string (nullable = true) - | | | | | |-- end: string (nullable = true) - | | | | | |-- _fid: integer (nullable = true) - | | | | |-- _fid: integer (nullable = true) - | | |-- address: struct (nullable = true) - | | | |-- id: string (nullable = true) - | | | |-- use: string (nullable = true) - | | | |-- type: string (nullable = true) - | | | |-- text: string (nullable = true) - | | | |-- line: array (nullable = true) - | | | | |-- element: string (containsNull = true) - | | | |-- city: string (nullable = true) - | | | |-- district: string (nullable = true) - | | | |-- state: string (nullable = true) - | | | |-- postalCode: string (nullable = true) - | | | |-- country: string (nullable = true) - | | | |-- period: struct (nullable = true) - | | | | |-- id: string (nullable = true) - | | | | |-- start: string (nullable = true) - | | | | |-- end: string (nullable = true) - | | | | |-- _fid: integer (nullable = true) - | | | |-- _fid: integer (nullable = true) - | | |-- gender: string (nullable = true) - | | |-- organization: struct (nullable = true) - | | | |-- reference: string (nullable = true) - | | | |-- display: string (nullable = true) - | | | |-- _fid: integer (nullable = true) - | | |-- period: struct (nullable = true) - | | | |-- id: string (nullable = true) - | | | |-- start: string (nullable = true) - | | | |-- end: string (nullable = true) - | | | |-- _fid: integer (nullable = true) - | | |-- _fid: integer (nullable = true) - |-- communication: array (nullable = true) - | |-- element: struct (containsNull = true) - | | |-- id: string (nullable = true) - | | |-- language: struct (nullable = true) - | | | |-- id: string (nullable = true) - | | | |-- coding: array (nullable = true) - | | | | |-- element: struct (containsNull = true) - | | | | | |-- id: string (nullable = true) - | | | | | |-- system: string (nullable = true) - | | | | | |-- version: string (nullable = true) - | | | | | |-- code: string (nullable = true) - | | | | | |-- display: string (nullable = true) - | | | | | |-- userSelected: boolean (nullable = true) - | | | | | |-- _fid: integer (nullable = true) - | | | |-- text: string (nullable = true) - | | | |-- _fid: integer (nullable = true) - | | |-- preferred: boolean (nullable = true) - | | |-- _fid: integer (nullable = true) - |-- generalPractitioner: array (nullable = true) - | |-- element: struct (containsNull = true) - | | |-- reference: string (nullable = true) - | | |-- display: string (nullable = true) - | | |-- _fid: integer (nullable = true) - |-- managingOrganization: struct (nullable = true) - | |-- reference: string (nullable = true) - | |-- display: string (nullable = true) - | |-- _fid: integer (nullable = true) - |-- link: array (nullable = true) - | |-- element: struct (containsNull = true) - | | |-- id: string (nullable = true) - | | |-- other: struct (nullable = true) - | | | |-- reference: string (nullable = true) - | | | |-- display: string (nullable = true) - | | | |-- _fid: integer (nullable = true) - | | |-- type: string (nullable = true) - | | |-- _fid: integer (nullable = true) - |-- _fid: integer (nullable = true) - |-- _extension: map (nullable = true) - | |-- key: integer - | |-- value: array (valueContainsNull = false) - | | |-- element: struct (containsNull = true) - | | | |-- id: string (nullable = true) - | | | |-- url: string (nullable = true) - | | | |-- valueAddress: struct (nullable = true) - | | | | |-- id: string (nullable = true) - | | | | |-- use: string (nullable = true) - | | | | |-- type: string (nullable = true) - | | | | |-- text: string (nullable = true) - | | | | |-- line: array (nullable = true) - | | | | | |-- element: string (containsNull = true) - | | | | |-- city: string (nullable = true) - | | | | |-- district: string (nullable = true) - | | | | |-- state: string (nullable = true) - | | | | |-- postalCode: string (nullable = true) - | | | | |-- country: string (nullable = true) - | | | | |-- period: struct (nullable = true) - | | | | | |-- id: string (nullable = true) - | | | | | |-- start: string (nullable = true) - | | | | | |-- end: string (nullable = true) - | | | | | |-- _fid: integer (nullable = true) - | | | | |-- _fid: integer (nullable = true) - | | | |-- valueBoolean: boolean (nullable = true) - | | | |-- valueCode: string (nullable = true) - | | | |-- valueCodeableConcept: struct (nullable = true) - | | | | |-- id: string (nullable = true) - | | | | |-- coding: array (nullable = true) - | | | | | |-- element: struct (containsNull = true) - | | | | | | |-- id: string (nullable = true) - | | | | | | |-- system: string (nullable = true) - | | | | | | |-- version: string (nullable = true) - | | | | | | |-- code: string (nullable = true) - | | | | | | |-- display: string (nullable = true) - | | | | | | |-- userSelected: boolean (nullable = true) - | | | | | | |-- _fid: integer (nullable = true) - | | | | |-- text: string (nullable = true) - | | | | |-- _fid: integer (nullable = true) - | | | |-- valueCoding: struct (nullable = true) - | | | | |-- id: string (nullable = true) - | | | | |-- system: string (nullable = true) - | | | | |-- version: string (nullable = true) - | | | | |-- code: string (nullable = true) - | | | | |-- display: string (nullable = true) - | | | | |-- userSelected: boolean (nullable = true) - | | | | |-- _fid: integer (nullable = true) - | | | |-- valueDateTime: string (nullable = true) - | | | |-- valueDate: string (nullable = true) - | | | |-- valueDecimal: decimal(32,6) (nullable = true) - | | | |-- valueDecimal_scale: integer (nullable = true) - | | | |-- valueIdentifier: struct (nullable = true) - | | | | |-- id: string (nullable = true) - | | | | |-- use: string (nullable = true) - | | | | |-- type: struct (nullable = true) - | | | | | |-- id: string (nullable = true) - | | | | | |-- coding: array (nullable = true) - | | | | | | |-- element: struct (containsNull = true) - | | | | | | | |-- id: string (nullable = true) - | | | | | | | |-- system: string (nullable = true) - | | | | | | | |-- version: string (nullable = true) - | | | | | | | |-- code: string (nullable = true) - | | | | | | | |-- display: string (nullable = true) - | | | | | | | |-- userSelected: boolean (nullable = true) - | | | | | | | |-- _fid: integer (nullable = true) - | | | | | |-- text: string (nullable = true) - | | | | | |-- _fid: integer (nullable = true) - | | | | |-- system: string (nullable = true) - | | | | |-- value: string (nullable = true) - | | | | |-- period: struct (nullable = true) - | | | | | |-- id: string (nullable = true) - | | | | | |-- start: string (nullable = true) - | | | | | |-- end: string (nullable = true) - | | | | | |-- _fid: integer (nullable = true) - | | | | |-- assigner: struct (nullable = true) - | | | | | |-- reference: string (nullable = true) - | | | | | |-- display: string (nullable = true) - | | | | | |-- _fid: integer (nullable = true) - | | | | |-- _fid: integer (nullable = true) - | | | |-- valueInteger: integer (nullable = true) - | | | |-- valueReference: struct (nullable = true) - | | | | |-- reference: string (nullable = true) - | | | | |-- display: string (nullable = true) - | | | | |-- _fid: integer (nullable = true) - | | | |-- valueString: string (nullable = true) - | | | |-- _fid: integer (nullable = true) +message spark_schema { + optional binary id (STRING); + optional binary id_versioned (STRING); + optional group meta { + optional binary id (STRING); + optional binary versionId (STRING); + optional binary versionId_versioned (STRING); + optional int96 lastUpdated; + optional binary source (STRING); + optional group profile (LIST) { + repeated group list { + optional binary element (STRING); + } + } + optional group security (LIST) { + repeated group list { + optional group element { + optional binary id (STRING); + optional binary system (STRING); + optional binary version (STRING); + optional binary code (STRING); + optional binary display (STRING); + optional boolean userSelected; + optional int32 _fid; + } + } + } + optional group tag (LIST) { + repeated group list { + optional group element { + optional binary id (STRING); + optional binary system (STRING); + optional binary version (STRING); + optional binary code (STRING); + optional binary display (STRING); + optional boolean userSelected; + optional int32 _fid; + } + } + } + optional int32 _fid; + } + optional binary implicitRules (STRING); + optional binary language (STRING); + optional group text { + optional binary id (STRING); + optional binary status (STRING); + optional binary div (STRING); + optional int32 _fid; + } + optional group identifier (LIST) { + repeated group list { + optional group element { + optional binary id (STRING); + optional binary use (STRING); + optional group type { + optional binary id (STRING); + optional group coding (LIST) { + repeated group list { + optional group element { + optional binary id (STRING); + optional binary system (STRING); + optional binary version (STRING); + optional binary code (STRING); + optional binary display (STRING); + optional boolean userSelected; + optional int32 _fid; + } + } + } + optional binary text (STRING); + optional int32 _fid; + } + optional binary system (STRING); + optional binary value (STRING); + optional group period { + optional binary id (STRING); + optional binary start (STRING); + optional binary end (STRING); + optional int32 _fid; + } + optional group assigner { + optional binary reference (STRING); + optional binary display (STRING); + optional int32 _fid; + } + optional int32 _fid; + } + } + } + optional boolean active; + optional group name (LIST) { + repeated group list { + optional group element { + optional binary id (STRING); + optional binary use (STRING); + optional binary text (STRING); + optional binary family (STRING); + optional group given (LIST) { + repeated group list { + optional binary element (STRING); + } + } + optional group prefix (LIST) { + repeated group list { + optional binary element (STRING); + } + } + optional group suffix (LIST) { + repeated group list { + optional binary element (STRING); + } + } + optional group period { + optional binary id (STRING); + optional binary start (STRING); + optional binary end (STRING); + optional int32 _fid; + } + optional int32 _fid; + } + } + } + optional group telecom (LIST) { + repeated group list { + optional group element { + optional binary id (STRING); + optional binary system (STRING); + optional binary value (STRING); + optional binary use (STRING); + optional int32 rank; + optional group period { + optional binary id (STRING); + optional binary start (STRING); + optional binary end (STRING); + optional int32 _fid; + } + optional int32 _fid; + } + } + } + optional binary gender (STRING); + optional binary birthDate (STRING); + optional boolean deceasedBoolean; + optional binary deceasedDateTime (STRING); + optional group address (LIST) { + repeated group list { + optional group element { + optional binary id (STRING); + optional binary use (STRING); + optional binary type (STRING); + optional binary text (STRING); + optional group line (LIST) { + repeated group list { + optional binary element (STRING); + } + } + optional binary city (STRING); + optional binary district (STRING); + optional binary state (STRING); + optional binary postalCode (STRING); + optional binary country (STRING); + optional group period { + optional binary id (STRING); + optional binary start (STRING); + optional binary end (STRING); + optional int32 _fid; + } + optional int32 _fid; + } + } + } + optional group maritalStatus { + optional binary id (STRING); + optional group coding (LIST) { + repeated group list { + optional group element { + optional binary id (STRING); + optional binary system (STRING); + optional binary version (STRING); + optional binary code (STRING); + optional binary display (STRING); + optional boolean userSelected; + optional int32 _fid; + } + } + } + optional binary text (STRING); + optional int32 _fid; + } + optional boolean multipleBirthBoolean; + optional int32 multipleBirthInteger; + optional group photo (LIST) { + repeated group list { + optional group element { + optional binary id (STRING); + optional binary contentType (STRING); + optional binary language (STRING); + optional binary data; + optional binary url (STRING); + optional int32 size; + optional binary hash; + optional binary title (STRING); + optional binary creation (STRING); + optional int32 _fid; + } + } + } + optional group contact (LIST) { + repeated group list { + optional group element { + optional binary id (STRING); + optional group relationship (LIST) { + repeated group list { + optional group element { + optional binary id (STRING); + optional group coding (LIST) { + repeated group list { + optional group element { + optional binary id (STRING); + optional binary system (STRING); + optional binary version (STRING); + optional binary code (STRING); + optional binary display (STRING); + optional boolean userSelected; + optional int32 _fid; + } + } + } + optional binary text (STRING); + optional int32 _fid; + } + } + } + optional group name { + optional binary id (STRING); + optional binary use (STRING); + optional binary text (STRING); + optional binary family (STRING); + optional group given (LIST) { + repeated group list { + optional binary element (STRING); + } + } + optional group prefix (LIST) { + repeated group list { + optional binary element (STRING); + } + } + optional group suffix (LIST) { + repeated group list { + optional binary element (STRING); + } + } + optional group period { + optional binary id (STRING); + optional binary start (STRING); + optional binary end (STRING); + optional int32 _fid; + } + optional int32 _fid; + } + optional group telecom (LIST) { + repeated group list { + optional group element { + optional binary id (STRING); + optional binary system (STRING); + optional binary value (STRING); + optional binary use (STRING); + optional int32 rank; + optional group period { + optional binary id (STRING); + optional binary start (STRING); + optional binary end (STRING); + optional int32 _fid; + } + optional int32 _fid; + } + } + } + optional group address { + optional binary id (STRING); + optional binary use (STRING); + optional binary type (STRING); + optional binary text (STRING); + optional group line (LIST) { + repeated group list { + optional binary element (STRING); + } + } + optional binary city (STRING); + optional binary district (STRING); + optional binary state (STRING); + optional binary postalCode (STRING); + optional binary country (STRING); + optional group period { + optional binary id (STRING); + optional binary start (STRING); + optional binary end (STRING); + optional int32 _fid; + } + optional int32 _fid; + } + optional binary gender (STRING); + optional group organization { + optional binary reference (STRING); + optional binary display (STRING); + optional int32 _fid; + } + optional group period { + optional binary id (STRING); + optional binary start (STRING); + optional binary end (STRING); + optional int32 _fid; + } + optional int32 _fid; + } + } + } + optional group communication (LIST) { + repeated group list { + optional group element { + optional binary id (STRING); + optional group language { + optional binary id (STRING); + optional group coding (LIST) { + repeated group list { + optional group element { + optional binary id (STRING); + optional binary system (STRING); + optional binary version (STRING); + optional binary code (STRING); + optional binary display (STRING); + optional boolean userSelected; + optional int32 _fid; + } + } + } + optional binary text (STRING); + optional int32 _fid; + } + optional boolean preferred; + optional int32 _fid; + } + } + } + optional group generalPractitioner (LIST) { + repeated group list { + optional group element { + optional binary reference (STRING); + optional binary display (STRING); + optional int32 _fid; + } + } + } + optional group managingOrganization { + optional binary reference (STRING); + optional binary display (STRING); + optional int32 _fid; + } + optional group link (LIST) { + repeated group list { + optional group element { + optional binary id (STRING); + optional group other { + optional binary reference (STRING); + optional binary display (STRING); + optional int32 _fid; + } + optional binary type (STRING); + optional int32 _fid; + } + } + } + optional int32 _fid; + optional group _extension (MAP) { + repeated group key_value { + required int32 key; + required group value (LIST) { + repeated group list { + optional group element { + optional binary id (STRING); + optional binary url (STRING); + optional group valueAddress { + optional binary id (STRING); + optional binary use (STRING); + optional binary type (STRING); + optional binary text (STRING); + optional group line (LIST) { + repeated group list { + optional binary element (STRING); + } + } + optional binary city (STRING); + optional binary district (STRING); + optional binary state (STRING); + optional binary postalCode (STRING); + optional binary country (STRING); + optional group period { + optional binary id (STRING); + optional binary start (STRING); + optional binary end (STRING); + optional int32 _fid; + } + optional int32 _fid; + } + optional boolean valueBoolean; + optional binary valueCode (STRING); + optional group valueCodeableConcept { + optional binary id (STRING); + optional group coding (LIST) { + repeated group list { + optional group element { + optional binary id (STRING); + optional binary system (STRING); + optional binary version (STRING); + optional binary code (STRING); + optional binary display (STRING); + optional boolean userSelected; + optional int32 _fid; + } + } + } + optional binary text (STRING); + optional int32 _fid; + } + optional group valueCoding { + optional binary id (STRING); + optional binary system (STRING); + optional binary version (STRING); + optional binary code (STRING); + optional binary display (STRING); + optional boolean userSelected; + optional int32 _fid; + } + optional binary valueDateTime (STRING); + optional binary valueDate (STRING); + optional fixed_len_byte_array(14) valueDecimal (DECIMAL(32,6)); + optional int32 valueDecimal_scale; + optional group valueIdentifier { + optional binary id (STRING); + optional binary use (STRING); + optional group type { + optional binary id (STRING); + optional group coding (LIST) { + repeated group list { + optional group element { + optional binary id (STRING); + optional binary system (STRING); + optional binary version (STRING); + optional binary code (STRING); + optional binary display (STRING); + optional boolean userSelected; + optional int32 _fid; + } + } + } + optional binary text (STRING); + optional int32 _fid; + } + optional binary system (STRING); + optional binary value (STRING); + optional group period { + optional binary id (STRING); + optional binary start (STRING); + optional binary end (STRING); + optional int32 _fid; + } + optional group assigner { + optional binary reference (STRING); + optional binary display (STRING); + optional int32 _fid; + } + optional int32 _fid; + } + optional int32 valueInteger; + optional group valueReference { + optional binary reference (STRING); + optional binary display (STRING); + optional int32 _fid; + } + optional binary valueString (STRING); + optional int32 _fid; + } + } + } + } + } +} ```