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

AGGMCTRG.m

Go to the documentation of this file.
AGGMCTRG ;VNGT/HS/KDC-Medicare Triggers ; 26 May 2010  11:06 AM
 ;;1.0;PATIENT REGISTRATION GUI;;Nov 15, 2010
 ;
ECCOV(DATA,DFN,AGGMCCOV,AGGMCNME,AGGMCNUM,AGGMCDOB) ; EP -- AGG MEDICARE PART D TRIGGER
 ; Input
 ;   AGGMCCOV - Type of Medicare coverage
 ;   AGGMCNME - Medicare Name - From Parent Form
 ;   AGGMCNUM - Medicare Number - From Parent Form
 ;   AGGMCDOB - Medicare DOB - From Parent Form
 ;
 NEW UID,II,VALUE,SOURCE,IEN,HELP,TYPE,ABLE,ECREL,REQ,VISIBLE
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("AGGMCTRG",UID))
 K @DATA
 S II=0
 S AGGMCCOV=$G(AGGMCCOV)
 S AGGMCNME=$G(AGGMCNME)
 S AGGMCNUM=$G(AGGMCNUM)
 S AGGMCDOB=$G(AGGMCDOB) S:AGGMCDOB]"" AGGMCDOB=$$DATE^AGGUL1(AGGMCDOB)
 ;
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^AGGMCTRG D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 D HDR
 S @DATA@(II)=HDR_$C(30)
 ;
 ;Type of Coverage is Blank
 I AGGMCCOV="" D  G XECCOV
 . S SOURCE="AGGMCESD",VALUE="",ABLE="N",TYPE="D",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMCEED",VALUE="",ABLE="N",TYPE="D",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMCPN",VALUE="",ABLE="N",TYPE="T",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMCMN",VALUE="",ABLE="N",TYPE="X",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMCIDN",VALUE="",ABLE="N",TYPE="X",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMCPC",VALUE="",ABLE="N",TYPE="X",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMCG",VALUE="",ABLE="N",TYPE="C",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMRDOB",VALUE="",ABLE="N",TYPE="D",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMCGN",VALUE="",ABLE="N",TYPE="T",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 ;
 ;Type of coverage is not Part D
 I AGGMCCOV'="D" D  G XECCOV
 . S SOURCE="AGGMCESD",VALUE="",ABLE="Y",TYPE="D",CLEAR="",HELP="",REQ="",VISIBLE="Y" D UP
 . S SOURCE="AGGMCEED",VALUE="",ABLE="Y",TYPE="D",CLEAR="",HELP="",REQ="",VISIBLE="Y" D UP
 . S SOURCE="AGGMCPN",VALUE="",ABLE="N",TYPE="T",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMCMN",VALUE="",ABLE="N",TYPE="X",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMCIDN",VALUE="",ABLE="N",TYPE="X",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMCPC",VALUE="",ABLE="N",TYPE="X",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMCG",VALUE="",ABLE="N",TYPE="C",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMRDOB",VALUE="",ABLE="N",TYPE="D",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMCGN",VALUE="",ABLE="N",TYPE="T",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 ;
 ;Type of coverage is Part D
 I AGGMCCOV="D" D
 . S SOURCE="AGGMCESD",ABLE="Y",TYPE="D",CLEAR="",HELP="",VALUE="",REQ="",VISIBLE="Y" D UP
 . S SOURCE="AGGMCEED",ABLE="Y",TYPE="D",CLEAR="",HELP="",VALUE="",REQ="",VISIBLE="Y" D UP
 . S SOURCE="AGGMCPN",ABLE="Y",TYPE="T",CLEAR="",HELP="",VALUE="",REQ="R",VISIBLE="Y" D UP
 . S SOURCE="AGGMCMN",ABLE="Y",TYPE="X",CLEAR="",HELP="",VALUE=$$MCNM(DFN,AGGMCNME),REQ="",VISIBLE="Y" D UP
 . S SOURCE="AGGMCIDN",ABLE="Y",TYPE="X",CLEAR="",HELP="",VALUE=AGGMCNUM,REQ="",VISIBLE="Y" D UP
 . S SOURCE="AGGMCPC",ABLE="Y",TYPE="X",CLEAR="",HELP="",VALUE="",REQ="",VISIBLE="Y" D UP
 . S SOURCE="AGGMCG",ABLE="Y",TYPE="C",CLEAR="",HELP="",VALUE=$$MGND(DFN),REQ="",VISIBLE="Y" D UP
 . S SOURCE="AGGMRDOB",ABLE="Y",TYPE="D",CLEAR="",HELP="",VALUE=$$MCDOB(DFN,AGGMCDOB),REQ="",VISIBLE="Y" D UP
 . S SOURCE="AGGMCGN",ABLE="Y",TYPE="T",CLEAR="",HELP="",VALUE="",REQ="",VISIBLE="Y" D UP
 ;
XECCOV S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
MGND(DFN) ;EP - Return Gender
 Q $$GET1^DIQ(2,DFN_",",.02,"I")
 ;
