PSODPT ;BIR/MFR - CENTRALIZED PATIENT LOOKUP FOR OP ;07/15/03
;;7.0;OUTPATIENT PHARMACY;**139,185,422**;DEC 1997;Build 132
;Ref. ^DGSEC4 supp. IA 3027
;Ref. MPIQQ^MPIFAPI supp. IA 3300
;
CHK(DFN,DISP,PAUSE) ; Security Check for Patient Selection
;Input: DFN - Patient IEN ^ Patient Name
; DISP - Display Messages Flag
; PAUSE - Pause Flag
N RESULT,RES,CHK
S DISP=$G(DISP),PAUSE=$G(PAUSE),CHK=+DFN D ICN(CHK)
D PTSEC^DGSEC4(.RESULT,$P(DFN,"^"),1)
I RESULT(1)'=0 D
. W !! I DISP W ?(80-$L($P(DFN,"^",2)))\2,$P(DFN,"^",2),!
. I RESULT(1)=3 S:$G(RX0) RESULT(3)="(RX# "_+RX0_")" ;*422
. F I=2:1:9 I $D(RESULT(I)) W ?(80-$L(RESULT(I)))\2,RESULT(I),!
. I RESULT(1)'=0,RESULT(1)'=2,PAUSE H 1
. Q:RESULT(1)=1
. I RESULT(1)=-1!(RESULT(1)=3)!(RESULT(1)=4) S CHK=-1 Q
. I RESULT(1)=2 D ENCONT I CHK=-1 Q
. D NOTICE^DGSEC4(.RES,DFN,XQY0,$S(RESULT(1)=1:1,1:3))
. I RES=0 S CHK=-1 Q
H 1 Q CHK
ENCONT W !,"Do you want to continue processing this patient record"
S %=2 D YN^DICN I %<0!(%=2) S CHK=-1
I '% W !!,"Enter 'YES' to continue processing, or 'NO' to quit processing this record." G ENCONT
Q
MSG ;
W !,$C(7),"Outpatient Division MUST be selected!",!
Q
ICN(X) ;
Q:'$G(X)
Q:'$D(^DPT(X,0))
I +$$GETICN^MPIF001(X)<1 N Y S Y=$$MPIQQ^MPIFAPI(X) K Y
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSODPT 1316 printed Oct 16, 2024@18:27:58 Page 2
PSODPT ;BIR/MFR - CENTRALIZED PATIENT LOOKUP FOR OP ;07/15/03
+1 ;;7.0;OUTPATIENT PHARMACY;**139,185,422**;DEC 1997;Build 132
+2 ;Ref. ^DGSEC4 supp. IA 3027
+3 ;Ref. MPIQQ^MPIFAPI supp. IA 3300
+4 ;
CHK(DFN,DISP,PAUSE) ; Security Check for Patient Selection
+1 ;Input: DFN - Patient IEN ^ Patient Name
+2 ; DISP - Display Messages Flag
+3 ; PAUSE - Pause Flag
+4 NEW RESULT,RES,CHK
+5 SET DISP=$GET(DISP)
SET PAUSE=$GET(PAUSE)
SET CHK=+DFN
DO ICN(CHK)
+6 DO PTSEC^DGSEC4(.RESULT,$PIECE(DFN,"^"),1)
+7 IF RESULT(1)'=0
Begin DoDot:1
+8 WRITE !!
IF DISP
WRITE ?(80-$LENGTH($PIECE(DFN,"^",2)))\2,$PIECE(DFN,"^",2),!
+9 ;*422
IF RESULT(1)=3
if $GET(RX0)
SET RESULT(3)="(RX# "_+RX0_")"
+10 FOR I=2:1:9
IF $DATA(RESULT(I))
WRITE ?(80-$LENGTH(RESULT(I)))\2,RESULT(I),!
+11 IF RESULT(1)'=0
IF RESULT(1)'=2
IF PAUSE
HANG 1
+12 if RESULT(1)=1
QUIT
+13 IF RESULT(1)=-1!(RESULT(1)=3)!(RESULT(1)=4)
SET CHK=-1
QUIT
+14 IF RESULT(1)=2
DO ENCONT
IF CHK=-1
QUIT
+15 DO NOTICE^DGSEC4(.RES,DFN,XQY0,$SELECT(RESULT(1)=1:1,1:3))
+16 IF RES=0
SET CHK=-1
QUIT
End DoDot:1
+17 HANG 1
QUIT CHK
ENCONT WRITE !,"Do you want to continue processing this patient record"
+1 SET %=2
DO YN^DICN
IF %<0!(%=2)
SET CHK=-1
+2 IF '%
WRITE !!,"Enter 'YES' to continue processing, or 'NO' to quit processing this record."
GOTO ENCONT
+3 QUIT
MSG ;
+1 WRITE !,$CHAR(7),"Outpatient Division MUST be selected!",!
+2 QUIT
ICN(X) ;
+1 if '$GET(X)
QUIT
+2 if '$DATA(^DPT(X,0))
QUIT
+3 IF +$$GETICN^MPIF001(X)<1
NEW Y
SET Y=$$MPIQQ^MPIFAPI(X)
KILL Y
+4 QUIT