-- DBMS: bigquery
CREATE TABLE `bigquery-public-data.fhir_synthea.procedure`
(
  basedOn ARRAY<STRUCT<carePlanId STRING, procedureRequestId STRING, referralRequestId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, display STRING>>, display STRING>>, display STRING>>,
  bodySite ARRAY<STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>>,
  category STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>,
  complication ARRAY<STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>>,
  complicationDetail ARRAY<STRUCT<conditionId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, display STRING>>, display STRING>>, display STRING>>,
  definition ARRAY<STRUCT<planDefinitionId STRING, activityDefinitionId STRING, healthcareServiceId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, display STRING>>, display STRING>>, display STRING>>,
  focalDevice ARRAY<STRUCT<action STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, manipulated STRUCT<deviceId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, display STRING>>, display STRING>>, display STRING>>>,
  followUp ARRAY<STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>>,
  identifier ARRAY<STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, display STRING>>, display STRING>>>,
  implicitRules STRING,
  language STRING,
  location STRUCT<locationId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, display STRING>>, display STRING>>, display STRING>,
  notDone BOOL,
  notDoneReason STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>,
  note ARRAY<STRUCT<author STRUCT<reference STRUCT<practitionerId STRING, patientId STRING, relatedPersonId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, display STRING>>, display STRING>>, display STRING>, string STRING>, time STRING, text STRING>>,
  outcome STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>,
  partOf ARRAY<STRUCT<procedureId STRING, observationId STRING, medicationAdministrationId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, display STRING>>, display STRING>>, display STRING>>,
  performer ARRAY<STRUCT<role STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, actor STRUCT<practitionerId STRING, organizationId STRING, patientId STRING, relatedPersonId STRING, deviceId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, display STRING>>, display STRING>>, display STRING>, onBehalfOf STRUCT<organizationId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, display STRING>>, display STRING>>, display STRING>>>,
  reasonCode ARRAY<STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>>,
  report ARRAY<STRUCT<diagnosticReportId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, display STRING>>, display STRING>>, display STRING>>,
  text STRUCT<status STRING, div STRING>,
  usedCode ARRAY<STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>>,
  usedReference ARRAY<STRUCT<deviceId STRING, medicationId STRING, substanceId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, display STRING>>, display STRING>>, display STRING>>,
  shr_action_PerformedContext_extension STRUCT<shr_action_Status_extension STRUCT<value STRUCT<code STRING>>>,
  code STRUCT<coding ARRAY<STRUCT<userSelected BOOL, version STRING, code STRING, display STRING, system STRING>>, text STRING>,
  context STRUCT<display STRING, episodeOfCareId STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, display STRING>>, display STRING>>, reference STRING, encounterId STRING>,
  id STRING,
  meta STRUCT<lastUpdated TIMESTAMP, security ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, tag ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, versionId STRING, profile ARRAY<STRING>>,
  performed STRUCT<dateTime STRING, period STRUCT<`end` STRING, start STRING>>,
  reasonReference ARRAY<STRUCT<identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, display STRING>>, display STRING>>, observationId STRING, reference STRING, conditionId STRING, display STRING>>,
  status STRING,
  subject STRUCT<display STRING, groupId STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, identifier STRUCT<use STRING, type STRUCT<coding ARRAY<STRUCT<system STRING, version STRING, code STRING, display STRING, userSelected BOOL>>, text STRING>, system STRING, value STRING, period STRUCT<start STRING, `end` STRING>, assigner STRUCT<organizationId STRING, reference STRING, display STRING>>, display STRING>>, reference STRING, patientId STRING>
);

