Report Writing

Interoperability and EHR Optimization

Privacy and Security

SQL Tip: The Good, the Bad, and the Ugly of TOP X

As you’re learning SQL, you will invariably come across the TOP X clause to a SELECT, which allows you to get – for example – the first 50 rows of a query:

SELECT TOP 50 ADV.VisitID FROM livedb.dbo.AdmVisits ADV ;

This can be quite handy for testing if tables are populated, or just grabbing some records to review when you’re looking for something. And if you’re an old, grizzled, MEDITECH NPR programmer (as many of our followers are), you’ll be happy to see something that acts like Z.record.limit.


Read More

Migration: Export MOX Using NPR

Recently a MEDITECH hospital wanted to export a handful of MOX databases, since they were migrating away from MOX. I have done a few of these in the past on rare occasions (on a “per database” basis), and most of the programming time was spent on mapping and cleanup — not on the actual extraction of the data itself.

In this blog post, I’ll discuss how I figured out how to write a generic export in an NPR report, so savvy NPR programmers can do this for themselves in the future.

Read More

Using DR Data Def Tables, Updated for CS/MAGIC 5.67 or MT 6.07/6.15

One of the challenges of DR-based report development is the same as for NPR or RD … where is the data you want stored? One way to find out is to go into MEDITECH and find the field, and — if you're lucky — you can do:

Read More

SQL+DR Tip: Use SSIS Templates to Speed Extract Builds

If you’ve started using Microsoft’s SQL Server Integration Services (SSIS) toolkit to create, schedule, and deliver extracts (machine-readable files) to vendors, non-MEDITECH applications, and even internal users who love their Excel, then you know that the same kinds of requirements come up over and over again…

Which means you can speed your SSIS development, and make it more flexible and easier to maintain, by creating an extract template to use each time you start a new project.

Read More

SQL Tip: Managing Diagnosis Codes (5.67 edition)

A common challenge in reporting (or extracting data, in this case) that we see over and over again is the need to transform one data structure into another. The best arrangement of data for the programmer writing the online application is not necessarily the best arrangement for the person writing a report, or an extract.

Read More


CMS Does Not Make Things Easy

Sometimes you just have to wonder… New ICD-10 diagnosis and procedural coding has been brought into play in the United Status (October 1, 2015 for diagnosis codes; next year for procedure codes), and CMS has — though a substantial effort — identified sets of equivalent codes between the -9 and -10 code sets. Your first thought may be, “This is huge! A tremendous help!” (If you want more details about this effort and you have not seen it already, check out the GEM website for Diagnoses and Procedures).

Read More

Testing Code for ICD-10

October 1 is coming fast, which means that this year (2015) US healthcare finally gets to join the rest of the world in using the ICD-10 codeset for diagnoses.

Read More

NPR Tip: "Echo Name" feature for Customer Report Screens (MAGIC Only)

You may have noticed that MEDITECH standard NPR report screens can have "display only" fields, but in customer reports, there is no attribute or standard method to provide the same feature. In a CDS, you could just set the "Echo Name" flag to Y when building the screen.

Read More

DR+SQL Tip: Using UNION to Best Effect

MEDITECH migrations platform bring many challenges; one of them being that you may find yourself with a new LIVExDB in the picture and once you’re past the go-live you find that data is flowing only into the new LIVExDB and not into the old one anymore.
Read More

DR+NPR Tip: Running Web-based Reports from a MEDITECH Menu

with Mitchell Lawrence, HIS Programmer Analyst at Iatric Systems


Many sites using SQL Server Reporting Services will use the External Links feature in MEDITECH to route a user to the "top" of the reporting portal. However, you can also set up a structure in NPR that lets you invoke the user’s web browser and provide a URL to go to the reporting portal and open a specific report directly from a MEDITECH menu.

Read More