Skip to content

Renaming URL

alexmbennett2 edited this page Jan 6, 2023 · 12 revisions

Renaming URL

To rename the URL across all of the MIMIC FHIR files use sed:

Linux: find . -type f -exec sed -i 's/mimic.mit.edu\/fhir/mimic.mit.edu\/fhir\/mimic/g' {} + Mac: find . -type f -exec sed -i '' s/mimic.mit.edu\/fhir/mimic.mit.edu\/fhir\/mimic/g {} +

  • find . -type f {} +: grabs all the files in the base directory '.'
  • sed
    • -i replaces in place
    • /g replaces all instances in a file (default is only replace first)
    • You need to escape the special charters with a backslash (ie / needs to be \/)\

Apply this to both the mimic-fhir and mimic-profiles repos

Steps to regenerate a valid demo

  1. Regenerate mimic_fhir schema with create_fhir_tables.sql
  • psql -d mimic_demo -f create_fhir_tables.sql
  1. Update terminology
  • Need to create terminology for everything, so run create_fhir_terminology.sql on full mimic db
    • psql -d mimic -f create_fhir_terminology.sql
  • py_mimic_fhir terminology --version=2.0 ***
    • Need to update .env to point DBNAME_MIMIC='mimic'
    • Run source.env
  1. Generate updated IG from mimic-profiles
  • ./_genonce.sh
  1. Create a new FHIR Store
  • To avoid conflicts in the resources/profiles it's suggested to create a new FHIR Store
  • gcloud healthcare fhir-stores create $GOOGLE_DATASTORE --dataset=$GOOGLE_DATASET --version=R4 --enable-update-create
    • GOOGLE_DATASTORE=
    • GOOGLE_DATASET=mimic-iv-on-fhir-dataset
  1. Update IG on Google Healthcare API
  1. Validate/populate mimic-fhir FHIR Store
  • make sure .env file in mimic-fhir repo updated with
    • DBNAME_MIMIC='mimic_demo'
    • FHIR_VALIDATOR='GCP'
    • Run source .env
  • Using Google Healthcare API: py_mimic_fhir validate --num_patients=100 --init
    • need the init flag to post the medication, locations, and organization resources (only need to load once)