Skip to content

fix(mimic-iv): retain device-only rows in oxygen_delivery #143

fix(mimic-iv): retain device-only rows in oxygen_delivery

fix(mimic-iv): retain device-only rows in oxygen_delivery #143

Workflow file for this run

name: mysql demo db build
on:
pull_request_review:
types: [submitted]
jobs:
mimic-iv-mysql:
# only run if PR is approved
if: github.event.review.state == 'approved'
runs-on: ubuntu-22.04
steps:
- name: Check out repository code
uses: actions/checkout@v7
- name: Download demo data
uses: ./.github/actions/download-demo
- name: Extract demo data to local folder
run: |
# download-demo provides the gzipped CSVs under hosp/, icu/ and ed/.
# Flatten every nested CSV into the working directory, where the mysql
# load.sql scripts expect them (e.g. LOAD DATA INFILE 'admissions.csv').
# Using find keeps this robust to how deeply the files are nested.
# NB: copy (not move) so hosp/, icu/ and ed/ retain their contents
# and the cache is preserved.
find . -mindepth 2 -name '*.csv.gz' -exec cp -t ./ {} +
gzip -d *.csv.gz
- name: Start MySQL service
run: |
sudo /etc/init.d/mysql start
mysql -u root -proot -e "SET GLOBAL local_infile=1;"
mysql -u root -proot -e "SET GLOBAL sql_notes=0;"
mysql -u root -proot -e "create database mimic"
- name: Load icu/hosp demo data
run: |
echo "Loading data into mysql."
mysql -u root -proot --local-infile=1 mimic < mimic-iv/buildmimic/mysql/load.sql
mysql -u root -proot mimic < mimic-iv/buildmimic/mysql/validate_demo.sql > results
# if we find "FAILED", then we did not pass the build
if grep -F -q "FAILED" results; then
echo "Failed the following row counts:"
head -n 1 results
grep "FAILED" results
exit 1
else
echo "Built and loaded demo data successfully."
cat results
fi
- name: Load ed demo data
run: |
echo "Loading data into mysql."
mysql -u root -proot --local-infile=1 mimic < mimic-iv-ed/buildmimic/mysql/load.sql
mysql -u root -proot mimic < mimic-iv-ed/buildmimic/mysql/validate_demo.sql > results
# if we find "FAILED", then we did not pass the build
if grep -F -q "FAILED" results; then
echo "Failed the following row counts:"
head -n 1 results
grep "FAILED" results
exit 1
else
echo "Built and loaded demo data successfully."
cat results
fi