INSERT INTO `bigquery-public-data.fhir_synthea.procedure` (basedOn, bodySite, category, complication, complicationDetail, definition, focalDevice, followUp, identifier, implicitRules, language, location, notDone, notDoneReason, note, outcome, partOf, performer, reasonCode, report, text, usedCode, usedReference, shr_action_PerformedContext_extension, code, context, id, meta, performed, reasonReference, status, subject) VALUES ('[]', '[]', NULL, '[]', '[]', '[]', '[]', '[]', '[]', NULL, NULL, NULL, NULL, NULL, '[]', NULL, '[]', '[]', '[]', '[]', NULL, '[]', '[]', {'shr_action_Status_extension': {'value': {'code': 'completed'}}}, {'coding': "[{'userSelected': None, 'version': None, 'code': '22523008', 'display': 'Vasectomy', 'system': 'http://snomed.info/sct'}]", 'text': 'Vasectomy'}, {'display': None, 'episodeOfCareId': None, 'identifier': None, 'reference': None, 'encounterId': 'a3eeee1f-b15a-41f5-955e-507b7dab75df'}, 'aacc15be-55e9-4b8f-9705-8c4cb10a78e5', {'lastUpdated': None, 'security': '[]', 'tag': '[]', 'versionId': None, 'profile': "['http://standardhealthrecord.org/fhir/StructureDefinition/shr-procedure-ProcedurePerformed']"}, {'dateTime': None, 'period': {'end': '1993-03-06T23:22:46+00:00', 'start': '1993-03-06T22:22:46+00:00'}}, '[]', 'completed', {'display': None, 'groupId': None, 'identifier': None, 'reference': None, 'patientId': '01c5a8ae-406a-4442-bbf5-7ad2dc8dd8fa'}), ('[]', '[]', NULL, '[]', '[]', '[]', '[]', '[]', '[]', NULL, NULL, NULL, NULL, NULL, '[]', NULL, '[]', '[]', '[]', '[]', NULL, '[]', '[]', {'shr_action_Status_extension': {'value': {'code': 'completed'}}}, {'coding': "[{'userSelected': None, 'version': None, 'code': '22523008', 'display': 'Vasectomy', 'system': 'http://snomed.info/sct'}]", 'text': 'Vasectomy'}, {'display': None, 'episodeOfCareId': None, 'identifier': None, 'reference': None, 'encounterId': 'd217d9af-ff16-448d-a0b9-fa80c76a1c6e'}, '3be59d70-69b1-475a-b195-e606684e14fd', {'lastUpdated': None, 'security': '[]', 'tag': '[]', 'versionId': None, 'profile': "['http://standardhealthrecord.org/fhir/StructureDefinition/shr-procedure-ProcedurePerformed']"}, {'dateTime': None, 'period': {'end': '2015-12-07T00:41:16+00:00', 'start': '2015-12-06T23:41:16+00:00'}}, '[]', 'completed', {'display': None, 'groupId': None, 'identifier': None, 'reference': None, 'patientId': '88baaa31-4eb0-4282-a6f3-a50abf400be1'}), ('[]', '[]', NULL, '[]', '[]', '[]', '[]', '[]', '[]', NULL, NULL, NULL, NULL, NULL, '[]', NULL, '[]', '[]', '[]', '[]', NULL, '[]', '[]', {'shr_action_Status_extension': {'value': {'code': 'completed'}}}, {'coding': "[{'userSelected': None, 'version': None, 'code': '22523008', 'display': 'Vasectomy', 'system': 'http://snomed.info/sct'}]", 'text': 'Vasectomy'}, {'display': None, 'episodeOfCareId': None, 'identifier': None, 'reference': None, 'encounterId': 'e5ad7ba1-d09d-4895-9b14-d331e672196b'}, 'c9281c23-facd-4d6a-b609-6ce13177ee20', {'lastUpdated': None, 'security': '[]', 'tag': '[]', 'versionId': None, 'profile': "['http://standardhealthrecord.org/fhir/StructureDefinition/shr-procedure-ProcedurePerformed']"}, {'dateTime': None, 'period': {'end': '2013-06-17T14:38:59+00:00', 'start': '2013-06-17T13:38:59+00:00'}}, '[]', 'completed', {'display': None, 'groupId': None, 'identifier': None, 'reference': None, 'patientId': 'f6002772-ecdc-4906-9597-0e3f78312ac3'}), ('[]', '[]', NULL, '[]', '[]', '[]', '[]', '[]', '[]', NULL, NULL, NULL, NULL, NULL, '[]', NULL, '[]', '[]', '[]', '[]', NULL, '[]', '[]', {'shr_action_Status_extension': {'value': {'code': 'completed'}}}, {'coding': "[{'userSelected': None, 'version': None, 'code': '22523008', 'display': 'Vasectomy', 'system': 'http://snomed.info/sct'}]", 'text': 'Vasectomy'}, {'display': None, 'episodeOfCareId': None, 'identifier': None, 'reference': None, 'encounterId': 'c3f70c08-07b3-4ad6-8dde-53b22738269e'}, '6fc8a1df-a4eb-4f40-8d11-3921d6cdc6a7', {'lastUpdated': None, 'security': '[]', 'tag': '[]', 'versionId': None, 'profile': "['http://standardhealthrecord.org/fhir/StructureDefinition/shr-procedure-ProcedurePerformed']"}, {'dateTime': None, 'period': {'end': '2018-05-26T13:38:10+00:00', 'start': '2018-05-26T12:38:10+00:00'}}, '[]', 'completed', {'display': None, 'groupId': None, 'identifier': None, 'reference': None, 'patientId': '89c367ed-f01d-40d3-8e86-e9ff62e64e67'}), ('[]', '[]', NULL, '[]', '[]', '[]', '[]', '[]', '[]', NULL, NULL, NULL, NULL, NULL, '[]', NULL, '[]', '[]', '[]', '[]', NULL, '[]', '[]', {'shr_action_Status_extension': {'value': {'code': 'completed'}}}, {'coding': "[{'userSelected': None, 'version': None, 'code': '22523008', 'display': 'Vasectomy', 'system': 'http://snomed.info/sct'}]", 'text': 'Vasectomy'}, {'display': None, 'episodeOfCareId': None, 'identifier': None, 'reference': None, 'encounterId': '1801fbb1-e14d-466b-84a7-fe688e965657'}, 'fbffd20d-5220-4f2b-a2cc-bc5f680e232e', {'lastUpdated': None, 'security': '[]', 'tag': '[]', 'versionId': None, 'profile': "['http://standardhealthrecord.org/fhir/StructureDefinition/shr-procedure-ProcedurePerformed']"}, {'dateTime': None, 'period': {'end': '2010-02-16T21:44:09+00:00', 'start': '2010-02-16T20:44:09+00:00'}}, '[]', 'completed', {'display': None, 'groupId': None, 'identifier': None, 'reference': None, 'patientId': 'cadc44a4-5197-4580-a4ed-ae178f23de56'});