Report Writing Tip: January 2014 – NPR Hot Key Report to See Activity (MAGIC only)

How often do you need to go change something about “the census report” only to go into Process Reports and see the following in your lookup:

Image

Most of you know that you can get out of Process Reports, and then go over to #57 “List Report Usage” on the customization menu:

Image

It isn’t terribly convenient to go over to this other option, and then deal with the never wanted BEGINNING/END defaults that MEDITECH application programmers like to include in standard reports:

Image

We can delete out the BEGINNING and type in the first of our list of suspects, then delete out the END and put in the last of our list (assuming no squirrels have run past our office window, causing distraction and loss of report internal name from short term memory).

Image

For the MAGIC platform, we can create a report in NPR.REP that can go on an NPR “hot key” menu and automatically use the last DPM and last procedure from the temporary file to provide an much more convenient activity list.

Image

We write our NPR report in the usage log segment:

Image

We can take advantage of the “spacebar – return” feature of Process Reports on the MAGIC platform, where the last DPM and the last procedure edited are kept in /.SV.DPM and /.SV.PROC respectively.

We set up selections on Page 2 for a report range:

Image

Then we can use the “Edit Elements” routine to add custom defaults.

Image

For the start of the default range, we use this:

Image

Note that unlike for CDS default attributes, you use DFT2 (not DFT).

For the end of the range we add a “zzz” to the procedure, and loop backward 1x on the procedure global to be likely to get all the copies of the report without having to type our own range.

Image

If we go to our hot key menu while editing “ADM.PAT.zcus.is.census.report”,” we get the following default range of reports:

Image

We build a simple report to list the title and procedure urn in a header and the saved activity in the detail line. We need to use two computed fields to deal with the fact that the run.time field is an “S(0)” time stamp, holding the number of seconds since March 1, 1980. To change this into a date, we use the Z program %Z.date.in.magic(run.time) in a “DATE” type computed field:

Image

You might wonder why there is no @ sign on the field @run.time. You can actually write it either way, since it is a subscript of the report activity segment, @run.time and run.time (with no @ sign) translate to exactly the same local variable.

For an HHMM (time) field from the S(0) run.time value, we use %Z.time.out(run.time):

Image

The @run.user and @run.dir are just fields and we can use the possessive @run.user’s.name also.

When we run the report for the default range, we can see that the ADM.PAT.zcus.is.census.report2 is the current version:

Image

The NPR.REP.zcus.is.hot.key.report has been uploaded to our MAGIC report library. Unfortunately, Client/Server does not have “hot key” menus and does not have the “spacebar return” recall feature. You can launch a new MEDITECH session from the session management button, but managing to peek back at the original session and figure out which report was being processed is just too hard, sorry!

Visit our report library athttp://www.iatric.com/Information/NPRReportLibrarySearch.aspx to look them up.

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 January 2014 issue of Iatric Systems Updates! newsletter.)

Report Writing Services: December 2013 – NPR Sunday Puzzler solved with NPR report (MAGIC example)

Joe Cocuzzo, Senior Vice President – Report Writing Services

NPR Sunday Puzzler solved with NPR report (MAGIC example)

There is a “Sunday Puzzler” feature of Weekend Edition on NPR Radio on Sundays. The host is Will Shortz, crossword editor of the New York Times.  Occasionally, he provides a puzzle that can be solved by exploiting MAGIC string operators and the spell check dictionary, or this week, using the Zip code dictionary and a specially rigged MPI.

The listener challenge from December 8th; deadline for submission Thursday, December 12th at 3pm ET.

“Next week’s challenge from listener Pete Collins of Ann Arbor, Michigan: Name a U.S. city in nine letters. Shift the third letter six places later in the alphabet. Then shift the last letter seven places later in the alphabet. The result will be a family name featured in the title of a famous work of fiction. What is the city, and what is the family name?”

We have, in effect, a dictionary of US cities in the MIS.ZIP dictionary and we can check the MRI name index for a last name match to find family names that might solve the puzzle. We will need to cheat a bit on the last count.

First we write an MRI.PAT report using the “actual.name.index” as follows:

Image 1

We set up the report so that we do an LI selection against a list of last names:

