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

IBCU.m

Go to the documentation of this file.
  1. IBCU ;ALB/MRL - BILLING UTILITY ROUTINE ;01 JUN 88 12:00
  1. ;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. ;MAP TO DGCRU
  1. ;
  1. ARSTAT ;find status of bill in file 430.3 (ar) return status number
  1. S IBARST=$$STA^PRCAFN(IBIFN)
  1. Q
  1. ;
  1. ARCAT ;Trigger logic to set who's responsible in 399.3 from AR Category
  1. S X=$P($$CATN^PRCAFN($P(^DGCR(399.3,DA,0),"^",6)),"^",3)
  1. S:X'="" X=$S("PC"[X:"p",X="N":"o",X="T":"i",1:"")
  1. Q
  1. ;
  1. PTF ;Screen for appropriate PTF records
  1. K IBDD1 S DFN=+$P(^DGCR(399,+DA,0),"^",2) Q:'$D(^DPT(+DFN,0)) S IB05=$P(^(0),"^",1),IB03=$P(^DGCR(399,+DA,0),"^",3)
  1. S IB01="",IB02=0 F IB02=0:0 S IB01=$O(^DD(45,0,"ID",IB01)) Q:'IB01 S IB02=IB02+1,IBDD(IB02)=^(IB01)
  1. F IB01=0:0 S IB01=$O(^DGPT("B",+DFN,IB01)) Q:'IB01 I $D(^DGPT(+IB01,0)) S IB04=$P(^(0),"^",2),Y=+IB01 I $P(IB03,".",1)=$P(IB04,".",1) S IBDD1(+Y)="" I $S('$D(X):0,X["?":1,1:0) D PTFW
  1. G PTFQ:X'["?" I '$O(IBDD1(0)) W !,"Patient has no ACTIVE PTF RECORDS for this event date.",!,"A 'PTF NUMBER' is required for inpatient billing records."
  1. E W !!,"Select the appropriate billing record from the above listing by number."
  1. PTFQ W ! K IB01,IB02,IB03,IB04,IB05,IBDD Q
  1. PTFW W !,Y,?15,IB05 F IB02=0:0 S IB02=$O(IBDD(IB02)) Q:'IB02 X IBDD(IB02)
  1. Q
  1. ;
  1. AGE ;Input Transform for Condition Code 17
  1. I X=18 G SEX
  1. I X=17 S IBC=X,DFN=$P(^DGCR(399,D0,0),"^",2) D DEM^VADPT I VADM(4)<100 W !!,"This patient is only ",VADM(4)," years old!!",!! K IBC Q
  1. I $D(IBC) S X=IBC
  1. Q
  1. ;
  1. SEX ;Input Transform for Condition Code 18
  1. I X=18 S IBC=X,DFN=$P(^DGCR(399,D0,0),"^",2) D DEM^VADPT I $E(VADM(5))="M" W !!,"This patient is a MALE!! Condition code 18 applies only to FEMALES!!",!! K IBC,X
  1. I $D(IBC) S X=IBC
  1. Q
  1. ;
  1. REV ;Input Transform for Revenue Code
  1. I X=-1 W !!,"Choose only ACTIVE Revenue Codes!!",!! S D="AC" ;S X="" S X=$O(^DGCR(399.2,"AC",X)) Q:X="" W !,$P(^DGCR(399.2,X,0),"^",1),?30,$P(^(0),"^",2) K X Q
  1. I '$D(IBC) I $D(^DGCR(399.2,X,0)) I '$P(^DGCR(399.2,X,0),"^",3) W !!,"Only ACTIVE Revenue Codes may be selected!!",!! K X Q
  1. Q
  1. ;
  1. YN S X=$E(X),X=$S(X=1:X,X=0:X,X="Y":1,X="y":1,X="n":0,X="N":0,1:2) I X'=2 W " (",$S(X:"YES",1:"NO"),")" Q
  1. W !?4,"NOT A VALID CHOICE!",*7 K X Q
  1. Q
  1. ;
  1. DIS ;Determine Billing Discharge status from PTF
  1. ;Called from triggers on fields .08 and 161
  1. N A
  1. I '$D(^DGCR(399,DA,0)) S X="" G DISQ
  1. S X=$P(^DGCR(399,DA,0),"^",6) I X=2!(X=3) S X=$O(^DGCR(399.1,"B","STILL PATIENT",0)) G DISQ
  1. S X=$P(^DGCR(399,DA,0),"^",8) I $S(X="":1,'$D(^DGPT(X)):1,1:0) S X="" G DISQ
  1. I '+$G(^DGPT(X,70)) S X=$O(^DGCR(399.1,"B","STILL PATIENT",0)) G DISQ
  1. S A=$P($G(^DGCR(399,DA,"U")),"^",2) I A,(A+.24)<+$G(^DGPT(X,70)) S X=$O(^DGCR(399.1,"B","STILL PATIENT",0)) G DISQ
  1. S X=+$P($G(^DGPT(X,70)),"^",3)
  1. I X=1 S X=$O(^DGCR(399.1,"B",$E("DISCHARGED TO HOME OR SELF CARE",1,30),0)) G DISQ
  1. I X=4 S X=$O(^DGCR(399.1,"B",$E("LEFT AGAINST MEDICAL ADVICE",1,30),0)) G DISQ
  1. I X=6!(X=7) S X=$O(^DGCR(399.1,"B","EXPIRED",0)) G DISQ
  1. I X=5!(X=2) S X=$O(^DGCR(399.1,"B",$E("DISCHARGED TO ANOTHER SHORT-TERM GENERAL HOSPITAL",1,30),0)) G DISQ
  1. S X=""
  1. DISQ Q
  1. ;
  1. INST ;Ask Institutution address info
  1. S DIC("DR")="1.01;1.02;1.03;.02;1.04" I $D(^XUSEC("IB SUPERVISOR",DUZ)) S DLAYGO=4
  1. Q
  1. ;
  1. SM ;Flag for printing medicare statment on UB-82
  1. ;DGSM=0 means figure out which statement, DGSM=1 means no statements
  1. S DGSM=0 Q
  1. ;IBCU