Unlock the Power of MEDITECH with MEDITECH KE

1

John, After reading your article from the Meditech Bulletin I asked - Can that functionality be used to look up specific orders placed on a patient, given the patient's urn and the date of the order.

You replied: Yes - you could use a macro to build a list based on patient & date. The only thing you'd likely change will be the name of your array (/NUMBERS.DICTIONARY).

Further - I wanted to be able to choose a specific order and have it print on the report. When my guru on site and I talked about this he had these questions...

So if I have my head wrapped around what would happen, assuming we could go out with a DO loop and populate the patient’s scheduled or ordered procs, first we need to know what patient. So we prompt the user for patient and they need to type that info in and press F12. At that point, we can create our list, but how do we get back to where we prompt the user again, to choose which proc they want? That’s the part I don’t know. If you call a frag, you normally still don’t get an opportunity to prompt the user from there, or at least I haven’t ever seen it done. If you could somehow do processing based on the user pressing Enter on the patient, before using F12 on the whole prompt screen… but I don’t know how to. Maybe an attribute or something?

If you could overcome that first hurdle, then the second problem I see would be that if you created your list in an LI, you would present that whole LI to the user and they would have to delete the ones that don’t apply. Kind of a reverse logic in a world where people are used to simply selecting one item from a list – like your group response idea.

flag

6 Answers

1

I've used the 'Enter/Edit Screen Elements' to provide a custom lookup using a group response. You could modify the logic to provide a lookup from a list of the ordered procedures for the patient for that particular day, using a macro to build the list. So you would capture the patient in the first select, the date in the second, then pass those two variables to your macro to build your list.

Clear as mud...

link|flag
1

Hi Pat,

I see what you are saying but it is in fact not to bad to do, although I haven't implemented a patient specific lookup before. However, but I have done is make use Screen attributes to launch macros at different times during the selection screen without hitting F12, which is what your programmer is asking. FCL is the field Check attribute which you would enter on a particular field. it allows you to do validation on a field at runtime, as soon as the user enters something. This can be manipulated to execute something completely different.

So in your case I would probably do the following. Keep in mind, that I haven't tested this so it may require a bit of tweaking to get working right. Especially when it comes to looking up patients and getting their urn.

  1. Add your patient field to the selects as well as the order field with a LI /ORDERS
  2. In the Edit Elements (option 9) in NPR, add a FCL=%[report name].M.build.lookup(A),""
    2a. This line will launch your build.lookup macro with the patient just entered into the field. Notice the ,"" after the macro call. This is because when a FCL statement evaluates to TRUE, meditech rejects the users entry. Therefore this will always evaluate to false, and let you move on to the next field.
  3. On the orders field, setup the ID element that same as in John's custom macro but only the section that %Z.id since the lookup list was built previously in the last field.

Play around with other field attributes that are listed on meditechs website. There are lots of cool things you can do from the select screen, long before you ever hit F12.

link|flag
I will have to try that, thanks for sharing. – John Sharpe Feb 9 at 17:14
1

Well I'm absolutely sure we are over our head here. We tried creating this macro

@SELECT.LIST.BUILD,
@LOOKUP.F9;

SELECT.LIST.BUILD
%Z.rw.fragment("","OE.KAL"),
c.urn^OE.ORD.patient,
@.today^OE.ORD.order.date,
""^OE.ORD.urn,
DO{@Next(OE.ORD.urn,OE.ORD.order.x) .,
IF{@OE.ORD.category^CATEG="RAD"!(CATEG="CT") .,
@OE.PROC.name[CATEG,@OE.ORD.procedure]^PROC,
1^/ORDERS[CATEG_" "_PROC]}}

LOOKUP.F9
; A - name of file
; B - Default val
; C - header string
; D - String to display
; E - ID.ARG


With this screen element for urn
FCL=ADM.PAT.zcus.ticket.to.ride.M.detail(A),""
ID.ARG=ALL
IFE=1
REQ=1

We are writing out of ADM.PAT with a select of xx.oe.ord.proc LI /ORDERS

We tried putting a debug into the screen element and it doesn't seem to hit it.
Can anyone see where we are going wrong?

link|flag
see my response below. – John Sharpe Mar 5 at 19:37
1

John, Thanks for the March Bulletin. We tried and we get the lookup prompt but there is no data. We debugged our macro to define the orders we want and it is working fine - however we are getting the warning "The entry is not defined" when we do a lookup at the orders prompt. Here is our orders.f9.lookup macro.
(We are especially confused about what the PARAM.D line means - what is CD?? We aren't knowledgeable about the syntax, I guess. "CD:10L_"_@Quote(@OE.PROC.name[@category,@procedure[CD]])^/PARAM.D,

@Macro(patients.procedures), ; Z.id parameter list ; A - name of file ; B - default value ; C - header string ; D - string to display ; E - ID.ARG ; F - Title ^/ORDERS^/PARAM.A, ; Send lookup value; if none, then lookup first value in index. IF{A&(/ORDERS[A]) A; +/ORDERS[""]$2}^PARAM.B, "Category":10L_("Order":30L)^PARAM.C, "CD:10L_"_@Quote(@OE.PROC.name[@category,@procedure[CD]])^/PARAM.D, "BR"^/PARAM.F, {"N","","","Y"}^/PARAM.G, @LOOKUP.KEY.PRESS^@KEY.PRESSED.LAST, %Z.id(/PARAM.A,/PARAM.B,/PARAM.C,/PARAM.D,/PARAM.E,/PARAM.F,/PARAM.G)^/F9.RESULT;

link|flag
The April MEDITECH Bulletin contains a new article on this topic: meditechbulletin.com/index.php/…. – John Sharpe Apr 6 at 2:36
0

For those just joining the conversation - read all about creating your own F9 MEDITECH Lookups here.

Question from Pat: ... assuming we could go out with a DO loop and populate the patient’s scheduled or ordered procs, first we need to know what patient. So we prompt the user for patient and they need to type that info in and press F12.

Question from Pat: ... the second problem I see would be that if you created your list in an LI, you would present that whole LI to the user and they would have to delete the ones that don’t apply. Kind of a reverse logic in a world where people are used to simply selecting one item from a list – like your group response idea.

Answers from John: It depends what you want. Your DO Loop can run in a macro and only present patients with an ordered procedure for a given date or range of dates. If you want to specific the dates, put your SELECT Fields for date before the SELECT for patient.

When the user running the report, keys F9, they will be presented with a list of patients that meet the predetermined criteria. At that point, the user selects the ones they want, one at a time. F9, select item, F12 - for each item in the Lookup that they want.

Does that help?

MEDITECH Lookup F9

link|flag
A new article on this topic has been posted in the April MEDITECH Bulletin: meditechbulletin.com/index.php/…. – John Sharpe Apr 6 at 2:37
0

Hi Pat,

This month in the March MEDITECH Bulletin, I've demonstrated a new way to do this. It comes out Monday, I think. In the meantime, I'll email it to you even though it isn't published, since you are a fellow contributor to the MEDITECH Bulletin.

I was going to advise you to use the ID.SEL attribute, but with more than one category, that won't be clean.

ID.SEL=@OE.ORD.patient.x["CT",c.urn,TO MANY SUBSCRIPTS HERE,HERE]

That and there are too many subscripts in the index to make that attribute work for your purposes.

John

link|flag

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.