source: FOIAVistA/trunk/r/CONTROLLED_SUBSTANCES-PSD/PSDRSI.m@ 1586

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

initial load of FOIAVistA 6/30/08 version

File size: 2.5 KB
Line 
1PSDRSI ;BIR/JPW-Inspector Remove Hold on Green Sheet ; 10 Nov 93
2 ;;3.0; CONTROLLED SUBSTANCES ;;13 Feb 97
3 I '$D(PSDSITE) D ^PSDSET Q:'$D(PSDSITE)
4 W !!,"Inspector Remove a Green Sheet from Hold" S PSDUZ=DUZ,PSDUZN=$S($P($G(^VA(200,PSDUZ,0)),"^")]"":$P(^(0),"^"),1:"")
5ASKN ;if nurse ask naou
6 W ! K DA,DIC S DIC=58.8,DIC(0)="QEAZ",DIC("A")="Select NAOU: "
7 S DIC("S")="I $P(^(0),""^"",3)=+PSDSITE,$S('$D(^(""I"")):1,'^(""I""):1,+^(""I"")>DT:1,1:0),$P(^(0),""^"",2)=""N"",'$P(^(0),""^"",7)"
8 D ^DIC K DIC G:Y<0 END S AOU=+Y,AOUN=$P(Y,"^",2)
9GS ;select green sheet #
10 W ! K DA,DIC S DIC("A")="Select the Green Sheet #: ",DIC=58.81,DIC(0)="QEASZ",D="D"
11 S DIC("S")="I $P(^(0),""^"",11)=11"
12 D IX^DIC K DIC G:Y<0 END S PSDA=+Y
13 S STAT=+$P(Y(0),"^",11),PSDPN=$P(Y(0),"^",17),STATN="" I STAT S STATN=$P($G(^PSD(58.82,STAT,0)),"^")
14 S ORD=+$P(Y(0),"^",20),NAOU=+$P(Y(0),"^",18),NAOUN=$P($G(^PSD(58.8,NAOU,0)),"^"),PSDR=+$P(Y(0),"^",5),PSDRN=$P($G(^PSDRUG(PSDR,0)),"^")
15 I AOU'=NAOU W $C(7),!!,"The Green Sheet # ",PSDPN," is assigned to ",NAOUN,".",!,"Please select another Green Sheet.",! G GS
16 I '$D(^PSD(58.8,NAOU,1,PSDR,3,ORD,0)) W $C(7),!!,"There's no data on ",NAOUN," for Green Sheet # ",PSDPN,".",!,"Contact your Pharmacy Coordinator for assistance.",! G END
17 I STAT'=11 W $C(7),!!,"This Green Sheet has a status of "_$S(STATN]"":STATN,1:"UNKNOWN")_".",!,"Please select another Green Sheet.",! G GS
18 W ! K DA,DIR,DIRUT S DIR(0)="Y",DIR("A")="Are you sure",DIR("B")="NO"
19 S DIR("?",1)="Answer 'YES' to to remove this Green Sheet from hold for the Inspector or",DIR("?")="answer 'NO' to leave the Green Sheet status under review by Inspector."
20 D ^DIR K DIR G:$D(DIRUT) END G:'Y GS
21 D NOW^%DTC S (RECD,Y)=+$E(%,1,12) X ^DD("DD") S RECDT=Y
22COM ;complete at order level in 58.8
23 W !!,"Accessing ",PSDRN," information...",!!
24 W !!,"Updating your records now..."
25 ;update transaction file (58.81)
26 K DA,DIE,DR S DA=PSDA,DIE=58.81,DR="29.7////"_RECD_";10////4" D ^DIE K DA,DIE,DR
27 I $D(Y)!$D(DTOUT) W $C(7),!!,"** THIS GREEN SHEET HAS NOT BEEN REMOVED FROM HOLD **",!!,"The status remains "_STATN,! G END
28 K DA,DIE,DR S DA=ORD,DA(1)=PSDR,DA(2)=NAOU,DIE="^PSD(58.8,"_DA(2)_",1,"_DA(1)_",3,",DR="10////4" D ^DIE K DA,DIE,DR
29 S STAT=$P($G(^PSD(58.81,PSDA,0)),"^",11) W ?2,!,"*** Your Green Sheet #"_PSDPN_" is now "_$S($P($G(^PSD(58.82,STAT,0)),"^")]"":$P(^(0),"^"),1:"UNKNOWN")_" ***",!
30 G GS
31END K %,%DT,%H,%I,AOU,AOUN,D,DA,DIC,DIE,DR,DTOUT,DUOUT
32 K NAOU,NAOUN,OK,ORD,PSDA,PSDPN,PSDR,PSDRN,PSDUZ,PSDUZN,RECD,RECDT,STAT,STATN,SUB,TRANS,X,Y
33 Q
Note: See TracBrowser for help on using the repository browser.