Well, that's no ordinary rabbit!

NPR Report From PCI With Account Selection

Meditech now allows NPR reports to be added to a PCI menu. You can link from to PCI patient to a patient in the NPR report by selecting on /mri.urn. That is the only available link. If you want to further narrow the selection down to current accounts you can add a select of status is one of ADM IN, REG SDC, etc, using any status you want included.

This page demonstrates how to take it one step further and allow the user to select an account from a list based on the PCI patient. I'm sure someone will come up with an easier way, but in the meantime feel free to try this method. The example is based on a report in PHA.RX.


Step 1 - Create the NPR Report

The report should use an index which has patient as one of the subscripts. The example report uses pha.rx.patient.index.

pci in npr image 1

The selections should be patient EQ /PAT and an xx.pat EQ Patient. You can add any other selections that you need.

npr in pci image 2

Finish creating your report adding whatever fields you want to the report picture.

Step 2 - Create a macro called id

The purpose of this macro is to populate a list with all the accounts for the PCI patient. I have included the patient account number, name, adm/ser date, discharge date, and status fields to help the user select the desired account. Note that the macro ends with a semi-colon because we will be calling it as a program.

npr in pci image 3

Step 3 - Edit the Report Title

The macro from step 2 has to run before the selection screen appears. This can be done by calling the macro from the report title. The last line of the macro will become the report title when the user runs the report. Note the placement of the quotes and underscores.

npr in pci image 4

Step 4 - Add an ID attribute to the xx.pat field

Using the Edit Elements routine add a custom ID attribute. This ID attribute will call the Z.id.non.dict.color program using the data in /LIST that we created in the macro. Use the IFE attribute to set up the header that will be used in the lookup. Add an FCL1 attribute that takes the value returned from the ID attibute and places it in /PAT.

npr in pci image 5

Step 5 - Add the report to a PCI menu

In PCI maintenance add the report to the NPR Report DS Dictionary.

Then add that to a user Table of Contents menu.

npr in pci image 7

Running the report from the PCI menu for this patient

npr in pci image 8

gives me this lookup at the patient prompt in the report. The report prompts for patient, but only the accounts belonging to the PCI patient will be in the list when the user uses F9 for a lookup.

npr in pci image 9

Click HERE to download the example PHA report containing the id macro and modified ID attribute.
Or HERE to download an example OE report. Both reports were written in Magic 5.4.

Other Magic Pages



Don't see what you need?  Visit one of these other sites


or email me your request (tomt at thomast357.com).