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

FBUCLNK1.m

Go to the documentation of this file.
  1. FBUCLNK1 ;ALBISC/TET - LINK CLAIM DISPLAY
  1. ;;3.5;FEE BASIS;;JAN 30, 1995
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;INPUT: FBDA = ien of unauthoriezed claim
  1. ; FBIX = xref indicating how user is looking up (APMS,AVMS,AOMS)
  1. ; FBSET = (optional) 1 to set global array, 0 to not set
  1. ;OUTPUT: 1 if claim is linked to others, 0 if not
  1. ; TMP("FBAR" global array (if 1 and flagged to set)
  1. I '+$G(FBDA) Q 0 S:$G(FBSET)']"" FBSET=0
  1. N FBCT,FBDCT,FBI,FBMC,FBZ S FBMC=+$P($$FBZ^FBUCUTL(FBDA),U,20) I 'FBMC Q 0
  1. S (FBDCT,FBCT,FBI)=0 F S FBI=$O(^FB583("AMC",FBMC,FBI)) Q:'FBI!(FBCT&('FBSET)) I FBI'=FBDA S FBCT=FBCT+1 I FBSET S FBZ=$G(^FB583(FBI,0)) I FBZ]"" D
  1. .;set array
  1. .D DA^FBUCUTL5(FBI,"APMS",.FBDCT,+$P(FBZ,U,20),FBZ)
  1. I FBCT,FBSET D FBAR^FBUCUTL5(FBCT)
  1. Q $S(FBCT:1,1:0)
  1. ;
  1. ENTER(FBDA,FBUCA,DISP,FBIX) ;link claim on entry
  1. ;called from fbucen - enter new unauth claim
  1. ;INPUT: FBDA = ien of unauthorized claim
  1. ; FBUCA = after node of unauthorized claim
  1. ; DISP = 0 to display only, 1 to update
  1. ; FBIX = cross-ref (optional)
  1. ;VAR: FBTFROM-treatment from date/FBTTO-treatment to date/FBVET-veteran
  1. ;OUTPUT: link new claim to existing claim, if user so designates
  1. ; data stored in tmp(fbar/tmp(fbary global arrays
  1. N FBAR,FBARY,FBCNT,FBDCT,FBI,FBLINK,FBMC,FBOUT,FBTFROM,FBTTO,FBVET,FBX,FBZ S FBDCT=0
  1. S:$G(FBIX)']"" FBIX="APMS" S FBTFROM=$P(FBUCA,U,5),FBTTO=$P(FBUCA,U,6),FBVET=$P(FBUCA,U,4),FBMC=+$P(FBUCA,U,20),FBX=+$O(^FB583("APF",FBVET,FBTFROM,0))
  1. I FBX'=FBDA S FBLINK=1,FBI=0 F S FBI=$O(^FB583("APF",FBVET,FBTFROM,FBI)) Q:'FBI S FBZ=$$FBZ^FBUCUTL(FBI) I $P(FBZ,U,6)=FBTTO,$$LINKTO^FBUCUTL4(FBI,FBZ,FBDA),FBI'=FBDA D DA^FBUCUTL5(FBI,FBIX,.FBDCT,FBMC,FBZ)
  1. D FBAR^FBUCUTL5(FBDCT)
  1. I DISP,+$G(FBLINK),+$G(FBAR) D ASK^FBUCLINK Q:+$G(FBOUT) I FBLINK D SELECT^FBUCLINK(+FBAR) Q:+$G(FBOUT) D:FBLINK UPD^FBUCLINK(FBDA,FBLINK)
  1. I 'DISP,+$G(FBLINK),+$G(FBAR) S FBX="< ASSOCIATED CLAIMS >" W !!?(IOM-$L(FBX)/2),FBX,! D DISPX^FBUCUTL1(0)
  1. K ^TMP("FBAR",$J),^TMP("FBARY",$J) Q
  1. ;
  1. ;INPUT: FBGROUP = # in group^# of programs^1 if auth^# of u/c w/same status^# of diff dispositions
  1. ; FBGROUP(ien of 162.7) = prog^auth ien^status ien^dispositon ien
  1. ; FBDA = ien of unauth claim working with
  1. ; FBZ = zero node of unauth claim (fbda)
  1. ; FBRELINK = <optional> flag to auto relink: 1 for auto-relink
  1. ;OUTPUT: fbda claim is unlinked; if group and fbda primary, new primary
  1. ; if another claim exists with same vet and episode of care,
  1. ; the unlinked claim may be relinked to it.
  1. I $S('+$G(FBGROUP):1,'+$G(FBDA):1,$G(FBZ)']"":1,1:0) Q
  1. S FBRELINK=+$G(FBRELINK) N FBALL,FBD,FBDIRA,FBI,FBMATCH,FBO,FBOUT,FBPRIME,FBTFR,FBTTO,FBVET ;other variables
  1. S (FBALL,FBMATCH,FBOUT)=0
  1. S FBPRIME=$$PRIME^FBUCUTL4(FBDA,FBZ) D:FBPRIME PRIME(.FBGROUP,FBDA,FBZ) I 'FBPRIME D DIE^FBUCUTL2("^FB583(",FBDA,"20////^S X="_FBDA)
  1. S FBVET=$P(FBZ,U,4),FBTFR=$P(FBZ,U,5),FBTTO=$P(FBZ,U,6),FBD=FBTFR-.1
  1. F S FBD=$O(^FB583("APF",FBVET,FBD)) Q:'FBD!(FBD>FBTFR) S FBI=0 F S FBI=$O(^FB583("APF",FBVET,FBD,FBI)) Q:'FBI!(FBMATCH) I FBI'=FBDA S FBO=$G(^FB583(FBI,0)) I $P(FBO,U,6)=FBTTO,'$D(FBGROUP(FBI)) S FBMATCH=+$P(FBO,U,20)
  1. Q:'FBMATCH ;nothing else to which this claim can be grouped
  1. I 'FBRELINK S FBDIRA="Do you want to automatically link this claim with another group" D READ^FBUCUTL7(FBDIRA,.FBOUT) Q:FBOUT!('FBALL)
  1. I FBALL D DIE^FBUCUTL2("^FB583(",FBDA,"20////^S X="_FBMATCH)
  1. Q
  1. PRIME(FBGROUP,FBDA,FBZ) ;determine primary claim
  1. ;INPUT: FBGROUP = # in group^# of programs^1 if auth^# of u/c w/same status^# of diff dispositions
  1. ; FBGROUP(ien of 162.7) = prog^auth ien^status ien^dispositon ien
  1. ; FBDA = ien of unauth claim
  1. ; FBZ = zero node of unauth claim (fbda)
  1. ;OUTPUT: if primary, find new primary for other claims in group and update
  1. N FBPRIME,FBI,FBO
  1. ;determine new primary claim; reset rest in group to new primary
  1. S (FBI,FBPRIME)=0 F S FBI=$O(FBGROUP(FBI)) Q:'FBI I FBI'=FBDA S FBPRIME=FBI Q:FBPRIME
  1. I FBPRIME S FBI=0 F S FBI=$O(FBGROUP(FBI)) Q:'FBI I FBI'=FBDA S FBO=$G(^FB583(FBI,0)) D DIE^FBUCUTL2("^FB583(",FBI,"20////^S X="_FBPRIME)
  1. Q