YSTUSE ;ASF/ALB- PSYCHOLOGICAL TEST USEAGE REPORTING ; 9/1/04 11:02am
;;5.01;MENTAL HEALTH;**87**;Dec 30, 1994
;called as a server option from YS TEST USAGE
1 N YSB,YSY,DFN,YSTST,YSCOMP,N,N1,A
K ^TMP($J,"YSTAT")
S ^TMP($J,"YSTAT",1)=$$SITE^VASITE
S XMA=1 X XMREC
I XMRG="" S ^TMP($J,"YSTAT",12)="Dates can not be resolved" D SENDER Q ;-->out
S YSB=$P(XMRG,U),YSY=$P(XMRG,U,2)
S ^TMP($J,"YSTAT",2)="From: "_YSB_" To: "_YSY
S ^TMP($J,"YSTAT",3)=" "
TT ;test ck
S N=20,DFN=0
F S DFN=$O(^YTD(601.2,DFN)) Q:DFN'>0 D TST
S YSTST=0 F S YSTST=$O(A(YSTST)) Q:YSTST'>0 D
. S N=N+1
. S ^TMP($J,"YSTAT",N)=$P($G(^YTT(601,YSTST,0)),U)_U_YSTST_U_A(YSTST)
SENDER S XMSUB="MH testing Statistics: "_XQSUB,XMY(XMFROM)="",XMTEXT="^TMP($J,""YSTAT"","
S XMDUZ="MH automated testing REPLY"
N XMFROM,XMZ,XMREC,XMCHAN D ^XMD
Q
TST ;test check
S YSTST=0 F S YSTST=$O(^YTD(601.2,DFN,1,YSTST)) Q:YSTST'>0 D COMP
Q
COMP ;date range
S YSCOMP=YSB-.01 F S YSCOMP=$O(^YTD(601.2,DFN,1,YSTST,1,YSCOMP)) Q:YSCOMP'>0!(YSCOMP>YSY) S A(YSTST)=$G(A(YSTST))+1
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYSTUSE 1075 printed Dec 13, 2024@02:15 Page 2
YSTUSE ;ASF/ALB- PSYCHOLOGICAL TEST USEAGE REPORTING ; 9/1/04 11:02am
+1 ;;5.01;MENTAL HEALTH;**87**;Dec 30, 1994
+2 ;called as a server option from YS TEST USAGE
1 NEW YSB,YSY,DFN,YSTST,YSCOMP,N,N1,A
+1 KILL ^TMP($JOB,"YSTAT")
+2 SET ^TMP($JOB,"YSTAT",1)=$$SITE^VASITE
+3 SET XMA=1
XECUTE XMREC
+4 ;-->out
IF XMRG=""
SET ^TMP($JOB,"YSTAT",12)="Dates can not be resolved"
DO SENDER
QUIT
+5 SET YSB=$PIECE(XMRG,U)
SET YSY=$PIECE(XMRG,U,2)
+6 SET ^TMP($JOB,"YSTAT",2)="From: "_YSB_" To: "_YSY
+7 SET ^TMP($JOB,"YSTAT",3)=" "
TT ;test ck
+1 SET N=20
SET DFN=0
+2 FOR
SET DFN=$ORDER(^YTD(601.2,DFN))
if DFN'>0
QUIT
DO TST
+3 SET YSTST=0
FOR
SET YSTST=$ORDER(A(YSTST))
if YSTST'>0
QUIT
Begin DoDot:1
+4 SET N=N+1
+5 SET ^TMP($JOB,"YSTAT",N)=$PIECE($GET(^YTT(601,YSTST,0)),U)_U_YSTST_U_A(YSTST)
End DoDot:1
SENDER SET XMSUB="MH testing Statistics: "_XQSUB
SET XMY(XMFROM)=""
SET XMTEXT="^TMP($J,""YSTAT"","
+1 SET XMDUZ="MH automated testing REPLY"
+2 NEW XMFROM,XMZ,XMREC,XMCHAN
DO ^XMD
+3 QUIT
TST ;test check
+1 SET YSTST=0
FOR
SET YSTST=$ORDER(^YTD(601.2,DFN,1,YSTST))
if YSTST'>0
QUIT
DO COMP
+2 QUIT
COMP ;date range
+1 SET YSCOMP=YSB-.01
FOR
SET YSCOMP=$ORDER(^YTD(601.2,DFN,1,YSTST,1,YSCOMP))
if YSCOMP'>0!(YSCOMP>YSY)
QUIT
SET A(YSTST)=$GET(A(YSTST))+1