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

YSASPRT.m

Go to the documentation of this file.
YSASPRT ;ALB/ASF,HIOFO/FT - ASI PRINTER ;1/31/13  10:33am
 ;;5.01;MENTAL HEALTH;**24,30,38,76,121**;Dec 30, 1994;Build 61
 ;Reference to VADPT APIs supported by DBIA #10061
 ;Reference to %ZTLOAD supported by IA #10063
 ;Reference to ^%ZIS supported by IA #10086
 ;Reference to ^%ZISC supported by IA #10089
 ;Reference to ^XLFDT APIs supported by DBIA #10103
EN1(YSASDA) ;Entry point to display ASI
 Q:$G(YSASDA)'>0
 N YSASN,YSASNA,YSZZ,YSHDR,YSASD,YSAST,YSAS0,DIERR,YSI,YSASC
 ;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
QTEP ;Queued Task Entry Point
 U IO
 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)_"  "_"xxx-xx-"_$E($P(VADM(2),U,2),8,11)_$J("",(20-$L(VADM(1))))_" ASI "_YSAST_"  on "_YSASD_" by: "_YSASC
 W @IOF,YSHDR,! W:'YSASIG ?25,"##### Unsigned Draft #####",!
 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 ^%ZISC
 Q
PRT ; Print output
 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