All messages should be posted in plain text.  HTML will be converted to
attachments.    The meditech-l web site is MTUsers.com
======================================

Thanks for everyone's help on this one.  I am going to show all the
solutions and let you know which one I used.  

SOLUTION 1: (Thanks to Lori Vandiver)
** I did not use this solution since I am strictly a report writer and
have no involvement with maintenance of CDS's.  This sounds like a cool
concept but the code to capture this was easy enough. ** 

        Have a query on the CDS that auto fills the patient's current
location and then skips the query.

************************************************************************
**************************************

SOLUTION 2: (Thanks to Phyllis Whitener, Kimberly Frick)
** I did not use this solution since it only contains a value when an
intervention is DOCUMENTED (D).  This would probably work in a crunch
but I wanted to be able to capture other Activity Types such as (+, ES,
U, etc...) **

        Use "td.location" with the Detail Segment
"nur.int.documented.activity"

************************************************************************
**************************************

SOLUTION 3: (Thanks to Ken MacPherson) I will cut and paste his solution
below.
** I did not use this solution only because I am a MAGIC site and did
not attempt to change the variables.  The code looks good and I like the
flow and may try it out in the future for the practice of it. **

What you have to do is cycle the events segment for the event following
the date and time of the charting and determine the location of the
patient from that record.  I Have a macro the cycles the event segment
for multiple pieces of information which is pasted below.

        Create a report Z.zcus.npr
        Paste the code below into the report

        If you are a magic site then you may have to alter the variable
names to match how variables are named in your system.

        To use this macro the statement would be

        
%Z.zcus.npr.M.get.event.info(ADM.PAT.urn,DATE,TIME,"event.location")

Hope this Helps
Ken

;Programmer : Ken MacPherson                 Date : March 11, 2004
;Purpose    : Cycle ADM.PAT Event Segment to determine historic patient
information
@SETUP,
@CYCLE.EFFECTIVE.DATES;

SETUP
A^ADM.PAT.urn,
B^DATE,
C^TIME,
D^REQUEST.FLAG,
%Z.date.text(DATE,"YND")^PARM.DATE,
%Z.time.text(TIME,"HM","S")^PARM.TIME,
PARM.DATE_PARM.TIME^PARM.DATE.TIME,
""^FOUND

CYCLE.EFFECTIVE.DATES
""^ADM.PAT.event.date,
""^BEST.DATE.TIME,
""^HOLD,
[EMAIL PROTECTED] @PROCESS.EFFECTIVE.DATE},
FOUND

NEXT.DATE
@Next(ADM.PAT.event.date,ADM.PAT.events)

PROCESS.EFFECTIVE.DATE
""^ADM.PAT.event.seq.no,
[EMAIL PROTECTED] @PROCESS.EFFECTIVE.EVENT}

NEXT.EVENT
@Next(ADM.PAT.event.seq.no,ADM.PAT.events)

PROCESS.EFFECTIVE.EVENT
[EMAIL PROTECTED];
   %Z.date.text(@ADM.PAT.event.eff.date,"YND")^EFF.DATE,
   %Z.time.text(@ADM.PAT.event.eff.time,"HM","S")^EFF.TIME,
   EFF.DATE_EFF.TIME^EFF.DATE.TIME,
   IF{(EFF.DATE.TIME>PARM.DATE.TIME)!(EFF.DATE.TIME<BEST.DATE.TIME);
      EFF.DATE.TIME^BEST.DATE.TIME,
      IF{REQUEST.FLAG="event.accom" @ADM.PAT.event.accom;
         REQUEST.FLAG="event.admit.doctor" @ADM.PAT.event.admit.doctor;
         REQUEST.FLAG="event.attend.doctor"
@ADM.PAT.event.attend.doctor;
         REQUEST.FLAG="event.location" @ADM.PAT.event.location;
         REQUEST.FLAG="event.prim.care.doctor"
@ADM.PAT.event.prim.care.doctor;
         REQUEST.FLAG="event.room.rate.accom"
@ADM.PAT.event.room.rate.accom;
         REQUEST.FLAG="event.room" @ADM.PAT.event.room;
         REQUEST.FLAG="event.service" @ADM.PAT.event.service;
         REQUEST.FLAG="event.status" @ADM.PAT.event.status;
         REQUEST.FLAG="event.user" @ADM.PAT.event.user;
         REQUEST.FLAG="event.bed" @ADM.PAT.event.bed}^HOLD,
      IF{HOLD;FOUND}^FOUND}}

