BQIVFTRH ;PRXM/HC/ALA-Trigger Health Factor ; 23 Aug 2007 3:55 PM
;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
Q
;
EN(DATA,CAT) ;EP - BQI VFILE TRIGGER FACTOR for a category
;
; Input
; CAT - Health Factor Category IEN
;
NEW UID,II,PARMS,DA,IENS,NM,VALUE
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQIVFTRH",UID))
K @DATA
S II=0,CAT=$G(CAT,"")
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIVFTRH D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
S SOURCE="APCDTHF"
S @DATA@(II)="T00008SOURCE^T00001CODE_TYPE^T01024PARMS"_$C(30)
S IEN=0,NAME="IEN=",VALUE=""
F S IEN=$O(^AUTTHF(IEN)) Q:'IEN D
. I $$GET1^DIQ(9999999.64,IEN,.13,"I")=1 Q
. I CAT'="",$$GET1^DIQ(9999999.64,IEN,.03,"I")'=CAT Q
. I $$GET1^DIQ(9999999.64,IEN,.1,"I")'="F" Q
. S VALUE=VALUE_IEN_$C(29)_$$GET1^DIQ(9999999.64,IEN,.01,"E")_$C(28)
S VALUE=$$TKO^BQIUL1(VALUE,$C(28))
S II=II+1,@DATA@(II)=SOURCE_U_"C"_U_VALUE_$C(30)
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
BQIVFTRH ;PRXM/HC/ALA-Trigger Health Factor ; 23 Aug 2007 3:55 PM
+1 ;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
+2 QUIT
+3 ;
EN(DATA,CAT) ;EP - BQI VFILE TRIGGER FACTOR for a category
+1 ;
+2 ; Input
+3 ; CAT - Health Factor Category IEN
+4 ;
+5 NEW UID,II,PARMS,DA,IENS,NM,VALUE
+6 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+7 SET DATA=$NAME(^TMP("BQIVFTRH",UID))
+8 KILL @DATA
+9 SET II=0
SET CAT=$GET(CAT,"")
+10 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQIVFTRH D UNWIND^%ZTER"
+11 SET SOURCE="APCDTHF"
+12 SET @DATA@(II)="T00008SOURCE^T00001CODE_TYPE^T01024PARMS"_$CHAR(30)
+13 SET IEN=0
SET NAME="IEN="
SET VALUE=""
+14 FOR
SET IEN=$ORDER(^AUTTHF(IEN))
IF 'IEN
QUIT
Begin DoDot:1
+15 IF $$GET1^DIQ(9999999.64,IEN,.13,"I")=1
QUIT
+16 IF CAT'=""
IF $$GET1^DIQ(9999999.64,IEN,.03,"I")'=CAT
QUIT
+17 IF $$GET1^DIQ(9999999.64,IEN,.1,"I")'="F"
QUIT
+18 SET VALUE=VALUE_IEN_$CHAR(29)_$$GET1^DIQ(9999999.64,IEN,.01,"E")_$CHAR(28)
End DoDot:1
+19 SET VALUE=$$TKO^BQIUL1(VALUE,$CHAR(28))
+20 SET II=II+1
SET @DATA@(II)=SOURCE_U_"C"_U_VALUE_$CHAR(30)
+21 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+22 QUIT
+23 ;
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