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

FBNPILK.m

Go to the documentation of this file.
  1. FBNPILK ;AISC/CLT, NPI lookup routine ;11 Apr 2006 3:02 PM
  1. ;;3.5;FEE BASIS;**98**;JAN 30, 1995;Build 54
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. ;This routine receives the IEN for the Fee Basis Vendor file (#161.2)
  1. ;and returns the NPI for that entry.
  1. ;
  1. ;This routine also performs a duplicate check to insure that only one vendor has
  1. ;a specific NPI in the FEE BASIS VENDOR file (#161.2)
  1. ;
  1. EN(IEN) ;ENTRY POINT IF IEN IN FEE BASIS VENDOR FILE (#161.2) IS KNOWN
  1. ;The variable passed in is the IEN or DA or the entry in the FEE BASIS VENDOR
  1. ;file (#161.2). Returned will be the variable FBNPI which is the NPI
  1. ;of the entry. If the NPI is not entered the variable FBNPI will equal null
  1. ;and 10 spaces will be returned.
  1. ;
  1. N DIC,Y,FBNPI
  1. D:IEN=""
  1. .S DIC="^FBAAV(",DIC(0)="AEQM",DIC("A")="ENTER VENDOR NAME: " D ^DIC G:Y'>0 XIT
  1. .S IEN=+Y
  1. S FBNPI=$$GET1^DIQ(161.2,IEN,41.01)
  1. Q $S(FBNPI="":" ",1:FBNPI)
  1. ;
  1. DUP(FBNPI) ;LOOK FOR DUPLICATE ENTRIES
  1. ;This subroutine will review the FEE BASIS VENDOR file (#161.2) cross reference NPI to
  1. ;determine if the NPI entered is unique and not assigned to another entity.
  1. ;This subroutine takes the value of the variable X from the fileman entry into file 161.2,
  1. ;field 41.01 (NPI) through the input transform using the input variable of X, assigns it
  1. ;to the variable FBNPI and performs the lookup using the "NPIHISTORY" cross reference in the file
  1. ;#161.2. If the NPI is not a duplicate entry a null value will be returned in FBRTN. If
  1. ;the variable FBRTN is a number larger than zero it means the transform lookup has failed
  1. ;and the NPI entered is a duplicate entry. This tag expects the variable DA to be the ien
  1. ;of the current entry in field name (#.01).
  1. ;The input transform is coded as follows: K:$L(X)>10!($L(X)<10)!('$$CHKDGT^XUSNPI(X))!($$DUP^FBNPILK(X)>0) X
  1. N FBLOOP,FBRTN S FBRTN=""
  1. S FBLOOP="" F S FBLOOP=$O(^FBAAV("NPIHISTORY",FBNPI,FBLOOP)) Q:FBLOOP="" S FBRTN=$G(FBLOOP) D:FBLOOP'=DA!('$D(^FBAAV("NPI",FBNPI,DA)))
  1. .W !,"The NPI of ",FBNPI," is now, or was in the past, assigned to: ",?47,$P(^FBAAV(FBLOOP,0),U,1)
  1. Q FBRTN
  1. XIT ;EXIT AND CLEAN
  1. K DIC,X,Y
  1. Q " "