keys to data repository data mapping - meditech · keys to data repository data mapping the...

8
Keys to Data Repository Data Mapping The MEDITECH Data Repository application provides convenient access to your MEDITECH data in a SQL database comprised of thousands of tables. To facilitate the best possible use of your data assets, MEDITECH provides resources to help you easily navigate these tables and pinpoint the data you need. These resources come in the form of SQL tables, Data Repository routines and online Data Model for linking tables. SQL Tables for Data Mapping In SQL, two mapping tables exist in both the MEDITECH TEST and LIVE databases: SysDrTables and SysDrColumns. Each can be queried like any other table. However, unlike other tables, they do not contain hospital-specific data from your MEDITECH system. SysDrTables and SysDrColumns indicate where your MEDITECH data exists in your SQL database. These tables also allow you to trace the path backwards to discover where a piece of data in SQL is stored in MEDITECH. SysDrTables and SysDrColumns help you understand how your MEDITECH data maps to your SQL database. Starting with SysDrTables, this table contains a complete list of all MEDITECH tables that are available in your SQL database for reporting. When opening SQL Server Management Studio, begin a New Query in either your TEST or LIVE database, and run the following SQL query: This query will return the complete contents of the table SysDrTables. Each row in your results is one table that is available in your Data Repository SQL database for reporting. Each column in SysDrTables provides information describing that table. Here are the columns to note: TableID Table mnemonic Application Feeder application from which table is populated Keylevel Type of information contained in the table

Upload: trinhkiet

Post on 10-Jul-2018

277 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Keys to Data Repository Data Mapping - MEDITECH · Keys to Data Repository Data Mapping The MEDITECH Data Repository application provides convenient access to your MEDITECH data in

Keys to Data Repository Data Mapping

The MEDITECH Data Repository application provides convenient access to your MEDITECH data in a SQLdatabase comprised of thousands of tables. To facilitate the best possible use of your data assets,MEDITECH provides resources to help you easily navigate these tables and pinpoint the data you need.These resources come in the form of SQL tables, Data Repository routines and online Data Model for linkingtables.

SQL Tables for Data Mapping

In SQL, two mapping tables exist in both the MEDITECH TEST and LIVE databases: SysDrTables andSysDrColumns. Each can be queried like any other table. However, unlike other tables, they do notcontain hospital-specific data from your MEDITECH system.

SysDrTables and SysDrColumns indicate where your MEDITECH data exists in your SQL database. Thesetables also allow you to trace the path backwards to discover where a piece of data in SQL is stored inMEDITECH. SysDrTables and SysDrColumns help you understand how your MEDITECH data maps to yourSQL database.

Starting with SysDrTables, this table contains a complete list of all MEDITECH tables that are available inyour SQL database for reporting. When opening SQL Server Management Studio, begin a New Query ineither your TEST or LIVE database, and run the following SQL query:

This query will return the complete contents of the table SysDrTables. Each row in your results is onetable that is available in your Data Repository SQL database for reporting.

Each column in SysDrTables provides information describing that table. Here are the columns to note:

TableID Table mnemonic

Application Feeder application from which table is populated

Keylevel Type of information contained in the table

Page 2: Keys to Data Repository Data Mapping - MEDITECH · Keys to Data Repository Data Mapping The MEDITECH Data Repository application provides convenient access to your MEDITECH data in

Name Table name

Using only this table you could identify all of the dictionary tables for a given application or all tables thatcontain visit specific information using the Keylevel column, or simply look up the name of a table given itsMEDITECH defined mnemonic (TableID).

The following table contains a list of all Keylevels a description of each, and a table example for each:

PS PATIENT SPECIFICSINGULAR

PatientID is the patient-specific primarykey

MriPatients (PATIENTS)

PM PATIENT SPECIFICMULTIPLE

PatientID is the patient-specific columnwhich is part of the primary key.Another column(s) (besides VisitID andSourceID) is also part of the primary keywhich allows multiple rows to exist for asingle PatientID

MriPatientEmploymentInfo(DRCEMP)

PF PATIENT SPECIFICFOREIGN KEY

PatientID is a foreign key BbkHistory (BBKHIST)

PV PATIENT SPECIFICVISIT

Both PatientID and VisitID are part ofthe primary key

MriPatientVisitEvents(PATEV)

V VISIT SPECIFIC VisitID is the patient-specific primarykey

AdmittingData (ADMITTIN)

VF VISIT SPECIFICFOREIGN KEY

VisitID is a foreign key OeOrders (ORDERS)

NP NON-PATIENTSPECIFIC

No patient-specific key in table. Datanot specific to any patient file

PpEmployeePayroll(PPEMPPF)

T TEXT Store lines of text in table rows. PthSpecimenFindingsText(PTHFTXT)

D DICTIONARY Used to store data from MAGICdictionaries

DMisDirectionModule(MISDIRMO)

To realize the greatest benefit, use SysDrTables in conjunction with SysDrColumns.

Run the following query to view the contents of SysDrColumns:

Each row in SysDrColumns represents a single column that is available to you in your Data Repository. Toput this another way, each NPR Element in MEDITECH corresponds to one column in SQL, and SysDrColumnslists all of your available columns and their corresponding NPR Element.

Page 3: Keys to Data Repository Data Mapping - MEDITECH · Keys to Data Repository Data Mapping The MEDITECH Data Repository application provides convenient access to your MEDITECH data in

