listLab Instructions

Lab Instructions for HealthGorilla ETL with CCD

Prerequisites

  1. Checked out Lab Repo from GitHub CS595 Lab RepoStep

  2. Pull the code to get the latest updates for GitHub Repo

  3. Python version 3.10 or later

  4. A Python virtual environment to link and use for the project

  5. Do Git Pull on lab repo to make sure you have the latest updates

Setup and Verify LOF Services

  1. Open <Project Root>

  2. Activate the python virtual environment

  3. Go to lof folder

  4. Edit .env file Update client_id and client_secret values with the credentials you have received

    client_id=
    client_secret=
  5. Install Requirements pip install -r requirements.txt

  6. Run services.py

    1. You should see the message : LoF Services verified successfully

Possible Error Messages and resolution:

  1. Missing or Incorrect client_id

    1. Failed to get LoF auth token: 400 : {"error":"Invalid client ID"}

    2. Resolution: Update correct client_id in .env file

  2. Missing or Incorrect client_secret

    1. Failed to get LoF auth token: 401 : {"error":"Unauthorized: Client authentication failed","status":401}

    2. Resolution: Update correct client_secret in .env file

HIN lab

In this lab we will be

  1. Retrieve two patients from Health Gorilla

    1. Registering them with CCD using CCD patient register API

  2. Retrieve patient conditions in HealthGorilla

    1. Populate them to CCD FHIR DB using python FHIRClient SDK

Setup HIN lab

  1. Open <Project Root>

  2. Activate the python virtual environment

  3. Go to /labs/hin

  4. Install Requirements pip install -r requirements.txt

  5. Make sure CCD Services are running

Instructions

Note: Anytime during the exercise if you need to delete patients and rerun the exercise, uncomment the Delete the patient by MRN block in main, update the MRN and delete the patient and patient FHIR data

  1. Step 1 - Populating Patients

    1. Implement retrieve_patient_from_hg function

    2. Implement transform_hg_to_ccd function

    3. Uncomment hg_etl_pipeline.create_patients() code in the main block and run

    4. On a successful run

      1. You should see the below logs

      2. You should the new patients on the CCD UI

        Note: It may take few seconds for the new patients to become visible. Refresh the page. Wait for sometime. If you don't see the new patients close CCD and re-login

      3. Note down the MRN for the patients

  2. Step 2 - Update MRN

    1. Comment hg_etl_pipeline.create_patients() code in the main block

    2. Open patients.json file

    3. Update the corresponding MRN from Step 1 for each patient

  3. Step 3 - Populate Conditions

    1. Implement retrieve_conditions_from_hg

    2. Implement create_ccd_condition

    3. Uncomment Step 3 code block in main and run

    4. The program should run successfully and should insert all the patient conditions from HealthGorilla

      1. Adding some conditions may fail due to some mismatch and missing values.

      2. You can ignore that

    5. Validating the patient conditions on FHIR

      1. http://localhost:8080/fhir/Condition?subject=<your_patient_id>&_pretty=true

    6. Validating the patient conditions on CCD Facesheet

Submission

  1. Both Patient JSON files as per step 3.e

  2. Both Patient Screenshots as per step 3.f

Last updated