source: WorldVistAEHR/trunk/r/AUTO_REPLENISHMENT_WARD_STOCK-PSGW/PSGWPSI.m@ 1661

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

initial load of WorldVistAEHR

File size: 2.2 KB
Line 
1PSGWPSI ;BHAM ISC/CML-Print Data for AR/WS Stock Items ; 19 Mar 93 / 8:34 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 AR/WS Stock Items.",!!,"Right margin for this report is 132 columns.",!,"You may queue the report to print at a later time.",!!
5 I '$O(^PSI(58.1,0)) W !,"You MUST create AOUs before running this report!" K %,%I,%H,PSGWDT Q
6DEV K %ZIS,IOP S %ZIS="QM",%ZIS("B")="" D ^%ZIS I POP W !,"NO DEVICE SELECTED OR REPORT PRINTED!" G QUIT^PSGWPSI1
7 I $D(IO("Q")) K IO("Q") S PSGWIO=ION,ZTIO="" K ZTSAVE,ZTDTH,ZTSK S ZTRTN="ENQ^PSGWPSI",ZTDESC="Compile Data for AR/WS Stock Items",ZTSAVE("PSGWIO")="",ZTSAVE("PSGWDT")=""
8 I D ^%ZTLOAD,HOME^%ZIS K ZTSK G QUIT^PSGWPSI1
9 U IO
10 ;
11ENQ ;ENTRY POINT WHEN QUEUED
12AOU K ^TMP("PSGWPSI",$J) F AOU=0:0 S AOU=$O(^PSI(58.1,AOU)) G:('AOU)&($D(ZTQUEUED)) PRTQUE G:'AOU PRINT^PSGWPSI1 D XREF
13 ;
14XREF F DRGDA=0:0 S DRGDA=$O(^PSI(58.1,AOU,1,"B",DRGDA)) Q:'DRGDA F ITMDA=0:0 S ITMDA=$O(^PSI(58.1,AOU,1,"B",DRGDA,ITMDA)) Q:'ITMDA D BUILD
15 Q
16BUILD ;BUILD DATA ELEMENTS
17 Q:'$D(^PSI(58.1,AOU,1,ITMDA,0)) S NODE=^(0) I +$P(NODE,"^",3),+$P(NODE,"^",3)'>DT Q
18 I '$O(^PSDRUG(DRGDA,0)) S DIK="^PSI(58.1,"_AOU_",1,",DA=ITMDA,DA(1)=AOU D ^DIK K DIK Q
19 I $O(^PSDRUG(DRGDA,0)) S ITMNM=$S($P(^PSDRUG(DRGDA,0),"^")]"":$P(^(0),"^"),1:"ZZ/DRUG #"_DRGDA_" is missing NAME in the DRUG File.")
20 I $P(NODE,"^",10)="Y",$P(NODE,"^",3)="" S $P(^PSI(58.1,AOU,1,ITMDA,0),"^",10)=""
21 I $D(^PSI(58.1,AOU,"I")),$P(^("I"),"^"),$P(^("I"),"^")'>PSGWDT S ^TMP("PSGWPSI",$J,ITMNM,AOU)="I^"_$P(^("I"),"^") Q
22 S LOC=$S($P(NODE,"^",8)]"":$P(NODE,"^",8),1:"NONE"),STKLEV=$S($P(NODE,"^",2):$P(NODE,"^",2),1:"NONE")
23 S TYPE="" F LL=0:0 S LL=$O(^PSI(58.1,AOU,1,ITMDA,2,LL)) Q:'LL S TYPE=TYPE_";;"_LL
24 S WARD="" F LL=0:0 S LL=$O(^PSI(58.1,AOU,1,ITMDA,4,LL)) Q:'LL S WARD=WARD_";;"_LL
25SETGL ;
26 S:WARD="" WARD=";;NONE" S:TYPE="" TYPE=";;NONE" S ^TMP("PSGWPSI",$J,ITMNM,AOU)=LOC_"^"_STKLEV_"^"_WARD_"^"_TYPE Q
27 Q
28 ;
29PRTQUE ;AFTER DATA IS COMPILED, QUEUE THE PRINT
30 K ZTSAVE,ZTIO S ZTIO=PSGWIO,ZTRTN="PRINT^PSGWPSI1",ZTDESC="Print Data for AR/WS Stock Items",ZTDTH=$H,ZTSAVE("^TMP(""PSGWPSI"",$J,")=""
31 D ^%ZTLOAD K ^TMP("PSGWPSI",$J) G QUIT^PSGWPSI1
Note: See TracBrowser for help on using the repository browser.