PSODPT ;BIR/MFR - CENTRALIZED PATIENT LOOKUP FOR OP ;29-May-2012 14:45;PLS
;;7.0;OUTPATIENT PHARMACY;**139,185,1015**;DEC 1997;Build 62
;Ref. ^DGSEC4 supp. IA 3027
;Ref. MPIQQ^MPIFAPI supp. IA 3300
;
;Modified - IHS/MSC/PLS - 06/01/2010 - Line ICN+1
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),!
. 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 ;IHS/MSC/PLS - 06/01/2010
Q:'$G(X)
Q:'$D(^DPT(X,0))
I +$$GETICN^MPIF001(X)<1 N Y S Y=$$MPIQQ^MPIFAPI(X) K Y
Q
PSODPT ;BIR/MFR - CENTRALIZED PATIENT LOOKUP FOR OP ;29-May-2012 14:45;PLS
+1 ;;7.0;OUTPATIENT PHARMACY;**139,185,1015**;DEC 1997;Build 62
+2 ;Ref. ^DGSEC4 supp. IA 3027
+3 ;Ref. MPIQQ^MPIFAPI supp. IA 3300
+4 ;
+5 ;Modified - IHS/MSC/PLS - 06/01/2010 - Line ICN+1
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 FOR I=2:1:9
IF $DATA(RESULT(I))
WRITE ?(80-$LENGTH(RESULT(I)))\2,RESULT(I),!
+10 IF RESULT(1)'=0
IF RESULT(1)'=2
IF PAUSE
HANG 1
+11 IF RESULT(1)=1
QUIT
+12 IF RESULT(1)=-1!(RESULT(1)=3)!(RESULT(1)=4)
SET CHK=-1
QUIT
+13 IF RESULT(1)=2
DO ENCONT
IF CHK=-1
QUIT
+14 DO NOTICE^DGSEC4(.RES,DFN,XQY0,$SELECT(RESULT(1)=1:1,1:3))
+15 IF RES=0
SET CHK=-1
QUIT
End DoDot:1
+16 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 ;IHS/MSC/PLS - 06/01/2010
QUIT
+2 IF '$GET(X)
QUIT
+3 IF '$DATA(^DPT(X,0))
QUIT
+4 IF +$$GETICN^MPIF001(X)<1
NEW Y
SET Y=$$MPIQQ^MPIFAPI(X)
KILL Y
+5 QUIT