Webcast: NPR and Report Designer Tips n Tricks

On July 11, 2013, at 2:00pm ET, Joe Cocuzzo, Sr. Vice President of Reporting Services at Iatric Systems, will be hosting a free educational webcast entitled NPR and Report Designer Tips n Tricks.

Joe will show attendees how to save time, keystrokes, and mouse-clicks in the NPR Report Writer and Report Designer tools. Topics will include:

  • Report Designer shortcuts
  • Converting specifications to code with file conversion and search and replace
  • Converting CDS data to NPR code with an NPR report (no more query typos!)
  • Fast intervention-independent NUR/PCS reports
  • How to force reports directly to printer/preview/download
  • A special treat for MAGIC report writers with slow reflexes

This webcast is an online repeat performance of the educational session that was presented and well-received at International MUSE 2013. Select the date and follow the instructions to register to attend:

Date: Thursday, July 11th, 2:00pm ET

We hope to see you online on July 11th!

Report Writing Tips June 2013

Find NPR Report Translation Errors more easily (MAGIC)

Joe Cocuzzo, Senior Vice President – Report Writing Services

At the recent International MUSE conference, one of the NPR Tips and Tricks showed a new utility report I wrote to deal with the problem of NPR translation error messages streaming by much too fast to be read.  One solution, if you are not working remotely, is to translate to a MAGIC device rather than the screen. If you are working remotely, you can translate using option #17 (Translate) to BKG and then use #53 and select “Errors Only.”

(Client/Server users do not face this issue because you can translate to Preview and scroll through pages to find errors, and when you translate a macro, you have the added conveniences of an immediate “Errors Only” selection prompt.)

NPR Tip Image

What I did was to create a report to launch the background translate in exactly the same manner that happens in option #17, and have the report wait up to 10 seconds for the translation to complete, then to print out just the errors as they happen when you use option #53. The report saves time and typing.

Just identify the report at the prompt (lookup available) and print to S, VIEW, LOCAL, PREVIEW or any printer, and instead of lightning fast reflexes on the pause key, or a more tedious two step process of translate/list translate information, you can get a list of all errors in one easy step.

NPR Tip Image

NPR Tip Image

To write the report, I looked at the standard routine and duplicated the various flags that are set before the routine %NPR.PROC.trans() is called and duplicated the flags in a report.

NPR Tip Image

Then I looked at the routine that lists the BKG information and duplicated that code to print out an MV array of the translation errors.

NPR Tip Image

The theme of this year’s “Tips and Tricks” (for NPR and RD) was “Save Keystrokes and Retire Early.”  You can get the PowerPoint and all report examples (including this utility) on the MUSE 2013 information page on our website at: http://www.iatric.com/MUSE2013.

You can find additional Report Writing Tips on our website at http://www.iatric.com/Information/NPRTips.aspx, as well as information about our on-site Report Writer Training and Report Writing Services.

To subscribe for email notifications for new Report Writing classes, please follow this link:

http://www.iatric.com/Information/Classes.aspx.

For more information, please contact Karen Roemer at 978.805.3142 or email karen.roemer@iatric.com.

(This article originally appeared in the June 2013 issue of Iatric Systems Updates! newsletter.)

MUSE: 2013 TUESDAY TRAINING WORKSHOPS

MUSE is pleased to present an array of workshop topics for MUSE members
Tuesday May 28, 2013. Cost is $50 per half day workshop. 
If you select a morning AND afternoon workshop you have an option to purchse a box lunch for $20
 
Morning Workshops – 9:30 am – 12:00 pm
701 – The ARRA Project: Quest to Attest
702 – NPR Report Writing for the Beginner
703 – Soup to Nuts – Data Repository 101
704 – MAGIC and C/S Advanced Attributes
705 – Rules for PCS and OM in the 6.x M-AT Environment
706 – Top 10 Things You Hate about NPR Report Writer… and How to Love Them
707 – HL7 Training:  Understanding Data Transfer Between Disparate Systems
Afternoon Workshops – 1:00 pm – 3:30 pm
801 – To Boldly Go Where No Rule Has Gone Before
802 – Roll Out the Welcome M-AT for MEDITECH 6.x and M-AT Report Writer!
803 – Soup to Nuts – Data Repository 102
804 – Report Designer 6.x Rules and Functions
805 – MAGIC Syntax for NPR Report Writers
806 -  Clinical Rules and NPR – 5.6 and Beyond …
807 – Developing a Successful Business Intelligence (BI) Strategy
 

