source: WorldVistAEHR/trunk/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOFUNC.m@ 1195

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

initial load of WorldVistAEHR

File size: 1.5 KB
Line 
1PSOFUNC ;BHAM ISC/DRI - functions moved from the psf global ; 10/26/92 11:49
2 ;;7.0;OUTPATIENT PHARMACY;**146,223,249**;DEC 1997;Build 9
3STAT ;gets status of rx
4 S ST0=+$P(RX0,"^",15) I ST0<12,$O(^PS(52.5,"B",J,0)),$D(^PS(52.5,+$O(^(0)),0)),'$G(^("P")) S ST0=5
5 I ST0<12,$P(RX2,"^",6)<DT S ST0=11
6 S ST=$P("Error^Active^Non-Verified^Refill^Hold^Non-Verified^Suspended^^^^^Done^Expired^Discontinued^Deleted^Discontinued^Discontinued (Edit)^Provider Hold^","^",ST0+2),$P(RX0,"^",15)=ST0
7 Q
8CUTDATE ;calculates exp/cancel cutoff date in PSODTCUT
9 S X1=DT,X2=-120 D C^%DTC S PSODTCUT=X,PSOPRPAS=$P($G(PSOPAR),"^",7) Q
10 ;
11FIXEXPDT ;calculate expiration date on rx's missing them
12 F J=0:0 S J=$O(^PSRX(J)) Q:'J I $D(^(J,0))#2 S RX0=^(0),RX2=$S($D(^(2))#2:^(2),1:"") D ^PSOEXDT:'$P(RX2,"^",6)
13 Q
14 ;
15INP526 ;input transform for drug field (#6) in prescription file (#52)
16 ;
17 S PSODFN=+$P(^PSRX(DA,0),"^",2) F I=0:0 S I=$O(^PS(55,PSODFN,"P",I)) Q:'I S RX=+^(I,0) I RX'=DA,$D(^PSRX(RX,0)),+$P(^(0),"^",6)=X,'$P(^("STA"),"^") S XS=X,X2=$P(^(0),"^",13),X1=$P(^PSRX(DA,0),"^",13) D ^%DTC D:X<180 INP5261 Q:'$D(X) S X=XS
18 Q
19INP5261 D EN^DDIOL("Duplicate Drug in Rx #"_$P(^PSRX(RX,0),"^")_" . Discontinue? (Y/N): ","","$C(7),?10") R ZX:DTIME
20 I ZX["^" D EN^DDIOL("NO UP ARROW ALLOWED","","!") S ZX="?"
21 I ZX["?" D EN^DDIOL("Enter Y to discontinue this Prescription","","!") D EN^DDIOL(" ","","!") G INP5261
22 S ZX=ZX?1"Y".E I ZX S $P(^PSRX(RX,"STA"),"^")=12,$P(^PSRX(RX,3),"^",5)=DT D CAN^PSOTPCAN(RX) D EN^DDIOL(" Discontinued") Q
23 K X,XS,ZS Q
Note: See TracBrowser for help on using the repository browser.