-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathhc_create_wf1.sql
More file actions
507 lines (467 loc) · 30.1 KB
/
hc_create_wf1.sql
File metadata and controls
507 lines (467 loc) · 30.1 KB
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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
-- create 96 well plate
insert into vw_material (description, consumable) values ('Plate: 96 Well', FALSE);
DO
$do$
DECLARE
loc_let varchar;
loc_num varchar;
ord int := 1;
loc_arr_let varchar[] := array['A','B','C','D','E','F','G','H'];
loc_arr_num varchar[] := array['1','2','3','4','5','6','7','8','9','10','11','12'];
prop_loc_def uuid := (select property_def_uuid from vw_property_def where short_description = 'well_loc');
prop_vol_def uuid := (select property_def_uuid from vw_property_def where short_description = 'well_vol');
prop_ord_def uuid := (select property_def_uuid from vw_property_def where short_description = 'well_ord');
act uuid := (select actor_uuid from vw_actor where description = 'Mike Tynes');
st uuid := (select status_uuid from vw_status where description = 'dev_test');
plate_96_uuid uuid := (select material_uuid from vw_material where description = 'Plate: 96 Well');
well_uuid uuid;
component_uuid uuid;
BEGIN
FOREACH loc_let IN ARRAY loc_arr_let[1:8]
LOOP
FOREACH loc_num IN ARRAY loc_arr_num[1:12]
LOOP
-- create the well
insert into vw_material (description, consumable, actor_uuid, status_uuid) values
(concat('96 Well Plate well#: ',loc_let,loc_num), FALSE,
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test')) returning material_uuid into well_uuid;
-- assign the well as a component of the plate
insert into vw_material_composite (composite_uuid, component_uuid, addressable, actor_uuid, status_uuid) values
(plate_96_uuid, well_uuid, TRUE,
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test')) returning material_composite_uuid into component_uuid;
-- well #
insert into vw_material_property (material_uuid, property_def_uuid,
property_value, property_actor_uuid, property_status_uuid ) values (
component_uuid, prop_ord_def,
ord::text,
act, st);
-- well location
insert into vw_material_property (material_uuid, property_def_uuid,
property_value, property_actor_uuid, property_status_uuid ) values (
component_uuid, prop_loc_def,
concat(loc_let,loc_num),
act, st);
-- well volume
insert into vw_material_property (material_uuid, property_def_uuid,
property_value, property_actor_uuid, property_status_uuid ) values (
component_uuid, prop_vol_def,
'{.5,10}',
act, st);
ord := ord + 1;
END LOOP;
END LOOP;
END
$do$;
insert into vw_property_def (description, short_description, val_type_uuid, valunit, actor_uuid, status_uuid ) values
('molecular-weight', 'mw',
(select get_type_def ('data', 'text')),
'g/mol',
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'active'));
-- this is confusing: everything has to be an actor? need to see documentation on what these fields mean
insert into vw_inventory (description, owner_uuid, operator_uuid, lab_uuid, actor_uuid, status_uuid)
values (
'HC Test Inventory',
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select actor_uuid from vw_actor where description = 'HC'),
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test'));
select * from inventory;
update vw_material
set material_class = 'model';
-- these are all the raw materials we need to get started!
select * from vw_material where description in ('Gamma-Butyrolactone', 'Formic Acid', 'Lead Diiodide', 'Ethylammonium Iodide');
-- STOCK SOLUTION A: Organic and Inorganic
insert into vw_material (description, consumable, material_class, actor_uuid, status_uuid) values
('Stock A', TRUE, 'model',
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test'));
-- add the components to the composite
insert into vw_material_composite (composite_uuid, component_uuid, addressable, actor_uuid, status_uuid) VALUES
((select material_uuid from vw_material where description = 'Stock A'),
(select material_uuid from vw_material where description = 'Lead Diiodide'),
FALSE,
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test')
);
insert into vw_material_composite (composite_uuid, component_uuid, addressable, actor_uuid, status_uuid) VALUES
((select material_uuid from vw_material where description = 'Stock A'),
(select material_uuid from vw_material where description = 'Ethylammonium Iodide'),
FALSE,
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test')
);
insert into vw_material_composite (composite_uuid, component_uuid, addressable, actor_uuid, status_uuid) VALUES
((select material_uuid from vw_material where description = 'Stock A'),
(select material_uuid from vw_material where description = 'Gamma-Butyrolactone'),
FALSE,
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test')
);
-- STOCK B: Concentrated Amine
insert into vw_material (description, consumable, material_class) values
('Stock B', TRUE, 'model');
insert into vw_material_composite (composite_uuid, component_uuid, addressable, actor_uuid, status_uuid) VALUES
((select material_uuid from vw_material where description = 'Stock B'),
(select material_uuid from vw_material where description = 'Ethylammonium Iodide'),
FALSE,
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test'));
insert into vw_material_composite (composite_uuid, component_uuid, addressable, actor_uuid, status_uuid) VALUES
((select material_uuid from vw_material where description = 'Stock B'),
(select material_uuid from vw_material where description = 'Gamma-Butyrolactone'),
FALSE,
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test')
);
insert into vw_material (description, consumable, material_class, actor_uuid, status_uuid) values
('Stock FAH', TRUE, 'model',
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test'));
insert into vw_material_composite (composite_uuid, component_uuid, addressable, actor_uuid, status_uuid) VALUES
((select material_uuid from vw_material where description = 'Stock FAH'),
(select material_uuid from vw_material where description = 'Formic Acid'),
FALSE,
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test')
);
insert into vw_material_composite (composite_uuid, component_uuid, addressable, actor_uuid, status_uuid) VALUES
((select material_uuid from vw_material where description = 'Stock FAH'),
(select material_uuid from vw_material where description = 'Water'),
FALSE,
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test')
);
insert into vw_material_type_assign (material_uuid, material_type_uuid) values
((select material_uuid from vw_material where description = 'Stock A'),(select material_type_uuid from vw_material_type where description = 'stock solution')),
((select material_uuid from vw_material where description = 'Stock A'),(select material_type_uuid from vw_material_type where description = 'human prepared')),
((select material_uuid from vw_material where description = 'Stock B'),(select material_type_uuid from vw_material_type where description = 'stock solution')),
((select material_uuid from vw_material where description = 'Stock B'),(select material_type_uuid from vw_material_type where description = 'human prepared')),
((select material_composite_uuid from vw_material_composite where composite_description = 'Stock A' and component_description = 'Lead Diiodide'),
(select material_type_uuid from vw_material_type where description = 'solute')),
((select material_composite_uuid from vw_material_composite where composite_description = 'Stock A' and component_description = 'Ethylammonium Iodide'),
(select material_type_uuid from vw_material_type where description = 'solute')),
((select material_composite_uuid from vw_material_composite where composite_description = 'Stock A' and component_description = 'Gamma-Butyrolactone'),
(select material_type_uuid from vw_material_type where description = 'solvent')),
((select material_composite_uuid from vw_material_composite where composite_description = 'Stock B' and component_description = 'Ethylammonium Iodide'),
(select material_type_uuid from vw_material_type where description = 'solute')),
((select material_composite_uuid from vw_material_composite where composite_description = 'Stock B' and component_description = 'Gamma-Butyrolactone'),
(select material_type_uuid from vw_material_type where description = 'solvent'));
select * from vw_material_composite where composite_description like '%Stock%';
insert into vw_material_property (material_uuid, property_def_uuid,
property_value, property_class, property_actor_uuid, property_status_uuid ) values (
(select material_composite_uuid from vw_material_composite where composite_description = 'Stock A' and component_description = 'Lead Diiodide'),
(select property_def_uuid from vw_property_def where description = 'concentration_molarity'),
'1.1',
'nominal',
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test'));
insert into vw_material_property (material_uuid, property_def_uuid,
property_value, property_class, property_actor_uuid, property_status_uuid ) values (
(select material_composite_uuid from vw_material_composite where composite_description = 'Stock A' and component_description = 'Ethylammonium Iodide'),
(select property_def_uuid from vw_property_def where description = 'concentration_molarity'),
'2.2',
'nominal',
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test'));
insert into vw_material_property (material_uuid, property_def_uuid,
property_value, property_class, property_actor_uuid, property_status_uuid ) values (
(select material_composite_uuid from vw_material_composite where composite_description = 'Stock B' and component_description = 'Ethylammonium Iodide'),
(select property_def_uuid from vw_property_def where description = 'concentration_molarity'),
'3.99',
'nominal',
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test'));
insert into vw_material_property (material_uuid, property_def_uuid,
property_value, property_class, property_actor_uuid, property_status_uuid ) values (
(select material_composite_uuid from vw_material_composite where composite_description = 'Stock FAH' and component_description = 'Formic Acid'),
(select property_def_uuid from vw_property_def where description = 'concentration_molarity'),
'23.6',
'nominal',
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test'));
--select composite_description, composite_class, component_description, property_description, property_class, property_value from vw_material_composite_property where composite_description like 'Stock%';
--select * from vw_material where description like '%Stock%';
insert into vw_inventory_material (inventory_uuid, description, material_uuid)
values (
(select inventory_uuid from vw_inventory where description = 'HC Test Inventory'),
'Wf1 Plate',
(select material_uuid from vw_material where description = 'Plate: 24 well')
);
insert into vw_inventory_material (inventory_uuid, description, material_uuid)
values (
(select inventory_uuid from vw_inventory where description = 'HC Test Inventory'),
'Stock A',
(select material_uuid from vw_material where description = 'Stock A')
);
insert into vw_inventory_material (inventory_uuid, description, material_uuid)
values (
(select inventory_uuid from vw_inventory where description = 'HC Test Inventory'),
'Stock B',
(select material_uuid from vw_material where description = 'Stock B')
);
insert into vw_inventory_material (inventory_uuid, description, material_uuid)
values (
(select inventory_uuid from vw_inventory where description = 'HC Test Inventory'),
'Stock FAH',
(select material_uuid from vw_material where description = 'Stock FAH')
);
insert into vw_inventory_material (inventory_uuid, description, material_uuid)
values (
(select inventory_uuid from vw_inventory where description = 'HC Test Inventory'),
'Neat GBL',
(select material_uuid from vw_material where description = 'Gamma-Butyrolactone')
);
insert into vw_experiment (ref_uid,
description,
-- experiment_type,
parent_uuid, owner_uuid, operator_uuid, lab_uuid, status_uuid)
values (
'test_wf_1', 'test_wf_1',
--(select experiment_type_uuid from vw_experiment_type where description = 'template'),
null,
(select actor_uuid from vw_actor where description = 'HC'),
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select actor_uuid from vw_actor where description = 'HC'),
(select status_uuid from vw_status where description = 'dev_test'));
insert into vw_bom (experiment_uuid, description, actor_uuid, status_uuid) values
((select experiment_uuid from vw_experiment where description = 'test_wf_1'),
'Test WF1 Materials',
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test'));
-- then add materials to BOM
insert into vw_bom_material (bom_uuid, description, inventory_material_uuid) values (
(select bom_uuid from vw_bom where description = 'Test WF1 Materials'),
'Acid',
(select inventory_material_uuid from vw_inventory_material where description = 'Stock FAH'));
insert into vw_bom_material (bom_uuid, description, inventory_material_uuid) values (
(select bom_uuid from vw_bom where description = 'Test WF1 Materials'),
'Solvent',
(select inventory_material_uuid from vw_inventory_material where description = 'Neat GBL'));
insert into vw_bom_material (bom_uuid, description, inventory_material_uuid) values (
(select bom_uuid from vw_bom where description = 'Test WF1 Materials'),
'Stock A',
(select inventory_material_uuid from vw_inventory_material where description = 'Stock A'));
insert into vw_bom_material (bom_uuid, description, inventory_material_uuid) values (
(select bom_uuid from vw_bom where description = 'Test WF1 Materials'),
'Stock B',
(select inventory_material_uuid from vw_inventory_material where description = 'Stock B'));
insert into vw_bom_material (bom_uuid, description, inventory_material_uuid) values (
(select bom_uuid from vw_bom where description = 'Test WF1 Materials'),
'Plate',
(select inventory_material_uuid from vw_inventory_material where description = 'Wf1 Plate'));
insert into vw_workflow (workflow_type_uuid, description, actor_uuid, status_uuid)
values
((select workflow_type_uuid from vw_workflow_type where description = 'template'),
'Preheat Plate',
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test')),
((select workflow_type_uuid from vw_workflow_type where description = 'template'),
'Dispense Solvent',
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test')),
((select workflow_type_uuid from vw_workflow_type where description = 'template'),
'Dispense Stock A',
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test')),
((select workflow_type_uuid from vw_workflow_type where description = 'template'),
'Dispense Stock B',
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test')),
((select workflow_type_uuid from vw_workflow_type where description = 'template'),
'Dispense Acid Vol 1',
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test')),
((select workflow_type_uuid from vw_workflow_type where description = 'template'),
'Heat Stir 1',
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test')),
((select workflow_type_uuid from vw_workflow_type where description = 'template'),
'Dispense Acid Vol 2',
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test')),
((select workflow_type_uuid from vw_workflow_type where description = 'template'),
'Heat Stir 2',
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test')),
((select workflow_type_uuid from vw_workflow_type where description = 'template'),
'Heat',
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test'));
insert into vw_experiment_workflow (experiment_workflow_seq, experiment_uuid, workflow_uuid)
values
-- (1,
-- (select experiment_uuid from vw_experiment where description = 'test_wf_1'),
-- (select workflow_uuid from vw_workflow where description = 'Preheat Plate')),
(1,
(select experiment_uuid from vw_experiment where description = 'test_wf_1'),
(select workflow_uuid from vw_workflow where description = 'Dispense Solvent')),
(2,
(select experiment_uuid from vw_experiment where description = 'test_wf_1'),
(select workflow_uuid from vw_workflow where description = 'Dispense Stock A')),
(3,
(select experiment_uuid from vw_experiment where description = 'test_wf_1'),
(select workflow_uuid from vw_workflow where description = 'Dispense Stock B')),
(4,
(select experiment_uuid from vw_experiment where description = 'test_wf_1'),
(select workflow_uuid from vw_workflow where description = 'Dispense Acid Vol 1')),
-- (6,
-- (select experiment_uuid from vw_experiment where description = 'test_wf_1'),
-- (select workflow_uuid from vw_workflow where description = 'Heat Stir 1')),
(5,
(select experiment_uuid from vw_experiment where description = 'test_wf_1'),
(select workflow_uuid from vw_workflow where description = 'Dispense Acid Vol 2'));
-- (8,
-- (select experiment_uuid from vw_experiment where description = 'test_wf_1'),
-- (select workflow_uuid from vw_workflow where description = 'Heat Stir 2')),
-- (9,
-- (select experiment_uuid from vw_experiment where description = 'test_wf_1'),
-- (select workflow_uuid from vw_workflow where description = 'Heat'));
-- dispense workflow action sets
insert into vw_workflow_action_set (description, workflow_uuid, action_def_uuid, start_date, end_date, duration,
repeating,
parameter_def_uuid, parameter_val, calculation_uuid, source_material_uuid, destination_material_uuid,
actor_uuid, status_uuid)
values ('Dispense Solvent',
(select workflow_uuid from vw_workflow where description = 'Dispense Solvent'),
(select action_def_uuid from vw_action_def where description = 'dispense'),
null, null, null, null,
(select parameter_def_uuid
from vw_action_parameter_def
where description = 'dispense' and parameter_description = 'volume'),
array [(select put_val(get_type_def('data', 'num'),'1', 'mL')),
(select put_val(get_type_def('data', 'num'),'2', 'mL'))],
null,
array [(select bom_material_index_uuid from vw_bom_material_index where description = 'Solvent')], -- this has to come from bom_material_index...
array [
(select bom_material_index_uuid from vw_bom_material_index where
description like '%Plate%A1%' and bom_uuid = (select bom_uuid from vw_bom where experiment_description = 'test_wf_1')),
(select bom_material_index_uuid from vw_bom_material_index where
description like '%Plate%A2%'and bom_uuid = (select bom_uuid from vw_bom where experiment_description = 'test_wf_1'))],
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test'));
insert into vw_workflow_action_set (description, workflow_uuid, action_def_uuid, start_date, end_date, duration,
repeating,
parameter_def_uuid, parameter_val, calculation_uuid, source_material_uuid, destination_material_uuid,
actor_uuid, status_uuid)
values ('Dispense Stock A',
(select workflow_uuid from vw_workflow where description = 'Dispense Stock A'),
(select action_def_uuid from vw_action_def where description = 'dispense'),
null, null, null, null,
(select parameter_def_uuid
from vw_action_parameter_def
where description = 'dispense' and parameter_description = 'volume'),
array [(select put_val(get_type_def('data', 'num'),'1', 'mL')),
(select put_val(get_type_def('data', 'num'),'2', 'mL'))],
null,
array [(select bom_material_index_uuid from vw_bom_material_index where description = 'Stock A')], -- this has to come from bom_material_index...
array [
(select bom_material_index_uuid from vw_bom_material_index where
description like '%Plate%A1%' and bom_uuid = (select bom_uuid from vw_bom where experiment_description = 'test_wf_1')),
(select bom_material_index_uuid from vw_bom_material_index where
description like '%Plate%A2%'and bom_uuid = (select bom_uuid from vw_bom where experiment_description = 'test_wf_1'))],
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test'));
insert into vw_workflow_action_set (description, workflow_uuid, action_def_uuid, start_date, end_date, duration,
repeating,
parameter_def_uuid, parameter_val, calculation_uuid, source_material_uuid, destination_material_uuid,
actor_uuid, status_uuid)
values ('Dispense Stock B',
(select workflow_uuid from vw_workflow where description = 'Dispense Stock B'),
(select action_def_uuid from vw_action_def where description = 'dispense'),
null, null, null, null,
(select parameter_def_uuid
from vw_action_parameter_def
where description = 'dispense' and parameter_description = 'volume'),
array [(select put_val(get_type_def('data', 'num'),'1', 'mL')),
(select put_val(get_type_def('data', 'num'),'2', 'mL'))],
null,
array [(select bom_material_index_uuid from vw_bom_material_index where description = 'Stock B')], -- this has to come from bom_material_index...
array [
(select bom_material_index_uuid from vw_bom_material_index where
description like '%Plate%A1%' and bom_uuid = (select bom_uuid from vw_bom where experiment_description = 'test_wf_1')),
(select bom_material_index_uuid from vw_bom_material_index where
description like '%Plate%A2%'and bom_uuid = (select bom_uuid from vw_bom where experiment_description = 'test_wf_1'))],
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test'));
insert into vw_workflow_action_set (description, workflow_uuid, action_def_uuid, start_date, end_date, duration,
repeating,
parameter_def_uuid, parameter_val, calculation_uuid, source_material_uuid, destination_material_uuid,
actor_uuid, status_uuid)
values ('Dispense Acid Vol 1',
(select workflow_uuid from vw_workflow where description = 'Dispense Acid Vol 1'),
(select action_def_uuid from vw_action_def where description = 'dispense'),
null, null, null, null,
(select parameter_def_uuid
from vw_action_parameter_def
where description = 'dispense' and parameter_description = 'volume'),
array [(select put_val(get_type_def('data', 'num'),'1', 'mL')),
(select put_val(get_type_def('data', 'num'),'2', 'mL'))],
null,
array [(select bom_material_index_uuid from vw_bom_material_index where description = 'Acid')], -- this has to come from bom_material_index...
array [
(select bom_material_index_uuid from vw_bom_material_index where
description like '%Plate%A1%' and bom_uuid = (select bom_uuid from vw_bom where experiment_description = 'test_wf_1')),
(select bom_material_index_uuid from vw_bom_material_index where
description like '%Plate%A2%'and bom_uuid = (select bom_uuid from vw_bom where experiment_description = 'test_wf_1'))],
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test'));
insert into vw_workflow_action_set (description, workflow_uuid, action_def_uuid, start_date, end_date, duration,
repeating,
parameter_def_uuid, parameter_val, calculation_uuid, source_material_uuid, destination_material_uuid,
actor_uuid, status_uuid)
values ('Dispense Acid Vol 2',
(select workflow_uuid from vw_workflow where description = 'Dispense Acid Vol 2'),
(select action_def_uuid from vw_action_def where description = 'dispense'),
null, null, null, null,
(select parameter_def_uuid
from vw_action_parameter_def
where description = 'dispense' and parameter_description = 'volume'),
array [(select put_val(get_type_def('data', 'num'),'1', 'mL')),
(select put_val(get_type_def('data', 'num'),'2', 'mL'))],
null,
array [(select bom_material_index_uuid from vw_bom_material_index where description = 'Acid')], -- this has to come from bom_material_index...
array [
(select bom_material_index_uuid from vw_bom_material_index where
description like '%Plate%A1%' and bom_uuid = (select bom_uuid from vw_bom where experiment_description = 'test_wf_1')),
(select bom_material_index_uuid from vw_bom_material_index where
description like '%Plate%A2%'and bom_uuid = (select bom_uuid from vw_bom where experiment_description = 'test_wf_1'))],
(select actor_uuid from vw_actor where description = 'Mike Tynes'),
(select status_uuid from vw_status where description = 'dev_test'));
select * from vw_experiment_workflow_bom_step_object_parameter_json;
-- select experiment_copy ((select experiment_uuid from vw_experiment where description = 'test_wf_1'),
-- 'perov_instance_1');
-- heat and heat stirs we dont do these as wafss because waffs cant handle multi-parameter actions :shrug:
-- i wonder if it makes more sense to just have a 'set heat'...
-- insert into vw_action (action_def_uuid, workflow_uuid, action_description, actor_uuid, status_uuid)
-- values (
-- (select action_def_uuid from vw_action_def where description = 'heat_stir'),
-- (select workflow_uuid from vw_workflow where description = 'Heat Stir 1'),
-- 'Heat Stir 1',
-- (select actor_uuid from vw_actor where description = 'Mike Tynes'),
-- (select status_uuid from vw_status where description = 'dev_test'));
-- insert into vw_workflow_object (workflow_uuid, action_uuid)
-- values (
-- (select workflow_uuid from vw_workflow where description = 'Heat Stir 1'),
-- (select action_uuid from vw_action where action_description = 'Heat Stir 1'));
-- insert into vw_workflow_step (workflow_uuid, workflow_object_uuid, parent_uuid, status_uuid)
-- values (
-- (select workflow_uuid from vw_workflow where description = 'Heat Stir 1'),
-- (select workflow_object_uuid from vw_workflow_object where (object_type = 'action' and object_description = 'Heat Stir 1')),
-- null,
-- (select status_uuid from vw_status where description = 'dev_test'));
-- update vw_action_parameter set parameter_val = (
-- select put_val((select get_type_def('data', 'num')), '15', 'mins'))
-- where action_description = 'Heat Stir 1'
-- and parameter_def_description = 'duration';
-- update vw_action_parameter set parameter_val = (
-- select put_val((select get_type_def('data', 'num')), '750', 'rpm'))
-- where action_description = 'Heat Stir 1'
-- and parameter_def_description = 'speed';
-- update vw_action_parameter set parameter_val = (
-- select put_val((select get_type_def('data', 'num')), '95', 'degC'))
-- where action_description = 'Heat Stir 1'
-- and parameter_def_description = 'temperature';