source: FOIAVistA/tag/r/ONCOLOGY-ONC/ONCOU0A.m@ 1262

Last change on this file since 1262 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 2.0 KB
Line 
1ONCOU0A ;WISC/MLH - ONCOLOGY PATIENT FILE UTILITIES - Fix follow ups for expired patients ;6/21/93 09:18
2 ;;2.11;ONCOLOGY;;Mar 07, 1995
3 ;
4FIXFOR(ONCOWRT) ; correct erroneous 'foreign resident' status for exp pats
5 ; ONCOWRT defined if output desired
6 N ONCOLVL S ONCOLVL="^TMP(""ONCOFIXFOR"","_$$INITSYA_")" ; level of ^TMP for SYA
7 N ONCOKP,ONCOKF,ONCOKC S (ONCOKP,ONCOKF,ONCOKC)=0 ; counts
8 N ONCOPI S ONCOPI=0 ; patient file index
9 FOR ONCOKP=0:1 S ONCOPI=$O(^ONCO(160,ONCOPI)) Q:ONCOPI'=+ONCOPI D
10 . N ONCOFI S ONCOFI=0 ; follow-up sub-file index
11 . FOR S ONCOFI=$O(^ONCO(160,ONCOPI,"F",ONCOFI)) Q:ONCOFI'=+ONCOFI S ONCOKF=ONCOKF+1,ONCOKC=ONCOKC+$$CHKSTAT(ONCOPI,ONCOFI,ONCOLVL,ONCOWRT)
12 . Q
13 ;END FOR
14 ;
15 N ONCORES S ONCORES=ONCOKP_U_ONCOKF_U_ONCOKC ; results array
16 I $D(ONCOWRT) D WRT(ONCORES)
17 QUIT
18 ;
19INITSYA() ; find level of ^TMP on which to put SYA and initialize
20 N ONCOI S ONCOI=$P($G(^TMP("ONCOFIXFOR",0)),U,3)+1,$P(^(0),U,3)=ONCOI
21 Q ONCOI
22 ;
23CHKSTAT(ONCOP,ONCOF,ONCOLVL,ONCOWRT) ; look at follow-up record for patient ONCOP, follow-up ONCOF
24 ; if we need to change and ONCOLVL defined, back up on ^TMP("ONCOFIXFOR",ONCOLVL)
25 ; ONCOWRT is defined if we want dots for the user
26 N ONCOX S ONCOX=$G(^ONCO(160,ONCOP,"F",ONCOF,0)) ; onco pat rec
27 N ONCOCHG S ONCOCHG=0 ; change flag
28 IF $P(ONCOX,U,2)=0,$P(ONCOX,U,6)=8 D ; exp pat, foreign resident --> hit!
29 . S ONCOSYA=$P($G(@ONCOLVL@(0)),U,3)+1,$P(@ONCOLVL@(0),U,3)=ONCOSYA,@ONCOLVL@(ONCOSYA,0)=ONCOP_":"_ONCOF_":"_ONCOX ; save old data
30 . ;
31 . ; correct follow-up method
32 . N DIE,DA S DIE="^ONCO(160,"_ONCOP_",""F"",",DA(1)=ONCOP,DA=ONCOF,DR="6///9"
33 . D ^DIE
34 . ;
35 . I $D(ONCOWRT),$R(40)=0 W "."
36 . S ONCOCHG=1
37 . Q
38 ;END IF
39 ;
40 Q ONCOCHG
41 ;
42WRT(ONCORES) ; output results array
43 N ONCOI F ONCOI=1:1:3 S ONCORES(ONCOI)=$P(ONCORES,U,ONCOI)
44 W !!,"Oncology patients processed: ",?35,$J(ONCORES(1),6),!,"Follow-ups processed: ",?35,$J(ONCORES(2),6),!,"Follow-ups corrected: ",?35,$J(ONCORES(3),6),!!
45 Q
Note: See TracBrowser for help on using the repository browser.