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

IB20P389.m

Go to the documentation of this file.
  1. IB20P389 ;ALB/ARH - IB*2.0*389 POST INIT: PROSTHETICS ITEM REPLACEMENT ; 20-FEB-2008
  1. ;;2.0;INTEGRATED BILLING;**389**;21-MAR-94;Build 6
  1. ;;Per VHA Directive 2004-038, this routine should not be modified.
  1. ;
  1. Q
  1. ;
  1. PRE ; Clean up DD, remove fields exported so installs clean
  1. ; TRANSFER PRICING INPT PROSTHETIC ITEMS (#351.67), ITEM (.01) Output Transform not deleted by install
  1. S DIK="^DD(351.61,",DA(1)=351.61,DA=4.04 D ^DIK K DIK,DA
  1. S DIK="^DD(351.67,",DA(1)=351.67,DA=.01 D ^DIK K DIK,DA
  1. S DIK="^DD(362.5,",DA(1)=362.5,DA=.03 D ^DIK K DIK,DA
  1. Q
  1. ;
  1. ;
  1. ; Add Prosthetics Item Name to IB BILL/CLAIMS PROSTHETICS (#362.5, .05)
  1. ; This free text Item Name (#362.5, .05) replaces the ITEM pointer (#362.5, .03) to PROS ITEM MASTER (#661)
  1. ; The free Text Item Name will be based on the RECORD (#352.5, .04) if defined, otherwise ITEM (#362.5, .03):
  1. ; - Prosthetics HISTORICAL ITEM (660,89) if patient item (#362.5, .04) defined/set
  1. ; - Item Master PRE_NIF SHORT DESCRIPTION (#441,52) if defined and Delivery Date before last edit date
  1. ; - Item Master SHORT DESCRIPTION (#441,.05) if Delivery Date is after last edit date
  1. ;
  1. ; Delete all entries in TRANSFER PRICING INPT PROSTHETIC ITEMS (#351.67) file
  1. ; List of Prosthetics Item to not bill, changed Item pointer from #661 to #661.1
  1. ;
  1. POST ;
  1. N IBA
  1. S IBA(1)="",IBA(2)=" IB*2*389 Prosthetics Item Replacement Post-Install .....",IBA(3)="" D MESG K IBA
  1. ;
  1. D PIDEL ; delete all TP Inpt Prosthetics Item (#352.67)
  1. D RBILL ; add prosthetic item name to bill record (#362.5)
  1. ;
  1. S IBA(1)="",IBA(2)=" IB*2*389 Prosthetics Item Replacement Post-Install Complete",IBA(3)="" D MESG K IBA
  1. ;
  1. Q
  1. ;
  1. PIDEL ; Delete all entries from TRANSFER PRICING INPT PROSTHETIC ITEMS (#361.67)
  1. N IBPIFN,IBCNT,DIK,DIC,DIE,DA,X,Y S IBCNT=0
  1. ;
  1. S IBPIFN=0 F S IBPIFN=$O(^IBAT(351.67,IBPIFN)) Q:'IBPIFN D
  1. . ;
  1. . S DA=IBPIFN,DIK="^IBAT(351.67," D ^DIK K DIK,DA S IBCNT=IBCNT+1
  1. ;
  1. S IBA(1)=" >> "_IBCNT_" TRANSFER PRICING INPT PROSTHETIC ITEMS deleted (#351.67)" D MESG K IBA
  1. Q
  1. ;
  1. RBILL ; Replace Bill Prosthetics Item pointer with name (#362.5)
  1. N IBPIN,IBPI0,IBDDT,IB661,IB660,IBNAME,IBCNT,DIE,DR,DA,DIC,DA,DO,X,Y S IBCNT=0
  1. ;
  1. S IBPIN=0 F S IBPIN=$O(^IBA(362.5,IBPIN)) Q:'IBPIN D
  1. . S IBPI0=$G(^IBA(362.5,IBPIN,0)) S IBDDT=+IBPI0 Q:$P(IBPI0,U,5)'=""
  1. . S IB661=+$P(IBPI0,U,3),IB660=+$P(IBPI0,U,4)
  1. . ;
  1. . S IBNAME=$$NAME(IB661,IB660,IBDDT) Q:IBNAME=""
  1. . ;
  1. . S DIE="^IBA(362.5,",DA=IBPIN,DR=".05////^S X=IBNAME" D ^DIE K DIE,DR,DA,DIC,DA,DO S IBCNT=IBCNT+1
  1. ;
  1. S IBA(1)=" >> "_IBCNT_" IB BILL/CLAIMS PROSTHETICS Records converted (#362.5)" D MESG K IBA
  1. Q
  1. ;
  1. NAME(IP661,IP660,IDDT) ; Return free text name description for item
  1. N IBNAME,IB441,IBOLD,IBNEW,IBDATE S IDDT=+$G(IDDT),IBNAME=""
  1. ;
  1. I +$G(IP660) S IBNAME=$P($G(^RMPR(660,IP660,"HST")),U,1)
  1. ;
  1. I IBNAME="",+$G(IP661) D
  1. . S IB441=+$G(^RMPR(661,+IP661,0)) Q:'IB441
  1. . S IBOLD=$P($G(^PRC(441,+IB441,9)),U,1) ; pre_nif short description
  1. . S IBNEW=$P($G(^PRC(441,+IB441,0)),U,2) ; short description
  1. . S IBDATE=$P($G(^PRC(441,+IB441,0)),U,9) ; date item created (last updated)
  1. . ;
  1. . S IBNAME=IBNEW I IBOLD'="",IDDT<IBDATE S IBNAME=IBOLD
  1. ;
  1. I $E(IBNAME,1,2)="**" S IBNAME=$P(IBNAME,"**",2)
  1. I IBNAME="" S IBNAME="PROSTHETIC ITEM"
  1. ;
  1. Q IBNAME
  1. ;
  1. MESG ;
  1. D MES^XPDUTL(.IBA)
  1. Q