source: FOIAVistA/trunk/r/MENTAL_HEALTH-YS-RUCL-YI-YT/YTAIMS.m@ 1801

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

initial load of FOIAVistA 6/30/08 version

File size: 2.2 KB
Line 
1YTAIMS ;ALB/ASF-TEST PKG: AIMS ;8/18/99 09:19
2 ;;5.01;MENTAL HEALTH;**54,66**;Dec 30, 1994
3 ;
4 ;Reference to ^%ZOSF("NO-TYPE-AHEAD" supported by IA #10096
5 ;Reference to ^VA(200 supported by IA #10060
6 ;Reference to $$GET1^DIQ() supported by IA #2056
7 ;
8 X ^%ZOSF("NO-TYPE-AHEAD")
9 I '$D(J) S J=1,(YSRP,B)="",YSBEGIN=DT
10NX ;
11 I $D(^YTT(601,YSTEST,"Q",J,0))#2=1 S:$P(^(0),U,2)]"" C=$P(^(0),U,2)
12 I $D(^YTT(601,YSTEST,"Q",J,"B")) S K=^("B") S:K'="" B=K
13 I '$D(^YTT(601,YSTEST,"Q",J,"I",1,0)) G D1
14 W @IOF F K=1:1 Q:'$D(^YTT(601,YSTEST,"Q",J,"I",K)) W:'$D(^YTT(601,YSTEST,"Q",J,"I",5)) ! W:$D(^YTT(601,YSTEST,"Q",J,"I",K,0)) !?3,^(0)
15 W !!!?3,"Press the Space bar to continue"
16 W !?3,"Press 'E' to review the Examination Procedure "
17I2 ;
18 D RD I X'=" " G:X="*" ^YTAR2 G:X="E"!(X="e") EP W " ? " G I2
19D1 ;
20 W @IOF F K=1:1 Q:'$D(^YTT(601,YSTEST,"Q",J,"T",K)) W:$D(^(K,0)) !?3,^(0)
21 X:B'="" B
22D3 ;
23 S YZT=$P($H,",",2) D RD G HOLD:YZT+1>$P($H,",",2) G D4:C[X,BK:X="^",^YTAR2:X="*",WHERE:X="?" W " ? " G D3
24D4 ;
25 S YSRP=YSRP_X D:J#200=0 EN4^YTFILE S J=J+1 I $D(^YTT(601,YSTEST,"Q",J)) G NX
26 D ^YTFILE Q
27RD ;
28 R "",*X:900 S:'$T X=42 G:X<32 RD S X=$C(X) Q
29BK ;
30 G:J=1 D1 S J=J-1,X=$L(YSRP),YSRP=$S(X>1:$E(YSRP,1,X-1),X=1:"",1:$E(^YTD(601.4,YSDFN,1,YSENT,J\200),1,199)) G NX
31WHERE ;
32 W !,YSTESTN," QUESTION # ",J,! X:B]"" B G D3
33HOLD ;
34 W @IOF,#,$C(7) R "Please read each question carefully!",X:3 K X G D1
35 ;
36EP ;exam procedure
37 W @IOF
38 F K=1:1 Q:'$D(^YTT(601,YSTEST,"M",1,1,K)) W !?3,^(K,0) D:($Y+4)>IOSL
39 . R !!,"press any key",*X:900
40 . W @IOF,!
41 R !!,"press any key ",*X:900
42 W @IOF
43 G D1
44 ;
45REPT ;generate printout
46 D DTA^YTREPT
47 S YSNOITEM="DONE^YTAIMS"
48 W !?7,"--- Abnormal Involuntary Movement Scale ---"
49 S Y=^YTD(601.2,YSDFN,1,YSET,1,YSED,1)
50 S R=0
51 F I=1:1:7 S R=R+$E(Y,I)
52 W !!?2,"AIMS score= ",R
53 S YSORD=$P(^YTD(601.2,YSDFN,1,YSET,1,YSED,0),U,3)
54 W ?20,"Ordered by: " I YSORD,$D(^VA(200,YSORD,0)) W $$GET1^DIQ(200,YSORD_",",.01)
55 W !
56 S J=0 F S J=$O(^YTT(601,YSET,"G",1,1,J)) Q:J'>0 D
57 . S X=^YTT(601,YSET,"G",1,1,J,0)
58 . S YSQ=+X
59 . S YSIND=$P($P(X,U),",",2)
60 . S YSTEM=$P(X,U,2)
61 . I YSQ&($E(Y,YSQ)'="X") W !?YSIND,$P(YSTEM,"#"),$P(X,U,$E(Y,YSQ)+3)
62 . I YSQ&($E(Y,YSQ)="X") W !?YSIND,$P(YSTEM,"#"),"missing"
63 . I 'YSQ W !?YSIND,$P(YSTEM,"#")
64DONE ;
65 K YSQ,YSTEM,YSIND
66 Q
Note: See TracBrowser for help on using the repository browser.