ACRFSS51 ;IHS/OIRM/DSD/THL,AEF - CONTINUATION OF ACRFSS5; [ 11/01/2001 9:44 AM ]
;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
;;CONTINUATION OF ACRFSS5
ADD ;EP;
F D ADD1 Q:$D(ACRQUIT)!$D(ACROUT)
D TMFEEA(ACRDOCDA)
Q
ADD1 S (ACRJ,X)=ACRJ+1
S DIC="^ACRAL("
S DIC(0)="L"
S DIC("DR")=".02////"_ACRDOCDA_";.03////"_ACRDOCDA
I ACRJ>1,$D(^ACRAL(+$G(ACRAL(1)),0)) S DIC("DR")=DIC("DR")_";2////"_$P($G(^("DT")),U,2)_";11////"_$P($G(^("DT")),U,11)
D FILE^ACRFDIC
S (DA,ACRDA)=+Y
D EDIT2
S DA=ACRDA
S DIR(0)="YO"
S DIR("A")="Add another flight"
S DIR("B")="NO"
W !
D DIR^ACRFDIC
I Y'=1 S ACRQUIT=""
Q
EDIT ;EP;
S DIR(0)="LO^1:"_ACRJ
S DIR("A")="Which FLIGHT(S)"
W !
D DIR^ACRFDIC
Q:$D(ACRQUIT)!$D(ACROUT)
S ACRZ=Y
F ACRI=1:1 S ACRYY=$P(ACRZ,",",ACRI) Q:'ACRYY D:$D(ACRAL(ACRYY)) EDIT1
K ACRZ
Q
EDIT1 S (DA,ACRDA)=+ACRAL(ACRYY)
EDIT2 S DIE="^ACRAL("
S DR="[ACR AIRLINE INFO]"
D DDS^ACRFDIC
Q:'$D(ACRSCREN)
K ACRSCREN
D ^ACRFEAL
Q
DELETE ;EP;
S DIR(0)="LO^1:"_ACRJ
S DIR("A")="Which FLIGHT(S)"
W !
D DIR^ACRFDIC
Q:$D(ACRQUIT)!$D(ACROUT)
S ACRY=Y
S:$E(ACRY,$L(ACRY))="," ACRY=$E(ACRY,1,($L(ACRY)-1))
F ACRI=1:1 S ACRYY=$P(ACRY,",",ACRI) Q:ACRYY="" D DTV1:$D(ACRAL(ACRYY))
Q
DTV1 S DA=$P(ACRAL(ACRYY),U)
S DIK="^ACRAL("
D DIK^ACRFDIC
D TMFEED(ACRDOCDA)
Q
TMFEEA(ACRDOCDA) ;
;----- ADDS TRAVEL MGT FEE WHEN AIRLINE FLIGHT IS ADDED
;
; ACRDOCDA = FMS DOCUMENT IEN
;
Q:'$D(^ACRAL("E",ACRDOCDA))
S DA=$$TMFIEN(ACRDOCDA)
Q:'DA
S DIE="^ACRSS("
S DR="13////"_+$P($G(^ACRSYS(1,400)),U)
D ^DIE
Q
TMFEED(ACRDOCDA) ;
;----- DELETES TRAVEL MGT FEE WHEN AIRLINE FLIGHTS ARE DELETED
;
; ACRDOCDA = FMS DOCUMENT IEN
;
Q:$D(^ACRAL("E",ACRDOCDA))
S DA=$$TMFIEN(ACRDOCDA)
Q:'DA
S DIE="^ACRSS("
S DR="13////"_"0"
D ^DIE
Q
TMFIEN(ACRDOCDA) ;
;----- EXTRINSIC FUNCTION - FIND FMS SUPPLIES & SERVICES ENTRY
; CONTAINING THE TRAVEL MGT FEE
;
; INPUT:
; ACRDOCDA = FMS DOCUMENT IEN
;
; OUTPUT:
; Y = FMS SUPPLIES & SERVICES FILE ENTRY IEN
;
N Y
S Y=0
F S Y=$O(^ACRSS("C",ACRDOCDA,Y)) Q:'Y Q:$P($G(^ACRSS(Y,"NMS")),U,5)="Travel Mgt Fee"
Q +Y
ACRFSS51 ;IHS/OIRM/DSD/THL,AEF - CONTINUATION OF ACRFSS5; [ 11/01/2001 9:44 AM ]
+1 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
+2 ;;CONTINUATION OF ACRFSS5
ADD ;EP;
+1 FOR
DO ADD1
IF $DATA(ACRQUIT)!$DATA(ACROUT)
QUIT
+2 DO TMFEEA(ACRDOCDA)
+3 QUIT
ADD1 SET (ACRJ,X)=ACRJ+1
+1 SET DIC="^ACRAL("
+2 SET DIC(0)="L"
+3 SET DIC("DR")=".02////"_ACRDOCDA_";.03////"_ACRDOCDA
+4 IF ACRJ>1
IF $DATA(^ACRAL(+$GET(ACRAL(1)),0))
SET DIC("DR")=DIC("DR")_";2////"_$PIECE($GET(^("DT")),U,2)_";11////"_$PIECE($GET(^("DT")),U,11)
+5 DO FILE^ACRFDIC
+6 SET (DA,ACRDA)=+Y
+7 DO EDIT2
+8 SET DA=ACRDA
+9 SET DIR(0)="YO"
+10 SET DIR("A")="Add another flight"
+11 SET DIR("B")="NO"
+12 WRITE !
+13 DO DIR^ACRFDIC
+14 IF Y'=1
SET ACRQUIT=""
+15 QUIT
EDIT ;EP;
+1 SET DIR(0)="LO^1:"_ACRJ
+2 SET DIR("A")="Which FLIGHT(S)"
+3 WRITE !
+4 DO DIR^ACRFDIC
+5 IF $DATA(ACRQUIT)!$DATA(ACROUT)
QUIT
+6 SET ACRZ=Y
+7 FOR ACRI=1:1
SET ACRYY=$PIECE(ACRZ,",",ACRI)
IF 'ACRYY
QUIT
IF $DATA(ACRAL(ACRYY))
DO EDIT1
+8 KILL ACRZ
+9 QUIT
EDIT1 SET (DA,ACRDA)=+ACRAL(ACRYY)
EDIT2 SET DIE="^ACRAL("
+1 SET DR="[ACR AIRLINE INFO]"
+2 DO DDS^ACRFDIC
+3 IF '$DATA(ACRSCREN)
QUIT
+4 KILL ACRSCREN
+5 DO ^ACRFEAL
+6 QUIT
DELETE ;EP;
+1 SET DIR(0)="LO^1:"_ACRJ
+2 SET DIR("A")="Which FLIGHT(S)"
+3 WRITE !
+4 DO DIR^ACRFDIC
+5 IF $DATA(ACRQUIT)!$DATA(ACROUT)
QUIT
+6 SET ACRY=Y
+7 IF $EXTRACT(ACRY,$LENGTH(ACRY))=","
SET ACRY=$EXTRACT(ACRY,1,($LENGTH(ACRY)-1))
+8 FOR ACRI=1:1
SET ACRYY=$PIECE(ACRY,",",ACRI)
IF ACRYY=""
QUIT
IF $DATA(ACRAL(ACRYY))
DO DTV1
+9 QUIT
DTV1 SET DA=$PIECE(ACRAL(ACRYY),U)
+1 SET DIK="^ACRAL("
+2 DO DIK^ACRFDIC
+3 DO TMFEED(ACRDOCDA)
+4 QUIT
TMFEEA(ACRDOCDA) ;
+1 ;----- ADDS TRAVEL MGT FEE WHEN AIRLINE FLIGHT IS ADDED
+2 ;
+3 ; ACRDOCDA = FMS DOCUMENT IEN
+4 ;
+5 IF '$DATA(^ACRAL("E",ACRDOCDA))
QUIT
+6 SET DA=$$TMFIEN(ACRDOCDA)
+7 IF 'DA
QUIT
+8 SET DIE="^ACRSS("
+9 SET DR="13////"_+$PIECE($GET(^ACRSYS(1,400)),U)
+10 DO ^DIE
+11 QUIT
TMFEED(ACRDOCDA) ;
+1 ;----- DELETES TRAVEL MGT FEE WHEN AIRLINE FLIGHTS ARE DELETED
+2 ;
+3 ; ACRDOCDA = FMS DOCUMENT IEN
+4 ;
+5 IF $DATA(^ACRAL("E",ACRDOCDA))
QUIT
+6 SET DA=$$TMFIEN(ACRDOCDA)
+7 IF 'DA
QUIT
+8 SET DIE="^ACRSS("
+9 SET DR="13////"_"0"
+10 DO ^DIE
+11 QUIT
TMFIEN(ACRDOCDA) ;
+1 ;----- EXTRINSIC FUNCTION - FIND FMS SUPPLIES & SERVICES ENTRY
+2 ; CONTAINING THE TRAVEL MGT FEE
+3 ;
+4 ; INPUT:
+5 ; ACRDOCDA = FMS DOCUMENT IEN
+6 ;
+7 ; OUTPUT:
+8 ; Y = FMS SUPPLIES & SERVICES FILE ENTRY IEN
+9 ;
+10 NEW Y
+11 SET Y=0
+12 FOR
SET Y=$ORDER(^ACRSS("C",ACRDOCDA,Y))
IF 'Y
QUIT
IF $PIECE($GET(^ACRSS(Y,"NMS")),U,5)="Travel Mgt Fee"
QUIT
+13 QUIT +Y