VistA-WorldVistAEHR/r/MENTAL_HEALTH-YS-RUCL-YI-YT/YSASPRT.m

57 lines
1.7 KiB
Mathematica

YSASPRT ;ALB/ASF-ASI PRINTER ;3/7/03 14:54
;;5.01;MENTAL HEALTH;**24,30,38,76**;Dec 30, 1994
EN1(YSASDA) ;Entry point to display ASI
Q:$G(YSASDA)'>0
N YSASN,YSASNA,YSZZ,YSHDR,YSASD,YSAST,YSAS0,DIERR,YSI,YSASC
;D DICI^YSASO(.YSASDA)
;Q:$G(YSASDA)'>0
;ASK DEVICE
N YSASQUIT,%ZIS,POP
S %ZIS="QM"
D ^%ZIS
Q:$G(POP)
I $D(IO("Q")) D Q
.N ZTRTN,ZTDESC,ZTSAVE
.S ZTRTN="QTEP^YSASPRT"
.S ZTDESC="YSASPRT ASI PRINT"
.S ZTSAVE("YSASDA")=""
.D ^%ZTLOAD
.D HOME^%ZIS
.Q
U IO
QTEP ;Queued Task Entry Point
S:$D(ZTQUEUED) ZTREQ="@"
N N,YSAS0,YSASC,YSASD,YSASIG,YSASN,YSASNA,YSASQUIT,YSAST,YSHDR,YSI,YSI1,YSZZ
S YSZZ=0
K ^TMP($J,"YSASOSR1")
S YSAS0=^YSTX(604,YSASDA,0),DFN=$P(YSAS0,"^",2)
D DEM^VADPT
S YSASD=$$FMTE^XLFDT($P(YSAS0,U,5),"5ZD")
S YSAST=$$GET1^DIQ(604,YSASDA_",",.04)
S YSASC=$$GET1^DIQ(604,YSASDA_",",.09)
S YSASIG=$$GET1^DIQ(604,YSASDA_",",.51,"I")
S YSHDR=VADM(1)_" "_$P(VADM(2),U,2)_$J("",(20-$L(VADM(1))))_" ASI "_YSAST_" on "_YSASD_" by: "_YSASC
W @IOF,YSHDR,! W:'YSASIG ?25,"##### Unsigned Draft #####",!
;F YSI=10:1:17,20 D Q:YSZZ
S Y=YSAST_" ITEM REPORT",YSI1=$O(^YSTX(604.68,"B",Y,-1)) Q:YSI1'>0
F YSI=YSI1,20 D Q:YSZZ
. D CSR^YSASOSR(YSASDA,"^TMP($J,""YSASOSR1"","_YSI_")","^YSTX(604.68,"_YSI_",1)")
. D PRT
;D HOME^%ZIS U IO
D ^%ZISC
Q
PRT ; Print output
;W @IOF,YSHDR,! W:'YSASIG ?25,"##### Unsigned Draft #####",!
S N=0 F S N=$O(^TMP($J,"YSASOSR1",YSI,N)) Q:N'>0!YSZZ D
. W !,^TMP($J,"YSASOSR1",YSI,N)
. I IOT'="HFS" D:$Y+4>IOSL WAIT ;ASF 3/7/03
;
Q
WAIT ;
F I0=1:1:IOSL-$Y-2 W !
N DTOUT,DUOUT,DIRUT
I IOST?1"C".E W $C(7) K DIR S DIR(0)="E" D ^DIR K DIR S YSZZ=$D(DIRUT)
Q:YSZZ
W @IOF,YSHDR,! W:'YSASIG ?25,"##### Unsigned Draft #####",!
Q