Image 2

Next, we write a start macro that loops through all the zip codes in MIS.ZIP, picking out all the cities that are nine characters long, and then changing the 3rd and the 9th character as specified and trying to match that new string to any last names in the MPI.

If we get a match, we will build a structure like this:

CITY^/LAST[NEWSTRING]  where NEWSTRING has a 3rd and 9th character changed per the puzzle rules.

Hint: I started the report at a hospital in Oregon that appeared to have a complete Zip code dictionary, but found it lacking and had to move the report to a Michigan hospital to solve the puzzle.

The first part of the macro creates a list of nine character cities in a temporary array:

Image 3

Remember that MAGIC numbers characters in a string starting from zero, so when we need to change the 3rd and 9th characters, we get the characters like this:

CITY#2 = third character

CITY#8 = ninth character

Before we change the string, we change it to all upper case like this:

@MIS.ZIP.city~$L.TO.U^CITY

The ~ is the translate operator and the $L.TO.U is a system string for MAGIC hospitals that will allow the translate to change a to A, b to B, and so on.

In C/S you would use the @Trl2u function like this:

@MIS.ZIP.city@Trl2u^CITY

We are supposed to move six down the alphabet for the third character (A becomes G, for example) and seven down the alphabet for the ninth character.

If we take the E(ncode) value of the third character and add six and then take the D(ecode) of that number, we will move six “down” the alphabet.  To avoid going past “Z” we check to make sure we are under 91 in the ASCII table.

We make a new string “NEWCITY” by using the $ and % operators to take everything to the left of the 2nd position $2, concatenating the new third character, then concatenating everything to the right of the 2nd position.

We do the same thing with the 9th character, but adding seven rather than six.  Because this is the last character, we can just do NEWCITY$8_CHAR^NEWCITY to make the final change.

Image 4

The final step is to use the new string in the actual name index as the “last.name.indexed” subscript and use the @First() operation to see if there are any patients with that last name in the MPI. You could also use @Next if you did it like this:

NEWCITY^last.name.indexed

“”^first.name.indexed,

IF{@Next(first.name.indexed,@actual.name.index) CITY^/LAST[last.name.indexed]}

@First loops from nil and does not assign back to the subscript

Looking at the object code for @First vs @Next will illustrate:

Image 5

If we run this report in just the right hospital (with a certain city in the Zip code dictionary) and just the right set of folks in the MPI, we can solve the puzzle:

Image 6

You have until Thursday 3pm ET to submit an entry.

I actually gave up on the cities in the Oregon hospital’s zip code dictionary after reviewing all the changed nine character strings manually and finding no likely solutions. Next, I got a list of US cities from some internet crossword puzzle dictionary and ran the string transformation against that list and saw that I’d need to find a customer in Michigan and also register some of just the right brothers in their test MPI to get my puzzle report to work.

Visit our report library at http://www.iatric.com/Information/NPRReportLibrarySearch.aspx to look them up.

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 2013 issue of Iatric Systems Updates! newsletter.)

Report Writing Services: November 2013: Adding custom dictionary lookup with CH and GRP attributes (and how to mimic GRP= in Client/Server)

Adding custom dictionary lookup with CH and GRP attributes (and how to mimic GRP= in Client/Server)

by Joe Cocuzzo, Senior Vice President – Report Writing Services

When using the MAGIC NPR report writer, you have two choices if you want to have a custom lookup on a computed field. You can add a CH= (Choice) attribute using the Edit Elements routing from the Process Reports menu:

Image 1 Image 2

Or in MAGIC only, you can add a GRP=<group mnemonic> attribute to a computed field in the field attributes.

Image 3

Client/Server (C/S) supports the CH option but not the GRP= field attribute. This month we will describe the two options for MAGIC, and show how to duplicate the GRP feature with a custom ID program in C/S.

CH works well when you want to give the user a hardcoded set of choices. I like to use it if I am building a report with multiple output modes:

Here is how it looks when done (identical approach) in a C/S or 6.x site:

