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.
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,
Windows 7 Enterprise
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
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'
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.
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....
Windows 7 Enterprise
Check out the documentation, there are several ways to use -REPEAT.
|Powered by Social Strata|