BQIFLUPD ;PRXM/HC/ALA-Update Flags ; 14 Dec 2005 5:22 PM
;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
;
Q
;
UPD(DATA,ADIEN,ALIEN,DFN,AACT) ;EP -- BQI UPDATE FLAGS
;Description
; For a user, update the status of a flag for a particular patient. This
; will be used to deactivate a flag or reactivate it.
;Input
; ADIEN = Flag Definition internal entry number
; ALIEN = Flag Record internal entry number
; DFN = Patient internal entry number
; AACT = Flag Action
;
NEW UID,II,X,ERROR
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQIFLUPD",UID))
K @DATA
;
S II=0
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIFLUPD D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
S @DATA@(II)="I00010RESULT"_$C(30)
;
NEW DA,IENS
S DA(3)=DFN,DA(2)=ADIEN,DA(1)=ALIEN,DA=DUZ,IENS=$$IENS^DILF(.DA)
I AACT="H" D
. S BQIUPD(90507.5151,IENS,.02)=1
. S BQIUPD(90507.5151,IENS,.03)=$$NOW^XLFDT()
I AACT="S" D
. S BQIUPD(90507.5151,IENS,.02)="@"
. S BQIUPD(90507.5151,IENS,.03)=$$NOW^XLFDT()
;
D FILE^DIE("","BQIUPD","ERROR")
K BQIUPD
;
I $D(ERROR) S II=II+1,@DATA@(II)="-1"_$C(30)
I '$D(ERROR) S II=II+1,@DATA@(II)="1"_$C(30)
;
; Refresh the flag indicator for this patient
D FND^BQIFLFLG(DUZ,DFN,ADIEN)
;
S II=II+1,@DATA@(II)=$C(31)
Q
;
ERR ;
D ^%ZTER
NEW Y,ERRDTM
S Y=$$NOW^XLFDT() X ^DD("DD") S ERRDTM=Y
S BMXSEC="Recording that an error occurred at "_ERRDTM
I $D(II),$D(DATA) S II=II+1,@DATA@(II)=$C(31)
Q
BQIFLUPD ;PRXM/HC/ALA-Update Flags ; 14 Dec 2005 5:22 PM
+1 ;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
+2 ;
+3 QUIT
+4 ;
UPD(DATA,ADIEN,ALIEN,DFN,AACT) ;EP -- BQI UPDATE FLAGS
+1 ;Description
+2 ; For a user, update the status of a flag for a particular patient. This
+3 ; will be used to deactivate a flag or reactivate it.
+4 ;Input
+5 ; ADIEN = Flag Definition internal entry number
+6 ; ALIEN = Flag Record internal entry number
+7 ; DFN = Patient internal entry number
+8 ; AACT = Flag Action
+9 ;
+10 NEW UID,II,X,ERROR
+11 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+12 SET DATA=$NAME(^TMP("BQIFLUPD",UID))
+13 KILL @DATA
+14 ;
+15 SET II=0
+16 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQIFLUPD D UNWIND^%ZTER"
+17 ;
+18 SET @DATA@(II)="I00010RESULT"_$CHAR(30)
+19 ;
+20 NEW DA,IENS
+21 SET DA(3)=DFN
SET DA(2)=ADIEN
SET DA(1)=ALIEN
SET DA=DUZ
SET IENS=$$IENS^DILF(.DA)
+22 IF AACT="H"
Begin DoDot:1
+23 SET BQIUPD(90507.5151,IENS,.02)=1
+24 SET BQIUPD(90507.5151,IENS,.03)=$$NOW^XLFDT()
End DoDot:1
+25 IF AACT="S"
Begin DoDot:1
+26 SET BQIUPD(90507.5151,IENS,.02)="@"
+27 SET BQIUPD(90507.5151,IENS,.03)=$$NOW^XLFDT()
End DoDot:1
+28 ;
+29 DO FILE^DIE("","BQIUPD","ERROR")
+30 KILL BQIUPD
+31 ;
+32 IF $DATA(ERROR)
SET II=II+1
SET @DATA@(II)="-1"_$CHAR(30)
+33 IF '$DATA(ERROR)
SET II=II+1
SET @DATA@(II)="1"_$CHAR(30)
+34 ;
+35 ; Refresh the flag indicator for this patient
+36 DO FND^BQIFLFLG(DUZ,DFN,ADIEN)
+37 ;
+38 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+39 QUIT
+40 ;
ERR ;
+1 DO ^%ZTER
+2 NEW Y,ERRDTM
+3 SET Y=$$NOW^XLFDT()
XECUTE ^DD("DD")
SET ERRDTM=Y
+4 SET BMXSEC="Recording that an error occurred at "_ERRDTM
+5 IF $DATA(II)
IF $DATA(DATA)
SET II=II+1
SET @DATA@(II)=$CHAR(31)
+6 QUIT