FIXED
@ADM.PAT.event.qualifiers="<FIXED>"

************************************************************************
**************************************

SOLUTION 4: (Thanks to Cheri Adams) Again, I will cut and paste her
response.
** I did use this solution, although I modified it a bit to fit what I
needed.  Very easy code to work with **

Here's something that I worked up for our group:
 
Go to the macro section (you choose the name of your macro - I have used
get and getloc as macro names before - and copy and paste this in - the
instructions (prefaced with a ";") are pretty straightforward - 
 
;This macro will determine the patient's location/rm/bed when the int
was ;documented.
;
;This macro was based on what was found on the MT web site and then
modified to concatenate ;the location-room-bed.  Validated and works
appropriately.
;
;If you want just the location, remove the concatenated room and bed
from the first part ;of the macro read: LOC; ;instead of
LOC_"-"_RM_"-"BED; ; ;Under the CHECK portion - you can remove last two
lines that ^RM and ^BED if you don't want ;room and bed in addition to
location.
;
;On report make xx.field w/the following:
;DAT=FREE
;JFY=C
;LEN=20
;In the val statement below, be sure to change the name of the
report/macro call to the ;current name/macro call in your report.
Remember, this isn't actually a macro, it is a ;program call to loop
through the ADM room/bed index.
;VAL=%NUR.PC.WORK.zcus.crm.kar.pain.download.cla1.M.get
;VAL=(@patient,@td.act.date,@td.act.time)
;
A^patient,
B_._C^ODT,
""^LOC^DT,
DO{-ADM.PAT.events[patient,DT]^DT&'LOC ""^TM,
 
DO{-ADM.PAT.events[patient,DT,TM]^TM&'LOC @CHECK}},LOC_"-"_RM_"-"_BED;
 
CHECK
@ADM.PAT.event.eff.date[patient,DT,[EMAIL PROTECTED]
,DT,TM]^LDT,
IF{LDT'>ODT @ADM.PAT.event.location[patient,DT,TM]^LOC},
@ADM.PAT.event.eff.date[patient,DT,[EMAIL PROTECTED]
,DT,TM]^LDT,
IF{LDT'>ODT @ADM.PAT.event.room[patient,DT,TM]^RM},
@ADM.PAT.event.eff.date[patient,DT,[EMAIL PROTECTED]
,DT,TM]^LDT,
IF{LDT'>ODT @ADM.PAT.event.bed[patient,DT,TM]^BED}

************************************************************************
**************************************

I hope this helps anyone who needs it!

Roy Coutts, LPN
Division Reporting Analyst
West Florida Division Information Technology & Services

26133 US Hwy 19N, Suite 100
Clearwater, FL 33763
t: 727.772.2842
f: 727.772.2843
e: [EMAIL PROTECTED]

This email and any files transmitted with it may contain PRIVILEGED or
CONFIDENTIAL information and may be read or used only by the intended
recipient.  If you are not the intended recipient of the email or any of
it's attachments, please be advised that you have received this email in
error and that any use, dissemination, distribution, forwarding,
printing or copying of this email or any attached files is strictly
prohibited.  If you have received this email in error, please
immediately purge it and all attachments and notify the sender by reply
mail or contact the sender at the number listed.

_______________________________________________
meditech-l mailing list
[email protected]
http://mtusers.com/mailman/listinfo/meditech-l

Reply via email to