At times, however, you want to prompt the user for a selection from a Group Response dictionary in MIS. One example is if you are trying to allow the user to pick a particular group response element that you are going to compare to a query response to select records. Another example is where you want to create a special dictionary with a large number of entries that would not fit in a CH attribute string, which is limited to 255 characters.

In MAGIC, you can just create a computed select field, free text, length 10, and add a GRP= attribute.

Now the computed selection field presents the group response dictionary:

For C/S, the GRP= attribute is not supported, but you can get equivalent functionality by creating your own ID program (or using ours from the example report from this tip).

Remember, you can just USE this code as is (just change the group mnemonic at the top line to match the group you want to have for a lookup). The details below are for those interested in how the code actually works.

You write a macro as a program, and attach it view the “Edit Elements” option like this:

Image

There are two steps in the ID program; first we loop through the desired group dictionary and create a typical MEDITECH dictionary file in a temporary structure.

Step #1

We want to turn this:
Into This:

The MEDITECH generic ID program we want to use for the lookup wants a structure that looks like this:

/GLOBAL[subscript]|0 = Y (active flag) |1 = name |2 extra fields as needed

So it is easier to just loop through the group response dictionary and create a temporary structure than to write a non dictionary lookup program (or find one). Also, a group response dictionary is never going to be that big, so moving it to a temp file works fine.

Step #2
Next we set up some arguments and call the standard C/S dictionary lookup program. The program has the following arguments:

Z.id(A,B,C,D,E,F) where
A= “name of” the structure to do the lookup on. We build our temp dictionary in the example in /LI so, we pass ^LI in the “A” argument
B = the value the user entered before hitting F12 (that is passed into our ID program in variable A)
C = A queued string of column headers for the dictionary lookup
D = A queued string of expressions that will build the data for each column
E = “AR” for restrict to “A”ctive entries and “R”eject new entries. This is what you want, because you don’t want to have the user able to create new entries and file them.
F = A title for the lookup window

Here is the section of the macro that does this for our example report:

And here is how the lookup behaves:

We have uploaded the C/S version of ABS.PAT.zcus.is.eupdate.choices.and.grp to our report library. Visit:http://www.iatric.com/Information/NPRReportLibrarySearch.aspx to look them up.

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 emailkaren.roemer@iatric.com.

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

Report Writing Tips – October 2013: Utility Report to Assist with Syntax Checker Changes – MAGIC, Client/Server or 6.x

Joe Cocuzzo, Senior Vice President – Report Writing Services

Utility Report to Assist with Syntax Checker Changes – MAGIC, Client/Server or 6.x

As most Report Writers are aware, the customer version of the NPR report writer includes a “syntax checker,” which does a string search of source code and a string search of object code to attempt to block commands that could delete or alter data.

Recently, MEDITECH became aware of a way code could be written that could result in changes to the database, and they have released a change to the checker that has the unfortunate side effect of disabling many innocent reports. We have had customers with tens to hundreds of reports affected. Most hospitals are getting this change along with a 5.66 update, but I believe it can be delivered in 5.64 as well.

It is very important to fix all affected reports that are still in use and move the fixed reports into your LIVE directory before MEDITECH runs the syntax checking job in LIVE, or you will have reports and  screens crashing due to broken reports.

In MAGIC, you will get two new routines on the NPR customization menu:

image 1

In C/S and 6x, you will get two new routines on the Reports menu:

image 2

Typically MEDITECH runs the first “Check Macro Syntax” background job and you may be a lucky winner and see many reports affected.

Here is a C/S site with 132 reports broken by the change:

image 3

Here is a MAGIC site with 784 reports broken:

image 41

Unfortunately, the “Print Syntax Results” routine does not include report activity, or allow you to limit the listing on some kind of usage basis, so you do not have an easy way to triage your fixing, to avoid wasting efforts on:

ADM.PAT.zcus.is.great.great.great.grandfather

ADM.PAT.zcus.is.great.great.grandfather

ADM.PAT.zcus.is.great.grandfather

ADM.PAT.zcus.is.grandfather

ADM.PAT.zcus.is.father

And you can just fix: ADM.PAT.zcus.is.son (provided sonny’s macros are local).

