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

FBXIP116.m

Go to the documentation of this file.
  1. FBXIP116 ;DALOI/KML-PATCH INSTALL ROUTINE ; 11/19/2010
  1. ;;3.5;FEE BASIS;**116**;JAN 30, 1995;Build 30
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. Q:'$G(XPDENV) ; routine is to be called only during install package option
  1. ; check for invoices totaling $0 that exist in batches that are "in-process"
  1. ; batches to examine are those that are in statuses of:
  1. ; "C" = CLERK CLOSED
  1. ; "R" = REVIEWED AFTER PRICER
  1. ; "S" = SUPERVISOR CLOSED
  1. ; if any zero dollar invoices exist
  1. ; the invoices will need to be reported and the patch install cannot occur
  1. W !,"Environmental check routine is executing."
  1. N DD,DO,DIE,DR,X,Y
  1. N FBSTAT,FBX,FB0,FBT,FBN,FBBATCH,FBINV
  1. K ^TMP("FBXIP116")
  1. F FBSTAT="C","R","S" D
  1. . S FBN=0
  1. . F S FBN=$O(^FBAA(161.7,"AC",FBSTAT,FBN)) Q:'FBN D
  1. . . S FB0=$G(^FBAA(161.7,FBN,0))
  1. . . S FBT=$P(FB0,U,3),FBBATCH=$P(FB0,U)
  1. . . I FBT]"","B3,B5,B9"[FBT D @FBT
  1. I $D(FBINV) D GZERO
  1. I $D(XPDABORT) W !,$C(7),"There are invoices that need further processing before installation of patch can be performed.",!,"Installation of patch has terminated"
  1. Q
  1. ;
  1. B3 ; process outpatient/ancillary batch
  1. Q:FBT'="B3"
  1. N DA,FBAAIN,FBAMTPD,FBY0
  1. ; loop thru items in batch and build list of invoices and their $
  1. S DA(3)=0 F S DA(3)=$O(^FBAAC("AC",FBN,DA(3))) Q:'DA(3) D
  1. . S DA(2)=0 F S DA(2)=$O(^FBAAC("AC",FBN,DA(3),DA(2))) Q:'DA(2) D
  1. . . S DA(1)=0
  1. . . F S DA(1)=$O(^FBAAC("AC",FBN,DA(3),DA(2),DA(1))) Q:'DA(1) D
  1. . . . S DA=0
  1. . . . F S DA=$O(^FBAAC("AC",FBN,DA(3),DA(2),DA(1),DA)) Q:'DA D
  1. . . . . S FBY0=$G(^FBAAC(DA(3),1,DA(2),1,DA(1),1,DA,0))
  1. . . . . S FBAAIN=$P(FBY0,U,16)
  1. . . . . S FBAMTPD=$P(FBY0,U,3)
  1. . . . . I FBAAIN]"" S FBINV(3,FBBATCH,FBAAIN)=$G(FBINV(3,FBBATCH,FBAAIN))+FBAMTPD
  1. Q
  1. ;
  1. B5 ; processes pharmacy batch
  1. Q:FBT'="B5"
  1. N DA,FBAAIN,FBAMTPD,FBRXY0,FBY0
  1. ;
  1. ; loop thru items in batch and build list of invoices and their $
  1. S DA(1)=0 F S DA(1)=$O(^FBAA(162.1,"AE",FBN,DA(1))) Q:'DA(1) D
  1. . S DA=0 F S DA=$O(^FBAA(162.1,"AE",FBN,DA(1),DA)) Q:'DA D
  1. . . S FBY0=$G(^FBAA(162.1,DA(1),0))
  1. . . S FBRXY0=$G(^FBAA(162.1,DA(1),"RX",DA,0))
  1. . . S FBAAIN=$P(FBY0,U)
  1. . . S FBAMTPD=$P(FBRXY0,U,16)
  1. . . I FBAAIN]"" S FBINV(5,FBBATCH,FBAAIN)=$G(FBINV(5,FBBATCH,FBAAIN))+FBAMTPD
  1. Q
  1. ;
  1. B9 ; processes inpatient batch
  1. Q:FBT'="B9"
  1. N DA,FBAAIN,FBAMTPD,FBY0
  1. ;
  1. ; loop thru items in batch and save zero dollar invoices
  1. S DA=0 F S DA=$O(^FBAAI("AC",FBN,DA)) Q:'DA D
  1. . S FBY0=$G(^FBAAI(DA,0))
  1. . S FBAAIN=$P(FBY0,U)
  1. . S FBAMTPD=$P(FBY0,U,9)
  1. . Q:+FBAMTPD>0
  1. . S FBINV(9,FBBATCH,FBAAIN)=""
  1. Q
  1. ;
  1. GZERO ; loop thru invoices and save invoices with 0.00 payment
  1. N FBT,FBAAIN,FBBN
  1. S (FBBN,FBAAIN)=0
  1. F FBT=3,5,9 D
  1. . F S FBBN=$O(FBINV(FBT,FBBN)) Q:FBBN="" D
  1. . . F S FBAAIN=$O(FBINV(FBT,FBBN,FBAAIN)) Q:FBAAIN="" D
  1. . . . I +FBINV(FBT,FBBN,FBAAIN)'>0 S FBINV(FBT,FBBN,FBAAIN)="" Q
  1. . . . K FBINV(FBT,FBBN,FBAAIN)
  1. I $D(FBINV) S XPDABORT=2 D BULLETIN
  1. Q
  1. ;
  1. BULLETIN ;
  1. N FBT,FBI,FBBN,FBL,FBTYP
  1. S ^TMP("FBXIP116",$J,1)="The Fee Basis patch FB*3.5*116 did not get installed because there exist"
  1. S ^TMP("FBXIP116",$J,2)="invoice(s) in Fee Basis payment batches that have a total AMOUNT PAID of "
  1. S ^TMP("FBXIP116",$J,3)="$0.00. Once patch 116 is installed the system will not allow an invoice"
  1. S ^TMP("FBXIP116",$J,4)="that totals $0. The patch will also begin the transmission of 0.00"
  1. S ^TMP("FBXIP116",$J,5)="payment lines to Central Fee in Austin; however, $0 invoices are not"
  1. S ^TMP("FBXIP116",$J,6)="accepted by FMS. There are one or two actions that must be taken before"
  1. S ^TMP("FBXIP116",$J,7)="patch 116 can be installed on your system:"
  1. S ^TMP("FBXIP116",$J,8)="1. Execute the Queue Data for Transmission option to transmit the"
  1. S ^TMP("FBXIP116",$J,9)=" batches with the $0 invoices since pre-patched software will prevent"
  1. S ^TMP("FBXIP116",$J,10)=" $0 payment lines from being transmitted to Central Fee."
  1. S ^TMP("FBXIP116",$J,11)="2. If a given batch is in a pre-released state ('CLOSED' or 'REVIEWED"
  1. S ^TMP("FBXIP116",$J,12)=" AFTER PRICER'), the batch can be re-opened and the invoice(s) can be"
  1. S ^TMP("FBXIP116",$J,13)=" edited to have an AMOUNT PAID greater than 0.00 or the invoice(s)"
  1. S ^TMP("FBXIP116",$J,14)=" will need to be removed from the associated batch."
  1. S ^TMP("FBXIP116",$J,15)=""
  1. S ^TMP("FBXIP116",$J,16)="Once the invoices have been reconciled, the Fee Basis patch can be installed."
  1. S ^TMP("FBXIP116",$J,17)=""
  1. S ^TMP("FBXIP116",$J,18)=" Invoice(s) Totaling Zero Dollars"
  1. S ^TMP("FBXIP116",$J,19)="Batch Type Batch Invoice"
  1. S ^TMP("FBXIP116",$J,20)="====================================================="
  1. S FBL=20,(FBBN,FBI)=0
  1. F FBT=3,5,9 D
  1. . S FBTYP=$S(FBT=3:"Medical Fee",FBT=5:"Pharmacy",FBT=9:"Civil Hospital",1:"*****")
  1. . I $D(FBINV(FBT)) F S FBBN=$O(FBINV(FBT,FBBN)) Q:'FBBN D
  1. . . F S FBI=$O(FBINV(FBT,FBBN,FBI)) Q:'FBI D
  1. . . . S FBL=FBL+1,^TMP("FBXIP116",$J,FBL)=FBTYP_" "_FBBN_" "_FBI
  1. D SENDMAIL
  1. Q
  1. ;
  1. SENDMAIL ;
  1. N DIFROM,XMDUZ,XMSUB,XMTEXT,XMY
  1. S XMSUB="FB*3.5*116 - Zero Dollar Invoices exist."
  1. S XMDUZ=.5
  1. S XMTEXT="^TMP(""FBXIP116"",$J,"
  1. S XMY("G.FEE")="",XMY(DUZ)=""
  1. D ^XMD
  1. Q
  1. ;
  1. TEST ; loop thru invoices and save invoices with 0.00 payment
  1. S CNT=0,BN=12300,INV=17900
  1. F FBT=3,5,9 D
  1. . F I=1:1:25 S CNT=CNT+1,BN=BN+CNT,INV=INV+CNT,FBINV(FBT,BN,INV)=""
  1. D BULLETIN
  1. Q
  1. ;
  1. ;FBXIP116