How to Upload Variables via CSV
Defining your variables in a "Comma-separated values file" or CSV and uploading the CSV is an easy way to create and edit a system of variables.
Brim has different CSV files and formats for the two different types of variable uploads:
- Normal Variables. These variables use only what is available in the medical record and the instructions you provide to generate labels.
- Dependent Variables. These variables use the values of other variables and the instructions you provide to generate labels.
The fields for these also differ (slightly).
CSV Format for Variables
CSV Header: variable_name,instruction,prompt_template,aggregation_instruction,aggregation_prompt_template,variable_type,scope Fields: Variable Name: Name of the variable. Instruction: Instructions on how to extract the variable. Prompt Template: Prompt to use to query the LLM. You can leave this blank to use the default template. Aggregation Instruction: Instructions to aggregate values for ONE_PER_PATIENT and ONE_PER_NOTE. Aggregation Prompt Template: Prompt to aggregate results. You can leave this blank to use the default template. Variable Type: Type of data to extract. Options: boolean, text, integer, float Scope: Granularity to extract data. Options: "one_per_note" - one value per note. "many_per_note" - many values per note. "one_per_patient" - one value per patient (from all notes). Notes: Formatting Options: The following variables can be used in the template. {name} - Variable name {instruction} - Variable instructions {var_type} - Variable Type
CSV Format for Dependent Variables
NOTE: Dependent variables and decisions refer to the same thing.
CSV Header: decision_name,instruction,decision_type,prompt_template,variables Fields: Decision Name: Name of the dependent variable (or outcome) to extract. Instructions: Instructions on how to extract the dependent variable from variable input. Decision Type: Type of data to extract. Options:, boolean, text, integer, float Prompt Template: Prompt to use to query the LLM. Variables: List of variables to feed as input. Expected Format: "[variable_name_1, variable_name_2]" Notes: Formatting Options: The following variables can be used in the template. {name} - Dependent variable name {instruction} - Dependent variable instructions {decision_type} - Dependent variable data type
To upload data:
- Access Project Setup on your Project Dashboard.
- Click on the first section, which should be named "Project Setup".
- Preparing a CSV
- Scroll down to the "Variables" section of the page.
- Click on the "Upload Variables" option.
- You'll see two places to "Choose a File:" one for each of Variables and Dependent Variables. You can click on "Example Format" to see the required fields in each type of CSV, some formatting notes, and a link to a Sample CSV file.
- Each variable CSV file should have a row for each variable with the details for how Brim should extract labels for that variable.
- Select File
- Click "Choose File", and then choose the CSV file you want to upload from your desktop.
- You can upload two files at once, or just one.
- Upload File
- Click on the "Upload" button to upload the selected file.
- Depending on the size of the file, this might take a few seconds, a few minutes, or longer for very long files. You'll see the status in the table change to "Complete" when the variables are ready.
- Preview Data
- After the upload is complete, you can see the variables update in the table at the bottom of the screen, with some in the "Variables" tab and some in the "Dependent Variables" tab.