How to find Data in the MEDITECH Data Repository
Data Repository Talk

How to find Data in the MEDITECH Data Repository

Explore the tools provided by MEDITECH within each application to help find table and column data


Utilizing Data Repository System Tables

Many first time MEDITECH Data Repository report writers find it difficult to find data in the Data Repository tables because they are unfamiliar with the MEDITECH table and column naming conventions.  Luckily for those users, MEDITECH has provided tools within each application as well as system level tables for both the NPR and M-AT platforms that help to identify table and column data.

Within NPR there are:

DrTableMain and DrTableColumns

These tables provide information about which MEDITECH NPR DPM, segments and elements populate the tables and columns in the NPR side (livendb) of the Data Repository.

NOTE: The original system tables that MEDITECH created where named SysDrTables and SysDrColumns. Many sites may still see these tables in their live and test databases. They can be used similar to DrTableMain and DrTableColumns but may not be up to date with the most recent MEDITECH version schema.

Within M-AT there are:

DrTable_Main and DrTable_Columns

These tables provide information about which MEDITECH M-AT object, records and fields populate the tables and columns in the M-AT side (livefdb) of the Data Repository.

Understanding MEDITEDH data storage

Before going further we should discuss the MEDITECH data structure and how application data is stored within MEDITECH as well as SQL. The best example of this is to think of the NPR and M-AT hierarchy as a filing cabinet.

We can start with an application which can be considered a filing cabinet, such as ADM in NPR or REG in M-AT.

NPR ADM Database  M-AT REG Database

In every filing cabinet the drawers are the equivalent of an NPR DPM or M-AT Object which stores the folders and sheets of paper.

NPR ADM.PAT Database  M-AT RegAcct Database

Each folder is the equivalent of an NPR segment or record in the M-AT platform which also correspond to a table in the Data Repository. Because the segment or record resides within the DPM, it will be preceded by the DPM name as seen below with the “main” segment and record:

ADM.PAT Segment  RegAcct_Main Record

Finally we get to the papers/files within each folder in our filing cabinet! These will equate to the data elements or fields in M-AT and NPR or the columns within each table in SQL.

ADM.PAT Data Element  RegAcct Data Element

Finding MEDITECH Data in SQL using DR System Tables

MEDITECH has provided customers with tools in the application fields (SHIFT + F9) in CS/M-AT and (SHIFT+F8) + (SHIFT+F8) in MAGIC which help to tell users if and where that fields data is captured in the Data Repository. This functionality will display the DR Table and Column as well as the NPR DPM, segment, and element where the data is captured to in the MEDITECH structure.

Paired with MEDITECH SHIFT + F9 functionality in M-AT and CS or (SHIFT + F8) + (SHIFT + F8) functionality in MAGIC, the system tables can help users to quickly identify the tables and columns that they would like to use in their queries.

The below queries can be used to find tables and columns in the Data Repository by searching for table names that contain columns with specific text in them OR change the column or table names that they are looking to find in the DR or search for tables based on NPR DPM, segment or elements or M-AT Object, Records or Fields.

NPR Find Table Code

 NPR Output sample

M-AT Find Table Code

M-AT Output Sample

The above queries will be helpful for finding tables and columns that you may want to use when starting your reports. But what if you have already started your report and are looking for a table with a specific column that you want to join to?

The below queries will help users to do just that by utilizing a second join to the DrTable_Columns and DrTableColumns system tables:

NPR Column Find

NPR Column Output

OR

M-AT Find Column Code

M-AT Find Column Output

The results from these queries can be used to help find tables in the same application or different applications that can be joined to.  The tables from each platform can even be joined together to help find M-AT and NPR tables with like columns to pull data from both platforms.

Report writers should make full use of the metadata provided right within the DR to help quickly identify tables and columns needed for their reports and make reporting out of the Data Repository easier and more efficient.


By Taylor Solari at 18 Apr 2017, 09:41 AM
Share this post via

Comments

 

Post a comment

Please correct the following:
Tags
Latest Comments
By Bill Presley at 4 May 2015, 17:09 PM

Authors
Glen D'Abate
Ian Proffer
Bill Presley
Jamie Gerardo
Geoff Grouten
Ken MacPherson
Alexis Donnaruma
Taylor Solari
Theresa Jasset
Howard Minor
Categories
Tutorial
Project
Company Information
Reports
News
Event
Subscribe






rss feedRSS