About MEDITECH Reports

 

View John Sharpe's profile on LinkedInI'm your host, John Sharpe, a MEDITECH Consultant living in Spokane, WA. Read more ...

Connect ...

Expand your network by connecting on these social media sites:

Sign up for the MEDITECH Reports Blog; details to attend MEDITECH workshops are sent out 1 week in advance to all MEDITECH Report blog subscribers.

These MEDITECH Workshops are sponsored by Donna Carroll at the MEDITECH Community Bulletin

MEDITECH NPR & RW RESOURCES:

Ascii Table: For NPR Report Writer
Loop Builder: For NPR Macros
Key Codes: For CDS Attributes
List Builder: For NPR Macros
MT Report Names: For NPR Reports
MT Structure Viewer: For Physicals
Strings: Format & Sort

HIT Topics

MEDITECH Reports

Current Articles | RSS Feed RSS Feed

Ad Hoc Reporting for MEDITECH NPR Data Definitions

 

MEDITECH fields, at times, can elude even experienced NPR Report Writers.  Let's review a quick way to find them using an unlikely technology for this task: SQL Server.

To produce unique lists of DPMS, SEGMENTS, & FIELDS from your MEDITECH Data Definitions, load them into a SQL Server database and then run ad hoc SQL queries against them.  Today, I want to show you how to use SQL Server to: De-duplicate a list, Find fields by DPM, & Learn about fields that compile to the same object code. 

Let's get started.

[De-Duplicate a List]

Want a list of DPMS from your MEDITECH Data Defs? Try a query like this in SQL Server. 

Select Distinct 0 resized 600

One problem, you'll notice is that the list of 140K+ rows is not unique. To de-duplicate the list, you could add a GROUP BY clause.

Select Unique Group By Clause resized 600

Or if you prefer a standardized method of de-duplicating the list, try the SQL Keyword DISTINCT

Select Distinct 2 resized 600

The record count of 1894 rows is the same for our data set here, for either approach you use. 

[Find Fields]

Looking for a field containing the letters 'drg'?  Want only fields from BAR?  Add a WHERE clause for DPM and FIELD.

MEDITECH Find NPR Field SQL resized 600


[Fields Compiling to Same Local Variable]

How many fields share the local variable for ADM.PAT.urn? In CS 5.5 about: 243, depending on which MEDITECH modules you have installed.

MEDITECH Fields Sharing Local Variable resized 600

Which MEDITECH applications contain a reference to 'aa' the local variable for ADM.PAT.urn?  Depending on the MEDITECH modules you have installed, about: 21.

MEDITECH Applications Containing Local Variable ADM.PAT.urn resized 600

Now when you're having trouble finding a field, this approach might help you find it.

Want an alert when the next post is published? Click the phone and Subscribe to the MEDITECH Reports Blog!

Subscribe to the Meditech Blog     

                                                                                                                                                                                                          

Comments

Currently, there are no comments. Be the first to post one!
Post Comment
Name
 *
Email
 *
Website (optional)
Comment
 *

Allowed tags: <a> link, <b> bold, <i> italics