Ignore:
Timestamp:
Dec 4, 2009, 12:11:15 AM (15 years ago)
Author:
George Lilly
Message:

revised back to 6/30/08 version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WorldVistAEHR/trunk/r/FEE_BASIS-FB/FBCH78.m

    r613 r623  
    1 FBCH78  ;AISC/DMK-SETS UP 7078/AUTHORIZATION FOR CONTRACT HOSPITAL ;08/07/02
    2         ;;3.5;FEE BASIS;**43,103**;JAN 30, 1995;Build 19
    3         ;;Per VHA Directive 2004-038, this routine should not be modified.
    4         S DIC("S")="I $P(^(0),U,15)=3&($P(^(0),U,12)=""Y"")" D ASKV^FBCHREQ G END:$E(X)="^"!($E(X)="")!('$D(FBDA))
    5         I $P(^FBAA(162.2,FBDA,0),"^",17)]"" W !!,*7,"There already is a 7078 set up for this request.",!,"The number is ",$P(^FB7078($P(^FBAA(162.2,FBDA,0),"^",17),0),"^")," .",! G END
    6 EN      S FBVEN=$P(^FBAA(162.2,FBDA,0),"^",2)_";FBAAV(",FBVET=$P(^(0),"^",4),FBFRDT=$P(^(0),"^",5),FBFRDT=FBFRDT\1,FBDOA=$S($P(^(0),"^",19):$P(^(0),"^",19)\1,1:""),FBDXS=$P(^(0),"^",6)
    7         ;FB*3.5*103 ;added FBRP
    8         S FBRP=$P($G(^FBAA(162.2,FBDA,2)),"^") K DA
    9         W !! S %DT="APEX",%DT("A")="AUTHORIZATION TO DATE: " D ^%DT K %DT G END:X="^" S FBTODT=$S(X="":"",1:Y)
    10         I FBTODT]"",FBFRDT>FBTODT W !!,*7,?5,"Authorization To Date must be after Authorization From Date!",! G EN
    11         W !! S %DT="APEX",%DT("A")="DATE OF DISCHARGE: ",%DT("B")=$$DATX^FBAAUTL(FBTODT) D ^%DT K %DT G END:X="^" S FBDOD=$S(X="":"",1:Y)
    12         I FBDOD]"",FBTODT>FBDOD W !!,*7,?5,"Date of Discharge must not be earlier than the Authorization To Date!",! G EN
    13         S DIR(0)="162.4,5",DIR("A")="ADMITTING AUTHORITY" D ^DIR K DIR
    14         G END:$D(DIRUT) S FBADMIT=+Y
    15         S DIR(0)="162.4,6" D ^DIR K DIR
    16         G END:$D(DIRUT) S FBEST=+Y
    17 FBPDIS  I FBTODT="" S DIR(0)="162.4,12" D ^DIR K DIR G END:$D(DUOUT),END:$D(DTOUT),NULL^FBCH780:X="" S FBPDIS=+Y
    18         ;
    19 ASKPT   I FBTODT]"" S DIR(0)="SAO^00:SURGICAL;10:MEDICAL;86:PSYCHIATRY",DIR("A")="BEDSECTION/TREATING SPECIALTY: ",DIR("?")="^D HELP^FBCH780" D ^DIR K DIR D NOUP^FBCHCD:$D(DIRUT) G ASKPT:$D(DIRUT) S FBPT=Y
    20 7078    S PRCS("A")="Select Obligation Number: ",PRCS("TYPE")="FB" D EN1^PRCS58 G:Y=-1 NOGOOD S (X,FBCHOB)=$P(Y,"^",2) K PRCS("A") S PRCS("TYPE")="FB" D EN1^PRCSUT31 G:Y="" NOGOOD S FB7078=$P(FBCHOB,"-",2)_"."_Y S FBSEQ=Y
    21         S DIC="^FB7078(",DIC(0)="LQ",DLAYGO=162.4,X=""""_FB7078_"""" D ^DIC G:Y<0 PROB S (DA,FBAA78)=+Y
    22         S DIE="^FBAA(162.2,",DA=FBDA,DR="16////^S X=FBAA78" D ^DIE K DIE,DIC,DA,DR
    23 SET78   S DIE="^FB7078(",DA=FBAA78,DR="[FBCH ENTER 7078]" D ^DIE K DIC,DIE,DR,DA
    24         D ^FBCH780 I $G(FBOUT) W !!,*7,"...deleting 7078." D DEL G END
    25         I +Y=0 W !!,*7,Y,!,"...deleting 7078.  Use 'Set-up a 7078' after adjusting 1358.",! D DEL G END
    26         K DIE,DIC,DA
    27         I $G(FBVET) S:'$G(DFN) DFN=FBVET D PTF^FBCH780
    28         G SHOW:FBTODT=""
    29 AUTH    D HOME^%ZIS
    30         D:'$D(FBSITE(1)) SITEP^FBAAUTL Q:FBPOP  S FBPSA=$S($P(FBSITE(1),"^",3)="":"",$D(^DIC(4,$P(FBSITE(1),"^",3),0)):$P(^(0),"^"),1:"")
    31         S FBVEN=$P(FBVEN,";")
    32         I '$D(^FBAAA(FBVET,0)) L +^FBAAA(FBVET) K DD,DO S (X,DINUM)=FBVET,DIC="^FBAAA(",DIC(0)="LM",DLAYGO=161 D FILE^DICN L -^FBAAA(FBVET) G:Y<0 END
    33         S:'$D(^FBAAA(FBVET,1,0)) ^(0)="^161.01D^^"
    34         K DE,DQ,DR,DIE,DLAYGO
    35 FBDCHG  S DIR(0)="161.01,.06" D ^DIR K DIR G END:$D(DTOUT),END:$D(DUOUT) D NULL1^FBCH780:X="" G FBDCHG:X="" S FBDCHG=+Y
    36 FBPUR   S FBTYPE=6,DIR(0)="161.01,.07" D ^DIR K DIR S FBPUR=+Y
    37         G END:$D(DTOUT),END:$D(DUOUT)
    38 FBPSA   S DIR(0)="161.01,101" D ^DIR K DIR G END:$D(DTOUT),END:$D(DUOUT) D NULL1^FBCH780:X="" G FBPSA:X="" S FBPSA=+Y
    39         ;file entry in authorization multiple of file 161
    40         S DIC="^FBAAA("_FBVET_",1,",DIC(0)="LM",DLAYGO=161,DA(1)=FBVET,X=FBFRDT K DD,DO D FILE^DICN G:Y<0 END S DA=+Y,DIE("NO^")="" ;DA(1)=FBVET
    41         S FB78=FBAA78_";FB7078("
    42         ;FB*3.5*103 ;added FBRP
    43         S DIE=DIC,DR=".02////^S X=FBTODT;.03////^S X=6;100////^S X=DUZ;1////^S X=""YES"";.055////^S X=FB78;.06////^S X=FBDCHG;S FBTYPE=6;.04////^S X=FBVEN;.065////^S X=FBPT;101////^S X=FBPSA"
    44         S:$G(FBRP)]"" DR=DR_";104////^S X=FBRP"
    45         S DR=DR_";.095////^S X=1"
    46         S DR(1,161.01,1)="I $D(^FB7078(FBAA78,1,0)) S ^FBAAA(DA(1),1,DA,2,0)=^(0) F FBI=1:1 Q:'$D(^FB7078(FBAA78,1,FBI,0))  I $D(^(0)) S ^FBAAA(DA(1),1,DA,2,FBI,0)=^(0);.07////^S X=FBPUR;.08///^S X=FBDXS;.096;.097//^S X=""N"""
    47         D ^DIE K DIE,DR
    48         S (DIC,DIE)="^FB7078(",DA=FBAA78,DR="9///^S X=""C"";12///^S X=""@""" D ^DIE K DR,DIE,DA,X
    49 SHOW    W !! S DA=FBAA78,DR="0;1",DIC="^FB7078(" D EN^DIQ
    50         ;
    51         ;FB*3.5*103 ;added FBRP
    52 END     K D,DA,DIC,DIE,DIR,DLAYGO,DR,FBDA,FB7078,FBAA78,FBPT,FBTYPE,FBVEN,FBZ,FBVET,FBFRDT,FBTODT,J,S,POP,X,Y,DFN,FBCHOB,FBCOMM,FBDFN,FBEST,FBI,FBLENT,FBMENT,FBNAME,FBSEQ,FBSSN,FBSW,I,K,PRC,VAL,FB,FBFLG,ZZ,FBPSA,FBSITE,FB78,FBOUT
    53         K FBDCHG,FBPUR,FBPDIS,FBADMIT,FBDXS,A,D0,D1,X1,DIRUT,DTOUT,DUOUT,FBDOA,FBDOD,FBPOP,FBZZ,ZZZ,PRCSCPAN,FBRP
    54         Q
    55 PROB    W !!,"The reference number did not get set up with the",!,"IFCAP software. Contact your package coordinator." G END
    56 NOGOOD  S DIR(0)="Y",DIR("A")="Obligation number selected is invalid or you are not a control point user in the IFCAP package!  Try again",DIR("B")="YES" D ^DIR K DIR G END:$D(DIRUT)!'Y,7078
    57         ;
    58 OUTP    ;ENTRY TO DISPLAY A 7078
    59         ;FB*3.5*103 ; Display the 0 node fields with computed REFERRING PROVIDER NPI, then 1 node fields
    60         S DIC="^FB7078(",DIC(0)="AEQM",D="D",DIC("A")="Select Patient: " D IX^DIC
    61         G END:X=""!(X="^")
    62         S (DA,FBDA)=+Y,DR="0",DIQ(0)="C" W !! D EN^DIQ K DIQ(0)
    63         S DA=FBDA,DR="1" D EN^DIQ
    64         I $$DISCH^FBCH780(FBDA)]"" W ?2,"DISCHARGE TYPE: ",$$DISCH^FBCH780(FBDA),!
    65         G OUTP
    66         ;
    67 REFNPI(IEN200,IEN162P4,CHKAUTH) ;FB*3.5*103
    68         ; a new function that returns the REFERRING PROVIDER NPI if it is Active and the provider has authorized use of the NPI
    69         ; If is used in both a Fileman function and in other FB routines.
    70         ;
    71         ; Input
    72         ; IEN200 - IEN to file 200 if known
    73         ; IEN162P4 (optional) - IEN to File 162.4 (if ref prov is not known)
    74         ; CHKAUTH (optional) - Flag on whether to Chek Authorization in file 200
    75         ;
    76         ; Output
    77         ; A valid/active NPI if one can be determined.  Otherwise, nada.
    78         ;
    79         ; If neither IEN is passed in, there is no NPI coming out
    80         I $G(IEN200)<1,$G(IEN162P4)<1 Q ""
    81         ;
    82         ; If there is no referrring provider IEN passed in, try getting it from the IEN from 162.4 (VA FORM 10-7078)
    83         ; return nothing if you can't
    84         I $G(IEN200)<1 S IEN200=$$GET1^DIQ(162.4,IEN162P4_",",15,"I") Q:$G(IEN200)<1 ""
    85         ;
    86         ; Now that we have an IEN to 200 see if we need authorization and have to display/print NPI
    87         ; If the return value is less than 1, then we don't have permission or it was not a valid IEN.
    88         ; IA#5070
    89         I $G(CHKAUTH) Q:+$$GETRLNPI^XUSNPI(IEN200)<1 ""
    90         ;
    91         ; Go get the NPI for this IEN
    92         N NPI S NPI=$$NPI^XUSNPI("Individual_ID",IEN200)
    93         ;
    94         ; Make sure it is a valid/Active NPI
    95         I +NPI<1!($P(NPI,U,3)="Inactive") Q ""
    96         Q +NPI
    97         ;
    98 DEL     S DA=FBAA78,DIK="^FB7078(" D ^DIK K DIK S DA=$O(^FBAA(162.2,"AM",+FBAA78,0)) I DA S DIE="^FBAA(162.2,",DR="16///@" D ^DIE
     1FBCH78 ;AISC/DMK-SETS UP 7078/AUTHORIZATION FOR CONTRACT HOSPITAL ;08/07/02
     2 ;;3.5;FEE BASIS;**43**;JAN 30, 1995
     3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
     4 S DIC("S")="I $P(^(0),U,15)=3&($P(^(0),U,12)=""Y"")" D ASKV^FBCHREQ G END:$E(X)="^"!($E(X)="")!('$D(FBDA))
     5 I $P(^FBAA(162.2,FBDA,0),"^",17)]"" W !!,*7,"There already is a 7078 set up for this request.",!,"The number is ",$P(^FB7078($P(^FBAA(162.2,FBDA,0),"^",17),0),"^")," .",! G END
     6EN S FBVEN=$P(^FBAA(162.2,FBDA,0),"^",2)_";FBAAV(",FBVET=$P(^(0),"^",4),FBFRDT=$P(^(0),"^",5),FBFRDT=FBFRDT\1,FBDOA=$S($P(^(0),"^",19):$P(^(0),"^",19)\1,1:""),FBDXS=$P(^(0),"^",6) K DA
     7 W !! S %DT="APEX",%DT("A")="AUTHORIZATION TO DATE: " D ^%DT K %DT G END:X="^" S FBTODT=$S(X="":"",1:Y)
     8 I FBTODT]"",FBFRDT>FBTODT W !!,*7,?5,"Authorization To Date must be after Authorization From Date!",! G EN
     9 W !! S %DT="APEX",%DT("A")="DATE OF DISCHARGE: ",%DT("B")=$$DATX^FBAAUTL(FBTODT) D ^%DT K %DT G END:X="^" S FBDOD=$S(X="":"",1:Y)
     10 I FBDOD]"",FBTODT>FBDOD W !!,*7,?5,"Date of Discharge must not be earlier than the Authorization To Date!",! G EN
     11 S DIR(0)="162.4,5",DIR("A")="ADMITTING AUTHORITY" D ^DIR K DIR
     12 G END:$D(DIRUT) S FBADMIT=+Y
     13 S DIR(0)="162.4,6" D ^DIR K DIR
     14 G END:$D(DIRUT) S FBEST=+Y
     15FBPDIS I FBTODT="" S DIR(0)="162.4,12" D ^DIR K DIR G END:$D(DUOUT),END:$D(DTOUT),NULL^FBCH780:X="" S FBPDIS=+Y
     16 ;
     17ASKPT I FBTODT]"" S DIR(0)="SAO^00:SURGICAL;10:MEDICAL;86:PSYCHIATRY",DIR("A")="BEDSECTION/TREATING SPECIALTY: ",DIR("?")="^D HELP^FBCH780" D ^DIR K DIR D NOUP^FBCHCD:$D(DIRUT) G ASKPT:$D(DIRUT) S FBPT=Y
     187078 S PRCS("A")="Select Obligation Number: ",PRCS("TYPE")="FB" D EN1^PRCS58 G:Y=-1 NOGOOD S (X,FBCHOB)=$P(Y,"^",2) K PRCS("A") S PRCS("TYPE")="FB" D EN1^PRCSUT31 G:Y="" NOGOOD S FB7078=$P(FBCHOB,"-",2)_"."_Y S FBSEQ=Y
     19 S DIC="^FB7078(",DIC(0)="LQ",DLAYGO=162.4,X=""""_FB7078_"""" D ^DIC G:Y<0 PROB S (DA,FBAA78)=+Y
     20 S DIE="^FBAA(162.2,",DA=FBDA,DR="16////^S X=FBAA78" D ^DIE K DIE,DIC,DA,DR
     21SET78 S DIE="^FB7078(",DA=FBAA78,DR="[FBCH ENTER 7078]" D ^DIE K DIC,DIE,DR,DA
     22 D ^FBCH780 I $G(FBOUT) W !!,*7,"...deleting 7078." D DEL G END
     23 I +Y=0 W !!,*7,Y,!,"...deleting 7078.  Use 'Set-up a 7078' after adjusting 1358.",! D DEL G END
     24 K DIE,DIC,DA
     25 I $G(FBVET) S:'$G(DFN) DFN=FBVET D PTF^FBCH780
     26 G SHOW:FBTODT=""
     27AUTH D HOME^%ZIS
     28 D:'$D(FBSITE(1)) SITEP^FBAAUTL Q:FBPOP  S FBPSA=$S($P(FBSITE(1),"^",3)="":"",$D(^DIC(4,$P(FBSITE(1),"^",3),0)):$P(^(0),"^"),1:"")
     29 S FBVEN=$P(FBVEN,";")
     30 I '$D(^FBAAA(FBVET,0)) L +^FBAAA(FBVET) K DD,DO S (X,DINUM)=FBVET,DIC="^FBAAA(",DIC(0)="LM",DLAYGO=161 D FILE^DICN L -^FBAAA(FBVET) G:Y<0 END
     31 S:'$D(^FBAAA(FBVET,1,0)) ^(0)="^161.01D^^"
     32 K DE,DQ,DR,DIE,DLAYGO
     33FBDCHG S DIR(0)="161.01,.06" D ^DIR K DIR G END:$D(DTOUT),END:$D(DUOUT) D NULL1^FBCH780:X="" G FBDCHG:X="" S FBDCHG=+Y
     34FBPUR S FBTYPE=6,DIR(0)="161.01,.07" D ^DIR K DIR S FBPUR=+Y
     35 G END:$D(DTOUT),END:$D(DUOUT)
     36FBPSA S DIR(0)="161.01,101" D ^DIR K DIR G END:$D(DTOUT),END:$D(DUOUT) D NULL1^FBCH780:X="" G FBPSA:X="" S FBPSA=+Y
     37 ;file entry in authorization multiple of file 161
     38 S DIC="^FBAAA("_FBVET_",1,",DIC(0)="LM",DLAYGO=161,DA(1)=FBVET,X=FBFRDT K DD,DO D FILE^DICN G:Y<0 END S DA=+Y,DIE("NO^")="" ;DA(1)=FBVET
     39 S FB78=FBAA78_";FB7078("
     40 S DIE=DIC,DR=".02////^S X=FBTODT;.03////^S X=6;100////^S X=DUZ;1////^S X=""YES"";.055////^S X=FB78;.06////^S X=FBDCHG;S FBTYPE=6;.04////^S X=FBVEN;.065////^S X=FBPT;101////^S X=FBPSA;.095////^S X=1"
     41 S DR(1,161.01,1)="I $D(^FB7078(FBAA78,1,0)) S ^FBAAA(DA(1),1,DA,2,0)=^(0) F FBI=1:1 Q:'$D(^FB7078(FBAA78,1,FBI,0))  I $D(^(0)) S ^FBAAA(DA(1),1,DA,2,FBI,0)=^(0);.07////^S X=FBPUR;.08///^S X=FBDXS;.096;.097//^S X=""N"""
     42 D ^DIE K DIE,DR
     43 S (DIC,DIE)="^FB7078(",DA=FBAA78,DR="9///^S X=""C"";12///^S X=""@""" D ^DIE K DIE,DIE,DA,X
     44SHOW W !! S DA=FBAA78,DR="0;1",DIC="^FB7078(" D EN^DIQ
     45 ;
     46END K D,DA,DIC,DIE,DIR,DLAYGO,DR,FBDA,FB7078,FBAA78,FBPT,FBTYPE,FBVEN,FBZ,FBVET,FBFRDT,FBTODT,J,S,POP,X,Y,DFN,FBCHOB,FBCOMM,FBDFN,FBEST,FBI,FBLENT,FBMENT,FBNAME,FBSEQ,FBSSN,FBSW,I,K,PRC,VAL,FB,FBFLG,ZZ,FBPSA,FBSITE,FB78,FBOUT
     47 K FBDCHG,FBPUR,FBPDIS,FBADMIT,FBDXS,A,D0,D1,X1,DIRUT,DTOUT,DUOUT,FBDOA,FBDOD,FBPOP,FBZZ,ZZZ,PRCSCPAN
     48 Q
     49PROB W !!,"The reference number did not get set up with the",!,"IFCAP software. Contact your package coordinator." G END
     50NOGOOD S DIR(0)="Y",DIR("A")="Obligation number selected is invalid or you are not a control point user in the IFCAP package!  Try again",DIR("B")="YES" D ^DIR K DIR G END:$D(DIRUT)!'Y,7078
     51 ;
     52OUTP ;ENTRY TO DISPLAY A 7078
     53 S DIC="^FB7078(",DIC(0)="AEQM",D="D",DIC("A")="Select Patient: " D IX^DIC G END:X=""!(X="^") S (DA,FBDA)=+Y,DR="0;1" W !! D EN^DIQ
     54 I $$DISCH^FBCH780(FBDA)]"" W ?2,"DISCHARGE TYPE: ",$$DISCH^FBCH780(FBDA),!
     55 G OUTP
     56DEL S DA=FBAA78,DIK="^FB7078(" D ^DIK K DIK S DA=$O(^FBAA(162.2,"AM",+FBAA78,0)) I DA S DIE="^FBAA(162.2,",DR="16///@" D ^DIE
Note: See TracChangeset for help on using the changeset viewer.