Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: YTREPT

YTREPT.m

Go to the documentation of this file.
YTREPT ;SLC/DKG-TEST PKG: GENERAL TEST REPORT ;11/16/90  08:18 ;
 ;;5.01;MENTAL HEALTH;**37**;Dec 30, 1994
SCOR ;
 K S G TF:YSTY["T",DI:YSTY["W",RW:YSTY["R",STND
DI ;
 G:$D(YSMX) F0 S YSMX=$P(^YTT(601,YSTEST,"Q",1,0),U,2),YSMX=$E(YSMX,$L(YSMX)-1)+1 G F0
TF ;
 S YSMX=0
F0 ;
 S R="",J=1
T0 ;
 S L=200,M=0,YSKK=1,YSTL=0 G:'$D(^YTT(601,YSTEST,"S",J,"K",YSKK,0)) STND D RD
T1 ;
 I '$D(^YTT(601,YSTEST,"S",J,"K",YSKK,0)) S R=R_YSTL_"^",J=J+1 G T0
 S Y=^YTT(601,YSTEST,"S",J,"K",YSKK,0),P=1
T2 ;
 S YSIT=$P(Y,U,P) I YSIT="" S YSKK=YSKK+1 G T1
 S A=$P(Y,U,P+1),P=P+2
T3 ;
 I YSIT>L S L=L+200,M=M+200 D RD G T3
 I 'YSMX S:$E(X,YSIT-M)=A YSTL=YSTL+1 G T2
 S B=$E(X,YSIT-M) S YSTL=YSTL+$S(A="D":B,B="X":0,1:YSMX-B) G T2
RW ;
 S R="",YSTTL=0,J=1,YSIT=1,L=200 D RD
W0 ;
 I '$D(^YTT(601,YSTEST,"S",J,"K",1,0)) S:J>2 R=R_YSTTL G STND
 S Y=^YTT(601,YSTEST,"S",J,"K",1,0),YSTL=0,L=$L(Y)
 F I=1:1:L S:$E(X,YSIT)=$E(Y,I) YSTL=YSTL+1 S YSIT=YSIT+1
 S R=R_YSTL_"^",YSTTL=YSTTL+YSTL,J=J+1 G W0
RD ;
 S X=^YTD(601.2,YSDFN,1,YSET,1,YSED,L\200) Q
STND ;
 I YSTY'["S",YSTY'["L" G REPT
 S S="",J=1,P="M" I $D(^YTT(601,YSTEST,"S",J,"F")),YSSX="F" S P="F"
 G LK:YSTY["L"
ST ;
 S A=$P(R,U,J) G:A="" REPT
 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
LK 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
 S S=S_$P(^(P),U,A+2-L1)_"^",J=J+1 G LK
REPT ;
 I YSTY'["*" G DONE
 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
 D DTA W !!?(72-$L(X)\2),X,!!!?(A-9\2+L1),"S C A L E",?(L2+1),"RAW  ",B,!
 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)
 Q
IR ;
 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))
 S K=K\10+$Y D DTA S X=$P(^YTT(601,YSTEST,"P"),U) W !!?(72-$L(X)/2),X
 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
R2 ;
 D RD S A=$L(X),B=A\10 I B S K=10 F I=1:1:B D RLN Q:YSLFT
 G:YSLFT DONE
 S K=-10*B+A I K D RLN G DONE
 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
DONE ;
 K YSTY,X,Y,A,B,K,YSKK,L,L1,L2,M,J,YSIT,YSRS,I,P,YSMX,YSTL,YSTTL Q
RLN ;
 W ?1 F YSKK=1:1:K W $J(YSIT,3,0)," ",$E(X,YSIT-M),"  " S YSIT=YSIT+1
 D:'P0&($Y>21) SCR:I<B W ! Q
SCR ;
 ;  Added 5/6/94 LJA
 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
 N N1,N2,N3,N4,P,P0,P1,P3,R,R1,S,S1,T,T1,T2,TT,V,V1,V2,V3
 N V4,V5,V6,W,X,X0,X1,X2,X3,X4,X7,X8,X9,Y,Y1,Y2,Z,Z1,Z3
 ;
 F I0=1:1:(IOSL-$Y-2) W !
 N DTOUT,DUOUT,DIRUT,X
 S DIR(0)="E" D ^DIR K DIR S YSTOUT=$D(DTOUT),YSUOUT=$D(DUOUT),YSLFT=$D(DIRUT)
 W @IOF Q
DTA ;
 S X0=^YTD(601.2,YSDFN,1,YSET,1,YSED,0),YSDTA=$P(X0,U,5) S:YSDTA'="" YSDTA=$$FMTE^XLFDT(YSDTA,"5ZD")
 S YSHDR=$E(YSHDR,1,43)_" "_YSSEX_" AGE "_$J(YSAGE,2,0)_" "_YSDT(0)_" "_$$FMTE^XLFDT(YSHD,"5ZD") W @IOF,YSHDR," ",YSDTA
 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")
 W ?53,"PRINTED    ENTERED  " W:YSDTA'="" "ADMIN" Q
 ;
ICL ;Report Logic for ICL Report.  This code was too long to remain in file.
 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"
 Q