This month I will show how you can write (or how I have written) a report that allows you to restrict your list to reports with activity on or after some reasonable cut off date, and be reasonably sure that you have fixed all reports in use. Note that if you call report macros as programs from a CDS, that report will not have activity. You can check the CDS issue by trying to re-file the screens that might be affected in TEST after the syntax check has been run.

The reports I will describe can be used “as is” and should prove very useful for sites with many reports caught by the new syntax checking. You do not need to go through my detailed discussion of how the report is written, unless you are interested in the techniques I used, and furthering your geeky education.

The first step to duplicate the standard report is to look at the MEDITECH “Print Check Syntax Results” report that they deliver with this change.

We can list the customization menu from LIST REPORTS to see the name of the procedure: NPR.PROC.check.syntax.print.

Just for fun, we can try to initialize from this standard report:

image 5

At Iatric Systems, our slogan about the “Initialize Report from Standard” routine is:  “The More You Need It… The Less Likely It is to Work.”

In this case, it is not complex code and a difference between the two Report Writing tools that stops us, but the fact that MEDITECH set up the data segment they created to not allow access for the Customer Report Writer.

We can list the report and see that is uses a detail segment of NPR.PROC.check.syntax, and if we look at the data definitions with Programmer’s NPR we see:

image 6

While we are poking around on the MEDITECH side of the house, we might as well take the opportunity to copy (to the Windows Clipboard) the ID code from the compile # field (cs.urn) so we can use the same lookup in the Customer Report Writer report we are about to create:

image 7

This is an extra credit step, and we could have just prompted the user for an integer with no lookup and our custom version of their report would still have worked fine.

Ironically, the C/S lookup attribute is ID=%NPR.PROC.check.syntax.id(A), but the C/S syntax checker won’t let you call an NPR.PROC program. So your syntax checker report gets stuck on the syntax checker. The solution is to copy the source code into your own NPR.REP.zcus.is.rw.check.syntax.with.activity.M.id macro, add the NPR.PROC dpm to all the fields, and grumble to yourself about the whole unhelpful syntax checking situation.

How can we deal with the fact that the detail segment “check.syntax” cannot be used by the customer report writer? Since we can write a report in NPR.REP and get report data (urn of report, title, and activity), we can write a loop in a start macro to go thru the “check.syntax” segment, check activity in NPR.REP, and make a list of reports in slash that our NPR.REP based report can use for selection.

Both C/S and MAGIC reports can get data from segments set to “Cust R/W Access” = N, so we can write a start macro in NPR.REP and loop on all the reports found by the compile selected and then check last activity.

The MAGIC DPM lookup will even show you the segment and fields, and the segment information:

image 8

Unfortunately, the C/S field lookup program will not show segments flagged as unavailable, but you can still use them in a macro or computed field or line attribute.

Our MAGIC report in written in NPR.REP, with a detail segment of npr.rep.main.

Our C/S report is written in NPR.REP, with a detail segment of main.

image 9

In the selections we prompt for the compile number, select urn against a list in /URN, provide an option to include or omit activity, and allow the user to provide a “last run on/after” date.

image 10

The start macro of both reports (MAGIC or C/S) contains identical code:

image 11

Both reports use two ECB-ECE loops to print both the macros found by the syntax checker:

This loop goes thru the syntax checker data and prints the macro and the syntax message:

image 12

This loop prints activity:

image 13

Here is sample output from the C/S version of the report.

image 14

Remember, these reports are designed to be used “as is,” so even if you skimmed through this entire article to get the report names from the bottom note, you can take these and use them to cope with the recent syntax checker changes and possibly save significant time and trouble.

We have uploaded the MAGIC and C/S version of these reports to our report library under NPR.REP.zcus.is.rw.check.syntax.with.activity – visit: http://www.iatric.com/Information/NPRReportLibrarySearch.aspx to look them up.

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 theOctober 2013 issue of Iatric Systems Updates! newsletter.)

Report Writing Tips – September 2013: When is an Order Actually Two Orders? (Client/Server or MAGIC)

Joe Cocuzzo, Senior Vice President – Report Writing Services

When is an Order Actually Two Orders? (Client/Server or MAGIC)

Moving report detail segment to count the same record multiple times.

