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

BPSOSQA.m

Go to the documentation of this file.
  1. BPSOSQA ;BHAM ISC/FCS/DRS/DLF - ECME background, Part 1 ;06/02/2004
  1. ;;1.0;E CLAIMS MGMT ENGINE;**1,5,7,8,10**;JUN 2004;Build 27
  1. ;;Per VHA Directive 2004-038, this routine should not be modified.
  1. Q
  1. ;
  1. ; ONE59 - Validate BPS Transaction data
  1. ; Input
  1. ; IEN59 - BPS Transaction
  1. ;
  1. ONE59(IEN59) ;EP - from BPSOSIZ
  1. ; Process this one IEN59
  1. ;
  1. ; Initialize variables
  1. N RTN,X1,REQTYPE,ERRNO,ERRMSG
  1. S RTN=$T(+0),X1=$G(^BPST(IEN59,1)),REQTYPE=$P($G(^BPST(IEN59,0)),U,15)
  1. ;
  1. ; Create log entry
  1. ; Needed for Turn-Around Stats - Do NOT delete/alter!!
  1. D LOG^BPSOSL(IEN59,$T(+0)_"-Validating the BPS Transaction")
  1. ;
  1. ; Validate that there is a request type
  1. I REQTYPE="" D ERROR^BPSOSU(RTN,IEN59,109,"Request Type not found in Transaction ") G END
  1. ;
  1. S (ERRNO,ERRMSG)=""
  1. I REQTYPE="C" D I ERRNO D ERROR^BPSOSU(RTN,IEN59,ERRNO,ERRMSG) G END
  1. . N RX,RXR
  1. . S RX=$P(X1,U,11),RXR=$P(X1,U)
  1. . I RX="" S ERRNO=108,ERRMSG="Prescription Number not found in Transaction" Q
  1. . I RXR="" S ERRNO=107,ERRMSG="Fill Number not found in Transaction" Q
  1. . I $$RXAPI1^BPSUTIL1(RX,.01,"I")="" S ERRNO=101,ERRMSG="Missing RX # field .01" Q
  1. . I RXR,$$RXSUBF1^BPSUTIL1(RX,52,52.1,RXR,.01,"I")="" S ERRNO=102,ERRMSG="Missing RX Refill field .01" Q
  1. ;
  1. ; Check for missing patient
  1. I '$P(^BPST(IEN59,0),U,6) D ERROR^BPSOSU(RTN,IEN59,103,"Patient missing from BPS Transaction") G END
  1. ;
  1. ; Check for missing division
  1. I '$P(X1,U,4) D ERROR^BPSOSU(RTN,IEN59,104,"Division missing from BPS Transaction") G END
  1. ;
  1. ; Check for missing BPS Pharmacy
  1. I '$P(X1,U,7)="" D ERROR^BPSOSU(RTN,IEN59,105,"ECME Pharmacy missing from BPS Transaction") G END
  1. ;
  1. ; Check for missing insurance node
  1. I '$D(^BPST(IEN59,10,1,0)) D ERROR^BPSOSU(RTN,IEN59,106,"Missing Insurance in BPST("_IEN59_",10,1,0)") G END
  1. ;
  1. ; If we got this far, we did not get an error
  1. ; Change status to 30 (Waiting for packet build)
  1. D SETSTAT^BPSOSU(IEN59,30)
  1. ;
  1. END ; Common exit point
  1. ;
  1. ; Log payer sequence
  1. N BPSCOB
  1. S BPSCOB=$$COB59^BPSUTIL2(IEN59),BPSCOB=$S(BPSCOB=2:"-Secondary",BPSCOB=3:"-Tertiary",1:"-Primary"),BPSCOB=BPSCOB_" Insurance"
  1. D LOG^BPSOSL(IEN59,$T(+0)_BPSCOB)
  1. ;
  1. ; Log the contents of Transaction record
  1. D LOG^BPSOSL(IEN59,$T(+0)_"-Contents of ^BPST("_IEN59_"):")
  1. D LOG59(IEN59)
  1. ;
  1. ; If there are claims at 30%, fire up the packet process
  1. I $O(^BPST("AD",30,0)) D TASK
  1. Q
  1. ;
  1. ;
  1. LOG59(IEN59) ; Log the IEN59 array
  1. N A
  1. M A=^BPST(IEN59)
  1. D LOGARRAY^BPSOSL(IEN59,"A")
  1. Q
  1. ;
  1. TASK ;EP - from BPSOSQ2,BPSOSQ4,BPSOSRB
  1. N X,%DT,Y S X="N",%DT="ST" D ^%DT
  1. D TASKAT(Y)
  1. Q
  1. ;
  1. TASKAT(ZTDTH) ;EP - from BPSOSQ4 (requeue if insurer is sleeping)
  1. N ZTRTN,ZTIO
  1. S ZTRTN="PACKETS^BPSOSQ2",ZTIO=""
  1. D ^%ZTLOAD
  1. Q