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

FBNHEDTR.m

Go to the documentation of this file.
  1. FBNHEDTR ;AISC/GRR - EDIT TRANSFER TYPE FOR NURSING HOME ;9/19/2014
  1. ;;3.5;FEE BASIS;**154**;JAN 30, 1995;Build 12
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. RD1 D GETVET^FBAAUTL1 G:DFN']"" Q
  1. ;
  1. RD2 S DIC("S")="I $P(^(0),U,3)=""T""&($P(^(0),U,2)=DFN)",DIC="^FBAACNH(",DIE=DIC,DIC(0)="AEQMZ",DLAYGO=162.3,DIC("A")="Select Transfer Date/Time: " D ^DIC K DIC,DLAYGO G RD1:X="^"!(X=""),RD2:Y<0 S (DA,IFN)=+Y,FBAADT=$P(Y,U,2)
  1. S FBDA=$P(Y(0),U,5) D I $G(FBERR) D Q G RD1
  1. . I $O(^FBAACNH("AC",FBDA,DA)) W !,*7,"There are movements following this transfer that must be deleted first.",!! S FBERR=1
  1. ;
  1. S FBTR=$P(Y(0),U,7),FBLTTYP=""
  1. S FBJ=9999999.999999-FBAADT F S FBJ=$O(^FBAACNH("AF",DFN,FBJ)) Q:'FBJ S FBK=$O(^FBAACNH("AF",DFN,FBJ,0)) I $P($G(^FBAACNH(FBK,0)),"^",5)=$P(^FBAACNH(DA,0),"^",5) D Q
  1. . S FBLTTYP=$P(^FBAACNH(FBK,0),U,7)
  1. S DR="@1;6;S FBNTR=X;D CHKTR^FBNHEDTR;6////^S X=FBTR;S Y=""@1"""
  1. D ^DIE K DIE G Q:$D(DTOUT)
  1. D
  1. . N FB,FBX
  1. . S FB(161)=$S(FBDA:$P($G(^FBAACNH(FBDA,0)),"^",10),1:"")
  1. . Q:'FB(161)
  1. . I $D(^FBAAA(DFN,1,FB(161),0)) S FB(78)=+$P(^(0),"^",9)
  1. . Q:'$G(FB(78))
  1. . S FBX=$$ADDUA^FBUTL9(162.4,FB(78)_",","Edit CNH transfer.")
  1. . I 'FBX W !,"Error adding record in User Audit. Please contact IRM."
  1. D Q G RD1
  1. ;
  1. Q K DIC,DIE,DR,DA,DFN,FBTYPE,FTP,Y,X,FBPROG,FBTR,FBNTR,IFN,FBAADT,FBJ,FBK,FBASIH,FBDA,FBERR,FBLTTYP
  1. Q
  1. CHKTR ;called from dr string to make sure that the transfer type is
  1. ;consistant, that is if the old transfer type (FBTR) is a loss
  1. ;then the new transfer type (FBNTR) is also a loss.
  1. ;
  1. I '$G(FBLTTYP),(FBTR>3&(FBNTR'>3)) D ERROR1 Q
  1. I '$G(FBLTTYP),(FBTR<4&(FBNTR'<4)) D ERROR Q
  1. S Y=""
  1. Q
  1. ;
  1. ERROR ;write inconsistant movement type which will reset the movement type
  1. ;to original and allow user to re-edit.
  1. ;
  1. W !?5,*7,"Movement Type must be consistant. A transfer that is a loss",!?5,"may only be editted to another 'loss' type.",!
  1. Q
  1. ERROR1 ;write inconsistant movement type 'gain', reset transfer type and re-edit
  1. ;
  1. W !?5,*7,"Movement Type must be consistant. A transfer that is a gain",!?5,"may only be editted to another 'gain' type.",!
  1. Q