AGGALTRG ;VNGT/HS/ALA-Alternate Resources Trigger ; 01 Oct 2010 11:00 AM
;;1.0;PATIENT REGISTRATION GUI;;Nov 15, 2010
;
;
RAB(DATA,DFN) ; EP -- AGG ROI AOB INIT TRIG
; Input
; DFN - Patient IEN
;
NEW UID,II,VALUE,SOURCE,HELP,TYPE,ABLE,REQ,CLEAR,HDR,PHREC,REC,RECPTR,X,END
NEW ACTIVE,AGSEL,AOPCOINS,DATEINEF,FAC,INSGEND,INSPTR,ISACTIVE,RELPOLHO
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("AGGALTRG",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="O"
;
I $$ROIMISS^AGEDERR4(DFN) D
. S SOURCE="AGGPTROI",REQ="R",VALUE="",ABLE="Y",TYPE="D",CLEAR="",HELP="Release of Information is missing" D UP
I $$AOBMISS^AGEDERR4(DFN) D
. S SOURCE="AGGPTAOB",REQ="R",VALUE="",ABLE="Y",TYPE="D",CLEAR="",HELP="Assignment of Benefits Missing" D UP
;
I $$ROIEXP^AGEDERR4(DFN) D
. S SOURCE="AGGPTROI",REQ="R",VALUE="",ABLE="Y",TYPE="D",CLEAR="AGGPTROI",HELP="Release of Information Expired past 1 year" D UP
I $$ROIEXP^AGEDERR1(DFN) D
. S SOURCE="AGGPTROI",REQ="O",VALUE="",ABLE="Y",TYPE="D",CLEAR="",HELP="Release of Information Expired past 1 year" D UP
;
I $$AOBDUE^AGEDERR4(DFN) D
. S SOURCE="AGGPTAOB",REQ="R",VALUE="",ABLE="Y",TYPE="D",CLEAR="AGGPTAOB",HELP="AOB expired (past one year) or AOB comes before eligibility start date" D UP
I $$AOBDUE^AGEDERR1(DFN) D
. S SOURCE="AGGPTAOB",REQ="O",VALUE="",ABLE="Y",TYPE="D",CLEAR="",HELP="AOB expired (past one year) or AOB comes before eligibility start date" D UP
;
DONE ;
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
;
ROI(ROI) ;EP - Return error (RESULT=-1, MSG=ERROR MESSAGE) for ROI issues
I $$RQROI^AGEDERR4(DUZ(2)),ROI="" Q "-1^Release of Information is Required"
I ROI="" Q ""
S ROI=$$DATE^AGGUL1(ROI)
I ROI>DT Q "-1^The Release of Information date cannot be in the future."
Q ""
AGGALTRG ;VNGT/HS/ALA-Alternate Resources Trigger ; 01 Oct 2010 11:00 AM
+1 ;;1.0;PATIENT REGISTRATION GUI;;Nov 15, 2010
+2 ;
+3 ;
RAB(DATA,DFN) ; EP -- AGG ROI AOB INIT TRIG
+1 ; Input
+2 ; DFN - Patient IEN
+3 ;
+4 NEW UID,II,VALUE,SOURCE,HELP,TYPE,ABLE,REQ,CLEAR,HDR,PHREC,REC,RECPTR,X,END
+5 NEW ACTIVE,AGSEL,AOPCOINS,DATEINEF,FAC,INSGEND,INSPTR,ISACTIVE,RELPOLHO
+6 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+7 SET DATA=$NAME(^TMP("AGGALTRG",UID))
+8 KILL @DATA
+9 SET II=0
+10 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^AGGWTRIG D UNWIND^%ZTER"
+11 DO HDR
+12 SET @DATA@(II)=HDR_$CHAR(30)
SET REQ="O"
+13 ;
+14 IF $$ROIMISS^AGEDERR4(DFN)
Begin DoDot:1
+15 SET SOURCE="AGGPTROI"
SET REQ="R"
SET VALUE=""
SET ABLE="Y"
SET TYPE="D"
SET CLEAR=""
SET HELP="Release of Information is missing"
DO UP
End DoDot:1
+16 IF $$AOBMISS^AGEDERR4(DFN)
Begin DoDot:1
+17 SET SOURCE="AGGPTAOB"
SET REQ="R"
SET VALUE=""
SET ABLE="Y"
SET TYPE="D"
SET CLEAR=""
SET HELP="Assignment of Benefits Missing"
DO UP
End DoDot:1
+18 ;
+19 IF $$ROIEXP^AGEDERR4(DFN)
Begin DoDot:1
+20 SET SOURCE="AGGPTROI"
SET REQ="R"
SET VALUE=""
SET ABLE="Y"
SET TYPE="D"
SET CLEAR="AGGPTROI"
SET HELP="Release of Information Expired past 1 year"
DO UP
End DoDot:1
+21 IF $$ROIEXP^AGEDERR1(DFN)
Begin DoDot:1
+22 SET SOURCE="AGGPTROI"
SET REQ="O"
SET VALUE=""
SET ABLE="Y"
SET TYPE="D"
SET CLEAR=""
SET HELP="Release of Information Expired past 1 year"
DO UP
End DoDot:1
+23 ;
+24 IF $$AOBDUE^AGEDERR4(DFN)
Begin DoDot:1
+25 SET SOURCE="AGGPTAOB"
SET REQ="R"
SET VALUE=""
SET ABLE="Y"
SET TYPE="D"
SET CLEAR="AGGPTAOB"
SET HELP="AOB expired (past one year) or AOB comes before eligibility start date"
DO UP
End DoDot:1
+26 IF $$AOBDUE^AGEDERR1(DFN)
Begin DoDot:1
+27 SET SOURCE="AGGPTAOB"
SET REQ="O"
SET VALUE=""
SET ABLE="Y"
SET TYPE="D"
SET CLEAR=""
SET HELP="AOB expired (past one year) or AOB comes before eligibility start date"
DO UP
End DoDot:1
+28 ;
DONE ;
+1 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+2 QUIT
+3 ;
UP ;
+1 SET II=II+1
SET @DATA@(II)=SOURCE_U_TYPE_U_VALUE_U_ABLE_U_$GET(REQ)_U_$GET(CLEAR)_U_HELP_$CHAR(30)
+2 QUIT
+3 ;
HDR ;
+1 SET HDR="T00008SOURCE^T00001CODE_TYPE^T01024PARMS^T00001ABLE_FLAG^T00001REQ_OPT^T00100CLEAR_FIELDS^T00200HELP_TEXT"
+2 QUIT
+3 ;
ROI(ROI) ;EP - Return error (RESULT=-1, MSG=ERROR MESSAGE) for ROI issues
+1 IF $$RQROI^AGEDERR4(DUZ(2))
IF ROI=""
QUIT "-1^Release of Information is Required"
+2 IF ROI=""
QUIT ""
+3 SET ROI=$$DATE^AGGUL1(ROI)
+4 IF ROI>DT
QUIT "-1^The Release of Information date cannot be in the future."
+5 QUIT ""