-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample.r
71 lines (52 loc) · 1.27 KB
/
sample.r
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
# To generate CSV from : https://synthetichealth.github.io/synthea/
library(tidyverse)
(patients <- read_csv("csv/patients.csv"))
(patients_100 <- sample(patients$Id, 100))
(
patients
%>% filter(Id %in% patients_100)
%>% write_csv("patients_100.csv")
)
(observations <- read_csv("csv/observations.csv"))
(
observations
%>% filter(PATIENT %in% patients_100)
%>% write_csv("measures_100.csv")
)
(procedures <- read_csv("csv/procedures.csv"))
(
procedures
%>% filter(PATIENT %in% patients_100)
%>% write_csv("events_100.csv")
)
(careplans <- read_csv("csv/careplans.csv"))
(
careplans
%>% filter(PATIENT %in% patients_100)
%>% write_csv("periods_100.csv")
)
(patients <- read_csv("csv/patients.csv"))
(patients_1000 <- sample(patients$Id, 1000))
(
patients
%>% filter(Id %in% patients_1000)
%>% write_csv("patients_1000.csv")
)
(observations <- read_csv("csv/observations.csv"))
(
observations
%>% filter(PATIENT %in% patients_1000)
%>% write_csv("measures_1000.csv")
)
(procedures <- read_csv("csv/procedures.csv"))
(
procedures
%>% filter(PATIENT %in% patients_1000)
%>% write_csv("events_1000.csv")
)
(careplans <- read_csv("csv/careplans.csv"))
(
careplans
%>% filter(PATIENT %in% patients_1000)
%>% write_csv("periods_1000.csv")
)