source: FOIAVistA/trunk/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOREF1.m@ 802

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

initial load of FOIAVistA 6/30/08 version

File size: 2.0 KB
Line 
1PSOREF1 ;IHS/DSD/JCM-ASKS ALL QUESTIONS FOR REFILL RX ORDER ENTRY ;12/08/92 7:54 PM
2 ;;7.0;OUTPATIENT PHARMACY;**26**;DEC 1997
3 ;External reference ^PSDRUG( supported by DBIA 221
4START ;
5 S (PSOREF("DFLG"),PSOREF("FIELD"),PSOREF1)=0
6 S X="T-6M",%DT="X" D ^%DT
7 S (PSOID,PSOREF("ISSUE DATE"))=$S($P(^PSRX(PSOREF("IRXN"),0),"^",13)<Y:Y,1:$P(^PSRX(PSOREF("IRXN"),0),"^",13))
8 S:$G(PSORX("BAR CODE"))&($G(PSOBBC1("FROM"))="NEW") PSOREF("ISSUE DATE")=DT
9 K X,X1,X2
10 S PSOREF("CS")=0,PSODRUG("DEA")=$P(^PSDRUG($P(^PSRX(PSOREF("IRXN"),0),"^",6),0),"^",3)
11 F DEA=1:1 Q:$E(PSODRUG("DEA"),DEA)="" I $E(+PSODRUG("DEA"),DEA)>1,$E(+PSODRUG("DEA"),DEA)<6 S $P(PSOREF("CS"),"^")=1 S:$E(+PSODRUG("DEA"),DEA)=2 $P(PSOREF("CS"),"^",2)=1
12 ;
13 ;
141 S PSONEW("DAYS SUPPLY")=$P(^PSRX(PSOREF("IRXN"),0),"^",8),PSONEW("# OF REFILLS")=$P(^(0),"^",9)
15 S PSOREF("FLD")=1 D FILLDT^PSODIR2(.PSOREF) ; Get Fill date
16 G:PSOREF("DFLG") END G:PSOREF("FIELD") @PSOREF("FIELD")
17 ;
182 S PSOREF("FLD")=2,PSORX("MAIL/WINDOW")="MAIL" D MW^PSODIR2(.PSOREF)
19 G:PSOREF("DFLG") END G:PSOREF("FIELD") @PSOREF("FIELD")
20 ;
213 I $G(DUZ("AG"))="I" S PSOREF("FLD")=3 D CLERK^PSODIR2(.PSOREF) ; Get Clerk Code
22 G:PSOREF("DFLG") END G:PSOREF("FIELD") @PSOREF("FIELD")
23 ;
244 I $G(DUZ("AG"))="I" S PSOREF("FLD")=4 D EXP^PSODIR2(.PSOREF) ; Get Expiration Date - Indian Health Service ONLY
25 G:PSOREF("DFLG") END G:PSOREF("FIELD") @PSOREF("FIELD")
26 ;
27END ;
28 K PSOREF1
29 Q
30JUMP ;
31 S PSOREF("FIELD")=$S(+Y=22:1,+Y=11:2,+Y=16:3,+Y=29:4,1:PSOREF("FLD"))
32 I PSOREF("FIELD")>PSOREF("FLD") W !,$C(7),"Cannot jump ahead ..",! S PSOREF("FIELD")=PSOREF("FLD")
33 Q
34 ;
35EN(PSOREF) ;
36 D START
37 Q
38PROFILE ;
39 S (PSORX("REFILL"),PSORX("RENEW"))=0,PSOX=""
40 D ^PSOBUILD
41 I '$G(PSOSD) W !,"This patient has no prescriptions" S:'$D(DFN) DFN=PSODFN D GMRA^PSODEM G PROFILEX
42 S (PSODRG,PSOX)="" F S PSODRG=$O(PSOSD(PSODRG)) Q:PSODRG="" F S PSOX=$O(PSOSD(PSODRG,PSOX)) Q:PSOX="" S:$P(PSOSD(PSODRG,PSOX),"^",3)="" PSORX("RENEW")=1 S:$P(PSOSD(PSODRG,PSOX),"^",4)="" PSORX("REFILL")=1
43 K PSOX
44PROFILEX Q
Note: See TracBrowser for help on using the repository browser.