Report Writing Tips April 2013: Selection based on a subtotal (MAGIC or Client/Server)

Many NPR report writers have trouble writing a report that has to do selection based on a total. For example, list all patients with three or more visits to a particular doctor during a period. A fragment called from a computed select field can be used for this kind of report, but fragments are tedious and slow. Some loops in a start macro could be used, but that can be a bit too complex.

This tip will show you how you can use the temporary sort file built by your report plus a line check to effectively select based on a total. No fragment is needed, and just one simple loop (using something called “physical nexting”) on the temp file will get the job done.

Even though Joel hates LC’s as a record selection technique, I had a recent request where the hospital asked me to change a report they originally insisted they wanted per visit to one that was per unit number and this trick saved a lot of re-write time. Joel wants me to point out that anything in the TR will be “wrong” because records suppressed with an LC still count in any totals or other statistics. You really don’t have those in a mailing list, however.

First, you need to add a sort by unit.number with a key and trailer, and set up your report to select all visits for a particular attending doctor for a date range.

You also prompt with an “IG” or IGNORE operator so that the desired minimum visit count can be found in c.xx.visit.count.

Without a bit of extra programming, we will see all visits for the selected doctor:

If we could count the visits before printing the set of detail records, we could use a line check to suppress the set of visits for patients with less than the minimum number.

Since we have added a sort, the report writer builds an index of all selected records before it prints any:

What we need to do is loop in the HK1 region (the sort per unit number) and count how many entries are in the temporary file so we can set a flag to control whether the set of visits print or not.

If we use a macro called AL HK1, we will have the local variable unit.number (do not use the @ sign) equal to the unit number of the patient who is about to be printed.

Notice how if we use the @ sign on the variable unit number, the translator converts that to a reference to stored data at the individual record level. In the HK region sorting by unit number, your urn is set to the value of the PRIOR patient or is nil for the first patient, so you should not use that variable to figure out which patient you are “on.”

But if you use unit.number you get dzU, which is the local subscript that the report is looping on, and it represents the unit number of the patient you are about to print.

If we loop on the temp file like so, we can count the records and set a flag in OK to allow the visits to print if we have enough of them:

The > operator is doing “physical nexting.”  This goes through all subscripts of a structure with one loop, so you could have any number of sort subscripts in the temporary sort file after the unit number and the looping and counting would still work.  If you used the “+” operator (logical next), you’d need to write a level of looping for each sort subscript and nest them.

