source: WorldVistAEHR/trunk/r/AUTO_REPLENISHMENT_WARD_STOCK-PSGW/PSGWPIG.m@ 1444

Last change on this file since 1444 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.8 KB
Line 
1PSGWPIG ;BHAM ISC/CML-Print AOU Inventory Group List ; 19 Mar 93 / 8:33 AM
2 ;;2.3; Automatic Replenishment/Ward Stock ;;4 JAN 94
3 D NOW^%DTC S PSGWDT=$P(%,".")
4 W !!!,"This report shows data stored for AOU Inventory Groups.",!!,"Right margin for this report is 80 columns.",!,"You may queue the report to print at a later time.",!!
5 I '$O(^PSI(58.2,0)) W !,"You MUST create Inventory Groups before running this report!" K %,%I,%H Q
6DEV K %ZIS,IOP S %ZIS="QM",%ZIS("B")="" D ^%ZIS I POP W !,"NO DEVICE SELECTED OR REPORT PRINTED!" G QUIT
7 I $D(IO("Q")) K IO("Q") S PSGWIO=ION,ZTIO="" K ZTSAVE,ZTDTH,ZTSK S ZTRTN="ENQ^PSGWPIG",ZTDESC="Compile Data for AOU Inventory Groups",ZTSAVE("PSGWIO")="",ZTSAVE("PSGWDT")=""
8 I D ^%ZTLOAD,HOME^%ZIS K ZTSK G QUIT
9 U IO
10 ;
11ENQ ;ENTRY POINT WHEN QUEUED
12INVG K ^TMP("PSGWPIG",$J) F INVG=0:0 S INVG=$O(^PSI(58.2,INVG)) G:('INVG)&($D(ZTQUEUED)) PRTQUE G:'INVG PRINT D BUILD
13 ;
14BUILD ;BUILD DATA ELEMENTS
15 I $S('$D(^PSI(58.2,INVG,0)):1,^(0)="":1,'$O(^(0)):1,1:0) S DIK="^PSI(58.2,",DA=INVG D ^DIK K DIK Q
16 F AOU=0:0 S AOU=$O(^PSI(58.2,INVG,1,AOU)) Q:'AOU I $D(^(AOU,0)) F TYPE=0:0 S TYPE=$O(^PSI(58.2,INVG,1,AOU,1,TYPE)) Q:'TYPE I $D(^(TYPE,0)) D SETGL
17 Q
18SETGL ;
19 S ANM=$S($D(^PSI(58.1,AOU,0)):$P(^(0),"^"),1:"AOU NAME MISSING"),TYPENM=$S($D(^PSI(58.16,TYPE,0)):$P(^(0),"^"),1:"TYPE NAME MISSING"),GNM=^PSI(58.2,INVG,0),INACT=""
20 I $D(^PSI(58.1,AOU,"I")),^("I")]"",^("I")'>DT S INACT="I"
21 S ^TMP("PSGWPIG",$J,GNM,ANM_"^"_INACT,TYPENM)=""
22 Q
23 ;
24PRTQUE ;AFTER DATA IS COMPILED, QUEUE THE PRINT
25 K ZTSAVE,ZTIO S ZTIO=PSGWIO,ZTRTN="PRINT^PSGWPIG",ZTDESC="Print Data for Inventory Group List",ZTDTH=$H,ZTSAVE("^TMP(""PSGWPIG"",$J,")=""
26 D ^%ZTLOAD K ^TMP("PSGWPIG",$J) G QUIT
27PRINT ;
28 S $P(LN,"-",80)="",PG=0,%DT="",(GNM,ANM,TYPENM,QFLG)="",X="T" D ^%DT X ^DD("DD") S HDT=Y D HDR
29 I '$D(^TMP("PSGWPIG",$J)) W !?17,"***** NO DATA AVAILABLE FOR THIS REPORT *****" G QUIT
30 F LL=0:0 S GNM=$O(^TMP("PSGWPIG",$J,GNM)) Q:GNM=""!(QFLG) D:$Y+4>IOSL PRTCHK Q:QFLG W !!,"=> ",GNM F LL=0:0 S ANM=$O(^TMP("PSGWPIG",$J,GNM,ANM)) Q:ANM=""!(QFLG) D:$Y+4>IOSL PRTCHK Q:QFLG W !?13,$P(ANM,"^") D WRTDATA Q:QFLG
31DONE I $E(IOST)'="C" W @IOF
32 I $E(IOST)="C" D:'QFLG SS^PSGWUTL1
33QUIT ;
34 K %DT,AOU,ANM,HDT,INACT,INVG,GNM,LL,LN,PG,PSGWDT,TYPE,TYPENM,X,Y,PSGWIO,ZTSK,ZTIO,DA,IO("Q"),%,%I,%H,ANS,QFLG
35 K ^TMP("PSGWPIG",$J) D ^%ZISC
36 S:$D(ZTQUEUED) ZTREQ="@" Q
37WRTDATA ;DATA LINES
38 I $P(ANM,"^",2)="I" W " *** INACTIVE ***"
39 F LL=0:0 S TYPENM=$O(^TMP("PSGWPIG",$J,GNM,ANM,TYPENM)) Q:TYPENM=""!(QFLG) D:$Y+4>IOSL PRTCHK Q:QFLG W !?18,TYPENM
40 Q
41HDR ;HEADER
42 W:$Y @IOF S PG=PG+1 W !?28,"AOU INVENTORY GROUP LIST",?71,"PAGE: ",PG,!?31,"PRINTED: ",HDT,!!,"=> INVENTORY GROUP",!?13,"AREA OF USE",!?18,"TYPE",!,LN
43 Q
44PRTCHK ;
45 I $E(IOST)="C" W !!,"Press <RETURN> to Continue or ""^"" to Exit: " R ANS:DTIME S:'$T ANS="^" D:ANS?1."?" HELP^PSGWUTL1 I ANS="^" S QFLG=1 Q
46 D HDR Q
Note: See TracBrowser for help on using the repository browser.