-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathread_intraop.py
More file actions
237 lines (203 loc) · 7.22 KB
/
Copy pathread_intraop.py
File metadata and controls
237 lines (203 loc) · 7.22 KB
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
import pandas as pd
import numpy as np
from datetime import datetime
import os
from pathlib import Path
def read_intraop():
date_columns = date_columns = ['Intraop Date','Last updated on','Date of Surgery/Fecha de cirugía','Incident date']
current_dir = Path(__file__).resolve().parent
data_path = current_dir.parent / "LF_Scripts" / "data"
df = pd.read_excel(data_path / "Enrollment.xls", parse_dates=date_columns)
df_intraop = pd.DataFrame(df)
df_intraop['Enrollment date'] = df_intraop['Date of Surgery/Fecha de cirugía']
return df_intraop
df_intraop = read_intraop()
#
#df[['Was the dressing not removed?','The wound looks clean and healthy']]= df[['Was the dressing not removed?','The wound looks clean and healthy']].fillna('')
df_intraop = df_intraop.rename(columns={'Tracked entity instance':'tei'})
df_intaop = pd.DataFrame(df_intraop,columns=['tei','Event','Enrollment date', 'Incident date', 'Geometry', 'Longitude', 'Latitude', 'Organisation unit name', 'Organisation unit code', 'Organisation unit', 'Card/Medical Record Number', 'Patient First Name',
'Patient Last Name',
'Sex',
'Date of Birth',
'Patient Age (For system use)',
'ASA Classification?',
'Anemia',
'Does the patient currently smoke cigarettes?',
'Does the patient have a diagnosis of hypertension?',
'Does the patient have diabetes?',
'HIV',
'Is the patient admitted to the ICU?',
'Is the patient hypothermic? (T<35C)',
'Is the patient malnourished? (BMI<18)',
'Is the patient obese? (BMI>30)',
'Is the patient on steroid medication?',
'Location of Surgery',
'Preoperative Diagnosis',
'PREOPDIA - Breast',
'PREOPDIA - Foregut/ Hepatobiliary',
'PREOPDIA - Gynecologic',
'PREOPDIA - Head & Neck',
'PREOPDIA - Hernia',
'PREOPDIA - Neurosurgical',
'PREOPDIA - Obstetric',
'PREOPDIA - Orthopedic',
'PREOPDIA - Skin/Soft Tissue',
'PREOPDIA - Small Bowel & Colorectal',
'PREOPDIA - Thoracic',
'PREOPDIA - Trauma',
'PREOPDIA - Urologic/Renal/Adrenal',
'Para',
'Gravida',
'Gestational Age (weeks)',
'What indication for Cesarean Section?',
'Was the sign-in read aloud?',
'Was the sign-in completed prior to anesthesia induction?',
'Sterility indicator inside the instrument tray?',
'Did the indicator change color?',
'Inside of instrument tray wet prior to start of operation?',
'Was the tray replaced?',
'Gauze count performed at beginning of case?',
'Total number of gauze counted?',
'Did surgeon scrub hands (enter OT with wet hands) prior to gowning?',
'What was available for handwashing at scrub sinks?',
'Did surgeon apply alcohol solution to hands in OT prior to gowning?',
'Were new surgical gloves used?',
'Sterility indicator inside the gown/drape pack?',
'Were the gowns or drapes wet prior to start of operation?',
'Did the gown indicator change color?',
'Was the gown/drape pack replaced?',
'Were the wet gowns replaced?',
'Were there holes in any of the gowns?',
'Were the torn gowns replaced?',
'Were there holes in any of the drapes?',
'Was the drape replaced or covered by another drape?',
'How was the patient surgical site prepared?',
'Vaginal Prep',
'Were antibiotics given?',
'INT-ABX - Ampicillin-sulbactam',
'INT-ABX - Aztreonam',
'INT-ABX - Cefazolin',
'INT-ABX - Cefotetan',
'INT-ABX - Cefoxitin',
'INT-ABX - Ceftazidime',
'INT-ABX - Ceftriaxone',
'INT-ABX - Clindamycin',
'INT-ABX - Ertapenem',
'INT-ABX - Fluconazole',
'INT-ABX - Gentamycin',
'INT-ABX - Metronidazole',
'INT-ABX - Penicillin',
'INT-ABX - Piperacillin-tazobactam',
'INT-ABX - Vancomycin',
'INT-ABX - Other',
'Where were the antibiotics administered?',
'What time were antibiotics given?',
'Is the patient on scheduled antibiotics?',
'Was Time Out read aloud?',
'Did the team announce the type of operation?',
'Was estimated blood loss announced before surgery?',
'What was estimated blood loss?',
'Time of incision (24 hour)',
'Gauze count performed at end of case?',
'Procedure - Total number of gauze counted?',
'Time dressing applied to wound (24 hour)',
'Procedure performed',
'PROC - Head & Neck',
'PROC - Neurosurgical',
'PROC - Breast',
'PROC - Foregut/ Hepatobiliary',
'PROC - Gynecologic',
'PROC - Hernia',
'PROC - Obstetric',
'PROC - Orthopedic',
'PROC - Skin/Soft Tissue',
'PROC - Small Bowel & Colorectal',
'PROC - Thoracic',
'PROC - Trauma',
'PROC - Urologic/Renal/Adrenal',
'Ruptured Membranes?',
'Were membranes ruptured at time of surgery?',
'Wound classification',
'Was the case elective or emergency?',
'Was the sign-out read aloud?',
'Was sign-out done in the operating theatre?',
'Unplanned intubation or reintubation?',
'Urgent tracheostomy or cricothyroidotomy?',
'Urgent need for central venous or direct arterial access?',
'Did any other crisis occur?',
'What was the crisis?',
'Death',
'Fetal death'])
df_intraop = df_intraop[['tei','Preoperative Diagnosis',
'Para',
'Gravida',
'Gestational Age (weeks)',
'What indication for Cesarean Section?',
'Was the sign-in read aloud?',
'Was the sign-in completed prior to anesthesia induction?',
'Sterility indicator inside the instrument tray?',
'Did the indicator change color?',
'Inside of instrument tray wet prior to start of operation?',
'Was the tray replaced?',
'Gauze count performed at beginning of case?',
'Total number of gauze counted?',
'Did surgeon scrub hands (enter OT with wet hands) prior to gowning?',
'What was available for handwashing at scrub sinks?',
'Did surgeon apply alcohol solution to hands in OT prior to gowning?',
'Were new surgical gloves used?',
'Sterility indicator inside the gown/drape pack?',
'Were the gowns or drapes wet prior to start of operation?',
'Did the gown indicator change color?',
'Was the gown/drape pack replaced?',
'Were the wet gowns replaced?',
'Were there holes in any of the gowns?',
'Were the torn gowns replaced?',
'Were there holes in any of the drapes?',
'Was the drape replaced or covered by another drape?',
'How was the patient surgical site prepared?',
'Vaginal Prep',
'PREOPDIA - Obstetric',
'PROC - Obstetric',
'Were antibiotics given?',
'INT-ABX - Ampicillin-sulbactam',
'INT-ABX - Aztreonam',
'INT-ABX - Cefazolin',
'INT-ABX - Cefotetan',
'INT-ABX - Cefoxitin',
'INT-ABX - Ceftazidime',
'INT-ABX - Ceftriaxone',
'INT-ABX - Clindamycin',
'INT-ABX - Ertapenem',
'INT-ABX - Fluconazole',
'INT-ABX - Gentamycin',
'INT-ABX - Metronidazole',
'INT-ABX - Penicillin',
'INT-ABX - Piperacillin-tazobactam',
'INT-ABX - Vancomycin',
'INT-ABX - Other',
'Where were the antibiotics administered?',
'What time were antibiotics given?',
'Is the patient on scheduled antibiotics?',
'Was Time Out read aloud?',
'Did the team announce the type of operation?',
'Was estimated blood loss announced before surgery?',
'What was estimated blood loss?',
'Time of incision (24 hour)',
'Gauze count performed at end of case?',
'Procedure - Total number of gauze counted?',
'Time dressing applied to wound (24 hour)',
'Ruptured Membranes?',
'Were membranes ruptured at time of surgery?',
'Wound classification',
'Was the case elective or emergency?',
'Was the sign-out read aloud?',
'Was sign-out done in the operating theatre?',
'Unplanned intubation or reintubation?',
'Urgent tracheostomy or cricothyroidotomy?',
'Urgent need for central venous or direct arterial access?',
'Did any other crisis occur?',
'What was the crisis?',
'Death',
'Fetal death']]
df_new = df_intraop.drop_duplicates(subset=['tei'], keep='first')
df_intraop_nd = df_new