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

FBNHRAT1.m

Go to the documentation of this file.
  1. FBNHRAT1 ;AISC/CMR - ENTER RATES CONT. ;9/19/2014
  1. ;;3.5;FEE BASIS;**17,154**;JAN 30, 1995;Build 12
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. VENDAT ;set up rate if contract exists
  1. N FBRATE,FBCFDT,FBCTDT,FBI,FBCNUM,FBNRFDT,FBNRTDT
  1. S FBCFDT=0
  1. I '$O(^FBAA(161.21,"AC",FBVIEN,0)) D:$G(FBDDT) CKSET(FBNFDT,FBNTDT) Q
  1. VENDAT1 K FBRET
  1. S FBCFDT=$O(^FBAA(161.21,"AC",FBVIEN,FBCFDT))
  1. I FBCFDT']"" D:$G(FBDDT) CKSET(FBNFDT,FBNTDT) Q
  1. S FBI=$O(^FBAA(161.21,"AC",FBVIEN,FBCFDT,0)) I FBI]"" S FBCTDT=$P(^FBAA(161.21,FBI,0),"^",3),FBCNUM=$P(^FBAA(161.21,FBI,0),"^")
  1. I FBNFDT=FBCFDT!(FBNFDT>FBCFDT) D G:$G(FBRET) VENDAT1 Q
  1. .I FBNFDT>FBCTDT S FBRET=1 Q
  1. .I FBNTDT=FBCTDT D SET(FBNFDT,FBNTDT,I) Q
  1. .I FBNTDT<FBCTDT D SET(FBNFDT,FBNTDT,I) Q
  1. .I FBNTDT>FBCTDT D SET(FBNFDT,FBCTDT,I) S FBNFDT=$$CDTC^FBUCUTL(FBCTDT,1),FBRET=1 Q
  1. I FBNFDT<FBCFDT D G:$G(FBRET) VENDAT1 Q
  1. .I FBNTDT<FBCFDT D:$G(FBDDT) CKSET(FBNFDT,FBNTDT) Q
  1. .I FBNTDT'>FBCTDT D:$G(FBDDT) CKSET(FBNFDT,$$CDTC^FBUCUTL(FBCFDT,-1)) S FBNFDT=FBCFDT D SET(FBNFDT,FBNTDT,I) Q
  1. .I FBNTDT>FBCTDT D:$G(FBDDT) CKSET(FBNFDT,$$CDTC^FBUCUTL(FBCFDT,-1)) S FBNFDT=FBCFDT D SET(FBNFDT,FBCTDT,I) S FBNFDT=$$CDTC^FBUCUTL(FBCTDT,1),FBRET=1 Q
  1. Q
  1. SET(FBFR,FBTO,FBDFN) ;set up rate array for pt
  1. ;FBFR and FBTO are from and to dates to establish rates for
  1. ;FBDFN=DFN for pt.
  1. ;FBNHARUP (optional)
  1. ; if = "N" the call is during payment and a rate cannot be added
  1. ; if = 1 rates are being monitored and a rate has not been added yet
  1. ; if = 11 rates are being monitored and a rate has been added
  1. ;output FBFND=1 to indicate that a gap was found to create a rate for
  1. ; FBNHARUP (optional) changed from 1 to 11 if rate added
  1. S FBFND=1
  1. W !!,*7,"Patient: ",$$NAME^FBCHREQ2(FBDFN),?40,"SSN: ",$$SSN^FBAAUTL(FBDFN)
  1. W !,?5,"Rate must be entered for the following period: ",$$DATX^FBAAUTL(FBFR)," - ",$$DATX^FBAAUTL(FBTO)
  1. I $G(FBNHARUP)'="N" S FBRATE=1 ; when not "N" allow rate to be added
  1. D DISPLAY^FBAAVD1 K FBX I '$G(FBRATE) D:$G(FBDDT) CKSET(FBFR,FBTO) Q
  1. K DD,DO S DIC="^FBAA(161.23,",DIC(0)="L",X=FBFR,DIC("DR")=".02////^S X=FBTO;.03////^S X=FB7078;.04////^S X=FBDFN;.05////^S X=FBRATE;.06////^S X=FBCNUM",DLAYGO=161.23 D FILE^DICN K DLAYGO,DIC,X
  1. I $G(FBNHARUP)=1 S FBNHARUP=11 ; let caller know a rate was added
  1. Q
  1. CKSET(FRDT,TODT) ;sets FBUNR array for timeframe unable to establish rate for.
  1. ;FBUNR array is only set if variable FBDDT is passed to subroutine
  1. ;and the attempt to create a rate (call to VENDAT) was unsuccessful.
  1. ;FBUNR array, if defined, is returned to calling program.
  1. ;FRDT=from date TODT=to date of unsuccessful rate setup
  1. S FBUNR(FRDT,TODT)=""
  1. Q