I recently had a site ask for a report listing all telephone or verbal orders, with an option to show just unsigned or both signed and unsigned orders.   The hospital wanted the option to sort by patient or by ordering provider.

This is a simple report (or so I thought), just select orders for an order date range and check to see that the source is “V” or “T”.

The site reported that I was “missing” some “verbal orders” and gave me an example, which actually looked like this:

The site thinks of this as two orders, an original written order from DAND, followed by a subsequent order (a stop order actually) by telephone by PCOWAN.

I can adjust the selection logic so that I pick up orders with a source of T or V, or an edit.pom.source of T or V, but I might need to list the same order on different dates and under different doctors. I can’t use the unsigned index because the report needs to be able to include both signed and unsigned orders.

Here is an example order that needs signing by two different doctors:

How can I get my report to print the same order under each doctor who either entered the order with a source of V or T, or edited the order with an edit.pom.source of V or T?

I have three options:

  1. Build an MV array for all my output, or some temporary structure that I loop through with an ECB-ECE loop.The disadvantage of this approach is that all my fields would need to be computed fields and automatic totaling with Z.count or FNC=TOT would not be available.
  2. Rewrite the temporary file to include the same order multiple times. This works well, but as the syntax checker blocks 1 ^/R.TF you need to code around the syntax checker, especially in MAGIC where1^ /[“temp”,SORT1,SORT2…] only works if the sort file stays under the MIS max records parameter and does not swap out to disk.
  3. Move the detail segment of the report from the main (where you get each order one time only) to the edit.data segment, and select the order if either of the following are true:- The edit.urn = 1 and the source is V or T

    - The edit urn >1 and the pom.edit.source is V or T

    In each case, test whether the user has asked for unsigned orders only and if they have, check to see if the order was subsequently signed by the appropriate doctor.

Option C seems best for this example.  Let’s see how the report should be written:

We set up the sorts as follows:

xx.sort1 sorts by doctor for the first edit transaction for provider sorting, by the @edit.pom.provider on all other transactions for provider sorting, and by patient name if name sorting is selected.

xx.sort2 sorts by patient name if you are doing primary sort by doctor, otherwise lets the orders list by edit.date by setting the sort at this level to a 1.

Remaining sorts are by edit.date, then urn, then edit.urn.

The selection is for an order date range, and then we have a computed selection field:

The xx.ck field calls a macro as a program, and passes the urn and the edit urn as arguments A and B:

We check each edit transaction. If we are on the first edit transaction that is the initial entry of the order, and we want to include the order if the @source is V or T. For additional flexibility, the user can elect to discard signed orders so we have some extra code to throw out signed orders by looping forward through subsequent transactions to see if the doctor did sign. Logic is similar for edits to orders, but for those we are checking for @edit.pom.source of V or T and checking the @edit.pom.provider to see if that doctor signed.

When we look for signing, we parse out the doctor from the “signed for” transaction with the % (right of) operator to get everything to the right of position 16 and for good luck we strip any leading and trailing spaces with :0S.

The final piece is to write a “detail” macro to loop forward to find the signed date and time and to calculate some elapsed time values and characterize the order as either not signed, on-time, or late.

The detail macro is attached with a footnote. For Client/Server only, you need to add a BUF NONE footnote. MAGIC would just have AL D detail:

In the C/S version of the report, you need to prevent “buffering” of the detail segment into a temporary structure. Otherwise, the detail macro looping code will loop on a temp structure that will only contain the one edit transaction that was selected by the report. Your code in the macro will be perfect, but will be changed when incorporated into the report itself (the .R program) and will not work at all to find signing transactions.

Here are the gory details (relevant to C/S only):

Macro source code: (written fine, should work)

Macro object code:

Report object code:

Then your macro also tries to loop on this temp:

If we add BUF NONE footnote:

Here is a sample of the report, with PHI removed. We show whether orders were signed within 72 hours and some percentages per doctor and for all doctors:

Client/Server and MAGIC version of this report OE.ORD.zcus.is.phone.and.verbal.orders2 are available on our website in our report library on our website: 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 September 2013 issue of Iatric Systems Updates! newsletter.)

