Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BTPWVTRG

BTPWVTRG.m

Go to the documentation of this file.
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