source: WorldVistAEHR/trunk/r/INTEGRATED_BILLING-IB-PRQ--IBD--IBQ--PRQS/IBATCM.m@ 1703

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

initial load of WorldVistAEHR

File size: 1.6 KB
Line 
1IBATCM ;LL/ELZ - TRANSFER PRICING TRANSACTION CHARGES ; 02-MAR-1999
2 ;;2.0;INTEGRATED BILLING;**115**;21-MAR-94
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5TOTAL(IBIEN) ; -- recalculate total and set
6 N IBT,IBD,IBTL S IBTL=0
7 S IBT=$P(^IBAT(351.61,IBIEN,0),"^",12)
8 I IBT["DGPM(" D Q
9 . S IBD=^IBAT(351.61,IBIEN,1)
10 . S IBTL=$P(IBD,"^",5)*$P(IBD,"^",6)+$P(IBD,"^",2)
11 . D SETTL(IBTL)
12 I IBT["SCE(" D Q
13 . N IBX S IBX=0 F S IBX=$O(^IBAT(351.61,IBIEN,3,IBX)) Q:IBX<1 D
14 .. S IBD=^IBAT(351.61,IBIEN,3,IBX,0)
15 .. S IBTL=$P(IBD,"^",2)*$P(IBD,"^",3)+IBTL
16 . D SETTL(IBTL)
17 I IBT["RMPR(660," D SETTL($P($G(^IBAT(351.61,IBIEN,4)),"^",5)) Q
18 S IBD=^IBAT(351.61,IBIEN,4)
19 S IBTL=$P(IBD,"^",2)*$P(IBD,"^",3)
20 D SETTL(IBTL)
21 Q
22SETTL(X) ; -- files total
23 N DIE,DR,DA Q:X<.01
24 S DIE="^IBAT(351.61,",DA=IBIEN,DR="6.02///"_$FN(X,"",2)_";.05////P"
25 D ^DIE
26 Q
27INPT(DRG,DATE,FAC) ; -- returns inpatient rates
28 ;
29 Q $$RATE("TP INPATIENT",DRG,DATE,$G(FAC))
30 ;
31OPT(CPT,DATE,FAC) ; -- returns outpatient rates
32 ;
33 Q $$RATE("TP OUTPATIENT",CPT,DATE,FAC)
34 ;
35RATE(BR,ITEM,DATE,FAC) ; -- returns rates for BR from charge master
36 ; CHARGE=1!0^default rate^nego rate^rate to use
37 ; if FAC undefined, send back default
38 N IBCHARGE,IBFAC
39 ;
40 ; look up negotiated rates if exist
41 I $G(FAC) F IBFAC=FAC,+$$VISN^IBATUTL(FAC) S $P(IBCHARGE,"^",2)=+$$ITCHG^IBCRCI($$TPCS^IBCRU7(BR,IBFAC),ITEM,DATE) Q:$P(IBCHARGE,"^",2)
42 ;
43 ; find default adjust by .8 and round
44 S $P(IBCHARGE,"^")=$FN((+$$ITCHG^IBCRCI($$TPCS^IBCRU7(BR),ITEM,DATE))*.8,"",2)
45 ;
46 ; set rate to use
47 S $P(IBCHARGE,"^",3)=$S($P(IBCHARGE,"^",2):$P(IBCHARGE,"^",2),1:+IBCHARGE)
48 ;
49 Q $S($P(IBCHARGE,"^",3):"1^",1:"0^")_IBCHARGE
50 ;
Note: See TracBrowser for help on using the repository browser.