38 lines
1.5 KiB
Mathematica
38 lines
1.5 KiB
Mathematica
PSOREF2 ;ISC-BIRM/SAB - asks all questions for barcode refill rx order entry ; 09/30/96
|
|
;;7.0;OUTPATIENT PHARMACY;;DEC 1997
|
|
;
|
|
START ;
|
|
S (PSOREF("DFLG"),PSOREF("FIELD"),PSOREF1)=0
|
|
S X1=DT,X2=-180 D C^%DTC S PSOREF("ISSUE DATE")=X
|
|
S:$G(PSORX("BAR CODE"))&($G(PSOBBC1("FROM"))="NEW") PSOREF("ISSUE DATE")=DT
|
|
K X,X1,X2
|
|
;
|
|
;
|
|
1 S PSOREF("FLD")=1 D FILLDT^PSODIR3(.PSOREF) ; Get Fill date
|
|
G:PSOREF("DFLG") END G:PSOREF("FIELD") @PSOREF("FIELD")
|
|
;
|
|
2 S PSOREF("FLD")=2,PSORX("MAIL/WINDOW")="MAIL" D MW^PSODIR3(.PSOREF)
|
|
G:PSOREF("DFLG") END G:PSOREF("FIELD") @PSOREF("FIELD")
|
|
;
|
|
3 I $G(DUZ("AG"))="I" S PSOREF("FLD")=3 D CLERK^PSODIR3(.PSOREF) ; Get Clerk Code
|
|
G:PSOREF("DFLG") END G:PSOREF("FIELD") @PSOREF("FIELD")
|
|
;
|
|
4 I $G(DUZ("AG"))="I" S PSOREF("FLD")=4 D EXP^PSODIR3(.PSOREF) ; Get Expiration Date - Indian Health Service ONLY
|
|
G:PSOREF("DFLG") END G:PSOREF("FIELD") @PSOREF("FIELD")
|
|
;
|
|
END ;
|
|
K PSOREF1
|
|
Q
|
|
JUMP ;
|
|
S PSOREF("FIELD")=$S(+Y=22:1,+Y=11:2,+Y=16:3,+Y=29:4,1:PSOREF("FLD"))
|
|
I PSOREF("FIELD")>PSOREF("FLD") W !,$C(7),"Cannot jump ahead ..",! S PSOREF("FIELD")=PSOREF("FLD")
|
|
Q
|
|
;
|
|
EN(PSOREF) ;
|
|
D START
|
|
Q
|
|
LOOK ;this entry is used to try and find current med order
|
|
S (PSOY,STA,PSOX)="",DRUG=$P(^PSDRUG($P(^PSRX(PSOREF("IRXN"),0),"^",6),0),"^")
|
|
I $G(PSOSD) W "Looking..." F S STA=$O(PSOSD(STA)) Q:STA="" F S PSOX=$O(PSOSD(STA,PSOX)) Q:PSOX']"" W "." I DRUG=PSOX,+PSOSD(STA,PSOX) S PSOY=PSOSD(STA,PSOX),PSOREF("IRXN")=+PSOSD(STA,PSOX),PSODF=1,PSOBBC("DONE")=PSOREF("IRXN")_"," Q
|
|
W ! K DRUG Q
|