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

BPSRPC01.m

Go to the documentation of this file.
  1. BPSRPC01 ;AITC/PD - ECME TAS RPC - Extract Txn IENs;7/30/2018
  1. ;;1.0;E CLAIMS MGMT ENGINE;**27,34**;JUN 2004;Build 11
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. Q
  1. ;
  1. RPC2(RESULT,ARGS) ; RPC: BPS TAS TXN IENS NEW
  1. ;
  1. ; At the TAS level, a Process Manager will be continually executing.
  1. ; The Process Manager will execute specific RPCs in each VistA. The
  1. ; purpose of this RPC is to transmit BPS Log of Transaction IENs to be
  1. ; stored in the WorkQueue on TAS. Another RPC will process the IENs
  1. ; from the WorkQueue, transmitting the data to be used by Power BI to TAS.
  1. ;
  1. ; RESULT - Output - JSON formatted array of transaction IENs
  1. ;
  1. N BPS57,BPSCNT,BPSCOUNT,BPSFLAG,BPSTMP,BPSTMP1
  1. ;
  1. S BPSTMP="^TMP($J,""BPSRPC2"",""IENS"")"
  1. S BPSTMP1="^TMP($J,""BPSRPC2"")"
  1. K @BPSTMP1
  1. S RESULT=$NA(^TMP("JSON",$J)) K @RESULT
  1. ;
  1. ; Create log if requested
  1. I $G(ARGS("LOG")) D LOG^BPSRPC02("ARGS")
  1. S BPSCOUNT=$G(ARGS("COUNT"))
  1. I BPSCOUNT="" S BPSCOUNT=2500
  1. ;
  1. S BPSCNT=0
  1. ;
  1. ; Loop through Claims identified as needing to be transmitted to TAS
  1. ;
  1. ; Loop through BPS LOG OF TRANSACTIONS file - "C" index
  1. ; Loop through entries with flag set as 2 first to pick up entries
  1. ; that previously transmitted but didn't receive a successful writeback
  1. ; indicator.
  1. ;
  1. F BPSFLAG=2,1 D
  1. . S BPS57=""
  1. . F S BPS57=$O(^BPSTL("C",BPSFLAG,BPS57),-1) Q:'BPS57!(BPSCNT>(BPSCOUNT-1)) D
  1. . . S BPSCNT=$G(BPSCNT)+1
  1. . . S @BPSTMP@(BPSCNT,"TxnIEN")=BPS57
  1. . . S @BPSTMP@("B",BPS57)=""
  1. . . ;
  1. . . ; Update MCCF EDI TAS Progress flag to be 2
  1. . . ; 2 = SENT
  1. . . N BPSA,BPSFN,BPSREC
  1. . . S BPSFN=9002313.57
  1. . . S BPSREC=BPS57_","
  1. . . S BPSA(BPSFN,BPSREC,20)=2
  1. . . D FILE^DIE("","BPSA","")
  1. ;
  1. ; No Txns Found - Set ^TMP array to show nothing found before calling
  1. ; ENCODE logic.
  1. I BPSCNT=0 S @BPSTMP@(1,"TxnIEN")=""
  1. ;
  1. ; Remove "B" index before creating JSON file
  1. K @BPSTMP@("B")
  1. ;
  1. ; Encode ^TMP array data into JSON formatted array (RESULT)
  1. D ENCODE^XLFJSON(BPSTMP1,RESULT)
  1. S @RESULT@(1)="["_@RESULT@(1)
  1. S LAST=$O(@RESULT@(""),-1)
  1. S @RESULT@(LAST)=@RESULT@(LAST)_"]"
  1. ;
  1. K @BPSTMP1
  1. ;
  1. Q