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

IBTRC3.m

Go to the documentation of this file.
  1. IBTRC3 ;ALB/AAS - CLAIMS TRAINING INS. REV DEFAULTS ; 29-SEP-93
  1. ;;2.0;INTEGRATED BILLING;**458**;21-MAR-94;Build 4
  1. ;;Per VHA Directive 2004-038, this routine should not be modified.
  1. ;
  1. LAST(IBTRN,IBTRC) ; -- return last insurance review
  1. ; -- Input IBTRN = claims tracking id
  1. ; IBTRC = ins. review being edited (option)
  1. ; (if hip is defined for ibtrc will use last review
  1. ; for that policy)
  1. ;
  1. N X,Y,IBHIP,IBQUIT
  1. S Y="",IBQUIT=0
  1. I '$G(IBTRN) G LASTQ
  1. S IBHIP=$P($G(^IBT(356.2,+$G(IBTRC),1)),"^",5)
  1. S X=-$G(^IBT(356.2,+IBTRC,0)) F S X=$O(^IBT(356.2,"ATIDT",IBTRN,X)) Q:'X!(IBQUIT) D
  1. .S Y="" F S Y=$O(^IBT(356.2,"ATIDT",IBTRN,X,Y)) Q:'Y!('IBHIP) D Q:IBQUIT
  1. ..I $P($G(^IBT(356.2,+Y,1)),"^",5)=IBHIP S IBQUIT=1 Q
  1. LASTQ Q $S(+Y<1:"",Y:Y,1:"")
  1. ;
  1. HIP(IBTRC) ; -- compute default health insurance policy for claims tracking
  1. ; -- called by trigger on patient field (.05) of file 356.2
  1. ; -- output pointer to subfile (2.312)^insurnace co name
  1. N X,IBDD,IBINDT,DFN
  1. S X=""
  1. S DFN=$P($G(^IBT(356.2,+$G(IBTRC),0)),"^",5)
  1. G:'DFN HIPQ
  1. S IBINDT=$S($P($G(^IBT(356,+$P($G(^IBT(356.2,+IBTRC,0)),U,2),0)),U,6):$P(^(0),U,6),1:DT)
  1. D ALL^IBCNS1(DFN,"IBDD",1,IBINDT)
  1. I $G(IBDD(0))=1 S X=+$O(IBDD(0))
  1. ;
  1. ; -- if more than one look for primary
  1. I 'X,$G(IBDD(0))>1 D
  1. .S IBX=0
  1. .F S IBX=$O(IBDD(IBX)) Q:'IBX I $P($G(IBDD(IBX,0)),"^",20)=1 S X=IBX Q
  1. I X S X=X_"^"_$P($G(^DIC(36,+$G(IBDD(X,0)),0)),"^")
  1. HIPQ Q X
  1. ;
  1. HIPD(DA,IBTLST) ; -- compute default health insurance policy from last review
  1. ; -- called from input templates
  1. ; input da = current entry being edited
  1. ; ibtlst = last entry for this review as determine by $$LAST
  1. ;
  1. N X,DFN
  1. S X="" I $P($G(^IBT(356.2,DA,1)),"^",5) G HIPDQ
  1. G:'$G(IBTLST) HIPDQ
  1. S X=$P($G(^IBT(356.2,+IBTLST,1)),"^",5),DFN=$P(^(0),"^",5)
  1. HIPDQ Q $S(+X<1:"",1:$P($G(^DIC(36,+$G(^DPT(DFN,.312,X,0)),0)),"^",1))
  1. ;
  1. PC(DA,IBTLST) ; -- compute default person contacted from last review
  1. ; -- called from input templates
  1. ; input da = current entry being edited
  1. ; ibtlst = last entry for this review as determine by $$LAST
  1. ;
  1. Q $P($G(^IBT(356.2,+$G(IBTLST),0)),"^",6)
  1. ;
  1. MC(DA,IBTLST) ; -- compute default method of contact from last review
  1. ; -- called from input templates
  1. ; input da = current entry being edited
  1. ;
  1. ; ibtlst = last entry for this review as determine by $$LAST
  1. ;
  1. N X
  1. S X=$P($G(^IBT(356.2,+$G(IBTLST),0)),"^",17)
  1. Q $S(+X>0:$$EXPAND^IBTRE(356.2,.17,X),1:"PHONE")
  1. ;
  1. CP(DA,IBTLST) ; -- compute default contact phone number from last review
  1. ; -- called from input templates
  1. ; input da = current entry being edited
  1. ; ibtlst = last entry for this review as determine by $$LAST
  1. ;
  1. Q $P($G(^IBT(356.2,+$G(IBTLST),0)),"^",7)
  1. ;
  1. AN(DA,IBTLST) ; -- compute default authorization number policy (call ref default removed with *458)
  1. ; -- called from input templates
  1. ; input da = current entry being edited
  1. ; ibtlst = last entry for this review as determine by $$LAST
  1. ;
  1. Q $P($G(^IBT(356.2,+$G(IBTLST),2)),"^",2)
  1. ;N X
  1. ;S X=$P(^IBT(356.2,DA,0),"^",9)
  1. ;Q $E($S($L(X):X,1:$P($G(^IBT(356.2,+$G(IBTLST),0)),"^",28)),1,10)
  1. ;
  1. APPEAL ; -- called from IBTRC, needed more room to compute
  1. ; info if an appeal
  1. N DAYS S DAYS=""
  1. S X=$$SETFLD^VALM1($$EXPAND^IBTRE(356.2,.29,$P(IBTRCD,"^",29)),X,"ACTION")
  1. S DAYS=$P(IBTRCD,"^",25) I $P(IBTRCD,"^",29)=1,$P(IBTRCD,"^",10)=3,$O(^IBT(356.2,+IBTRC,14,0)) S DAYS=$$AP^IBTODD1(IBTRC)
  1. S X=$$SETFLD^VALM1($J(DAYS,3),X,"DAYS")
  1. S X=$$SETFLD^VALM1($$TPE(),X,"TYPE")
  1. Q
  1. ;
  1. TPE() ; -- add appeal type to type of action
  1. N X
  1. S X=$P(IBETYP,"^",3)
  1. I $P(IBTRCD,"^",23) S X=X_"-"_$S($P(IBTRCD,"^",23)=1:"Clin",$P(IBTRCD,"^",23)=2:"Admin",1:"")
  1. Q X