/
pivot.html
executable file
·361 lines (304 loc) · 22.4 KB
/
pivot.html
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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pivot multiple rows per observation to one row with multiple columns — pivot • healthcareai</title>
<!-- favicons -->
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png">
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png" />
<link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png" />
<link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png" />
<link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png" />
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/yeti/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.7.1/css/all.min.css" integrity="sha256-nAmazAk6vS34Xqo0BSrTb+abbtFlgsFK7NKSi6o7Y78=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.7.1/css/v4-shims.min.css" integrity="sha256-6qHlizsOWFskGlwVOKuns+D1nB6ssZrHQrNj1wGplHc=" crossorigin="anonymous" />
<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
<!-- headroom.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.9.4/headroom.min.js" integrity="sha256-DJFC1kqIhelURkuza0AvYal5RxMtpzLjFhsnVIeuk+U=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.9.4/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script>
<!-- pkgdown -->
<link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script>
<!-- docsearch -->
<script src="../docsearch.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/docsearch.js/2.6.1/docsearch.min.css" integrity="sha256-QOSRU/ra9ActyXkIBbiIB144aDBdtvXBcNc3OTNuX/Q=" crossorigin="anonymous" />
<link href="../docsearch.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/jquery.mark.min.js" integrity="sha256-4HLtjeVgH0eIB3aZ9mLYF6E8oU5chNdjU6p6rrXpl9U=" crossorigin="anonymous"></script>
<meta property="og:title" content="Pivot multiple rows per observation to one row with multiple columns — pivot" />
<meta property="og:description" content="Pivot multiple rows per observation to one row with multiple columns" />
<meta property="og:image" content="https://docs.healthcare.ai/logo.png" />
<meta name="twitter:card" content="summary" />
<!-- mathjax -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-85609357-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-85609357-1');
</script>
</head>
<body>
<div class="container template-reference-topic">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">healthcareai</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">2.4.0</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Vignettes
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/site_only/healthcareai.html">Getting Started</a>
</li>
<li>
<a href="../articles/site_only/db_connections.html">Database Connections</a>
</li>
<li>
<a href="../articles/site_only/deploy_model.html">Deploying a Model</a>
</li>
<li>
<a href="../articles/site_only/best_levels.html">Variables with Many Categories</a>
</li>
<li>
<a href="../articles/site_only/performance.html">Performance with Big Data</a>
</li>
<li>
<a href="../articles/site_only/transitioning.html">Transition from Version 1</a>
</li>
</ul>
</li>
<li>
<a href="../reference/index.html">Functions</a>
</li>
<li>
<a href="../news/index.html">News</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/HealthCatalyst/healthcareai-r">
<span class="fa fa-github"></span>
</a>
</li>
<li>
<a href="https://healthcare-ai.slack.com/">
<span class="fa fa-users"></span>
</a>
</li>
</ul>
<form class="navbar-form navbar-right hidden-xs hidden-sm" role="search">
<div class="form-group">
<input type="search" class="form-control" name="search-input" id="search-input" placeholder="Search..." aria-label="Search for..." autocomplete="off">
</div>
</form>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>Pivot multiple rows per observation to one row with multiple columns</h1>
<div class="hidden name"><code>pivot.Rd</code></div>
</div>
<div class="ref-description">
<p>Pivot multiple rows per observation to one row with multiple columns</p>
</div>
<pre class="usage"><span class='fu'>pivot</span>(<span class='no'>d</span>, <span class='no'>grain</span>, <span class='no'>spread</span>, <span class='no'>fill</span>, <span class='kw'>fun</span> <span class='kw'>=</span> <span class='no'>sum</span>, <span class='kw'>missing_fill</span> <span class='kw'>=</span> <span class='fl'>NA</span>, <span class='no'>extra_cols</span>)</pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments">
<colgroup><col class="name" /><col class="desc" /></colgroup>
<tr>
<th>d</th>
<td><p>data frame</p></td>
</tr>
<tr>
<th>grain</th>
<td><p>Column that defines rows. Unquoted.</p></td>
</tr>
<tr>
<th>spread</th>
<td><p>Column that will become multiple columns. Unquoted.</p></td>
</tr>
<tr>
<th>fill</th>
<td><p>Column to be used to fill the values of cells in the output,
perhaps after aggregation by <code>fun</code>. If <code>fill</code> is not provided,
counts will be used, as though a fill column of 1s had been provided.</p></td>
</tr>
<tr>
<th>fun</th>
<td><p>Function for aggregation, defaults to <code>sum</code>. Custom functions
can be used with the same syntax as the apply family of functions, e.g.
<code>fun = function(x) some_function(another_fun(x))</code>.</p></td>
</tr>
<tr>
<th>missing_fill</th>
<td><p>Value to fill for combinations of grain and spread that
are not present. Defaults to NA, but 0 may be useful as well.</p></td>
</tr>
<tr>
<th>extra_cols</th>
<td><p>Values of <code>spread</code> to create all-<code>missing_fill</code>
columns, for e.g. if you want to add levels that were observed in training
but are not present in deployment.</p></td>
</tr>
</table>
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>A tibble data frame with one row for each unique value of
<code>grain</code>, and one column for each unique value of <code>spread</code> plus
one column for the entries in grain.</p>
<p>Entries in the tibble are defined by the fill column. Combinations of
<code>grain</code> x <code>spread</code> that are not present in <code>d</code> will be
filled in with <code>missing_fill</code>. If there are <code>grain</code> x
<code>spread</code> pairs that appear more than once in d, they will be
aggregated by <code>fun</code>.</p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p><code>pivot</code> is useful when you want to change the grain of your
data, for example from the procedure grain to the patient grain. In that
example, each patient might have 0, 1, or more medications. To make a
patient-level table, we need a column for each medication, which is what it
means to make a wide table. The <code>fill</code> argument dictates what to put
in each of the medication columns, e.g. the dose the patient got.
<code>fill</code> defaults to "1", as an indicator variable. If any patients have
multiple rows for the same medication (say they recieved a med more than
once), we need a way to deal with that, which is what the <code>fun</code>
argument handles. By default it uses <code>sum</code>, so if <code>fill</code> is left
as its default, the count of instances for each patient will be used.</p>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><div class='input'><span class='no'>meds</span> <span class='kw'><-</span>
<span class='kw pkg'>tibble</span><span class='kw ns'>::</span><span class='fu'><a href='https://tibble.tidyverse.org/reference/tibble.html'>tibble</a></span>(
<span class='kw'>patient_id</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"A"</span>, <span class='st'>"A"</span>, <span class='st'>"A"</span>, <span class='st'>"B"</span>),
<span class='kw'>medication</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"zoloft"</span>, <span class='st'>"asprin"</span>, <span class='st'>"lipitor"</span>, <span class='st'>"asprin"</span>),
<span class='kw'>pills_per_day</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='fl'>1</span>, <span class='fl'>8</span>, <span class='fl'>2</span>, <span class='fl'>4</span>)
)
<span class='no'>meds</span></div><div class='output co'>#> <span style='color: #555555;'># A tibble: 4 x 3</span><span>
#> patient_id medication pills_per_day
#> </span><span style='color: #555555;font-style: italic;'><chr></span><span> </span><span style='color: #555555;font-style: italic;'><chr></span><span> </span><span style='color: #555555;font-style: italic;'><dbl></span><span>
#> </span><span style='color: #555555;'>1</span><span> A zoloft 1
#> </span><span style='color: #555555;'>2</span><span> A asprin 8
#> </span><span style='color: #555555;'>3</span><span> A lipitor 2
#> </span><span style='color: #555555;'>4</span><span> B asprin 4</div><div class='input'>
<span class='co'># Number of pills of each medication each patient gets:</span>
<span class='fu'>pivot</span>(
<span class='kw'>d</span> <span class='kw'>=</span> <span class='no'>meds</span>,
<span class='kw'>grain</span> <span class='kw'>=</span> <span class='no'>patient_id</span>,
<span class='kw'>spread</span> <span class='kw'>=</span> <span class='no'>medication</span>,
<span class='kw'>fill</span> <span class='kw'>=</span> <span class='no'>pills_per_day</span>,
<span class='kw'>missing_fill</span> <span class='kw'>=</span> <span class='fl'>0</span>
)</div><div class='output co'>#> </span><span style='color: #555555;'># A tibble: 2 x 4</span><span>
#> patient_id medication_asprin medication_lipitor medication_zoloft
#> </span><span style='color: #555555;font-style: italic;'><chr></span><span> </span><span style='color: #555555;font-style: italic;'><dbl></span><span> </span><span style='color: #555555;font-style: italic;'><dbl></span><span> </span><span style='color: #555555;font-style: italic;'><dbl></span><span>
#> </span><span style='color: #555555;'>1</span><span> A 8 2 1
#> </span><span style='color: #555555;'>2</span><span> B 4 0 0</div><div class='input'>
<span class='no'>bills</span> <span class='kw'><-</span>
<span class='kw pkg'>tibble</span><span class='kw ns'>::</span><span class='fu'><a href='https://tibble.tidyverse.org/reference/tibble.html'>tibble</a></span>(
<span class='kw'>patient_id</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/rep.html'>rep</a></span>(<span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"A"</span>, <span class='st'>"B"</span>), <span class='kw'>each</span> <span class='kw'>=</span> <span class='fl'>4</span>),
<span class='kw'>dept_id</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/rep.html'>rep</a></span>(<span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"ED"</span>, <span class='st'>"ICU"</span>), <span class='kw'>times</span> <span class='kw'>=</span> <span class='fl'>4</span>),
<span class='kw'>charge</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/stats/Uniform.html'>runif</a></span>(<span class='fl'>8</span>, <span class='fl'>0</span>, <span class='fl'>1e4</span>),
<span class='kw'>date</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/as.Date.html'>as.Date</a></span>(<span class='st'>"2024-12-25"</span>) - <span class='fu'><a href='https://rdrr.io/r/base/sample.html'>sample</a></span>(<span class='fl'>0</span>:<span class='fl'>2</span>, <span class='fl'>8</span>, <span class='fl'>TRUE</span>)
)
<span class='no'>bills</span></div><div class='output co'>#> </span><span style='color: #555555;'># A tibble: 8 x 4</span><span>
#> patient_id dept_id charge date
#> </span><span style='color: #555555;font-style: italic;'><chr></span><span> </span><span style='color: #555555;font-style: italic;'><chr></span><span> </span><span style='color: #555555;font-style: italic;'><dbl></span><span> </span><span style='color: #555555;font-style: italic;'><date></span><span>
#> </span><span style='color: #555555;'>1</span><span> A ED </span><span style='text-decoration: underline;'>3</span><span>823. 2024-12-25
#> </span><span style='color: #555555;'>2</span><span> A ICU </span><span style='text-decoration: underline;'>8</span><span>641. 2024-12-24
#> </span><span style='color: #555555;'>3</span><span> A ED </span><span style='text-decoration: underline;'>7</span><span>990. 2024-12-25
#> </span><span style='color: #555555;'>4</span><span> A ICU 201. 2024-12-25
#> </span><span style='color: #555555;'>5</span><span> B ED </span><span style='text-decoration: underline;'>5</span><span>447. 2024-12-23
#> </span><span style='color: #555555;'>6</span><span> B ICU </span><span style='text-decoration: underline;'>3</span><span>750. 2024-12-24
#> </span><span style='color: #555555;'>7</span><span> B ED </span><span style='text-decoration: underline;'>7</span><span>808. 2024-12-23
#> </span><span style='color: #555555;'>8</span><span> B ICU </span><span style='text-decoration: underline;'>9</span><span>957. 2024-12-25</div><div class='input'>
<span class='co'># Total charges per patient x department:</span>
<span class='fu'>pivot</span>(<span class='no'>bills</span>, <span class='no'>patient_id</span>, <span class='no'>dept_id</span>, <span class='no'>charge</span>, <span class='no'>sum</span>)</div><div class='output co'>#> </span><span style='color: #555555;'># A tibble: 2 x 3</span><span>
#> patient_id dept_id_ED dept_id_ICU
#> </span><span style='color: #555555;font-style: italic;'><chr></span><span> </span><span style='color: #555555;font-style: italic;'><dbl></span><span> </span><span style='color: #555555;font-style: italic;'><dbl></span><span>
#> </span><span style='color: #555555;'>1</span><span> A </span><span style='text-decoration: underline;'>11</span><span>814. </span><span style='text-decoration: underline;'>8</span><span>842.
#> </span><span style='color: #555555;'>2</span><span> B </span><span style='text-decoration: underline;'>13</span><span>255. </span><span style='text-decoration: underline;'>13</span><span>707.</div><div class='input'>
<span class='co'># Count of charges per patient x day:</span>
<span class='fu'>pivot</span>(<span class='no'>bills</span>, <span class='no'>patient_id</span>, <span class='no'>date</span>)</div><div class='output co'>#> <span class='message'>No fill column was provided, so using "1" for present entities</span></div><div class='output co'>#> <span class='message'>There are rows that contain the same values of both patient_id and date but you didn't provide a function to 'fun' for their aggregation. Proceeding with the default: fun = sum.</span></div><div class='output co'>#> </span><span style='color: #555555;'># A tibble: 2 x 4</span><span>
#> patient_id `date_2024-12-23` `date_2024-12-24` `date_2024-12-25`
#> </span><span style='color: #555555;font-style: italic;'><chr></span><span> </span><span style='color: #555555;font-style: italic;'><int></span><span> </span><span style='color: #555555;font-style: italic;'><int></span><span> </span><span style='color: #555555;font-style: italic;'><int></span><span>
#> </span><span style='color: #555555;'>1</span><span> A </span><span style='color: #BB0000;'>NA</span><span> 1 3
#> </span><span style='color: #555555;'>2</span><span> B 2 1 1</div><div class='input'>
<span class='co'># Can provide a custom function to fun, which will take fill as input.</span>
<span class='co'># Get the difference between the greatest and smallest charge in each</span>
<span class='co'># department for each patient and format it as currency.</span>
<span class='fu'>pivot</span>(<span class='kw'>d</span> <span class='kw'>=</span> <span class='no'>bills</span>,
<span class='kw'>grain</span> <span class='kw'>=</span> <span class='no'>patient_id</span>,
<span class='kw'>spread</span> <span class='kw'>=</span> <span class='no'>dept_id</span>,
<span class='kw'>fill</span> <span class='kw'>=</span> <span class='no'>charge</span>,
<span class='kw'>fun</span> <span class='kw'>=</span> <span class='kw'>function</span>(<span class='no'>x</span>) <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste0</a></span>(<span class='st'>"$"</span>, <span class='fu'><a href='https://rdrr.io/r/base/Round.html'>round</a></span>(<span class='fu'><a href='https://rdrr.io/r/base/Extremes.html'>max</a></span>(<span class='no'>x</span>) - <span class='fu'><a href='https://rdrr.io/r/base/Extremes.html'>min</a></span>(<span class='no'>x</span>), <span class='fl'>2</span>))
)</div><div class='output co'>#> </span><span style='color: #555555;'># A tibble: 2 x 3</span><span>
#> patient_id dept_id_ED dept_id_ICU
#> </span><span style='color: #555555;font-style: italic;'><chr></span><span> </span><span style='color: #555555;font-style: italic;'><chr></span><span> </span><span style='color: #555555;font-style: italic;'><chr></span><span>
#> </span><span style='color: #555555;'>1</span><span> A $4166.72 $8440.26
#> </span><span style='color: #555555;'>2</span><span> B $2361.24 $6207.09 </div></span></pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<h2>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#arguments">Arguments</a></li>
<li><a href="#value">Value</a></li>
<li><a href="#details">Details</a></li>
<li><a href="#examples">Examples</a></li>
</ul>
</div>
</div>
<footer>
<div class="copyright">
<p>Developed by Levi Thatcher, Michael Levy, Mike Mastanduno, Taylor Larsen, Taylor Miller, Rex Sumsion.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.4.1.</p>
</div>
</footer>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/docsearch.js/2.6.1/docsearch.min.js" integrity="sha256-GKvGqXDznoRYHCwKXGnuchvKSwmx9SRMrZOTh2g4Sb0=" crossorigin="anonymous"></script>
<script>
docsearch({
apiKey: 'ac39465bc37cbef616f5de1e646b6037',
indexName: 'healthcareai',
inputSelector: 'input#search-input.form-control',
transformData: function(hits) {
return hits.map(function (hit) {
hit.url = updateHitURL(hit);
return hit;
});
}
});
</script>
</body>
</html>