-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdd_export.R
151 lines (130 loc) · 5.04 KB
/
dd_export.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
export<-
list(
data.frame(
Variable="ExportID",
Label="Export Identifier",
Definition="System-provided Export identifier",
Type="Integer",
Mandatory="System-assigned"),
data.frame(
Variable="ExportCode",
Label="Export Code",
Definition="User-provided Export code",
Type="String",
Mandatory="No"),
data.frame(
Variable="ExportCrossReferenceID",
Label="Export Cross Identifier",
Definition="The identifier of an Export in another system (e.g., database/document/other)",
Type="String",
Mandatory="No"),
data.frame(
Variable="ExportCrossReferenceIDOrigin",
Label="Export Cross Identifier Origin",
Definition="The database/document/other where other identification
for the same Export is used",
Type="String",
Mandatory="No"),
data.frame(
Variable="ExportOrigin",
Label="Export Origin",
Definition="The facility where the Carcass or Specimen depart from",
Type="Single selection",
Mandatory="Yes"),
data.frame(
Variable="ExportPermits",
Label="Export Permits",
Definition="Answer to the question: 'Does the exportation process requires any permit'?",
Type="Boolean",
Mandatory="Yes"),
data.frame(
Variable="ExportQuantity",
Label="Export Quantity",
Definition="The quantity of Carcass or Specimen exported",
Type="Float", # more than one exportation location if the sample is moved around.
Mandatory="Yes"),
data.frame(
Variable="ExportQuantityUnit",
Label="Export Quantity Unit",
Definition="The unit for the quantity of Carcass or Specimen exported reported",
Type="Single selection", # more than one exportation location if the sample is moved around.
Mandatory="Yes"),
data.frame(
Variable="ExportDestination",
Label="Export Destination",
Definition="The destination of the Carcass or Specimen",
Type="String", # more than one exportation location if the sample is moved around.
Mandatory="Yes"),
data.frame(
Variable="ExportDepartureDate",
Label="Export Departure Date",
Definition="The date the Carcass or Specimen leaves the current store location to
start the exportation process",
Type="Date", # more than one exportation location if the sample is moved around.
Mandatory="Yes"),
data.frame(
Variable="ExportStorageMethod",
Label="Export Storage Method",
Definition="The method(s) used to keep the Carcass or Specimen properly maintained",
Type="Multiple selection",
Mandatory="Yes"),
data.frame(
Variable="ExportStatus",
Label="Export Status",
Definition="The current status of the exportation",
Type="Single selection", # not shipped, shipped. in transit, arrived, delivered,
Mandatory="Yes"),
data.frame(
Variable="ExportTransitLocation",
Label="Export Transit Location",
Definition="The current transit location of the exported Carcass or Specimen, if any",
Type="String",
Mandatory="No"),
data.frame(
Variable="ExportTransitLocationContact",
Label="Export Transit Location Contact",
Definition="A contact at the current transit location of the exported Carcass or Specimen",
Type="Single selection",
Mandatory="No"),
data.frame(
Variable="ExportProblems",
Label="Export Problems",
Definition="Description of any problems during the export of the Carcass or Specimen",
Type="String",
Mandatory="No"),
data.frame(
Variable="ExportArrived",
Label="Export Arrived",
Definition="Answer to the question: 'Have the exported Carcass or Specimen arrived to destination?'",
Type="Boolean",
Mandatory="Yes"),
data.frame(
Variable="ExportArrivalDate",
Label="Export Arrival Date",
Definition="The date the Carcass or Specimen arrived to their destination",
Type="Date", # more than one exportation location if the sample is moved around.
Mandatory="Yes"),
data.frame(
Variable="ExportReceivedBy",
Label="Export Received By",
Definition="The person that receive the Carcass or Specimen at destnation",
Type="Single Selection", # more than one exportation location if the sample is moved around.
Mandatory="Yes"),
data.frame(
Variable="ExportComments",
Label="Export Comments",
Definition="Any other comments regarding the Export",
Type="String",
Mandatory="No"))
export<-
export %>% 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())