source: FOIAVistA/trunk/r/CONTROLLED_SUBSTANCES-PSD/PSDLBL.m@ 1742

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

initial load of FOIAVistA 6/30/08 version

File size: 3.9 KB
Line 
1PSDLBL ;BIR/JPW-CS Label Print for CS Disp Drug ; 5 Oct 94
2 ;;3.0; CONTROLLED SUBSTANCES ;;13 Feb 97
3 I '$D(PSDSITE) D ^PSDSET Q:'$D(PSDSITE)
4 S OK=$S($D(^XUSEC("PSJ RPHARM",DUZ)):1,$D(^XUSEC("PSJ PHARM TECH",DUZ)):1,1:0)
5 I 'OK W $C(7),!!,?9,"** Please contact your Pharmacy Coordinator for access to",!,?12,"print CS dispensing labels.",!!,"PSJ RPHARM or PSJ PHARM TECH security key required.",! K OK Q
6ASKD ;ask disp number range
7 S PSDS=$P(PSDSITE,U,3),PSDSN=$P(PSDSITE,U,4)
8 G:$P(PSDSITE,U,5) CHKD
9 K DIC,DA S DIC=58.8,DIC(0)="QEAZ",DIC("S")="I $P(^(0),""^"",3)=+PSDSITE,$S($P(^(0),""^"",2)[""M"":1,$P(^(0),""^"",2)[""S"":1,1:0)"
10 S DIC("A")="Select Primary Dispensing Site: ",DIC("B")=PSDSN
11 D ^DIC K DIC G:Y<0 END
12 S PSDS=+Y,PSDSN=$P(Y,"^",2),$P(PSDSITE,U,3)=+Y,$P(PSDSITE,U,4)=PSDSN
13CHKD I '$O(^PSD(58.8,+PSDS,1,0)) W !!,"There are no CS stocked drugs for your dispensing vault.",!! G END
14ONE ;asks print type
15 K DA,DIR,DIRUT S DIR(0)="S^N:NAOU(s);R:Range of Green Sheet Numbers",DIR("A")="Printing Method"
16 S DIR("?",1)="Answer 'N' to select printing by NAOU(s), 'R' to select a number range",DIR("?")="to print ALL Green Sheets not previously printed, or '^' to quit."
17 D ^DIR K DIR G:$D(DIRUT) END S ANS=Y
18 G:ANS="N" SEL
19GS1 ;ask gs # range
20 W !!,"You may enter a Green Sheet # list and/or a Green Sheet # range.",!
21 W "NOTE: This response must be a list or range, e.g. 1,3,5 or 2-4,8.",!
22 K DA,DIR,DIRUT S DIR(0)="LOA^0:999999999",DIR("A")="Select Green Sheet #(s): "
23 D ^DIR K DIR G:$D(DIRUT) END
24 S PSD1="" F S PSD1=$O(Y(PSD1)) Q:PSD1="" S:$D(Y(PSD1)) PSD1(PSD1)=Y(PSD1) K Y(PSD1)
25 G DEV
26SEL ;sel naou or group
27 W !!,?5,"Select one of the following:",!!,?10,"N",?20,"NAOU (One, Some, or ^ALL)",!,?10,"G",?20,"Group of NAOUs",!
28 K DA,DIR,DIRUT S DIR(0)="SOA^N:NAOU;G:Group of NAOUs",DIR("A")="Select Method: "
29 S DIR("?",1)="Enter 'N' to select one, some or ^ALL NAOU(s),",DIR("?")="enter 'G' to select a group of NAOUs, or '^' to quit"
30 D ^DIR K DIR G:$D(DIRUT) END S SEL=Y D NOW^%DTC S PSDT=X K DA,DIC S CNT=0
31 I SEL="G" D GROUP G:'$D(PSDG) END G DEV
32 F S DIC=58.8,DIC("A")="Select NAOU: ",DIC(0)="QEA",DIC("S")="I $P(^(0),""^"",3)=+PSDSITE,$P(^(0),""^"",2)=""N""" D ^DIC K DIC Q:Y<0 D
33 .S NAOU(+Y)="",CNT=CNT+1
34 I '$D(NAOU)&(X'="^ALL") G END
35 S:X="^ALL" ALL=1
36DEV ;ask device and queue info
37 S DIR(0)="Y",DIR("A")="Would you like to try printing these on PIN FED labels",DIR("B")="No" D ^DIR K DIR Q:$D(DIRUT) G:Y=1 ^PSDLBL4
38 W $C(7),!!,?3,"WARNING: The printing of these labels requires the use of a sheet fed",!,?12,"laser printer setup to create Controlled Substances",!,?12,"barcodes.",!
39 W !,?12,"*** Check printer for LABEL paper before printing! ***",!
40 W !!,"This report is designed for a 3 column label format.",!,"You may queue this report to print at a later time.",!!
41 S Y=$P($G(^PSD(58.8,+PSDS,2)),"^",10),C=$P(^DD(58.8,24,0),"^",2) D Y^DIQ S PSDEV=Y
42 K %ZIS,IOP,IO("Q"),POP S %ZIS="Q",%ZIS("B")=PSDEV D ^%ZIS I POP W !,"NO DEVICE SELECTED OR REPORT PRINTED!" G END
43 I $D(IO("Q")) K IO("Q"),ZTSAVE,ZTDTH,ZTSK S ZTRTN="START^PSDLBL0",ZTDESC="Print Dispensing Labels for CS PHARM" D SAVE,^%ZTLOAD,HOME^%ZIS K ZTSK G END
44 U IO D ^PSDLBL0
45END ;kill variables and exit
46 K %,%DT,%H,%I,%ZIS,ALL,ANS,C,CNT,DA,DIC,DIE,DIR,DIROUT,DIRUT,DR,DRUG,DTOUT,DUOUT,JJ,JLP1,LIQ,NAOU,NAOUN,NODE,OK
47 K POP,PSD,PSD1,PSD2,PSDA,PSDBAR0,PSDBAR1,PSDCNT,PSDEV,PSDG,PSDJ,PSDN,PSDPN,PSDOUT,PSDR,PSDRG,PSDPRT,PSDRN,PSDS,PSDSN,PSDT,PSDX1,PSDX2
48 K SEL,STAT,TEMP,TEST,TEXT,X,Y,ZTDESC,ZTIO,ZTRTN,ZTSAVE,ZTSK
49 K ^TMP("PSDLBL",$J)
50 D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
51 Q
52SAVE ;save queued variables
53 S:$D(ALL) ZTSAVE("ALL")=""
54 S:$D(PSDS) (ZTSAVE("PSDS"),ZTSAVE("PSDSN"))=""
55 S:$D(PSD1) ZTSAVE("PSD1(")="" S:$D(NAOU) ZTSAVE("NAOU(")="" S:$D(PSDG) ZTSAVE("PSDG(")="" S:$D(CNT) ZTSAVE("CNT")=""
56 S (ZTSAVE("ANS"),ZTSAVE("PSDSITE"))=""
57 Q
58GROUP ;select group of naous
59 K DA,DIC F S DIC=58.2,DIC("A")="Select NAOU INVENTORY GROUP NAME: ",DIC(0)="QEA",DIC("S")="I $S($D(^PSI(58.2,""CS"",+Y)):1,1:0)" D ^DIC K DIC Q:Y<0 S PSDG(+Y)=""
60 Q
Note: See TracBrowser for help on using the repository browser.