source: WorldVistAEHR/trunk/r/CONTROLLED_SUBSTANCES-PSD/PSDCORP.m@ 789

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

initial load of WorldVistAEHR

File size: 2.7 KB
Line 
1PSDCORP ;BIR/BJW-CS Correction Log Report ; 6 Feb 98
2 ;;3.0; CONTROLLED SUBSTANCES ;**8**;13 Feb 97
3 ;**Y2K compliance**,"P" added to date input string
4 I '$D(PSDSITE) D ^PSDSET Q:'$D(PSDSITE)
5 I '$D(^XUSEC("PSDMGR",DUZ)) W $C(7),!!,?9,"** Please contact your Pharmacy Coordinator for access to print",!,?12,"the narcotic corrections log.",!!,"PSDMGR security key required.",! Q
6ASKD ;ask disp site
7 S PSDS=$P(PSDSITE,U,3),PSDSN=$P(PSDSITE,U,4)
8 G:$P(PSDSITE,U,5) TYPE
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)"
10 S DIC("A")="Select Primary Dispensing Site: "
11 S DIC("B")=PSDSN
12 D ^DIC K DIC G:Y<0 END
13 S PSDS=+Y,PSDSN=$P(Y,"^",2),$P(PSDSITE,U,3)=+Y,$P(PSDSITE,U,4)=PSDSN
14TYPE ;ask correction type
15 K DA,DIR,DIRUT S DIR(0)="SO^1:GREEN SHEET READY FOR PICKUP CORRECTION;2:DELETE EXISTING GREEN SHEET CORRECTION;3:ERROR FOUND ON COMPLETED GS;4:RESOLVED ERROR ON GREEN SHEET"
16 S DIR("A")="Select Type of Correction Log"
17 S DIR("?",1)="Answer '1' to print Green Sheets flagged ready for pickup corrections,"
18 S DIR("?",2)="answer '2' to print existing Green Sheets deleted,",DIR("?",3)="answer '3' to print Green Sheets with an error found after initial completion,"
19 S DIR("?",4)="answer '4' to print Green Sheets with errors resolved or",DIR("?")="answer '^' to quit without printing the report."
20 D ^DIR K DIR G:$D(DIRUT) END S TYPE=Y
21DATE ;ask date range
22 W ! K %DT S %DT="AEP",%DT("A")="Start with Date: " D ^%DT I Y<0 S PSDOUT=1 G END
23 S PSDSD=Y D D^DIQ S PSDATE=Y,%DT("A")="End with Date: " D ^%DT I Y<0 S PSDOUT=1 G END
24 I Y<PSDSD W !!,"The ending date of the range must be later than the starting date." G DATE
25 S PSDED=Y D D^DIQ S PSDATE=PSDATE_"^"_Y,PSDSD=PSDSD-.0001,PSDED=PSDED+.9999
26DEV ;asks device and queueing information
27 W !!,"This report is designed for a 132 column format.",!,"You may queue this report to print at a later time.",!!
28 S Y=$P($G(^PSD(58.8,+PSDS,2)),"^",9),C=$P(^DD(58.8,24,0),"^",2) D Y^DIQ S PSDEV=Y
29 K %ZIS,IOP,IO("Q"),POP S %ZIS="QM",%ZIS("B")=PSDEV D ^%ZIS I POP W !,"NO DEVICE SELECTED OR REPORT PRINTED!" G END
30 I $D(IO("Q")) K IO("Q"),ZTIO,ZTSAVE,ZTDTH,ZTSK S ZTRTN=$S(TYPE=1:"^PSDCORP1",TYPE=2:"^PSDCORP2",1:"^PSDCORP3"),ZTDESC="CS PHARM Correction Log" D SAVE,^%ZTLOAD,HOME^%ZIS K ZTSK G END
31 U IO
32 G:TYPE=1 ^PSDCORP1 G:TYPE=2 ^PSDCORP2 G:TYPE=3 ^PSDCORP3 G:TYPE=4 ^PSDCORP3
33END K %,%DT,%H,%I,AOU,AOUN,C,D,DA,DIC,DIE,DIR,DIROUT,DIRUT,DR,DRUG,DTOUT,DUOUT,IO("Q"),JJ,NODE,NUM,PG,POP,PSD,PSDATE,PSDED,PSDEV,PSDOUT,PSDS,PSDSD,PSDSN,PSDT,TYPE,X,Y
34 K ZTDESC,ZTIO,ZTRTN,ZTSAVE D ^%ZISC
35 S:$D(ZTQUEUED) ZTREQ="@"
36 Q
37SAVE S (ZTSAVE("PSDS"),ZTSAVE("PSDSN"),ZTSAVE("PSDSD"),ZTSAVE("PSDED"),ZTSAVE("PSDATE"),ZTSAVE("TYPE"))=""
38 Q
Note: See TracBrowser for help on using the repository browser.