YTREPT ;SLC/DKG-TEST PKG: GENERAL TEST REPORT ;Nov 09, 2023@14:48:57;
;;5.01;MENTAL HEALTH;**37,238**;Dec 30, 1994;Build 25
;
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)_" "_$S($G(YSSIG)'="":YSSIG,1: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
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYTREPT 3592 printed Nov 22, 2024@17:29:07 Page 2
YTREPT ;SLC/DKG-TEST PKG: GENERAL TEST REPORT ;Nov 09, 2023@14:48:57;
+1 ;;5.01;MENTAL HEALTH;**37,238**;Dec 30, 1994;Build 25
+2 ;
SCOR ;
+1 KILL S
if YSTY["T"
GOTO TF
if YSTY["W"
GOTO DI
if YSTY["R"
GOTO RW
GOTO STND
DI ;
+1 if $DATA(YSMX)
GOTO F0
SET YSMX=$PIECE(^YTT(601,YSTEST,"Q",1,0),U,2)
SET YSMX=$EXTRACT(YSMX,$LENGTH(YSMX)-1)+1
GOTO F0
TF ;
+1 SET YSMX=0
F0 ;
+1 SET R=""
SET J=1
T0 ;
+1 SET L=200
SET M=0
SET YSKK=1
SET YSTL=0
if '$DATA(^YTT(601,YSTEST,"S",J,"K",YSKK,0))
GOTO STND
DO RD
T1 ;
+1 IF '$DATA(^YTT(601,YSTEST,"S",J,"K",YSKK,0))
SET R=R_YSTL_"^"
SET J=J+1
GOTO T0
+2 SET Y=^YTT(601,YSTEST,"S",J,"K",YSKK,0)
SET P=1
T2 ;
+1 SET YSIT=$PIECE(Y,U,P)
IF YSIT=""
SET YSKK=YSKK+1
GOTO T1
+2 SET A=$PIECE(Y,U,P+1)
SET P=P+2
T3 ;
+1 IF YSIT>L
SET L=L+200
SET M=M+200
DO RD
GOTO T3
+2 IF 'YSMX
if $EXTRACT(X,YSIT-M)=A
SET YSTL=YSTL+1
GOTO T2
+3 SET B=$EXTRACT(X,YSIT-M)
SET YSTL=YSTL+$SELECT(A="D":B,B="X":0,1:YSMX-B)
GOTO T2
RW ;
+1 SET R=""
SET YSTTL=0
SET J=1
SET YSIT=1
SET L=200
DO RD
W0 ;
+1 IF '$DATA(^YTT(601,YSTEST,"S",J,"K",1,0))
if J>2
SET R=R_YSTTL
GOTO STND
+2 SET Y=^YTT(601,YSTEST,"S",J,"K",1,0)
SET YSTL=0
SET L=$LENGTH(Y)
+3 FOR I=1:1:L
if $EXTRACT(X,YSIT)=$EXTRACT(Y,I)
SET YSTL=YSTL+1
SET YSIT=YSIT+1
+4 SET R=R_YSTL_"^"
SET YSTTL=YSTTL+YSTL
SET J=J+1
GOTO W0
RD ;
+1 SET X=^YTD(601.2,YSDFN,1,YSET,1,YSED,L\200)
QUIT
STND ;
+1 IF YSTY'["S"
IF YSTY'["L"
GOTO REPT
+2 SET S=""
SET J=1
SET P="M"
IF $DATA(^YTT(601,YSTEST,"S",J,"F"))
IF YSSX="F"
SET P="F"
+3 if YSTY["L"
GOTO LK
ST ;
+1 SET A=$PIECE(R,U,J)
if A=""
GOTO REPT
+2 SET X=^YTT(601,YSTEST,"S",J,P)
SET S=S_$JUSTIFY((A-$PIECE(X,U)/$PIECE(X,U,2)*10+50),0,0)_"^"
SET J=J+1
GOTO ST
LK SET A=$PIECE(R,U,J)
if A=""
GOTO REPT
SET L1=$PIECE(^YTT(601,YSTEST,"S",J,P),U)
IF A<L1
SET S=S_"0^"
SET J=J+1
GOTO LK
+1 SET S=S_$PIECE(^(P),U,A+2-L1)_"^"
SET J=J+1
GOTO LK
REPT ;
+1 IF YSTY'["*"
GOTO DONE
+2 SET X=$PIECE(^YTT(601,YSTEST,"P"),U)
SET A=$PIECE(^("P"),U,2)
SET B=$PIECE(^("P"),U,3)
SET L1=58-A\2
SET L2=L1+A+4
if A<9
SET A=9
+3 DO DTA
WRITE !!?(72-$LENGTH(X)\2),X,!!!?(A-9\2+L1),"S C A L E",?(L2+1),"RAW ",B,!
+4 FOR J=1:1
SET YSRS=$PIECE(R,U,J)
if YSRS=""
QUIT
if IOST?1"C-".E&($Y>21)
DO SCR
if YSTOUT!YSUOUT
QUIT
WRITE !?L1,$PIECE(^YTT(601,YSTEST,"S",J,0),U,2),?L2,$JUSTIFY(YSRS,4,0)
if $DATA(S)
WRITE ?(L2+6),$JUSTIFY($PIECE(S,U,J),4,0)
+5 QUIT
IR ;
+1 SET P0=$SELECT(IOST?1"P".E:1,1:0)
SET K=0
SET YSLFT=0
FOR I=1:1
if '$DATA(^YTD(601.2,YSDFN,1,YSET,1,YSED,I))
QUIT
SET K=K+$LENGTH(^(I))
+2 SET K=K\10+$Y
DO DTA
SET X=$PIECE(^YTT(601,YSTEST,"P"),U)
WRITE !!?(72-$LENGTH(X)/2),X
+3 ;I $D(^YTD(601.2,YSDFN,1,YSTEST,1,YSHD,99)),^(99)="MMPIR" S L=800
WRITE !!!?25,"--- ITEM RESPONSES ---",!!
SET L=200
SET M=0
SET YSIT=1
R2 ;
+1 DO RD
SET A=$LENGTH(X)
SET B=A\10
IF B
SET K=10
FOR I=1:1:B
DO RLN
if YSLFT
QUIT
+2 if YSLFT
GOTO DONE
+3 SET K=-10*B+A
IF K
DO RLN
GOTO DONE
+4 if A<200
GOTO DONE
SET L=L+200
SET M=M+200
IF $DATA(^YTD(601.2,YSDFN,1,YSET,1,YSED,L\200))
GOTO R2
DONE ;
+1 KILL YSTY,X,Y,A,B,K,YSKK,L,L1,L2,M,J,YSIT,YSRS,I,P,YSMX,YSTL,YSTTL
QUIT
RLN ;
+1 WRITE ?1
FOR YSKK=1:1:K
WRITE $JUSTIFY(YSIT,3,0)," ",$EXTRACT(X,YSIT-M)," "
SET YSIT=YSIT+1
+2 if 'P0&($Y>21)
if I<B
DO SCR
WRITE !
QUIT
SCR ;
+1 ; Added 5/6/94 LJA
+2 NEW A,B,B1,C,D,E,E1,F,F1,G,G1,H,I,J,J1,J2,J3,J4,K,L,L1,L2,M,N
+3 NEW N1,N2,N3,N4,P,P0,P1,P3,R,R1,S,S1,T,T1,T2,TT,V,V1,V2,V3
+4 NEW V4,V5,V6,W,X,X0,X1,X2,X3,X4,X7,X8,X9,Y,Y1,Y2,Z,Z1,Z3
+5 ;
+6 FOR I0=1:1:(IOSL-$Y-2)
WRITE !
+7 NEW DTOUT,DUOUT,DIRUT,X
+8 SET DIR(0)="E"
DO ^DIR
KILL DIR
SET YSTOUT=$DATA(DTOUT)
SET YSUOUT=$DATA(DUOUT)
SET YSLFT=$DATA(DIRUT)
+9 WRITE @IOF
QUIT
DTA ;
+1 SET X0=^YTD(601.2,YSDFN,1,YSET,1,YSED,0)
SET YSDTA=$PIECE(X0,U,5)
if YSDTA'=""
SET YSDTA=$$FMTE^XLFDT(YSDTA,"5ZD")
+2 SET YSHDR=$EXTRACT(YSHDR,1,43)_" "_$SELECT($GET(YSSIG)'="":YSSIG,1:YSSEX)_" AGE "_$JUSTIFY(YSAGE,2,0)_" "_YSDT(0)_" "_$$FMTE^XLFDT(YSHD,"5ZD")
WRITE @IOF,YSHDR," ",YSDTA
+3 WRITE !
SET X7=$PIECE(X0,U)
SET X8=$PIECE(X0,U,8)
IF X8
IF X8<X7
WRITE "Begun: ",$$FMTE^XLFDT(X8,"5ZD")," Finished ",$$FMTE^XLFDT(X7,"5ZD")
+4 WRITE ?53,"PRINTED ENTERED "
if YSDTA'=""
WRITE "ADMIN"
QUIT
+5 ;
ICL ;Report Logic for ICL Report. This code was too long to remain in file.
+1 SET D=$PIECE(R,U,2)-$PIECE(R,U,6)
SET A=$PIECE(R,U,8)-$PIECE(R,U,4)
SET L=A-D*.7+$PIECE(R,U,7)-$PIECE(R,U,3)
SET D=D=A*.7+$PIECE(R,U)-$PIECE(R,U,5)
SET R=$PIECE(R,U,1,8)_U_$JUSTIFY(D+2.85/7.88*10+50,0,0)_U_$JUSTIFY(L-1.60/8.88*10+50,0,0)
SET L="16^"
SET S=L_L_L_L_L_L_L_L_"102^91"
+2 QUIT