-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdd_animal_source_record.R
287 lines (248 loc) · 10.8 KB
/
dd_animal_source_record.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
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
animal_source_record<-
list(
data.frame(
Variable="GroupAnimalSourceRecordDistancetoSource",
Label="Distance to the Animal Source Record",
Definition="In case of transect or similar, this is the distance in any unit from the Event
(point in transect) to the Animal Source",
Type="Numeric",
Mandatory="No"),
data.frame(
Variable="GroupAnimalSourceRecordDistancetoSourceUnit",
Label="Unit of the Distance",
Definition="The unit for the distance from the Event (point in a transect) to the Animal Source
(e.g., meters, kilometers)",
Type="Single selection",
Mandatory="Yes"),
data.frame(
Variable="GroupAnimalArthropodSourceRecordAge",
Label="Animal Source Record Age of the Animal",
Definition="An age category of the Animal Source Record",
Type="Single selection",
Mandatory="Yes"),
data.frame(
Variable="GroupAnimalSourceRecordCaptivityCategory",
Label="Animal Source Record Captivity Category",
Definition="The captivity category of the Animal Source Record",
Type="Multiple selection",
Mandatory="Yes"),
# data.frame(
# Variable="GroupAnimalSourceRecordInFacility",
# Label="Animal Source In Facility",
# Definition="Answer to the question: 'Is the Animal Source in a captive facility
# (e.g., rehabilitation center, zoologic, laboratory, market, etc).",
# Type="Boolean",
# Mandatory="Yes"),
data.frame(
Variable="GroupAnimalSourceRecordNameFacility",
Label="Animal Source Record Name Facility",
Definition="The name of the facility where the Animal Source is",
Type="String",
Mandatory="Yes"),
data.frame(
Variable="GroupAnimalSourceRecordAdmissiontoFacility",
Label="Animal Source Record Date Entered to the Facility",
Definition="The date the Animal Source Record entered to the facility. Applies when the Location
type is a farm or similar",
Type="Date",
Mandatory="No"),
data.frame(
Variable="GroupAnimalSourceRecordTimeOutNaturalHabitat",
Label="Animal Source Record Time Out Natural Habitat",
Definition="The period of time the Animal Source has not been on its natural area",
Type="String",
Mandatory="Yes"),
data.frame(
Variable="GroupAnimalSourceRecordInPenOrCage",
Label="Animal Source In Pen or Cage",
Definition="Answer to the question: 'Is the Animal Source in a pen or a cage?'",
Type="Boolean",
Mandatory="Yes"),
data.frame(
Variable="GroupAnimalSourceRecordPenCageIdentifier",
Label="Animal Source Record Pen Cage Identifier",
Definition="The identifier of the pen or cage where the Animal Source is",
Type="String",
Mandatory="Yes"),
data.frame(
Variable="GroupAnimalSourceRecordAdmissiontoPenCage",
Label="Animal Source Record Date Entered to the Pen or Cage",
Definition="The date the Animal Source Record entered to the Pen or Cage. Applies when the Location
type is a market or similar",
Type="Date",
Mandatory="No"),
data.frame(
Variable="GroupAnimalSourceRecordInitialHealthStatus",
Label="Animal Source Record Initial Health Status",
Definition="An initial health status category of the Animal
Source Record",
Type="Single selection",
Mandatory="Yes"),
data.frame(
Variable="GroupAnimalSourceRecordHealthStatusAssessedBy",
Label="Animal Source Record Health Status Assessed By",
Definition="The health, animal, environmental, or another sector of the individual
assigning the initial health status",
Type="Single selection",
Mandatory="Yes"),
data.frame(
Variable="GroupAnimalSourceRecordAnomaly",
Label="Animal Source Record Anomalies",
Definition="The anomalies detected in the Animal Source Record reported as sick, injured,
or dead",
Type="Multiple selection",
Mandatory="Yes"),
data.frame(
Variable="GroupAnimalSourceRecordOtherAnomalies",
Label="Animal Source Record Other Anomalies",
Definition="Other anomalies not listed in the previous field in the Animal Source Record
reported as sick, injured, or dead",
Type="String",
Mandatory="No"),
data.frame(
Variable="GroupAnimalSourceRecordAnomaliesBy",
Label="Animal Source Record Anomalies By",
Definition="The health, animal, environmental, or another sector of the individual
reporting the anomalies in the sick, injured, or dead Animal Source Record.
Not available if all Animal Source Record is healthy",
Type="Single selection",
Mandatory="Yes"),
data.frame(
Variable="GroupAnimalSourceRecordPotentialCauseInjuryDisease",
Label="Animal Source Record Potential Cause Injury or Disease",
Definition="The potential causes of injury or disease in the Animal Source
Record that is reported as sick or injured",
Type="Multiple selection",
Mandatory="Yes"),
data.frame(
Variable="GroupAnimalSourceRecordPotentialCauseInjuryDiseaseBy",
Label="Animal Source Record Potential Cause Injury Disease By",
Definition="The health, animal, environmental, or another sector of the individual
reporting the potential cause of injury or disease in the Animal
Source Record. Not available if the Animal Source Record is healthy or dead",
Type="Single selection",
Mandatory="Yes"),
data.frame(
Variable="AnimalSourceRecordVaccination",
Label="Animal Source Record Vaccination",
Definition="Answer to the question:'Animal Source vaccinated at time t?'",
Type="Boolean",
Mandatory="Yes"),
data.frame(
Variable="AnimalSourceRecordFinalHealthStatus",
Label="Animal Source Record Final Health Status",
Definition="The health status of the Animal Source Record at the end of the observation",
Type="Single selection",
Mandatory="Yes"),
# data.frame(
# Variable="AnimalSourceRecordEuthanasia",
# Label="Animal Source Record Euthanasia",
# Definition="Answer to the question: 'Was the Animal Source euthanized?'",
# Type="Boolean",
# Mandatory="Yes"),
# data.frame(
# Variable="AnimalSourceRecordEuthanasiaMethod",
# Label="Animal Source Record Euthanasia Method",
# Definition="The euthanasia method used in the Animal Source",
# Type="Single selection",
# Mandatory="Yes"),
data.frame(
Variable="AnimalSourceDateOfDeathKnown",
Label="Animal Source Record Date of Death Known",
Definition="Answer to the question: 'Is the Animal Source date of death known?'",
Type="Boolean",
Mandatory="Yes"),
data.frame(
Variable="AnimalSourceDateOfDeath",
Label="Animal Source Record Date of Death",
Definition="The date the Animal Source died",
Type="Date",
Mandatory="Yes"),
data.frame(
Variable="GroupAnimalSourceRecordPotentialCauseDeath",
Label="Animal Source Record Potential Cause Death",
Definition="The potential causes of death of the Animal Source Record",
Type="Multiple selection",
Mandatory="Yes"),
data.frame(
Variable="GroupAnimalSourceRecordPotentialCauseDeathBy",
Label="Animal Source Record Potential Cause Injury Disease By",
Definition="The health, animal, environmental, or another sector of the individual
reporting the potential cause of death of the Animal
Source Record. Not available if the Animal Source Record is not dead",
Type="Single selection",
Mandatory="Yes"),
data.frame(
Variable="AnimalSourceRecordEuthanasiaMethod",
Label="Animal Source Record Euthanasia Method",
Definition="The euthanasia method used in the Animal Source",
Type="Single selection",
Mandatory="Yes"),
data.frame(
Variable="AnimalSourceRecordCarcassFieldCondition",
Label="Animal Source Record Carcass Field Condition",
Definition="The condition of the Carcass when it was collected at time t",
Type="Single selection",
Mandatory="Yes"),
# data.frame(
# Variable="AnimalSourceFieldNecropsy",
# Label="Animal Source Field Necropsy",
# Definition="Answer to the question:'Was an animal necropsy conducted in the field?'",
# Type="Boolean",
# Mandatory="Yes"),
# data.frame(
# Variable="AnimalSourceRecordCarcassCollected",
# Label="Animal Source Record Carcass collected",
# Definition="Answer to the question: 'Was the carcass of the Animal Source Record collected?'",
# Type="Boolean",
# Mandatory="Yes"),
# data.frame(
# Variable="AnimalSourceRecordFieldStorageCarcass",
# Label="Field storage carcass",
# Definition="The method to store the carcass in the field while in transit to a proper facility",
# Type="Single selection but available only if 'Carcass collected' is true",
# Mandatory="Yes"),
#
data.frame(
Variable="AnimalSourceRecordCarcassAction",
Label="Animal Source Record Carcass Action",
Definition="Description of what was done with the Carcass found in the field or captive facility",
Type="Single selection",
Mandatory="Yes"),
data.frame(
Variable="AnimalSourceRecordAnyMarkingCode",
Label="Animal Source Record Any Marking Code",
Definition="Answer to the question: 'Was there any marking in the Animal Source
at time t that allowed its individual identification?'",
Type="String",
Mandatory="No"),
data.frame(
Variable="AnimalSourceRecordMarkingCode",
Label="Animal Source Record Marking Code",
Definition="The marking of the Animal Source at time t",
Type="String",
Mandatory="Yes"),
data.frame(
Variable="AnimalSourceRecordMarkingCodeChange",
Label="Animal Source Record Marking Code Change",
Definition="Answer to the question: 'Was the marking code changed at time t?'",
Type="Boolean",
Mandatory="No"),
data.frame(
Variable="AnimalSourceRecordMarkingCodeChangingReason",
Label="Animal Source Record Marking Code Change Reason",
Definition="Provide an explanation for changing the marking code",
Type="String",
Mandatory="No"))
animal_source_record<-
animal_source_record %>% bind_rows() |>
gt::gt() %>%
gt::tab_options(table.font.size = 8) %>%
gt::cols_width(Variable ~ gt::pct(22),
Label ~ gt::pct(20),
Definition ~ gt::pct(30),
Type~ gt::pct(13),
Mandatory~ gt::pct(15)) %>%
gt::tab_style(
style = cell_text(size = px(15), weight = "bold"),
locations = cells_column_labels())