source: WorldVistAEHR/trunk/r/MENTAL_HEALTH-YS-RUCL-YI-YT/YTKIL.m@ 1009

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

revised back to 6/30/08 version

File size: 2.1 KB
Line 
1YTKIL ;SLC/TGA-KILL TEST/INTERVIEW DATA ;4/21/92 08:50 ;03/11/94 12:49
2 ;;5.01;MENTAL HEALTH;**37**;Dec 30, 1994
3 ;
4 ; Called from the top by MENU option YSMKIL
5 ;
6 S YSO=0,YSNOKILL=1 W @IOF,!!,"Delete Patient Data"
7 W ! D ^YSLRP G:YSDFN<1 END I '$D(^YTD(601.2,YSDFN)),'$D(^YTD(601.4,YSDFN)) W !!,"NO DATA ON THIS PATIENT!" G END
8R ;
9 R !!,"Delete All tests and interviews? N// ",A:DTIME S YSTOUT='$T,YSUOUT=A["^" G:YSTOUT!YSUOUT END S A=$TR($E(A_"N"),"yn","YN") I "YN"'[A W:A'["?" " ?",$C(7) G R
10 I "Y"[A S DIK="^YTD(601.2,",DA=YSDFN D ^DIK S DIK="^YTD(601.4,",DA=YSDFN D ^DIK W !!,"DELETED!" G END
11 S T(0)=0 G:'$O(^YTD(601.4,YSDFN,1,0)) C W !!,"Incomplete tests and Interviews",! S YTC=$O(^YTT(601,"B","CLERK",0))
12 S T=0
13 F S T=$O(^YTD(601.4,YSDFN,1,T)) G:'T C S T(0)=T(0)+1 G:YSTOUT!YSUOUT END S X=^(T,0),P=$P(X,U),D=$P(X,U,2),DA=P S:P=YTC P=$P(X,U,6),DA=YTC W !!,$$TN(+YSDFN,+T,+P),?10,$$FMTE^XLFDT(D,"5ZD") D DI
14DI ;
15 R " ...Delete? N// ",K:DTIME S YSTOUT='$T,YSUOUT=K["^",K=$E(K) Q:"Nn"[K I YSTOUT!YSUOUT Q
16 I "Yy"'[K W:K'["?" " ?",$C(7) G DI
17 S DIK="^YTD(601.4,YSDFN,1,",DA(1)=YSDFN D ^DIK W ?40,"DELETED!" Q
18C ;
19 G:'$D(^YTD(601.2,YSDFN,1,0)) E W !!,"Completed Tests and Interviews"
20 S T=0
21 F S T=$O(^YTD(601.2,YSDFN,1,T)) G:'T!YSUOUT END F D=0:0 S D=$O(^YTD(601.2,YSDFN,1,T,1,D)) Q:'D S T(0)=T(0)+1 Q:YSTOUT!YSUOUT Q:'$D(^YTT(601,T)) W !!,$P(^YTT(601,T,0),U),?10,$$FMTE^XLFDT(D,"5ZD") D DC
22DC ;
23 R " ...Delete? N// ",K:DTIME S YSTOUT='$T,YSUOUT=K["^",K=$E(K) Q:"Nn"[K I YSTOUT!YSUOUT Q
24 I "Yy"'[K W:K'["?" " ?",$C(7) G DC
25 S DIK="^YTD(601.2,YSDFN,1,T,1,",DA=D,DA(1)=T,DA(2)=YSDFN D ^DIK W ?40,"DELETED" Q
26E ;
27 W:'T(0) !!,"NO TESTS/INTERVIEWS FOUND!"
28END ;
29 K %,A,D,DA,DIC,DIK,K,P,T,X,YSAGE,YSDFN,YSDOB,YSE,YSN,YSNM,YSNOKILL,YSO,YSS,YSSEX,YSSSN,YTC
30 QUIT
31 ;
32TN(DFN,TN6014,TN601) ;Print test name...
33 ; TN6014 = IEN of ^YTD(601.4,+DFN,1,+TN6014...
34 ; TN601 = IEN of ^YTT(601,+TN601...
35 N TESTNAME,X
36 S X=$P($G(^YTT(601,+TN601,0)),U),TESTNAME=$S(X']"":"Unknown",1:X)
37 I $G(^YTD(601.4,+DFN,1,+TN6014,99))'="MMPIR" QUIT TESTNAME ;->
38 QUIT $S(TN601=60:"MMPIR",TN601=61:"MMPR",1:"Unknown") ;->
39 ;
Note: See TracBrowser for help on using the repository browser.