source: WorldVistAEHR/trunk/r/MENTAL_HEALTH-YS-RUCL-YI-YT/YTREPT.m@ 1375

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

initial load of WorldVistAEHR

File size: 3.4 KB
Line 
1YTREPT ;SLC/DKG-TEST PKG: GENERAL TEST REPORT ;11/16/90 08:18 ;
2 ;;5.01;MENTAL HEALTH;**37**;Dec 30, 1994
3SCOR ;
4 K S G TF:YSTY["T",DI:YSTY["W",RW:YSTY["R",STND
5DI ;
6 G:$D(YSMX) F0 S YSMX=$P(^YTT(601,YSTEST,"Q",1,0),U,2),YSMX=$E(YSMX,$L(YSMX)-1)+1 G F0
7TF ;
8 S YSMX=0
9F0 ;
10 S R="",J=1
11T0 ;
12 S L=200,M=0,YSKK=1,YSTL=0 G:'$D(^YTT(601,YSTEST,"S",J,"K",YSKK,0)) STND D RD
13T1 ;
14 I '$D(^YTT(601,YSTEST,"S",J,"K",YSKK,0)) S R=R_YSTL_"^",J=J+1 G T0
15 S Y=^YTT(601,YSTEST,"S",J,"K",YSKK,0),P=1
16T2 ;
17 S YSIT=$P(Y,U,P) I YSIT="" S YSKK=YSKK+1 G T1
18 S A=$P(Y,U,P+1),P=P+2
19T3 ;
20 I YSIT>L S L=L+200,M=M+200 D RD G T3
21 I 'YSMX S:$E(X,YSIT-M)=A YSTL=YSTL+1 G T2
22 S B=$E(X,YSIT-M) S YSTL=YSTL+$S(A="D":B,B="X":0,1:YSMX-B) G T2
23RW ;
24 S R="",YSTTL=0,J=1,YSIT=1,L=200 D RD
25W0 ;
26 I '$D(^YTT(601,YSTEST,"S",J,"K",1,0)) S:J>2 R=R_YSTTL G STND
27 S Y=^YTT(601,YSTEST,"S",J,"K",1,0),YSTL=0,L=$L(Y)
28 F I=1:1:L S:$E(X,YSIT)=$E(Y,I) YSTL=YSTL+1 S YSIT=YSIT+1
29 S R=R_YSTL_"^",YSTTL=YSTTL+YSTL,J=J+1 G W0
30RD ;
31 S X=^YTD(601.2,YSDFN,1,YSET,1,YSED,L\200) Q
32STND ;
33 I YSTY'["S",YSTY'["L" G REPT
34 S S="",J=1,P="M" I $D(^YTT(601,YSTEST,"S",J,"F")),YSSX="F" S P="F"
35 G LK:YSTY["L"
36ST ;
37 S A=$P(R,U,J) G:A="" REPT
38 S X=^YTT(601,YSTEST,"S",J,P),S=S_$J((A-$P(X,U)/$P(X,U,2)*10+50),0,0)_"^",J=J+1 G ST
39LK S A=$P(R,U,J) G:A="" REPT S L1=$P(^YTT(601,YSTEST,"S",J,P),U) I A<L1 S S=S_"0^",J=J+1 G LK
40 S S=S_$P(^(P),U,A+2-L1)_"^",J=J+1 G LK
41REPT ;
42 I YSTY'["*" G DONE
43 S X=$P(^YTT(601,YSTEST,"P"),U),A=$P(^("P"),U,2),B=$P(^("P"),U,3),L1=58-A\2,L2=L1+A+4 S:A<9 A=9
44 D DTA W !!?(72-$L(X)\2),X,!!!?(A-9\2+L1),"S C A L E",?(L2+1),"RAW ",B,!
45 F J=1:1 S YSRS=$P(R,U,J) Q:YSRS="" D:IOST?1"C-".E&($Y>21) SCR Q:YSTOUT!YSUOUT W !?L1,$P(^YTT(601,YSTEST,"S",J,0),U,2),?L2,$J(YSRS,4,0) W:$D(S) ?(L2+6),$J($P(S,U,J),4,0)
46 Q
47IR ;
48 S P0=$S(IOST?1"P".E:1,1:0),K=0,YSLFT=0 F I=1:1 Q:'$D(^YTD(601.2,YSDFN,1,YSET,1,YSED,I)) S K=K+$L(^(I))
49 S K=K\10+$Y D DTA S X=$P(^YTT(601,YSTEST,"P"),U) W !!?(72-$L(X)/2),X
50 W !!!?25,"--- ITEM RESPONSES ---",!! S L=200,M=0,YSIT=1 ;I $D(^YTD(601.2,YSDFN,1,YSTEST,1,YSHD,99)),^(99)="MMPIR" S L=800
51R2 ;
52 D RD S A=$L(X),B=A\10 I B S K=10 F I=1:1:B D RLN Q:YSLFT
53 G:YSLFT DONE
54 S K=-10*B+A I K D RLN G DONE
55 G:A<200 DONE S L=L+200,M=M+200 I $D(^YTD(601.2,YSDFN,1,YSET,1,YSED,L\200)) G R2
56DONE ;
57 K YSTY,X,Y,A,B,K,YSKK,L,L1,L2,M,J,YSIT,YSRS,I,P,YSMX,YSTL,YSTTL Q
58RLN ;
59 W ?1 F YSKK=1:1:K W $J(YSIT,3,0)," ",$E(X,YSIT-M)," " S YSIT=YSIT+1
60 D:'P0&($Y>21) SCR:I<B W ! Q
61SCR ;
62 ; Added 5/6/94 LJA
63 N A,B,B1,C,D,E,E1,F,F1,G,G1,H,I,J,J1,J2,J3,J4,K,L,L1,L2,M,N
64 N N1,N2,N3,N4,P,P0,P1,P3,R,R1,S,S1,T,T1,T2,TT,V,V1,V2,V3
65 N V4,V5,V6,W,X,X0,X1,X2,X3,X4,X7,X8,X9,Y,Y1,Y2,Z,Z1,Z3
66 ;
67 F I0=1:1:(IOSL-$Y-2) W !
68 N DTOUT,DUOUT,DIRUT,X
69 S DIR(0)="E" D ^DIR K DIR S YSTOUT=$D(DTOUT),YSUOUT=$D(DUOUT),YSLFT=$D(DIRUT)
70 W @IOF Q
71DTA ;
72 S X0=^YTD(601.2,YSDFN,1,YSET,1,YSED,0),YSDTA=$P(X0,U,5) S:YSDTA'="" YSDTA=$$FMTE^XLFDT(YSDTA,"5ZD")
73 S YSHDR=$E(YSHDR,1,43)_" "_YSSEX_" AGE "_$J(YSAGE,2,0)_" "_YSDT(0)_" "_$$FMTE^XLFDT(YSHD,"5ZD") W @IOF,YSHDR," ",YSDTA
74 W ! S X7=$P(X0,U),X8=$P(X0,U,8) I X8,X8<X7 W "Begun: ",$$FMTE^XLFDT(X8,"5ZD")," Finished ",$$FMTE^XLFDT(X7,"5ZD")
75 W ?53,"PRINTED ENTERED " W:YSDTA'="" "ADMIN" Q
76 ;
77ICL ;Report Logic for ICL Report. This code was too long to remain in file.
78 S D=$P(R,U,2)-$P(R,U,6),A=$P(R,U,8)-$P(R,U,4),L=A-D*.7+$P(R,U,7)-$P(R,U,3),D=D=A*.7+$P(R,U)-$P(R,U,5),R=$P(R,U,1,8)_U_$J(D+2.85/7.88*10+50,0,0)_U_$J(L-1.60/8.88*10+50,0,0),L="16^",S=L_L_L_L_L_L_L_L_"102^91"
79 Q
Note: See TracBrowser for help on using the repository browser.