Other Common Patterns
Purpose: To complete your pattern recognition toolkit with additional conventions found throughout Epic’s database.
Beyond the Big Five
Section titled “Beyond the Big Five”You’ve mastered the major patterns, but Epic’s database contains several more conventions that appear repeatedly. Understanding these completes your ability to navigate any table confidently.
The _YN Boolean Pattern
Section titled “The _YN Boolean Pattern”Epic uses _YN
suffix for all boolean fields, with only two valid values:
The rules are simple:
- ‘Y’ = Yes/True
- ‘N’ = No/False
- NULL = Unknown/Not specified
Never expect ‘T’/‘F’, ‘1’/‘0’, or ‘true’/‘false’—Epic exclusively uses Y/N.
The ID/NAME Pairing Pattern
Section titled “The ID/NAME Pairing Pattern”Epic frequently pairs technical IDs with human-readable names:
This pattern serves two purposes:
- ID: For joining and referential integrity
- NAME: For immediate human readability without joins
The Continuation Table Pattern (_2, _3, _4)
Section titled “The Continuation Table Pattern (_2, _3, _4)”Epic splits wide tables across multiple physical tables:
These aren’t separate entities—they’re chunks of the same logical record, split because:
- SQL Server has column limits
- Chronicles records can be enormous
- Historical reasons from older database versions
Always query them together:
SELECT p.*, p2.*, p3.*FROM PATIENT pLEFT JOIN PATIENT_2 p2 ON p.PAT_ID = p2.PAT_IDLEFT JOIN PATIENT_3 p3 ON p.PAT_ID = p3.PAT_ID;
Date and Time Patterns
Section titled “Date and Time Patterns”Epic uses multiple patterns for temporal data:
Each serves a specific purpose:
- _DTTM: Full datetime stamp
- _DT: Date only (often abbreviated)
- _DATE: Date only (spelled out)
- _TIME: Time portion only
- _REAL: Precise chronological ordering (as you learned)
Financial Amount Pattern (_AMT)
Section titled “Financial Amount Pattern (_AMT)”All monetary values use the _AMT
suffix:
These are always:
- REAL data type
- Stored in dollars (not cents)
- Can be negative (credits, adjustments)
- NULL when not applicable
The Contact Serial Number (_CSN) Pattern
Section titled “The Contact Serial Number (_CSN) Pattern”CSN (Contact Serial Number) is Epic’s unique identifier for encounters:
CSNs are:
- Globally unique across the entire Epic system
- Never reused
- The primary way to link encounter-related data
Putting It All Together
Section titled “Putting It All Together”Let’s see multiple patterns in one query:
Pattern Recognition Checklist
Section titled “Pattern Recognition Checklist”When encountering a new table:
- Check for LINE columns → Indicates one-to-many relationships
- Look for _HX suffix → Has historical tracking
- Scan for _C_NAME → Contains denormalized categories
- Find _REAL columns → Use these for chronological sorting
- Identify _YN fields → Boolean flags with Y/N values
- Spot ID/NAME pairs → Denormalized for convenience
- Check for _2, _3 tables → Continuation of the base table
Key Takeaways
Section titled “Key Takeaways”- _YN columns are Epic’s boolean pattern (Y/N/NULL only)
- ID/NAME pairs provide both referential integrity and human readability
- Continuation tables (_2, _3, _4) are parts of the same logical record
- Date patterns vary: _DTTM (datetime), _DT (date), _TIME (time only)
- _AMT indicates financial amounts in dollars
- _CSN columns contain Contact Serial Numbers for encounter linking
- These patterns combine with the major five to form Epic’s complete data grammar