FBAAIAQ ;ALB/FA - Managing IPAC Agreement MRAs ;04 Dec 2013 7:36 AM
;;3.5;FEE BASIS;**123**;JAN 30, 1995;Build 51
;;Per VA Directive 6402, this routine should not be modified.
;
; Contains methods for creating add/edit/delete Master Record Adjustments for a
; selected IPAC Vendor Agreement
;
;-----------------------------------------------------------------------------
; Entry Points
; A - Create an Add Master Record Adjustment for a newly created IPAC
; Vendor Agreement
; AA - Create an Add Master Record Adjustment for a specified IPAC Vendor
; Agreement without changing existing data. Called from
; FBAA IPAC AGREEMENT MRA MENU/FBAA MRA IPAC ADD TYPE
; C - Create an Edit Master Record Adjustment for an edited IPAC Vendor
; agreement
; CC - Create an Edit Master Record Adjustment for a specified Vendor
; Agreement without changing existing data. Called from
; FBAA IPAC AGREEMENT MRA MENU/FBAA MRA IPAC CHANGE TYPE
; D - Create a Delete Master Record Adjustment record
; DD - Create a delete Master Record Adjustment record for a specified
; Vendor Agreement without changing existing data. Called from
; FBAA IPAC AGREEMENT MRA MENU/FBAA MRA IPAC DELETE TYPE
;-----------------------------------------------------------------------------
;
A(VAIEN) ;EP
; Create an IPAC Vendor Agreement Add MRA record. Only called when adding
; a new Vendor agreement
; Input: VAIEN - Vendor Agreement IEN to create an ADD MRA
; record for
; Output:
; Called From: FBAAIAE@ADDVA
N VAID
S VAID=$P(^FBAA(161.95,VAIEN,0),U,1)
D NEWMRA(VAIEN,VAID,"A")
Q
;
C(VAIEN) ;EP
; Create a Change MRA record for the edited Vendor Agreement
; Input: VAIEN - Vendor Agreement IEN
; ^TMP($J,"FBAAIAC") - Vendor Agreement values prior to being
; being edited. Used to detect changes.
; Called From: FBAAIAC@EDITF
N MRAACT,VAID
S VAID=$P(^FBAA(161.95,VAIEN,0),U,1)
;
; If a pending MRA record already exists for this agreement quit now
Q:$$PENDMRA(VAID,.MRAACT)
D NEWMRA(VAIEN,VAID,"C")
Q
;
D(VAID) ;EP
; Create a Delete MRA record for the selected Vendor Agreement
; Input: VAID - ID of the Selected Vendor Agreement
; Output: Delete Master Record Adjustment record created (potentially)
; Called From: DEL@FBAAIAD
N MRAACT,MRAIEN
S MRAIEN=$$PENDMRA(VAID,.MRAACT)
;
; If a pending MRA record for the Vendor agreement exists, it must be either an
; ADD or a CHANGE record. It cannot be a DELETE record because before a DELETE
; MRA record is filed for a Vendor agreement, the agreement is deleted from the
; file making it impossible to be deleted again. If a pending MRA record is an
; ADD action we just need to delete it because the user deleted the Vendor
; agreement before it was ever transmitted. If it is a CHANGE action we need to
; edit it and change the action to DELETE and re-file it rather than file a new one.
I MRAIEN>0 D Q
. I MRAACT="A" D DELMRA(MRAIEN) Q
. N DA,DIE,DR,DTOUT
. S DIE=161.96,DA=MRAIEN
. S DR="1////@;3////D"
. D ^DIE
D NEWMRA("",VAID,"D") ; Create a DELETE MRA record
Q
;
PENDMRA(VAID,MRASTAT) ; Checks to see if an MRA record in a pending status already
; exists for the specified IPAC Vendor Agreement
; Input: VAID - ID of the selected IPAC Vendor Agreement
; Output: MRAACT - Action of the pending MRA record
; "" if no pending MRA record exists
; Returns: IEN of the pending MRA record if one exists, 0 otherwise
; Called From: AA,C,CC,D
N MRAIEN,STOP
S MRASTAT="",MRAIEN="",STOP=0
F D Q:MRAIEN="" Q:STOP
. S MRAIEN=$O(^FBAA(161.96,"AS","P",MRAIEN))
. Q:MRAIEN=""
. ;
. ; Quit if the MRA is not for the selected Vendor Agreement
. Q:$P(^FBAA(161.96,MRAIEN,0),U,3)'=VAID
. S STOP=1
S:STOP MRASTAT=$P(^FBAA(161.96,MRAIEN,0),U,4)
Q:STOP MRAIEN
Q 0
;
AA ;EP
; Create and ADD Master Record Adjustment for a specified Vendor Agreement without
; changing existing data
; Input: None
; Called From: Menu - FBAA IPAC AGREEMENT MRA MENU/FBAA MRA IPAC ADD TYPE
N DIC,DTOUT,DUOUT,MRAACT,MRAIEN,MRASTAT,VAID,VAIEN,X,Y
S DIC=161.95,DIC(0)="AEQMZ"
S DIC("A")="Select an IPAC Vendor Agreement: "
D ^DIC ; Select an agreement
Q:Y'>0
S VAIEN=+Y ; Selected Vendor Agreement EIN
Q:VAIEN'>0 ; No selected agreement
I $P(^FBAA(161.95,VAIEN,0),U,4)="N" D Q
. W !!,"IPAC Vendor Agreement Status is NEW."
. W !,"First edit the Vendor Agreement and complete it."
S VAID=$P(^FBAA(161.95,VAIEN,0),U,1)
;
; Check to see if the selected Vendor Agreement already has a pending MRA record
S MRAIEN=$$PENDMRA(VAID,.MRAACT)
;
; No pending record exists, attempt to add a pending MRA add record for the selected
; Vendor agreement
I MRAIEN=0 D Q
. I '$$LOCKVA^FBAAIAU(VAIEN,0) D Q
. . W !!,"Someone else is editing this agreement. "
. . W !,"An ADD MRA cannot be created at this time."
. . W !,"Try again later."
. D NEWMRA(VAIEN,VAID,"A")
. D UNLOCKVA^FBAAIAU(VAIEN)
. W !!,"ADD MRA created and ready for transmission.",!!
;
S MRASTAT=$P(^FBAA(161.96,MRAIEN,0),U,5)
I MRASTAT="P",MRAACT="A" W !!,"ADD MRA already exists." Q
;
; Prompt the user to ask if we should change a pending CHANGE MRA record to a
; pending Add MRA record
I MRASTAT="P",MRAACT="C" D
. I '$$LOCKVA^FBAAIAU(VAIEN,0) D Q
. . W !!,"Someone else is editing this agreement. "
. . W !,"An ADD MRA cannot be created at this time."
. . W !,"Try again later."
. W !,"An MRA is with a status of CHANGE is currently Pending."
. N DA,DIE,DIR,DIROUT,DIRUT,DR,DTOUT,DUOUT,Y
. S DIR(0)="Y",DIR("A")="Do you want to change the type to ADD?"
. S DIR("B")="No"
. D ^DIR
. I +Y=0 D UNLOCKVA^FBAAIAU(VAIEN) Q
. S DIE=161.96,DA=MRAIEN
. S DR="3////A;4////P"
. D ^DIE
. D UNLOCKVA^FBAAIAU(VAIEN)
. W !!,"ADD MRA created from a CHANGE MRA and ready for transmission.",!!
Q
;
CC ;EP
; Change a Master Record Adjustment for a specified Vendor agreement without
; changing existing data
; Input: None
; Called From: Menu - FBAA IPAC AGREEMENT MRA MENU/FBAA MRA IPAC CHANGE TYPE
N DIC,DTOUT,DUOUT,MRAACT,MRAIEN,MRASTAT,VAID,VAIEN,X,Y
S DIC=161.95,DIC(0)="AEQMZ"
S DIC("A")="Select an IPAC Vendor Agreement: "
D ^DIC ; Select an agreement
Q:Y'>0
S VAIEN=+Y ; Selected Vendor Agreement EIN
Q:VAIEN'>0 ; No selected agreement
;
I $P(^FBAA(161.95,VAIEN,0),U,4)="N" D Q
. W !!,"IPAC Vendor Agreement Status is NEW."
. W !,"First edit the Vendor Agreement and complete it."
S VAID=$P(^FBAA(161.95,VAIEN,0),U,1)
;
; Check to see if the selected Vendor Agreement already has a pending MRA record
S MRAIEN=$$PENDMRA(VAID,.MRAACT)
;
; No pending record exists, attempt to add a pending MRA change record for the selected
; Vendor agreement
I MRAIEN=0 D Q
. I '$$LOCKVA^FBAAIAU(VAIEN,0) D Q
. . W !!,"Someone else is editing this agreement. "
. . W !,"A CHANGE MRA cannot be created at this time."
. . W !,"Try again later."
. D NEWMRA(VAIEN,VAID,"C")
. D UNLOCKVA^FBAAIAU(VAIEN)
. W !!,"CHANGE MRA created and ready for transmission.",!!
;
S MRASTAT=$P(^FBAA(161.96,MRAIEN,0),U,5)
I MRASTAT="P",MRAACT="C" W !!,"CHANGE MRA already exists." Q
;
; Prompt the user to ask if we should change a pending Add MRA record to a
; pending Add MRA record
I MRASTAT="P",MRAACT="A" D
. I '$$LOCKVA^FBAAIAU(VAIEN,0) D Q
. . W !!,"Someone else is editing this agreement. "
. . W !,"A CHANGE MRA cannot be created at this time."
. . W !,"Try again later."
. W !,"An MRA is with a status of ADD is currently Pending."
. N DA,DIE,DIR,DIROUT,DIRUT,DR,DTOUT,DUOUT,Y
. S DIR(0)="Y",DIR("A")="Do you want to change the type to CHANGE?"
. S DIR("B")="No"
. D ^DIR
. I +Y=0 D UNLOCKVA^FBAAIAU(VAIEN) Q
. S DIE=161.96,DA=MRAIEN
. S DR="3////C;4///P"
. D ^DIE
. D UNLOCKVA^FBAAIAU(VAIEN)
. W !!,"CHANGE MRA created from an ADD MRA and ready for transmission.",!!
Q
;
DD ;EP
; Create a delete Master Record Adjustment record for a specified Vendor Agreement
; without changing actual data
; Called From: Menu - FBAA IPAC AGREEMENT MRA MENU/FBAA MRA IPAC DELETE TYPE
N DA,DIE,DR,DIR,FLINE,STEXT,MRAIEN,X,Y
S FLINE="The following Transmitted DELETE MRA Records are currently on file:"
S STEXT="Please select the DELETE MRA Record to re-transmit"
;
; Display a list of Transmitted Deleted MRA Records for selection
S MRAIEN=$$SELMRA^FBAAIAU(FLINE,STEXT,"T","D")
Q:MRAIEN="" ; No MRA record selected
;
; Change the status and remove the transmit date of the selected transmitted
; record and refile it.
S DIE="^FBAA(161.96,",DA=MRAIEN
S DR="3///^S X="_"""DELETE"""
S DR=DR_";4////P;5////@"
D ^DIE
W !!,"DELETE MRA processing completed."
Q
;
NEWMRA(VAIEN,VAID,ACTION) ; Create an IPAC Vendor Agreement MRA record of
; specified ACTION for the specified Vendor Agreement
; a new Vendor agreement
; Input: VAIEN - Vendor Agreement IEN to create an MRA
; record for. "" if creating a DELETE MRA
; VAID - Vendor Agreement ID to create and MRA record for
; ACTION - MRA Action ('A','C' or 'D')
; Output: New MRA record is filed
; Called From: A,AA,C,CC,D,DD
N DA,DIC,DO,DR,DTOUT,DUOUT,X,Y
S DIC=161.96,DIC(0)="EZ"
S X=$P($G(^FBAA(161.96,0)),U,4)+1
S DIC("DR")="1///^S X=VAIEN;2///^S X=VAID;3///^S X=ACTION;4///P"
D FILE^DICN
Q
;
DELMRA(MRAIEN) ; Delete an existing MRA record
; Input: MRAIEN - IEN of the MRA record to be deleted
; Output: Specified MRA record is deleted
; Called From: A,C,D
N DA,DIK
S DIK="^FBAA(161.96,"
S DA=MRAIEN
D ^DIK
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFBAAIAQ 10418 printed Oct 16, 2024@17:56:24 Page 2
FBAAIAQ ;ALB/FA - Managing IPAC Agreement MRAs ;04 Dec 2013 7:36 AM
+1 ;;3.5;FEE BASIS;**123**;JAN 30, 1995;Build 51
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 ;
+4 ; Contains methods for creating add/edit/delete Master Record Adjustments for a
+5 ; selected IPAC Vendor Agreement
+6 ;
+7 ;-----------------------------------------------------------------------------
+8 ; Entry Points
+9 ; A - Create an Add Master Record Adjustment for a newly created IPAC
+10 ; Vendor Agreement
+11 ; AA - Create an Add Master Record Adjustment for a specified IPAC Vendor
+12 ; Agreement without changing existing data. Called from
+13 ; FBAA IPAC AGREEMENT MRA MENU/FBAA MRA IPAC ADD TYPE
+14 ; C - Create an Edit Master Record Adjustment for an edited IPAC Vendor
+15 ; agreement
+16 ; CC - Create an Edit Master Record Adjustment for a specified Vendor
+17 ; Agreement without changing existing data. Called from
+18 ; FBAA IPAC AGREEMENT MRA MENU/FBAA MRA IPAC CHANGE TYPE
+19 ; D - Create a Delete Master Record Adjustment record
+20 ; DD - Create a delete Master Record Adjustment record for a specified
+21 ; Vendor Agreement without changing existing data. Called from
+22 ; FBAA IPAC AGREEMENT MRA MENU/FBAA MRA IPAC DELETE TYPE
+23 ;-----------------------------------------------------------------------------
+24 ;
A(VAIEN) ;EP
+1 ; Create an IPAC Vendor Agreement Add MRA record. Only called when adding
+2 ; a new Vendor agreement
+3 ; Input: VAIEN - Vendor Agreement IEN to create an ADD MRA
+4 ; record for
+5 ; Output:
+6 ; Called From: FBAAIAE@ADDVA
+7 NEW VAID
+8 SET VAID=$PIECE(^FBAA(161.95,VAIEN,0),U,1)
+9 DO NEWMRA(VAIEN,VAID,"A")
+10 QUIT
+11 ;
C(VAIEN) ;EP
+1 ; Create a Change MRA record for the edited Vendor Agreement
+2 ; Input: VAIEN - Vendor Agreement IEN
+3 ; ^TMP($J,"FBAAIAC") - Vendor Agreement values prior to being
+4 ; being edited. Used to detect changes.
+5 ; Called From: FBAAIAC@EDITF
+6 NEW MRAACT,VAID
+7 SET VAID=$PIECE(^FBAA(161.95,VAIEN,0),U,1)
+8 ;
+9 ; If a pending MRA record already exists for this agreement quit now
+10 if $$PENDMRA(VAID,.MRAACT)
QUIT
+11 DO NEWMRA(VAIEN,VAID,"C")
+12 QUIT
+13 ;
D(VAID) ;EP
+1 ; Create a Delete MRA record for the selected Vendor Agreement
+2 ; Input: VAID - ID of the Selected Vendor Agreement
+3 ; Output: Delete Master Record Adjustment record created (potentially)
+4 ; Called From: DEL@FBAAIAD
+5 NEW MRAACT,MRAIEN
+6 SET MRAIEN=$$PENDMRA(VAID,.MRAACT)
+7 ;
+8 ; If a pending MRA record for the Vendor agreement exists, it must be either an
+9 ; ADD or a CHANGE record. It cannot be a DELETE record because before a DELETE
+10 ; MRA record is filed for a Vendor agreement, the agreement is deleted from the
+11 ; file making it impossible to be deleted again. If a pending MRA record is an
+12 ; ADD action we just need to delete it because the user deleted the Vendor
+13 ; agreement before it was ever transmitted. If it is a CHANGE action we need to
+14 ; edit it and change the action to DELETE and re-file it rather than file a new one.
+15 IF MRAIEN>0
Begin DoDot:1
+16 IF MRAACT="A"
DO DELMRA(MRAIEN)
QUIT
+17 NEW DA,DIE,DR,DTOUT
+18 SET DIE=161.96
SET DA=MRAIEN
+19 SET DR="1////@;3////D"
+20 DO ^DIE
End DoDot:1
QUIT
+21 ; Create a DELETE MRA record
DO NEWMRA("",VAID,"D")
+22 QUIT
+23 ;
PENDMRA(VAID,MRASTAT) ; Checks to see if an MRA record in a pending status already
+1 ; exists for the specified IPAC Vendor Agreement
+2 ; Input: VAID - ID of the selected IPAC Vendor Agreement
+3 ; Output: MRAACT - Action of the pending MRA record
+4 ; "" if no pending MRA record exists
+5 ; Returns: IEN of the pending MRA record if one exists, 0 otherwise
+6 ; Called From: AA,C,CC,D
+7 NEW MRAIEN,STOP
+8 SET MRASTAT=""
SET MRAIEN=""
SET STOP=0
+9 FOR
Begin DoDot:1
+10 SET MRAIEN=$ORDER(^FBAA(161.96,"AS","P",MRAIEN))
+11 if MRAIEN=""
QUIT
+12 ;
+13 ; Quit if the MRA is not for the selected Vendor Agreement
+14 if $PIECE(^FBAA(161.96,MRAIEN,0),U,3)'=VAID
QUIT
+15 SET STOP=1
End DoDot:1
if MRAIEN=""
QUIT
if STOP
QUIT
+16 if STOP
SET MRASTAT=$PIECE(^FBAA(161.96,MRAIEN,0),U,4)
+17 if STOP
QUIT MRAIEN
+18 QUIT 0
+19 ;
AA ;EP
+1 ; Create and ADD Master Record Adjustment for a specified Vendor Agreement without
+2 ; changing existing data
+3 ; Input: None
+4 ; Called From: Menu - FBAA IPAC AGREEMENT MRA MENU/FBAA MRA IPAC ADD TYPE
+5 NEW DIC,DTOUT,DUOUT,MRAACT,MRAIEN,MRASTAT,VAID,VAIEN,X,Y
+6 SET DIC=161.95
SET DIC(0)="AEQMZ"
+7 SET DIC("A")="Select an IPAC Vendor Agreement: "
+8 ; Select an agreement
DO ^DIC
+9 if Y'>0
QUIT
+10 ; Selected Vendor Agreement EIN
SET VAIEN=+Y
+11 ; No selected agreement
if VAIEN'>0
QUIT
+12 IF $PIECE(^FBAA(161.95,VAIEN,0),U,4)="N"
Begin DoDot:1
+13 WRITE !!,"IPAC Vendor Agreement Status is NEW."
+14 WRITE !,"First edit the Vendor Agreement and complete it."
End DoDot:1
QUIT
+15 SET VAID=$PIECE(^FBAA(161.95,VAIEN,0),U,1)
+16 ;
+17 ; Check to see if the selected Vendor Agreement already has a pending MRA record
+18 SET MRAIEN=$$PENDMRA(VAID,.MRAACT)
+19 ;
+20 ; No pending record exists, attempt to add a pending MRA add record for the selected
+21 ; Vendor agreement
+22 IF MRAIEN=0
Begin DoDot:1
+23 IF '$$LOCKVA^FBAAIAU(VAIEN,0)
Begin DoDot:2
+24 WRITE !!,"Someone else is editing this agreement. "
+25 WRITE !,"An ADD MRA cannot be created at this time."
+26 WRITE !,"Try again later."
End DoDot:2
QUIT
+27 DO NEWMRA(VAIEN,VAID,"A")
+28 DO UNLOCKVA^FBAAIAU(VAIEN)
+29 WRITE !!,"ADD MRA created and ready for transmission.",!!
End DoDot:1
QUIT
+30 ;
+31 SET MRASTAT=$PIECE(^FBAA(161.96,MRAIEN,0),U,5)
+32 IF MRASTAT="P"
IF MRAACT="A"
WRITE !!,"ADD MRA already exists."
QUIT
+33 ;
+34 ; Prompt the user to ask if we should change a pending CHANGE MRA record to a
+35 ; pending Add MRA record
+36 IF MRASTAT="P"
IF MRAACT="C"
Begin DoDot:1
+37 IF '$$LOCKVA^FBAAIAU(VAIEN,0)
Begin DoDot:2
+38 WRITE !!,"Someone else is editing this agreement. "
+39 WRITE !,"An ADD MRA cannot be created at this time."
+40 WRITE !,"Try again later."
End DoDot:2
QUIT
+41 WRITE !,"An MRA is with a status of CHANGE is currently Pending."
+42 NEW DA,DIE,DIR,DIROUT,DIRUT,DR,DTOUT,DUOUT,Y
+43 SET DIR(0)="Y"
SET DIR("A")="Do you want to change the type to ADD?"
+44 SET DIR("B")="No"
+45 DO ^DIR
+46 IF +Y=0
DO UNLOCKVA^FBAAIAU(VAIEN)
QUIT
+47 SET DIE=161.96
SET DA=MRAIEN
+48 SET DR="3////A;4////P"
+49 DO ^DIE
+50 DO UNLOCKVA^FBAAIAU(VAIEN)
+51 WRITE !!,"ADD MRA created from a CHANGE MRA and ready for transmission.",!!
End DoDot:1
+52 QUIT
+53 ;
CC ;EP
+1 ; Change a Master Record Adjustment for a specified Vendor agreement without
+2 ; changing existing data
+3 ; Input: None
+4 ; Called From: Menu - FBAA IPAC AGREEMENT MRA MENU/FBAA MRA IPAC CHANGE TYPE
+5 NEW DIC,DTOUT,DUOUT,MRAACT,MRAIEN,MRASTAT,VAID,VAIEN,X,Y
+6 SET DIC=161.95
SET DIC(0)="AEQMZ"
+7 SET DIC("A")="Select an IPAC Vendor Agreement: "
+8 ; Select an agreement
DO ^DIC
+9 if Y'>0
QUIT
+10 ; Selected Vendor Agreement EIN
SET VAIEN=+Y
+11 ; No selected agreement
if VAIEN'>0
QUIT
+12 ;
+13 IF $PIECE(^FBAA(161.95,VAIEN,0),U,4)="N"
Begin DoDot:1
+14 WRITE !!,"IPAC Vendor Agreement Status is NEW."
+15 WRITE !,"First edit the Vendor Agreement and complete it."
End DoDot:1
QUIT
+16 SET VAID=$PIECE(^FBAA(161.95,VAIEN,0),U,1)
+17 ;
+18 ; Check to see if the selected Vendor Agreement already has a pending MRA record
+19 SET MRAIEN=$$PENDMRA(VAID,.MRAACT)
+20 ;
+21 ; No pending record exists, attempt to add a pending MRA change record for the selected
+22 ; Vendor agreement
+23 IF MRAIEN=0
Begin DoDot:1
+24 IF '$$LOCKVA^FBAAIAU(VAIEN,0)
Begin DoDot:2
+25 WRITE !!,"Someone else is editing this agreement. "
+26 WRITE !,"A CHANGE MRA cannot be created at this time."
+27 WRITE !,"Try again later."
End DoDot:2
QUIT
+28 DO NEWMRA(VAIEN,VAID,"C")
+29 DO UNLOCKVA^FBAAIAU(VAIEN)
+30 WRITE !!,"CHANGE MRA created and ready for transmission.",!!
End DoDot:1
QUIT
+31 ;
+32 SET MRASTAT=$PIECE(^FBAA(161.96,MRAIEN,0),U,5)
+33 IF MRASTAT="P"
IF MRAACT="C"
WRITE !!,"CHANGE MRA already exists."
QUIT
+34 ;
+35 ; Prompt the user to ask if we should change a pending Add MRA record to a
+36 ; pending Add MRA record
+37 IF MRASTAT="P"
IF MRAACT="A"
Begin DoDot:1
+38 IF '$$LOCKVA^FBAAIAU(VAIEN,0)
Begin DoDot:2
+39 WRITE !!,"Someone else is editing this agreement. "
+40 WRITE !,"A CHANGE MRA cannot be created at this time."
+41 WRITE !,"Try again later."
End DoDot:2
QUIT
+42 WRITE !,"An MRA is with a status of ADD is currently Pending."
+43 NEW DA,DIE,DIR,DIROUT,DIRUT,DR,DTOUT,DUOUT,Y
+44 SET DIR(0)="Y"
SET DIR("A")="Do you want to change the type to CHANGE?"
+45 SET DIR("B")="No"
+46 DO ^DIR
+47 IF +Y=0
DO UNLOCKVA^FBAAIAU(VAIEN)
QUIT
+48 SET DIE=161.96
SET DA=MRAIEN
+49 SET DR="3////C;4///P"
+50 DO ^DIE
+51 DO UNLOCKVA^FBAAIAU(VAIEN)
+52 WRITE !!,"CHANGE MRA created from an ADD MRA and ready for transmission.",!!
End DoDot:1
+53 QUIT
+54 ;
DD ;EP
+1 ; Create a delete Master Record Adjustment record for a specified Vendor Agreement
+2 ; without changing actual data
+3 ; Called From: Menu - FBAA IPAC AGREEMENT MRA MENU/FBAA MRA IPAC DELETE TYPE
+4 NEW DA,DIE,DR,DIR,FLINE,STEXT,MRAIEN,X,Y
+5 SET FLINE="The following Transmitted DELETE MRA Records are currently on file:"
+6 SET STEXT="Please select the DELETE MRA Record to re-transmit"
+7 ;
+8 ; Display a list of Transmitted Deleted MRA Records for selection
+9 SET MRAIEN=$$SELMRA^FBAAIAU(FLINE,STEXT,"T","D")
+10 ; No MRA record selected
if MRAIEN=""
QUIT
+11 ;
+12 ; Change the status and remove the transmit date of the selected transmitted
+13 ; record and refile it.
+14 SET DIE="^FBAA(161.96,"
SET DA=MRAIEN
+15 SET DR="3///^S X="_"""DELETE"""
+16 SET DR=DR_";4////P;5////@"
+17 DO ^DIE
+18 WRITE !!,"DELETE MRA processing completed."
+19 QUIT
+20 ;
NEWMRA(VAIEN,VAID,ACTION) ; Create an IPAC Vendor Agreement MRA record of
+1 ; specified ACTION for the specified Vendor Agreement
+2 ; a new Vendor agreement
+3 ; Input: VAIEN - Vendor Agreement IEN to create an MRA
+4 ; record for. "" if creating a DELETE MRA
+5 ; VAID - Vendor Agreement ID to create and MRA record for
+6 ; ACTION - MRA Action ('A','C' or 'D')
+7 ; Output: New MRA record is filed
+8 ; Called From: A,AA,C,CC,D,DD
+9 NEW DA,DIC,DO,DR,DTOUT,DUOUT,X,Y
+10 SET DIC=161.96
SET DIC(0)="EZ"
+11 SET X=$PIECE($GET(^FBAA(161.96,0)),U,4)+1
+12 SET DIC("DR")="1///^S X=VAIEN;2///^S X=VAID;3///^S X=ACTION;4///P"
+13 DO FILE^DICN
+14 QUIT
+15 ;
DELMRA(MRAIEN) ; Delete an existing MRA record
+1 ; Input: MRAIEN - IEN of the MRA record to be deleted
+2 ; Output: Specified MRA record is deleted
+3 ; Called From: A,C,D
+4 NEW DA,DIK
+5 SET DIK="^FBAA(161.96,"
+6 SET DA=MRAIEN
+7 DO ^DIK
+8 QUIT
+9 ;