source: FOIAVistA/trunk/r/FEE_BASIS-FB/FBUCLINK.m@ 1572

Last change on this file since 1572 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 4.4 KB
Line 
1FBUCLINK ;ALBISC/TET - LINK CLAIM TO A PRIMARY ;5/14/93 14:59
2 ;;3.5;FEE BASIS;;JAN 30, 1995
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4EDIT ;associate claims to a primary ;call from FBUC ASSOCIATE option
5 ;INPUT: none
6 ;VAR: FBLINK = ien of master claim #
7 ;OUTPUT: none; if fblink will update
8 N FBACT S FBACT="LNK",FBO=0 D LOOKUP^FBUCUTL3(FBO) G:FBOUT END
9 Q:'+$G(FBARY) N FBDA,FBI,FBNODE,FBPL,FBW D PARSE^FBUCUTL4(FBARY)
10 S FBI=0 F S FBI=$O(^TMP("FBARY",$J,FBI)) Q:'FBI S FBNODE=$G(^(FBI)),FBDA=+FBNODE D Q:FBOUT
11 .N FBUCA,FBUCAA,FBUCP,FBUCPA,FBZ I +$G(FBARY)>1 D LINE^FBUCUTL4(FBNODE,FBI,FBPL,FBW)
12 .D PRIOR^FBUCEVT(FBDA,FBACT)
13 .I '$$LINK^FBUCUTL4(FBDA,FBUCP) W !,"This claim has other claims associated with it",!,"and, therefore, can not be associated to another." Q
14 .D ASSOC Q:FBOUT D UPD(FBDA,FBLINK)
15 .S FBZ=$$FBZ^FBUCUTL(FBDA) D EN^FBUCEN1(FBZ,FBDA)
16 .D AFTER^FBUCEVT(FBDA,FBACT),^FBUCUPD(FBUCP,FBUCPA,FBUCA,FBUCAA,FBDA,FBACT)
17END ;kill and quit
18 K DA,DIE,DIRUT,DR,DTOUT,DUOUT,FBAR,FBARY,FBDCT,FBI,FBLINK,FBO,FBOUT,FBP,FBPL,FBUCP,FBUCPA,FBW,FBX,FBZ,X,Y,^TMP("FBARY",$J) Q
19ASSOC ;associate claim to a primary
20 ;INPUT: FBDA = ien of unauthorized claim to be linked
21 ; FBUCP = zero node of fbda
22 ;OUTPUT: FBLINK = ien of unauthorized claim to which is linked
23 ; FBOUT = set if timed out or up-arrow entered
24 S DIC="^FB583(",DIC(0)="AEMQZ",DIC("A")="Select the unauthorized claim to which this one should be associated: ",DIC("W")="D ID^FBUCUTL4"
25 S DIC("S")="N FBZ S FBZ=$$FBZ^FBUCUTL(+Y) I $P(FBZ,U,4)=$P(FBUCP,U,4)&(+Y'=FBDA)&($$LINKTO^FBUCUTL4(+Y,FBZ,FBDA))&($P(FBZ,U,5)=$P(FBUCP,U,5))&($P(FBZ,U,6)=$P(FBUCP,U,6)) K FBZ"
26 D ^DIC K DIC S:$D(DTOUT)!($D(DUOUT)) FBOUT=1 G:FBOUT!(Y'>0) ASSOCQ S FBLINK=+Y
27ASSOCQ S FBLINK=+$G(FBLINK) K FBZ,Y Q
28DISASSOC ;disassociate a claim, interactive, called from option
29 N FBARY,FBDA,FBI,FBNODE,FBOUT,FBP,FBPL,FBW ;new variables here
30 W !,"This option will allow you to disassociate a claim.",!
31 D LOOKUP^FBUCUTL3(0)
32 G:'+$G(FBARY) DISASSQ
33 S FBOUT=0 D PARSE^FBUCUTL4(FBARY)
34 S FBI=0 F S FBI=$O(^TMP("FBARY",$J,FBI)) Q:'FBI!(FBOUT) S FBNODE=$G(^(FBI)),FBDA=+$P(FBNODE,";") D G:FBOUT DISASSQ
35 .N FBALL,FBDIRA,FBDISP,FBGROUP,FBZ
36 .D LINE^FBUCUTL4(FBNODE,FBI,FBPL,FBW)
37 .S FBZ=$G(^FB583(FBDA,0))
38 .S FBALL=0 D GROUP^FBUCUTL7(FBZ,FBDA)
39 .I +$G(FBGROUP)=1 W !,"This claim is not associated with another claim." Q
40 .D DISPLAY^FBUCUTL7(FBDA,.FBGROUP) S FBDIRA="Do you wish to disassociate claim from the above group" D READ^FBUCUTL7(FBDIRA,.FBOUT,.FBDISP) Q:FBOUT!('FBALL)
41 .D UNLINK^FBUCLNK1(.FBGROUP,FBDA,FBZ)
42DISASSQ K FBARY,^TMP("FBARY",$J) Q
43UPD(FBDA,FBLINK) ;update master claim field
44 ;INPUT: FBDA = internal entry number of unauthorized claim for update
45 ; FBLINK = internal entry number of primary claim
46 ;OUTPUT: update of MASTER CLAIM field
47 N DA,DIE,DR,X,FBLOCK
48 Q:'+$G(FBDA)!('+$G(FBLINK)) I +$G(FBLINK) S DA=FBDA,DIE="^FB583(",DR="20////^S X=FBLINK" D LOCK^FBUCUTL(DIE,DA,1) I FBLOCK D ^DIE L -^FB583(FBDA)
49 Q
50ARSET(FBDA,FBZ) ;set display array
51 ;INPUT: FBDA = ien of unauthorized claim record
52 ; FBZ = zero node of unauthorized claim
53 ;OUTPUT: string of data for display
54 N FBX I '+$G(FBDA)!($G(FBZ)']"") Q $G(FBX)
55 S FBX=FBDA_";"_$S($$PRIME^FBUCUTL4(FBDA,FBZ):"*",1:" ")_$E($$VET^FBUCUTL(+$P(FBZ,U,4)),1,12)_U_$E($$VEN^FBUCUTL(+$P(FBZ,U,3)),1,12)_U_$E($$PROG^FBUCUTL(+$P(FBZ,U,2)),1,12)_U_$$DATX^FBAAUTL(+$P(FBZ,U))
56 S FBX=FBX_U_$E($$PTR^FBUCUTL("^FB(162.92,",+$P(FBZ,U,24)),1,16)
57 S FBX=FBX_U_"TREATMENT FROM: "_$$DATX^FBAAUTL(+$P(FBZ,U,5))_U_"TREATMENT TO: "_$$DATX^FBAAUTL(+$P(FBZ,U,6))
58 Q $G(FBX)
59ASK ;ask if want to associate claim
60 ;INPUT: FBLINK = flag that another entry for vet and episode exists
61 ; FBAR & FBAR( = data for vet/episode of care to display
62 ;OUTPUT: FBLINK = 1 is which to associate; 0 to associate to itself
63 W !!,"Other claims exist for the same veteran and episode of care." H 1 D DISPX^FBUCUTL1(0,1)
64 W ! S DIR("A")="Do you wish to associate this new claim with one from the above listing",DIR("B")="YES",DIR(0)="Y" D ^DIR K DIR S:$D(DIRUT) FBOUT=1 S FBLINK=$S(Y=1:1,1:0)
65 Q
66SELECT(FBAR) ;select a claim from listing to link
67 ;INPUT: FBAR = (not subscripted), for upper limit
68 ;OUTPUT: FBLINK = number of primary master claim or zero
69 Q:'+$G(FBAR) S DIR(0)="N^1:"_FBAR_":0",DIR("A")="Select the claim to which you wish to associate",DIR("??")="^D DISPX^FBUCUTL1(0,1)"
70 D ^DIR K DIR S:$D(DIRUT) FBOUT=1 Q:+$G(FBOUT) S FBLINK=+$G(^TMP("FBAR",$J,+Y))
71 Q
Note: See TracBrowser for help on using the repository browser.