If MIS is open, I believe all you need to do is call
MIS.GL.PERIOD.period(date)^c.period
 
Where date is in Magic form YYYYMMDD
 
%MIS.GL.PERIOD(@.date)^c.period
 
James Purvins 
Inland Northwest Health Services 
(509) 232-8384 

This e-mail and any attachments are confidential and may also be
privileged. If you are not the named recipient, or have otherwise
received this communication in error, please delete it from your inbox,
notify the sender immediately by replying to the message, and do not
disclose its contents to any other person, use the information for any
purpose or store or copy the information in any medium. Thank you for
your cooperation 
________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gibbs, David
Sent: Wednesday, July 11, 2007 10:04 AM
To: [email protected]
Subject: [MEDITECH-L] Determining period a date belongs to in NPR macro



Hi 

I am trying to figure out a way to determine what GL period a date
belongs to in a macro.  Before I spend a lot of time inventing the
wheel, I thought I would check to see if someone else has already
determined it.

My selects are 

Xx.fromperiod ig From Period 
Xx.thruperiod ig Thru Period 
Enter.date ge /FROM 
Enter.date le /THRU 

I have a start macro that assigns /FROM and /THRU and an ID attribute on
xx.fromperiod to look up the GL period 

I want to evaluate each record to determine which period @enter.date is
in. 

The logic I think I want (but I get mixed up with the syntax of the DO
loop in my macro) is like this: 

>From StartPeriod to EndPeriod 
 set variable for previous period 
 if enter.date > previous period end date AND enter.date < current
period end date then 
   Set variable to capture the current period 
Loop 

I know I need the fields to do this 
 MIS.GL.PERIOD.period 
 MIS.GL.PERIOD.ending.date[period] 
 enter.date is a field in my Report DPM (it has DATE datatype) 

Can someone help me to put this logic into Magic syntax? 

Thanks 

David Gibbs 
Lab IS Analyst 
Fraser Health 


=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
To subscribe or unsubscribe to the meditech-l, visit 
http://mtusers.com/mailman/listinfo/meditech-l_mtusers.com

To check the status of the meditech-l, visit MTUsers.NET

For help, email [EMAIL PROTECTED]

Please visit and add information to the MTUsers WikiPedia at MTUsers.NET/mwiki
______________________________________
meditech-l mailing list
[email protected]
http://mtusers.com/mailman/listinfo/meditech-l_mtusers.com

Reply via email to