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

FBCHC78.m

Go to the documentation of this file.
  1. FBCHC78 ;AISC/DMK - CANCEL A 7078 ;8/25/14 15:22
  1. ;;3.5;FEE BASIS;**82,154**;JAN 30, 1995;Build 12
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. Q:'$G(DUZ)
  1. ;
  1. ;get station number from site parameter file
  1. D SITEP^FBAAUTL G END:FBPOP
  1. S FBPSA=$E($P($G(^DIC(4,+$P($G(FBSITE(1)),"^",3),99)),"^"),1,3)
  1. ;
  1. ASK ;get 7078 entry to cancel
  1. W ! S DIC(0)="AEQMZ",DIC="^FB7078(",D="D",DIC("A")="Select Patient: ",DIC("S")="I $P(^(0),U,9)'=""DC""&($P(^(0),U,11)=$S($D(FBNH):7,1:6))" D IX^DIC K DIC,D G END:X=""!(X="^"),ASK:Y<0
  1. S FB7078=+Y_";FB7078(",FBAAOB=FBPSA_"-"_$P(Y(0,0),".")_"-"_$P(Y(0,0),".",2),DFN=+$P(Y(0),"^",3),FB(161)=+$O(^FBAAA("AG",FB7078,DFN,0)),FBMM=$E($P(Y(0),U,4),4,5)
  1. S FBADDT=$P(Y(0),U,4),FBVEN=$P(Y(0),U,2)
  1. I $D(FBNH) S DIC="^FBAACNH(",DIC(0)="MZ",DIC("S")="I $P(^(0),U,2)=DFN&($P(^(0),U,10)=FB(161))",X=$P(Y(0),U,4) D ^DIC K DIC I +Y>0 W !,*7,"Must delete all movements associated with this authorization before canceling.",! G END
  1. ;
  1. ;check if payments made against the 7078
  1. ;if so do not allow a user to cancel
  1. I $D(^FBAAI("E",FB7078)) W !!,*7,"There is already an invoice entered for this hospitalization. Cannot delete!",!! G END
  1. I $D(^FBAAC("AM",FB7078)) W !!,*7,"There already are ancillary services entered against this authorization. Cannot delete!",!! G END
  1. ;
  1. ;display 7078 and ask if ok to cancel
  1. S DA=+FB7078,DIC="^FB7078(",DR="0;1" D EN^DIQ
  1. W ! S DIR(0)="Y",DIR("A")="Are you sure you want to cancel",DIR("B")="No" D ^DIR K DIR G FBCHC78:'Y,END:$D(DIRUT)
  1. ;
  1. ;cancelling 7078 and associated athorization in file 161
  1. ;deleting associated 7078 from the notification file in civil hospital
  1. ;remove entries assoiciated with CNH in 161.23
  1. ;removing estimated amount from 1358
  1. I '$D(FBNH) S DA=$O(^FBAA(162.2,"AM",+FB7078,0)) I DA S DIE="^FBAA(162.2,",DR="16///@" D ^DIE K DIC,DIE W " ."
  1. S DA(1)=DFN,DA=$O(^FBAAA("AG",FB7078,DFN,0)) I DA S DIK="^FBAAA("_DFN_",1," D ^DIK K DIK,DA W "."
  1. S DA=+FB7078,DIE="^FB7078(",DR=".013////^S X=DUZ;.014////^S X=DT;9////^S X=""DC""" D ^DIE K DIE,DIC W "."
  1. I $D(FBNH) S FBI=0 F S FBI=$O(^FBAA(161.23,"AC",+FB7078,FBI)) Q:'FBI I $D(^FBAA(161.23,FBI,0)) D
  1. . S DA=FBI,DIK="^FBAA(161.23," D ^DIK K DIK W "."
  1. ; if cancelled civil hospital 7078 then delete associated PTF record
  1. I '$G(FBNH) D PTFD^FBUTL6(DFN,FBADDT)
  1. W !!,"Authorization cancelled. Now updating 1358.",!
  1. D 1358 I $D(FBERR) W !,"Unable to affect 1358 adjustment. Use appropriate IFCAP options.",!
  1. W "... Finished",!
  1. ;
  1. END K DA,DR,DIE,DIC,DFN,FB,FBI,FB7078,FBAAOB,FBERR,PRC,PRCS,PRCSX,FBPSA,FBZZ,FBSITE,X,Y,FBPOP,FBNH,FBMM,FBADDT,FBVEN
  1. Q
  1. 1358 ;subtract estimated dollar amount from 1358
  1. ;FBAAOB=FULL OBLIGATION NUMBER (STATION #-OBLIGATION #-REF #)
  1. ;FBERR returned if IFCAP call fails
  1. ;internal entry # in 424 = $O(^PRC(424,"B",FBAAOB,0))
  1. ;
  1. ;check if 1358 available for posting
  1. I '$$INTER() W !,*7,"Unable to locate reference number on 1358.",! S FBERR=1 Q
  1. S PRCS("X")=$P(FBAAOB,"-",1,2),PRCS("TYPE")="FB" D EN3^PRCS58 I Y=-1 W !,*7,"1358 Not available for posting.",! S FBERR=1 Q
  1. D NOW^%DTC
  1. S PRCSX=$$INTER()_"^"_%_"^"_0_"^"_"Authorization has been cancelled"_"^"_1_"^"
  1. S PRCS("TYPE")="FB" D ^PRCS58CC I Y'=1 W !,*7,$P(Y,"^",2),! S FBERR=1 Q
  1. Q
  1. ;
  1. INTER() ;get internal entry number from file 424
  1. ;first check interface id x-ref
  1. ;second check is to "B" x-ref to stay backward compatible with IFCAP3.6
  1. ;
  1. I '$G(FBNH),$D(^PRC(424,"E",DFN_";"_+FB7078_";"_$P(FBAAOB,"-",2))) Q $O(^(DFN_";"_+FB7078_";"_$P(FBAAOB,"-",2),0))
  1. I $G(FBNH),$D(^PRC(424,"E",DFN_";"_+FB7078_";"_$P(FBAAOB,"-",2)_";"_FBMM)) Q $O(^(DFN_";"_+FB7078_";"_$P(FBAAOB,"-",2)_";"_FBMM,0))
  1. I $D(^PRC(424,"B",FBAAOB)) Q $O(^(FBAAOB,0))
  1. Q 0
  1. ;
  1. CNH ;entry point to cancel an authorization associated with the
  1. ;community nursing home program.
  1. S FBNH=1 G FBCHC78
  1. Q