-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdd_diagnostic.R
250 lines (214 loc) · 7.98 KB
/
dd_diagnostic.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
diagnostic<-
list(
data.frame(
Variable="DiagnosticID",
Label="Diagnostic Identifier",
Definition="System-provided Diagnostic identifier",
Type="Integer",
Mandatory="System-assigned"),
data.frame(
Variable="DiagnosticCode",
Label="Diagnostic Code",
Definition="User-provided Diagnostic code",
Type="String",
Mandatory="Yes"),
data.frame(
Variable="DiagnosticCrossReferenceID",
Label="Diagnostic Cross Identifier",
Definition="The identifier of an Diagnostic in another system (e.g., database/document/other)",
Type="String",
Mandatory="No"),
data.frame(
Variable="DiagnosticCrossReferenceIDOrigin",
Label="Diagnostic Cross Identifier Origin",
Definition="The database/document/other where other identification
for the same Diagnostic is used",
Type="String",
Mandatory="No"),
data.frame(
Variable="DiagnosticTargetedHazardType",
Label="Diagnostic Targeted Hazard Type",
Definition="The type health hazard targeted by the Diagnostic",
Type="Single selection",
Mandatory="Yes"),
data.frame(
Variable="DiagnosticTargetedHazardName",
Label="Diagnostic Targeted Hazard Name",
Definition="The name of the health hazard targeted by the Diagnostic",
Type="Single selection",
Mandatory="No"),
data.frame(
Variable="DiagnosticType",
Label="Diagnostic Type",
Definition="The type of method used to conduct the Diagnostic (e.g., 'molecular', 'serology', etc)",
Type="Single selection",
Mandatory="Yes"),
data.frame(
Variable="DiagnosticMethod",
Label="Diagnostic Method",
Definition="The method used to conduct the Diagnostic (e.g., 'agglutination', 'PCR', etc)",
Type="Single selection",
Mandatory="Yes"),
data.frame(
Variable="DiagnosticName",
Label="Diagnostic Name",
Definition="The name of the Diagnostic method",
Type="Single selection",
Mandatory="Yes"),
data.frame(
Variable="DiagnosticMeasurementQuantitative",
Label="Diagnostic Measurement Quantitative",
Definition="Answer to the question: 'Does the Diagnostic method provide a quantitative result?'",
Type="Boolean",
Mandatory="Yes"),
data.frame(
Variable="DiagnosticMeasurementQuantitativeUnit",
Label="Diagnostic Measurement Quantitative Unit",
Definition="The quantitative unit usedd to report the results of the Diagnostic",
Type="Single selection",
Mandatory="Yes"),
data.frame(
Variable="DiagnosticMeasurementQualitativeUnit",
Label="Diagnostic Measurement Qualitative Unit",
Definition="The qualitative unit used to report the results of the Diagnostic",
Type="Single selection",
Mandatory="Yes"),
data.frame(
Variable="DiagnosticRunInField",
Label="Diagnostic Run in the Field ",
Definition="Answer to the question: 'Is the Diagnostic run in the field?'",
Type="Boolean",
Mandatory="Yes"),
data.frame(
Variable="DiagnosticRequestedBy",
Label="Diagnostic Requested By",
Definition="The person requesting the Diagnostic",
Type="Single selection",
Mandatory="No"),
data.frame(
Variable="LaboratoryName",
Label="Laboratory Name",
Definition="The name of the Laboratory where the Diagnostic is completed",
Type="Single Selection",
Mandatory="Yes"),
data.frame(
Variable="DiagnosticDateSentForTesting",
Label="Date Sent for Testing",
Definition="The date the Animal Source, Carcass, or Specimen was sent to the
Laboratory to be tested",
Type="Date",
Mandatory="Yes"),
data.frame(
Variable="DiagnosticDateReceivedForTesting",
Label="Date Received for Testing",
Definition="The date the Animal Source, Carcass, or Specimen was received in the Laboratory",
Type="Date",
Mandatory="No"),
data.frame(
Variable="DiagnosticDate",
Label="Date Diagnostic Conducted",
Definition="The date the Dieagnostics is conducted",
Type="Date",
Mandatory="No"),
data.frame(
Variable="DiagnosticBy",
Label="Diagnostic By",
Definition="The person that conducted the Diagnostic",
Type="Single selection",
Mandatory="No"),
data.frame(
Variable="DiagnosticResultsReceived",
Label="Diagnostic Results Received",
Definition="Answer to the question: 'Were the Diagnostic results received?'",
Type="Boolean",
Mandatory="Yes"),
data.frame(
Variable="DiagnosticDateResultsReceived",
Label="Date Results Received",
Definition="The date the Diagnostic results were received by the requester",
Type="Date",
Mandatory="No"),
data.frame(
Variable="DiagnosticResultQuantitative",
Label="Diagnostic Result",
Definition="The result of the diagnostic on quantitative units",
Type="Float",
Mandatory="Yes"),
data.frame(
Variable="DiagnosticResultQualitative",
Label="Diagnostic Result",
Definition="The result of the diagnostic on qualitative units",
Type="String",
Mandatory="Yes"),
data.frame(
Variable="DiagnosticResultModified",
Label="Diagnostic Result Modified",
Definition="Answer to the question:'Have the Diagnostic results been modified?'",
Type="Boolean",
Mandatory="Yes"),
data.frame(
Variable="DiagnosticDateResultModified",
Label="Date Diagnostic Result modified",
Definition="The date when the Diagnostic result was modified",
Type="Date",
Mandatory="Yes"),
data.frame(
Variable="DiagnosticReasonResultModified",
Label="Reason Diagnostic Result modified",
Definition="Description of the reason the Diagnostic result was modified",
Type="String",
Mandatory="Yes"),
data.frame(
Variable="DiagnosticPreviousResultQuantitative",
Label="Diagnostic Previous Result Quantitative",
Definition="The Diagnostic quantitative result before modification",
Type="String",
Mandatory="No"),
data.frame(
Variable="DiagnosticPreviousResultQualitative",
Label="Diagnostic Previous Result Qualitative",
Definition="The Diagnostic quantitative result before modification",
Type="String",
Mandatory="No"),
data.frame(
Variable="DiagnosticProblems",
Label="Diagnostic Problems",
Definition="Description of any problems regarding the Diagnostic",
Type="String",
Mandatory="No"),
data.frame(
Variable="DiagnosticIsRepetition",
Label="Diagnostic Is a Repetition",
Definition="Answer to the question: 'Is the Diagnostic a repetition of another Diagnostic",
Type="Boolean",
Mandatory="Yes"),
data.frame(
Variable="DiagnosticReasonRepeated",
Label="Diagnostic Reason Repetition",
Definition="Description of the reason the Diagnostic is repeated",
Type="String",
Mandatory="Yes"),
data.frame(
Variable="DiagnosticComments",
Label="Diagnostic Comments",
Definition="Any comments regarding the Diagnostic",
Type="String",
Mandatory="No"),
data.frame(
Variable="DiagnosticInterpreted",
Label="Diagnostic Interpreted",
Definition="Ansnwer to the quessiton: 'In the diagnostic interpreted?'",
Type="Boolean",
Mandatory="Yes"))
diagnostic<-
diagnostic %>% 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())