source: WorldVistAEHR/trunk/r/CONTROLLED_SUBSTANCES-PSD/PSDPLOG3.m@ 1639

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

initial load of WorldVistAEHR

File size: 3.6 KB
Line 
1PSDPLOG3 ;BIR/JPW,LTL-Inspector's Log (cont'd) ; 31 May 95
2 ;;3.0; CONTROLLED SUBSTANCES ;;13 Feb 97
3PRINT ;print inspector's log by naou, drug and green sheet #
4 S (PG,PSDOUT,NAOU)=0 D NOW^%DTC S Y=+$E(%,1,12) X ^DD("DD") S RPDT=Y
5 K LN S $P(LN,"-",132)="" I '$D(^TMP("PSDLOG",$J)) D HDR W !!,?45,"**** NO PENDING NARCOTIC ORDERS FOR INSPECTION ****",! G DONE
6 S NAOU="" F S NAOU=$O(^TMP("PSDLOG",$J,"B",NAOU)) Q:NAOU=""!(PSDOUT) D HDR Q:PSDOUT W !,?2,"=> NAOU: ",NAOU,! S LNUM=$Y D LOOP2 Q:PSDOUT D PRT
7 D:'PSDOUT PRT
8DONE I $E(IOST)'="C" W @IOF
9 I $E(IOST,1,2)="C-",'PSDOUT W ! K DIR,DIRUT S DIR(0)="EA",DIR("A")="END OF REPORT! Press <RET> to return to the menu" D ^DIR K DIR
10END K %,%DT,%H,%I,%ZIS,ALL,ANS,ASK,ASKN,CNT,COMM,DA,DIC,DIE,DIR,DIROUT,DIRUT,DIWF,DIWL,DIWR,DR,DTOUT,DUOUT,EXP,EXPD,JJ,LN,LNUM,LOOP,LOT,MFG,NAOU,NODE,NODE3,NUM
11 K OK,ORD,ORDN,PG,PSD,PSDA,PSDCNT,PSDDT,PSDG,PSDIO,PSDOK,PSDN,PSDNA,PSDOUT,PSDR,PSDRN,PSDSD,PSDST,PSDT,PSDTR,QTY,REQD,REQDT,RPDT,RQTY
12 K SEL,STAT,STATN,TEXT,TYP,TYPN,X,Y,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE,ZTSK
13 K ^TMP("PSDLOG",$J) D ^%ZISC
14 S:$D(ZTQUEUED) ZTREQ="@"
15 Q
16HDR ;header for log
17 I $E(IOST,1,2)="C-",PG W ! K DA,DIR S DIR(0)="E" D ^DIR K DIR I 'Y S PSDOUT=1 Q
18 S PG=PG+1 W:$Y @IOF W !,?42,"Inspector's Log for Controlled Substances",?120,"Page: ",PG,!,?52,RPDT,!
19 W !,?57,"DATE",?71,"QTY"
20 W !,"DISP #",?13,"DRUG",?55,"DISPENSED",?68,"DISPENSED",?85,"EXP DATE",?100,"QTY ON HAND",?118,"NAME/DATE"
21 W !,LN,!
22 Q
23LOOP2 ;print inv typ loop
24 S NAOU(1)=$O(^TMP("PSDLOG",$J,"B",NAOU,0))
25 S TYPN="" F S TYPN=$O(^TMP("PSDLOG",$J,NAOU(1),"B",TYPN)) Q:TYPN=""!(PSDOUT) W !,?4,"=> INVENTORY TYPE: ",$S($E(TYPN,1,2)="ZZ":$E(TYPN,3,99),1:TYPN),! S LNUM=$Y D
26 .S TYPN(1)=$O(^TMP("PSDLOG",$J,NAOU(1),"B",TYPN,0))
27 .I ASK="N" D Q
28 ..S NUM=0
29 ..F S NUM=$O(^TMP("PSDLOG",$J,NAOU(1),TYPN(1),NUM)) Q:NUM=""!(PSDOUT) D Q:PSDOUT
30 ...I $Y+8>IOSL D PRT,HDR Q:PSDOUT W !,?2,"=> NAOU: ",NAOU,!!?4,"=> INVENTORY TYPE: ",$S($E(TYPN,1,2)="ZZ":$E(TYPN,3,99),1:TYPN),! S LNUM=$Y
31 ...S PSDR=0
32 ...F S PSDR=$O(^TMP("PSDLOG",$J,NAOU(1),TYPN(1),NUM,PSDR)) Q:'PSDR!(PSDOUT) S PSDCNT=0 F S PSDCNT=$O(^TMP("PSDLOG",$J,NAOU(1),TYPN(1),NUM,PSDR,PSDCNT)) Q:'PSDCNT!(PSDOUT) D Q:PSDOUT
33 ....I $Y+8>IOSL D PRT,HDR Q:PSDOUT W !,?2,"=> NAOU: ",NAOU,!!?4,"=> INVENTORY TYPE: ",$S($E(TYPN,1,2)="ZZ":$E(TYPN,3,99),1:TYPN),! S LNUM=$Y
34 ....S NODE=$G(^TMP("PSDLOG",$J,NAOU(1),TYPN(1),NUM,PSDR,PSDCNT))
35 ....W !,$P(NODE,U,4),?2,NUM,?13,$P(NODE,U,5),?55,$P(NODE,U,2),?70,$J($P(NODE,U),6),?85,$P(NODE,U,3),?100,"____________",?118,"____________",! S LNUM=$Y
36 .S PSDRN="" F S PSDRN=$O(^TMP("PSDLOG",$J,NAOU(1),TYPN(1),"B",PSDRN)) Q:PSDRN=""!(PSDOUT) D Q:PSDOUT
37 ..I $Y+8>IOSL D PRT,HDR Q:PSDOUT W !,?2,"=> NAOU: ",NAOU,! W:ASKN !,?4,"=> INVENTORY TYPE: ",$S($E(TYPN,1,2)="ZZ":$E(TYPN,3,99),1:TYPN),! S LNUM=$Y
38 ..S PSDRN(1)=$O(^TMP("PSDLOG",$J,NAOU(1),TYPN(1),"B",PSDRN,0))
39 ..S NUM="" F S NUM=$O(^TMP("PSDLOG",$J,NAOU(1),TYPN(1),PSDRN(1),NUM)) Q:NUM=""!(PSDOUT) F PSDCNT=0:0 S PSDCNT=$O(^TMP("PSDLOG",$J,NAOU(1),TYPN(1),PSDRN(1),NUM,PSDCNT)) Q:'PSDCNT!(PSDOUT) D Q:PSDOUT
40 ...I $Y+8>IOSL D PRT,HDR Q:PSDOUT W !,?2,"=> NAOU: ",NAOU,! W:ASKN !,?4,"=> INVENTORY TYPE: ",TYPN,! S LNUM=$Y
41 ...S NODE=$G(^TMP("PSDLOG",$J,NAOU(1),TYPN(1),PSDRN(1),NUM,PSDCNT))
42 ...W !,$P(NODE,"^",4),?2,$S(ASK="N":PSDRN,1:NUM),?13,$S(ASK="D":PSDRN,1:NUM),?55,$P(NODE,"^",2),?70,$J($P(NODE,"^"),6),?85,$P(NODE,"^",3),?100,"____________",?118,"____________",!
43 ...S LNUM=$Y
44 Q
45PRT ;
46 I LNUM<IOSL-7 F JJ=LNUM:1:IOSL-7 W !
47 W LN,!,"* - Transferred to another NAOU but not yet received",!,"** - Filled not yet received",!,"# - Returned to Stock",!
48 Q
Note: See TracBrowser for help on using the repository browser.