File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22# This script makes the _version table for each schema in BigQuery,
33# Currently hard-coded to the status as of 2025-04-20.
4- export VERSION_TABLE= " _version "
4+ export METADATA_TABLE= " _metadata "
55
66# create an array of target datasets and versions
77# loop through them at the same time
@@ -18,16 +18,16 @@ for entry in "${datasets[@]}"; do
1818 export TARGET_DATASET
1919 export MIMIC_VERSION
2020
21- echo " Creating ${TARGET_DATASET} .${VERSION_TABLE } table"
21+ echo " Creating ${TARGET_DATASET} .${METADATA_TABLE } table"
2222 bq query << EOF
23- CREATE TABLE IF NOT EXISTS \` physionet-data.${TARGET_DATASET} .${VERSION_TABLE } \` (
23+ CREATE TABLE IF NOT EXISTS \` physionet-data.${TARGET_DATASET} .${METADATA_TABLE } \` (
2424 attribute STRING,
2525 value STRING
2626);
2727
28- TRUNCATE TABLE \` physionet-data.${TARGET_DATASET} .${VERSION_TABLE } \` ;
28+ TRUNCATE TABLE \` physionet-data.${TARGET_DATASET} .${METADATA_TABLE } \` ;
2929
30- INSERT INTO \` physionet-data.${TARGET_DATASET} .${VERSION_TABLE } \` (attribute, value)
30+ INSERT INTO \` physionet-data.${TARGET_DATASET} .${METADATA_TABLE } \` (attribute, value)
3131VALUES
3232 ('mimic_version', '${MIMIC_VERSION} ');
3333EOF
Original file line number Diff line number Diff line change 11#! /bin/bash
22# This script generates the concepts in the BigQuery table mimiciv_derived.
33export TARGET_DATASET=mimiciv_derived
4- export VERSION_TABLE= " _version "
4+ export METADATA_TABLE= " _metadata "
55export MIMIC_VERSION=" 3.1"
66
77# specify bigquery query command options
2323GIT_COMMIT_HASH=$( git rev-parse HEAD)
2424LATEST_GIT_TAG=$( git describe --tags --abbrev=0)
2525
26- echo " Creating ${TARGET_DATASET} .${VERSION_TABLE } table"
26+ echo " Creating ${TARGET_DATASET} .${METADATA_TABLE } table"
2727bq query << EOF
28- CREATE TABLE IF NOT EXISTS \` physionet-data.${TARGET_DATASET} .${VERSION_TABLE } \` (
28+ CREATE TABLE IF NOT EXISTS \` physionet-data.${TARGET_DATASET} .${METADATA_TABLE } \` (
2929 attribute STRING,
3030 value STRING
3131);
3232
33- TRUNCATE TABLE \` physionet-data.${TARGET_DATASET} .${VERSION_TABLE } \` ;
33+ TRUNCATE TABLE \` physionet-data.${TARGET_DATASET} .${METADATA_TABLE } \` ;
3434
35- INSERT INTO \` physionet-data.${TARGET_DATASET} .${VERSION_TABLE } \` (attribute, value)
35+ INSERT INTO \` physionet-data.${TARGET_DATASET} .${METADATA_TABLE } \` (attribute, value)
3636VALUES
3737 ('mimic_version', '${MIMIC_VERSION} '),
3838 ('mimic_code_version', '${LATEST_GIT_TAG} '),
You can’t perform that action at this time.
0 commit comments