Skip to content

Directory Structure and Scripts

Elsa Perelli edited this page Jan 25, 2024 · 3 revisions

src Directory Structure

The following sub-directories exist in the src directory:

  • compartment-definition - Contains copy of the patient compartment definition, which is used as a reference for allowable resource types. Used with npm script to compile all resource types that reference patients.
  • resources - Sets up BeeQueue export queue to establish new Redis Connectathon.
  • scripts - Contains database setup scripts and data upload scripts.
  • server - Connects to server, established queue that pulls down the jobs on Redis to handle, and establishes server endpoints.
  • services - Contains the following services:
    • bulkstatus.service - checks bulk export status (in progress, completed, etc.)
    • bundle.service - handles transaction bundle uploads
    • export.service - handles export level and validates provided parameters
    • group.service - manages FHIR group creation, updates, etc.
    • ndjson.service - returnes exported ndjson
  • util - Contains a variety of helper functions, including:
    • ValueSet handling for _typeFilter
    • Mongo setup
    • exportToNDJson file - contains the bulk of the logic on query building from the provided bulk parameters

Available npm Scripts

  • upload-bundles - Pulls bundles from the ecqm-content-r4-2021 repository. Requires that the repository is cloned locally in order to upload bundles successfully.
  • parse-compartment-def - Parses the compartment definition that is checked into the repository. Used for assembling list of resource types for patient-level and group-level export. Only needs to be run if the patient compartment definition gets updated.
  • post-txn-bundles - Takes in a directory of transaction bundles (ex. Synthea exports) and performs transaction bundle upload via POST request. Requires a directory path to the bundles and a group id to use for creating the new group containing the uploaded patients from the transaction bundles.
Clone this wiki locally