BEHOXQCV ;MSC/IND/DKM - Cover Sheet: Alerts ;20-Mar-2007 13:48;DKM
;;1.1;BEH COMPONENTS;**026001**;Mar 20, 2007
;=================================================================
; Return alerts according to FLG:
; A = one patient, all users (default)
; U = one patient, one user
; P = all patients, one user
LIST(DATA,DFN,FLG) ;
N GBL,LP,CNT,X,Y
S DATA=$$TMPGBL^CIAVMRPC,GBL=$$TMPGBL^CIAVMRPC(1)
S @DATA@(1)="^No notifications found.",(CNT,LP)=0,FLG=$G(FLG),DFN=+$G(DFN)
D PATIENT^XQALERT(GBL,DFN):"A"[FLG,USER^XQALERT(GBL,DUZ):"UP"[FLG
F S LP=$O(@GBL@(LP)) Q:'LP D
.S X=@GBL@(LP),Y=$P(X,U,2)
.Q:$P(Y,";")'["OR"
.Q:"AU"[FLG&($P(Y,",",2)'=DFN)
.S CNT=CNT+1,@DATA@(CNT)=Y_U_$P(X,U)_U_$P($P(Y,";"),",",2)
K @GBL
Q
; No alert detail for now
DETAIL(DATA,DFN,AID) ;
S @DATA@(1)="Detail view not yet implemented."
Q
BEHOXQCV ;MSC/IND/DKM - Cover Sheet: Alerts ;20-Mar-2007 13:48;DKM
+1 ;;1.1;BEH COMPONENTS;**026001**;Mar 20, 2007
+2 ;=================================================================
+3 ; Return alerts according to FLG:
+4 ; A = one patient, all users (default)
+5 ; U = one patient, one user
+6 ; P = all patients, one user
LIST(DATA,DFN,FLG) ;
+1 NEW GBL,LP,CNT,X,Y
+2 SET DATA=$$TMPGBL^CIAVMRPC
SET GBL=$$TMPGBL^CIAVMRPC(1)
+3 SET @DATA@(1)="^No notifications found."
SET (CNT,LP)=0
SET FLG=$GET(FLG)
SET DFN=+$GET(DFN)
+4 IF "A"[FLG
DO PATIENT^XQALERT(GBL,DFN)
IF "UP"[FLG
DO USER^XQALERT(GBL,DUZ)
+5 FOR
SET LP=$ORDER(@GBL@(LP))
IF 'LP
QUIT
Begin DoDot:1
+6 SET X=@GBL@(LP)
SET Y=$PIECE(X,U,2)
+7 IF $PIECE(Y,";")'["OR"
QUIT
+8 IF "AU"[FLG&($PIECE(Y,",",2)'=DFN)
QUIT
+9 SET CNT=CNT+1
SET @DATA@(CNT)=Y_U_$PIECE(X,U)_U_$PIECE($PIECE(Y,";"),",",2)
End DoDot:1
+10 KILL @GBL
+11 QUIT
+12 ; No alert detail for now
DETAIL(DATA,DFN,AID) ;
+1 SET @DATA@(1)="Detail view not yet implemented."
+2 QUIT