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

FBUCDD.m

Go to the documentation of this file.
  1. FBUCDD ;ALBISC/TET - DD UTILITY ROUTINE ;5/27/93 19:28
  1. ;;3.5;FEE BASIS;;JAN 30, 1995
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. INPUT(DA,X,Y,FBZZ) ;input transform of status field, file 162.7
  1. ;INPUT: X and Y - FM variables
  1. ; DA - internal entry number of 162.7, Unauthorized Claims
  1. ; FBZZ - set in input transform, identifies the field in 162.7
  1. ;OUTPUT: 1 if x should be killed, otherwise 0.
  1. N FBZ S FBZ=$G(^FB583(DA,0))
  1. 23 ;If FBZZ=23 - CLAIM SUBMITTED BY
  1. ;ensure that if vendor or veteran entered, same as vendor or veteran field
  1. I FBZZ=23 Q $S(X["FBAAV"&(+X'=$P(FBZ,U,3)):1,X["DPT"&(+X'=$P(FBZ,U,4)):1,1:0)
  1. 24 ;IF FBZZ=24 - STATUS
  1. ;if y<0 k x
  1. ;if dispositioned, status can only be dispositioned (and converse).
  1. ;if not dispositioned, valid claim received, cannot select status
  1. ; which indicates incomplete claim (and converse).
  1. I FBZZ=24 N O S O=$$ORDER^FBUCUTL(X) Q $S(Y<0:1,"^40^70^90^"[O&('$P(FBZ,U,11)):1,"^40^70^90^"'[O&($P(FBZ,U,11)):1,$P(FBZ,U,8)&(O'>20):1,'$P(FBZ,U,8)&(O>20):1,1:0)
  1. 10 ;IF FBZZ=10 - DISPOSITION
  1. ;dispositon to cancelled/withdrawn or abandoned if date valid claim received is null,
  1. ; k x if disposition is other than approved(1) or approved to stabilization(4)
  1. ; and not ok to updated (payments were made and user doesn't hold key)
  1. ;otherwise can select any disposition.
  1. I FBZZ=10 Q $S(Y<0:1,'(X=3!(X=5))&('$P(FBZ,U,8)):1,((X=2)!(X=3)!(X=5))&('$$UPOK^FBUCUTL(DA)):1,1:0)
  1. 7 ;IF FBZZ=7 - DATE VALID CLAIM RECEIVED
  1. ;claim is considered valid when all pending information is received.
  1. I FBZZ=7 Q $S(Y<1:1,$$PEND^FBUCUTL(DA):1,1:0)
  1. 4 ;IF FBZZ=4 - TREATMENT TO DATE
  1. ;if y<1 k x
  1. ;if treatment to date is before treatment from date, k x
  1. I FBZZ=4 Q $S(Y<1:1,$P(FBZ,U,5)>X:1,1:0)
  1. 12 ;IF FBZZ=12 - AUTHORIZED FROM DATE
  1. ;if y<1 k x
  1. ;if authorized from date is before treatment from date, k x
  1. ;if authorized from date is after treatment to date, k x
  1. I FBZZ=12 Q $S(Y<1:1,$P(FBZ,U,5)>X:1,X>$P(FBZ,U,6):1,1:0)
  1. 13 ;IF FBZZ=14 - AUTHORIZED TO DATE
  1. ;if y<1 k x
  1. ;if authorized to date is before authorized from date, k x
  1. ;if authorized to date is after treatment to date, k x
  1. I FBZZ=13 Q $S(Y<1:1,$P(FBZ,U,13)>X:1,X>$P(FBZ,U,6):1,1:0)
  1. Q
  1. DISCHTYP(DA) ;discharge type - computed field expression from field 29 of 162.7
  1. ;INPUT: DA = ien
  1. ;OUTPUT: long value of discharge type for file 161.01,.06
  1. N FBZ,FBIEN
  1. I '+$G(DA) Q ""
  1. S FBZ=$$FBZ^FBUCUTL(DA),FBIEN=+$O(^FBAAA("AG",DA_";FB583(",+$P(FBZ,U,4),0)) I 'FBIEN Q ""
  1. S FBZ=$$PTR^FBUCUTL("^FBAAA("_+$P(FBZ,U,4)_",1,",FBIEN),FBIEN=$P(FBZ,U,15)
  1. Q $S('FBIEN:"",FBIEN=4:"DISCHARGE",FBIEN=3:"DEATH WITHOUT AUTOPSY",FBIEN=2:"DEATH WITH AUTOPSY",1:"TRANSFER TO VA")
  1. ;
  1. MSIX(X,DA,FLD,ACT,FBIX) ;cross-reference on either vendor/veteran/other,master claim,status order
  1. ;INPUT: X = value edited
  1. ; DA = internal entry number of record
  1. ; FLD = field edited
  1. ; ACT = action: 1 for set; 2 for kill
  1. ; FBIX = cross-ref to be set, either APMS, AVMS or AOMS
  1. ;VAR: FBZ = zero node and value of first subscript of cross-ref
  1. ; FBZ(1) = master claim designation
  1. ; FBZ(2) = status order
  1. ;OUTPUT: set or kill cross-reference, depending upon the action
  1. I $S('+$G(X):1,'+$G(DA):1,'+$G(FLD):1,'+$G(ACT):1,$G(FBIX)']"":1,1:0) Q
  1. I $S(FBIX="APMS":0,FBIX="AVMS":0,FBIX="AOMS":0,1:1) Q
  1. N FBZ S FBZ=$$FBZ^FBUCUTL(DA) I FBIX="AOMS",$P(FBZ,U,23)'["VA(200" Q
  1. S FBZ(1)=$S(FLD=20:X,1:+$P(FBZ,U,20)) Q:'FBZ(1) S FBZ(1)=FBZ(1)_$S(DA=FBZ(1):"P",1:"S")
  1. S FBZ(2)=$$ORDER^FBUCUTL($S(FLD=24:X,1:+$P(FBZ,U,24))) Q:'FBZ(2)
  1. S FBZ=$S(FLD'=20&(FLD'=24):+X,FBIX="APMS":+$P(FBZ,U,4),FBIX="AVMS":+$P(FBZ,U,3),1:+$P(FBZ,U,23)) Q:'FBZ
  1. I ACT=1 S ^FB583(FBIX,FBZ,FBZ(1),FBZ(2),DA)="" Q
  1. I ACT=2 K ^FB583(FBIX,FBZ,FBZ(1),FBZ(2),DA)
  1. Q