Using Timestamps in Brim
Timestamps are important for establishing patient timelines and making decisions. LLMs represent dates and times as text only, so Brim provides additional tools to support better precision, comparison, and formatting for timestamps.
Timestamps Under the Hood
Timestamps are stored in a standardized text form that captures exactly the components that are known. For example, "June 2019" is stored as 2019-06, never widened to a full date. This built-in precision lets Brim distinguish "June 2019" from "2019-06-17 10:01:30" when displaying and formatting values.
The underlying value is what Brim uses when comparing timestamps for sorting, validation, and conditional generation regardless of how it is formatted or which precision it carries. Precision governs how the value is displayed. Brim never invents components you didn't have unless you turn on padding, below.
Timestamp Formatting
Variables have a timestamp format that determines how values for the variable are displayed within Brim and exported. The format options are below:
| Format | String Version | Example |
| ISO | YYYY-MM-DD HH:MM:SS | 2019-06-17 10:01:30 |
| US | MM/DD/YYYY HH:MM:SS | 06/17/2019 10:01:30 |
| DMY | DD/MM/YYYY HH:MM:SS | 17/06/2019 10:01:30 |
| Month Day, Year | Month D, YYYY HH:MM:SS | June 17, 2019 10:01:30 |
Time-only values always display as HH:MM:SS in every format.
We also provide a "padding" option for partial dates. This determines the behavior you want if the timestamp value is something like "June 2019".
- Padded: This will add a date representing the beginning of the missing period, making "June 2019" display as "2019-06-01" in ISO format. Padding applies in whichever format you've chosen: "June 2019" padded displays as 2019-06-01 (ISO), 06/01/2019 (US), 01/06/2019 (DMY), or June 1, 2019 (Month Day, Year).
- Not Padded: This will display only the known date information, so "June 2019" will display as "2019-06" in ISO format.
You can change timestamp format settings for one timestamp variable in Project Setup > Edit Variable > Semantics. You can also change format settings for many timestamp variables at once: select variables in the Project Setup variables table and choose Action > Change Timestamp Format, or use the "Change timestamp format for variables" notice that appears when existing variables haven't had a format chosen.
Note Date Usage
Some variables should use the note datetime, and some should not. Brim allows specifying this decision on the variable level for greater date accuracy.
You can find this setting in Project Setup > Edit Variable > Semantics for timestamp variables only. Go to the "Note date usage" and select one of the options:
- Blank. This is the default setting. In this case, the LLM will attempt to understand whether the note date should be used for a specific variable by looking at the instructions only. We recommend using another setting if you have more information about how this variable should work.
- Never. If this is selected, this variable can only use note text to compute its value.
- Always. The note's own date is always allowed as this variable's value. When a note's text states a more specific date, the stated date is still used; the note date fills in when the text does not provide one.
- When a condition in the instruction is met. If this is selected, the LLM will use the note datetime only when conditions described in the instruction are met. This should be paired with explicit changes to the variable instruction describing when to use the note datetime.