YSASU1 ;ASF/ALB,HIOFO/FT - ASI MANAGEMENT UTILITITIES CONT ;1/30/13 4:09pm
;;5.01;MENTAL HEALTH;**38,121**;Dec 30, 1994;Build 61
;Reference to XUP API supported by DBIA #4409
;Reference to VADPT APIs supported by DBIA #10061
;Reference to XMD API supported by DBIA #10070
PTLST ;patient list
S YSASN=YSASN+1,^TMP("YSASU",$J,"M",YSASN)=" "
S YSASN=YSASN+1,^TMP("YSASU",$J,"M",YSASN)="Name"_$E(YSASS,1,17)_"SSN Interview Class Special Transmitted Queued"
S YSFL="" F S YSFL=$O(^TMP("YSASU",$J,"A",YSFL)) Q:YSFL="" D
. S YSASN=YSASN+1,^TMP("YSASU",$J,"M",YSASN)=$E(YSFL_YSASS,1,20)
. S YSIFN=0,J=0 F S YSIFN=$O(^TMP("YSASU",$J,"A",YSFL,YSIFN)) Q:YSIFN'>0 S J=J+1 D
.. S G=^TMP("YSASU",$J,YSIFN)
.. I J=1 S DFN=$P(G,U,2),VA("BID")=" " D:DFN DEM^VADPT S ^TMP("YSASU",$J,"M",YSASN)=^TMP("YSASU",$J,"M",YSASN)_" "_$E(VA("BID")_" ",1,6)
.. I J>1 S YSASN=YSASN+1,^TMP("YSASU",$J,"M",YSASN)=$E(YSASS,1,27)
.. S Y=+G,^TMP("YSASU",$J,"M",YSASN)=^TMP("YSASU",$J,"M",YSASN)_$E(Y,4,5)_"/"_$E(Y,6,7)_$S(Y>2999999:"/20",1:"/19")_$E(Y,2,3)
.. S ^TMP("YSASU",$J,"M",YSASN)=^TMP("YSASU",$J,"M",YSASN)_" "_$S($P(G,U,3)=1:"Full",$P(G,U,3)=2:"Lite",$P(G,U,3)=3:"F-up",1:" ")
.. S ^TMP("YSASU",$J,"M",YSASN)=^TMP("YSASU",$J,"M",YSASN)_" "_$S($P(G,U,4)="":" ",1:$P(G,U,4))
.. S ^TMP("YSASU",$J,"M",YSASN)=^TMP("YSASU",$J,"M",YSASN)_" "_$S($P(G,U,6)=1:" signed",1:"unsigned")
.. S Y=$P(G,U,9),^TMP("YSASU",$J,"M",YSASN)=^TMP("YSASU",$J,"M",YSASN)_" "_$S(Y>1:$E(Y,4,5)_"/"_$E(Y,6,7)_$S(Y>2999999:"/20",1:"/19")_$E(Y,2,3),1:" ")
.. S ^TMP("YSASU",$J,"M",YSASN)=^TMP("YSASU",$J,"M",YSASN)_" "_$S($P(G,U,8)=1:"queued",1:"")
Q
MAIL2 ; SEND MAILMAN
S YSASMCNT=0,YSASMTC=(YSASN\1000)+1
S YSASCNT=0,YSASCNT2=0 F S YSASCNT=$O(^TMP("YSASU",$J,"M",YSASCNT)) Q:(YSASCNT'>0) D
.S YSASCNT2=YSASCNT2+1,^TMP("YSASM",$J,YSASCNT)=^TMP("YSASU",$J,"M",YSASCNT)
.I (YSASCNT2=1000)!(YSASCNT=YSASN) D
..S YSASMCNT=YSASMCNT+1
..S DTIME=600
.. S XMSUB="ASI Stats "_YSASITE_" ("_YSASMCNT_" OF "_YSASMTC_")"
..S XMTEXT="^TMP(""YSASM"",$J,"
..S XMY("G.ASI PERFORMANCE MEASURES")=""
..S XMY(DUZ)=""
..S XMDUZ="AUTOMATED MESSAGE"
..D ^XMD
..S YSASCNT2=0
..K ^TMP("YSASM",$J)
..S DTIME=$$DTIME^XUP(DUZ)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYSASU1 2265 printed Nov 22, 2024@17:23:27 Page 2
YSASU1 ;ASF/ALB,HIOFO/FT - ASI MANAGEMENT UTILITITIES CONT ;1/30/13 4:09pm
+1 ;;5.01;MENTAL HEALTH;**38,121**;Dec 30, 1994;Build 61
+2 ;Reference to XUP API supported by DBIA #4409
+3 ;Reference to VADPT APIs supported by DBIA #10061
+4 ;Reference to XMD API supported by DBIA #10070
PTLST ;patient list
+1 SET YSASN=YSASN+1
SET ^TMP("YSASU",$JOB,"M",YSASN)=" "
+2 SET YSASN=YSASN+1
SET ^TMP("YSASU",$JOB,"M",YSASN)="Name"_$EXTRACT(YSASS,1,17)_"SSN Interview Class Special Transmitted Queued"
+3 SET YSFL=""
FOR
SET YSFL=$ORDER(^TMP("YSASU",$JOB,"A",YSFL))
if YSFL=""
QUIT
Begin DoDot:1
+4 SET YSASN=YSASN+1
SET ^TMP("YSASU",$JOB,"M",YSASN)=$EXTRACT(YSFL_YSASS,1,20)
+5 SET YSIFN=0
SET J=0
FOR
SET YSIFN=$ORDER(^TMP("YSASU",$JOB,"A",YSFL,YSIFN))
if YSIFN'>0
QUIT
SET J=J+1
Begin DoDot:2
+6 SET G=^TMP("YSASU",$JOB,YSIFN)
+7 IF J=1
SET DFN=$PIECE(G,U,2)
SET VA("BID")=" "
if DFN
DO DEM^VADPT
SET ^TMP("YSASU",$JOB,"M",YSASN)=^TMP("YSASU",$JOB,"M",YSASN)_" "_$EXTRACT(VA("BID")_" ",1,6)
+8 IF J>1
SET YSASN=YSASN+1
SET ^TMP("YSASU",$JOB,"M",YSASN)=$EXTRACT(YSASS,1,27)
+9 SET Y=+G
SET ^TMP("YSASU",$JOB,"M",YSASN)=^TMP("YSASU",$JOB,"M",YSASN)_$EXTRACT(Y,4,5)_"/"_$EXTRACT(Y,6,7)_$SELECT(Y>2999999:"/20",1:"/19")_$EXTRACT(Y,2,3)
+10 SET ^TMP("YSASU",$JOB,"M",YSASN)=^TMP("YSASU",$JOB,"M",YSASN)_" "_$SELECT($PIECE(G,U,3)=1:"Full",$PIECE(G,U,3)=2:"Lite",$PIECE(G,U,3)=3:"F-up",1:" ")
+11 SET ^TMP("YSASU",$JOB,"M",YSASN)=^TMP("YSASU",$JOB,"M",YSASN)_" "_$SELECT($PIECE(G,U,4)="":" ",1:$PIECE(G,U,4))
+12 SET ^TMP("YSASU",$JOB,"M",YSASN)=^TMP("YSASU",$JOB,"M",YSASN)_" "_$SELECT($PIECE(G,U,6)=1:" signed",1:"unsigned")
+13 SET Y=$PIECE(G,U,9)
SET ^TMP("YSASU",$JOB,"M",YSASN)=^TMP("YSASU",$JOB,"M",YSASN)_" "_$SELECT(Y>1:$EXTRACT(Y,4,5)_"/"_$EXTRACT(Y,6,7)_$SELECT(Y>2999999:"/20",1:"/19")_$EXTRACT(Y,2,3),1:" ")
+14 SET ^TMP("YSASU",$JOB,"M",YSASN)=^TMP("YSASU",$JOB,"M",YSASN)_" "_$SELECT($PIECE(G,U,8)=1:"queued",1:"")
End DoDot:2
End DoDot:1
+15 QUIT
MAIL2 ; SEND MAILMAN
+1 SET YSASMCNT=0
SET YSASMTC=(YSASN\1000)+1
+2 SET YSASCNT=0
SET YSASCNT2=0
FOR
SET YSASCNT=$ORDER(^TMP("YSASU",$JOB,"M",YSASCNT))
if (YSASCNT'>0)
QUIT
Begin DoDot:1
+3 SET YSASCNT2=YSASCNT2+1
SET ^TMP("YSASM",$JOB,YSASCNT)=^TMP("YSASU",$JOB,"M",YSASCNT)
+4 IF (YSASCNT2=1000)!(YSASCNT=YSASN)
Begin DoDot:2
+5 SET YSASMCNT=YSASMCNT+1
+6 SET DTIME=600
+7 SET XMSUB="ASI Stats "_YSASITE_" ("_YSASMCNT_" OF "_YSASMTC_")"
+8 SET XMTEXT="^TMP(""YSASM"",$J,"
+9 SET XMY("G.ASI PERFORMANCE MEASURES")=""
+10 SET XMY(DUZ)=""
+11 SET XMDUZ="AUTOMATED MESSAGE"
+12 DO ^XMD
+13 SET YSASCNT2=0
+14 KILL ^TMP("YSASM",$JOB)
+15 SET DTIME=$$DTIME^XUP(DUZ)
End DoDot:2
End DoDot:1
+16 QUIT