source: WorldVistAEHR/trunk/r/FEE_BASIS-FB/FBAARB.m@ 1154

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

initial load of WorldVistAEHR

File size: 2.1 KB
Line 
1FBAARB ;AISC/GRR,dmk-RE-OPEN BATCH PREVIOUSLY CLOSED ;18OCT94
2 ;;3.5;FEE BASIS;;JAN 30, 1995
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4BT W !!
5 S DIC="^FBAA(161.7,",DIC(0)="AEQMZ",DIC("S")=$S($D(^XUSEC("FBAASUPERVISOR",DUZ)):"I $G(^(""ST""))=""C""",1:"I $P(^(0),U,5)=DUZ&($G(^(""ST""))=""C"")")
6 D ^DIC K DIC G Q:X="^"!(X=""),BT:Y<0
7 S FBBAT=+Y,FBTYPE=$P(Y(0),U,3)
8 ;FBBAT=ien of batch in 161.7 FBTYPE= batch type (B2,B3,B5,B9)
9 ;reset payment line item total and total dollars
10 D CNTTOT(FBBAT)
11 S DIE="^FBAA(161.7,",DR="4////^S X=DUZ;4.5///@;10////^S X=FBLCNT;8////^S X=FBTOTAL;11////^S X=""O"";S:$G(FBTYPE)'=""B9"" Y="""";9////^S X=FBLCNT",DA=FBBAT
12 D ^DIE K DIE,DR
13 S:FBTOTAL=0 $P(^FBAA(161.7,+FBBAT,0),U,9)=""
14 S:FBLCNT=0 $P(^FBAA(161.7,+FBBAT,0),U,11)=""
15 W !! D EN^DIQ W !,"Batch has been Re-opened!" D Q G BT
16 ;
17Q K DA,FBLCNT,FBTOTAL,FBBAT,Y
18 Q
19 ;
20CNTTOT(B) ;called to determine line count and total dollars for a batch
21 ; INPUT: B = IEN of batch in 161.7
22 ; OUTPUT: FBLCNT = total line items in batch
23 ; FBTOTAL= total dollars in batch
24 ;
25 N A
26 S (FBLCNT,FBTOTAL)=0
27 Q:'$G(B)
28 Q:'$D(^FBAA(161.7,+B,0)) S A=$P($G(^(0)),U,3)
29 Q:A']""
30 D @A
31 Q
32B2 ;travel batch use ^FBAAC("AD", to locate line items
33 N I,J
34 S (I,J)=0 F S I=$O(^FBAAC("AD",B,I)) Q:'I F S J=$O(^FBAAC("AD",B,I,J)) Q:'J I $D(^FBAAC(I,3,J,0)) D
35 . S FBLCNT=FBLCNT+1,FBTOTAL=FBTOTAL+$P(^(0),U,3)
36 Q
37 ;
38B3 ;outpatient batch use ^FBAAC("AC", to locate line items
39 N I,J,K,L
40 S (I,J,K,L)=0
41 F S I=$O(^FBAAC("AC",B,I)) Q:'I F S J=$O(^FBAAC("AC",B,I,J)) Q:'J F S K=$O(^FBAAC("AC",B,I,J,K)) Q:'K F S L=$O(^FBAAC("AC",B,I,J,K,L)) Q:'L I $D(^FBAAC(I,1,J,1,K,1,L,0)) D
42 . S FBLCNT=FBLCNT+1,FBTOTAL=FBTOTAL+$P(^(0),U,3)
43 Q
44 ;
45B5 ;pharmacy batch use ^FBAA(162.1,"AE", to locate line items
46 N I,J
47 S (I,J)=0
48 F S I=$O(^FBAA(162.1,"AE",B,I)) Q:'I F S J=$O(^FBAA(162.1,"AE",B,I,J)) Q:'J I $D(^FBAA(162.1,I,"RX",J,0)) D
49 . S FBLCNT=FBLCNT+1,FBTOTAL=FBTOTAL+$P(^(0),U,16)
50 Q
51 ;
52B9 ;inpatient batch use ^FBAAI("AC", to locate line items
53 N I
54 S I=0
55 F S I=$O(^FBAAI("AC",B,I)) Q:'I I $D(^FBAAI(I,0)) D
56 . S FBLCNT=FBLCNT+1,FBTOTAL=FBTOTAL+$P(^(0),U,9)
57 Q
Note: See TracBrowser for help on using the repository browser.