Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: FBAARMRA

FBAARMRA.m

Go to the documentation of this file.
  1. FBAARMRA ;AISC/DMK-RETRANSMIT MRA's FOR A DATE ;25OCT89
  1. ;;3.5;FEE BASIS;**123**;JAN 30, 1995;Build 51
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. ASK W !! S %DT("A")="Re-transmit MRA's for which date: ",%DT="AEXP",%DT(0)=-DT D ^%DT K %DT(0),%DT("A") G END:X="^"!(X=""),ASK:Y<0 S FBAATD=Y
  1. I '$D(^FBAA(161.25,"AD",FBAATD)),'$D(^FBAA(161.26,"AD",FBAATD)),'$D(^FBAA(161.96,"AD",FBAATD)) W !!,*7,"No MRA's were transmitted on that date!" G ASK
  1. ;
  1. D VEND:$D(^FBAA(161.25,"AD",FBAATD)),VET:$D(^FBAA(161.26,"AD",FBAATD))
  1. ;
  1. D:$D(^FBAA(161.96,"AD",FBAATD)) IA(FBAATD) ; prepare IPAC MRAs for retransmission (FB*3.5*123)
  1. ;
  1. D RTRAN^FBAAV0
  1. END K D0,FBAATD,OCTD,J,K,XCNP,VAT Q
  1. ;
  1. VEND F J="O","P" F K=0:0 S K=$O(^FBAA(161.25,"AD",FBAATD,J,K)) Q:K'>0 I $D(^FBAA(161.25,K)) S $P(^(K,0),"^",5)="",^FBAA(161.25,"AE",J,K)="" K ^FBAA(161.25,"AD",FBAATD,J,K)
  1. Q
  1. VET W !!,?20,"Re-Transmitting",! F K=0:0 S K=$O(^FBAA(161.26,"AD",FBAATD,K)) Q:K'>0 I $D(^FBAA(161.26,K)) S $P(^(K,0),"^",5)="",$P(^(0),"^",2)="P",^FBAA(161.26,"AC","P",K)="" K ^FBAA(161.26,"AD",FBAATD,K),^FBAA(161.26,"AC","T",K)
  1. Q
  1. ;
  1. IA(XMITDT) ; Prepare IPAC Agreement MRAs for re-transmission
  1. ; Input: XMITDT - Internal date to re-transmit IPAC Agreement MRAs for
  1. ; Output: IPAC Agreement MRAs for the selected date are prepared for re-transmission
  1. ; Called From: ASK
  1. N DIE,DA,DR,DTOUT,MRAACT,MRAIEN,K,TACT,VAID,VAIEN
  1. ;
  1. ; Loop through every transmitted Patient MRA record for the specified date and
  1. ; remove the transmitted date
  1. S K=0
  1. F D Q:K'>0
  1. . S K=$O(^FBAA(161.96,"AD",XMITDT,K))
  1. . Q:'K
  1. . ;
  1. . ; IPAC vendor agreement IEN in file 161.95 for this transmitted MRA
  1. . S VAIEN=$P($G(^FBAA(161.96,K,0)),U,2),MRAIEN=""
  1. . S VAID=$P($G(^FBAA(161.96,K,0)),U,3)
  1. . ;
  1. . ; This must be an Add or a change MRA record for an Agreement that was
  1. . ; later deleted - Skip it
  1. . I VAIEN'="",'$D(^FBAA(161.95,VAIEN)) Q
  1. . I VAIEN S MRAIEN=$$PENDMRA^FBAAIAQ(VAID,.MRAACT)
  1. . ;
  1. . ; if there is an existing Pending MRA, then we'll use it and get out
  1. . I MRAIEN>0 D Q
  1. . . S TACT=$P($G(^FBAA(161.96,K,0)),U,4) ; Action value of transmitted MRA
  1. . . I TACT="A",MRAACT="C" D ; Change pending action to add action
  1. . . . S DIE=161.96,DA=MRAIEN,DR="3////A"
  1. . . . D ^DIE
  1. . ;
  1. . ; Otherwise, change the status of this MRA back to Pending and remove the Date Transmitted field
  1. . I $D(^FBAA(161.96,K)) D
  1. . . S DIE=161.96,DA=K
  1. . . S DR="4////P" ; Set the status back to Pending
  1. . . S DR=DR_";5////@" ; Remove the transmitted date from the record
  1. . . D ^DIE
  1. Q
  1. ;