MCNM(DFN,AGGMCNME) ;EP - Medicare Name - Plug in parent form value and if blank - Patient File name
 I AGGMCNME]"" Q AGGMCNME
 E  Q $$GET1^DIQ(2,DFN_",",.01,"E")
 ;
MCDOB(DFN,AGGMCDOB) ;EP - Date of Birth - Plug in parent value and if blank - Patient File value
 I AGGMCDOB]"" Q $$FMTE^AGGUL1(AGGMCDOB)
 E  Q $$FMTE^AGGUL1($P($G(^DPT(DFN,0)),U,3))
 ;
ELG(DATA,AGGMCCOV) ; EP -- AGG MEDICARE ELIG TRIGGER
 ; Input
 ;   AGGMCCOV - Coverage Type
 ;
 NEW UID,II,VALUE,SOURCE,IEN,HELP,TYPE,ABLE,ECREL,REQ,VISIBLE
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("AGGMCTRG",UID))
 K @DATA
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^AGGMCTRG D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 D HDR
 S @DATA@(II)=HDR_$C(30)
 ;
 ;Type of Coverage is Blank
 S AGGMCCOV=$G(AGGMCCOV)
 I AGGMCCOV="" D  G XECCOV
 . S SOURCE="AGGMCESD",VALUE="",ABLE="N",TYPE="D",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMCEED",VALUE="",ABLE="N",TYPE="D",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMCPN",VALUE="",ABLE="N",TYPE="T",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMCMN",VALUE="",ABLE="N",TYPE="X",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMCIDN",VALUE="",ABLE="N",TYPE="X",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMCPC",VALUE="",ABLE="N",TYPE="X",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMCG",VALUE="",ABLE="N",TYPE="C",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMRDOB",VALUE="",ABLE="N",TYPE="D",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMCGN",VALUE="",ABLE="N",TYPE="T",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 ;
 ;Type of coverage is not Part D
 I AGGMCCOV'="D" D  G XECCOV
 . S SOURCE="AGGMCESD",VALUE="",ABLE="Y",TYPE="D",CLEAR="",HELP="",REQ="",VISIBLE="" D UP
 . S SOURCE="AGGMCEED",VALUE="",ABLE="Y",TYPE="D",CLEAR="",HELP="",REQ="",VISIBLE="" D UP
 . S SOURCE="AGGMCPN",VALUE="",ABLE="N",TYPE="T",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMCMN",VALUE="",ABLE="N",TYPE="X",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMCIDN",VALUE="",ABLE="N",TYPE="X",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMCPC",VALUE="",ABLE="N",TYPE="X",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMCG",VALUE="",ABLE="N",TYPE="C",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMRDOB",VALUE="",ABLE="N",TYPE="D",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 . S SOURCE="AGGMCGN",VALUE="",ABLE="N",TYPE="T",CLEAR="",HELP="",REQ="",VISIBLE="N" D UP
 ;
 ;Type of coverage is Part D
 I AGGMCCOV="D" D
 . S SOURCE="AGGMCESD",ABLE="Y",TYPE="D",CLEAR="",HELP="",VALUE="",REQ="",VISIBLE="Y" D UP
 . S SOURCE="AGGMCEED",ABLE="Y",TYPE="D",CLEAR="",HELP="",VALUE="",REQ="",VISIBLE="Y" D UP
 . S SOURCE="AGGMCPN",ABLE="Y",TYPE="T",CLEAR="",HELP="",VALUE="",REQ="R",VISIBLE="Y" D UP
 . S SOURCE="AGGMCMN",ABLE="Y",TYPE="X",CLEAR="",HELP="",VALUE="",REQ="",VISIBLE="Y" D UP
 . S SOURCE="AGGMCIDN",ABLE="Y",TYPE="X",CLEAR="",HELP="",VALUE="",REQ="",VISIBLE="Y" D UP
 . S SOURCE="AGGMCPC",ABLE="Y",TYPE="X",CLEAR="",HELP="",VALUE="",REQ="",VISIBLE="Y" D UP
 . S SOURCE="AGGMCG",ABLE="Y",TYPE="C",CLEAR="",HELP="",VALUE="",REQ="",VISIBLE="Y" D UP
 . S SOURCE="AGGMRDOB",ABLE="Y",TYPE="D",CLEAR="",HELP="",VALUE="",REQ="",VISIBLE="Y" D UP
 . S SOURCE="AGGMCGN",ABLE="Y",TYPE="T",CLEAR="",HELP="",VALUE="",REQ="",VISIBLE="Y" D UP
 ;
XELG 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_U_$G(VISIBLE)_$C(30)
 Q
 ;
HDR ;
 S HDR="T00008SOURCE^T00001CODE_TYPE^T01024PARMS^T00001ABLE_FLAG^T00001REQ_OPT^T00100CLEAR_FIELDS^T00200HELP_TEXT^T00001VISIBLE"
 Q