E-mail
Wednesday, 01 September 2010 07:00

Tricks of the Trade: MEDITECH DR – Way Finding Using NPR DPMs, Segments & Fields

By: John Sharpe, President, Comstock Software, Inc.

Your first adventures with MEDITECH Data Repository (DR) may be spent mapping NPR DPMs, Segments, & Fields to the Tables & Columns in the Data Repository.  This discovery process is essential in finding out how to produce reports you might have written in NPR, with DR as the data source instead.

SysDrTables & SysDrColumns, tables in your DR database, are indispensable as you map your way from NPR to the DR.  You can write ad hoc queries against these tables; or implement a more permanent solution that will save you time in every report you write.

SQL, the language you’ll be using to write reports in the DR, looks a little like this:

mcb0910_1

Resulting in this …

mcb0910_2

So you won’t have to look this code up and run it every time, you or your Database Administrator might implement a stored procedure on your SQL Server that does the same thing.

mcb0910_3

Once the stored procedure is implemented on your DR server, you’ll call it like this:

Example 1 … a search using DPM, Segment, & Field

mcb0910_4

Results in this …

mcb0910_5

Example 2 … a search using DPM, & Field

mcb0910_6

Results in this …

mcb0910_7

Example 3 … a search using just the Field

mcb0910_8

Results in this …

mcb0910_9

As we’ve seen here, stored procedures help you by concentrating your code on the SQL Server where it is reusable, shortening development time for other queries, reports, stored procedures and views in related projects.  In a way, I think of stored procedures as NPR Z.procedures or Z.zcus.procedures for the SQL Server.  My favorite thing about using stored procedures this way - is that I can type 1 line of code, instead of writing a custom query each time I want to look something up.

Thoughts or Questions? Email them to John at jsharpe@comstock-software.com.

 

john-sharpe

 

John Sharpe is President / NPR Consultant at Comstock Software, Inc. Learn more about NPR Report Writing at the MEDITECH NPR Report Writing Blog.

 

 
Copyright © 2012 Systems Personnel - "Your Partner in Healthcare Search & Consulting"
399-meditechbulletin.com and MeditechCareers.com are not affiliated with MEDITECH, Inc.