DGBTMTTH ;BLD-RETRIVE MT THRESHOLD AMOUNTS; 10/05/2012@1130; 03/04/2012
;;1.0;Beneficiary Travel;**20**;March 4, 2012;Build 185
;
Q
;
MTTH(DEP,DGBTDT) ;entry point to return MT threshold amounts
; input - DEP - number of dependents
; DGBTDT - BT Claim Date
; output - DGBTMTTH - MT threshold amount
;
N DGBTMTTH,DGBTYEAR,THDATA,MTYEAR,DGBTTH,DGBTTHD1,DGBTTHD2
S DGBTMTTH=0
S DGBTYEAR=$E(DGBTDT,1,3)_"0000"+1
S MTYEAR=$O(^DG(43,1,"MT",DGBTYEAR),-1)
S THDATA=^DG(43,1,"MT",MTYEAR,0)
S DGBTTH=$P(THDATA,"^",2)
S DGBTTHD1=$P(THDATA,"^",3)
S DGBTTHD2=$P(THDATA,"^",4)
I DEP=0 Q DGBTTH
I DEP=1 Q DGBTTH+DGBTTHD1
I DEP>1 Q DGBTTH+DGBTTHD1+(DGBTTHD2*(DEP-1))
;
Q DGBTMTTH
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDGBTMTTH 731 printed Dec 13, 2024@01:40:48 Page 2
DGBTMTTH ;BLD-RETRIVE MT THRESHOLD AMOUNTS; 10/05/2012@1130; 03/04/2012
+1 ;;1.0;Beneficiary Travel;**20**;March 4, 2012;Build 185
+2 ;
+3 QUIT
+4 ;
MTTH(DEP,DGBTDT) ;entry point to return MT threshold amounts
+1 ; input - DEP - number of dependents
+2 ; DGBTDT - BT Claim Date
+3 ; output - DGBTMTTH - MT threshold amount
+4 ;
+5 NEW DGBTMTTH,DGBTYEAR,THDATA,MTYEAR,DGBTTH,DGBTTHD1,DGBTTHD2
+6 SET DGBTMTTH=0
+7 SET DGBTYEAR=$EXTRACT(DGBTDT,1,3)_"0000"+1
+8 SET MTYEAR=$ORDER(^DG(43,1,"MT",DGBTYEAR),-1)
+9 SET THDATA=^DG(43,1,"MT",MTYEAR,0)
+10 SET DGBTTH=$PIECE(THDATA,"^",2)
+11 SET DGBTTHD1=$PIECE(THDATA,"^",3)
+12 SET DGBTTHD2=$PIECE(THDATA,"^",4)
+13 IF DEP=0
QUIT DGBTTH
+14 IF DEP=1
QUIT DGBTTH+DGBTTHD1
+15 IF DEP>1
QUIT DGBTTH+DGBTTHD1+(DGBTTHD2*(DEP-1))
+16 ;
+17 QUIT DGBTMTTH