text: CREATE EXTERNAL TABLE [fhir].[MessageHeader] (
      [resourceType] NVARCHAR(4000),
      [id] VARCHAR(64),
      [meta.id] NVARCHAR(4000),
      [meta.extension] NVARCHAR(MAX),
      [meta.versionId] VARCHAR(64),
      [meta.lastUpdated] VARCHAR(30),
      [meta.source] VARCHAR(256),
      [meta.profile] VARCHAR(MAX),
      [meta.security] VARCHAR(MAX),
      [meta.tag] VARCHAR(MAX),
      [implicitRules] VARCHAR(256),
      [language] NVARCHAR(4000),
      [text.id] NVARCHAR(4000),
      [text.extension] NVARCHAR(MAX),
      [text.status] NVARCHAR(64),
      [text.div] NVARCHAR(MAX),
      [extension] NVARCHAR(MAX),
      [modifierExtension] NVARCHAR(MAX),
      [destination] VARCHAR(MAX),
      [sender.id] NVARCHAR(4000),
      [sender.extension] NVARCHAR(MAX),
      [sender.reference] NVARCHAR(4000),
      [sender.type] VARCHAR(256),
      [sender.identifier.id] NVARCHAR(4000),
      [sender.identifier.extension] NVARCHAR(MAX),
      [sender.identifier.use] NVARCHAR(64),
      [sender.identifier.type] NVARCHAR(MAX),
      [sender.identifier.system] VARCHAR(256),
      [sender.identifier.value] NVARCHAR(4000),
      [sender.identifier.period] NVARCHAR(MAX),
      [sender.identifier.assigner] NVARCHAR(MAX),
      [sender.display] NVARCHAR(4000),
      [enterer.id] NVARCHAR(4000),
      [enterer.extension] NVARCHAR(MAX),
      [enterer.reference] NVARCHAR(4000),
      [enterer.type] VARCHAR(256),
      [enterer.identifier.id] NVARCHAR(4000),
      [enterer.identifier.extension] NVARCHAR(MAX),
      [enterer.identifier.use] NVARCHAR(64),
      [enterer.identifier.type] NVARCHAR(MAX),
      [enterer.identifier.system] VARCHAR(256),
      [enterer.identifier.value] NVARCHAR(4000),
      [enterer.identifier.period] NVARCHAR(MAX),
      [enterer.identifier.assigner] NVARCHAR(MAX),
      [enterer.display] NVARCHAR(4000),
      [author.id] NVARCHAR(4000),
      [author.extension] NVARCHAR(MAX),
      [author.reference] NVARCHAR(4000),
      [author.type] VARCHAR(256),
      [author.identifier.id] NVARCHAR(4000),
      [author.identifier.extension] NVARCHAR(MAX),
      [author.identifier.use] NVARCHAR(64),
      [author.identifier.type] NVARCHAR(MAX),
      [author.identifier.system] VARCHAR(256),
      [author.identifier.value] NVARCHAR(4000),
      [author.identifier.period] NVARCHAR(MAX),
      [author.identifier.assigner] NVARCHAR(MAX),
      [author.display] NVARCHAR(4000),
      [source.id] NVARCHAR(4000),
      [source.extension] NVARCHAR(MAX),
      [source.modifierExtension] NVARCHAR(MAX),
      [source.name] NVARCHAR(4000),
      [source.software] NVARCHAR(4000),
      [source.version] NVARCHAR(4000),
      [source.contact.id] NVARCHAR(4000),
      [source.contact.extension] NVARCHAR(MAX),
      [source.contact.system] NVARCHAR(64),
      [source.contact.value] NVARCHAR(4000),
      [source.contact.use] NVARCHAR(64),
      [source.contact.rank] bigint,
      [source.contact.period] NVARCHAR(MAX),
      [source.endpoint] VARCHAR(256),
      [responsible.id] NVARCHAR(4000),
      [responsible.extension] NVARCHAR(MAX),
      [responsible.reference] NVARCHAR(4000),
      [responsible.type] VARCHAR(256),
      [responsible.identifier.id] NVARCHAR(4000),
      [responsible.identifier.extension] NVARCHAR(MAX),
      [responsible.identifier.use] NVARCHAR(64),
      [responsible.identifier.type] NVARCHAR(MAX),
      [responsible.identifier.system] VARCHAR(256),
      [responsible.identifier.value] NVARCHAR(4000),
      [responsible.identifier.period] NVARCHAR(MAX),
      [responsible.identifier.assigner] NVARCHAR(MAX),
      [responsible.display] NVARCHAR(4000),
      [reason.id] NVARCHAR(4000),
      [reason.extension] NVARCHAR(MAX),
      [reason.coding] VARCHAR(MAX),
      [reason.text] NVARCHAR(4000),
      [response.id] NVARCHAR(4000),
      [response.extension] NVARCHAR(MAX),
      [response.modifierExtension] NVARCHAR(MAX),
      [response.identifier] VARCHAR(64),
      [response.code] NVARCHAR(64),
      [response.details.id] NVARCHAR(4000),
      [response.details.extension] NVARCHAR(MAX),
      [response.details.reference] NVARCHAR(4000),
      [response.details.type] VARCHAR(256),
      [response.details.identifier] NVARCHAR(MAX),
      [response.details.display] NVARCHAR(4000),
      [focus] VARCHAR(MAX),
      [definition] VARCHAR(256),
      [event.coding.id] NVARCHAR(4000),
      [event.coding.extension] NVARCHAR(MAX),
      [event.coding.system] VARCHAR(256),
      [event.coding.version] NVARCHAR(4000),
      [event.coding.code] NVARCHAR(4000),
      [event.coding.display] NVARCHAR(4000),
      [event.coding.userSelected] bit,
      [event.uri] VARCHAR(256),
  ) WITH (
      LOCATION='/MessageHeader/**',
      DATA_SOURCE = ParquetSource,
      FILE_FORMAT = ParquetFormat
  );
  
  GO
  
  CREATE VIEW fhir.MessageHeaderDestination AS
  SELECT
      [id],
      [destination.JSON],
      [destination.id],
      [destination.extension],
      [destination.modifierExtension],
      [destination.name],
      [destination.target.id],
      [destination.target.extension],
      [destination.target.reference],
      [destination.target.type],
      [destination.target.identifier],
      [destination.target.display],
      [destination.endpoint],
      [destination.receiver.id],
      [destination.receiver.extension],
      [destination.receiver.reference],
      [destination.receiver.type],
      [destination.receiver.identifier],
      [destination.receiver.display]
  FROM openrowset (
          BULK 'MessageHeader/**',
          DATA_SOURCE = 'ParquetSource',
          FORMAT = 'PARQUET'
      ) WITH (
          [id]   VARCHAR(64),
         [destination.JSON]  VARCHAR(MAX) '$.destination'
      ) AS rowset
      CROSS APPLY openjson (rowset.[destination.JSON]) with (
          [destination.id]               NVARCHAR(4000)      '$.id',
          [destination.extension]        NVARCHAR(MAX)       '$.extension',
          [destination.modifierExtension] NVARCHAR(MAX)       '$.modifierExtension',
          [destination.name]             NVARCHAR(4000)      '$.name',
          [destination.target.id]        NVARCHAR(4000)      '$.target.id',
          [destination.target.extension] NVARCHAR(MAX)       '$.target.extension',
          [destination.target.reference] NVARCHAR(4000)      '$.target.reference',
          [destination.target.type]      VARCHAR(256)        '$.target.type',
          [destination.target.identifier] NVARCHAR(MAX)       '$.target.identifier',
          [destination.target.display]   NVARCHAR(4000)      '$.target.display',
          [destination.endpoint]         VARCHAR(256)        '$.endpoint',
          [destination.receiver.id]      NVARCHAR(4000)      '$.receiver.id',
          [destination.receiver.extension] NVARCHAR(MAX)       '$.receiver.extension',
          [destination.receiver.reference] NVARCHAR(4000)      '$.receiver.reference',
          [destination.receiver.type]    VARCHAR(256)        '$.receiver.type',
          [destination.receiver.identifier] NVARCHAR(MAX)       '$.receiver.identifier',
          [destination.receiver.display] NVARCHAR(4000)      '$.receiver.display'
      ) j
  
  GO
  
  CREATE VIEW fhir.MessageHeaderFocus AS
  SELECT
      [id],
      [focus.JSON],
      [focus.id],
      [focus.extension],
      [focus.reference],
      [focus.type],
      [focus.identifier.id],
      [focus.identifier.extension],
      [focus.identifier.use],
      [focus.identifier.type],
      [focus.identifier.system],
      [focus.identifier.value],
      [focus.identifier.period],
      [focus.identifier.assigner],
      [focus.display]
  FROM openrowset (
          BULK 'MessageHeader/**',
          DATA_SOURCE = 'ParquetSource',
          FORMAT = 'PARQUET'
      ) WITH (
          [id]   VARCHAR(64),
         [focus.JSON]  VARCHAR(MAX) '$.focus'
      ) AS rowset
      CROSS APPLY openjson (rowset.[focus.JSON]) with (
          [focus.id]                     NVARCHAR(4000)      '$.id',
          [focus.extension]              NVARCHAR(MAX)       '$.extension',
          [focus.reference]              NVARCHAR(4000)      '$.reference',
          [focus.type]                   VARCHAR(256)        '$.type',
          [focus.identifier.id]          NVARCHAR(4000)      '$.identifier.id',
          [focus.identifier.extension]   NVARCHAR(MAX)       '$.identifier.extension',
          [focus.identifier.use]         NVARCHAR(64)        '$.identifier.use',
          [focus.identifier.type]        NVARCHAR(MAX)       '$.identifier.type',
          [focus.identifier.system]      VARCHAR(256)        '$.identifier.system',
          [focus.identifier.value]       NVARCHAR(4000)      '$.identifier.value',
          [focus.identifier.period]      NVARCHAR(MAX)       '$.identifier.period',
          [focus.identifier.assigner]    NVARCHAR(MAX)       '$.identifier.assigner',
          [focus.display]                NVARCHAR(4000)      '$.display'
      ) j
  