Focal Point
[CLOSED] Compliance based on a rolling week

This topic can be found at:
http://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5087047595

December 22, 2010, 09:50 AM
Sleet
[CLOSED] Compliance based on a rolling week
I need to determine compliance based on how many times a week a patient is seen. Problem is...the week begins based on each patient's initial eval date, not a typical week, and ends upon discharge. I want to do this w/o having to perform a lot of manual calculations as each patient is different. One could have a stay of a week or be here for 6 months. How do I set this up based upon each patient's stay so that everything is calculated within the program? I'm trying to accomplish this vertically and do not think setting up weeks across in columns will work w/o manually specifying. Example of the data I'm looking at:

My initial eval time is 09/20/10 and I am supposed to be seen twice a week. I was discharged on 11/02/10. Here are my visit times which are entered by day.

2010/09/20
2010/09/21
2010/09/25
2010/09/26
2010/09/27
2010/09/29
2010/10/26
2010/10/29

Looking at this example, the patient was not seen twice per week, except during 9/20 to 9/27. How do I say "this patient was seen 5 times during 9/20 to 9/27, once from 9/28 to 10/4, none for 10/5 to 10/12, etc. I'm trying to do it in a define, but don't know how to set this up so that it is all based on the stay and not my having to set this up based on how many weeks I think a patient may be here. I've calculated the difference between the initial stay (9/20) and each visit to see what week it falls in, but need help figuring out the rest or would so appreciate other suggestions. Maybe I'm making this harder than it is??

This message has been edited. Last edited by: Kerry,


WF 8009
Windows 7 Enterprise
IE 9.0
Output: All
December 22, 2010, 04:32 PM
Waz
Here is a suggestion that may work for you.

It uses the FOR commmand, you could replace this with Macgyver as well.

-SET &Cntr = 0 ;
-* Write out a master to read the BSB_ACC list
EX -LINES 4 EDAPUT MASTER,tmp_date,CV,FILE
FILENAME=TMP_DATE, SUFFIX=FIX,$
SEGNAME=TMP_DATE, $
  FIELD=Date ,ALIAS=  ,YYMD ,A10,$

FILEDEF TMP_DATE DISK tmp_date.ftm (LRECL 10

EX -LINES 9 EDAPUT FOCTEMP,tmp_date,CV,FILE
2010/09/20
2010/09/21
2010/09/25
2010/09/26
2010/09/27
2010/09/29
2010/10/26
2010/10/29

TABLE  FILE TMP_DATE
 SUM   
       COMPUTE MIN_DATE/YYMD = MIN.Date ;
 PRINT 
       COMPUTE NO_DAYS/I9 = Date - MIN_DATE ;
       COMPUTE WK_NO/I9   = (NO_DAYS/7) + 1 ;
 BY    Date
 ON    TABLE HOLD AS TMP_DAYS
 ON    TABLE SET HOLDLIST PRINTONLY
END

TABLE  FILE TMP_DAYS
 SUM   MAX.WK_NO
 ON    TABLE SAVE AS SAV_WK
END
-RUN
-READ SAV_WK &MAX_WK.A9.

TABLE  FILE TMP_DAYS
 PRINT Date
 FOR   WK_NO
-REPEAT WK_LOOP FOR &Cntr FROM 1 TO &MAX_WK ;
-SET &Over = IF &Cntr EQ 1 THEN ' ' ELSE 'OVER' ;
&Over &Cntr
-WK_LOOP
END



Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

December 23, 2010, 05:12 PM
GCohen
Why can't you map the DATE field into a WEEK of Year field and sort by WEEK. e.g.
WDATE/YYW = DATE;

COUNT visits by WDATE where patient eq 'xxx'


Release 7.6.9
Windows
HTML
December 23, 2010, 05:21 PM
Waz
That would work, if there was always dates in each week, but if there was no visits in a week, there will be missing data.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

December 28, 2010, 03:36 PM
Sleet
quote:
-REPEAT

Thanks you guys....I so appreciate it.

I've never used Repeat before. From the -Repeat to the -Wk_Loop statement in the last table file...is that simply another way of doing a loop? I've not worked with loops that much....


WF 8009
Windows 7 Enterprise
IE 9.0
Output: All
December 28, 2010, 04:06 PM
Waz
quote:
-REPEAT


Check out the documentation, there are several ways to use -REPEAT.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!