source: FOIAVistA/trunk/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOCMOPB.m@ 1765

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

initial load of FOIAVistA 6/30/08 version

File size: 3.0 KB
Line 
1PSOCMOPB ;BIR/HTW-CMOP Release/Edit Utility ; 6/17/97 [ 12/15/97 2:11 PM ]
2 ;;7.0;OUTPATIENT PHARMACY;**11,148**;DEC 1997
3OREL(RXP) ; Called from PSODISP to check for CMOP during manual Release
4 ; IF ePharmacy Rx and it was returned to Stock, allow release
5 I $$STATUS^PSOBPSUT(RXP,0)'="",$$RXRLDT^PSOBPSUT(RXP,0)="",$$GET1^DIQ(52,RXP,32.1,"I") G D1
6 D LAST
7 ; This for original fill. No release unless cancelled.
8 I $G(CMOP(0))=0!($G(CMOP(0))=1)!($G(CMOP(0))=2) S ISUF=1
9 G D1
10RREL(RXP,RFL) ; This for Release Refills PSODISP
11 ; IF ePharmacy Rx and it was returned to Stock, allow release
12 I $$STATUS^PSOBPSUT(RXP,RFL)'="",$$RXRLDT^PSOBPSUT(RXP,RFL)="",$$GET1^DIQ(52.1,RFL_","_RXP,14,"I") G D1
13 D LAST
14 ;
15RREL1 ; No release of fills unless cancelled
16 I $G(CMOP(YY))=0!($G(CMOP(YY))=1)!($G(CMOP(YY))=2) S ISUF=1
17 G D1
18CS(RXP) N YY,ISUF
19 I +$G(XTYPE) S YY=$P($G(XTYPE),"^",2) D RREL(RXP,YY) I $G(ISUF) S XFLAG=1 K ISUF Q
20 I $P($G(XTYPE),"^")="" D OREL(RXP) I $G(ISUF) S XFLAG=1 K ISUF Q
21 Q
22LAST ; Find last event, Find last fill
23 F B=0:0 S B=$O(^PSRX(RXP,4,B)) Q:(+B<1) S CMOP($P(^PSRX(RXP,4,B,0),"^",3))=$P(^PSRX(RXP,4,B,0),"^",4)
24 Q
25D1 ;
26 K CMOP,PSXACT,PSXRXN,PSXDA,PSXRX0,PSXRXS,PSXRXP,PSXLFD,PSXRXF,PSXFDA,PSXIR
27 K PSXACT,CNT,PPLSAVE,PSXPPL1,PSXCK,P1,P2,PSXPPL,PSXIEN,PSXDRUG,PSXLF
28 K PSXRX,PSXSD,FLAG,NEWDT,PSXFDT,I,SUSPT,PSX1,PSX2,PSXER,PSXJOB,B,C
29 Q
30SUS ; From SUP^PSORXED1 If suspense date edited to future date resuspend
31 S RXN=DA,RX0=^PSRX(DA,0),DA=RXS,DIK="^PS(52.5," D ^DIK S DA=RXN
32 S DIC="^PS(52.5,",DIC(0)="L",X=RXN
33 S DIC("DR")=".02///"_SD_";.03////"_$P(^PSRX(DA,0),"^",2)_";.04///M;.05///0;.06////"_PSOSITE_";2///0;3////Q;9////"_$G(RFD)
34 K DD,DO D FILE^DICN K DD,DO
35 K ^PS(52.5,"AC",$P(^PSRX(RXN,0),"^",2),SD,+Y)
36 S IR=0 F FDA=0:0 S FDA=$O(^PSRX(DA,"A",FDA)) Q:'FDA S IR=FDA
37 S IR=IR+1,^PSRX(DA,"A",0)="^52.3DA^"_IR_"^"_IR
38 D NOW^%DTC S ^PSRX(DA,"A",IR,0)=%_"^E^"_DUZ_"^"_RFD_"^Suspended for CMOP until "_$E(SD,4,5)_"-"_$E(SD,6,7)_"-"_$E(SD,2,3)
39 W !,"RX# "_$P(RX0,"^")_" HAS BEEN SUSPENDED FOR CMOP UNTIL "_$E(SD,4,5)_"-"_$E(SD,6,7)_"-"_$E(SD,2,3)_".",!
40 K PSOCMOP
41 Q
42EQTY ;W !,"Y=",Y
43 S DIR(0)="52,7" S DRG=+$P(^PSRX(ZRX,0),"^",6) S DIR("A")="QTY "_$S($D(^PSDRUG("AQ",DRG)):$G(^PSDRUG(DRG,5)),1:"")
44 S:$P(^PSRX(ZRX,0),"^",7) DIR("B")=$P(^(0),"^",7)
45 D ^DIR K DIR
46 I Y["^",($L(Y)>1) W $C(7)," Sorry no ^ jumping allowed" K Y G EQTY
47 I Y["^"!($D(DTOUT)) S PSXEXIT=1
48 K Y,DIR
49 Q
50EQTY2 ;
51 S DIR(0)="52.1,1" S DRG=+$P(^PSRX(ZRX,0),"^",6)
52 S DIR("A")="QTY "_$S($D(^PSDRUG("AQ",DRG)):$G(^PSDRUG(DRG,5)),1:"")
53 S DIR("B")=$P(^PSRX(ZRX,1,PSXRFL,0),"^",4)
54 D ^DIR
55 I Y["^",($L(Y)>1) W $C(7)," Sorry no ^ jumping allowed" K Y G EQTY2
56 I Y["^"!($D(DTOUT)) S PSXEXIT=1
57 D QTY
58 I $G(X)']"" G EQTY2
59 K Y S:X>0 $P(^PSRX(ZRX,1,PSXRFL,0),"^",4)=X
60 Q
61QTY ;Check quantity
62 I X>99999999!($L(X)>11)!(X'?.N.1".".2N) K X G HELP
63 Q
64HELP ; QTY HELP
65 W !!,"This is a CMOP drug. The quantity may not contain alpha characters (i.e.; ML) or more than two decimal places (i.e.; .01)."
66 W !,"Enter a whole number between 0 and 99999999 inclusive. The total entry cannot exceed 11 characters." K Z0
67 Q
Note: See TracBrowser for help on using the repository browser.