source: FOIAVistA/trunk/r/CONTROLLED_SUBSTANCES-PSD/PSDRPGS.m@ 674

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

initial load of FOIAVistA 6/30/08 version

File size: 2.3 KB
Line 
1PSDRPGS ;BIR/JPW-Reprint Green Sheet (VA FORM 10-2638) ; 29 Aug 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,"reprint Green Sheets.",!!,"PSJ RPHARM or PSJ PHARM TECH security key required.",! K OK Q
6ASKD ;ask dispensing location
7 S PSDS=$P(PSDSITE,U,3),PSDSN=$P(PSDSITE,U,4)
8 I $P(PSDSITE,U,5) S PRT=+$P($G(^PSD(58.8,+PSDS,2)),"^",6),ASK=+$G(^(2.5)) G GS1
9 W ! 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)",DIC("A")="Select Primary Dispensing Site: ",DIC("B")=$P(PSDSITE,U,4)
10 D ^DIC K DIC G:Y<0 END
11 S PSDS=+Y,PSDSN=$P(Y,"^",2),PRT=+$P($G(^PSD(58.8,+PSDS,2)),"^",6),ASK=+$G(^PSD(58.8,+PSDS,2.5)),$P(PSDSITE,U,3)=+Y,$P(PSDSITE,U,4)=PSDSN
12GS1 ;ask gs # range
13 W !!,"You may enter a Green Sheet # list and/or a Green Sheet # range.",!
14 W "NOTE: This response must be a list or range, e.g., 1,3,5 or 2-4,8.",!
15 K DA,DIR,DIRUT S DIR(0)="LOA^0:999999999",DIR("A")="Select Green Sheet #(s): "
16 D ^DIR K DIR G:$D(DIRUT) END
17 S PSD1="" F S PSD1=$O(Y(PSD1)) Q:PSD1="" S:$D(Y(PSD1)) PSD1(PSD1)=Y(PSD1) K Y(PSD1)
18DEV ;ask device and queue info
19 W $C(7),!!,"This report now prints on plain paper.",!,"Please check your printer before starting this report.",!!,"You may queue this report to print at a later time.",!!
20 S PSDCPI=10
21 S Y=$P($G(^PSD(58.8,+PSDS,2)),"^",8),C=$P(^DD(58.8,24,0),"^",2) D Y^DIQ S PSDEV=Y
22 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
23 I $D(IO("Q")) K IO("Q"),ZTIO,ZTSAVE,ZTDTH,ZTSK S ZTRTN="START^PSDRPGS2",ZTDESC="Reprint Green Sheets (VA FORM 10-2638)" D SAVE D ^%ZTLOAD,HOME^%ZIS K ZTSK G END
24 U IO G START^PSDRPGS2
25END K %ZIS,ANS,ASK,C,CNT,D,DA,DIC,DIE,DIR,DIROUT,DIRUT,DR,DTOUT,DUOUT,EXP,EXPD,LINE,LOT,NAOU,NAOUN,NODE,NODE1,PSDW
26 K OK,ORD,ORDN,POP,PRT,PSD,PSD1,PSDA,PSDBY,PSDBYN,PSDCNT,PSDDT,PSDEV,PSDOUT,PSDCPI,PSDPN,PSDR,PSDRN,PSDS,PSDSN,PSDT,PSDTR,PSDTRN,REPRINT,QTY,SITE,STAT,TRANS,Y,ZTDESC,ZTDTH,ZTRTN,ZTSAVE,ZTSK
27 D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
28 Q
29SAVE ;save var
30 S (ZTSAVE("ASK"),ZTSAVE("PSDS"),ZTSAVE("PSDSN"),ZTSAVE("PSDCPI"))="" S:$D(REPRINT) ZTSAVE("REPRINT")=""
31 S ZTSAVE("PSD1(")=""
32 Q
Note: See TracBrowser for help on using the repository browser.