Epic’s databases hold the information that your system lives on. Being able to query that data quickly and efficiently is a mark of system mastery. One database tool that I’d like to promote today is the indexes that are created for various items.
Database indexes are lists of record IDs for each known value of the “index item”. An Example: Patient Encounter Date, item EPT 20, is an index item. This means that living in the system right now is a self updating list of all patients who had an encounter for each day your system was running. If necessary, the lists for multiple separate values (the last 3 Mondays) or a range of contiguous values (all of last week) can be generated rapidly. When trying to query the Patient Database, instead of searching through every record in the system, you can limit your search to patients in the Encounter Date index for a range you deem relevant or an appropriate sample (like the last month’s worth of patients). This increases the speed of Chronicles or Clarity Searched by orders of magnitude. The performance gain is even larger if you can find other indexes on items you are searching for. Encounter Provider, EPT 7040, is another indexed item. Combining these indexes lets you easily search for “All of Dr X’s patients seen in the last month”
Nearly anywhere you are asked to enter a Record ID in the text side (Chronicles, EAVIEWID, Reflections record editing) typing the command “key ?” without quotes will bring up a list of all the indexed items the master file has. Likewise if the item is a category list, “key item number=?” will list all categories where at least one record is present and depending on the item, can give you a quick count of how many records are in each index.
I could go on a lot longer, but here are some simple takeaways that help solve problems you might have been stuck on:
- How do I find the parent order of this released order? Search ORD for “key 660=childOrderID”
- How do I find out who’s a member of this pool? Search EMP for key 450=Class ID of Pool. This also works for User Security Template records instead of pools, with index EMP 198 instead.
- How do I find all Order transmittal Destination maps that print to this printer? Search LOM for “key 110=ID of Printer’s LWS record”
- For finding multiple values in the index, you can type commas like “key item number=1,4,8” for multiple values or a colon to make a range, “Key item number=5:25”
You can actually make Indexed items from EPT (like encounter date or Encounter provider/Department) available to end users in Hyperspace as part of the Patient Custom Search Tab. Take care to only add Indexed items to the tab, attempting patient lookup with non-indexed items will appear very slow in Hyperspace. Instructions here: https://galaxy.epic.com/?#Browse/page=7900!68!30!443329,443385,34234,34232