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

IBCNSU1.m

Go to the documentation of this file.
  1. IBCNSU1 ;ALB/AAS - INSURANCE UTILITY ROUTINE ; 19-MAY-93
  1. ;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. RCHK(X) ; -- Input transform for different revenue codes in file 36
  1. ; Returns 1 if passes, 0 if not pass input transform
  1. ;
  1. N I,Y,RC,NO S Y=0
  1. I $G(X)="" G RCHKQ
  1. F I=1:1 S RC=$P(X,",",I) Q:RC="" I $S(RC?3N:0,RC?5N:0,1:1) S NO=1 Q
  1. I '$G(NO) S Y=1
  1. RCHKQ Q Y
  1. ;
  1. BU(DFN,IBCPOL,IBYR,IBCDFN,IBASK) ; -- Return entry in Benefits Used file
  1. ; Input: IBCDFN = pointer to patient file policy (2.312)
  1. ; DFN = patient pointer
  1. ; IBCPOL = pointer to health insurance policy file
  1. ; IBYR = fileman internal date, year will be calendar
  1. ; year of the internal date, Default = dt
  1. ; IBASK = 1 if want to ask okay to add new entry
  1. ;
  1. ; Output: IBCBU = pointer to Benefits Used file if added,
  1. ; else null
  1. ;
  1. N DIR,IBCBU
  1. S IBCBU=""
  1. I $G(IBCPOL)="" G BUQ
  1. I $G(IBYR)="" S IBYR=DT
  1. ;
  1. ;if no match display message
  1. I '$O(^IBA(355.4,"APY",IBCPOL,-IBYR,0)) W !!,"You cannot add a new Benefits Used BENEFIT YEAR",!! G BUQ
  1. ;
  1. ; -- try to find entry for policy for year
  1. S IBCBU=$O(^IBA(355.5,"APPY",DFN,IBCPOL,-IBYR,IBCDFN,0))
  1. ;
  1. ; -- if no match add new entry
  1. I 'IBCBU D
  1. .I $G(IBASK) S DIR(0)="Y",DIR("A")="Are you adding a new Benefits Used YEAR",DIR("B")="YES" D ^DIR I $D(DIRUT)!(Y<1) S VALMQUIT="" Q
  1. .S IBCBU=$$ADDBU(DFN,IBCPOL,IBYR,IBCDFN)
  1. .Q
  1. ;
  1. BUQ Q IBCBU
  1. ;
  1. ADDBU(DFN,IBCPOL,IBYR,IBCDFN) ; -- add entries to Benefits Used file
  1. ; Input: DFN = pointer to patient file
  1. ; IBCDFN = point to patient policy (2.312)
  1. ; IBCPOL = pointer to health insurance policy file
  1. ; IBYR = fileman internal date, year will be calendar
  1. ; year of the internal date, Default = dt
  1. ;
  1. ; Output: IBCBU = pointer to Benefits Used file if added,
  1. ; else null
  1. ;
  1. N %DT,IBN1,IBCBU,DIC,DIE,DR,DA,DLAYGO,DO,DD
  1. S IBCBU=""
  1. I $G(IBCDFN)="" G ADDBUQ
  1. I $G(IBCPOL)="" G ADDBUQ
  1. I $G(IBYR)="" S IBYR=DT
  1. K DD,DO,DIC,DR S DIC="^IBA(355.5,",DIC(0)="L",DLAYGO=355.5
  1. ;
  1. ;S IBYR=$E(IBYR,1,3)_"0000"
  1. S X=IBCPOL D FILE^DICN I +Y<0 G ADDBUQ
  1. S (IBCBU,DA)=+Y,DIE="^IBA(355.5,",DR=".02////"_DFN_";.03////"_IBYR_";.17////"_IBCDFN_";1.01///NOW;1.02////"_DUZ
  1. D ^DIE K DIC,DIE,DA,DR
  1. ADDBUQ Q IBCBU