Each column in SysDrColumns contains information that helps define that Element. Here are the columns tonote:

TableID Table mnemonic for the table in which this column exists (a column common to bothSysDrTables and SysDrColumns)

Name Column name

DataType SQL data type for the column (ex. varchar, int, datetime, etc.)

Length The defined maximum length of the column

SortKey Indicates whether this column is a primary key

NprDpm NPR DPM from which data is populated from

NprSegment NPR Segment from which data is populated from

NprElement Corresponding NPR element for the column

ColumnPosition The position (counting from the left) of this column within the table

Given a particular NPR Element you can identify every table to which that piece of data flows. Moreimportantly, now that you have an idea of what each table contains, you can use the tables together totake full advantage of the information they contain and find any piece of data you need.

Together, SysDrTables and SysDrColumns enables you to find where any piece of data resides in SQL, orfrom where it originates in MEDITECH. Consider a scenario in which you have an NPR Element,ADM.PAT.allergy, and you want to find where that piece of data ends up when it is filed in its application.Try the following query:

You can see that this piece of data is available in just one column in your Data Repository SQL database,called “Allergy”. Next, run the following query to include information from SysDrTables and find out whattable the Allergy column is a part of:

Page 4: Keys to Data Repository Data Mapping - MEDITECH · Keys to Data Repository Data Mapping The MEDITECH Data Repository application provides convenient access to your MEDITECH data in

This query builds on your previous query by returning everything from both SysDrTables and SysDrColumns.You can now identify the SQL Table and Column where the ADM.PAT.allergy data resides, but the querycan be further improved to present this information more intuitively.

The results of this query tell you that the ADM.PAT.allergy element corresponds to the Allergy column,which is part of the AdmAllergies table. More importantly, this query is the basic format that you can use towork with SysDrTables and SysDrColumns. By altering the “where” clause you can ask many usefulquestions about your MEDITECH data. If you take any piece of information from this article, make itthis query! Try it out; augment the “where” clause, and start to gain a better understanding of how tonavigate your MEDITECH database.

In the previous example you worked with a known NPR Element to find a specific column, but you can alsoreverse this process. Given a column of data, if you wish to find the NPR DPM, segment, and element thatpopulates it, you can use the basic structure of this query and make a few adjustments to the “where”clause. Consider the “Address1” column in the “AdmVisits” table. In working with this column, if you want toknow what MEDITECH structure populates it, try the following query:

Page 5: Keys to Data Repository Data Mapping - MEDITECH · Keys to Data Repository Data Mapping The MEDITECH Data Repository application provides convenient access to your MEDITECH data in

You will see that the “ADM.PAT.pat.street” element populates the “Address1” column.

Finally, consider a possible scenario: you know your future reporting needs will require data from aparticular DPM or Segment. You can determine which tables the segment populates, and request your DataRepository specialist enable and populate those tables (if they are not already). For example, if your futurereporting needs require data from the “LAB.L.SPEC.main” segment, run the following query to determinewhich tables and columns this segment populates:

These examples illustrate the power of SysDrTables and SysDrColumns, when used together, to be yourmap of MEDITECH to SQL data flow and guide you efficiently through your database. Given a piece ofinformation as input (e.g. element, column name, etc.), you can use this basic query format to derive

Page 6: Keys to Data Repository Data Mapping - MEDITECH · Keys to Data Repository Data Mapping The MEDITECH Data Repository application provides convenient access to your MEDITECH data in

valuable information about where data originates from in MEDITECH, or where it flows to in SQL.

Application Routines and Functions

MEDITECH provides additional resources to use in conjunction with SysDrTables and SysDrColumns. Usesome of the following methods to identify pieces of information you can use as input to your SysDrColumnsand SysDrTables queries.

Table Inquiry - Identify a table in this routine by name or mnemonic and it will provided detailedinformation about the table itself, the columns in the table, and the NPR Elements that correspond to thosecolumns. If you are more comfortable working in MEDITECH environments than SQL, this is a good place togather some of the same information as we identified with the queries above.

Field Inquiry - Provide an NPR element and learn the Data Repository SQL Table and Column in which thisElement is stored.

Page 7: Keys to Data Repository Data Mapping - MEDITECH · Keys to Data Repository Data Mapping The MEDITECH Data Repository application provides convenient access to your MEDITECH data in

Shift+F9 - Within your MEDITECH applications you can determine the NPR DPM, Segment, and Element ofany field that you come across by pressing Shift+F9 in the field. If you know you want to work with thedata from a particular field in an application you can use “Shift+F9” to identify the corresponding DataRepository SQL information.

In the event that the NPR data element is defined as 'Not captured by DR', please take the NPR elementinfo provided from this Shift+F9, and use the tools outlined above to find the element or a similar namedelement. Some MEDITECH screens are designed to use temporary data structures which do not produce theproper Data Repository Information to the screen. However, the data structure that will ultimately housethis temporary data will most likely have a corresponding SQL table.

Page 8: Keys to Data Repository Data Mapping - MEDITECH · Keys to Data Repository Data Mapping The MEDITECH Data Repository application provides convenient access to your MEDITECH data in

Online Data Model

Finally, at www.meditech.com on the Data Repository Product and Resource homepage you can access theonline Data Model under DR support.

The online Data Model allows you to view how tables can be linked in SQL and also depicts tablerelationships for SQL reporting.