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

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

initial load of WorldVistAEHR

File size: 2.7 KB
RevLine 
[613]1IBYPPL ;ALB/ARH - IB*2*307 POST INIT: CMAC 2005, INACTIVATE OLD CHARGES ; 06-JUN-2005
2 ;;2.0;INTEGRATED BILLING;**307**;21-MAR-94
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 Q
6POST ;
7 N IBA S IBA(1)="",IBA(2)=" IB*2*307 CMAC 2005 Post-Install .....",IBA(3)="" D MES^XPDUTL(.IBA) K IBA
8 ;
9 D CHGINA("CMAC",3050401) ; inactivate all CMAC charges effective before 04/01/05 in #363.2
10 ;
11 S IBA(1)="",IBA(2)=" IB*2*307 CMAC 2005 Post-Install Complete",IBA(3)="" D MES^XPDUTL(.IBA) K IBA
12 Q
13 ;
14CHGINA(BRATE,NEXT) ; inactivate charges for a particular Billing Rate
15 ; For procedure charges of requested Billing Rate, inactivate all charges effective before the date passed in.
16 ; - For each charge the inactive date used is one day before the procedures next charge effective date.
17 ; - If no date is passed in then the last charge is left active.
18 ; - If a date is passed in it is used as the default in case no 'next' date is found.
19 ; BRATE - Billing Rate, any charges whose billing rate contain BRATE will be inactivated
20 ; NEXT - if set, beginning effective date of charges that should not be inactivated
21 ;
22 N IBA,IBI,IBX,IBCS,IBCS0,IBBR0,IBXRF,IBITM,IBNEF,IBCI,IBCI0,IBCIEF,IBCIIA,IBNEWIA
23 N DD,DO,DLAYGO,DIC,DIE,DA,DR,X,Y,IBCNT S IBCNT=0 Q:$G(BRATE)="" S NEXT=$G(NEXT) I NEXT'="",NEXT'?7N Q
24 ;
25 S IBA(1)=" >> Inactivating Existing "_BRATE_" Charges, Please Wait..." D MES^XPDUTL(.IBA) K IBA
26 ;
27 S IBCS=0 F S IBCS=$O(^IBE(363.1,IBCS)) Q:'IBCS D
28 . S IBCS0=$G(^IBE(363.1,IBCS,0)) Q:IBCS0=""
29 . S IBBR0=$G(^IBE(363.3,+$P(IBCS0,U,2),0))
30 . ;
31 . I $P(IBBR0,U,1)'[BRATE Q
32 . ;
33 . S IBXRF="AIVDTS"_IBCS
34 . S IBITM=0 F S IBITM=$O(^IBA(363.2,IBXRF,IBITM)) Q:'IBITM D
35 .. S IBNEF="" F S IBNEF=$O(^IBA(363.2,IBXRF,IBITM,IBNEF)) Q:IBNEF="" D
36 ... ;
37 ... S IBCI=0 F S IBCI=$O(^IBA(363.2,IBXRF,IBITM,IBNEF,IBCI)) Q:'IBCI D
38 .... S IBCI0=$G(^IBA(363.2,IBCI,0)) Q:IBCI0=""
39 .... S IBCIEF=$P(IBCI0,U,3),IBCIIA=$P(IBCI0,U,4),IBNEWIA=""
40 .... ;
41 .... I +NEXT,IBCIEF'<NEXT Q
42 .... ;
43 .... S IBNEWIA=-$O(^IBA(363.2,IBXRF,IBITM,-IBCIEF),-1) I 'IBNEWIA S IBNEWIA=NEXT
44 .... ;
45 .... I 'IBNEWIA Q
46 .... I +IBCIIA,IBCIIA'>IBNEWIA Q
47 .... ;
48 .... S IBNEWIA=$$FMADD^XLFDT(IBNEWIA,-1)
49 .... ;
50 .... S DR=".04////"_+IBNEWIA,DIE="^IBA(363.2,",DA=+IBCI D ^DIE K DIE,DIC,DA,DR,X,Y S IBCNT=IBCNT+1
51 ;
52 S IBA(1)=" Done. "_IBCNT_" existing charges inactivated " D MES^XPDUTL(.IBA) K IBA
53 Q
54 ;
55 ;
56 ;
57MCCRUTL(X,P) ; returns IFN of item in 399.1 if Name is found and piece P is true
58 N IBX,IBY S IBY=""
59 I $G(X)'="" S IBX=0 F S IBX=$O(^DGCR(399.1,"B",X,IBX)) Q:'IBX I $P($G(^DGCR(399.1,IBX,0)),U,+$G(P)) S IBY=IBX
60 Q IBY
61 ;
62MSG(X) ;
63 N IBX S IBX=$O(IBA(999999),-1) S:'IBX IBX=1 S IBX=IBX+1
64 S IBA(IBX)=$G(X)
65 Q
Note: See TracBrowser for help on using the repository browser.