FBUTL ;WCIOFO/SAB-FEE BASIS UTILITY ;4/8/2004 ;;3.5;FEE BASIS;**16,78**;JAN 30, 1995 Q ; AUTH(FBDA,FBCUT) ; FEE Authorization extrinsic function ; Determines if the patient has any FEE authorizations on file. ; An optional date can be specified to determine if the patient has ; any FEE authorizations in effect on or after the specified date. ; input ; FBDA - patient internal entry number (DFN) ; of the PATIENT (#2) and FEE BASIS PATIENT (#161) file ; FBCUT - (optional) cutoff date (fileman format) ; Default: none ; authorizations with a TO DATE prior to the ; cutoff date (if specified) will not be considered. ; returns a value of 1 or 0 ; will be true (1) if patient has one or more FEE authorizations ; N FBDA1,FBRET,FBY0 S FBCUT=$S($G(FBCUT)?7N:FBCUT,1:"") S FBRET=0 ; assume no authorizations will meet criteria ; reverse loop thru authorizations - stop when any one meets criteria S FBDA1=" " F S FBDA1=$O(^FBAAA(FBDA,1,FBDA1),-1) Q:'FBDA1 D Q:FBRET . Q:$P($G(^FBAAA(FBDA,1,FBDA1,"ADEL")),U)="Y" ; ignore Austin Deleted . S FBY0=$G(^FBAAA(FBDA,1,FBDA1,0)) . I FBCUT]"",$P(FBY0,U,2)