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

AGGDCTRG.m

Go to the documentation of this file.
AGGDCTRG ;VNGT/HS/ALA-Document Triggers ; 26 May 2010  1:01 PM
 ;;1.0;PATIENT REGISTRATION GUI;;Nov 15, 2010
 ;
 ;
DOC(DATA,DFN) ; EP -- AGG DOCUMENTS TRIGGER
 ; Input
 ;   DFN      - Patient IEN
 ;
 NEW UID,II,VALUE,SOURCE,IEN,HELP,TYPE,ABLE,AGGPTACK,REQ
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("AGGTRDOC",UID))
 K @DATA
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^AGGWTRIG D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 D HDR
 S @DATA@(II)=HDR_$C(30),REQ="N"
 ;
 S AGGPTNPP=$$GET1^DIQ(9000038,DFN_",",.02,"E")
 I AGGPTNPP="YES" D
 . S VALUE=$$FMTE^AGGUL1($$GET1^DIQ(9000038,DFN_",",.03,"I"))
 . S SOURCE="AGGPTNPD",ABLE="Y",TYPE="D",CLEAR="",HELP="" D UP
 I AGGPTNPP="NO" S SOURCE="AGGPTNPD",ABLE="N",TYPE="D",CLEAR="AGGPTNPD",HELP="",VALUE="N" D UP
 ; 
 S AGGPTACK=$$GET1^DIQ(9000038,DFN_",",.04,"E")
 I AGGPTACK="NO" D
 . S VALUE=$$GET1^DIQ(9000038,DFN_",",.05,"E")
 . S SOURCE="AGGPTAKN",ABLE="Y",TYPE="X",CLEAR="",HELP="Enter a reason patient did not sign the acknowledgement" D UP
 I AGGPTACK="YES" S SOURCE="AGGPTAKN",ABLE="N",TYPE="X",CLEAR="AGGPTAKN",HELP="",VALUE="" D UP
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
NPP(DATA,AGGPTNPP) ; EP -- AGG NPP TRIGGER
 ; Input
 ;   AGGPTNP - Notice of Privacy Practice
 ;
 NEW UID,II,VALUE,SOURCE,IEN,HELP,TYPE,ABLE,REQ
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("AGGTRNPP",UID))
 K @DATA
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^AGGWTRIG D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 D HDR
 S @DATA@(II)=HDR_$C(30),REQ="N"
 I $E(AGGPTNPP,1)="Y" D
 . S SOURCE="AGGPTNPD",ABLE="Y",TYPE="D",CLEAR="",HELP="",VALUE="",REQ="R" D UP
 I $E(AGGPTNPP,1)="N" S SOURCE="AGGPTNPD",ABLE="N",TYPE="D",CLEAR="AGGPTNPD",HELP="",VALUE="" D UP
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
ACK(DATA,ACK) ; EP -- AGG ACKNOWLEDGE TRIGGER
 ; Input
 ;   ACK   - Acknowledgement Signed
 ;
 NEW UID,II,VALUE,SOURCE,IEN,HELP,TYPE,ABLE,REQ
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("AGGTRACK",UID))
 K @DATA
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^AGGWTRIG D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 D HDR
 S @DATA@(II)=HDR_$C(30),REQ="N"
 I $E(ACK,1)="N" D
 . S SOURCE="AGGPTAKN",ABLE="Y",TYPE="X",CLEAR="",HELP="Enter a reason patient did not sign the acknowledgement",VALUE="" D UP
 I $E(ACK,1)="Y" S SOURCE="AGGPTAKN",ABLE="N",TYPE="X",CLEAR="AGGPTAKN",HELP="",VALUE="" D UP
 ;
 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
 ;
UP ;
 S II=II+1,@DATA@(II)=SOURCE_U_TYPE_U_VALUE_U_ABLE_U_$G(REQ)_U_$G(CLEAR)_U_HELP_$C(30)
 Q
 ;
HDR ;
 S HDR="T00008SOURCE^T00001CODE_TYPE^T01024PARMS^T00001ABLE_FLAG^T00001REQ_OPT^T00100CLEAR_FIELDS^T00200HELP_TEXT"
 Q