-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSummaryModule.py
168 lines (127 loc) · 5.74 KB
/
SummaryModule.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
import DBModule as db
class summaryClass:
def __init__(self):
from fpdf import FPDF
self.pdf = FPDF()
self.pdf.set_auto_page_break(False)
self.currentRow = 0
self.claimCount = 1
self.database = db.database_class()
def writeClaim(self, claim, diagCodes):
#self.database.insertAccession(claim.rowList[0]["ACCESSION_NUMBER"])
self.pdf.set_font('Arial', '', 8)
self.pdf.set_xy(5, self.currentRow)
self.pdf.line(5, self.currentRow, 280, self.currentRow)
self.currentRow += 2
self.pdf.set_xy(5, self.currentRow)
self.pdf.cell(5, 4, "[" + str(self.claimCount) + "]")
self.pdf.set_xy(12, self.currentRow)
self.pdf.cell(5, 4, str(claim.rowList[0]["ACCESSION_NUMBER"]))
self.pdf.set_xy(38, self.currentRow)
self.pdf.cell(5, 4, str(claim.rowList[0]["PATIENT_ID"]))
self.pdf.set_xy(70, self.currentRow)
self.pdf.cell(5, 4, str(claim.rowList[0]["PATIENT_LAST"]))
self.pdf.set_xy(88, self.currentRow)
self.pdf.cell(5, 4, str(claim.rowList[0]["PATIENT_FIRST"]))
self.pdf.set_xy(110, self.currentRow)
self.pdf.cell(5, 4, str(claim.rowList[0]["PATIENT_DOB"]))
self.pdf.set_xy(132, self.currentRow)
self.pdf.cell(5, 4, str(claim.rowList[0]["PATIENT_GENDER"]))
self.pdf.set_xy(145, self.currentRow)
self.pdf.cell(5, 4, str(claim.rowList[0]["REFER_PHY_FIRST"]))
self.pdf.set_xy(160, self.currentRow)
self.pdf.cell(5, 4, str(claim.rowList[0]["REFER_PHY_LAST"]))
self.pdf.set_xy(190, self.currentRow)
self.pdf.cell(5, 4, str(claim.rowList[0]["REFER_PHY_NPI"]))
self.pdf.set_xy(220, self.currentRow)
self.pdf.cell(5, 4, str(claim.rowList[0]["INSURANCE_PLAN_NAME"]))
self.currentRow += 5
self.pdf.set_xy(70, self.currentRow)
self.pdf.cell(5, 4, str(claim.rowList[0]["PATIENT_STREET_ADDR"]))
self.pdf.set_xy(220, self.currentRow)
self.pdf.cell(5, 4, str(claim.rowList[0]["INSURANCE_STREET_ADDR"]))
self.currentRow += 5
self.pdf.set_xy(70, self.currentRow)
self.pdf.cell(5, 4, str(claim.rowList[0]["PATIENT_CITY"]))
self.pdf.set_xy(105, self.currentRow)
self.pdf.cell(5, 4, str(claim.rowList[0]["PATIENT_STATE"]))
self.pdf.set_xy(110, self.currentRow)
self.pdf.cell(5, 4, str(claim.rowList[0]["PATIENT_ZIP"]))
self.pdf.set_xy(220, self.currentRow)
self.pdf.cell(5, 4, str(claim.rowList[0]["INSURANCE_CITY"]))
self.pdf.set_xy(250, self.currentRow)
self.pdf.cell(5, 4, str(claim.rowList[0]["INSURANCE_STATE"]))
self.pdf.set_xy(258, self.currentRow)
self.pdf.cell(5, 4, str(claim.rowList[0]["INSURANCE_ZIP"]))
self.currentRow += 5
self.pdf.line(5,self.currentRow, 280, self.currentRow)
self.currentRow += 2
self.pdf.set_xy(15, self.currentRow)
self.pdf.cell(5, 4, "From DOS: " + claim.rowList[0]["FROM_DATE_SERVICE"])
self.pdf.set_xy(50, self.currentRow)
self.pdf.cell(5, 4, "To DOS: " + claim.rowList[0]["TO_DATE_SERVICE"])
self.currentRow += 5
self.pdf.set_xy(15, self.currentRow)
self.pdf.cell(5, 4, "Diagnosis Codes:")
xPos = 40
for i in range(len(diagCodes)):
self.pdf.set_xy(xPos, self.currentRow)
self.pdf.cell(5, 4, diagCodes[i])
xPos += 15
self.currentRow += 5
self.pdf.set_xy(15, self.currentRow)
self.pdf.cell(5, 4, "CPT Code")
self.pdf.set_xy(35, self.currentRow)
self.pdf.cell(5, 4, "EMG Code")
self.pdf.set_xy(55, self.currentRow)
self.pdf.cell(5, 4, "Price")
self.currentRow += 5
self.pdf.line(5, self.currentRow, 280, self.currentRow)
self.currentRow += 3
claimTotal = 0
for row in claim.rowList:
self.pdf.set_xy(15, self.currentRow)
self.pdf.cell(5, 4, str(row["CPT"]))
self.pdf.set_xy(35, self.currentRow)
self.pdf.cell(5, 4, str(row["EMG"]))
self.pdf.set_xy(55, self.currentRow)
self.pdf.cell(5, 4, str(row["PRICE"]))
claimTotal = claimTotal + int(row["PRICE"])
self.currentRow += 5
if self.pdf.get_y() > 155:
self.pdf.add_page("L")
self.pdf.set_xy(5, 10)
self.currentRow = 5
self.currentRow += 5
self.pdf.set_xy(35,self.currentRow)
self.pdf.cell(5, 4, "Claim Total: " + str(claimTotal))
self.currentRow += 10
self.claimCount += 1
def writeMast(self):
self.pdf.add_page("L")
self.pdf.set_font('Arial', 'B', 10)
self.pdf.set_xy(5,0)
self.pdf.cell(5, 10, 'Claim Summary - ')
self.pdf.set_xy(12, self.currentRow + 10)
self.pdf.set_font('Arial', '', 8)
self.pdf.cell(5, 4, "Accession #")
self.pdf.set_xy(38, self.currentRow + 10)
self.pdf.cell(5, 4, "Sub ID")
self.pdf.set_xy(70, self.currentRow + 10)
self.pdf.cell(5, 4, "Pat. Last")
self.pdf.set_xy(88, self.currentRow + 10)
self.pdf.cell(5, 4, "Pat. First")
self.pdf.set_xy(110, self.currentRow + 10)
self.pdf.cell(5, 4, "DOB")
self.pdf.set_xy(132, self.currentRow + 10)
self.pdf.cell(5, 4, "Gender")
self.pdf.set_xy(145, self.currentRow + 10)
self.pdf.cell(5, 4, "Ref Phy")
self.pdf.set_xy(190, self.currentRow + 10)
self.pdf.cell(5, 4, "Ref Phy NPI")
self.pdf.set_xy(220, self.currentRow + 10)
self.pdf.cell(5, 4, "Insurance")
self.currentRow = 20
self.pdf.set_font('Arial', '', 10)
def writePDF(self):
self.pdf.output('claimSummary.pdf', 'F')