source: FOIAVistA/trunk/r/INTEGRATED_BILLING-IB-PRQ--IBD--IBQ--PRQS/IBCREF.m@ 1154

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

initial load of FOIAVistA 6/30/08 version

File size: 2.1 KB
Line 
1IBCREF ;ALB/ARH - RATES: CM FILE ENTRIES (CI,BI) ; 22-MAY-1996
2 ;;2.0;INTEGRATED BILLING;**52,106,138,245**;21-MAR-94
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 ;
6ADDCI(CS,ITEM,EFDT,CHG,RVCD,MOD,INAC,BASE) ; adds new charge item entries, does not check for duplicates or zero charge
7 ; Input: CS, ITEM, EFDT are required, rest will be set if they have values
8 ; Output: IFN of new entry
9 ;
10 N IBCS0,IBCI,IBEFDT,IBBI,IBFILE,DIC,DIE,DA,D0,DLAYGO,DR,X,Y S IBCI=0 I '$G(ITEM) G ADDCIQ
11 S IBCS0=$G(^IBE(363.1,+$G(CS),0)) I IBCS0="" G ADDCIQ
12 S IBEFDT=$G(EFDT)\1 I IBEFDT'?7N G ADDCIQ
13 ;
14 S IBBI=$P($$CSBR^IBCRU3(CS),U,4) I 'IBBI G ADDCIQ
15 S IBFILE=$P($$BIFILE^IBCRU2(IBBI),U,1) I IBFILE="" G ADDCIQ
16 I '$$ITFILE^IBCRU2(IBBI,ITEM,IBEFDT) G ADDCIQ
17 ;
18 S DIC("DR")=".02////"_CS_";.03////"_IBEFDT
19 K DD,DO S DLAYGO=363.2,DIC="^IBA(363.2,",DIC(0)="L",X=+ITEM_IBFILE
20 D FILE^DICN K DIC,DLAYGO,X I Y<1 G ADDCIQ
21 ;
22 S IBCI=+Y D EDITCI(IBCI,$G(CHG),$G(RVCD),$G(MOD),$G(INAC),$G(BASE))
23 ;
24ADDCIQ Q IBCI
25 ;
26EDITCI(CI,CHG,RVCD,MOD,INAC,BASE) ; edit certain fields of a charge item
27 ;
28 N DIC,DIE,DA,D0,DR,X,Y S DR=""
29 S:$G(INAC)'="" DR=".04////"_INAC_";" S:$G(CHG)'="" DR=DR_".05////"_+$FN(CHG,"",2)_";" S:$G(BASE)'="" DR=DR_".08////"_+$FN(BASE,"",2)_";"
30 S:$G(RVCD)'="" DR=DR_".06////"_RVCD_";" S:$G(MOD)'="" DR=DR_".07////"_MOD
31 I DR'="",+$G(CI),$G(^IBA(363.2,+CI,0))'="" S DIE="^IBA(363.2,",DA=+CI D ^DIE
32 Q
33 ;
34ADDBI(TYPE,NAME,DUP) ; add a new Billing Item entry (363.21), check for duplicates optional
35 ; Input: TYPE - data type (363.21,.02), NAME - billing item name, DUP - 1 if add without duplicate check
36 ; Output: 0 - not added, BI IFN ^ 0 - already exists, BI IFN ^ 1 - new entry added
37 N IBX,IBTYPE,IBBI,DIC,DIE,DA,D0,DLAYGO,DR,X,Y S IBBI=0
38 ;
39 S IBTYPE=$G(TYPE),IBTYPE=$S(IBTYPE["NDC":1,IBTYPE["MISCELLANEOUS":9,1:IBTYPE) I 'IBTYPE!($G(NAME)="") G ADDBIQ
40 I IBTYPE=1,NAME'?1N.N1"-"1N.N1"-"1N.N G ADDBIQ
41 I '$G(DUP) S IBX=$$FNDBI^IBCRU2(IBTYPE,NAME) I +IBX S IBBI=+IBX_U_0 G ADDBIQ
42 ;
43 S DIC("DR")=".02////"_IBTYPE
44 K DD,DO S DLAYGO=363.21,DIC="^IBA(363.21,",DIC(0)="L",X=NAME D FILE^DICN K DIC,DLAYGO,X I Y<1 G ADDCIQ
45 S IBBI=+Y_U_1
46ADDBIQ Q IBBI
Note: See TracBrowser for help on using the repository browser.