source: FOIAVistA/trunk/r/FEE_BASIS-FB/FBAAFED.m@ 1076

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

initial load of FOIAVistA 6/30/08 version

File size: 5.1 KB
Line 
1FBAAFED ;WOIFO/SAB-FPPS DATA EDIT OUTPATIENT/ANCILLARY INVOICE ;8/6/2003
2 ;;3.5;FEE BASIS;**61**;JAN 30, 1995
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 I '$D(^XUSEC("FBAASUPERVISOR",DUZ)) D Q
6 . W $C(7),!,"You must hold the FBAASUPERVISOR security key to use this option!"
7 ;
8 S FBAAOUT=0
9 F D INVED Q:FBAAOUT
10 D CLEAN
11 Q
12 ;
13INVED ; Invoice Edit
14 ;
15ASKINV ; Select Invoice to Edit
16 W !
17 S DIR(0)="NO",DIR("A")="Select Invoice Number"
18 S DIR("?")="^D HELP^FBAAPIN1"
19 D ^DIR K DIR I $D(DIRUT)!(Y="") S FBAAOUT=1 Q
20 I '$D(^FBAAC("C",Y)) W !,$C(7),"Invalid selection.",! G ASKINV
21 S FBAAIN=Y
22 ;
23 I $$CKFPPS^FBFHLL(FBAAIN)'=1 D G ASKINV
24 . W !?5,"Invoice ",FBAAIN," has not been transmitted to FPPS."
25 ;
26 ; Get Lines on Invoice
27 D MILL^FBAAPET1(FBAAIN,.FBMILL)
28 ;
29 ; Determine Vendor and FPPS CLAIM ID based on first line on invoice
30 S FBIENS=FBMILL($O(FBMILL(0)))
31 S FBV=$P(FBIENS,",",3)
32 S (FBFPPSC,FBFPPSC(0))=$$GET1^DIQ(162.03,FBIENS,50)
33 ;
34 I FBFPPSC="" D G ASKINV
35 . W !,$C(7),"Only EDI Claims can be selected!"
36 ;
37 S FBINVCHG=0 ; initialize invoice changed flag
38 ;
39EDITFC ; edit FPPS CLAIM ID
40 S FBX=$$FPPSC^FBUTL5(1,FBFPPSC)
41 I FBX=-1 S FBAAOUT=1 G INVEDX
42 ; need to verify if following restriction is appropriate
43 I FBX="" D G EDITFC
44 . W !,$C(7),"Can not change EDI from YES to NO on invoice that has been sent to FPPS!"
45 S FBFPPSC=FBX
46 ;
47 ; if FPPS CLAIM ID changed, then update file, audit log, and lines
48 I FBFPPSC'=FBFPPSC(0) D
49 . ; set invoice changed flag
50 . S FBINVCHG=1
51 . ;
52 . K FBFDA
53 . ; loop thru lines on invoice
54 . S FBI=0 F S FBI=$O(FBMILL(FBI)) Q:'FBI D
55 . . S FBIENS=FBMILL(FBI)
56 . . ; file data in 162.03 for each line
57 . . S FBFDA(162.03,FBIENS,50)=$S(FBFPPSC="":"@",1:FBFPPSC)
58 . . ;
59 . . ; add record to audit log
60 . . K FBFDAA
61 . . S FBFDAA(163.7,"+1,",.01)=FBAAIN ; invoice number
62 . . S FBFDAA(163.7,"+1,",1)=$$NOW^XLFDT() ; date/time changed
63 . . S FBFDAA(163.7,"+1,",2)=162.03 ; file #
64 . . S FBFDAA(163.7,"+1,",3)=FBIENS ; iens
65 . . S FBFDAA(163.7,"+1,",4)=50 ; field #
66 . . S FBFDAA(163.7,"+1,",5)=FBFPPSC(0) ; old value
67 . . S FBFDAA(163.7,"+1,",6)=FBFPPSC ; new value
68 . . S FBFDAA(163.7,"+1,",7)=DUZ ; user
69 . . I $D(FBFDAA) D UPDATE^DIE("","FBFDAA") D MSG^DIALOG()
70 . . ;
71 . I $D(FBFDA) D FILE^DIE("","FBFDA") D MSG^DIALOG()
72 ;
73ASKLINE ; Select Line to Edit
74 ;
75ASKPT ; Select Patient
76 W !
77 S DIC="^FBAAC(",DIC(0)="AEQM"
78 D ^DIC K DIC I $D(DTOUT)!$D(DUOUT) G INVEDX
79 I Y'>0 D G:$D(DIRUT) INVEDX G:'Y ASKPT G INVEDX
80 . S DIR(0)="Y"
81 . S DIR("A")="Are you finished entering patients for this invoice"
82 . D ^DIR K DIR I $D(DIRUT) S FBAAOUT=1
83 S FBDA(3)=+Y
84 ;
85ASKVEN ; Select Vendor
86 W !
87 ;S DIC(0)="AEQM"
88 ;S DIC="^FBAAC("_FBDA(3)_",1,"
89 ;D ^DIC K DIC I $D(DTOUT)!$D(DUOUT) G INVEDX
90 ;I Y'>0 D G:$D(DIRUT) INVEDX G:'Y ASKVEN G ASKPT
91 ;. S DIR(0)="Y"
92 ;. S DIR("A")="Are you finished entering vendors for this patient"
93 ;. D ^DIR K DIR I $D(DIRUT) S FBAAOUT=1
94 ;S FBDA(2)=+Y
95 S FBDA(2)=FBV
96 W !,"Vendor = ",$P($G(^FBAAV(FBV,0)),U)
97 ;
98ASKDOS ; Select Date of Service
99 W !
100 S DIC(0)="AEQM"
101 S DIC="^FBAAC("_FBDA(3)_",1,"_FBDA(2)_",1,"
102 S DIC("A")="Select DATE OF SERVICE: "
103 D ^DIC K DIC I $D(DTOUT)!$D(DUOUT) G INVEDX
104 I Y'>0 D G:$D(DIRUT) INVEDX G:'Y ASKDOS G ASKPT
105 . S DIR(0)="Y"
106 . S DIR("A")="Are you finished entering dates for this patient"
107 . D ^DIR K DIR I $D(DIRUT) S FBAAOUT=1
108 S FBDA(1)=+Y
109 ;
110ASKSVC ; Select Service Provided
111 W !
112 S DIC(0)="AEQM"
113 S DIC="^FBAAC("_FBDA(3)_",1,"_FBDA(2)_",1,"_FBDA(1)_",1,"
114 D ^DIC K DIC I $D(DTOUT)!$D(DUOUT) G INVEDX
115 I Y'>0 D G:$D(DIRUT) INVEDX G:'Y ASKSVC G ASKDOS
116 . S DIR(0)="Y"
117 . S DIR("A")="Are you finished entering services for this date"
118 . D ^DIR K DIR I $D(DIRUT) S FBAAOUT=1
119 S FBDA=+Y
120 ;
121 S FBIENS=FBDA_","_FBDA(1)_","_FBDA(2)_","_FBDA(3)_","
122 ;
123 ; check if line is on invoice
124 I $$GET1^DIQ(162.03,FBIENS,14)'=FBAAIN D G ASKSVC
125 . W $C(7),!,"Line is not on invoice ",FBAAIN,"!"
126 ;
127 ; get current value of FPPS LINE ITEM to use as default
128 S (FBFPPSL(0),FBFPPSL)=$$GET1^DIQ(162.03,FBIENS,51)
129 ;
130EDITFL ; edit FPPS Line Item
131 S FBX=$$FPPSL^FBUTL5(FBFPPSL)
132 I FBX=-1 S FBAAOUT=1 G INVEDX
133 ; need to verify if following restriction is appropriate
134 S FBFPPSL=FBX
135 ;
136 ; if FPPS LINE ITEM changed, then update file and audit log
137 I FBFPPSL'=FBFPPSL(0) D
138 . ; set invoice changed flag
139 . S FBINVCHG=1
140 . ;
141 . ; file data in 162.03
142 . K FBFDA
143 . S FBFDA(162.03,FBIENS,51)=FBFPPSL
144 . I $D(FBFDA) D FILE^DIE("","FBFDA") D MSG^DIALOG()
145 . ;
146 . ; add record to audit log
147 . K FBFDA
148 . S FBFDA(163.7,"+1,",.01)=FBAAIN ; invoice number
149 . S FBFDA(163.7,"+1,",1)=$$NOW^XLFDT() ; date/time changed
150 . S FBFDA(163.7,"+1,",2)=162.03 ; file #
151 . S FBFDA(163.7,"+1,",3)=FBIENS ; iens
152 . S FBFDA(163.7,"+1,",4)=51 ; field #
153 . S FBFDA(163.7,"+1,",5)=FBFPPSL(0) ; old value
154 . S FBFDA(163.7,"+1,",6)=FBFPPSL ; new value
155 . S FBFDA(163.7,"+1,",7)=DUZ ; user
156 . I $D(FBFDA) D UPDATE^DIE("","FBFDA") D MSG^DIALOG()
157 ;
158 G ASKSVC
159 ;
160INVEDX ; Invoice Edit Exit
161 ; if invoice changed then queue for retransmit to FPPS
162 I FBINVCHG D FILEQUE^FBFHLL(FBAAIN,3)
163 Q
164 ;
165CLEAN K D,DIC,DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
166 K FBAAIN,FBAAOUT,FBDA,FBFDA,FBFDAA,FBIENS,FBFPPSC,FBFPPSL,FBINVCHG
167 K FBMILL,FBV,FBX
168 Q
169 ;FBAAFED
Note: See TracBrowser for help on using the repository browser.