Report Writing Tips – August 2013: Find Duplicate Medical Records (Client/Server, MAGIC or 6.0)

Joe Cocuzzo, Senior Vice President – Report Writing Services

Find Duplicate Medical Records (Client/Server, MAGIC or 6.0)

Recently, a user posting to Meditech-L was looking for a report that could compare patient records in MRI and find all cases where “different” patients have the same name, birth date, and social security number. This means that they have different unit numbers at the same facility, so MEDITECH would treat them as different patients even though they are very likely to be missed merges, and actually the same person.

This makes a good “NPR tip,” showing how to use a macro as a program for selection, and the code is the same for the MAGIC, C/S or 6.x platform.

First, we build a simple MRI.PAT report with no index.

We sort by xx.name with a header and trailer. If we used a sort of @name, a middle initial or difference in case would separate our matches. Instead, we build a computed field that will keep our name matches in groups. The Z.convert.name program is used by MEDITECH in the MRI.PAT filer program to build the subscripts of the @actual.name.index.

To select our records, we use a computed select field “xx.ck” that calls a program:

In the program, we are going to loop on the “actual.name.index” to take the @name from the record we are checking and loop through all the name matches to see if the patient also matches on DOB and SSN, has not already been merged, and has a unit number.

We could have also used the social security index to find all patients with the same SSN, name, and DOB, but I thought that some sites might want to remove the SSN match criteria, and that makes the name index approach more flexible.

In MAGIC, the actual.name.index looks like this:

In Client/Server, it has some additional subscripts after urn, but our looping code can ignore this, as we only need to loop to the urn level. Therefore, the same macro code works in both C/S and MAGIC.

While we might have been able to squeeze our looping/matching into a computed field, using a program instead allows us unlimited “elbow room,” and we can be sure we will not “step on” subscript values that the report is using. In a computed field, nilling or changing the value of a subscript that your report is looping on can cause your report to either end early or loop forever. In a macro written and called as a program, you have a separate set of local variables so this cannot happen.

Our macro looks like this:

For extra credit, we create a computed total field to count the number of matches like this:

Here is some test system output from a MAGIC site:

Here is some test system output from a 6.0 site:

Sample reports: MRI.PAT.zcus.is.find.dup.pts2 have been created for both MAGIC and C/S (or 6.x) systems and uploaded to the report library on our website: 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 August 2013 issue of Iatric Systems Updates! newsletter.)

Report Writing Tips July 2013: Force Client/Server or MAGIC Report to Download File

Joe Cocuzzo, Senior Vice President – Report Writing Services

At our recent “rebroadcast” of the 2013 MUSE RD/NPR “Tips and Tricks” session, participants were particularly interested in how to force either a Client/Server or MAGIC NPR report direct to a download file, where the user does not see any Print On: prompt, and the report itself defines the path and file name for the output. In the “Tricks” session, I showed the C/S approach, but not the MAGIC one, so I have included both methods in this tip for our newsletter.

In C/S, you can use the “EDIT ELEMENTS” routine to add an IFE attribute and put a path into Z.c.cust.rw.download.path. The user will not be prompted for an output destination and the report will automatically download to the path you load with your attribute code.

The Edit Elements routine allows you to attach field attributes to report selection fields in a similar fashion to the way you write attributes for Customer Defined Screens. We can exploit an IFE attribute (used to control whether the cursor stops at a field) to put the path into Z.c.cust.rw.path as the selection screen is displayed.

NPR Image 1

Here is what the IFE attribute should look like; substitute the local path and file name you wish to use for my example path and file here:

NPR Image 2

In MAGIC, you can imbed a program call in the title of the report, and use the program to set up an “auto download.”

NPR Image 3

Since the title of the report is executed as a line of programming code when the selection screen is displayed (and again as the report banner is built for each page), we can use some quotes and underscores to imbed a program call in the title. We use a macro built as a program to set the report up to download, and we return the desired title as the last line of the program.

NPR Image 4

Since the MAGIC program involves quite a bit more code, I have uploaded this demonstration report to our MAGIC report library: ADM.PAT.zcus.is.auto.download

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 July 2013 issue of Iatric Systems Updates! newsletter.)

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.)