The “NOT.AS.GOOD” code, which loops on /[“temp” instead of [/R.TF, is deficient because MEDITECH will swap the temp sort file out to disk and it is kept in a different place, and your loop will fail if you run your report for a large set of records.  Using /R.TF to loop on makes sure your code works whether the temp file is in memory or on the disk.

Now if we run the report, we will only see patients with three or more visits during the period for the selected doctor.

Sample reports called ABS.PAT.zcus.is.suppress.based.on.total have been uploaded to our report library, along with a more complex MAGIC report: ABS.PAT.zcus.is.provider.mailing.list.demo, which includes code to go to MRI.PAT to exclude expired patients and get the latest mailing address information from MRI.DRC. That report also has a “list visits” or “just list patients per unit number” option.

Search our report library for more Report Writing tips:
http://www.iatric.com/Information/NPRReportLibrarySearch.aspx.

You can find additional Report Writing Tips on our website athttp://www.iatric.com/Information/NPRTips.aspx, as well as information about our on-site Report Writer Training and Report Writing Services.

To subscribe for email notifications for new Report Writing classes, please follow this link:

http://www.iatric.com/Information/Classes.aspx.

For more information, please contact Karen Roemer at 978.805.3142 or email karen.roemer@iatric.com.

Report Writing Tips: March 2013

Joe Cocuzzo, Senior Vice President – Report Writing Services

Just Curious: ICD-9 vs ICD-10 – eh?

As US hospitals are beginning the process of migration from ICD-9 to ICD-10,  I wondered how the much larger ICD-10 dictionary might affect the diversity of coding diagnosis and surgical procedures.

Since Canada implemented ICD-10 in 2001, we can visit our neighbors to the North and see how their coding changed as they converted to the new schema.

The first step is to set up a report to check all “IN” patients for a discharge date range, in a report that has no detail region:

Then we add a computed sort field where we will group patients by the calendar year of their discharge date. The $4 takes the YYYY off of YYYYMMDD discharge date.

We select all the “IN” patients for a dis.date range:

We write a small “detail” macro to execute each record to loop on the diagnoses and operative procedures to create some temporary lists of unique diagnoses and procedures, both for the entire report range, and for each year:

This code makes a list in slash of each code, in four different globals:
/DX[dx] for all dx codes
/PROC[proc] for all procedure codes
/DXY[year,dx] for diagnoses by year
/PROCY[year,proc] for all operative procedures by year

For example, /DXY[dx] looks like this (note the leading alpha in the ICD-10 codes):

To put totals on the report, we can use a computed field to loop on the sort value in the TK region and count the number of diagnosis and procedures for the year. By using the + operator in a “DO” loop and then incrementing the variable TOT by 1 for each unique code in our list, we can count the unique codes per each year in the TK1 region.

The fields in the TR region loop on /DX[dx] and /PROC[proc] to count codes for the entire report date range.

We also create some fields to compare the 1999 patient count, unique diagnosis count, and unique procedure count to the values for each subsequent year. To do this we use a TK1 macro to loop one time thru the values for 1999 to provide a diagnosis count and procedure count that we can then use as the denominator to calculate some percentages.

The macro looks like this:

Since ICD-9 has 13,000 diagnosis codes and ICD-10 has about 68,000, and ICD-9 has 3,000 procedure codes and ICD-10 has about 87,000 codes, we would expect to see more unique codes after the transition from ICD-9 to ICD-10.

In a completely non-scientific survey of two Canadian sites, we see only a slight increase in the diversity of codes between 1999 and >2001.  Here is the first hospital:

Here is a second hospital:

A sample (MAGIC) report ABS.PAT.zcus.is.icd9 has been uploaded to our report library. Code for a Client/Server version would be identical.

Search our report library for more Report Writing tips:
http://www.iatric.com/Information/NPRReportLibrarySearch.aspx.

You can find additional Report Writing Tips on our website athttp://www.iatric.com/Information/NPRTips.aspx, as well as information about our on-site Report Writer Training and Report Writing Services.

To subscribe for email notifications for new Report Writing classes, please follow this link:

http://www.iatric.com/Information/Classes.aspx.

For more information, please contact Karen Roemer at 978.805.3142 or email karen.roemer@iatric.com.

(This article originally appeared in the March 2013 issue of Iatric Systems Updates! newsletter.)

2013 MUSE Tuesday Training Workshops

 Class is in session! What training do you need?

 MUSE is pleased to present an array of workshop topics for MUSE members
Tuesday May 28, 2013. Cost is $50 per half day workshop. 
 If you select a morning AND afternoon workshop you have an option to purchse a box lunch for $20
 
Morning Workshops – 9:30 am – 12:00 pm
701 – The ARRA Project: Quest to Attest
702 – NPR Report Writing for the Beginner
703 – Soup to Nuts – Data Repository 101
704 – MAGIC and C/S Advanced Attributes
705 – Rules for PCS and OM in the 6.x M-AT Environment
706 – Top 10 Things You Hate about NPR Report Writer… and How to Love Them
707 – HL7 Training:  Understanding Data Transfer Between Disparate Systems
Afternoon Workshops – 1:00 pm – 3:30 pm
801 – To Boldly Go Where No Rule Has Gone Before
802 – Roll Out the Welcome M-AT for MEDITECH 6.x and M-AT Report Writer!
803 – Soup to Nuts – Data Repository 102
804 – Report Designer 6.x Rules and Functions
805 – MAGIC Syntax for NPR Report Writers
807 – Developing a Successful Business Intelligence (BI) Strategy

Report Writing Tips: January 2013

Joe Cocuzzo, Senior Vice President – Report Writing Services

Report Writing Tip: Summary Subtotals in Report Trailer (MAGIC or Client/Server)

Users sometimes would like to see a recap listing of subtotals in the trailer of your report. This can be done with an “MV” array in a pretty straightforward manner, with no loops or resorting required, provided the data is to be listed by some static sort value in the trailer region.

For example, assume that you are listing patients for a discharge date range sorted (and subtotaled) by attending doctor.  At the end of your report you want to have a listing of all the attending doctors and the total patients for each.

We could build such a report like this:

Image 1

The fields xx.doctor and xx.cnt are built like this:

Image 2

An “MV” array is built in the temp file with three subscripts, like this:

MAGIC

/MV[node,sort.value,field.number] = data to print in column

C/S

/R.MV[node,sort.value,field.number] = data to print in column

The “node” is whatever you use to the right of the equal sign in the MV= line attribute, so in this example we would have “TR” as the first subscript. What you use is arbitrary, but some abbreviation of the region (“D” , “TR” , “HK”) is typical. If you are building more than one set of MV columns on your report, you need each set of fields to have a different first subscript. For example, if you had a section in the detail region to print lab results and another section to print current medications, you could use “LAB” and “MED” as the first subscript of the MV array.

MV= LAB xx.lab.test    xx.lab.date    xx.lab.time    xx.lab.result
        xx.lab.test    xx.lab.date    xx.lab.time    xx.lab.result
MV=MED  xx.medication.name______      xx.med.dose
        xx.medication.name______      xx.med.dose

Since we want the summary listing to be sorted by doctor, we can use the attending doctor mnemonic or name as the second subscript.

Since we want to print the name of the doctor in the xx.doctor field, we would store the doctor name in /MV[“TR”,doctor,9] (field 9 is xx.doctor after translation) and we would put the total for that doctor in /MV[“TR,doctor,10] (xx.cnt is field 10 after translation). (In C/S the data is kept in /R.MV instead of /MV).

We can write a macro and attach it to a footnote on our report so that it runs for each detail record. The macro will store the attending physician’s name in the MV array for field 9 (xx.doctor) and keep a running total in field 10 (xx.cnt).

Image 3

The first line stores the same thing over and over, and the second line increments the total.

We can make the code a bit more efficient by putting @attending.phys into a variable and then using that variable the three times we need it. This avoids forcing the report writer to retrieve disk-based data more than necessary (although the data might be buffered in the disk queues anyway).

Image 4

One significant problem with using MV arrays is that they break if you hard-code the field number and then forget and add or remove or rearrange fields. If the field number in your code no longer matches the actual field number, data will “disappear” or data will jump to the left or right if you have a set of MV fields in columns.

The best solution we have found is to use a utility we wrote years ago that uses the report new page program to go find the field list of all computed fields of the report and then make an array like this:

/FLD[field name] = field number

The report that holds the utlity is called “Z.zcus.is.rw.util” and the macro (which is written as a program) is called “field”. So we can call it from an AL START footnote to build our list of fields as follows:

Image 5

When this macro is attached, the report builds a list of field numbers that is always current and correct. Here is what the /FLD structure looks like for our example report:

Image 6

So instead of hard-coding a 9 for the xx.doctor field and a 10 for the xx.cnt field in our detail macro, it is much better practice to code like this:

Image 7

Here is some example output, showing the detail per doctor and then the summary at the end:

Image 8

I have created two example reports for both MAGIC and C/S and placed them in our report library.  The report is called ABS.PAT.zcus.is.eupdate.trailer.summary.  If you need our Z.zcus.is.rw.util report, that is in the library as well.

Search our report library for more Report Writing tips:
http://www.iatric.com/Information/NPRReportLibrarySearch.aspx.

You can find additional Report Writing Tips on our website at http://www.iatric.com/Information/NPRTips.aspx, as well as information about our on-site Report Writer Training and Report Writing Services.

To subscribe for email notifications for new Report Writing classes, please follow this link:

http://www.iatric.com/Information/Classes.aspx.

For more information, please contact Karen Roemer at 978-805-3142 or email
karen.roemer@iatric.com
.

(This article originally appeared in the January 2013 issue of Iatric Systems Updates! newsletter.)

Stump the NPR Expert – MAGIC

Turn your NPR challenges into learning opportunities for yourself and others. Join us for this free NPR webcast training. Simply click on the date below to register to attend:

January 29, 2013 (Tuesday), at 2:00pm ET

Send us an NPR challenge you can’t overcome, and during this webcast, we’ll demonstrate a way to accomplish it. Please send your NPR challenge, together with your hospital name and system type (MAGIC or C/S) to ReportWriting@iatric.com by Tuesday, 1/22, 2013.

Joe Cocuzzo, our Senior VP of Report Writing Services, will present solutions to those challenges during this webcast. Now you can help create his training agenda!

For more information, please contact Amanda Howell at Amanda.Howell@iatric.com or 978-674-8121.

P.S. Remember to send your NPR challenge to us today!

New Stump the NPR Expert Course Offering

A new Stump the NPR Expert class has been scheduled:

Site: Iatric Systems
Location: Webcast
Dates: 1/31/2013-1/31/2013
Class: Int/Adv
Status: Open
Instructor: Joe Cocuzzo

The class has also been added to our website, http://www.iatric.com/Information/Classes.aspx. If you have any questions, please comment on this post. This should be a lot of fun, hope you join us!

Report Writing Tips: December 2012

Joe Cocuzzo, Vice President – Report Writing Services

Report Writing Tip: Smarter Location Lookup (MAGIC or Client/Server)

This month we will show you how to have a location lookup on any report that shows only “I”npatient or “O”utpatient or “D”epartment type locations.

First some geeky background (feel free to just skip to the end to see the report names in our library and go get the code you will need).

In ADM, you can use the field inpatient.location to have a lookup that just shows the inpatient locations.  At one Client/Server (actually 6.0) site, it looks like this:

But a lookup on @location is an inconvenient 5 screens worth of data, and in NUR, PHA, OE, RAD, ITS and so on, you would not have the handy @ADM.PAT.inpatient.location field at your disposal.

The EDIT ELEMENTS option on process reports will let you create your own ID program and attach it to an ID= attribute, so if only we knew the code for an ID restricted to I or D or O type locations, we would be all set.

The easy way to get at the code required is to write a quick report and look at the screen object code. Just write an ADM.PAT report with a select field of @inpatient.location.

In Client/Server (C/S) from the List Object Code routine, we want to pick this screen program:

In the object code, we can see a call to Z.id.dict.ck.fac.  If we print to a file, we can open it in Notepad and copy the code:

%(Z)id.dict.ck.fac(^&(G)GGNI["I"],A,{“Mnemonic”,”Name”},”{CD,&(G)GGN[CD]|1}
“,”CR”,”MIS “_
/(.S).PTI_” Location”)

In MAGIC, we can only see the object code of a screen program in the “Front End,” using the “E” command you can get a lookup of programs:

In the MAGIC screen, we see very similar code, which we can even copy into the Windows clipboard. (I have broken the line at a comma to make it shorter for readability here.)

Now we can create a simple PHA report where we want to have a location selection with an “inpatient only” lookup.

We just add a location field to the selections:

Next we write a macro as a program attached to our report.  For C/S we can paste in the object code we got from listing the screen and change the reference to the program so it is in source code format; otherwise you get a translation error.

(Line broken for readability, and it is legal to break a line of code at a comma within arguments to a program.)

In MAGIC,  we can just paste in the screen object code:

You can change the “I” to “O” or “D” for Outpatient or Department locations.

Now, for both platforms, use the EDIT ELEMENTS routine to attach your ID program as follows:

If you do not want to write the macro in the local report, if you load the Z report example I have provided, you could use a call like this instead.  A report or report macro written in the Z or any MIS DPM is available to all reports in any application.

Now we have a nice lookup in PHA that shows us inpatient locations only, even though the field ADM.PAT.inpatient.location cannot be used on the select screen in PHA (it crashes).

This gives you a way to have an “I” patient, “O”utpatient, or “D”epartmental restricted lookup in an NPR report in any module.  The code from the PHA report macros will work in any NPR report, although you should copy it to an MIS.USER, Z, or the individual report as you cannot call a PHA report from other application reports.

I have created 2 example reports for both MAGIC and C/S and placed them in our report library.  For those who just skip to the bottom, here is what you can use:

Z.zcus.is.location.id holds a macro Z.zcus.is.location.id.M.id, which could be used in any report.   PHA.RX.zcus.is.location.id is an example report from PHA where the ID program is PHA.RX.zcus.is.location.id.M.id.

Search our report library for more Report Writing tips:
http://www.iatric.com/Information/NPRReportLibrarySearch.aspx.

You can find additional Report Writing Tips on our website at http://www.iatric.com/Information/NPRTips.aspx, as well as information about our on-site Report Writer Training and Report Writing Services.

To subscribe for email notifications for new Report Writing classes, please follow this link:

http://www.iatric.com/Information/Classes.aspx

For more information, please contact Karen Roemer at 978-805-3142 or email
karen.roemer@iatric.com
.

(This article originally appeared in the December 2012 issue of Iatric Systems Updates! newsletter.)