source: WorldVistAEHR/trunk/r/INCOME_VERIFICATION_MATCH-IVM/IVMPTRN6.m@ 1604

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

initial load of WorldVistAEHR

File size: 2.9 KB
Line 
1IVMPTRN6 ;ALB/CPM - UPDATE BILLING TRANSMISSION FILE ; 13-JUN-94
2 ;;Version 2.0 ; INCOME VERIFICATION MATCH ;; 21-OCT-94
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5UPDATE ; Roll through billing activity and update file #301.61 if necessary
6 ; Input: the array ^TMP("IVMPTRN5",$J), which is built in
7 ; the routine IVMPTRN5 and fully described in the
8 ; routine IBAMTV4.
9 ;
10 S IVMREF="" F S IVMREF=$O(^TMP("IVMPTRN5",$J,IVMREF)) Q:IVMREF="" S IVMSTR=$G(^(IVMREF)) I IVMSTR D
11 .;
12 .; - if an uncancelled bill is not recorded, add it
13 .S IVMTDA=$O(^IVM(301.61,"B",IVMREF,0)) I 'IVMTDA D Q
14 ..Q:$P(IVMSTR,"^",10)
15 ..S IVMTDA=$$ADD^IVMUFNC3(IVMREF) Q:'IVMTDA
16 ..D NOW^%DTC S $P(^IVM(301.61,IVMTDA,0),"^",2,11)=$P(IVMSTR,"^",1,10),$P(^(1),"^",3,4)=%_"^"_DUZ
17 ..S DA=IVMTDA,DIK="^IVM(301.61," D IX1^DIK
18 ..;
19 ..; - trigger transmission
20 ..I $P(IVMSTR,"^",3)>1,$P(IVMSTR,"^",11) Q ; bill is on hold
21 ..D TRANS(IVMTDA,1)
22 .;
23 .; - see if a transmission is not required
24 .S IVMQ=0,IVMTN=$G(^IVM(301.61,IVMTDA,0)) Q:'IVMTN
25 .I $P(IVMTN,"^",14) D Q:IVMQ
26 ..I $P(IVMTN,"^",10)!$P(IVMTN,"^",11) S IVMQ=1 Q
27 ..I $P(IVMTN,"^",4)>1,'$P(IVMSTR,"^",10),$P(IVMTN,"^",8)=$P(IVMSTR,"^",7) S IVMQ=1 Q
28 .;
29 .; - if a billed charge was cancelled, zero out amt and queue trans.
30 .I $P(IVMTN,"^",13),$P(IVMSTR,"^",10) D Q
31 ..S DA=IVMTDA,DIE="^IVM(301.61,",DR=".08////0;.11////1" D ^DIE K DA,DR,DIE
32 ..D TRANS(IVMTDA,1)
33 .;
34 .; - if a held charge
35 .I '$P(IVMTN,"^",13) D Q:IVMQ
36 ..;
37 ..; - is still on hold, quit
38 ..I $P(IVMSTR,"^",11) S IVMQ=1 Q
39 ..;
40 ..; - was cancelled, delete record
41 ..I $P(IVMSTR,"^",10) S DA=IVMTDA,DIK="^IVM(301.61," D ^DIK K DA,DIK S IVMQ=1
42 .;
43 .; - is no longer on hold, update record and queue transmission
44 .I '$P(IVMTN,"^",13),'$P(IVMSTR,"^",11) D
45 ..S DR=".05////"_$P(IVMSTR,"^",4)_";.06////"_$P(IVMSTR,"^",5)_";.07////"_$P(IVMSTR,"^",6)_";.08////"_$P(IVMSTR,"^",7)
46 ..S DA=IVMTDA,DIE="^IVM(301.61," D ^DIE K DA,DR,DIE
47 ..D TRANS(IVMTDA,1)
48 .;
49 .; - if amts billed/collected, or status changes, update and queue
50 .I +$P(IVMTN,"^",8)=+$P(IVMSTR,"^",7),+$P(IVMTN,"^",11)=+$P(IVMSTR,"^",10) D Q:IVMQ
51 ..I $P(IVMTN,"^",4)>1 S IVMQ=1 Q
52 ..I +$P(IVMTN,"^",9)=+$P(IVMSTR,"^",8),+$P(IVMTN,"^",10)=+$P(IVMSTR,"^",9) S IVMQ=1 Q
53 .;
54 .S DR=".05////"_$P(IVMSTR,"^",4)_";.06////"_$P(IVMSTR,"^",5)_";.08////"_$P(IVMSTR,"^",7)
55 .I $P(IVMTN,"^",4)=1 S DR=DR_$S($P(IVMSTR,"^",8):";.09////"_$P(IVMSTR,"^",8),1:"")_$S($P(IVMSTR,"^",9):";.1////"_$P(IVMSTR,"^",9),1:"")
56 .I $P(IVMSTR,"^",10) S DR=DR_";.11////1"
57 .S DA=IVMTDA,DIE="^IVM(301.61," D ^DIE K DA,DR,DIE
58 .D TRANS(IVMTDA,1)
59 ;
60 K IVMREF,IVMSTR,IVMTDA,IVMQ,IVMTN,^TMP("IVMPTRN5",$J)
61 Q
62 ;
63 ;
64TRANS(DA,IVMF) ; Set bill to be transmitted
65 ; Input: DA -- Pointer to transmission record in #301.61
66 ; IVMF -- Flag to queue transmission [1=Yes, 0=No]
67 I '$G(DA) G TRANSQ
68 N DR,DIE
69 S DIE="^IVM(301.61,",DR=".12////"_+$G(IVMF)_";1.03///NOW;1.04////"_DUZ D ^DIE
70TRANSQ Q
Note: See TracBrowser for help on using the repository browser.