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

ASUUZIS.m

Go to the documentation of this file.
  1. ASUUZIS ; IHS/ITSC/LMH -INTERFACE WITH %ZIS ;
  1. ;;4.2T2;Supply Accounting Mgmt. System;;JUN 30, 2000
  1. ;This is a utility routine which provides a front end to ^%ZIS.
  1. ;It uses a local variable array to save information about the
  1. ;files opened by involking ^%ZIS. Entry points are provided for
  1. ;Opening (O), Closing (C), Selecting (S) and Using (U) devices as well
  1. ;as for Killing the array (K) and Double Queueing (Q).
  1. D S0 Q:$G(POP)
  1. S ASUK("PTRSEL")=""
  1. Q
  1. S ;EP; SELECT AND CHECK FOR BOTH QUEUED
  1. D S0 Q:$G(POP)
  1. I ASUK("PTR")="IRPT",ASUK("SRPT","Q")=1,'$D(IO("Q")) W !,"Standard Reports are Queued, Invoice reports must also be Queued" G S
  1. S ASUK("PTRSEL")=1
  1. Q
  1. S0 ;
  1. S:'$D(ASUK("PTR")) ASUK("PTR")="PRINTER"
  1. I $D(%ZIS("A")) S %ZIS("B")=$S(%ZIS("A")["Stand":$G(ASUP("STD")),%ZIS("A")["Invo":$G(ASUP("IVD")),1:"") S ASUK(ASUK("PTR"),"IOP")=%ZIS("B")
  1. S %ZIS=$G(%ZIS) ;S:%ZIS'["Q" %ZIS=%ZIS_"Q"
  1. S ASUK(ASUK("PTR"),"ZIS")=%ZIS
  1. I $G(ASUK(ASUK("PTR"),"IOP"))="HFS" D
  1. .I $G(ASUG("MEDIUM"))']"" D
  1. ..N DIR
  1. ..W !!,"HFS file "_$S($G(ASUK(ASUK("PTR"),"IOPAR"))']"":"NOT DEFINED",1:$P($P(ASUK(ASUK("PTR"),"IOPAR"),"(",2),":"))_" is the default for the prompt",!,$G(%ZIS("A"))
  1. ..S DIR(0)="Y",DIR("B")="Y"
  1. ..S DIR("A")="Is that OK" D ^DIR
  1. .E S Y=1
  1. .I Y D ASUUZIS1
  1. .E K %ZIS("B") D ^%ZIS
  1. E D
  1. .D ^%ZIS
  1. I $G(POP) S ASURX="W !,""Unable to Select Device""" D ^ASUUPLOG Q
  1. D V
  1. I ASUK(ASUK("PTR"),"ZIS")'["O" D ^%ZISC
  1. K ASUK(ASUK("PTR"),"ZIS")
  1. Q
  1. U ;EP; USE PRINTER DEVICE
  1. I $D(ASUK("PTR")) D
  1. .S IO(0)=$G(ASUK(ASUK("PTR"),0))
  1. .S IO("S")=$G(ASUK(ASUK("PTR"),"S"))
  1. .S IO=$G(ASUK(ASUK("PTR"),"IO"))
  1. .S IOM=$G(ASUK(ASUK("PTR"),"IOM"))
  1. .S IOF=$G(ASUK(ASUK("PTR"),"IOF"))
  1. .S ION=$G(ASUK(ASUK("PTR"),"ION"))
  1. .S IOST=$G(ASUK(ASUK("PTR"),"IOST"))
  1. .S IOSL=$G(ASUK(ASUK("PTR"),"IOSL"))
  1. .S IOPAR=$G(ASUK(ASUK("PTR"),"IOPAR"))
  1. I IO']"" D HOME^%ZIS
  1. U IO
  1. Q
  1. O ;EP; OPEN DEVICE ENTRY POINT.
  1. U IO(0) S %ZIS("A")="Select Printer : ",%ZIS="OQM" ; JDH added M to ask for right margin
  1. S:'$D(ASUK("PTR")) ASUK("PTR")="PRINTER"
  1. I $D(ASUK(ASUK("PTR"),"IOP")) D
  1. .S IOP=ASUK(ASUK("PTR"),"IOP")
  1. .S:IOP["HFS" IOP=ASUK(ASUK("PTR"),"IO")
  1. I $D(ASUK(ASUK("PTR"),"IOPAR")) D
  1. .S %ZIS("IOPAR")=ASUK(ASUK("PTR"),"IOPAR")
  1. .S IOPAR=%ZIS("IOPAR")
  1. D ^%ZIS
  1. I $G(POP) S ASURX="W !,""Unable to Select and Open Printer"",!" D ^ASUUPLOG Q
  1. D V
  1. S ASUK(ASUK("PTR"),"O")=1
  1. I ASUK(ASUK("PTR"),"Q") D T Q
  1. Q
  1. C ;EP; CLOSE DEVICE ENTRY POINT.
  1. I ASUK(ASUK("PTR"),0)=ASUK(ASUK("PTR"),"IO"),ASUK(ASUK("PTR"),"S")']"" W @IOF D K U IO(0) Q
  1. I $D(ASUK("PTR-Q")),ASUK("PTR-Q") S IO=ASUK(ASUK("PTR"),"IO") D ^%ZISC D K U IO(0) Q
  1. D U W @(ASUK(ASUK("PTR"),"IOF")) D ^%ZISC U IO(0) D K
  1. Q
  1. K ;
  1. K ASUK("PTR-Q")
  1. K2 ;
  1. K ASUK(ASUK("PTR")),ASUK("PTRSEL")
  1. K ASUK("PTR")
  1. Q
  1. Q ;EP; DOUBLE QUEUE
  1. S XBFQ=1,XBION=ASUK(ASUK("PTR"),"ION"),IOP=ASUK(ASUK("PTR"),"IOP")
  1. S XBNS="ASU" D ^XBDBQUE
  1. Q
  1. V ;
  1. S:'$D(ASUK("PTR")) ASUK("PTR")="PRINTER"
  1. S ASUK(ASUK("PTR"),0)=IO(0)
  1. S ASUK(ASUK("PTR"),"S")=$G(IO("S"))
  1. S ASUK(ASUK("PTR"),"IO")=IO
  1. S ASUK(ASUK("PTR"),"IOM")=IOM
  1. S ASUK(ASUK("PTR"),"IOF")=IOF
  1. S ASUK(ASUK("PTR"),"ION")=ION
  1. S ASUK(ASUK("PTR"),"IOST")=IOST
  1. S ASUK(ASUK("PTR"),"IOSL")=IOSL
  1. S ASUK(ASUK("PTR"),"IOPAR")=IOPAR
  1. S ASUK(ASUK("PTR"),"IOP")=ION_";"_IOST_";"_$S($D(IOM):IOM,ASUK("PTR")="IRPT":80,1:132)_";"_$S($D(IOSL):IOSL,1:66)
  1. S ASUK(ASUK("PTR"),"Q")=$S($D(IO("Q")):1,1:0)
  1. S ASUK("PTR-Q")=$S($D(IO("Q")):1,1:0)
  1. Q
  1. T ;
  1. S ZTSAVE("ZTDESC")=$G(ZTSAVE("ZTDESC"))
  1. S ZTIO=ASUK(ASUK("PTR"),"IOP")
  1. S ZTSAVE("ASU*")=""
  1. D ^%ZTLOAD
  1. K ASURZX
  1. W !!,$S($D(ZTQUEUED):"Request Queued!",1:"Request Cancelled!")
  1. D ^%ZISC
  1. S DIR(0)="E" D ^DIR K DIR
  1. Q
  1. ASUUZIS1 ;HOST FILE SERVER OPEN
  1. F X=0:0 S X=$O(^%ZIS(1,X)) Q:'X I ^%ZIS(1,X,"TYPE")="HFS" D Q:'$G(POP)
  1. .S (ASUK(ASUK("PTR"),"IOP"),IOP)=$P(^%ZIS(1,X,0),U)
  1. .S ASUK(ASUK("PTR"),"IO")=$P(^%ZIS(1,X,0),U,2)
  1. .S:$G(ASUK(ASUK("PTR"),"IOPAR"))]"" %ZIS("IOPAR")=ASUK(ASUK("PTR"),"IOPAR")
  1. .D ^%ZIS
  1. Q