AGGWTRIG ;VNGT/HS/ALA - Window Triggers ; 07 Apr 2010 7:09 PM
;;1.0;PATIENT REGISTRATION GUI;;Nov 15, 2010
;
FORM(LNM,FNM,MNM) ;EP - Format Name
NEW NAME
S NAME=LNM_","_FNM_" "_MNM
K DG20NAME S DG20NAME=X,(X,DG20NAME)=$$FORMAT^DPTNAME(.DG20NAME,3,30)
K:'$L(X) X,DG20NAME S:$D(X) DGNEWVAL=X
Q
;
HDR ;
S HDR="T00008SOURCE^T00001CODE_TYPE^T01024PARMS^T00001ABLE_FLAG^T00100CLEAR_FIELDS^T00200HELP_TEXT^T00001VISIBLE"
Q
;
VET(DATA,DFN,AGGPTVET) ; EP -- AGG VETERAN TRIGGER
; Input
; DFN - Patient IEN
; AGGPTVET - Value of VETERAN (Y/N)?
;
NEW UID,II,VALUE,SOURCE,IEN,HELP,TYPE,ABLE,AGE,VISIBLE
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("AGGTRVET",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)
S AGGPTVET=$G(AGGPTVET)
I AGGPTVET="" S AGGPTVET=$$GET1^DIQ(2,DFN_",",1901,"I")
S AGE=$$AGE^AGGAGE(DFN) I AGE<17 S AGGPTVET="N"
S SOURCE="AGGPTVET"
F S SOURCE=$O(^AGG(9009068.3,5,10,"AC",SOURCE)) Q:SOURCE="" D
. S IEN=""
. F S IEN=$O(^AGG(9009068.3,5,10,"AC",SOURCE,IEN)) Q:IEN="" D
.. S HELP="",VALUE="",TYPE=$P($G(^AGG(9009068.3,5,10,IEN,1)),U,1)
.. S ABLE=$S(AGGPTVET="Y":"Y",1:"N") I ABLE="N" S CLEAR=SOURCE
.. D UP
;
S II=II+1,@DATA@(II)=$C(31)
Q
;
CLM(DATA,DFN,AGGVCLMN) ; EP - AGG VET CLAIM TRIGGER
NEW UID,II,VALUE,SOURCE,IEN,HELP,TYPE,ABLE,VISIBLE
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("AGGVTCLM",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)
I $G(AGGVCLMN)="SS" S VALUE=$P(^DPT(DFN,0),U,9)
I $G(AGGVCLMN)'="SS" S VALUE=$G(AGGVCLMN)
S SOURCE="AGGVCLMN",HELP="",TYPE="X",ABLE="Y" 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(CLEAR)_U_HELP_U_$G(VISIBLE)_$C(30)
Q
;
GRP(DATA,DEF,GROUP) ; EP -- AGG INSUR GROUP TRIGGER
NEW UID,II,VALUE,SOURCE,IEN,HELP,TYPE,ABLE,AGWIEN,FILE,VISIBLE
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("AGGTRGRP",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)
S AGWIEN=$$FIND1^DIC(9009068.3,"","BX",DEF,"","","ERROR")
S FILE=$P(^AGG(9009068.3,AGWIEN,0),U,2)
S SOURCE=$S(FILE=9000004:"AGGMDGRN",1:"AGGPIGRN")
S ABLE="Y",HELP="",VALUE="",TYPE="X"
I $G(GROUP)'="" S VALUE=$P($G(^AUTNEGRP(GROUP,0)),U,2)
D UP
;
S II=II+1,@DATA@(II)=$C(31)
Q
;
MIG(DATA,MGRNT) ;EP -- AGG MIGRNT TRIGGER
NEW UID,II,VALUE,SOURCE,IEN,HELP,TYPE,ABLE,AGWIEN,FILE,VISIBLE
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("AGGTRMIG",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)
S AGWIEN=$$FIND1^DIC(9009068.3,"","BX","Other Patient","","","ERROR")
S SOURCE="AGGMGTYP",IEN=$O(^AGG(9009068.3,AGWIEN,10,"AC",SOURCE,""))
S TYPE=$P($G(^AGG(9009068.3,AGWIEN,10,IEN,1)),"^",1)
S ABLE=$S($G(MGRNT)="Y":"Y",1:"N"),HELP="",VALUE=""
I TYPE="C"!(TYPE="K") D
. S CIEN=0
. F S CIEN=$O(^AGG(9009068.3,AGWIEN,10,IEN,5,CIEN)) Q:'CIEN D
.. NEW CDATA
.. S CDATA=^AGG(9009068.3,AGWIEN,10,IEN,5,CIEN,0)
.. S VALUE=VALUE_$P(CDATA,U,2)_$C(29)_$P(CDATA,U,1)_$C(28)
. S VALUE=$$TKO^AGGUL1(VALUE,$C(28))
D UP
;
S II=II+1,@DATA@(II)=$C(31)
Q
;
HOM(DATA,HMLS) ;EP -- AGG HOMELESS TRIGGER
NEW UID,II,VALUE,SOURCE,IEN,HELP,TYPE,ABLE,AGWIEN,FILE,VISIBLE
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("AGGTRHMLS",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)
S AGWIEN=$$FIND1^DIC(9009068.3,"","BX","Other Patient","","","ERROR")
S SOURCE="AGGHMTYP",IEN=$O(^AGG(9009068.3,AGWIEN,10,"AC",SOURCE,""))
S TYPE=$P($G(^AGG(9009068.3,AGWIEN,10,IEN,1)),"^",1)
S ABLE=$S($G(HMLS)="Y":"Y",1:"N"),HELP="",VALUE=""
I TYPE="C"!(TYPE="K") D
. S CIEN=0
. F S CIEN=$O(^AGG(9009068.3,AGWIEN,10,IEN,5,CIEN)) Q:'CIEN D
.. NEW CDATA
.. S CDATA=^AGG(9009068.3,AGWIEN,10,IEN,5,CIEN,0)
.. S VALUE=VALUE_$P(CDATA,U,2)_$C(29)_$P(CDATA,U,1)_$C(28)
. S VALUE=$$TKO^AGGUL1(VALUE,$C(28))
D UP
;
S II=II+1,@DATA@(II)=$C(31)
Q
;
COMM(DATA,DFN,COMM) ;EP - AGG COMMUNITY TRIGGER
NEW UID,II,VALUE,SOURCE,IEN,HELP,TYPE,ABLE,AGWIEN,FILE,DTMV,PCOMM,VISIBLE
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("AGGTRCOMM",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)
S DTMV=$O(^AUPNPAT(DFN,51,"A"),-1)
I +DTMV'=0 S PCOMM=$P(^AUPNPAT(DFN,51,DTMV,0),U,3)
S SOURCE="AGGPTCDT",TYPE="D",ABLE="Y" D
. I $G(PCOMM)="" S CLEAR="",HELP="",VALUE="" D UP Q
. I $G(PCOMM)=COMM S CLEAR="",HELP="",VALUE="" D UP Q
. S CLEAR="AGGPTCDT",HELP="",VALUE="" D UP
S SOURCE="AGGCMCNY",TYPE="X",HELP="",ABLE="Y",VALUE="",CLEAR=""
I $G(COMM)'="" S VALUE=$$GET1^DIQ(9999999.05,COMM_",",.02,"E") D UP
;
S II=II+1,@DATA@(II)=$C(31)
Q
;
DTM(DATA,DFN,DATE) ;EP - AGG DATE MOVED TRIGGER
NEW UID,II,VALUE,SOURCE,IEN,HELP,TYPE,ABLE,AGWIEN,FILE,VISIBLE
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("AGGTRDTM",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)
I DATE?.A S DATE=$$UP^XLFSTR(DATE)
I $E(DATE,1,1)="B" S DATE=$P(^DPT(DFN,0),U,3)
I $E(DATE,1,1)="T" S DATE=DT
S DATE=$$DATE^AGGUL1(DATE),DATE=$$FMTE^AGGUL1(DATE)
S SOURCE="AGGPTCDT",TYPE="D",ABLE="Y",CLEAR="",HELP="Enter 'B' for at birth, TODAY or any date format",VALUE=DATE
D UP
;
S II=II+1,@DATA@(II)=$C(31)
Q
;
MEM(DATA,DFN,AGGPIIEN,PINUM) ;EP - AGG POLICY MEMBER NUMBER TRIG
NEW UID,II,VALUE,SOURCE,IEN,HELP,TYPE,ABLE,MBNUM,VISIBLE
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("AGGPINMB",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)
;
I $G(AGGPIIEN)'="" D
. NEW IENS,DA
. S DA(1)=DFN,DA=AGGPIIEN,IENS=$$IENS^DILF(.DA)
. S MBNUM=$$GET1^DIQ(9000006.11,IENS,21,"E")
I $G(PINUM)'="",$G(MBNUM)="" S SOURCE="AGGPIMBN",TYPE="X",ABLE="Y",CLEAR="",HELP="",VALUE=PINUM D UP
;
S II=II+1,@DATA@(II)=$C(31)
Q
;
CTY(DATA,DFN,AGGPTCTY) ;EP - AGG CITY COMMUNITY TRIGGER
NEW UID,II,VALUE,SOURCE,IEN,HELP,TYPE,ABLE,AGWIEN,FILE,VISIBLE
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("AGGTRCOMM",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)
S CTY=$$GET1^DIQ(2,DFN_",",.114,"E")
I CTY'="",CTY'=$G(AGGPTCTY) D
. S SOURCE="AGGPTCOM",TYPE="D",ABLE="Y",CLEAR="AGGPTCOM",HELP="",VALUE="" D UP
. ;S SOURCE="AGGPTCDT",TYPE="D",ABLE="Y",CLEAR="AGGPTCDT",HELP="",VALUE="" D UP
. S SOURCE="AGGCMCNY",TYPE="X",ABLE="Y",CLEAR="AGGCMCNY",HELP="",VALUE="" D UP
;
S II=II+1,@DATA@(II)=$C(31)
Q
AGGWTRIG ;VNGT/HS/ALA - Window Triggers ; 07 Apr 2010 7:09 PM
+1 ;;1.0;PATIENT REGISTRATION GUI;;Nov 15, 2010
+2 ;
FORM(LNM,FNM,MNM) ;EP - Format Name
+1 NEW NAME
+2 SET NAME=LNM_","_FNM_" "_MNM
+3 KILL DG20NAME
SET DG20NAME=X
SET (X,DG20NAME)=$$FORMAT^DPTNAME(.DG20NAME,3,30)
+4 IF '$LENGTH(X)
KILL X,DG20NAME
IF $DATA(X)
SET DGNEWVAL=X
+5 QUIT
+6 ;
HDR ;
+1 SET HDR="T00008SOURCE^T00001CODE_TYPE^T01024PARMS^T00001ABLE_FLAG^T00100CLEAR_FIELDS^T00200HELP_TEXT^T00001VISIBLE"
+2 QUIT
+3 ;
VET(DATA,DFN,AGGPTVET) ; EP -- AGG VETERAN TRIGGER
+1 ; Input
+2 ; DFN - Patient IEN
+3 ; AGGPTVET - Value of VETERAN (Y/N)?
+4 ;
+5 NEW UID,II,VALUE,SOURCE,IEN,HELP,TYPE,ABLE,AGE,VISIBLE
+6 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+7 SET DATA=$NAME(^TMP("AGGTRVET",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)
+13 SET AGGPTVET=$GET(AGGPTVET)
+14 IF AGGPTVET=""
SET AGGPTVET=$$GET1^DIQ(2,DFN_",",1901,"I")
+15 SET AGE=$$AGE^AGGAGE(DFN)
IF AGE<17
SET AGGPTVET="N"
+16 SET SOURCE="AGGPTVET"
+17 FOR
SET SOURCE=$ORDER(^AGG(9009068.3,5,10,"AC",SOURCE))
IF SOURCE=""
QUIT
Begin DoDot:1
+18 SET IEN=""
+19 FOR
SET IEN=$ORDER(^AGG(9009068.3,5,10,"AC",SOURCE,IEN))
IF IEN=""
QUIT
Begin DoDot:2
+20 SET HELP=""
SET VALUE=""
SET TYPE=$PIECE($GET(^AGG(9009068.3,5,10,IEN,1)),U,1)
+21 SET ABLE=$SELECT(AGGPTVET="Y":"Y",1:"N")
IF ABLE="N"
SET CLEAR=SOURCE
+22 DO UP
End DoDot:2
End DoDot:1
+23 ;
+24 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+25 QUIT
+26 ;
CLM(DATA,DFN,AGGVCLMN) ; EP - AGG VET CLAIM TRIGGER
+1 NEW UID,II,VALUE,SOURCE,IEN,HELP,TYPE,ABLE,VISIBLE
+2 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+3 SET DATA=$NAME(^TMP("AGGVTCLM",UID))
+4 KILL @DATA
+5 SET II=0
+6 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^AGGWTRIG D UNWIND^%ZTER"
+7 DO HDR
+8 SET @DATA@(II)=HDR_$CHAR(30)
+9 IF $GET(AGGVCLMN)="SS"
SET VALUE=$PIECE(^DPT(DFN,0),U,9)
+10 IF $GET(AGGVCLMN)'="SS"
SET VALUE=$GET(AGGVCLMN)
+11 SET SOURCE="AGGVCLMN"
SET HELP=""
SET TYPE="X"
SET ABLE="Y"
DO UP
+12 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+13 QUIT
+14 ;
ERR ;
+1 DO ^%ZTER
+2 NEW Y,ERRDTM
+3 SET Y=$$NOW^XLFDT()
XECUTE ^DD("DD")
SET ERRDTM=Y
+4 SET BMXSEC="Recording that an error occurred at "_ERRDTM
+5 IF $DATA(II)
IF $DATA(DATA)
SET II=II+1
SET @DATA@(II)=$CHAR(31)
+6 QUIT
+7 ;
UP ;
+1 SET II=II+1
SET @DATA@(II)=SOURCE_U_TYPE_U_VALUE_U_ABLE_U_$GET(CLEAR)_U_HELP_U_$GET(VISIBLE)_$CHAR(30)
+2 QUIT
+3 ;
GRP(DATA,DEF,GROUP) ; EP -- AGG INSUR GROUP TRIGGER
+1 NEW UID,II,VALUE,SOURCE,IEN,HELP,TYPE,ABLE,AGWIEN,FILE,VISIBLE
+2 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+3 SET DATA=$NAME(^TMP("AGGTRGRP",UID))
+4 KILL @DATA
+5 SET II=0
+6 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^AGGWTRIG D UNWIND^%ZTER"
+7 DO HDR
+8 SET @DATA@(II)=HDR_$CHAR(30)
+9 SET AGWIEN=$$FIND1^DIC(9009068.3,"","BX",DEF,"","","ERROR")
+10 SET FILE=$PIECE(^AGG(9009068.3,AGWIEN,0),U,2)
+11 SET SOURCE=$SELECT(FILE=9000004:"AGGMDGRN",1:"AGGPIGRN")
+12 SET ABLE="Y"
SET HELP=""
SET VALUE=""
SET TYPE="X"
+13 IF $GET(GROUP)'=""
SET VALUE=$PIECE($GET(^AUTNEGRP(GROUP,0)),U,2)
+14 DO UP
+15 ;
+16 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+17 QUIT
+18 ;
MIG(DATA,MGRNT) ;EP -- AGG MIGRNT TRIGGER
+1 NEW UID,II,VALUE,SOURCE,IEN,HELP,TYPE,ABLE,AGWIEN,FILE,VISIBLE
+2 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+3 SET DATA=$NAME(^TMP("AGGTRMIG",UID))
+4 KILL @DATA
+5 SET II=0
+6 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^AGGWTRIG D UNWIND^%ZTER"
+7 DO HDR
+8 SET @DATA@(II)=HDR_$CHAR(30)
+9 SET AGWIEN=$$FIND1^DIC(9009068.3,"","BX","Other Patient","","","ERROR")
+10 SET SOURCE="AGGMGTYP"
SET IEN=$ORDER(^AGG(9009068.3,AGWIEN,10,"AC",SOURCE,""))
+11 SET TYPE=$PIECE($GET(^AGG(9009068.3,AGWIEN,10,IEN,1)),"^",1)
+12 SET ABLE=$SELECT($GET(MGRNT)="Y":"Y",1:"N")
SET HELP=""
SET VALUE=""
+13 IF TYPE="C"!(TYPE="K")
Begin DoDot:1
+14 SET CIEN=0
+15 FOR
SET CIEN=$ORDER(^AGG(9009068.3,AGWIEN,10,IEN,5,CIEN))
IF 'CIEN
QUIT
Begin DoDot:2
+16 NEW CDATA
+17 SET CDATA=^AGG(9009068.3,AGWIEN,10,IEN,5,CIEN,0)
+18 SET VALUE=VALUE_$PIECE(CDATA,U,2)_$CHAR(29)_$PIECE(CDATA,U,1)_$CHAR(28)
End DoDot:2
+19 SET VALUE=$$TKO^AGGUL1(VALUE,$CHAR(28))
End DoDot:1
+20 DO UP
+21 ;
+22 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+23 QUIT
+24 ;
HOM(DATA,HMLS) ;EP -- AGG HOMELESS TRIGGER
+1 NEW UID,II,VALUE,SOURCE,IEN,HELP,TYPE,ABLE,AGWIEN,FILE,VISIBLE
+2 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+3 SET DATA=$NAME(^TMP("AGGTRHMLS",UID))
+4 KILL @DATA
+5 SET II=0
+6 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^AGGWTRIG D UNWIND^%ZTER"
+7 DO HDR
+8 SET @DATA@(II)=HDR_$CHAR(30)
+9 SET AGWIEN=$$FIND1^DIC(9009068.3,"","BX","Other Patient","","","ERROR")
+10 SET SOURCE="AGGHMTYP"
SET IEN=$ORDER(^AGG(9009068.3,AGWIEN,10,"AC",SOURCE,""))
+11 SET TYPE=$PIECE($GET(^AGG(9009068.3,AGWIEN,10,IEN,1)),"^",1)
+12 SET ABLE=$SELECT($GET(HMLS)="Y":"Y",1:"N")
SET HELP=""
SET VALUE=""
+13 IF TYPE="C"!(TYPE="K")
Begin DoDot:1
+14 SET CIEN=0
+15 FOR
SET CIEN=$ORDER(^AGG(9009068.3,AGWIEN,10,IEN,5,CIEN))
IF 'CIEN
QUIT
Begin DoDot:2
+16 NEW CDATA
+17 SET CDATA=^AGG(9009068.3,AGWIEN,10,IEN,5,CIEN,0)
+18 SET VALUE=VALUE_$PIECE(CDATA,U,2)_$CHAR(29)_$PIECE(CDATA,U,1)_$CHAR(28)
End DoDot:2
+19 SET VALUE=$$TKO^AGGUL1(VALUE,$CHAR(28))
End DoDot:1
+20 DO UP
+21 ;
+22 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+23 QUIT
+24 ;
COMM(DATA,DFN,COMM) ;EP - AGG COMMUNITY TRIGGER
+1 NEW UID,II,VALUE,SOURCE,IEN,HELP,TYPE,ABLE,AGWIEN,FILE,DTMV,PCOMM,VISIBLE
+2 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+3 SET DATA=$NAME(^TMP("AGGTRCOMM",UID))
+4 KILL @DATA
+5 SET II=0
+6 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^AGGWTRIG D UNWIND^%ZTER"
+7 DO HDR
+8 SET @DATA@(II)=HDR_$CHAR(30)
+9 SET DTMV=$ORDER(^AUPNPAT(DFN,51,"A"),-1)
+10 IF +DTMV'=0
SET PCOMM=$PIECE(^AUPNPAT(DFN,51,DTMV,0),U,3)
+11 SET SOURCE="AGGPTCDT"
SET TYPE="D"
SET ABLE="Y"
Begin DoDot:1
+12 IF $GET(PCOMM)=""
SET CLEAR=""
SET HELP=""
SET VALUE=""
DO UP
QUIT
+13 IF $GET(PCOMM)=COMM
SET CLEAR=""
SET HELP=""
SET VALUE=""
DO UP
QUIT
+14 SET CLEAR="AGGPTCDT"
SET HELP=""
SET VALUE=""
DO UP
End DoDot:1
+15 SET SOURCE="AGGCMCNY"
SET TYPE="X"
SET HELP=""
SET ABLE="Y"
SET VALUE=""
SET CLEAR=""
+16 IF $GET(COMM)'=""
SET VALUE=$$GET1^DIQ(9999999.05,COMM_",",.02,"E")
DO UP
+17 ;
+18 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+19 QUIT
+20 ;
DTM(DATA,DFN,DATE) ;EP - AGG DATE MOVED TRIGGER
+1 NEW UID,II,VALUE,SOURCE,IEN,HELP,TYPE,ABLE,AGWIEN,FILE,VISIBLE
+2 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+3 SET DATA=$NAME(^TMP("AGGTRDTM",UID))
+4 KILL @DATA
+5 SET II=0
+6 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^AGGWTRIG D UNWIND^%ZTER"
+7 DO HDR
+8 SET @DATA@(II)=HDR_$CHAR(30)
+9 IF DATE?.A
SET DATE=$$UP^XLFSTR(DATE)
+10 IF $EXTRACT(DATE,1,1)="B"
SET DATE=$PIECE(^DPT(DFN,0),U,3)
+11 IF $EXTRACT(DATE,1,1)="T"
SET DATE=DT
+12 SET DATE=$$DATE^AGGUL1(DATE)
SET DATE=$$FMTE^AGGUL1(DATE)
+13 SET SOURCE="AGGPTCDT"
SET TYPE="D"
SET ABLE="Y"
SET CLEAR=""
SET HELP="Enter 'B' for at birth, TODAY or any date format"
SET VALUE=DATE
+14 DO UP
+15 ;
+16 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+17 QUIT
+18 ;
MEM(DATA,DFN,AGGPIIEN,PINUM) ;EP - AGG POLICY MEMBER NUMBER TRIG
+1 NEW UID,II,VALUE,SOURCE,IEN,HELP,TYPE,ABLE,MBNUM,VISIBLE
+2 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+3 SET DATA=$NAME(^TMP("AGGPINMB",UID))
+4 KILL @DATA
+5 SET II=0
+6 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^AGGWTRIG D UNWIND^%ZTER"
+7 DO HDR
+8 SET @DATA@(II)=HDR_$CHAR(30)
+9 ;
+10 IF $GET(AGGPIIEN)'=""
Begin DoDot:1
+11 NEW IENS,DA
+12 SET DA(1)=DFN
SET DA=AGGPIIEN
SET IENS=$$IENS^DILF(.DA)
+13 SET MBNUM=$$GET1^DIQ(9000006.11,IENS,21,"E")
End DoDot:1
+14 IF $GET(PINUM)'=""
IF $GET(MBNUM)=""
SET SOURCE="AGGPIMBN"
SET TYPE="X"
SET ABLE="Y"
SET CLEAR=""
SET HELP=""
SET VALUE=PINUM
DO UP
+15 ;
+16 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+17 QUIT
+18 ;
CTY(DATA,DFN,AGGPTCTY) ;EP - AGG CITY COMMUNITY TRIGGER
+1 NEW UID,II,VALUE,SOURCE,IEN,HELP,TYPE,ABLE,AGWIEN,FILE,VISIBLE
+2 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+3 SET DATA=$NAME(^TMP("AGGTRCOMM",UID))
+4 KILL @DATA
+5 SET II=0
+6 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^AGGWTRIG D UNWIND^%ZTER"
+7 DO HDR
+8 SET @DATA@(II)=HDR_$CHAR(30)
+9 SET CTY=$$GET1^DIQ(2,DFN_",",.114,"E")
+10 IF CTY'=""
IF CTY'=$GET(AGGPTCTY)
Begin DoDot:1
+11 SET SOURCE="AGGPTCOM"
SET TYPE="D"
SET ABLE="Y"
SET CLEAR="AGGPTCOM"
SET HELP=""
SET VALUE=""
DO UP
+12 ;S SOURCE="AGGPTCDT",TYPE="D",ABLE="Y",CLEAR="AGGPTCDT",HELP="",VALUE="" D UP
+13 SET SOURCE="AGGCMCNY"
SET TYPE="X"
SET ABLE="Y"
SET CLEAR="AGGCMCNY"
SET HELP=""
SET VALUE=""
DO UP
End DoDot:1
+14 ;
+15 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+16 QUIT