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

FBLTCAR.m

Go to the documentation of this file.
  1. FBLTCAR ;WOIFO/SS - LTC AUTHORIZATIONS REPORTS ;5/16/2014
  1. ;;3.5;FEE BASIS;**49,154**;JAN 30, 1995;Build 12
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. Q
  1. ;LTC Ending and Active Authorization Reports
  1. ;
  1. ;
  1. EXPO ;entry point for LTC Outpatient Ending Authorization Report
  1. N FBLTCRT,FBLTCPR
  1. S FBLTCPR="OUTPATIENT"
  1. S FBLTCRT=1 ;Ending Expiration report
  1. D EN^FBLTCAR2
  1. Q
  1. ;
  1. EXPC ;entry point for LTC CHN Ending Authorization Report
  1. N FBLTCRT,FBLTCPR
  1. S FBLTCPR="CONTRACT NURSING HOME"
  1. S FBLTCRT=1 ;Ending Expiration report
  1. D EN^FBLTCAR2
  1. Q
  1. ;
  1. ACTO ;entry point for LTC Outpatient Active Authorization Report
  1. N FBLTCRT,FBLTCPR
  1. S FBLTCPR="OUTPATIENT"
  1. S FBLTCRT=2 ;Active authorizations report
  1. D EN^FBLTCAR2
  1. Q
  1. ACTC ;entry point for LTC CHN Active Authorization Report
  1. N FBLTCRT,FBLTCPR
  1. S FBLTCPR="CONTRACT NURSING HOME"
  1. S FBLTCRT=2 ;Active authorizations report
  1. D EN^FBLTCAR2
  1. Q
  1. ;
  1. ;/*
  1. ;check if exclude/include the aithorization in report
  1. ;INPUT:
  1. ;FBAUTHFR - authorization date FROM
  1. ;FBAUTHTO - authorization date TO
  1. ;FBRPTFR - report for date FROM
  1. ;FBRPTTO - report for date TO
  1. ;FBRPTYPE - type of report:
  1. ; 1-authorization Ending report
  1. ; 2-Active authorization report
  1. ;OUTPUT:
  1. ;1 - exclude
  1. ;0 - include
  1. LTCRPT(FBAUTHFR,FBAUTHTO,FBRPTFR,FBRPTTO,FBRPTYPE) ;
  1. Q:FBRPTYPE=0 0
  1. ;authorization Ending report
  1. I FBRPTYPE=1 Q:((FBAUTHTO'<FBRPTFR)&(FBAUTHTO'>FBRPTTO)) 0 Q 1
  1. ;Active authorization report
  1. I FBRPTYPE=2 Q:((FBAUTHTO<FBRPTFR)!(FBAUTHFR>FBRPTTO)) 1 Q 0
  1. Q 0
  1. ;
  1. ;
  1. ;FBPTDFN - patient ien in file #2
  1. ;FB161P - pointer to multiple in file #161 under the DFN
  1. ;FBVEND - vendor
  1. ;FBDTB - begin date of the user specified date range
  1. ;FBDTE - end date of the user specified date range
  1. ;FBAUBEG - begin date of authorization
  1. ;FBAUEND - end date of authorization
  1. ;
  1. ;OUTPUT:
  1. ; string to print
  1. ;
  1. PRNVIS(FBPTDFN,FB161P,FBVEND,FBDTB,FBDTE,FBAUBEG,FBAUEND) ;
  1. N FBRET1,FBRETAR,FBVNDR
  1. S FBRETAR=""
  1. S FBRET1=$$GETVIS(FBPTDFN,FB161P,FBDTB,$S(FBAUEND>FBDTE:FBDTE,1:FBAUEND),FBAUBEG,.FBRETAR)
  1. I FBVEND="not specified" D ;if vendor was not specified in (#161)
  1. . ;loop thru vendors (#162) under this authorization
  1. . S FBVNDR="" F S FBVNDR=$O(FBRETAR(FBVNDR)) Q:FBVNDR="" D
  1. . . W !,?6,"Vendor: "_$S(FBVNDR>0:$P($G(^FBAAV(FBVNDR,0)),U),1:"not specified")
  1. . . W !,?6,"Visits: "_$G(FBRETAR(FBVNDR,1)),?19,"Paid Amt: $"_$G(FBRETAR(FBVNDR,2)),?39,"Cum Visits: "_$G(FBRETAR(FBVNDR,3)),?56,"Cum Paid Amt: $"_$G(FBRETAR(FBVNDR,4))
  1. . W !,?6,"---"
  1. W !,?6,"Visits: "_$P(FBRET1,U,1),?19,"Paid Amt: $"_$P(FBRET1,U,2),?39,"Cum Visits: "_$P(FBRET1,U,3),?56,"Cum Paid Amt: $"_$P(FBRET1,U,4)
  1. Q
  1. ;
  1. ;INPUT:
  1. ;FBPATDFN - patient ien in file #2
  1. ;FB161 - pointer to multiple in file #161 under the DFN
  1. ;FBBEG - begin date of the user specified date range
  1. ;FBEND - end date of the user specified date range
  1. ;FBAUTB - begin date of authorization
  1. ;
  1. ;OUTPUT:
  1. ; returns number_of_visits^total amount^cumulative_number_of_visits^cumulative_total amount
  1. ; FBRET - array with results
  1. GETVIS(FBPATDFN,FB161,FBBEG,FBEND,FBAUTB,FBRET) ;
  1. N FBVND,FBINDT,FBINITDT,FBCPT,FBAMT,FBCNT,FBCMAMT,FBCMCNT,FBDTCPT,FBBB,FBCPTN,FBAMT1
  1. ; auth,patient,vendor
  1. S (FBCNT,FBAMT,FBCMCNT,FBCMAMT)=0
  1. S FBVND=0 F S FBVND=$O(^FBAAC("AFN",FB161,FBPATDFN,FBVND)) Q:+FBVND=0 D
  1. . F FBBB=1:1:4 S FBRET(FBVND,FBBB)=0
  1. . ;auth,patient,vendor,date
  1. . S FBINDT=0 F S FBINDT=$O(^FBAAC("AFN",FB161,FBPATDFN,FBVND,FBINDT)) Q:+FBINDT=0 D
  1. . . ;determine a date value
  1. . . S FBINITDT=+$G(^FBAAC(FBPATDFN,1,FBVND,1,FBINDT,0))
  1. . . Q:FBINITDT=0
  1. . . I FBINITDT>FBEND Q ;out of date range
  1. . . ;auth,patient,vendor,date,service
  1. . . S FBCPT=0 F S FBCPT=$O(^FBAAC("AFN",FB161,FBPATDFN,FBVND,FBINDT,FBCPT)) Q:+FBCPT=0 D
  1. . . . S FBCPTN=+$G(^FBAAC(FBPATDFN,1,FBVND,1,FBINDT,1,FBCPT,0))
  1. . . . S FBAMT1=+$P($G(^FBAAC(FBPATDFN,1,FBVND,1,FBINDT,1,FBCPT,0)),"^",3)
  1. . . . ; cumulative (from the begining of authorization till the end of user's date range)
  1. . . . I FBINITDT'<FBAUTB S FBCMAMT=FBCMAMT+FBAMT1,FBRET(FBVND,4)=FBRET(FBVND,4)+FBAMT1 S:'$D(FBDTCPT(FBINITDT,FBCPTN)) FBCMCNT=FBCMCNT+1,FBRET(FBVND,3)=FBRET(FBVND,3)+1
  1. . . . ; for user specified date range
  1. . . . I FBINITDT'<FBBEG S FBAMT=FBAMT+FBAMT1,FBRET(FBVND,2)=FBRET(FBVND,2)+FBAMT1 S:'$D(FBDTCPT(FBINITDT,FBCPTN)) FBCNT=FBCNT+1,FBRET(FBVND,1)=FBRET(FBVND,1)+1
  1. . . . S:'$D(FBDTCPT(FBINITDT,FBCPTN)) FBDTCPT(FBINITDT,FBCPTN)=""
  1. S FBRET=FBCNT_"^"_FBAMT_"^"_FBCMCNT_"^"_FBCMAMT
  1. Q FBRET
  1. ;
  1. ;
  1. ;FBLTCAR