You've never noticed how many steps are involved when you import a text file into Microsoft Excel; until you do.
Larry Carver noticed. He's written a free Microsoft Excel Import utility that eliminates most of the keystrokes in the import text file process.

To import a text file into excel:
1) Drag & drop the file path to the white text box.
2) Click Export and wait for Microsoft Excel to pop up with your data in spreadsheet form.

If you enjoy this utility, or have suggestions for improvement - stop by the MEDITECH KE and say hi to Larry: http://www.meditech-ke.com/users/39/larry-carver. If you have general questions about the utility, post a question and he'll get back to you.
*** Installation: to install, unzip this file to a favorite location on your computer, maybe your DESKTOP or MY DOCUMENTS. Then execute file.
For months - this bug ran undetected. One day the right conditions allowed it to crash the report.
In this case, /PROC[SU,6] was printed in a custom field:
xx.proc.6
DAT=FREE
LEN=40
VAL=/PROC[SU,6]
The vendor, who'd requested the extract, didn't need data beyond procedure 5 and requested that any remaining data reported in field xx.proc.6. The values in xx.proc.6 would likely be used for manual review if needed. The field only reported the value to a length of 40 characters.
As you know, MEDITECH variables on the Client Server & Magic platforms are limited to 255 characters. However, this code allowed more than 255 characters to be assigned to a variable (/PROC[SU,6]): /PROC[SU,6]_", "_@actual.op^/PROC[SU,6].
To resolve this overflow, the IF statement can be modified to stop processing when the length of the existing variable (/PROC[SU,6]) and field (@actual.op) will be greater than 255 characters when strung together:
IF{L(/PROC[SU,6]_", "_@actual.op)>255 0^/CONTINUE; ...
By implementing a condition based on the value /CONTINUE; the variable /PROC[SU,6] will never contain more than 255 characters. Now our DO{@PROC.NXT stops; this prevents inaccurate reporting if the next value for @actual.op is short enough to print in a field of 40 characters.
PROC.NXT
(/CONTINUE=1)&(@Next(actual.op.urn))
PROCEDURES
""^actual.op.urn,1^/CONTINUE,
DO{@PROC.NXT IF{actual.op.urn<6 @actual.op^/PROC[SU,actual.op.urn];
IF{L(/PROC[SU,6]_", "_@actual.op)>255 0^/CONTINUE;
/PROC[SU,6] /PROC[SU,6]_", "_@actual.op^/PROC[SU,6];
@actual.op^/PROC[SU,6]}}},
IF{/CONTINUE=0 (/PROC[SU,6]_", "_@actual.op):40TL^/PROC[SU,6]}
When you've inherited a report from another report writer, it is tempting to re-design and re-write the report from scratch. There's a saying in the programmer / developer world that goes something like this: if you can come back a year from now and review code you wrote today ... and not want to change anything, you're an expert.
Question: What could be more important than writing expert code in every report you work on?
Answer: Keeping your time focused on those reports that most 1) improve patient outcomes OR 2) contribute to the bottom line.
Have questions? Need answers? Join some of the smartest MEDITECH people in the industry at the Meditech Knowledge Exchange
Ever wished you could use parameters in MEDITECH NPR sub-routines? For now - here's the implementation below.
{@FLD.NO,"A"}^@SEND.DATA
SEND.DATA
{/FIELD,/TXT},
/FIELDS[/REC.TYPE,/FIELD]|1_"TL"^SIZE,
/TXT:SIZE^@PRINTER
FLD.NO
/FLD+1^/FLD
Keep an eye on the
MEDITECH Community Bulletin Tips & Tricks in November; I'll be writing about why this makes your life, as an
NPR Report Writer, easier.
Calling a macro from the report title, like the one below, will suppress the 'Overwrite Existing File' message in a Client Server NPR Report.
Report Title: "_%(APP)DPM..zcus.report.name.M..start(0)_"
[start macro]
"d:\test.txt"^Z.c.cust.rw.download.path,
%Z.on.device("","",DEV,{1,1}),
"Report Title";
If you're using Summit's CS Print Manager; bookmark this for later, you'll be glad you did.
[Please ignore this information posted earlier in the day; it does not work.]
This combination of FOOTNOTES disables the 'Overwrite Existing File' message; but leaves the 'End of Report' message.
AL START 1^/(.S).QUIET
AL CLOSE.UP ""^/(.S).QUIET
Do you print your records in NPR Downloads from a macro? If so, the following may be of interest to you.
When printing records (I(/LINE)N^!) from a macro to your destination file, your macro should call the new page program (/R.NEW.PAGE.PGM) on a regular basis. If your file is small (under 10,000 records OR 1MB) you will probably be fine without calling the new page program.
If your file is large, the MEDITECH CS Client could slow to a crawl and may never complete. Because the records are held in memory, they are only released to the file when your report completes. Calling [/R.NEW.PAGE.PGM](0) releases records from memory to the print prefix (in this case a file) which allows the report to perform as if MEDITECH NPR were handling the printing.
To implement, drop this little routine below named 'NEW.PAGE' in where ever you send a new line in your macro:
NEW.PAGE
IF{/R.LL-1^/R.LL<1 [/R.NEW.PAGE.PGM](0)}
Note: Thank you Mitch Lawrence @ Christus Health for pointing out that the Page Parameters on the NPR General Tab will affect how many records will be accumulated before records are released.

If you download NPR source & object code like I do, you probably want to quickly find the difference between one version and another (say a backup copy). I have never liked any of the text editor compare utilities out there. I know a lot of programmers find them extremely useful; but I never have found them to be intuitively useful.
I've been reading Eric Sink's blog on the Business of Software for about 3 years; so recently when his company tackled the file / folder comparison problem I noticed. The product is free and its called Diff Merge.

Give it a try, I think you'll like it.
I recently had a vendor request the comma "," as the delimiter for an NPR download. I prefer to use a # or | for the delimiter as they are unlikely to surface in normal data entry by end users.
However, I quickly used the following code to reformat patient name in a custom field:
^X,DO{X#(L(X,",")^P) (X$P)_" "_(X%P)^X},X
As a result, "NPR, REPORT WRITER" prints as "NPR REPORT WRITER" for the full name.
Here's the custom field:
DAT=FREE
JFY=L
LEN=80
VAL=IF{@cd.response["PAYER.NAME"]^X,DO{X#(L(X,",")^P) (X$P)_" "_(X%P)^X},X}