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

BTPWPEVC.m

Go to the documentation of this file.
BTPWPEVC ;VNGT/HS/ALA-Get the tracked events - Continued ; 21 Sep 2009  12:00 PM
 ;;1.0;CARE MANAGEMENT EVENT TRACKING;;Feb 07, 2011
 ;
RES(DATA,CMIEN) ; EP -- BTPW GET EVENT RESULTS
 NEW UID,II,HDR,BN
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BTPWPERS",UID))
 K @DATA
 ;
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BTPWPEVC D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S HDR="I00010RSIEN^D00030RESULT_DATETIME^T00050RESULT^T00035ENTERED_BY^T00003FOLLOWUP^T01024RES_COMMENT"
 S @DATA@(II)=HDR_$C(30)
 S BN=0
 F  S BN=$O(^BTPWP(CMIEN,5,BN)) Q:'BN  D
 . NEW DA,IENS,RSDT,RES,RWHO,FOL,RCN,RCOMM
 . S DA(1)=CMIEN,DA=BN,IENS=$$IENS^DILF(.DA)
 . S RSDT=$$FMTE^BQIUL1($$GET1^DIQ(90620.05,IENS,.01,"I"))
 . S RES=$$GET1^DIQ(90620.05,IENS,.02,"E")
 . S RWHO=$$GET1^DIQ(90620.05,IENS,.03,"E")
 . S FOL="N" I $O(^BTPWP(CMIEN,5,BN,5,0))'="" S FOL="Y"
 . S RCOMM=""
 . S RCN=0
 . F  S RCN=$O(^BTPWP(CMIEN,5,BN,1,RCN)) Q:'RCN  D
 .. S RCOMM=RCOMM_^BTPWP(CMIEN,5,BN,1,RCN,0)_$C(10)
 . S II=II+1,@DATA@(II)=BN_U_RSDT_U_RES_U_RWHO_U_FOL_U_RCOMM_$C(30)
 ;
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
FOL(DATA,CMIEN,RSIEN) ; EP -- BTPW GET EVENT FOLLOWUPS
 NEW UID,II,BN,HDR
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BTPWPEFL",UID))
 K @DATA
 ;
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BTPWPEVC D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S HDR="I00010FLIEN^D00030FOLLOW_DATETIME^T00050FOL_TYPE^T00035FWHO^D00030FOLLOW_DUE^T00001NOTIFICATION^T01024FOL_COMMENT"
 S @DATA@(II)=HDR_$C(30)
 S BN=0
 F  S BN=$O(^BTPWP(CMIEN,5,RSIEN,5,BN)) Q:'BN  D
 . NEW DA,FCN,FCOMM,FLDT,FOL,FWHO,FDUE,IENS,NOT
 . S DA(2)=CMIEN,DA(1)=RSIEN,DA=BN,IENS=$$IENS^DILF(.DA)
 . S FLDT=$$FMTE^BQIUL1($$GET1^DIQ(90620.55,IENS,.01,"I"))
 . S FOL=$$GET1^DIQ(90620.55,IENS,.02,"E")
 . S FWHO=$$GET1^DIQ(90620.55,IENS,.03,"E")
 . S FDUE=$$FMTE^BQIUL1($$GET1^DIQ(90620.55,IENS,.04,"I"))
 . S NOT="N" I $O(^BTPWP(CMIEN,5,RSIEN,5,BN,5,0))'="" S NOT="Y"
 . S FCOMM=""
 . S FCN=0
 . F  S FCN=$O(^BTPWP(CMIEN,5,RSIEN,5,BN,1,FCN)) Q:'FCN  D
 .. S FCOMM=FCOMM_^BTPWP(CMIEN,5,RSIEN,5,BN,1,FCN,0)_$C(10)
 . S II=II+1,@DATA@(II)=BN_U_FLDT_U_FOL_U_FWHO_U_FDUE_U_NOT_U_FCOMM_$C(30)
 ;
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
NOT(DATA,CMIEN,RSIEN,FLIEN) ; EP -- BTPW GET EVENT NOTIFICATIONS
 NEW UID,HDR,II,BN
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BTPWPENT",UID))
 K @DATA
 ;
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BTPWPEVC D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S HDR="I00010NTIEN^D00030NOT_DATETIME^T00030NOT_TYPE^T00035NOT_BY^D00030NOT_DUE^I00010TIUIEN^T00060DOCUMENT^T01024NOT_COMMENT"
 S @DATA@(II)=HDR_$C(30)
 S BN=0
 F  S BN=$O(^BTPWP(CMIEN,5,RSIEN,5,FLIEN,5,BN)) Q:'BN  D
 . NEW DA,DOC,IENS,NTDT,NOT,NWHO,NDUE,TIUIEN,NCOMM,NCN
 . S DA(3)=CMIEN,DA(2)=RSIEN,DA(1)=FLIEN,DA=BN,IENS=$$IENS^DILF(.DA)
 . S NTDT=$$FMTE^BQIUL1($$GET1^DIQ(90620.555,IENS,.01,"I"))
 . S NOT=$$GET1^DIQ(90620.555,IENS,.02,"E")
 . S NWHO=$$GET1^DIQ(90620.555,IENS,.03,"E")
 . S NDUE=$$FMTE^BQIUL1($$GET1^DIQ(90620.555,IENS,.04,"I"))
 . S TIUIEN=$$GET1^DIQ(90620.555,IENS,.05,"I")
 . S DOC=$$GET1^DIQ(90620.555,IENS,.05,"E")
 . S NCOMM=""
 . S NCN=0
 . F  S NCN=$O(^BTPWP(CMIEN,5,RSIEN,5,FLIEN,5,BN,1,NCN)) Q:'NCN  D
 .. S NCOMM=NCOMM_^BTPWP(CMIEN,5,RSIEN,5,FLIEN,BN,1,NCN,0)_$C(10)
 . S II=II+1,@DATA@(II)=BN_U_NTDT_U_NOT_U_NWHO_U_NDUE_U_TIUIEN_U_DOC_U_NCOMM_$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
 S II=II+1,@DATA@(II)=$C(31)
 Q