BTPWVTRG ;VNGT/HS/ALA-CMET Triggers ; 04 Nov 2009 10:20 AM
;;1.0;CARE MANAGEMENT EVENT TRACKING;;Feb 07, 2011
;
;
STT(BTPWSTGE) ;EP - State Trigger
NEW UID,II,VALUE,SOURCE,HELP,ABLE,REQ,CLEAR,TYPE
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BTPWVTRG",UID))
K @DATA
S II=0
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BTPWVTRG D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
D HDR
I BTPWSTGE="C" D
. S SOURCE="BTPCLREA",VALUE="",HELP="",ABLE="Y",REQ="R",CLEAR="",TYPE="T" D REC
. S SOURCE="BTPOTCOM",VALUE="",HELP="",ABLE="Y",REQ="O",CLEAR="",TYPE="W" D REC
I BTPWSTGE="O" D
. S SOURCE="BTPCLREA",VALUE="",HELP="",ABLE="N",REQ="R",CLEAR="BTPCLREA;BTPOTCOM",TYPE="T" D REC
. S SOURCE="BTPOTCOM",VALUE="",HELP="",ABLE="N",REQ="O",CLEAR="",TYPE="W" D REC
S II=II+1,@DATA@(II)=$C(31)
Q
;
FOL(BTPFLND) ; EP - Followup Needed
NEW UID,II,VALUE,SOURCE,HELP,ABLE,REQ,CLEAR,TYPE
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BTPWVTRG",UID))
K @DATA
S II=0
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BTPWVTRG D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
D HDR
I BTPFLND="Y" D
. S SOURCE="BTPWFU",VALUE="",HELP="",ABLE="Y",REQ="R",CLEAR="",TYPE="T" D REC
I BTPFLND="N" D
. S SOURCE="BTPWFU",VALUE="",HELP="",ABLE="N",REQ="O",CLEAR="",TYPE="T" D REC
S II=II+1,@DATA@(II)=$C(31)
Q
;
NTIU(BTPNOTFY) ; EP - TIU needed
NEW UID,II,VALUE,SOURCE,HELP,ABLE,REQ,CLEAR,TYPE
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BTPWVTRG",UID))
K @DATA
S II=0
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BTPWVTRG D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
D HDR
I BTPNOTFY="L" D
. S SOURCE="BTPNTDC",VALUE="",HELP="",ABLE="Y",REQ="R",CLEAR="",TYPE="T" D REC
. S SOURCE="BTPNTTM",VALUE="",HELP="",ABLE="Y",REQ="R",CLEAR="",TYPE="T" D REC
. S SOURCE="BTPSIGN",VALUE="",HELP="",ABLE="Y",REQ="R",CLEAR="",TYPE="P" D REC
I BTPFLND'="L" D
. S SOURCE="BTPNTDC",VALUE="",HELP="",ABLE="N",REQ="O",CLEAR="BTPNTTM;BTPSIGN",TYPE="T" D REC
. S SOURCE="BTPNTTM",VALUE="",HELP="",ABLE="N",REQ="O",CLEAR="",TYPE="T" D REC
. S SOURCE="BTPSIGN",VALUE="",HELP="",ABLE="N",REQ="O",CLEAR="",TYPE="P" D REC
S II=II+1,@DATA@(II)=$C(31)
Q
;
DONE ;
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
;
HDR ; Header
S @DATA@(II)="T00008SOURCE^T00001CODE_TYPE^T01024PARMS^T00030PROP_VALUE^T00001ABLE_FLAG^T00001REQ_OPT^T00200HELP_TEXT^T01024CLEAR_FIELDS"_$C(30)
Q
;
REC ; Record
S II=II+1,@DATA@(II)=SOURCE_U_TYPE_U_VALUE_U_U_ABLE_U_REQ_U_HELP_U_CLEAR_$C(30)
Q
BTPWVTRG ;VNGT/HS/ALA-CMET Triggers ; 04 Nov 2009 10:20 AM
+1 ;;1.0;CARE MANAGEMENT EVENT TRACKING;;Feb 07, 2011
+2 ;
+3 ;
STT(BTPWSTGE) ;EP - State Trigger
+1 NEW UID,II,VALUE,SOURCE,HELP,ABLE,REQ,CLEAR,TYPE
+2 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+3 SET DATA=$NAME(^TMP("BTPWVTRG",UID))
+4 KILL @DATA
+5 SET II=0
+6 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BTPWVTRG D UNWIND^%ZTER"
+7 ;
+8 DO HDR
+9 IF BTPWSTGE="C"
Begin DoDot:1
+10 SET SOURCE="BTPCLREA"
SET VALUE=""
SET HELP=""
SET ABLE="Y"
SET REQ="R"
SET CLEAR=""
SET TYPE="T"
DO REC
+11 SET SOURCE="BTPOTCOM"
SET VALUE=""
SET HELP=""
SET ABLE="Y"
SET REQ="O"
SET CLEAR=""
SET TYPE="W"
DO REC
End DoDot:1
+12 IF BTPWSTGE="O"
Begin DoDot:1
+13 SET SOURCE="BTPCLREA"
SET VALUE=""
SET HELP=""
SET ABLE="N"
SET REQ="R"
SET CLEAR="BTPCLREA;BTPOTCOM"
SET TYPE="T"
DO REC
+14 SET SOURCE="BTPOTCOM"
SET VALUE=""
SET HELP=""
SET ABLE="N"
SET REQ="O"
SET CLEAR=""
SET TYPE="W"
DO REC
End DoDot:1
+15 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+16 QUIT
+17 ;
FOL(BTPFLND) ; EP - Followup Needed
+1 NEW UID,II,VALUE,SOURCE,HELP,ABLE,REQ,CLEAR,TYPE
+2 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+3 SET DATA=$NAME(^TMP("BTPWVTRG",UID))
+4 KILL @DATA
+5 SET II=0
+6 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BTPWVTRG D UNWIND^%ZTER"
+7 ;
+8 DO HDR
+9 IF BTPFLND="Y"
Begin DoDot:1
+10 SET SOURCE="BTPWFU"
SET VALUE=""
SET HELP=""
SET ABLE="Y"
SET REQ="R"
SET CLEAR=""
SET TYPE="T"
DO REC
End DoDot:1
+11 IF BTPFLND="N"
Begin DoDot:1
+12 SET SOURCE="BTPWFU"
SET VALUE=""
SET HELP=""
SET ABLE="N"
SET REQ="O"
SET CLEAR=""
SET TYPE="T"
DO REC
End DoDot:1
+13 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+14 QUIT
+15 ;
NTIU(BTPNOTFY) ; EP - TIU needed
+1 NEW UID,II,VALUE,SOURCE,HELP,ABLE,REQ,CLEAR,TYPE
+2 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+3 SET DATA=$NAME(^TMP("BTPWVTRG",UID))
+4 KILL @DATA
+5 SET II=0
+6 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BTPWVTRG D UNWIND^%ZTER"
+7 ;
+8 DO HDR
+9 IF BTPNOTFY="L"
Begin DoDot:1
+10 SET SOURCE="BTPNTDC"
SET VALUE=""
SET HELP=""
SET ABLE="Y"
SET REQ="R"
SET CLEAR=""
SET TYPE="T"
DO REC
+11 SET SOURCE="BTPNTTM"
SET VALUE=""
SET HELP=""
SET ABLE="Y"
SET REQ="R"
SET CLEAR=""
SET TYPE="T"
DO REC
+12 SET SOURCE="BTPSIGN"
SET VALUE=""
SET HELP=""
SET ABLE="Y"
SET REQ="R"
SET CLEAR=""
SET TYPE="P"
DO REC
End DoDot:1
+13 IF BTPFLND'="L"
Begin DoDot:1
+14 SET SOURCE="BTPNTDC"
SET VALUE=""
SET HELP=""
SET ABLE="N"
SET REQ="O"
SET CLEAR="BTPNTTM;BTPSIGN"
SET TYPE="T"
DO REC
+15 SET SOURCE="BTPNTTM"
SET VALUE=""
SET HELP=""
SET ABLE="N"
SET REQ="O"
SET CLEAR=""
SET TYPE="T"
DO REC
+16 SET SOURCE="BTPSIGN"
SET VALUE=""
SET HELP=""
SET ABLE="N"
SET REQ="O"
SET CLEAR=""
SET TYPE="P"
DO REC
End DoDot:1
+17 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+18 QUIT
+19 ;
DONE ;
+1 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+2 QUIT
+3 ;
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
+7 ;
HDR ; Header
+1 SET @DATA@(II)="T00008SOURCE^T00001CODE_TYPE^T01024PARMS^T00030PROP_VALUE^T00001ABLE_FLAG^T00001REQ_OPT^T00200HELP_TEXT^T01024CLEAR_FIELDS"_$CHAR(30)
+2 QUIT
+3 ;
REC ; Record
+1 SET II=II+1
SET @DATA@(II)=SOURCE_U_TYPE_U_VALUE_U_U_ABLE_U_REQ_U_HELP_U_CLEAR_$CHAR(30)
+2 QUIT