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

RCFMFN02.m

Go to the documentation of this file.
RCFMFN02 ;WASH-ISC@ATLOONA,PA/RGY-Return information for FMS Document processing ;8/27/94  8:40 PM
V ;;4.5;Accounts Receivable;**114,204,173**;Mar 20, 1995
 ;;Per VHA Directive 10-93-142, this routine should not be modified.
DEL(ID) ;Delete entry from DOCUMENT file (347)
 NEW DA
 I '$D(ID) Q
 S DA=+$O(^RC(347,"C",ID,0)) S:'DA DA=+$O(^RC(347,"D",ID,0))
 I '$D(^RC(347,DA,0)) Q
 D DEL^RCFMPUR(DA)
 Q
SSTAT(ID,STAT) ;Set status for DOCUMENT file (347)
 NEW %DT,D,D0,DA,DI,DIC,DIE,DQ,DR,X
 I '$D(ID) Q
 S DA=+$O(^RC(347,"C",ID,0)) S:'DA DA=+$O(^RC(347,"D",ID,0))
 I '$D(^RC(347,DA,0)) Q
 I ",0,1,2,3,"'[(","_$G(STAT)_",") Q
 S DIE="^RC(347,",DR=".05///^S X=""NOW"";.03////^S X="_STAT D ^DIE
 ;Update the FMS TRAMSISSION DATE in files 430 and 347
 S FMSDT=$S($G(FMSDT):FMSDT,1:DT)
 ;DA is already set above
 I $D(^RC(347,DA,2)) K ^RC(347,"FMS",^RC(347,DA,2),DA)
 S ^RC(347,DA,2)=FMSDT,^RC(347,"FMS",FMSDT,DA)=""
 ;need to set DA for file 430... from the AR Bill number from file 347.
 S DA=$P($G(^RC(347,DA,0)),"^",7) I DA D
 .I $D(^PRCA(430,DA,203)) K ^PRCA(430,"FMS",^PRCA(430,DA,203),DA)
 .S ^PRCA(430,DA,203)=FMSDT,^PRCA(430,"FMS",FMSDT,DA)=""
 Q
GSTAT(ID) ;Get status for DOCUMENT file (347)
 NEW DA
 I '$D(ID) Q -1
 S DA=+$O(^RC(347,"C",ID,0)) S:'DA DA=+$O(^RC(347,"D",ID,0))
 I '$D(^RC(347,DA,0)) Q -1
 Q $P(^RC(347,DA,0),"^",3)
RETN(ID,ST) ;Process return document from stacker
 NEW DA
 I '$D(ID) Q
 ;line removed to accomodate full fms doc number - CLH
 S ST=$G(ST),ST=$S(ST="A":2,ST="R":3,1:-1)
 I ST<0 Q
 ;  if a CR document and it rejects, send message to users
 I $S($E(ID,1,3)="CR-":1,$E(ID,1,3)="TR-":1,1:0),ST=3 D MAILREJ(ID)
 D SSTAT(ID,ST)
 Q
STSTAT(DA,ST) ;set processed status in 433 (used for summary docs)
 Q:'$D(DA)
 Q:'$D(ST)
 Q:'$D(^PRCA(433,DA,0))
 N DIE,DR
 S DIE="^PRCA(433,",DR="91///^S X="_ST D ^DIE
 Q
GTSTAT(DA) ;function to return transaction status
 I DA<0 Q -1
 I '$D(^PRCA(433,DA,8)) Q -1
 Q $P(^PRCA(433,DA,0),U,9)
 ;
 ;
MAILREJ(DOCUMENT) ;  mail reject message to user to ask for retransmission
 N MESSAGE,RECEIPT,XCNP,XMDUZ,XMZ,RCCR
 S RCCR=$S($E(DOCUMENT,1,3)="CR-":1,$E(DOCUMENT,1,4)="TR-":2,1:0)
 S MESSAGE(1)="The following "_$E(DOCUMENT,1,2)_" FMS document rejected and needs to be retransmitted."
 S MESSAGE(2)=" "
 S MESSAGE(3)="        Document: "_DOCUMENT
 S MESSAGE(4)=" "
 ;  show information for cash receipt/transfer receipt for EDI document
 I RCCR D
 .   S MESSAGE(5)="You may regenerate this "_$P("cash^transfer",U,RCCR)_" receipt document by selecting the"
 .   S MESSAGE(6)="option Process Receipt (PR) located under the Receipt Processing"
 .   S MESSAGE(7)="Listmanager screen."
 .   S RECEIPT=$P($G(^RCY(344,+$O(^RCY(344,"ADOC",DOCUMENT,0)),0)),"^")
 .   I RECEIPT'="" S MESSAGE(8)=" ",MESSAGE(9)="  This "_$P("cash^transfer",U,RCCR)_" receipt document was generated by receipt "_RECEIPT_"."
 ;
 S XMTEXT="MESSAGE("
 S XMSUB="FMS "_$S(RCCR'=2:"Cash",1:"Transfer")_" Receipt Document Rejected"
 S XMDUZ="AR Package",XMY("G.RCDP PAYMENTS")=""
 D ^XMD
 Q