1 | PSDERD ;BIR/JPW-CS Error Log Edit ; 20 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("PSDMGR",DUZ)):1,$D(^XUSEC("PSD ERROR",DUZ)):2,1:0)
|
---|
5 | I 'OK W $C(7),!!,?9,"** Please contact your Pharmacy Coordinator for access to",!,?12,"the pending Controlled Substances error log.",!!,"PSDMGR or PSD ERROR security key required.",! K OK Q
|
---|
6 | S PSDUZ=DUZ
|
---|
7 | K LN S $P(LN,"-",30)=""
|
---|
8 | S PSDS=$P(PSDSITE,U,3),PSDSN=$P(PSDSITE,U,4) G:$P(PSDSITE,U,5) EDIT
|
---|
9 | ASKD ;ask disp location
|
---|
10 | W !!!,"You may select a Dispensing Site at the prompt.",!
|
---|
11 | W ! K DIC,DA S DIC=58.8,DIC(0)="QEAZ"
|
---|
12 | S DIC("S")="I $P(^(0),""^"",3)=+PSDSITE,$S($P(^(0),""^"",2)[""M"":1,$P(^(0),""^"",2)[""S"":1,1:0)"
|
---|
13 | S DIC("A")="Select Dispensing Site: ",DIC("B")=PSDSN
|
---|
14 | D ^DIC K DIC G:Y<0 END
|
---|
15 | S PSDS=+Y,PSDSN=$P(Y,"^",2),$P(PSDSITE,U,3)=+Y,$P(PSDSITE,U,4)=PSDSN
|
---|
16 | EDIT ;edit entry
|
---|
17 | K DA,DIC S DIC=58.89,DIC("S")="I $P(^(0),""^"",6)=PSDS",DIC("A")="Select Error Log Number: ",DIC(0)="QEAZ"
|
---|
18 | D ^DIC K DIC G:Y<0 END S PSD=+Y,NODE=Y(0)
|
---|
19 | S PSDA=+$P(NODE,"^",2),PSDATE=$P(NODE,"^",3) I PSDATE S Y=PSDATE X ^DD("DD") S PSDATE=Y
|
---|
20 | ;transaction to edit
|
---|
21 | I '$D(^PSD(58.81,PSDA,0)) W !!,"Transaction unavailable for editing.",!! G END
|
---|
22 | W !!,"Accessing transaction now..."
|
---|
23 | S NODE1=^PSD(58.81,PSDA,0),NODE9=$G(^PSD(58.81,PSDA,9))
|
---|
24 | S PSDR=+$P(NODE1,"^",5),PSDRN=$P($G(^PSDRUG(PSDR,0)),"^"),PSDQTY=+$P(NODE1,"^",6)
|
---|
25 | S PSDTYP=+$P(NODE1,"^",2),PSDTYP=$P($G(^PSD(58.84,PSDTYP,0)),"^")
|
---|
26 | S PSD1=$S(+$P(NODE9,"^",2):+$P(NODE9,"^",2),+$P(NODE9,"^",8):+$P(NODE9,"^",8),+$P(NODE9,"^",11):+$P(NODE9,"^",11),1:"UNKNOWN")
|
---|
27 | S:PSD1 PSD1=$P($G(^VA(200,PSD1,0)),"^")
|
---|
28 | S PSD2=$S(+$P(NODE9,"^",6):+$P(NODE9,"^",6),+$P(NODE9,"^",9):+$P(NODE9,"^",9),+$P(NODE9,"^",12):+$P(NODE9,"^",12),1:"")
|
---|
29 | S:PSD2 PSD2=$P($G(^VA(200,PSD2,0)),"^")
|
---|
30 | D DISPLAY
|
---|
31 | DIE ;
|
---|
32 | D NOW^%DTC S PSDT=+$E(%,1,12)
|
---|
33 | W !!,"Enter your resolution.",!
|
---|
34 | K DA,DIE,DR S DIE=58.89,DA=PSD,DR="5;4////"_PSDT_";3////"_PSDUZ D ^DIE K DA,DIE,DR
|
---|
35 | END ;
|
---|
36 | K %,%DT,%H,%I,%ZIS,ALL,CNT,DA,DIC,DIR,DIROUT,DIRUT,DTOUT,DUOUT,LN,NODE,NODE1,NODE9
|
---|
37 | K PG,PHARM,PHARMN,POP,PSD,PSD1,PSD2,PSDA,PSDATE,PSDED,PSDEV,PSDN,PSDOUT,PSDQTY,PSDR,PSDRG,PSDRN,PSDS,PSDSD,PSDSN,PSDT,PSDTYP,PSDUZ
|
---|
38 | K QTY,RPDT,X,Y,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE,ZTSK
|
---|
39 | Q
|
---|
40 | DISPLAY ;display info
|
---|
41 | W !!,"Transaction Information",!,LN,!
|
---|
42 | W !,PSDRN,!,"Transaction Type: ",PSDTYP,!,"Date Entered: ",PSDATE,?50,"Quantity: ",PSDQTY,!,"Entered By: ",PSD1,! W:PSD2]"" "Witnessed By: ",PSD2,!
|
---|
43 | Q
|
---|