-
Global information
- Generated on Fri Nov 28 04:31:30 2025
- Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log , ..., ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log.9.gz
- Parsed 2,813,992 log entries in 31m28s
- Log start from 2025-11-27 00:00:01 to 2025-11-27 23:59:55
-
Overview
Global Stats
- 654 Number of unique normalized queries
- 332,240 Number of queries
- 19m25s Total query duration
- 2025-11-27 00:00:01 First query
- 2025-11-27 23:59:42 Last query
- 1,558 queries/s at 2025-11-27 23:00:03 Query peak
- 19m25s Total query duration
- 29s412ms Prepare/parse total duration
- 40s597ms Bind total duration
- 18m15s Execute total duration
- 34,302 Number of events
- 3 Number of unique normalized events
- 34,184 Max number of times the same event was reported
- 0 Number of cancellation
- 422 Total number of automatic vacuums
- 483 Total number of automatic analyzes
- 6,775 Number temporary file
- 14.36 MiB Max size of temporary file
- 2.06 MiB Average size of temporary file
- 14,824 Total number of sessions
- 3 sessions at 2025-11-27 17:02:04 Session peak
- 39m32s Total duration of sessions
- 160ms Average duration of sessions
- 22 Average queries per session
- 78ms Average queries duration per session
- 81ms Average idle time per session
- 14,824 Total number of connections
- 13 connections/s at 2025-11-27 05:02:03 Connection peak
- 3 Total number of databases
SQL Traffic
Key values
- 1,558 queries/s Query Peak
- 2025-11-27 23:00:03 Date
SELECT Traffic
Key values
- 1,558 queries/s Query Peak
- 2025-11-27 23:00:03 Date
INSERT/UPDATE/DELETE Traffic
Key values
- 1,210 queries/s Query Peak
- 2025-11-27 23:35:12 Date
Queries duration
Key values
- 19m25s Total query duration
Prepared queries ratio
Key values
- 0.00 Ratio of bind vs prepare
- 0.00 % Ratio between prepared and "usual" statements
General Activity
↑ Back to the top of the General Activity tableDay Hour Count Min duration Max duration Avg duration Latency Percentile(90) Latency Percentile(95) Latency Percentile(99) Nov 27 00 7,123 0ms 44ms 0ms 7ms 7ms 888ms 01 6,444 0ms 1ms 0ms 7ms 7ms 11ms 02 6,420 0ms 1ms 0ms 7ms 7ms 8ms 03 6,420 0ms 2ms 0ms 7ms 8ms 8ms 04 6,420 0ms 1ms 0ms 6ms 7ms 7ms 05 16,319 0ms 11s347ms 6ms 1s420ms 1s476ms 1m31s 06 15,974 0ms 1s353ms 1ms 1s360ms 1s446ms 1s574ms 07 16,471 0ms 1s390ms 0ms 1s380ms 1s442ms 1s519ms 08 16,893 0ms 1s418ms 0ms 1s404ms 1s429ms 1s628ms 09 14,613 0ms 1s663ms 1ms 1s436ms 1s467ms 1s889ms 10 18,038 0ms 1s338ms 0ms 1s334ms 1s404ms 1s800ms 11 14,684 0ms 1s305ms 1ms 1s388ms 1s402ms 1s563ms 12 20,048 0ms 2s29ms 0ms 1s405ms 1s783ms 3s74ms 13 13,831 0ms 2s341ms 1ms 1s354ms 1s474ms 2s433ms 14 13,768 0ms 1s342ms 1ms 1s328ms 1s373ms 1s560ms 15 14,901 0ms 2s201ms 1ms 1s319ms 1s420ms 2s307ms 16 15,386 0ms 1s278ms 1ms 1s322ms 1s375ms 1s481ms 17 15,156 0ms 9m43s 46ms 1s380ms 36s814ms 9m43s 18 16,012 0ms 1s346ms 1ms 1s359ms 1s379ms 1s536ms 19 13,820 0ms 1s441ms 1ms 1s329ms 1s383ms 1s703ms 20 13,765 0ms 1s629ms 1ms 1s374ms 1s419ms 1s724ms 21 13,780 0ms 1s296ms 1ms 1s326ms 1s389ms 1s495ms 22 14,699 0ms 1s403ms 1ms 1s370ms 1s440ms 1s501ms 23 21,255 0ms 1s395ms 0ms 1s380ms 1s486ms 1s551ms Day Hour SELECT COPY TO Average Duration Latency Percentile(90) Latency Percentile(95) Latency Percentile(99) Nov 27 00 6,402 0 0ms 6ms 6ms 7ms 01 6,024 0 0ms 6ms 6ms 6ms 02 6,000 0 0ms 6ms 6ms 6ms 03 6,000 0 0ms 6ms 6ms 7ms 04 6,000 0 0ms 5ms 6ms 6ms 05 12,819 0 0ms 71ms 88ms 376ms 06 14,081 0 0ms 67ms 90ms 95ms 07 15,490 0 0ms 46ms 91ms 105ms 08 15,937 0 0ms 34ms 89ms 201ms 09 13,742 0 0ms 22ms 87ms 123ms 10 17,066 0 0ms 85ms 152ms 386ms 11 13,797 0 0ms 85ms 89ms 172ms 12 19,053 0 0ms 87ms 114ms 314ms 13 12,977 0 0ms 20ms 87ms 105ms 14 12,925 0 0ms 18ms 88ms 120ms 15 14,032 0 0ms 21ms 88ms 199ms 16 14,498 0 0ms 45ms 86ms 136ms 17 13,337 0 0ms 19ms 90ms 214ms 18 15,087 0 0ms 85ms 89ms 303ms 19 12,967 0 0ms 18ms 88ms 117ms 20 12,922 0 0ms 18ms 89ms 95ms 21 12,933 0 0ms 17ms 85ms 98ms 22 13,804 0 0ms 19ms 92ms 219ms 23 14,478 0 0ms 28ms 88ms 102ms Day Hour INSERT UPDATE DELETE COPY FROM Average Duration Latency Percentile(90) Latency Percentile(95) Latency Percentile(99) Nov 27 00 100 0 0 0 0ms 0ms 0ms 0ms 01 0 0 0 0 0ms 0ms 0ms 0ms 02 0 0 0 0 0ms 0ms 0ms 0ms 03 0 0 0 0 0ms 0ms 0ms 0ms 04 0 0 0 0 0ms 0ms 0ms 0ms 05 647 182 0 0 0ms 0ms 2ms 81ms 06 273 255 0 0 0ms 3ms 3ms 45ms 07 28 109 0 0 1ms 3ms 3ms 8ms 08 19 108 0 0 1ms 3ms 3ms 5ms 09 13 99 0 0 1ms 2ms 3ms 5ms 10 24 130 0 0 1ms 3ms 4ms 8ms 11 15 99 0 0 1ms 3ms 3ms 6ms 12 26 127 0 0 1ms 3ms 5ms 15ms 13 10 96 0 0 1ms 2ms 3ms 4ms 14 10 94 0 0 1ms 3ms 3ms 3ms 15 13 96 0 0 1ms 3ms 3ms 5ms 16 12 106 0 0 1ms 2ms 3ms 7ms 17 13 87 0 0 1ms 3ms 3ms 5ms 18 19 104 0 0 1ms 3ms 3ms 6ms 19 12 95 0 0 1ms 3ms 3ms 4ms 20 10 94 0 0 1ms 3ms 3ms 4ms 21 10 95 0 0 1ms 3ms 3ms 3ms 22 18 100 0 0 1ms 3ms 3ms 6ms 23 18 99 0 0 1ms 2ms 3ms 3ms Day Hour Prepare Bind Bind/Prepare Percentage of prepare Nov 27 00 6,322 6,322 1.00 94.33% 01 5,820 5,820 1.00 96.61% 02 5,820 5,820 1.00 97.00% 03 5,820 5,820 1.00 97.00% 04 5,820 5,820 1.00 97.00% 05 13,440 13,440 1.00 84.67% 06 14,446 14,446 1.00 93.26% 07 15,464 15,464 1.00 96.97% 08 15,901 15,901 1.00 97.18% 09 13,691 13,691 1.00 96.97% 10 17,057 17,057 1.00 97.41% 11 13,748 13,748 1.00 96.91% 12 19,043 19,043 1.00 97.66% 13 12,920 12,920 1.00 96.84% 14 12,866 12,866 1.00 96.85% 15 13,978 13,978 1.00 97.03% 16 14,453 14,453 1.00 97.10% 17 13,235 13,235 1.00 90.20% 18 15,047 15,047 1.00 97.05% 19 12,911 12,911 1.00 96.82% 20 12,866 12,866 1.00 96.88% 21 12,875 12,875 1.00 96.84% 22 13,759 13,759 1.00 96.86% 23 14,448 14,448 1.00 69.86% Day Hour Count Average / Second Nov 27 00 601 0.17/s 01 602 0.17/s 02 600 0.17/s 03 600 0.17/s 04 600 0.17/s 05 652 0.18/s 06 600 0.17/s 07 639 0.18/s 08 646 0.18/s 09 610 0.17/s 10 643 0.18/s 11 614 0.17/s 12 665 0.18/s 13 605 0.17/s 14 600 0.17/s 15 611 0.17/s 16 617 0.17/s 17 652 0.18/s 18 623 0.17/s 19 601 0.17/s 20 597 0.17/s 21 601 0.17/s 22 610 0.17/s 23 635 0.18/s Day Hour Count Average Duration Average idle time Nov 27 00 601 20ms 18ms 01 602 18ms 17ms 02 600 18ms 17ms 03 600 18ms 17ms 04 600 17ms 17ms 05 652 440ms 274ms 06 600 108ms 81ms 07 639 68ms 42ms 08 646 74ms 48ms 09 610 57ms 30ms 10 643 61ms 36ms 11 614 57ms 31ms 12 665 68ms 38ms 13 605 55ms 28ms 14 600 51ms 25ms 15 611 57ms 31ms 16 617 59ms 32ms 17 652 2s106ms 1s21ms 18 623 58ms 31ms 19 601 52ms 26ms 20 597 52ms 26ms 21 601 51ms 26ms 22 610 56ms 30ms 23 635 66ms 39ms -
Connections
Established Connections
Key values
- 13 connections Connection Peak
- 2025-11-27 05:02:03 Date
Connections per database
Key values
- celspac Main Database
- 14,824 connections Total
Connections per user
Key values
- tng_migration_user Main User
- 14,824 connections Total
-
Sessions
Simultaneous sessions
Key values
- 3 sessions Session Peak
- 2025-11-27 17:02:04 Date
Histogram of session times
Key values
- 14,515 0-500ms duration
Sessions per database
Key values
- celspac Main Database
- 14,824 sessions Total
Sessions per user
Key values
- tng_migration_user Main User
- 14,824 sessions Total
Sessions per host
Key values
- 127.0.0.1 Main Host
- 14,824 sessions Total
-
Checkpoints / Restartpoints
Checkpoints Buffers
Key values
- 8,539 buffers Checkpoint Peak
- 2025-11-27 17:07:43 Date
- 269.816 seconds Highest write time
- 0.631 seconds Sync time
Checkpoints Wal files
Key values
- 17 files Wal files usage Peak
- 2025-11-27 05:07:35 Date
Checkpoints distance
Key values
- 479.92 Mo Distance Peak
- 2025-11-27 05:07:35 Date
Checkpoints Activity
↑ Back to the top of the Checkpoint Activity tableDay Hour Written buffers Write time Sync time Total time Nov 27 00 2,284 228.453s 0.01s 228.473s 01 0 0s 0s 0s 02 0 0s 0s 0s 03 0 0s 0s 0s 04 0 0s 0s 0s 05 17,529 1,641.168s 0.084s 1,641.422s 06 20,311 2,380.1s 0.114s 2,380.418s 07 18,082 2,151.385s 0.113s 2,151.681s 08 15,699 1,919.97s 0.103s 1,920.265s 09 15,642 1,907.088s 0.092s 1,907.393s 10 17,602 2,148.396s 0.112s 2,148.636s 11 15,420 1,899.959s 0.097s 1,900.268s 12 17,690 2,132.637s 0.14s 2,132.992s 13 15,412 1,907.007s 0.723s 1,907.922s 14 15,421 1,914.87s 0.099s 1,915.138s 15 14,915 1,910.64s 0.113s 1,910.931s 16 17,801 2,142.681s 0.132s 2,142.997s 17 24,582 2,110.778s 0.124s 2,111.031s 18 18,025 2,195.978s 0.161s 2,196.366s 19 15,764 1,963.932s 0.117s 1,964.268s 20 15,705 1,968.354s 0.104s 1,968.575s 21 17,988 2,202.355s 0.134s 2,202.707s 22 17,991 2,193.797s 0.183s 2,194.199s 23 15,843 1,984.065s 0.108s 1,984.287s Day Hour Added Removed Recycled Synced files Longest sync Average sync Nov 27 00 0 0 0 54 0.004s 0.001s 01 0 0 0 0 0s 0s 02 0 0 0 0 0s 0s 03 0 0 0 0 0s 0s 04 0 0 0 0 0s 0s 05 0 0 32 688 0.007s 0.007s 06 0 8 13 793 0.006s 0.012s 07 0 4 17 755 0.005s 0.011s 08 0 0 20 689 0.004s 0.01s 09 0 0 21 656 0.004s 0.01s 10 0 0 23 750 0.007s 0.011s 11 0 0 19 658 0.006s 0.01s 12 0 0 23 720 0.009s 0.011s 13 0 0 19 638 0.624s 0.02s 14 0 0 21 628 0.005s 0.01s 15 0 0 22 652 0.015s 0.01s 16 0 0 21 694 0.013s 0.011s 17 0 0 32 911 0.004s 0.011s 18 0 6 15 732 0.009s 0.011s 19 0 1 20 648 0.010s 0.01s 20 0 0 21 627 0.006s 0.01s 21 0 0 20 695 0.007s 0.011s 22 0 1 20 729 0.035s 0.011s 23 0 0 21 678 0.005s 0.01s Day Hour Count Avg time (sec) Nov 27 00 0 0s 01 0 0s 02 0 0s 03 0 0s 04 0 0s 05 0 0s 06 0 0s 07 0 0s 08 0 0s 09 0 0s 10 0 0s 11 0 0s 12 0 0s 13 0 0s 14 0 0s 15 0 0s 16 0 0s 17 0 0s 18 0 0s 19 0 0s 20 0 0s 21 0 0s 22 0 0s 23 0 0s Day Hour Mean distance Mean estimate Nov 27 00 33,695.00 kB 41,797.00 kB 01 0.00 kB 0.00 kB 02 0.00 kB 0.00 kB 03 0.00 kB 0.00 kB 04 0.00 kB 0.00 kB 05 74,212.86 kB 195,568.86 kB 06 28,618.08 kB 95,530.08 kB 07 31,118.09 kB 54,354.73 kB 08 34,193.10 kB 59,920.40 kB 09 34,142.40 kB 59,913.90 kB 10 31,126.55 kB 54,710.64 kB 11 34,132.70 kB 57,368.40 kB 12 31,083.64 kB 54,719.00 kB 13 34,149.10 kB 57,404.90 kB 14 34,170.50 kB 59,885.00 kB 15 34,163.30 kB 59,895.10 kB 16 31,104.73 kB 54,710.45 kB 17 47,414.09 kB 148,440.36 kB 18 30,986.64 kB 74,661.18 kB 19 34,047.90 kB 58,944.00 kB 20 34,070.60 kB 59,783.40 kB 21 30,998.73 kB 54,636.91 kB 22 31,022.18 kB 45,585.64 kB 23 34,128.90 kB 59,923.70 kB -
Temporary Files
Size of temporary files
Key values
- 73.28 MiB Temp Files size Peak
- 2025-11-27 05:48:02 Date
Number of temporary files
Key values
- 36 per second Temp Files Peak
- 2025-11-27 06:12:02 Date
Temporary Files Activity
↑ Back to the top of the Temporary Files Activity tableDay Hour Count Total size Average size Nov 27 00 0 0 0 01 0 0 0 02 0 0 0 03 0 0 0 04 0 0 0 05 372 790.60 MiB 2.13 MiB 06 357 732.22 MiB 2.05 MiB 07 357 732.21 MiB 2.05 MiB 08 354 732.07 MiB 2.07 MiB 09 351 732.23 MiB 2.09 MiB 10 357 732.06 MiB 2.05 MiB 11 354 732.19 MiB 2.07 MiB 12 357 732.32 MiB 2.05 MiB 13 360 732.40 MiB 2.03 MiB 14 357 732.05 MiB 2.05 MiB 15 360 732.17 MiB 2.03 MiB 16 357 732.10 MiB 2.05 MiB 17 337 729.38 MiB 2.16 MiB 18 360 732.16 MiB 2.03 MiB 19 354 731.88 MiB 2.07 MiB 20 354 732.13 MiB 2.07 MiB 21 360 732.04 MiB 2.03 MiB 22 360 732.00 MiB 2.03 MiB 23 357 732.00 MiB 2.05 MiB Queries generating the most temporary files (N)
Rank Count Total size Min size Max size Avg size Query 1 6,744 13.51 GiB 696.00 KiB 9.13 MiB 2.05 MiB refresh materialized view core.mv_subject_form with data;-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-27 13:12:03 Duration: 2s341ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-27 15:06:03 Duration: 2s201ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-27 12:12:03 Duration: 2s29ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
2 8 12.19 MiB 8.00 KiB 3.45 MiB 1.52 MiB alter table "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" add primary key (id);-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject_inform_consent"} */ ALTER TABLE "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" ADD PRIMARY KEY (id);
Date: 2025-11-27 17:02:06 Duration: 219ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject_inform_consent"} */ ALTER TABLE "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" ADD PRIMARY KEY (id);
Date: 2025-11-27 05:02:05 Duration: 168ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject_inform_consent"} */ ALTER TABLE "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" ADD PRIMARY KEY (id);
Date: 2025-11-27 05:02:05 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
3 8 1.97 MiB 8.00 KiB 744.00 KiB 252.00 KiB alter table "celspac"."dbt_stg"."stg_celspac_admin__subject" add primary key (id);-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ ALTER TABLE "celspac"."dbt_stg"."stg_celspac_admin__subject" ADD PRIMARY KEY (id);
Date: 2025-11-27 05:02:19 Duration: 33ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ ALTER TABLE "celspac"."dbt_stg"."stg_celspac_admin__subject" ADD PRIMARY KEY (id);
Date: 2025-11-27 17:02:20 Duration: 32ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ ALTER TABLE "celspac"."dbt_stg"."stg_celspac_admin__subject" ADD PRIMARY KEY (id);
Date: 2025-11-27 05:02:19 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
4 6 42.07 MiB 2.49 MiB 14.36 MiB 7.01 MiB create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( with ranked_table_con as ( select *, row_number() over (partition by subject_id, type_code order by priority desc ) as ranked_row from "celspac"."core"."contact" where value -> ? = ?), ranked_table_contact as ( select *, row_number() over (partition by subject_id, type_code order by priority desc ) as ranked_row from "celspac"."core"."contact"), max_prio_perm as ( select * from ranked_table_con where ranked_row = ?), contact_table_max_prio as ( select * from ranked_table_contact where ranked_row = ?), contact_d as ( select distinct subject_id, replace((value -> ?)::text, ?, ? ) AS city, replace((value -> ?)::text, ?, ? ) as postal_code, replace((value -> ?)::text, ?, ? ) AS country, replace((value -> ?)::text, ?, ? ) as street, replace((value -> ?)::text, ?, ? ) AS street_number, replace((value -> ?)::text, ?, ? ) as permanent from max_prio_perm con where con.type_code = ?), contact_d_c as ( select distinct subject_id, replace((value -> ?)::text, ?, ? ) AS city, replace((value -> ?)::text, ?, ? ) as postal_code, replace((value -> ?)::text, ?, ? ) AS country, replace((value -> ?)::text, ?, ? ) as street, replace((value -> ?)::text, ?, ? ) AS street_number, replace((value -> ?)::text, ?, ? ) as permanent from contact_table_max_prio con where con.type_code = ?), con_email as ( select subject_id, replace(value::text, ?, ? ) AS email FROM contact_table_max_prio con WHERE con.type_code = ?), con_ph AS ( SELECT subject_id, replace(value::text, ?, ? ) as phone_number from contact_table_max_prio where type_code = ? ) select s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number as street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street as street_contact, con_d_c.street_number as street_number_contact, con_d_c.city as city_contact, con_d_c.postal_code as postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* from "celspac"."core"."subject" s left join "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se on se.subject_id = s.id left join "celspac"."core"."subject_dead" s_dead on s.id = s_dead.subject_id left join contact_d con_d on con_d.subject_id = s.id left join contact_d_c con_d_c on con_d_c.subject_id = s.id left join con_email c_e on c_e.subject_id = s.id left join con_ph c_p on c_p.subject_id = s.id );-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );
Date: 2025-11-27 17:02:20 Duration: 1s298ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );
Date: 2025-11-27 05:02:19 Duration: 1s225ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );
Date: 2025-11-27 05:02:18 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
5 4 35.88 MiB 6.88 MiB 11.07 MiB 8.97 MiB create table "celspac"."dbt_stg"."inte_unique_subject_extend_array__dbt_tmp" as ( select subject_id, array_agg(extend_template order by subcohort_id ) as extend_template, array_agg(extend order by subcohort_id ) as extend, array_agg(description order by subcohort_id ) as description, array_agg(description_internal order by subcohort_id ) as description_internal, array_agg(subcohort_id order by subcohort_id ) as subcohort_id, array_agg(subcohort_name order by subcohort_id ) as subcohort_name, array_agg(column_prefix order by subcohort_id ) as column_prefix from "celspac"."dbt_stg"."inte_subject_extend" group by subject_id );-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.inte_unique_subject_extend_array"} */ create table "celspac"."dbt_stg"."inte_unique_subject_extend_array__dbt_tmp" as ( SELECT subject_id, array_agg(extend_template ORDER BY subcohort_id ) AS extend_template, array_agg(extend ORDER BY subcohort_id ) AS extend, array_agg(description ORDER BY subcohort_id ) AS description, array_agg(description_internal ORDER BY subcohort_id ) AS description_internal, array_agg(subcohort_id ORDER BY subcohort_id ) AS subcohort_id, array_agg(subcohort_name ORDER BY subcohort_id ) AS subcohort_name, array_agg(column_prefix ORDER BY subcohort_id ) AS column_prefix FROM "celspac"."dbt_stg"."inte_subject_extend" GROUP BY subject_id );
Date: 2025-11-27 05:02:04 Duration: 696ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.inte_unique_subject_extend_array"} */ create table "celspac"."dbt_stg"."inte_unique_subject_extend_array__dbt_tmp" as ( SELECT subject_id, array_agg(extend_template ORDER BY subcohort_id ) AS extend_template, array_agg(extend ORDER BY subcohort_id ) AS extend, array_agg(description ORDER BY subcohort_id ) AS description, array_agg(description_internal ORDER BY subcohort_id ) AS description_internal, array_agg(subcohort_id ORDER BY subcohort_id ) AS subcohort_id, array_agg(subcohort_name ORDER BY subcohort_id ) AS subcohort_name, array_agg(column_prefix ORDER BY subcohort_id ) AS column_prefix FROM "celspac"."dbt_stg"."inte_subject_extend" GROUP BY subject_id );
Date: 2025-11-27 17:02:05 Duration: 547ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.inte_unique_subject_extend_array"} */ create table "celspac"."dbt_stg"."inte_unique_subject_extend_array__dbt_tmp" as ( SELECT subject_id, array_agg(extend_template ORDER BY subcohort_id ) AS extend_template, array_agg(extend ORDER BY subcohort_id ) AS extend, array_agg(description ORDER BY subcohort_id ) AS description, array_agg(description_internal ORDER BY subcohort_id ) AS description_internal, array_agg(subcohort_id ORDER BY subcohort_id ) AS subcohort_id, array_agg(subcohort_name ORDER BY subcohort_id ) AS subcohort_name, array_agg(column_prefix ORDER BY subcohort_id ) AS column_prefix FROM "celspac"."dbt_stg"."inte_subject_extend" GROUP BY subject_id );
Date: 2025-11-27 05:02:04 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
6 3 29.34 MiB 8.70 MiB 11.91 MiB 9.78 MiB create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );
Date: 2025-11-27 17:12:09 Duration: 9m43s Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );
Date: 2025-11-27 05:02:28 Duration: 4s738ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );
Date: 2025-11-27 05:02:28 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
7 2 7.55 MiB 3.78 MiB 3.78 MiB 3.78 MiB create table "celspac"."dbt_marts_dbt_all"."export_proband_all__dbt_tmp" as ( select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, ct.* from ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code || ? || subject_role_code || ? || activity_state_code as state_role from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as state_role ("subject_id" int, "celspac_pr_celspac_p01" text, "celspac_pr_elspac_p01" text, "celspac_pr_zajemci_p01" text, "covid_p01" text, "covid_p02" text, "covid_p03" text, "dust_p01_tng_p09" text, "dust_p01_tng_p10" text, "dust_p01_tng_p11" text, "hapiee_p01" text, "hapiee_p02" text, "hba_p01" text, "horpark" text, "horpark_patients" text, "parents_p01" text, "parents_p02" text, "psycap_p01_hba_p01" text, "psycap_p01_ya_p01" text, "psycap_p01_ya_p02" text, "psycap_p01_ya_p03" text, "psycap_p02_new_hba_p01" text, "psycap_p02_new_ya_p03" text, "psycap_p02_old_hba_p01" text, "psycap_p02_old_ya_p01" text, "psycap_p02_old_ya_p02" text, "psycap_p02_old_ya_p03" text, "tng_4mi_p1" text, "tng_4mi_p2" text, "tng_children_p1" text, "tng_children_p1_chibra" text, "tng__monitor" text, "tng_p01" text, "tng_p02" text, "tng_p03" text, "tng_p04" text, "tng_p05" text, "tng_p06" text, "tng_p07" text, "tng_p08" text, "tng_p08_test" text, "tng_p09" text, "tng_p10" text, "tng_p10_test_tp" text, "tng_p11" text, "tng_p11_monitor" text, "tng_p12" text, "tng_p12_monitor" text, "tng_p13" text, "tng_p13_monitor" text, "tng_pilot_8__monitor" text, "tng_pilot_9__form_fix_2019_06" text, "tng_pilot_9__form_fix_mm38p01_v2_v2" text, "tng_pilot_9__form_fix_mm38p02_v2_v2" text, "tng_pilot_9__form_fix_mm38p03_v2_v2" text, "tng_pilot_9__form_fix_mm38p04_v2_v2" text, "tng_pilot_9__monitor" text, "vulde" text, "ya_p01" text, "ya_p01_digi_ya03v2" text, "ya_p01_digi_ya04v2" text, "ya_p01_digi_ya05v2" text, "ya_p01_test" text, "ya_p02" text, "ya_p02_digi_ya03v2" text, "ya_p02_digi_ya04v2" text, "ya_p02_digi_ya05v2" text, "ya_p02_test" text, "ya_p03" text, "ya_p03_digi_ya03v2" text, "ya_p03_digi_ya04v2" text, "ya_p03_digi_ya05v2" text, "ya_p04" text)) ct join "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj on sbj.id = ct.subject_id );-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_all"} */ create table "celspac"."dbt_marts_dbt_all"."export_proband_all__dbt_tmp" as ( SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, ct.* FROM ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code || ';' || subject_role_code || ';' || activity_state_code AS state_role FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01'), ('celspac_pr_zajemci_p01'), ('covid_p01'), ('covid_p02'), ('covid_p03'), ('dust_p01_tng_p09'), ('dust_p01_tng_p10'), ('dust_p01_tng_p11'), ('hapiee_p01'), ('hapiee_p02'), ('hba_p01'), ('horpark'), ('horpark_patients'), ('parents_p01'), ('parents_p02'), ('psycap_p01_hba_p01'), ('psycap_p01_ya_p01'), ('psycap_p01_ya_p02'), ('psycap_p01_ya_p03'), ('psycap_p02_new_hba_p01'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_hba_p01'), ('psycap_p02_old_ya_p01'), ('psycap_p02_old_ya_p02'), ('psycap_p02_old_ya_p03'), ('tng_4mi_p1'), ('tng_4mi_p2'), ('tng_children_p1'), ('tng_children_p1_chibra'), ('tng__monitor'), ('tng_p01'), ('tng_p02'), ('tng_p03'), ('tng_p04'), ('tng_p05'), ('tng_p06'), ('tng_p07'), ('tng_p08'), ('tng_p08_test'), ('tng_p09'), ('tng_p10'), ('tng_p10_test_tp'), ('tng_p11'), ('tng_p11_monitor'), ('tng_p12'), ('tng_p12_monitor'), ('tng_p13'), ('tng_p13_monitor'), ('tng_pilot_8__monitor'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor'), ('vulde'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2'), ('ya_p04') $$ ) AS state_role ("subject_id" int, "celspac_pr_celspac_p01" text, "celspac_pr_elspac_p01" text, "celspac_pr_zajemci_p01" text, "covid_p01" text, "covid_p02" text, "covid_p03" text, "dust_p01_tng_p09" text, "dust_p01_tng_p10" text, "dust_p01_tng_p11" text, "hapiee_p01" text, "hapiee_p02" text, "hba_p01" text, "horpark" text, "horpark_patients" text, "parents_p01" text, "parents_p02" text, "psycap_p01_hba_p01" text, "psycap_p01_ya_p01" text, "psycap_p01_ya_p02" text, "psycap_p01_ya_p03" text, "psycap_p02_new_hba_p01" text, "psycap_p02_new_ya_p03" text, "psycap_p02_old_hba_p01" text, "psycap_p02_old_ya_p01" text, "psycap_p02_old_ya_p02" text, "psycap_p02_old_ya_p03" text, "tng_4mi_p1" text, "tng_4mi_p2" text, "tng_children_p1" text, "tng_children_p1_chibra" text, "tng__monitor" text, "tng_p01" text, "tng_p02" text, "tng_p03" text, "tng_p04" text, "tng_p05" text, "tng_p06" text, "tng_p07" text, "tng_p08" text, "tng_p08_test" text, "tng_p09" text, "tng_p10" text, "tng_p10_test_tp" text, "tng_p11" text, "tng_p11_monitor" text, "tng_p12" text, "tng_p12_monitor" text, "tng_p13" text, "tng_p13_monitor" text, "tng_pilot_8__monitor" text, "tng_pilot_9__form_fix_2019_06" text, "tng_pilot_9__form_fix_mm38p01_v2_v2" text, "tng_pilot_9__form_fix_mm38p02_v2_v2" text, "tng_pilot_9__form_fix_mm38p03_v2_v2" text, "tng_pilot_9__form_fix_mm38p04_v2_v2" text, "tng_pilot_9__monitor" text, "vulde" text, "ya_p01" text, "ya_p01_digi_ya03v2" text, "ya_p01_digi_ya04v2" text, "ya_p01_digi_ya05v2" text, "ya_p01_test" text, "ya_p02" text, "ya_p02_digi_ya03v2" text, "ya_p02_digi_ya04v2" text, "ya_p02_digi_ya05v2" text, "ya_p02_test" text, "ya_p03" text, "ya_p03_digi_ya03v2" text, "ya_p03_digi_ya04v2" text, "ya_p03_digi_ya05v2" text, "ya_p04" text)) ct JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj ON sbj.id = ct.subject_id );
Date: 2025-11-27 05:02:20 Duration: 865ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_all"} */ create table "celspac"."dbt_marts_dbt_all"."export_proband_all__dbt_tmp" as ( SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, ct.* FROM ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code || ';' || subject_role_code || ';' || activity_state_code AS state_role FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01'), ('celspac_pr_zajemci_p01'), ('covid_p01'), ('covid_p02'), ('covid_p03'), ('dust_p01_tng_p09'), ('dust_p01_tng_p10'), ('dust_p01_tng_p11'), ('hapiee_p01'), ('hapiee_p02'), ('hba_p01'), ('horpark'), ('horpark_patients'), ('parents_p01'), ('parents_p02'), ('psycap_p01_hba_p01'), ('psycap_p01_ya_p01'), ('psycap_p01_ya_p02'), ('psycap_p01_ya_p03'), ('psycap_p02_new_hba_p01'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_hba_p01'), ('psycap_p02_old_ya_p01'), ('psycap_p02_old_ya_p02'), ('psycap_p02_old_ya_p03'), ('tng_4mi_p1'), ('tng_4mi_p2'), ('tng_children_p1'), ('tng_children_p1_chibra'), ('tng__monitor'), ('tng_p01'), ('tng_p02'), ('tng_p03'), ('tng_p04'), ('tng_p05'), ('tng_p06'), ('tng_p07'), ('tng_p08'), ('tng_p08_test'), ('tng_p09'), ('tng_p10'), ('tng_p10_test_tp'), ('tng_p11'), ('tng_p11_monitor'), ('tng_p12'), ('tng_p12_monitor'), ('tng_p13'), ('tng_p13_monitor'), ('tng_pilot_8__monitor'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor'), ('vulde'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2'), ('ya_p04') $$ ) AS state_role ("subject_id" int, "celspac_pr_celspac_p01" text, "celspac_pr_elspac_p01" text, "celspac_pr_zajemci_p01" text, "covid_p01" text, "covid_p02" text, "covid_p03" text, "dust_p01_tng_p09" text, "dust_p01_tng_p10" text, "dust_p01_tng_p11" text, "hapiee_p01" text, "hapiee_p02" text, "hba_p01" text, "horpark" text, "horpark_patients" text, "parents_p01" text, "parents_p02" text, "psycap_p01_hba_p01" text, "psycap_p01_ya_p01" text, "psycap_p01_ya_p02" text, "psycap_p01_ya_p03" text, "psycap_p02_new_hba_p01" text, "psycap_p02_new_ya_p03" text, "psycap_p02_old_hba_p01" text, "psycap_p02_old_ya_p01" text, "psycap_p02_old_ya_p02" text, "psycap_p02_old_ya_p03" text, "tng_4mi_p1" text, "tng_4mi_p2" text, "tng_children_p1" text, "tng_children_p1_chibra" text, "tng__monitor" text, "tng_p01" text, "tng_p02" text, "tng_p03" text, "tng_p04" text, "tng_p05" text, "tng_p06" text, "tng_p07" text, "tng_p08" text, "tng_p08_test" text, "tng_p09" text, "tng_p10" text, "tng_p10_test_tp" text, "tng_p11" text, "tng_p11_monitor" text, "tng_p12" text, "tng_p12_monitor" text, "tng_p13" text, "tng_p13_monitor" text, "tng_pilot_8__monitor" text, "tng_pilot_9__form_fix_2019_06" text, "tng_pilot_9__form_fix_mm38p01_v2_v2" text, "tng_pilot_9__form_fix_mm38p02_v2_v2" text, "tng_pilot_9__form_fix_mm38p03_v2_v2" text, "tng_pilot_9__form_fix_mm38p04_v2_v2" text, "tng_pilot_9__monitor" text, "vulde" text, "ya_p01" text, "ya_p01_digi_ya03v2" text, "ya_p01_digi_ya04v2" text, "ya_p01_digi_ya05v2" text, "ya_p01_test" text, "ya_p02" text, "ya_p02_digi_ya03v2" text, "ya_p02_digi_ya04v2" text, "ya_p02_digi_ya05v2" text, "ya_p02_test" text, "ya_p03" text, "ya_p03_digi_ya03v2" text, "ya_p03_digi_ya04v2" text, "ya_p03_digi_ya05v2" text, "ya_p04" text)) ct JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj ON sbj.id = ct.subject_id );
Date: 2025-11-27 17:02:22 Duration: 841ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_all"} */ create table "celspac"."dbt_marts_dbt_all"."export_proband_all__dbt_tmp" as ( SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, ct.* FROM ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code || ';' || subject_role_code || ';' || activity_state_code AS state_role FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01'), ('celspac_pr_zajemci_p01'), ('covid_p01'), ('covid_p02'), ('covid_p03'), ('dust_p01_tng_p09'), ('dust_p01_tng_p10'), ('dust_p01_tng_p11'), ('hapiee_p01'), ('hapiee_p02'), ('hba_p01'), ('horpark'), ('horpark_patients'), ('parents_p01'), ('parents_p02'), ('psycap_p01_hba_p01'), ('psycap_p01_ya_p01'), ('psycap_p01_ya_p02'), ('psycap_p01_ya_p03'), ('psycap_p02_new_hba_p01'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_hba_p01'), ('psycap_p02_old_ya_p01'), ('psycap_p02_old_ya_p02'), ('psycap_p02_old_ya_p03'), ('tng_4mi_p1'), ('tng_4mi_p2'), ('tng_children_p1'), ('tng_children_p1_chibra'), ('tng__monitor'), ('tng_p01'), ('tng_p02'), ('tng_p03'), ('tng_p04'), ('tng_p05'), ('tng_p06'), ('tng_p07'), ('tng_p08'), ('tng_p08_test'), ('tng_p09'), ('tng_p10'), ('tng_p10_test_tp'), ('tng_p11'), ('tng_p11_monitor'), ('tng_p12'), ('tng_p12_monitor'), ('tng_p13'), ('tng_p13_monitor'), ('tng_pilot_8__monitor'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor'), ('vulde'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2'), ('ya_p04') $$ ) AS state_role ("subject_id" int, "celspac_pr_celspac_p01" text, "celspac_pr_elspac_p01" text, "celspac_pr_zajemci_p01" text, "covid_p01" text, "covid_p02" text, "covid_p03" text, "dust_p01_tng_p09" text, "dust_p01_tng_p10" text, "dust_p01_tng_p11" text, "hapiee_p01" text, "hapiee_p02" text, "hba_p01" text, "horpark" text, "horpark_patients" text, "parents_p01" text, "parents_p02" text, "psycap_p01_hba_p01" text, "psycap_p01_ya_p01" text, "psycap_p01_ya_p02" text, "psycap_p01_ya_p03" text, "psycap_p02_new_hba_p01" text, "psycap_p02_new_ya_p03" text, "psycap_p02_old_hba_p01" text, "psycap_p02_old_ya_p01" text, "psycap_p02_old_ya_p02" text, "psycap_p02_old_ya_p03" text, "tng_4mi_p1" text, "tng_4mi_p2" text, "tng_children_p1" text, "tng_children_p1_chibra" text, "tng__monitor" text, "tng_p01" text, "tng_p02" text, "tng_p03" text, "tng_p04" text, "tng_p05" text, "tng_p06" text, "tng_p07" text, "tng_p08" text, "tng_p08_test" text, "tng_p09" text, "tng_p10" text, "tng_p10_test_tp" text, "tng_p11" text, "tng_p11_monitor" text, "tng_p12" text, "tng_p12_monitor" text, "tng_p13" text, "tng_p13_monitor" text, "tng_pilot_8__monitor" text, "tng_pilot_9__form_fix_2019_06" text, "tng_pilot_9__form_fix_mm38p01_v2_v2" text, "tng_pilot_9__form_fix_mm38p02_v2_v2" text, "tng_pilot_9__form_fix_mm38p03_v2_v2" text, "tng_pilot_9__form_fix_mm38p04_v2_v2" text, "tng_pilot_9__monitor" text, "vulde" text, "ya_p01" text, "ya_p01_digi_ya03v2" text, "ya_p01_digi_ya04v2" text, "ya_p01_digi_ya05v2" text, "ya_p01_test" text, "ya_p02" text, "ya_p02_digi_ya03v2" text, "ya_p02_digi_ya04v2" text, "ya_p02_digi_ya05v2" text, "ya_p02_test" text, "ya_p03" text, "ya_p03_digi_ya03v2" text, "ya_p03_digi_ya04v2" text, "ya_p03_digi_ya05v2" text, "ya_p04" text)) ct JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj ON sbj.id = ct.subject_id );
Date: 2025-11-27 05:02:20 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
Queries generating the largest temporary files
Rank Size Query 1 14.36 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );[ Date: 2025-11-27 05:02:19 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
2 14.36 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );[ Date: 2025-11-27 17:02:20 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
3 11.91 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-11-27 17:12:09 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
4 11.07 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.inte_unique_subject_extend_array"} */ create table "celspac"."dbt_stg"."inte_unique_subject_extend_array__dbt_tmp" as ( SELECT subject_id, array_agg(extend_template ORDER BY subcohort_id ) AS extend_template, array_agg(extend ORDER BY subcohort_id ) AS extend, array_agg(description ORDER BY subcohort_id ) AS description, array_agg(description_internal ORDER BY subcohort_id ) AS description_internal, array_agg(subcohort_id ORDER BY subcohort_id ) AS subcohort_id, array_agg(subcohort_name ORDER BY subcohort_id ) AS subcohort_name, array_agg(column_prefix ORDER BY subcohort_id ) AS column_prefix FROM "celspac"."dbt_stg"."inte_subject_extend" GROUP BY subject_id );[ Date: 2025-11-27 17:02:05 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
5 9.26 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.inte_unique_subject_extend_array"} */ create table "celspac"."dbt_stg"."inte_unique_subject_extend_array__dbt_tmp" as ( SELECT subject_id, array_agg(extend_template ORDER BY subcohort_id ) AS extend_template, array_agg(extend ORDER BY subcohort_id ) AS extend, array_agg(description ORDER BY subcohort_id ) AS description, array_agg(description_internal ORDER BY subcohort_id ) AS description_internal, array_agg(subcohort_id ORDER BY subcohort_id ) AS subcohort_id, array_agg(subcohort_name ORDER BY subcohort_id ) AS subcohort_name, array_agg(column_prefix ORDER BY subcohort_id ) AS column_prefix FROM "celspac"."dbt_stg"."inte_subject_extend" GROUP BY subject_id );[ Date: 2025-11-27 05:02:04 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
6 9.13 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-27 09:42:02 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] ]
7 8.73 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-11-27 05:02:28 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
8 8.70 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-11-27 17:12:09 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
9 8.68 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.inte_unique_subject_extend_array"} */ create table "celspac"."dbt_stg"."inte_unique_subject_extend_array__dbt_tmp" as ( SELECT subject_id, array_agg(extend_template ORDER BY subcohort_id ) AS extend_template, array_agg(extend ORDER BY subcohort_id ) AS extend, array_agg(description ORDER BY subcohort_id ) AS description, array_agg(description_internal ORDER BY subcohort_id ) AS description_internal, array_agg(subcohort_id ORDER BY subcohort_id ) AS subcohort_id, array_agg(subcohort_name ORDER BY subcohort_id ) AS subcohort_name, array_agg(column_prefix ORDER BY subcohort_id ) AS column_prefix FROM "celspac"."dbt_stg"."inte_subject_extend" GROUP BY subject_id );[ Date: 2025-11-27 05:02:04 ]
10 8.55 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-27 05:06:02 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] ]
11 8.55 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-27 10:24:02 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] ]
12 8.55 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-27 19:54:02 ]
13 8.54 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-27 10:12:02 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] ]
14 8.54 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-27 14:48:02 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] ]
15 8.53 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-27 05:42:02 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] ]
16 8.53 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-27 17:42:02 ]
17 8.47 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-27 20:48:02 ]
18 8.41 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-27 20:30:02 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] ]
19 8.33 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-27 05:48:02 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] ]
20 8.22 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-27 11:24:02 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] ]
-
Vacuums
Vacuums / Analyzes Distribution
Key values
- 1.21 sec Highest CPU-cost vacuum
Table dbt_stg.stg_celspac_admin__subject_inform_consent
Database celspac - 2025-11-27 05:02:25 Date
- 0 sec Highest CPU-cost analyze
Table
Database celspac - Date
Average Autovacuum Duration
Key values
- 1.21 sec Highest CPU-cost vacuum
Table dbt_stg.stg_celspac_admin__subject_inform_consent
Database celspac - 2025-11-27 05:02:25 Date
Analyzes per table
Key values
- core.mv_subject_form (189) Main table analyzed (database celspac)
- 483 analyzes Total
Table Number of analyzes celspac.core.mv_subject_form 189 celspac.core.mv_subject_event 126 celspac.public.scheduled_command 33 celspac.pg_catalog.pg_class 24 celspac.pg_catalog.pg_attribute 10 celspac.pg_catalog.pg_type 10 celspac.pg_catalog.pg_index 6 celspac.pg_catalog.pg_depend 5 celspac.pg_catalog.pg_shdepend 3 celspac.dbt_marts_dbt.export_proband_by_pilot__35 2 celspac.dbt_marts_dbt.export_proband_by_pilot__8 2 celspac.dbt_marts_dbt.export_proband_by_pilot__20 2 celspac.dbt_marts_dbt.export_proband_by_pilot__37 2 celspac.dbt_marts_dbt.export_proband_by_pilot__4 2 celspac.dbt_stg.inte_unique_subject_extend 2 celspac.dbt_marts_dbt.export_proband_by_pilot__25 2 celspac.dbt_stg.stg_celspac_admin__subject 2 celspac.dbt_marts_dbt.export_proband_by_pilot__11 2 celspac.dbt_marts_dbt.export_proband_by_pilot__22 2 celspac.dbt_marts_dbt.export_proband_by_pilot__15 2 celspac.dbt_stg.stg_celspac_admin__subcohort 2 celspac.dbt_marts_dbt.export_proband_by_pilot__12 2 postgres.pg_catalog.pg_shdepend 2 celspac.dbt_marts_dbt.test_export 2 celspac.dbt_marts_dbt_all.export_proband_all 2 celspac.dbt_marts_dbt.export_proband_by_pilot__21 2 celspac.dbt_marts_dbt.export_proband_by_pilot__30 2 celspac.dbt_stg.inte_unique_subject_extend_array 2 celspac.dbt_marts_dbt.export_proband_by_pilot__17 2 celspac.dbt_stg.stg_celspac_admin__inform_consent 2 celspac.core.cohort 2 celspac.dbt_marts_dbt.export_proband_by_pilot__7 2 celspac.dbt_marts_dbt.export_proband_by_pilot__9 2 celspac.dbt_stg.stg_celspac_admin__subcohort_inform_consent 2 celspac.dbt_marts_dbt.export_proband_by_pilot__36 2 celspac.dbt_marts_dbt.export_proband_by_pilot__18 2 celspac.dbt_marts_dbt.export_proband_by_pilot__1 2 celspac.dbt_marts_dbt.export_proband_by_pilot__19 2 celspac.dbt_stg.stg_celspac_admin__subject_inform_consent 2 celspac.dbt_stg.inte_subject_extend 2 celspac.dbt_marts_dbt.export_proband_by_pilot__10 2 celspac.dbt_marts_dbt.export_proband_by_pilot__27 2 celspac.dbt_marts_dbt.export_proband_by_pilot__23 2 celspac.dbt_stg.inte_unique_subject_extend_columns 2 celspac.dbt_marts_dbt.export_proband_by_pilot__5 2 celspac.dbt_marts_dbt.export_proband_by_pilot__26 2 celspac.dbt_marts_dbt.export_proband_by_pilot__29 2 template1.pg_catalog.pg_shdepend 1 Total 483 Vacuums per table
Key values
- core.mv_subject_form (189) Main table vacuumed on database celspac
- 422 vacuums Total
Index Buffer usage Skipped WAL usage Frozen Table Vacuums scans hits misses dirtied pins frozen records full page bytes pages tuples celspac.core.mv_subject_form 189 0 887,673 0 46,269 0 0 414,666 226 26,201,833 0 0 celspac.core.mv_subject_event 126 0 25,901 0 519 0 0 4,158 143 1,359,556 0 0 celspac.pg_catalog.pg_class 35 1 6,985 0 495 0 0 1,106 513 1,183,486 204 561 celspac.pg_catalog.pg_attribute 19 2 30,332 0 1,565 0 0 2,940 1,033 2,770,607 14 275 celspac.pg_catalog.pg_type 7 6 2,304 0 639 0 0 1,386 448 680,604 89 177 celspac.pg_catalog.pg_depend 6 6 8,949 0 653 0 0 1,502 508 985,333 84 609 celspac.pg_catalog.pg_index 3 3 1,164 0 584 0 0 1,094 304 210,077 33 39 celspac.dbt_stg.inte_unique_subject_extend 2 0 4,448 0 3,860 0 0 3,854 2 244,038 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__20 2 0 760 0 8 0 0 79 1 13,109 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__22 2 0 210 0 71 0 0 66 1 12,402 0 0 celspac.dbt_stg.stg_celspac_admin__subject 2 0 9,048 0 8 0 0 4,437 2 278,435 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__27 2 0 611 0 227 0 0 115 2 16,862 0 0 celspac.dbt_stg.inte_subject_extend 2 0 5,349 0 5,208 0 0 5,202 2 323,570 0 0 celspac.dbt_stg.stg_celspac_admin__subject_inform_consent 2 0 21,372 0 9,583 0 0 10,550 2 639,102 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__19 2 0 6,784 0 1,985 0 0 3,678 2 233,760 0 0 celspac.dbt_stg.inte_unique_subject_extend_array 2 0 7,352 0 7,266 0 0 7,260 2 444,992 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__17 2 0 594 0 86 0 0 84 1 13,404 0 0 celspac.pg_catalog.pg_statistic 2 1 4,306 0 1,916 0 0 3,159 1,193 1,200,398 64 216 celspac.dbt_marts_dbt.export_proband_by_pilot__26 2 0 579 0 190 0 0 124 2 17,393 0 0 celspac.dbt_marts_dbt_all.export_proband_all 2 0 6,713 0 3,630 0 0 4,338 2 272,594 0 0 celspac.dbt_marts_dbt.test_export 2 0 68 0 36 0 0 34 2 18,598 0 0 celspac.dbt_stg.inte_unique_subject_extend_columns 2 0 2,523 0 1,438 0 0 1,436 2 101,316 0 0 postgres.pg_catalog.pg_shdepend 2 2 616 0 333 0 0 604 185 149,264 46 80 celspac.dbt_marts_dbt.export_proband_by_pilot__23 2 0 1,395 0 331 0 0 329 2 29,488 0 0 template1.pg_catalog.pg_shdepend 1 1 376 0 131 0 0 322 101 72,261 46 80 celspac.pg_toast.pg_toast_2619 1 1 183 0 95 0 0 178 38 116,203 2 4 celspac.pg_toast.pg_toast_2618 1 1 129 0 93 0 0 155 33 34,518 0 0 Total 422 24 1,036,724 56,613 87,219 0 0 472,856 4,752 37,623,203 582 2,041 Vacuum throughput per table
Key values
- core.mv_subject_form (20.44) Max CPU elapsed for vacuum on database celspac
- unknown (0 ms) Max I/O read time for vacuum on database celspac
- unknown (0 ms) Max I/O write time for vacuum on database celspac
I/O timing (ms) CPU (s) Table read write elapsed celspac.core.mv_subject_form 0 0 20.44 celspac.core.mv_subject_event 0 0 0.03 celspac.pg_catalog.pg_class 0 0 0.11 celspac.pg_catalog.pg_attribute 0 0 1.11 celspac.pg_catalog.pg_type 0 0 0.18 celspac.pg_catalog.pg_depend 0 0 0.45 celspac.pg_catalog.pg_index 0 0 0.18 celspac.dbt_stg.inte_unique_subject_extend 0 0 1.03 celspac.dbt_marts_dbt.export_proband_by_pilot__20 0 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__22 0 0 0.01 celspac.dbt_stg.stg_celspac_admin__subject 0 0 0.11 celspac.dbt_marts_dbt.export_proband_by_pilot__27 0 0 0.04 celspac.dbt_stg.inte_subject_extend 0 0 1.42 celspac.dbt_stg.stg_celspac_admin__subject_inform_consent 0 0 2.39 celspac.dbt_marts_dbt.export_proband_by_pilot__19 0 0 0.51 celspac.dbt_stg.inte_unique_subject_extend_array 0 0 2.03 celspac.dbt_marts_dbt.export_proband_by_pilot__17 0 0 0.02 celspac.pg_catalog.pg_statistic 0 0 0.93 celspac.dbt_marts_dbt.export_proband_by_pilot__26 0 0 0.04 celspac.dbt_marts_dbt_all.export_proband_all 0 0 0.92 celspac.dbt_marts_dbt.test_export 0 0 0 celspac.dbt_stg.inte_unique_subject_extend_columns 0 0 0.37 postgres.pg_catalog.pg_shdepend 0 0 0.09 celspac.dbt_marts_dbt.export_proband_by_pilot__23 0 0 0.09 template1.pg_catalog.pg_shdepend 0 0 0.03 celspac.pg_toast.pg_toast_2619 0 0 0.02 celspac.pg_toast.pg_toast_2618 0 0 0.02 Total 0 0 32.57 Tuples removed per table
Key values
- pg_catalog.pg_attribute (26427) Main table with removed tuples on database celspac
- 51802 tuples Total removed
Index Tuples Pages Table Vacuums scans removed remain not yet removable removed remain celspac.pg_catalog.pg_attribute 19 2 26,427 1,028,663 71,866 0 229,064 celspac.pg_catalog.pg_statistic 2 1 14,887 302,723 3,778 0 81,264 celspac.pg_catalog.pg_class 35 1 4,936 90,346 168 0 156,800 celspac.pg_catalog.pg_depend 6 6 3,258 73,354 168 0 4,290 celspac.pg_catalog.pg_type 7 6 1,113 14,388 252 0 5,026 celspac.pg_catalog.pg_index 3 3 405 2,879 15 0 822 postgres.pg_catalog.pg_shdepend 2 2 295 2,018 0 0 204 celspac.pg_toast.pg_toast_2619 1 1 178 2,050 42 0 860 celspac.pg_toast.pg_toast_2618 1 1 153 524 0 0 581 template1.pg_catalog.pg_shdepend 1 1 150 1,009 0 0 102 celspac.dbt_stg.inte_unique_subject_extend 2 0 0 100,248 0 0 3,968 celspac.dbt_marts_dbt.export_proband_by_pilot__20 2 0 0 2,688 0 110 146 celspac.dbt_marts_dbt.export_proband_by_pilot__22 2 0 0 2,394 0 0 128 celspac.dbt_stg.stg_celspac_admin__subject 2 0 0 100,340 0 0 4,480 celspac.core.mv_subject_event 126 0 0 284,508 0 252 3,780 celspac.core.mv_subject_form 189 0 0 31,159,674 0 0 423,360 celspac.dbt_marts_dbt.export_proband_by_pilot__27 2 0 0 4,476 0 38 218 celspac.dbt_stg.inte_subject_extend 2 0 0 103,998 0 0 5,248 celspac.dbt_stg.stg_celspac_admin__subject_inform_consent 2 0 0 635,186 0 0 10,624 celspac.dbt_marts_dbt.export_proband_by_pilot__19 2 0 0 61,730 0 0 3,712 celspac.dbt_stg.inte_unique_subject_extend_array 2 0 0 100,248 0 0 7,296 celspac.dbt_marts_dbt.export_proband_by_pilot__17 2 0 0 2,928 0 100 156 celspac.dbt_marts_dbt.export_proband_by_pilot__26 2 0 0 4,372 0 20 236 celspac.dbt_marts_dbt_all.export_proband_all 2 0 0 100,202 0 0 4,352 celspac.dbt_marts_dbt.test_export 2 0 0 2,928 0 4 28 celspac.dbt_stg.inte_unique_subject_extend_columns 2 0 0 100,248 0 106 1,430 celspac.dbt_marts_dbt.export_proband_by_pilot__23 2 0 0 15,346 0 122 646 Total 422 24 51,802 34,299,468 76,289 752 948,821 Pages removed per table
Key values
- core.mv_subject_event (252) Main table with removed pages on database celspac
- 752 pages Total removed
Table Number of vacuums Index scans Tuples removed Pages removed celspac.core.mv_subject_event 126 0 0 252 celspac.dbt_marts_dbt.export_proband_by_pilot__23 2 0 0 122 celspac.dbt_marts_dbt.export_proband_by_pilot__20 2 0 0 110 celspac.dbt_stg.inte_unique_subject_extend_columns 2 0 0 106 celspac.dbt_marts_dbt.export_proband_by_pilot__17 2 0 0 100 celspac.dbt_marts_dbt.export_proband_by_pilot__27 2 0 0 38 celspac.dbt_marts_dbt.export_proband_by_pilot__26 2 0 0 20 celspac.dbt_marts_dbt.test_export 2 0 0 4 celspac.dbt_stg.inte_unique_subject_extend 2 0 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__22 2 0 0 0 celspac.dbt_stg.stg_celspac_admin__subject 2 0 0 0 celspac.pg_catalog.pg_attribute 19 2 26427 0 celspac.core.mv_subject_form 189 0 0 0 celspac.dbt_stg.inte_subject_extend 2 0 0 0 template1.pg_catalog.pg_shdepend 1 1 150 0 celspac.dbt_stg.stg_celspac_admin__subject_inform_consent 2 0 0 0 celspac.pg_catalog.pg_depend 6 6 3258 0 celspac.dbt_marts_dbt.export_proband_by_pilot__19 2 0 0 0 celspac.pg_toast.pg_toast_2619 1 1 178 0 celspac.dbt_stg.inte_unique_subject_extend_array 2 0 0 0 celspac.pg_catalog.pg_class 35 1 4936 0 celspac.pg_catalog.pg_statistic 2 1 14887 0 celspac.pg_catalog.pg_index 3 3 405 0 celspac.pg_toast.pg_toast_2618 1 1 153 0 celspac.dbt_marts_dbt_all.export_proband_all 2 0 0 0 celspac.pg_catalog.pg_type 7 6 1113 0 postgres.pg_catalog.pg_shdepend 2 2 295 0 Total 422 24 51,802 752 Autovacuum Activity
↑ Back to the top of the Autovacuum Activity tableDay Hour VACUUMs ANALYZEs Nov 27 00 0 0 01 0 0 02 0 0 03 0 0 04 0 0 05 32 55 06 19 20 07 21 22 08 20 22 09 21 21 10 20 22 11 18 20 12 20 22 13 20 22 14 20 22 15 21 21 16 19 22 17 53 61 18 18 22 19 19 20 20 20 22 21 19 21 22 20 21 23 22 25 - 1.21 sec Highest CPU-cost vacuum
-
Locks
Locks by types
Key values
- unknown Main Lock Type
- 0 locks Total
Most frequent waiting queries (N)
Rank Count Total time Min time Max time Avg duration Query NO DATASET
Queries that waited the most
Rank Wait time Query NO DATASET
-
Queries
Queries by type
Key values
- 302,371 Total read queries
- 18,234 Total write queries
Queries by database
Key values
- celspac Main database
- 329,338 Requests
- 18m13s (celspac)
- Main time consuming database
Queries by user
Key values
- tng_migration_user Main user
- 635,523 Requests
User Request type Count Duration postgres Total 7,920 5s623ms select 7,920 5s623ms tng__dwh_celspac_fdw Total 11,747 3s150ms cursor 11,551 3s143ms others 140 5ms tcl 56 0ms tng_migration_user Total 635,523 45m51s cte 2,616 54s276ms ddl 736 34m24s insert 2,530 1s468ms others 21,642 8m49s select 588,737 1m15s tcl 14,712 19s408ms update 4,550 6s470ms Duration by user
Key values
- 45m51s (tng_migration_user) Main time consuming user
User Request type Count Duration postgres Total 7,920 5s623ms select 7,920 5s623ms tng__dwh_celspac_fdw Total 11,747 3s150ms cursor 11,551 3s143ms others 140 5ms tcl 56 0ms tng_migration_user Total 635,523 45m51s cte 2,616 54s276ms ddl 736 34m24s insert 2,530 1s468ms others 21,642 8m49s select 588,737 1m15s tcl 14,712 19s408ms update 4,550 6s470ms Queries by host
Key values
- 127.0.0.1 Main host
- 635,547 Requests
- 45m51s (127.0.0.1)
- Main time consuming host
Queries by application
Key values
- [unknown] Main application
- 324,266 Requests
- 13m4s (dbt)
- Main time consuming application
Application Request type Count Duration [unknown] Total 324,266 5m8s insert 1,290 693ms others 11,553 4m22s select 302,271 36s59ms tcl 6,977 6s792ms update 2,175 3s24ms dbt Total 2,076 13m4s cte 1,308 26s962ms ddl 368 12m31s others 12 171ms select 76 961ms tcl 312 5s283ms pg_dumpall Total 24 4ms select 24 4ms postgres_fdw Total 5,874 1s539ms cursor 5,776 1s535ms others 70 2ms tcl 28 0ms Number of cancelled queries
Key values
- 0 per second Cancelled query Peak
- 2025-11-27 23:51:15 Date
Number of cancelled queries (5 minutes period)
NO DATASET
-
Top Queries
Histogram of query times
Key values
- 322,785 0-1ms duration
Slowest individual queries
Rank Duration Query 1 9m43s /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-11-27 17:12:09 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
2 36s762ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__23"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__23__dbt_tmp" as ( -- suject (proband) patrici do kohorty ..., Pilot ID: 23 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__role" text, "celspac_pr_elspac_p01__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__state" text, "celspac_pr_elspac_p01__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS activity ("subject_id" int, "celspac_pr_celspac_p01__activity_state" text, "celspac_pr_elspac_p01__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS created_at ("subject_id" int, "celspac_pr_celspac_p01__created_at" text, "celspac_pr_elspac_p01__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS accepted_at ("subject_id" int, "celspac_pr_celspac_p01__accepted_at" text, "celspac_pr_elspac_p01__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS cancelled_at ("subject_id" int, "celspac_pr_celspac_p01__cancelled_at" text, "celspac_pr_elspac_p01__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS revoked_at ("subject_id" int, "celspac_pr_celspac_p01__revoked_at" text, "celspac_pr_elspac_p01__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS paused_at ("subject_id" int, "celspac_pr_celspac_p01__paused_at" text, "celspac_pr_elspac_p01__paused_at" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.celspac_pr_celspac_p01__role, psc_role.celspac_pr_elspac_p01__role, psc_state.celspac_pr_celspac_p01__state, psc_state.celspac_pr_elspac_p01__state, psc_activity_state.celspac_pr_celspac_p01__activity_state, psc_activity_state.celspac_pr_elspac_p01__activity_state, psc_created_at.celspac_pr_celspac_p01__created_at, psc_created_at.celspac_pr_elspac_p01__created_at, psc_accepted_at.celspac_pr_celspac_p01__accepted_at, psc_accepted_at.celspac_pr_elspac_p01__accepted_at, psc_cancelled_at.celspac_pr_celspac_p01__cancelled_at, psc_cancelled_at.celspac_pr_elspac_p01__cancelled_at, psc_revoked_at.celspac_pr_celspac_p01__revoked_at, psc_revoked_at.celspac_pr_elspac_p01__revoked_at, psc_paused_at.celspac_pr_celspac_p01__paused_at, psc_paused_at.celspac_pr_elspac_p01__paused_at FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 23 -- Pilot ID );[ Date: 2025-11-27 17:03:04 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
3 11s347ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__21"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__21__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: Young Adults, Pilot ID: 21 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p03__role" text, "psycap_p02_new_ya_p03__role" text, "psycap_p02_old_ya_p03__role" text, "ya_p03__role" text, "ya_p03_digi_ya03v2__role" text, "ya_p03_digi_ya04v2__role" text, "ya_p03_digi_ya05v2__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p03__state" text, "psycap_p02_new_ya_p03__state" text, "psycap_p02_old_ya_p03__state" text, "ya_p03__state" text, "ya_p03_digi_ya03v2__state" text, "ya_p03_digi_ya04v2__state" text, "ya_p03_digi_ya05v2__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p03__activity_state" text, "psycap_p02_new_ya_p03__activity_state" text, "psycap_p02_old_ya_p03__activity_state" text, "ya_p03__activity_state" text, "ya_p03_digi_ya03v2__activity_state" text, "ya_p03_digi_ya04v2__activity_state" text, "ya_p03_digi_ya05v2__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p03__created_at" text, "psycap_p02_new_ya_p03__created_at" text, "psycap_p02_old_ya_p03__created_at" text, "ya_p03__created_at" text, "ya_p03_digi_ya03v2__created_at" text, "ya_p03_digi_ya04v2__created_at" text, "ya_p03_digi_ya05v2__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p03__accepted_at" text, "psycap_p02_new_ya_p03__accepted_at" text, "psycap_p02_old_ya_p03__accepted_at" text, "ya_p03__accepted_at" text, "ya_p03_digi_ya03v2__accepted_at" text, "ya_p03_digi_ya04v2__accepted_at" text, "ya_p03_digi_ya05v2__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p03__cancelled_at" text, "psycap_p02_new_ya_p03__cancelled_at" text, "psycap_p02_old_ya_p03__cancelled_at" text, "ya_p03__cancelled_at" text, "ya_p03_digi_ya03v2__cancelled_at" text, "ya_p03_digi_ya04v2__cancelled_at" text, "ya_p03_digi_ya05v2__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p03__revoked_at" text, "psycap_p02_new_ya_p03__revoked_at" text, "psycap_p02_old_ya_p03__revoked_at" text, "ya_p03__revoked_at" text, "ya_p03_digi_ya03v2__revoked_at" text, "ya_p03_digi_ya04v2__revoked_at" text, "ya_p03_digi_ya05v2__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p03__paused_at" text, "psycap_p02_new_ya_p03__paused_at" text, "psycap_p02_old_ya_p03__paused_at" text, "ya_p03__paused_at" text, "ya_p03_digi_ya03v2__paused_at" text, "ya_p03_digi_ya04v2__paused_at" text, "ya_p03_digi_ya05v2__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p03_ic_buccal_swab_proband'), ('ya_p03_ic_urine_proband'), ('ya_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p03_ic_buccal_swab_proband" text, "ya_p03_ic_urine_proband" text, "ya_p03_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p03_ic_anam_qs'), ('ya_p03_ic_aneurysm'), ('ya_p03_ic_anthropometry'), ('ya_p03_ic_arch_foot'), ('ya_p03_ic_basic_qs'), ('ya_p03_ic_blood_pressure'), ('ya_p03_ic_braces_piercing_iud'), ('ya_p03_ic_cognition_test'), ('ya_p03_ic_da_health_registry'), ('ya_p03_ic_dexa'), ('ya_p03_ic_enviro_qs'), ('ya_p03_ic_follow_up_studies'), ('ya_p03_ic_fracture_lower_body_last_3m'), ('ya_p03_ic_fracture_upper_body_last_3m'), ('ya_p03_ic_hand_grip'), ('ya_p03_ic_hearing_vision_impairment'), ('ya_p03_ic_heart_disease'), ('ya_p03_ic_hemoptysis_ns'), ('ya_p03_ic_hernia'), ('ya_p03_ic_hyperthyroidism'), ('ya_p03_ic_inability_hold_pencil'), ('ya_p03_ic_inability_stand_both_legs'), ('ya_p03_ic_inability_talk_cze'), ('ya_p03_ic_inability_walk'), ('ya_p03_ic_inbody'), ('ya_p03_ic_infectious_resp_diseases'), ('ya_p03_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p03_ic_knee_stability'), ('ya_p03_ic_nutri_qs'), ('ya_p03_ic_over_weight_200_height_195'), ('ya_p03_ic_pacemaker_defibrillator'), ('ya_p03_ic_pneumothorax'), ('ya_p03_ic_pregnancy'), ('ya_p03_ic_recent_eye_abdominal_chest_surgery'), ('ya_p03_ic_recent_myocardial_infarction'), ('ya_p03_ic_spirometry'), ('ya_p03_ic_surgical_metal_body'), ('ya_p03_ic_unstable_angina_pectoris'), ('ya_p03_ic_ya_dl_elspac'), ('ya_p03_ic_ya_med_find'), ('ya_p03_ic_ya_newsletter') $$ ) AS extra_state ("subject_id" int, "ya_p03_ic_anam_qs" text, "ya_p03_ic_aneurysm" text, "ya_p03_ic_anthropometry" text, "ya_p03_ic_arch_foot" text, "ya_p03_ic_basic_qs" text, "ya_p03_ic_blood_pressure" text, "ya_p03_ic_braces_piercing_iud" text, "ya_p03_ic_cognition_test" text, "ya_p03_ic_da_health_registry" text, "ya_p03_ic_dexa" text, "ya_p03_ic_enviro_qs" text, "ya_p03_ic_follow_up_studies" text, "ya_p03_ic_fracture_lower_body_last_3m" text, "ya_p03_ic_fracture_upper_body_last_3m" text, "ya_p03_ic_hand_grip" text, "ya_p03_ic_hearing_vision_impairment" text, "ya_p03_ic_heart_disease" text, "ya_p03_ic_hemoptysis_ns" text, "ya_p03_ic_hernia" text, "ya_p03_ic_hyperthyroidism" text, "ya_p03_ic_inability_hold_pencil" text, "ya_p03_ic_inability_stand_both_legs" text, "ya_p03_ic_inability_talk_cze" text, "ya_p03_ic_inability_walk" text, "ya_p03_ic_inbody" text, "ya_p03_ic_infectious_resp_diseases" text, "ya_p03_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p03_ic_knee_stability" text, "ya_p03_ic_nutri_qs" text, "ya_p03_ic_over_weight_200_height_195" text, "ya_p03_ic_pacemaker_defibrillator" text, "ya_p03_ic_pneumothorax" text, "ya_p03_ic_pregnancy" text, "ya_p03_ic_recent_eye_abdominal_chest_surgery" text, "ya_p03_ic_recent_myocardial_infarction" text, "ya_p03_ic_spirometry" text, "ya_p03_ic_surgical_metal_body" text, "ya_p03_ic_unstable_angina_pectoris" text, "ya_p03_ic_ya_dl_elspac" text, "ya_p03_ic_ya_med_find" text, "ya_p03_ic_ya_newsletter" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p03__role, psc_role.psycap_p02_new_ya_p03__role, psc_role.psycap_p02_old_ya_p03__role, psc_role.ya_p03__role, psc_role.ya_p03_digi_ya03v2__role, psc_role.ya_p03_digi_ya04v2__role, psc_role.ya_p03_digi_ya05v2__role, psc_state.psycap_p01_ya_p03__state, psc_state.psycap_p02_new_ya_p03__state, psc_state.psycap_p02_old_ya_p03__state, psc_state.ya_p03__state, psc_state.ya_p03_digi_ya03v2__state, psc_state.ya_p03_digi_ya04v2__state, psc_state.ya_p03_digi_ya05v2__state, psc_activity_state.psycap_p01_ya_p03__activity_state, psc_activity_state.psycap_p02_new_ya_p03__activity_state, psc_activity_state.psycap_p02_old_ya_p03__activity_state, psc_activity_state.ya_p03__activity_state, psc_activity_state.ya_p03_digi_ya03v2__activity_state, psc_activity_state.ya_p03_digi_ya04v2__activity_state, psc_activity_state.ya_p03_digi_ya05v2__activity_state, psc_created_at.psycap_p01_ya_p03__created_at, psc_created_at.psycap_p02_new_ya_p03__created_at, psc_created_at.psycap_p02_old_ya_p03__created_at, psc_created_at.ya_p03__created_at, psc_created_at.ya_p03_digi_ya03v2__created_at, psc_created_at.ya_p03_digi_ya04v2__created_at, psc_created_at.ya_p03_digi_ya05v2__created_at, psc_accepted_at.psycap_p01_ya_p03__accepted_at, psc_accepted_at.psycap_p02_new_ya_p03__accepted_at, psc_accepted_at.psycap_p02_old_ya_p03__accepted_at, psc_accepted_at.ya_p03__accepted_at, psc_accepted_at.ya_p03_digi_ya03v2__accepted_at, psc_accepted_at.ya_p03_digi_ya04v2__accepted_at, psc_accepted_at.ya_p03_digi_ya05v2__accepted_at, psc_cancelled_at.psycap_p01_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_new_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p03__cancelled_at, psc_cancelled_at.ya_p03__cancelled_at, psc_cancelled_at.ya_p03_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya05v2__cancelled_at, psc_revoked_at.psycap_p01_ya_p03__revoked_at, psc_revoked_at.psycap_p02_new_ya_p03__revoked_at, psc_revoked_at.psycap_p02_old_ya_p03__revoked_at, psc_revoked_at.ya_p03__revoked_at, psc_revoked_at.ya_p03_digi_ya03v2__revoked_at, psc_revoked_at.ya_p03_digi_ya04v2__revoked_at, psc_revoked_at.ya_p03_digi_ya05v2__revoked_at, psc_paused_at.psycap_p01_ya_p03__paused_at, psc_paused_at.psycap_p02_new_ya_p03__paused_at, psc_paused_at.psycap_p02_old_ya_p03__paused_at, psc_paused_at.ya_p03__paused_at, psc_paused_at.ya_p03_digi_ya03v2__paused_at, psc_paused_at.ya_p03_digi_ya04v2__paused_at, psc_paused_at.ya_p03_digi_ya05v2__paused_at, ya_p03_ic_buccal_swab_proband, ya_p03_ic_urine_proband, ya_p03_ic_venous_blood_proband, ya_p03_ic_anam_qs, ya_p03_ic_aneurysm, ya_p03_ic_anthropometry, ya_p03_ic_arch_foot, ya_p03_ic_basic_qs, ya_p03_ic_blood_pressure, ya_p03_ic_braces_piercing_iud, ya_p03_ic_cognition_test, ya_p03_ic_da_health_registry, ya_p03_ic_dexa, ya_p03_ic_enviro_qs, ya_p03_ic_follow_up_studies, ya_p03_ic_fracture_lower_body_last_3m, ya_p03_ic_fracture_upper_body_last_3m, ya_p03_ic_hand_grip, ya_p03_ic_hearing_vision_impairment, ya_p03_ic_heart_disease, ya_p03_ic_hemoptysis_ns, ya_p03_ic_hernia, ya_p03_ic_hyperthyroidism, ya_p03_ic_inability_hold_pencil, ya_p03_ic_inability_stand_both_legs, ya_p03_ic_inability_talk_cze, ya_p03_ic_inability_walk, ya_p03_ic_inbody, ya_p03_ic_infectious_resp_diseases, ya_p03_ic_iodine_barium_radioisotopes_last_7d, ya_p03_ic_knee_stability, ya_p03_ic_nutri_qs, ya_p03_ic_over_weight_200_height_195, ya_p03_ic_pacemaker_defibrillator, ya_p03_ic_pneumothorax, ya_p03_ic_pregnancy, ya_p03_ic_recent_eye_abdominal_chest_surgery, ya_p03_ic_recent_myocardial_infarction, ya_p03_ic_spirometry, ya_p03_ic_surgical_metal_body, ya_p03_ic_unstable_angina_pectoris, ya_p03_ic_ya_dl_elspac, ya_p03_ic_ya_med_find, ya_p03_ic_ya_newsletter FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 21 -- Pilot ID );[ Date: 2025-11-27 05:02:35 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
4 10s659ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__18"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__18__dbt_tmp" as ( -- suject (proband) patrici do kohorty HBA, Pilot ID: 18 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS role ("subject_id" int, "hba_p01__role" text, "psycap_p01_hba_p01__role" text, "psycap_p02_new_hba_p01__role" text, "psycap_p02_old_hba_p01__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS role ("subject_id" int, "hba_p01__state" text, "psycap_p01_hba_p01__state" text, "psycap_p02_new_hba_p01__state" text, "psycap_p02_old_hba_p01__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS activity ("subject_id" int, "hba_p01__activity_state" text, "psycap_p01_hba_p01__activity_state" text, "psycap_p02_new_hba_p01__activity_state" text, "psycap_p02_old_hba_p01__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS created_at ("subject_id" int, "hba_p01__created_at" text, "psycap_p01_hba_p01__created_at" text, "psycap_p02_new_hba_p01__created_at" text, "psycap_p02_old_hba_p01__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS accepted_at ("subject_id" int, "hba_p01__accepted_at" text, "psycap_p01_hba_p01__accepted_at" text, "psycap_p02_new_hba_p01__accepted_at" text, "psycap_p02_old_hba_p01__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS cancelled_at ("subject_id" int, "hba_p01__cancelled_at" text, "psycap_p01_hba_p01__cancelled_at" text, "psycap_p02_new_hba_p01__cancelled_at" text, "psycap_p02_old_hba_p01__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS revoked_at ("subject_id" int, "hba_p01__revoked_at" text, "psycap_p01_hba_p01__revoked_at" text, "psycap_p02_new_hba_p01__revoked_at" text, "psycap_p02_old_hba_p01__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS paused_at ("subject_id" int, "hba_p01__paused_at" text, "psycap_p01_hba_p01__paused_at" text, "psycap_p02_new_hba_p01__paused_at" text, "psycap_p02_old_hba_p01__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01_ic_buccal_swab_proband'), ('hba_p01_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "hba_p01_ic_buccal_swab_proband" text, "hba_p01_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01_ic_anthropometry'), ('hba_p01_ic_blood_pressure'), ('hba_p01_ic_da_health_registry'), ('hba_p01_ic_dl_elspac'), ('hba_p01_ic_dl_hba_future_studies'), ('hba_p01_ic_dl_tng'), ('hba_p01_ic_dl_tooth'), ('hba_p01_ic_dl_vulde'), ('hba_p01_ic_dl_ya'), ('hba_p01_ic_hba_med_find'), ('hba_p01_ic_hba_newsletter'), ('hba_p01_ic_mri'), ('hba_p01_ic_spirometry'), ('hba_p01_ic_survey') $$ ) AS extra_state ("subject_id" int, "hba_p01_ic_anthropometry" text, "hba_p01_ic_blood_pressure" text, "hba_p01_ic_da_health_registry" text, "hba_p01_ic_dl_elspac" text, "hba_p01_ic_dl_hba_future_studies" text, "hba_p01_ic_dl_tng" text, "hba_p01_ic_dl_tooth" text, "hba_p01_ic_dl_vulde" text, "hba_p01_ic_dl_ya" text, "hba_p01_ic_hba_med_find" text, "hba_p01_ic_hba_newsletter" text, "hba_p01_ic_mri" text, "hba_p01_ic_spirometry" text, "hba_p01_ic_survey" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.hba_p01__role, psc_role.psycap_p01_hba_p01__role, psc_role.psycap_p02_new_hba_p01__role, psc_role.psycap_p02_old_hba_p01__role, psc_state.hba_p01__state, psc_state.psycap_p01_hba_p01__state, psc_state.psycap_p02_new_hba_p01__state, psc_state.psycap_p02_old_hba_p01__state, psc_activity_state.hba_p01__activity_state, psc_activity_state.psycap_p01_hba_p01__activity_state, psc_activity_state.psycap_p02_new_hba_p01__activity_state, psc_activity_state.psycap_p02_old_hba_p01__activity_state, psc_created_at.hba_p01__created_at, psc_created_at.psycap_p01_hba_p01__created_at, psc_created_at.psycap_p02_new_hba_p01__created_at, psc_created_at.psycap_p02_old_hba_p01__created_at, psc_accepted_at.hba_p01__accepted_at, psc_accepted_at.psycap_p01_hba_p01__accepted_at, psc_accepted_at.psycap_p02_new_hba_p01__accepted_at, psc_accepted_at.psycap_p02_old_hba_p01__accepted_at, psc_cancelled_at.hba_p01__cancelled_at, psc_cancelled_at.psycap_p01_hba_p01__cancelled_at, psc_cancelled_at.psycap_p02_new_hba_p01__cancelled_at, psc_cancelled_at.psycap_p02_old_hba_p01__cancelled_at, psc_revoked_at.hba_p01__revoked_at, psc_revoked_at.psycap_p01_hba_p01__revoked_at, psc_revoked_at.psycap_p02_new_hba_p01__revoked_at, psc_revoked_at.psycap_p02_old_hba_p01__revoked_at, psc_paused_at.hba_p01__paused_at, psc_paused_at.psycap_p01_hba_p01__paused_at, psc_paused_at.psycap_p02_new_hba_p01__paused_at, psc_paused_at.psycap_p02_old_hba_p01__paused_at, hba_p01_ic_buccal_swab_proband, hba_p01_ic_venous_blood_proband, hba_p01_ic_anthropometry, hba_p01_ic_blood_pressure, hba_p01_ic_da_health_registry, hba_p01_ic_dl_elspac, hba_p01_ic_dl_hba_future_studies, hba_p01_ic_dl_tng, hba_p01_ic_dl_tooth, hba_p01_ic_dl_vulde, hba_p01_ic_dl_ya, hba_p01_ic_hba_med_find, hba_p01_ic_hba_newsletter, hba_p01_ic_mri, hba_p01_ic_spirometry, hba_p01_ic_survey FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 18 -- Pilot ID );[ Date: 2025-11-27 05:02:34 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
5 10s415ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__20"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__20__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: TNG, Pilot ID: 20 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p11__role" text, "tng_p11__role" text, "tng_p11_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p11__state" text, "tng_p11__state" text, "tng_p11_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p11__activity_state" text, "tng_p11__activity_state" text, "tng_p11_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p11__created_at" text, "tng_p11__created_at" text, "tng_p11_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p11__accepted_at" text, "tng_p11__accepted_at" text, "tng_p11_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p11__cancelled_at" text, "tng_p11__cancelled_at" text, "tng_p11_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p11__revoked_at" text, "tng_p11__revoked_at" text, "tng_p11_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p11__paused_at" text, "tng_p11__paused_at" text, "tng_p11_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11_ic_dust_mother'), ('tng_p11_ic_buccal_swab_child'), ('tng_p11_ic_buccal_swab_mother'), ('tng_p11_ic_cord_blood_mother'), ('tng_p11_ic_drop_blood_child'), ('tng_p11_ic_stool_child'), ('tng_p11_ic_urine_mother'), ('tng_p11_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p11_ic_dust_mother" text, "tng_p11_ic_buccal_swab_child" text, "tng_p11_ic_buccal_swab_mother" text, "tng_p11_ic_cord_blood_mother" text, "tng_p11_ic_drop_blood_child" text, "tng_p11_ic_stool_child" text, "tng_p11_ic_urine_mother" text, "tng_p11_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11_ic_dl_celpac_studies'), ('dust_p01_tng_p11_ic_survey'), ('tng_p11_ic_celspac_newsletter'), ('tng_p11_ic_dl_celpac_studies'), ('tng_p11_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p11_ic_dl_celpac_studies" text, "dust_p01_tng_p11_ic_survey" text, "tng_p11_ic_celspac_newsletter" text, "tng_p11_ic_dl_celpac_studies" text, "tng_p11_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p11__role, psc_role.tng_p11__role, psc_role.tng_p11_monitor__role, psc_state.dust_p01_tng_p11__state, psc_state.tng_p11__state, psc_state.tng_p11_monitor__state, psc_activity_state.dust_p01_tng_p11__activity_state, psc_activity_state.tng_p11__activity_state, psc_activity_state.tng_p11_monitor__activity_state, psc_created_at.dust_p01_tng_p11__created_at, psc_created_at.tng_p11__created_at, psc_created_at.tng_p11_monitor__created_at, psc_accepted_at.dust_p01_tng_p11__accepted_at, psc_accepted_at.tng_p11__accepted_at, psc_accepted_at.tng_p11_monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p11__cancelled_at, psc_cancelled_at.tng_p11__cancelled_at, psc_cancelled_at.tng_p11_monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p11__revoked_at, psc_revoked_at.tng_p11__revoked_at, psc_revoked_at.tng_p11_monitor__revoked_at, psc_paused_at.dust_p01_tng_p11__paused_at, psc_paused_at.tng_p11__paused_at, psc_paused_at.tng_p11_monitor__paused_at, dust_p01_tng_p11_ic_dust_mother, tng_p11_ic_buccal_swab_child, tng_p11_ic_buccal_swab_mother, tng_p11_ic_cord_blood_mother, tng_p11_ic_drop_blood_child, tng_p11_ic_stool_child, tng_p11_ic_urine_mother, tng_p11_ic_venous_blood_mother, dust_p01_tng_p11_ic_dl_celpac_studies, dust_p01_tng_p11_ic_survey, tng_p11_ic_celspac_newsletter, tng_p11_ic_dl_celpac_studies, tng_p11_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 20 -- Pilot ID );[ Date: 2025-11-27 05:02:34 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
6 5s886ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__26"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__26__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... TNG Pilot XIII, Pilot ID: 26 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS role ("subject_id" int, "tng_p13__role" text, "tng_p13_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS role ("subject_id" int, "tng_p13__state" text, "tng_p13_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS activity ("subject_id" int, "tng_p13__activity_state" text, "tng_p13_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS created_at ("subject_id" int, "tng_p13__created_at" text, "tng_p13_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p13__accepted_at" text, "tng_p13_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p13__cancelled_at" text, "tng_p13_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p13__revoked_at" text, "tng_p13_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS paused_at ("subject_id" int, "tng_p13__paused_at" text, "tng_p13_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13_ic_buccal_swab_child'), ('tng_p13_ic_buccal_swab_mother'), ('tng_p13_ic_cord_blood_child'), ('tng_p13_ic_drop_blood_child'), ('tng_p13_ic_stool_child'), ('tng_p13_ic_urine_mother'), ('tng_p13_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p13_ic_buccal_swab_child" text, "tng_p13_ic_buccal_swab_mother" text, "tng_p13_ic_cord_blood_child" text, "tng_p13_ic_drop_blood_child" text, "tng_p13_ic_stool_child" text, "tng_p13_ic_urine_mother" text, "tng_p13_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13_ic_celspac_newsletter'), ('tng_p13_ic_dl_celpac_studies'), ('tng_p13_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p13_ic_celspac_newsletter" text, "tng_p13_ic_dl_celpac_studies" text, "tng_p13_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p13__role, psc_role.tng_p13_monitor__role, psc_state.tng_p13__state, psc_state.tng_p13_monitor__state, psc_activity_state.tng_p13__activity_state, psc_activity_state.tng_p13_monitor__activity_state, psc_created_at.tng_p13__created_at, psc_created_at.tng_p13_monitor__created_at, psc_accepted_at.tng_p13__accepted_at, psc_accepted_at.tng_p13_monitor__accepted_at, psc_cancelled_at.tng_p13__cancelled_at, psc_cancelled_at.tng_p13_monitor__cancelled_at, psc_revoked_at.tng_p13__revoked_at, psc_revoked_at.tng_p13_monitor__revoked_at, psc_paused_at.tng_p13__paused_at, psc_paused_at.tng_p13_monitor__paused_at, tng_p13_ic_buccal_swab_child, tng_p13_ic_buccal_swab_mother, tng_p13_ic_cord_blood_child, tng_p13_ic_drop_blood_child, tng_p13_ic_stool_child, tng_p13_ic_urine_mother, tng_p13_ic_venous_blood_mother, tng_p13_ic_celspac_newsletter, tng_p13_ic_dl_celpac_studies, tng_p13_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 26 -- Pilot ID );[ Date: 2025-11-27 17:02:37 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
7 5s602ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__27"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__27__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... HAPIEE Pilot II, Pilot ID: 27 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS activity ("subject_id" int, "hapiee_p02__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS created_at ("subject_id" int, "hapiee_p02__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS accepted_at ("subject_id" int, "hapiee_p02__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS cancelled_at ("subject_id" int, "hapiee_p02__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS revoked_at ("subject_id" int, "hapiee_p02__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS paused_at ("subject_id" int, "hapiee_p02__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "hapiee_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_dl_hapiee'), ('hapiee_p02_ic_dl_statistics'), ('hapiee_p02_ic_examination'), ('hapiee_p02_ic_health_qs'), ('hapiee_p02_ic_samples_storage') $$ ) AS extra_state ("subject_id" int, "hapiee_p02_ic_dl_hapiee" text, "hapiee_p02_ic_dl_statistics" text, "hapiee_p02_ic_examination" text, "hapiee_p02_ic_health_qs" text, "hapiee_p02_ic_samples_storage" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.hapiee_p02__role, psc_state.hapiee_p02__state, psc_activity_state.hapiee_p02__activity_state, psc_created_at.hapiee_p02__created_at, psc_accepted_at.hapiee_p02__accepted_at, psc_cancelled_at.hapiee_p02__cancelled_at, psc_revoked_at.hapiee_p02__revoked_at, psc_paused_at.hapiee_p02__paused_at, hapiee_p02_ic_venous_blood_proband, hapiee_p02_ic_dl_hapiee, hapiee_p02_ic_dl_statistics, hapiee_p02_ic_examination, hapiee_p02_ic_health_qs, hapiee_p02_ic_samples_storage FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 27 -- Pilot ID );[ Date: 2025-11-27 17:02:37 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
8 5s81ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__26"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__26__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... TNG Pilot XIII, Pilot ID: 26 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS role ("subject_id" int, "tng_p13__role" text, "tng_p13_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS role ("subject_id" int, "tng_p13__state" text, "tng_p13_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS activity ("subject_id" int, "tng_p13__activity_state" text, "tng_p13_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS created_at ("subject_id" int, "tng_p13__created_at" text, "tng_p13_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p13__accepted_at" text, "tng_p13_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p13__cancelled_at" text, "tng_p13_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p13__revoked_at" text, "tng_p13_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS paused_at ("subject_id" int, "tng_p13__paused_at" text, "tng_p13_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13_ic_buccal_swab_child'), ('tng_p13_ic_buccal_swab_mother'), ('tng_p13_ic_cord_blood_child'), ('tng_p13_ic_drop_blood_child'), ('tng_p13_ic_stool_child'), ('tng_p13_ic_urine_mother'), ('tng_p13_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p13_ic_buccal_swab_child" text, "tng_p13_ic_buccal_swab_mother" text, "tng_p13_ic_cord_blood_child" text, "tng_p13_ic_drop_blood_child" text, "tng_p13_ic_stool_child" text, "tng_p13_ic_urine_mother" text, "tng_p13_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13_ic_celspac_newsletter'), ('tng_p13_ic_dl_celpac_studies'), ('tng_p13_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p13_ic_celspac_newsletter" text, "tng_p13_ic_dl_celpac_studies" text, "tng_p13_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p13__role, psc_role.tng_p13_monitor__role, psc_state.tng_p13__state, psc_state.tng_p13_monitor__state, psc_activity_state.tng_p13__activity_state, psc_activity_state.tng_p13_monitor__activity_state, psc_created_at.tng_p13__created_at, psc_created_at.tng_p13_monitor__created_at, psc_accepted_at.tng_p13__accepted_at, psc_accepted_at.tng_p13_monitor__accepted_at, psc_cancelled_at.tng_p13__cancelled_at, psc_cancelled_at.tng_p13_monitor__cancelled_at, psc_revoked_at.tng_p13__revoked_at, psc_revoked_at.tng_p13_monitor__revoked_at, psc_paused_at.tng_p13__paused_at, psc_paused_at.tng_p13_monitor__paused_at, tng_p13_ic_buccal_swab_child, tng_p13_ic_buccal_swab_mother, tng_p13_ic_cord_blood_child, tng_p13_ic_drop_blood_child, tng_p13_ic_stool_child, tng_p13_ic_urine_mother, tng_p13_ic_venous_blood_mother, tng_p13_ic_celspac_newsletter, tng_p13_ic_dl_celpac_studies, tng_p13_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 26 -- Pilot ID );[ Date: 2025-11-27 05:02:34 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
9 4s907ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__27"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__27__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... HAPIEE Pilot II, Pilot ID: 27 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS activity ("subject_id" int, "hapiee_p02__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS created_at ("subject_id" int, "hapiee_p02__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS accepted_at ("subject_id" int, "hapiee_p02__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS cancelled_at ("subject_id" int, "hapiee_p02__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS revoked_at ("subject_id" int, "hapiee_p02__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS paused_at ("subject_id" int, "hapiee_p02__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "hapiee_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_dl_hapiee'), ('hapiee_p02_ic_dl_statistics'), ('hapiee_p02_ic_examination'), ('hapiee_p02_ic_health_qs'), ('hapiee_p02_ic_samples_storage') $$ ) AS extra_state ("subject_id" int, "hapiee_p02_ic_dl_hapiee" text, "hapiee_p02_ic_dl_statistics" text, "hapiee_p02_ic_examination" text, "hapiee_p02_ic_health_qs" text, "hapiee_p02_ic_samples_storage" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.hapiee_p02__role, psc_state.hapiee_p02__state, psc_activity_state.hapiee_p02__activity_state, psc_created_at.hapiee_p02__created_at, psc_accepted_at.hapiee_p02__accepted_at, psc_cancelled_at.hapiee_p02__cancelled_at, psc_revoked_at.hapiee_p02__revoked_at, psc_paused_at.hapiee_p02__paused_at, hapiee_p02_ic_venous_blood_proband, hapiee_p02_ic_dl_hapiee, hapiee_p02_ic_dl_statistics, hapiee_p02_ic_examination, hapiee_p02_ic_health_qs, hapiee_p02_ic_samples_storage FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 27 -- Pilot ID );[ Date: 2025-11-27 05:02:34 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
10 4s738ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-11-27 05:02:28 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
11 3s62ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__17"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__17__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot X, Pilot ID: 17 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__role" text, "tng__monitor__role" text, "tng_p10__role" text, "tng_p10_test_tp__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__state" text, "tng__monitor__state" text, "tng_p10__state" text, "tng_p10_test_tp__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p10__activity_state" text, "tng__monitor__activity_state" text, "tng_p10__activity_state" text, "tng_p10_test_tp__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p10__created_at" text, "tng__monitor__created_at" text, "tng_p10__created_at" text, "tng_p10_test_tp__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p10__accepted_at" text, "tng__monitor__accepted_at" text, "tng_p10__accepted_at" text, "tng_p10_test_tp__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p10__cancelled_at" text, "tng__monitor__cancelled_at" text, "tng_p10__cancelled_at" text, "tng_p10_test_tp__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p10__revoked_at" text, "tng__monitor__revoked_at" text, "tng_p10__revoked_at" text, "tng_p10_test_tp__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p10__paused_at" text, "tng__monitor__paused_at" text, "tng_p10__paused_at" text, "tng_p10_test_tp__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dust_mother'), ('tng_p10_ic_buccal_swab_child'), ('tng_p10_ic_buccal_swab_mother'), ('tng_p10_ic_cord_blood_mother'), ('tng_p10_ic_drop_blood_child'), ('tng_p10_ic_stool_child'), ('tng_p10_ic_urine_mother'), ('tng_p10_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p10_ic_dust_mother" text, "tng_p10_ic_buccal_swab_child" text, "tng_p10_ic_buccal_swab_mother" text, "tng_p10_ic_cord_blood_mother" text, "tng_p10_ic_drop_blood_child" text, "tng_p10_ic_stool_child" text, "tng_p10_ic_urine_mother" text, "tng_p10_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dl_celpac_studies'), ('dust_p01_tng_p10_ic_survey'), ('tng_p10_ic_follow_up_studies'), ('tng_p10_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p10_ic_dl_celpac_studies" text, "dust_p01_tng_p10_ic_survey" text, "tng_p10_ic_follow_up_studies" text, "tng_p10_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p10__role, psc_role.tng__monitor__role, psc_role.tng_p10__role, psc_role.tng_p10_test_tp__role, psc_state.dust_p01_tng_p10__state, psc_state.tng__monitor__state, psc_state.tng_p10__state, psc_state.tng_p10_test_tp__state, psc_activity_state.dust_p01_tng_p10__activity_state, psc_activity_state.tng__monitor__activity_state, psc_activity_state.tng_p10__activity_state, psc_activity_state.tng_p10_test_tp__activity_state, psc_created_at.dust_p01_tng_p10__created_at, psc_created_at.tng__monitor__created_at, psc_created_at.tng_p10__created_at, psc_created_at.tng_p10_test_tp__created_at, psc_accepted_at.dust_p01_tng_p10__accepted_at, psc_accepted_at.tng__monitor__accepted_at, psc_accepted_at.tng_p10__accepted_at, psc_accepted_at.tng_p10_test_tp__accepted_at, psc_cancelled_at.dust_p01_tng_p10__cancelled_at, psc_cancelled_at.tng__monitor__cancelled_at, psc_cancelled_at.tng_p10__cancelled_at, psc_cancelled_at.tng_p10_test_tp__cancelled_at, psc_revoked_at.dust_p01_tng_p10__revoked_at, psc_revoked_at.tng__monitor__revoked_at, psc_revoked_at.tng_p10__revoked_at, psc_revoked_at.tng_p10_test_tp__revoked_at, psc_paused_at.dust_p01_tng_p10__paused_at, psc_paused_at.tng__monitor__paused_at, psc_paused_at.tng_p10__paused_at, psc_paused_at.tng_p10_test_tp__paused_at, dust_p01_tng_p10_ic_dust_mother, tng_p10_ic_buccal_swab_child, tng_p10_ic_buccal_swab_mother, tng_p10_ic_cord_blood_mother, tng_p10_ic_drop_blood_child, tng_p10_ic_stool_child, tng_p10_ic_urine_mother, tng_p10_ic_venous_blood_mother, dust_p01_tng_p10_ic_dl_celpac_studies, dust_p01_tng_p10_ic_survey, tng_p10_ic_follow_up_studies, tng_p10_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 17 -- Pilot ID );[ Date: 2025-11-27 17:02:27 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
12 2s853ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__20"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__20__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: TNG, Pilot ID: 20 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p11__role" text, "tng_p11__role" text, "tng_p11_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p11__state" text, "tng_p11__state" text, "tng_p11_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p11__activity_state" text, "tng_p11__activity_state" text, "tng_p11_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p11__created_at" text, "tng_p11__created_at" text, "tng_p11_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p11__accepted_at" text, "tng_p11__accepted_at" text, "tng_p11_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p11__cancelled_at" text, "tng_p11__cancelled_at" text, "tng_p11_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p11__revoked_at" text, "tng_p11__revoked_at" text, "tng_p11_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p11__paused_at" text, "tng_p11__paused_at" text, "tng_p11_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11_ic_dust_mother'), ('tng_p11_ic_buccal_swab_child'), ('tng_p11_ic_buccal_swab_mother'), ('tng_p11_ic_cord_blood_mother'), ('tng_p11_ic_drop_blood_child'), ('tng_p11_ic_stool_child'), ('tng_p11_ic_urine_mother'), ('tng_p11_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p11_ic_dust_mother" text, "tng_p11_ic_buccal_swab_child" text, "tng_p11_ic_buccal_swab_mother" text, "tng_p11_ic_cord_blood_mother" text, "tng_p11_ic_drop_blood_child" text, "tng_p11_ic_stool_child" text, "tng_p11_ic_urine_mother" text, "tng_p11_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11_ic_dl_celpac_studies'), ('dust_p01_tng_p11_ic_survey'), ('tng_p11_ic_celspac_newsletter'), ('tng_p11_ic_dl_celpac_studies'), ('tng_p11_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p11_ic_dl_celpac_studies" text, "dust_p01_tng_p11_ic_survey" text, "tng_p11_ic_celspac_newsletter" text, "tng_p11_ic_dl_celpac_studies" text, "tng_p11_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p11__role, psc_role.tng_p11__role, psc_role.tng_p11_monitor__role, psc_state.dust_p01_tng_p11__state, psc_state.tng_p11__state, psc_state.tng_p11_monitor__state, psc_activity_state.dust_p01_tng_p11__activity_state, psc_activity_state.tng_p11__activity_state, psc_activity_state.tng_p11_monitor__activity_state, psc_created_at.dust_p01_tng_p11__created_at, psc_created_at.tng_p11__created_at, psc_created_at.tng_p11_monitor__created_at, psc_accepted_at.dust_p01_tng_p11__accepted_at, psc_accepted_at.tng_p11__accepted_at, psc_accepted_at.tng_p11_monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p11__cancelled_at, psc_cancelled_at.tng_p11__cancelled_at, psc_cancelled_at.tng_p11_monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p11__revoked_at, psc_revoked_at.tng_p11__revoked_at, psc_revoked_at.tng_p11_monitor__revoked_at, psc_paused_at.dust_p01_tng_p11__paused_at, psc_paused_at.tng_p11__paused_at, psc_paused_at.tng_p11_monitor__paused_at, dust_p01_tng_p11_ic_dust_mother, tng_p11_ic_buccal_swab_child, tng_p11_ic_buccal_swab_mother, tng_p11_ic_cord_blood_mother, tng_p11_ic_drop_blood_child, tng_p11_ic_stool_child, tng_p11_ic_urine_mother, tng_p11_ic_venous_blood_mother, dust_p01_tng_p11_ic_dl_celpac_studies, dust_p01_tng_p11_ic_survey, tng_p11_ic_celspac_newsletter, tng_p11_ic_dl_celpac_studies, tng_p11_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 20 -- Pilot ID );[ Date: 2025-11-27 17:02:30 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
13 2s424ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__22"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__22__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: TNG (nabor od 29.4.2022), Pilot ID: 22 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS role ("subject_id" int, "tng_p12__role" text, "tng_p12_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS role ("subject_id" int, "tng_p12__state" text, "tng_p12_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS activity ("subject_id" int, "tng_p12__activity_state" text, "tng_p12_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS created_at ("subject_id" int, "tng_p12__created_at" text, "tng_p12_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p12__accepted_at" text, "tng_p12_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p12__cancelled_at" text, "tng_p12_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p12__revoked_at" text, "tng_p12_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS paused_at ("subject_id" int, "tng_p12__paused_at" text, "tng_p12_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12_ic_buccal_swab_child'), ('tng_p12_ic_buccal_swab_mother'), ('tng_p12_ic_cord_blood_mother'), ('tng_p12_ic_drop_blood_child'), ('tng_p12_ic_stool_child'), ('tng_p12_ic_urine_mother'), ('tng_p12_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p12_ic_buccal_swab_child" text, "tng_p12_ic_buccal_swab_mother" text, "tng_p12_ic_cord_blood_mother" text, "tng_p12_ic_drop_blood_child" text, "tng_p12_ic_stool_child" text, "tng_p12_ic_urine_mother" text, "tng_p12_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12_ic_celspac_newsletter'), ('tng_p12_ic_dl_celpac_studies'), ('tng_p12_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p12_ic_celspac_newsletter" text, "tng_p12_ic_dl_celpac_studies" text, "tng_p12_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p12__role, psc_role.tng_p12_monitor__role, psc_state.tng_p12__state, psc_state.tng_p12_monitor__state, psc_activity_state.tng_p12__activity_state, psc_activity_state.tng_p12_monitor__activity_state, psc_created_at.tng_p12__created_at, psc_created_at.tng_p12_monitor__created_at, psc_accepted_at.tng_p12__accepted_at, psc_accepted_at.tng_p12_monitor__accepted_at, psc_cancelled_at.tng_p12__cancelled_at, psc_cancelled_at.tng_p12_monitor__cancelled_at, psc_revoked_at.tng_p12__revoked_at, psc_revoked_at.tng_p12_monitor__revoked_at, psc_paused_at.tng_p12__paused_at, psc_paused_at.tng_p12_monitor__paused_at, tng_p12_ic_buccal_swab_child, tng_p12_ic_buccal_swab_mother, tng_p12_ic_cord_blood_mother, tng_p12_ic_drop_blood_child, tng_p12_ic_stool_child, tng_p12_ic_urine_mother, tng_p12_ic_venous_blood_mother, tng_p12_ic_celspac_newsletter, tng_p12_ic_dl_celpac_studies, tng_p12_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 22 -- Pilot ID );[ Date: 2025-11-27 17:02:29 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
14 2s399ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__17"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__17__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot X, Pilot ID: 17 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__role" text, "tng__monitor__role" text, "tng_p10__role" text, "tng_p10_test_tp__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__state" text, "tng__monitor__state" text, "tng_p10__state" text, "tng_p10_test_tp__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p10__activity_state" text, "tng__monitor__activity_state" text, "tng_p10__activity_state" text, "tng_p10_test_tp__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p10__created_at" text, "tng__monitor__created_at" text, "tng_p10__created_at" text, "tng_p10_test_tp__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p10__accepted_at" text, "tng__monitor__accepted_at" text, "tng_p10__accepted_at" text, "tng_p10_test_tp__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p10__cancelled_at" text, "tng__monitor__cancelled_at" text, "tng_p10__cancelled_at" text, "tng_p10_test_tp__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p10__revoked_at" text, "tng__monitor__revoked_at" text, "tng_p10__revoked_at" text, "tng_p10_test_tp__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p10__paused_at" text, "tng__monitor__paused_at" text, "tng_p10__paused_at" text, "tng_p10_test_tp__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dust_mother'), ('tng_p10_ic_buccal_swab_child'), ('tng_p10_ic_buccal_swab_mother'), ('tng_p10_ic_cord_blood_mother'), ('tng_p10_ic_drop_blood_child'), ('tng_p10_ic_stool_child'), ('tng_p10_ic_urine_mother'), ('tng_p10_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p10_ic_dust_mother" text, "tng_p10_ic_buccal_swab_child" text, "tng_p10_ic_buccal_swab_mother" text, "tng_p10_ic_cord_blood_mother" text, "tng_p10_ic_drop_blood_child" text, "tng_p10_ic_stool_child" text, "tng_p10_ic_urine_mother" text, "tng_p10_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dl_celpac_studies'), ('dust_p01_tng_p10_ic_survey'), ('tng_p10_ic_follow_up_studies'), ('tng_p10_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p10_ic_dl_celpac_studies" text, "dust_p01_tng_p10_ic_survey" text, "tng_p10_ic_follow_up_studies" text, "tng_p10_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p10__role, psc_role.tng__monitor__role, psc_role.tng_p10__role, psc_role.tng_p10_test_tp__role, psc_state.dust_p01_tng_p10__state, psc_state.tng__monitor__state, psc_state.tng_p10__state, psc_state.tng_p10_test_tp__state, psc_activity_state.dust_p01_tng_p10__activity_state, psc_activity_state.tng__monitor__activity_state, psc_activity_state.tng_p10__activity_state, psc_activity_state.tng_p10_test_tp__activity_state, psc_created_at.dust_p01_tng_p10__created_at, psc_created_at.tng__monitor__created_at, psc_created_at.tng_p10__created_at, psc_created_at.tng_p10_test_tp__created_at, psc_accepted_at.dust_p01_tng_p10__accepted_at, psc_accepted_at.tng__monitor__accepted_at, psc_accepted_at.tng_p10__accepted_at, psc_accepted_at.tng_p10_test_tp__accepted_at, psc_cancelled_at.dust_p01_tng_p10__cancelled_at, psc_cancelled_at.tng__monitor__cancelled_at, psc_cancelled_at.tng_p10__cancelled_at, psc_cancelled_at.tng_p10_test_tp__cancelled_at, psc_revoked_at.dust_p01_tng_p10__revoked_at, psc_revoked_at.tng__monitor__revoked_at, psc_revoked_at.tng_p10__revoked_at, psc_revoked_at.tng_p10_test_tp__revoked_at, psc_paused_at.dust_p01_tng_p10__paused_at, psc_paused_at.tng__monitor__paused_at, psc_paused_at.tng_p10__paused_at, psc_paused_at.tng_p10_test_tp__paused_at, dust_p01_tng_p10_ic_dust_mother, tng_p10_ic_buccal_swab_child, tng_p10_ic_buccal_swab_mother, tng_p10_ic_cord_blood_mother, tng_p10_ic_drop_blood_child, tng_p10_ic_stool_child, tng_p10_ic_urine_mother, tng_p10_ic_venous_blood_mother, dust_p01_tng_p10_ic_dl_celpac_studies, dust_p01_tng_p10_ic_survey, tng_p10_ic_follow_up_studies, tng_p10_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 17 -- Pilot ID );[ Date: 2025-11-27 05:02:24 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
15 2s352ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__21"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__21__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: Young Adults, Pilot ID: 21 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p03__role" text, "psycap_p02_new_ya_p03__role" text, "psycap_p02_old_ya_p03__role" text, "ya_p03__role" text, "ya_p03_digi_ya03v2__role" text, "ya_p03_digi_ya04v2__role" text, "ya_p03_digi_ya05v2__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p03__state" text, "psycap_p02_new_ya_p03__state" text, "psycap_p02_old_ya_p03__state" text, "ya_p03__state" text, "ya_p03_digi_ya03v2__state" text, "ya_p03_digi_ya04v2__state" text, "ya_p03_digi_ya05v2__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p03__activity_state" text, "psycap_p02_new_ya_p03__activity_state" text, "psycap_p02_old_ya_p03__activity_state" text, "ya_p03__activity_state" text, "ya_p03_digi_ya03v2__activity_state" text, "ya_p03_digi_ya04v2__activity_state" text, "ya_p03_digi_ya05v2__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p03__created_at" text, "psycap_p02_new_ya_p03__created_at" text, "psycap_p02_old_ya_p03__created_at" text, "ya_p03__created_at" text, "ya_p03_digi_ya03v2__created_at" text, "ya_p03_digi_ya04v2__created_at" text, "ya_p03_digi_ya05v2__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p03__accepted_at" text, "psycap_p02_new_ya_p03__accepted_at" text, "psycap_p02_old_ya_p03__accepted_at" text, "ya_p03__accepted_at" text, "ya_p03_digi_ya03v2__accepted_at" text, "ya_p03_digi_ya04v2__accepted_at" text, "ya_p03_digi_ya05v2__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p03__cancelled_at" text, "psycap_p02_new_ya_p03__cancelled_at" text, "psycap_p02_old_ya_p03__cancelled_at" text, "ya_p03__cancelled_at" text, "ya_p03_digi_ya03v2__cancelled_at" text, "ya_p03_digi_ya04v2__cancelled_at" text, "ya_p03_digi_ya05v2__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p03__revoked_at" text, "psycap_p02_new_ya_p03__revoked_at" text, "psycap_p02_old_ya_p03__revoked_at" text, "ya_p03__revoked_at" text, "ya_p03_digi_ya03v2__revoked_at" text, "ya_p03_digi_ya04v2__revoked_at" text, "ya_p03_digi_ya05v2__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p03__paused_at" text, "psycap_p02_new_ya_p03__paused_at" text, "psycap_p02_old_ya_p03__paused_at" text, "ya_p03__paused_at" text, "ya_p03_digi_ya03v2__paused_at" text, "ya_p03_digi_ya04v2__paused_at" text, "ya_p03_digi_ya05v2__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p03_ic_buccal_swab_proband'), ('ya_p03_ic_urine_proband'), ('ya_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p03_ic_buccal_swab_proband" text, "ya_p03_ic_urine_proband" text, "ya_p03_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p03_ic_anam_qs'), ('ya_p03_ic_aneurysm'), ('ya_p03_ic_anthropometry'), ('ya_p03_ic_arch_foot'), ('ya_p03_ic_basic_qs'), ('ya_p03_ic_blood_pressure'), ('ya_p03_ic_braces_piercing_iud'), ('ya_p03_ic_cognition_test'), ('ya_p03_ic_da_health_registry'), ('ya_p03_ic_dexa'), ('ya_p03_ic_enviro_qs'), ('ya_p03_ic_follow_up_studies'), ('ya_p03_ic_fracture_lower_body_last_3m'), ('ya_p03_ic_fracture_upper_body_last_3m'), ('ya_p03_ic_hand_grip'), ('ya_p03_ic_hearing_vision_impairment'), ('ya_p03_ic_heart_disease'), ('ya_p03_ic_hemoptysis_ns'), ('ya_p03_ic_hernia'), ('ya_p03_ic_hyperthyroidism'), ('ya_p03_ic_inability_hold_pencil'), ('ya_p03_ic_inability_stand_both_legs'), ('ya_p03_ic_inability_talk_cze'), ('ya_p03_ic_inability_walk'), ('ya_p03_ic_inbody'), ('ya_p03_ic_infectious_resp_diseases'), ('ya_p03_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p03_ic_knee_stability'), ('ya_p03_ic_nutri_qs'), ('ya_p03_ic_over_weight_200_height_195'), ('ya_p03_ic_pacemaker_defibrillator'), ('ya_p03_ic_pneumothorax'), ('ya_p03_ic_pregnancy'), ('ya_p03_ic_recent_eye_abdominal_chest_surgery'), ('ya_p03_ic_recent_myocardial_infarction'), ('ya_p03_ic_spirometry'), ('ya_p03_ic_surgical_metal_body'), ('ya_p03_ic_unstable_angina_pectoris'), ('ya_p03_ic_ya_dl_elspac'), ('ya_p03_ic_ya_med_find'), ('ya_p03_ic_ya_newsletter') $$ ) AS extra_state ("subject_id" int, "ya_p03_ic_anam_qs" text, "ya_p03_ic_aneurysm" text, "ya_p03_ic_anthropometry" text, "ya_p03_ic_arch_foot" text, "ya_p03_ic_basic_qs" text, "ya_p03_ic_blood_pressure" text, "ya_p03_ic_braces_piercing_iud" text, "ya_p03_ic_cognition_test" text, "ya_p03_ic_da_health_registry" text, "ya_p03_ic_dexa" text, "ya_p03_ic_enviro_qs" text, "ya_p03_ic_follow_up_studies" text, "ya_p03_ic_fracture_lower_body_last_3m" text, "ya_p03_ic_fracture_upper_body_last_3m" text, "ya_p03_ic_hand_grip" text, "ya_p03_ic_hearing_vision_impairment" text, "ya_p03_ic_heart_disease" text, "ya_p03_ic_hemoptysis_ns" text, "ya_p03_ic_hernia" text, "ya_p03_ic_hyperthyroidism" text, "ya_p03_ic_inability_hold_pencil" text, "ya_p03_ic_inability_stand_both_legs" text, "ya_p03_ic_inability_talk_cze" text, "ya_p03_ic_inability_walk" text, "ya_p03_ic_inbody" text, "ya_p03_ic_infectious_resp_diseases" text, "ya_p03_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p03_ic_knee_stability" text, "ya_p03_ic_nutri_qs" text, "ya_p03_ic_over_weight_200_height_195" text, "ya_p03_ic_pacemaker_defibrillator" text, "ya_p03_ic_pneumothorax" text, "ya_p03_ic_pregnancy" text, "ya_p03_ic_recent_eye_abdominal_chest_surgery" text, "ya_p03_ic_recent_myocardial_infarction" text, "ya_p03_ic_spirometry" text, "ya_p03_ic_surgical_metal_body" text, "ya_p03_ic_unstable_angina_pectoris" text, "ya_p03_ic_ya_dl_elspac" text, "ya_p03_ic_ya_med_find" text, "ya_p03_ic_ya_newsletter" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p03__role, psc_role.psycap_p02_new_ya_p03__role, psc_role.psycap_p02_old_ya_p03__role, psc_role.ya_p03__role, psc_role.ya_p03_digi_ya03v2__role, psc_role.ya_p03_digi_ya04v2__role, psc_role.ya_p03_digi_ya05v2__role, psc_state.psycap_p01_ya_p03__state, psc_state.psycap_p02_new_ya_p03__state, psc_state.psycap_p02_old_ya_p03__state, psc_state.ya_p03__state, psc_state.ya_p03_digi_ya03v2__state, psc_state.ya_p03_digi_ya04v2__state, psc_state.ya_p03_digi_ya05v2__state, psc_activity_state.psycap_p01_ya_p03__activity_state, psc_activity_state.psycap_p02_new_ya_p03__activity_state, psc_activity_state.psycap_p02_old_ya_p03__activity_state, psc_activity_state.ya_p03__activity_state, psc_activity_state.ya_p03_digi_ya03v2__activity_state, psc_activity_state.ya_p03_digi_ya04v2__activity_state, psc_activity_state.ya_p03_digi_ya05v2__activity_state, psc_created_at.psycap_p01_ya_p03__created_at, psc_created_at.psycap_p02_new_ya_p03__created_at, psc_created_at.psycap_p02_old_ya_p03__created_at, psc_created_at.ya_p03__created_at, psc_created_at.ya_p03_digi_ya03v2__created_at, psc_created_at.ya_p03_digi_ya04v2__created_at, psc_created_at.ya_p03_digi_ya05v2__created_at, psc_accepted_at.psycap_p01_ya_p03__accepted_at, psc_accepted_at.psycap_p02_new_ya_p03__accepted_at, psc_accepted_at.psycap_p02_old_ya_p03__accepted_at, psc_accepted_at.ya_p03__accepted_at, psc_accepted_at.ya_p03_digi_ya03v2__accepted_at, psc_accepted_at.ya_p03_digi_ya04v2__accepted_at, psc_accepted_at.ya_p03_digi_ya05v2__accepted_at, psc_cancelled_at.psycap_p01_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_new_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p03__cancelled_at, psc_cancelled_at.ya_p03__cancelled_at, psc_cancelled_at.ya_p03_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya05v2__cancelled_at, psc_revoked_at.psycap_p01_ya_p03__revoked_at, psc_revoked_at.psycap_p02_new_ya_p03__revoked_at, psc_revoked_at.psycap_p02_old_ya_p03__revoked_at, psc_revoked_at.ya_p03__revoked_at, psc_revoked_at.ya_p03_digi_ya03v2__revoked_at, psc_revoked_at.ya_p03_digi_ya04v2__revoked_at, psc_revoked_at.ya_p03_digi_ya05v2__revoked_at, psc_paused_at.psycap_p01_ya_p03__paused_at, psc_paused_at.psycap_p02_new_ya_p03__paused_at, psc_paused_at.psycap_p02_old_ya_p03__paused_at, psc_paused_at.ya_p03__paused_at, psc_paused_at.ya_p03_digi_ya03v2__paused_at, psc_paused_at.ya_p03_digi_ya04v2__paused_at, psc_paused_at.ya_p03_digi_ya05v2__paused_at, ya_p03_ic_buccal_swab_proband, ya_p03_ic_urine_proband, ya_p03_ic_venous_blood_proband, ya_p03_ic_anam_qs, ya_p03_ic_aneurysm, ya_p03_ic_anthropometry, ya_p03_ic_arch_foot, ya_p03_ic_basic_qs, ya_p03_ic_blood_pressure, ya_p03_ic_braces_piercing_iud, ya_p03_ic_cognition_test, ya_p03_ic_da_health_registry, ya_p03_ic_dexa, ya_p03_ic_enviro_qs, ya_p03_ic_follow_up_studies, ya_p03_ic_fracture_lower_body_last_3m, ya_p03_ic_fracture_upper_body_last_3m, ya_p03_ic_hand_grip, ya_p03_ic_hearing_vision_impairment, ya_p03_ic_heart_disease, ya_p03_ic_hemoptysis_ns, ya_p03_ic_hernia, ya_p03_ic_hyperthyroidism, ya_p03_ic_inability_hold_pencil, ya_p03_ic_inability_stand_both_legs, ya_p03_ic_inability_talk_cze, ya_p03_ic_inability_walk, ya_p03_ic_inbody, ya_p03_ic_infectious_resp_diseases, ya_p03_ic_iodine_barium_radioisotopes_last_7d, ya_p03_ic_knee_stability, ya_p03_ic_nutri_qs, ya_p03_ic_over_weight_200_height_195, ya_p03_ic_pacemaker_defibrillator, ya_p03_ic_pneumothorax, ya_p03_ic_pregnancy, ya_p03_ic_recent_eye_abdominal_chest_surgery, ya_p03_ic_recent_myocardial_infarction, ya_p03_ic_spirometry, ya_p03_ic_surgical_metal_body, ya_p03_ic_unstable_angina_pectoris, ya_p03_ic_ya_dl_elspac, ya_p03_ic_ya_med_find, ya_p03_ic_ya_newsletter FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 21 -- Pilot ID );[ Date: 2025-11-27 17:02:29 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
16 2s341ms REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-27 13:12:03 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] - Bind query: yes ]
17 2s201ms REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-27 15:06:03 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] - Bind query: yes ]
18 2s165ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__11"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__11__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot IX, Pilot ID: 11 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p09__role" text, "tng_p09__role" text, "tng_pilot_9__form_fix_2019_06__role" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__role" text, "tng_pilot_9__monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p09__state" text, "tng_p09__state" text, "tng_pilot_9__form_fix_2019_06__state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__state" text, "tng_pilot_9__monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p09__activity_state" text, "tng_p09__activity_state" text, "tng_pilot_9__form_fix_2019_06__activity_state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state" text, "tng_pilot_9__monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p09__created_at" text, "tng_p09__created_at" text, "tng_pilot_9__form_fix_2019_06__created_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__created_at" text, "tng_pilot_9__monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p09__accepted_at" text, "tng_p09__accepted_at" text, "tng_pilot_9__form_fix_2019_06__accepted_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at" text, "tng_pilot_9__monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p09__cancelled_at" text, "tng_p09__cancelled_at" text, "tng_pilot_9__form_fix_2019_06__cancelled_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at" text, "tng_pilot_9__monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p09__revoked_at" text, "tng_p09__revoked_at" text, "tng_pilot_9__form_fix_2019_06__revoked_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at" text, "tng_pilot_9__monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p09__paused_at" text, "tng_p09__paused_at" text, "tng_pilot_9__form_fix_2019_06__paused_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at" text, "tng_pilot_9__monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09_ic_dust_mother'), ('tng_p09_ic_buccal_swab_child'), ('tng_p09_ic_buccal_swab_mother'), ('tng_p09_ic_cord_blood_mother'), ('tng_p09_ic_drop_blood_child'), ('tng_p09_ic_stool_child'), ('tng_p09_ic_urine_mother'), ('tng_p09_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p09_ic_dust_mother" text, "tng_p09_ic_buccal_swab_child" text, "tng_p09_ic_buccal_swab_mother" text, "tng_p09_ic_cord_blood_mother" text, "tng_p09_ic_drop_blood_child" text, "tng_p09_ic_stool_child" text, "tng_p09_ic_urine_mother" text, "tng_p09_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09_ic_dl_celpac_studies'), ('dust_p01_tng_p09_ic_survey'), ('tng_p09_ic_follow_up_studies'), ('tng_p09_ic_med_find'), ('tng_pilot_9__monitor_ic_follow_up_studies'), ('tng_pilot_9__monitor_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p09_ic_dl_celpac_studies" text, "dust_p01_tng_p09_ic_survey" text, "tng_p09_ic_follow_up_studies" text, "tng_p09_ic_med_find" text, "tng_pilot_9__monitor_ic_follow_up_studies" text, "tng_pilot_9__monitor_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p09__role, psc_role.tng_p09__role, psc_role.tng_pilot_9__form_fix_2019_06__role, psc_role.tng_pilot_9__form_fix_mm38p01_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p02_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p03_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p04_v2_v2__role, psc_role.tng_pilot_9__monitor__role, psc_state.dust_p01_tng_p09__state, psc_state.tng_p09__state, psc_state.tng_pilot_9__form_fix_2019_06__state, psc_state.tng_pilot_9__form_fix_mm38p01_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p02_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p03_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p04_v2_v2__state, psc_state.tng_pilot_9__monitor__state, psc_activity_state.dust_p01_tng_p09__activity_state, psc_activity_state.tng_p09__activity_state, psc_activity_state.tng_pilot_9__form_fix_2019_06__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state, psc_activity_state.tng_pilot_9__monitor__activity_state, psc_created_at.dust_p01_tng_p09__created_at, psc_created_at.tng_p09__created_at, psc_created_at.tng_pilot_9__form_fix_2019_06__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p01_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p02_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p03_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p04_v2_v2__created_at, psc_created_at.tng_pilot_9__monitor__created_at, psc_accepted_at.dust_p01_tng_p09__accepted_at, psc_accepted_at.tng_p09__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_2019_06__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p09__cancelled_at, psc_cancelled_at.tng_p09__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_2019_06__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p09__revoked_at, psc_revoked_at.tng_p09__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_2019_06__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__monitor__revoked_at, psc_paused_at.dust_p01_tng_p09__paused_at, psc_paused_at.tng_p09__paused_at, psc_paused_at.tng_pilot_9__form_fix_2019_06__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at, psc_paused_at.tng_pilot_9__monitor__paused_at, dust_p01_tng_p09_ic_dust_mother, tng_p09_ic_buccal_swab_child, tng_p09_ic_buccal_swab_mother, tng_p09_ic_cord_blood_mother, tng_p09_ic_drop_blood_child, tng_p09_ic_stool_child, tng_p09_ic_urine_mother, tng_p09_ic_venous_blood_mother, dust_p01_tng_p09_ic_dl_celpac_studies, dust_p01_tng_p09_ic_survey, tng_p09_ic_follow_up_studies, tng_p09_ic_med_find, tng_pilot_9__monitor_ic_follow_up_studies, tng_pilot_9__monitor_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 11 -- Pilot ID );[ Date: 2025-11-27 17:02:24 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
19 2s29ms REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-27 12:12:03 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] - Bind query: yes ]
20 2s7ms REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-27 12:36:04 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] - Bind query: yes ]
Time consuming queries (N)
Rank Total duration Times executed Min duration Max duration Avg duration Query 1 9m48s 2 4s738ms 9m43s 4m54s create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #1
Day Hour Count Duration Avg duration Nov 27 05 1 4s738ms 4s738ms 17 1 9m43s 9m43s [ User: tng_migration_user - Total duration: 9m48s - Times executed: 2 ]
[ Application: dbt - Total duration: 9m48s - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );
Date: 2025-11-27 17:12:09 Duration: 9m43s Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );
Date: 2025-11-27 05:02:28 Duration: 4s738ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );
Date: 2025-11-27 05:02:28 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
2 4m3s 189 1s150ms 2s341ms 1s288ms refresh materialized view core.mv_subject_form with data;Times Reported Time consuming queries #2
Day Hour Count Duration Avg duration Nov 27 05 10 12s912ms 1s291ms 06 10 12s836ms 1s283ms 07 10 12s994ms 1s299ms 08 10 12s956ms 1s295ms 09 10 13s400ms 1s340ms 10 10 12s487ms 1s248ms 11 10 12s594ms 1s259ms 12 10 14s931ms 1s493ms 13 10 13s661ms 1s366ms 14 10 12s469ms 1s246ms 15 10 13s49ms 1s304ms 16 10 12s322ms 1s232ms 17 9 11s80ms 1s231ms 18 10 12s521ms 1s252ms 19 10 12s663ms 1s266ms 20 10 13s30ms 1s303ms 21 10 12s341ms 1s234ms 22 10 12s658ms 1s265ms 23 10 12s634ms 1s263ms [ User: tng_migration_user - Total duration: 4m3s - Times executed: 189 ]
[ Application: [unknown] - Total duration: 4m3s - Times executed: 189 ]
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-27 13:12:03 Duration: 2s341ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-27 15:06:03 Duration: 2s201ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-27 12:12:03 Duration: 2s29ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
3 38s436ms 2 1s673ms 36s762ms 19s218ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__23__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "celspac_pr_celspac_p01__role" text, "celspac_pr_elspac_p01__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "celspac_pr_celspac_p01__state" text, "celspac_pr_elspac_p01__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as activity ("subject_id" int, "celspac_pr_celspac_p01__activity_state" text, "celspac_pr_elspac_p01__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as created_at ("subject_id" int, "celspac_pr_celspac_p01__created_at" text, "celspac_pr_elspac_p01__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as accepted_at ("subject_id" int, "celspac_pr_celspac_p01__accepted_at" text, "celspac_pr_elspac_p01__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as cancelled_at ("subject_id" int, "celspac_pr_celspac_p01__cancelled_at" text, "celspac_pr_elspac_p01__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as revoked_at ("subject_id" int, "celspac_pr_celspac_p01__revoked_at" text, "celspac_pr_elspac_p01__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as paused_at ("subject_id" int, "celspac_pr_celspac_p01__paused_at" text, "celspac_pr_elspac_p01__paused_at" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.celspac_pr_celspac_p01__role, psc_role.celspac_pr_elspac_p01__role, psc_state.celspac_pr_celspac_p01__state, psc_state.celspac_pr_elspac_p01__state, psc_activity_state.celspac_pr_celspac_p01__activity_state, psc_activity_state.celspac_pr_elspac_p01__activity_state, psc_created_at.celspac_pr_celspac_p01__created_at, psc_created_at.celspac_pr_elspac_p01__created_at, psc_accepted_at.celspac_pr_celspac_p01__accepted_at, psc_accepted_at.celspac_pr_elspac_p01__accepted_at, psc_cancelled_at.celspac_pr_celspac_p01__cancelled_at, psc_cancelled_at.celspac_pr_elspac_p01__cancelled_at, psc_revoked_at.celspac_pr_celspac_p01__revoked_at, psc_revoked_at.celspac_pr_elspac_p01__revoked_at, psc_paused_at.celspac_pr_celspac_p01__paused_at, psc_paused_at.celspac_pr_elspac_p01__paused_at from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #3
Day Hour Count Duration Avg duration Nov 27 05 1 1s673ms 1s673ms 17 1 36s762ms 36s762ms [ User: tng_migration_user - Total duration: 38s436ms - Times executed: 2 ]
[ Application: dbt - Total duration: 38s436ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__23"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__23__dbt_tmp" as ( -- suject (proband) patrici do kohorty ..., Pilot ID: 23 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__role" text, "celspac_pr_elspac_p01__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__state" text, "celspac_pr_elspac_p01__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS activity ("subject_id" int, "celspac_pr_celspac_p01__activity_state" text, "celspac_pr_elspac_p01__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS created_at ("subject_id" int, "celspac_pr_celspac_p01__created_at" text, "celspac_pr_elspac_p01__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS accepted_at ("subject_id" int, "celspac_pr_celspac_p01__accepted_at" text, "celspac_pr_elspac_p01__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS cancelled_at ("subject_id" int, "celspac_pr_celspac_p01__cancelled_at" text, "celspac_pr_elspac_p01__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS revoked_at ("subject_id" int, "celspac_pr_celspac_p01__revoked_at" text, "celspac_pr_elspac_p01__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS paused_at ("subject_id" int, "celspac_pr_celspac_p01__paused_at" text, "celspac_pr_elspac_p01__paused_at" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.celspac_pr_celspac_p01__role, psc_role.celspac_pr_elspac_p01__role, psc_state.celspac_pr_celspac_p01__state, psc_state.celspac_pr_elspac_p01__state, psc_activity_state.celspac_pr_celspac_p01__activity_state, psc_activity_state.celspac_pr_elspac_p01__activity_state, psc_created_at.celspac_pr_celspac_p01__created_at, psc_created_at.celspac_pr_elspac_p01__created_at, psc_accepted_at.celspac_pr_celspac_p01__accepted_at, psc_accepted_at.celspac_pr_elspac_p01__accepted_at, psc_cancelled_at.celspac_pr_celspac_p01__cancelled_at, psc_cancelled_at.celspac_pr_elspac_p01__cancelled_at, psc_revoked_at.celspac_pr_celspac_p01__revoked_at, psc_revoked_at.celspac_pr_elspac_p01__revoked_at, psc_paused_at.celspac_pr_celspac_p01__paused_at, psc_paused_at.celspac_pr_elspac_p01__paused_at FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 23 -- Pilot ID );
Date: 2025-11-27 17:03:04 Duration: 36s762ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__23"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__23__dbt_tmp" as ( -- suject (proband) patrici do kohorty ..., Pilot ID: 23 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__role" text, "celspac_pr_elspac_p01__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__state" text, "celspac_pr_elspac_p01__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS activity ("subject_id" int, "celspac_pr_celspac_p01__activity_state" text, "celspac_pr_elspac_p01__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS created_at ("subject_id" int, "celspac_pr_celspac_p01__created_at" text, "celspac_pr_elspac_p01__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS accepted_at ("subject_id" int, "celspac_pr_celspac_p01__accepted_at" text, "celspac_pr_elspac_p01__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS cancelled_at ("subject_id" int, "celspac_pr_celspac_p01__cancelled_at" text, "celspac_pr_elspac_p01__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS revoked_at ("subject_id" int, "celspac_pr_celspac_p01__revoked_at" text, "celspac_pr_elspac_p01__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS paused_at ("subject_id" int, "celspac_pr_celspac_p01__paused_at" text, "celspac_pr_elspac_p01__paused_at" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.celspac_pr_celspac_p01__role, psc_role.celspac_pr_elspac_p01__role, psc_state.celspac_pr_celspac_p01__state, psc_state.celspac_pr_elspac_p01__state, psc_activity_state.celspac_pr_celspac_p01__activity_state, psc_activity_state.celspac_pr_elspac_p01__activity_state, psc_created_at.celspac_pr_celspac_p01__created_at, psc_created_at.celspac_pr_elspac_p01__created_at, psc_accepted_at.celspac_pr_celspac_p01__accepted_at, psc_accepted_at.celspac_pr_elspac_p01__accepted_at, psc_cancelled_at.celspac_pr_celspac_p01__cancelled_at, psc_cancelled_at.celspac_pr_elspac_p01__cancelled_at, psc_revoked_at.celspac_pr_celspac_p01__revoked_at, psc_revoked_at.celspac_pr_elspac_p01__revoked_at, psc_paused_at.celspac_pr_celspac_p01__paused_at, psc_paused_at.celspac_pr_elspac_p01__paused_at FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 23 -- Pilot ID );
Date: 2025-11-27 05:02:26 Duration: 1s673ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
4 17s699ms 126 115ms 384ms 140ms refresh materialized view core.mv_subject_event with data;Times Reported Time consuming queries #4
Day Hour Count Duration Avg duration Nov 27 06 7 913ms 130ms 07 7 1s324ms 189ms 08 7 1s10ms 144ms 09 7 1s53ms 150ms 10 7 901ms 128ms 11 7 893ms 127ms 12 7 956ms 136ms 13 7 905ms 129ms 14 7 1s24ms 146ms 15 7 918ms 131ms 16 7 975ms 139ms 17 7 887ms 126ms 18 7 923ms 131ms 19 7 906ms 129ms 20 7 897ms 128ms 21 7 954ms 136ms 22 7 1s108ms 158ms 23 7 1s144ms 163ms [ User: tng_migration_user - Total duration: 17s699ms - Times executed: 126 ]
[ Application: [unknown] - Total duration: 17s699ms - Times executed: 126 ]
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-11-27 07:05:02 Duration: 384ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-11-27 23:05:01 Duration: 373ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-11-27 07:59:01 Duration: 314ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
5 13s916ms 160 37ms 254ms 86ms with values as ( select label as value from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? group by label order by ? ) select value from values;Times Reported Time consuming queries #5
Day Hour Count Duration Avg duration Nov 27 05 80 6s170ms 77ms 17 80 7s746ms 96ms [ User: tng_migration_user - Total duration: 13s916ms - Times executed: 160 ]
[ Application: dbt - Total duration: 13s916ms - Times executed: 160 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-11-27 17:02:25 Duration: 254ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-11-27 17:02:25 Duration: 221ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-11-27 05:02:23 Duration: 208ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
6 13s700ms 2 2s352ms 11s347ms 6s850ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__21__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "psycap_p01_ya_p03__role" text, "psycap_p02_new_ya_p03__role" text, "psycap_p02_old_ya_p03__role" text, "ya_p03__role" text, "ya_p03_digi_ya03v2__role" text, "ya_p03_digi_ya04v2__role" text, "ya_p03_digi_ya05v2__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "psycap_p01_ya_p03__state" text, "psycap_p02_new_ya_p03__state" text, "psycap_p02_old_ya_p03__state" text, "ya_p03__state" text, "ya_p03_digi_ya03v2__state" text, "ya_p03_digi_ya04v2__state" text, "ya_p03_digi_ya05v2__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as activity ("subject_id" int, "psycap_p01_ya_p03__activity_state" text, "psycap_p02_new_ya_p03__activity_state" text, "psycap_p02_old_ya_p03__activity_state" text, "ya_p03__activity_state" text, "ya_p03_digi_ya03v2__activity_state" text, "ya_p03_digi_ya04v2__activity_state" text, "ya_p03_digi_ya05v2__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as created_at ("subject_id" int, "psycap_p01_ya_p03__created_at" text, "psycap_p02_new_ya_p03__created_at" text, "psycap_p02_old_ya_p03__created_at" text, "ya_p03__created_at" text, "ya_p03_digi_ya03v2__created_at" text, "ya_p03_digi_ya04v2__created_at" text, "ya_p03_digi_ya05v2__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "psycap_p01_ya_p03__accepted_at" text, "psycap_p02_new_ya_p03__accepted_at" text, "psycap_p02_old_ya_p03__accepted_at" text, "ya_p03__accepted_at" text, "ya_p03_digi_ya03v2__accepted_at" text, "ya_p03_digi_ya04v2__accepted_at" text, "ya_p03_digi_ya05v2__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "psycap_p01_ya_p03__cancelled_at" text, "psycap_p02_new_ya_p03__cancelled_at" text, "psycap_p02_old_ya_p03__cancelled_at" text, "ya_p03__cancelled_at" text, "ya_p03_digi_ya03v2__cancelled_at" text, "ya_p03_digi_ya04v2__cancelled_at" text, "ya_p03_digi_ya05v2__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "psycap_p01_ya_p03__revoked_at" text, "psycap_p02_new_ya_p03__revoked_at" text, "psycap_p02_old_ya_p03__revoked_at" text, "ya_p03__revoked_at" text, "ya_p03_digi_ya03v2__revoked_at" text, "ya_p03_digi_ya04v2__revoked_at" text, "ya_p03_digi_ya05v2__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as paused_at ("subject_id" int, "psycap_p01_ya_p03__paused_at" text, "psycap_p02_new_ya_p03__paused_at" text, "psycap_p02_old_ya_p03__paused_at" text, "ya_p03__paused_at" text, "ya_p03_digi_ya03v2__paused_at" text, "ya_p03_digi_ya04v2__paused_at" text, "ya_p03_digi_ya05v2__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "ya_p03_ic_buccal_swab_proband" text, "ya_p03_ic_urine_proband" text, "ya_p03_ic_venous_blood_proband" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "ya_p03_ic_anam_qs" text, "ya_p03_ic_aneurysm" text, "ya_p03_ic_anthropometry" text, "ya_p03_ic_arch_foot" text, "ya_p03_ic_basic_qs" text, "ya_p03_ic_blood_pressure" text, "ya_p03_ic_braces_piercing_iud" text, "ya_p03_ic_cognition_test" text, "ya_p03_ic_da_health_registry" text, "ya_p03_ic_dexa" text, "ya_p03_ic_enviro_qs" text, "ya_p03_ic_follow_up_studies" text, "ya_p03_ic_fracture_lower_body_last_3m" text, "ya_p03_ic_fracture_upper_body_last_3m" text, "ya_p03_ic_hand_grip" text, "ya_p03_ic_hearing_vision_impairment" text, "ya_p03_ic_heart_disease" text, "ya_p03_ic_hemoptysis_ns" text, "ya_p03_ic_hernia" text, "ya_p03_ic_hyperthyroidism" text, "ya_p03_ic_inability_hold_pencil" text, "ya_p03_ic_inability_stand_both_legs" text, "ya_p03_ic_inability_talk_cze" text, "ya_p03_ic_inability_walk" text, "ya_p03_ic_inbody" text, "ya_p03_ic_infectious_resp_diseases" text, "ya_p03_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p03_ic_knee_stability" text, "ya_p03_ic_nutri_qs" text, "ya_p03_ic_over_weight_200_height_195" text, "ya_p03_ic_pacemaker_defibrillator" text, "ya_p03_ic_pneumothorax" text, "ya_p03_ic_pregnancy" text, "ya_p03_ic_recent_eye_abdominal_chest_surgery" text, "ya_p03_ic_recent_myocardial_infarction" text, "ya_p03_ic_spirometry" text, "ya_p03_ic_surgical_metal_body" text, "ya_p03_ic_unstable_angina_pectoris" text, "ya_p03_ic_ya_dl_elspac" text, "ya_p03_ic_ya_med_find" text, "ya_p03_ic_ya_newsletter" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.psycap_p01_ya_p03__role, psc_role.psycap_p02_new_ya_p03__role, psc_role.psycap_p02_old_ya_p03__role, psc_role.ya_p03__role, psc_role.ya_p03_digi_ya03v2__role, psc_role.ya_p03_digi_ya04v2__role, psc_role.ya_p03_digi_ya05v2__role, psc_state.psycap_p01_ya_p03__state, psc_state.psycap_p02_new_ya_p03__state, psc_state.psycap_p02_old_ya_p03__state, psc_state.ya_p03__state, psc_state.ya_p03_digi_ya03v2__state, psc_state.ya_p03_digi_ya04v2__state, psc_state.ya_p03_digi_ya05v2__state, psc_activity_state.psycap_p01_ya_p03__activity_state, psc_activity_state.psycap_p02_new_ya_p03__activity_state, psc_activity_state.psycap_p02_old_ya_p03__activity_state, psc_activity_state.ya_p03__activity_state, psc_activity_state.ya_p03_digi_ya03v2__activity_state, psc_activity_state.ya_p03_digi_ya04v2__activity_state, psc_activity_state.ya_p03_digi_ya05v2__activity_state, psc_created_at.psycap_p01_ya_p03__created_at, psc_created_at.psycap_p02_new_ya_p03__created_at, psc_created_at.psycap_p02_old_ya_p03__created_at, psc_created_at.ya_p03__created_at, psc_created_at.ya_p03_digi_ya03v2__created_at, psc_created_at.ya_p03_digi_ya04v2__created_at, psc_created_at.ya_p03_digi_ya05v2__created_at, psc_accepted_at.psycap_p01_ya_p03__accepted_at, psc_accepted_at.psycap_p02_new_ya_p03__accepted_at, psc_accepted_at.psycap_p02_old_ya_p03__accepted_at, psc_accepted_at.ya_p03__accepted_at, psc_accepted_at.ya_p03_digi_ya03v2__accepted_at, psc_accepted_at.ya_p03_digi_ya04v2__accepted_at, psc_accepted_at.ya_p03_digi_ya05v2__accepted_at, psc_cancelled_at.psycap_p01_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_new_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p03__cancelled_at, psc_cancelled_at.ya_p03__cancelled_at, psc_cancelled_at.ya_p03_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya05v2__cancelled_at, psc_revoked_at.psycap_p01_ya_p03__revoked_at, psc_revoked_at.psycap_p02_new_ya_p03__revoked_at, psc_revoked_at.psycap_p02_old_ya_p03__revoked_at, psc_revoked_at.ya_p03__revoked_at, psc_revoked_at.ya_p03_digi_ya03v2__revoked_at, psc_revoked_at.ya_p03_digi_ya04v2__revoked_at, psc_revoked_at.ya_p03_digi_ya05v2__revoked_at, psc_paused_at.psycap_p01_ya_p03__paused_at, psc_paused_at.psycap_p02_new_ya_p03__paused_at, psc_paused_at.psycap_p02_old_ya_p03__paused_at, psc_paused_at.ya_p03__paused_at, psc_paused_at.ya_p03_digi_ya03v2__paused_at, psc_paused_at.ya_p03_digi_ya04v2__paused_at, psc_paused_at.ya_p03_digi_ya05v2__paused_at, ya_p03_ic_buccal_swab_proband, ya_p03_ic_urine_proband, ya_p03_ic_venous_blood_proband, ya_p03_ic_anam_qs, ya_p03_ic_aneurysm, ya_p03_ic_anthropometry, ya_p03_ic_arch_foot, ya_p03_ic_basic_qs, ya_p03_ic_blood_pressure, ya_p03_ic_braces_piercing_iud, ya_p03_ic_cognition_test, ya_p03_ic_da_health_registry, ya_p03_ic_dexa, ya_p03_ic_enviro_qs, ya_p03_ic_follow_up_studies, ya_p03_ic_fracture_lower_body_last_3m, ya_p03_ic_fracture_upper_body_last_3m, ya_p03_ic_hand_grip, ya_p03_ic_hearing_vision_impairment, ya_p03_ic_heart_disease, ya_p03_ic_hemoptysis_ns, ya_p03_ic_hernia, ya_p03_ic_hyperthyroidism, ya_p03_ic_inability_hold_pencil, ya_p03_ic_inability_stand_both_legs, ya_p03_ic_inability_talk_cze, ya_p03_ic_inability_walk, ya_p03_ic_inbody, ya_p03_ic_infectious_resp_diseases, ya_p03_ic_iodine_barium_radioisotopes_last_7d, ya_p03_ic_knee_stability, ya_p03_ic_nutri_qs, ya_p03_ic_over_weight_200_height_195, ya_p03_ic_pacemaker_defibrillator, ya_p03_ic_pneumothorax, ya_p03_ic_pregnancy, ya_p03_ic_recent_eye_abdominal_chest_surgery, ya_p03_ic_recent_myocardial_infarction, ya_p03_ic_spirometry, ya_p03_ic_surgical_metal_body, ya_p03_ic_unstable_angina_pectoris, ya_p03_ic_ya_dl_elspac, ya_p03_ic_ya_med_find, ya_p03_ic_ya_newsletter from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #6
Day Hour Count Duration Avg duration Nov 27 05 1 11s347ms 11s347ms 17 1 2s352ms 2s352ms [ User: tng_migration_user - Total duration: 13s700ms - Times executed: 2 ]
[ Application: dbt - Total duration: 13s700ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__21"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__21__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: Young Adults, Pilot ID: 21 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p03__role" text, "psycap_p02_new_ya_p03__role" text, "psycap_p02_old_ya_p03__role" text, "ya_p03__role" text, "ya_p03_digi_ya03v2__role" text, "ya_p03_digi_ya04v2__role" text, "ya_p03_digi_ya05v2__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p03__state" text, "psycap_p02_new_ya_p03__state" text, "psycap_p02_old_ya_p03__state" text, "ya_p03__state" text, "ya_p03_digi_ya03v2__state" text, "ya_p03_digi_ya04v2__state" text, "ya_p03_digi_ya05v2__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p03__activity_state" text, "psycap_p02_new_ya_p03__activity_state" text, "psycap_p02_old_ya_p03__activity_state" text, "ya_p03__activity_state" text, "ya_p03_digi_ya03v2__activity_state" text, "ya_p03_digi_ya04v2__activity_state" text, "ya_p03_digi_ya05v2__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p03__created_at" text, "psycap_p02_new_ya_p03__created_at" text, "psycap_p02_old_ya_p03__created_at" text, "ya_p03__created_at" text, "ya_p03_digi_ya03v2__created_at" text, "ya_p03_digi_ya04v2__created_at" text, "ya_p03_digi_ya05v2__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p03__accepted_at" text, "psycap_p02_new_ya_p03__accepted_at" text, "psycap_p02_old_ya_p03__accepted_at" text, "ya_p03__accepted_at" text, "ya_p03_digi_ya03v2__accepted_at" text, "ya_p03_digi_ya04v2__accepted_at" text, "ya_p03_digi_ya05v2__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p03__cancelled_at" text, "psycap_p02_new_ya_p03__cancelled_at" text, "psycap_p02_old_ya_p03__cancelled_at" text, "ya_p03__cancelled_at" text, "ya_p03_digi_ya03v2__cancelled_at" text, "ya_p03_digi_ya04v2__cancelled_at" text, "ya_p03_digi_ya05v2__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p03__revoked_at" text, "psycap_p02_new_ya_p03__revoked_at" text, "psycap_p02_old_ya_p03__revoked_at" text, "ya_p03__revoked_at" text, "ya_p03_digi_ya03v2__revoked_at" text, "ya_p03_digi_ya04v2__revoked_at" text, "ya_p03_digi_ya05v2__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p03__paused_at" text, "psycap_p02_new_ya_p03__paused_at" text, "psycap_p02_old_ya_p03__paused_at" text, "ya_p03__paused_at" text, "ya_p03_digi_ya03v2__paused_at" text, "ya_p03_digi_ya04v2__paused_at" text, "ya_p03_digi_ya05v2__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p03_ic_buccal_swab_proband'), ('ya_p03_ic_urine_proband'), ('ya_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p03_ic_buccal_swab_proband" text, "ya_p03_ic_urine_proband" text, "ya_p03_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p03_ic_anam_qs'), ('ya_p03_ic_aneurysm'), ('ya_p03_ic_anthropometry'), ('ya_p03_ic_arch_foot'), ('ya_p03_ic_basic_qs'), ('ya_p03_ic_blood_pressure'), ('ya_p03_ic_braces_piercing_iud'), ('ya_p03_ic_cognition_test'), ('ya_p03_ic_da_health_registry'), ('ya_p03_ic_dexa'), ('ya_p03_ic_enviro_qs'), ('ya_p03_ic_follow_up_studies'), ('ya_p03_ic_fracture_lower_body_last_3m'), ('ya_p03_ic_fracture_upper_body_last_3m'), ('ya_p03_ic_hand_grip'), ('ya_p03_ic_hearing_vision_impairment'), ('ya_p03_ic_heart_disease'), ('ya_p03_ic_hemoptysis_ns'), ('ya_p03_ic_hernia'), ('ya_p03_ic_hyperthyroidism'), ('ya_p03_ic_inability_hold_pencil'), ('ya_p03_ic_inability_stand_both_legs'), ('ya_p03_ic_inability_talk_cze'), ('ya_p03_ic_inability_walk'), ('ya_p03_ic_inbody'), ('ya_p03_ic_infectious_resp_diseases'), ('ya_p03_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p03_ic_knee_stability'), ('ya_p03_ic_nutri_qs'), ('ya_p03_ic_over_weight_200_height_195'), ('ya_p03_ic_pacemaker_defibrillator'), ('ya_p03_ic_pneumothorax'), ('ya_p03_ic_pregnancy'), ('ya_p03_ic_recent_eye_abdominal_chest_surgery'), ('ya_p03_ic_recent_myocardial_infarction'), ('ya_p03_ic_spirometry'), ('ya_p03_ic_surgical_metal_body'), ('ya_p03_ic_unstable_angina_pectoris'), ('ya_p03_ic_ya_dl_elspac'), ('ya_p03_ic_ya_med_find'), ('ya_p03_ic_ya_newsletter') $$ ) AS extra_state ("subject_id" int, "ya_p03_ic_anam_qs" text, "ya_p03_ic_aneurysm" text, "ya_p03_ic_anthropometry" text, "ya_p03_ic_arch_foot" text, "ya_p03_ic_basic_qs" text, "ya_p03_ic_blood_pressure" text, "ya_p03_ic_braces_piercing_iud" text, "ya_p03_ic_cognition_test" text, "ya_p03_ic_da_health_registry" text, "ya_p03_ic_dexa" text, "ya_p03_ic_enviro_qs" text, "ya_p03_ic_follow_up_studies" text, "ya_p03_ic_fracture_lower_body_last_3m" text, "ya_p03_ic_fracture_upper_body_last_3m" text, "ya_p03_ic_hand_grip" text, "ya_p03_ic_hearing_vision_impairment" text, "ya_p03_ic_heart_disease" text, "ya_p03_ic_hemoptysis_ns" text, "ya_p03_ic_hernia" text, "ya_p03_ic_hyperthyroidism" text, "ya_p03_ic_inability_hold_pencil" text, "ya_p03_ic_inability_stand_both_legs" text, "ya_p03_ic_inability_talk_cze" text, "ya_p03_ic_inability_walk" text, "ya_p03_ic_inbody" text, "ya_p03_ic_infectious_resp_diseases" text, "ya_p03_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p03_ic_knee_stability" text, "ya_p03_ic_nutri_qs" text, "ya_p03_ic_over_weight_200_height_195" text, "ya_p03_ic_pacemaker_defibrillator" text, "ya_p03_ic_pneumothorax" text, "ya_p03_ic_pregnancy" text, "ya_p03_ic_recent_eye_abdominal_chest_surgery" text, "ya_p03_ic_recent_myocardial_infarction" text, "ya_p03_ic_spirometry" text, "ya_p03_ic_surgical_metal_body" text, "ya_p03_ic_unstable_angina_pectoris" text, "ya_p03_ic_ya_dl_elspac" text, "ya_p03_ic_ya_med_find" text, "ya_p03_ic_ya_newsletter" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p03__role, psc_role.psycap_p02_new_ya_p03__role, psc_role.psycap_p02_old_ya_p03__role, psc_role.ya_p03__role, psc_role.ya_p03_digi_ya03v2__role, psc_role.ya_p03_digi_ya04v2__role, psc_role.ya_p03_digi_ya05v2__role, psc_state.psycap_p01_ya_p03__state, psc_state.psycap_p02_new_ya_p03__state, psc_state.psycap_p02_old_ya_p03__state, psc_state.ya_p03__state, psc_state.ya_p03_digi_ya03v2__state, psc_state.ya_p03_digi_ya04v2__state, psc_state.ya_p03_digi_ya05v2__state, psc_activity_state.psycap_p01_ya_p03__activity_state, psc_activity_state.psycap_p02_new_ya_p03__activity_state, psc_activity_state.psycap_p02_old_ya_p03__activity_state, psc_activity_state.ya_p03__activity_state, psc_activity_state.ya_p03_digi_ya03v2__activity_state, psc_activity_state.ya_p03_digi_ya04v2__activity_state, psc_activity_state.ya_p03_digi_ya05v2__activity_state, psc_created_at.psycap_p01_ya_p03__created_at, psc_created_at.psycap_p02_new_ya_p03__created_at, psc_created_at.psycap_p02_old_ya_p03__created_at, psc_created_at.ya_p03__created_at, psc_created_at.ya_p03_digi_ya03v2__created_at, psc_created_at.ya_p03_digi_ya04v2__created_at, psc_created_at.ya_p03_digi_ya05v2__created_at, psc_accepted_at.psycap_p01_ya_p03__accepted_at, psc_accepted_at.psycap_p02_new_ya_p03__accepted_at, psc_accepted_at.psycap_p02_old_ya_p03__accepted_at, psc_accepted_at.ya_p03__accepted_at, psc_accepted_at.ya_p03_digi_ya03v2__accepted_at, psc_accepted_at.ya_p03_digi_ya04v2__accepted_at, psc_accepted_at.ya_p03_digi_ya05v2__accepted_at, psc_cancelled_at.psycap_p01_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_new_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p03__cancelled_at, psc_cancelled_at.ya_p03__cancelled_at, psc_cancelled_at.ya_p03_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya05v2__cancelled_at, psc_revoked_at.psycap_p01_ya_p03__revoked_at, psc_revoked_at.psycap_p02_new_ya_p03__revoked_at, psc_revoked_at.psycap_p02_old_ya_p03__revoked_at, psc_revoked_at.ya_p03__revoked_at, psc_revoked_at.ya_p03_digi_ya03v2__revoked_at, psc_revoked_at.ya_p03_digi_ya04v2__revoked_at, psc_revoked_at.ya_p03_digi_ya05v2__revoked_at, psc_paused_at.psycap_p01_ya_p03__paused_at, psc_paused_at.psycap_p02_new_ya_p03__paused_at, psc_paused_at.psycap_p02_old_ya_p03__paused_at, psc_paused_at.ya_p03__paused_at, psc_paused_at.ya_p03_digi_ya03v2__paused_at, psc_paused_at.ya_p03_digi_ya04v2__paused_at, psc_paused_at.ya_p03_digi_ya05v2__paused_at, ya_p03_ic_buccal_swab_proband, ya_p03_ic_urine_proband, ya_p03_ic_venous_blood_proband, ya_p03_ic_anam_qs, ya_p03_ic_aneurysm, ya_p03_ic_anthropometry, ya_p03_ic_arch_foot, ya_p03_ic_basic_qs, ya_p03_ic_blood_pressure, ya_p03_ic_braces_piercing_iud, ya_p03_ic_cognition_test, ya_p03_ic_da_health_registry, ya_p03_ic_dexa, ya_p03_ic_enviro_qs, ya_p03_ic_follow_up_studies, ya_p03_ic_fracture_lower_body_last_3m, ya_p03_ic_fracture_upper_body_last_3m, ya_p03_ic_hand_grip, ya_p03_ic_hearing_vision_impairment, ya_p03_ic_heart_disease, ya_p03_ic_hemoptysis_ns, ya_p03_ic_hernia, ya_p03_ic_hyperthyroidism, ya_p03_ic_inability_hold_pencil, ya_p03_ic_inability_stand_both_legs, ya_p03_ic_inability_talk_cze, ya_p03_ic_inability_walk, ya_p03_ic_inbody, ya_p03_ic_infectious_resp_diseases, ya_p03_ic_iodine_barium_radioisotopes_last_7d, ya_p03_ic_knee_stability, ya_p03_ic_nutri_qs, ya_p03_ic_over_weight_200_height_195, ya_p03_ic_pacemaker_defibrillator, ya_p03_ic_pneumothorax, ya_p03_ic_pregnancy, ya_p03_ic_recent_eye_abdominal_chest_surgery, ya_p03_ic_recent_myocardial_infarction, ya_p03_ic_spirometry, ya_p03_ic_surgical_metal_body, ya_p03_ic_unstable_angina_pectoris, ya_p03_ic_ya_dl_elspac, ya_p03_ic_ya_med_find, ya_p03_ic_ya_newsletter FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 21 -- Pilot ID );
Date: 2025-11-27 05:02:35 Duration: 11s347ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__21"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__21__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: Young Adults, Pilot ID: 21 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p03__role" text, "psycap_p02_new_ya_p03__role" text, "psycap_p02_old_ya_p03__role" text, "ya_p03__role" text, "ya_p03_digi_ya03v2__role" text, "ya_p03_digi_ya04v2__role" text, "ya_p03_digi_ya05v2__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p03__state" text, "psycap_p02_new_ya_p03__state" text, "psycap_p02_old_ya_p03__state" text, "ya_p03__state" text, "ya_p03_digi_ya03v2__state" text, "ya_p03_digi_ya04v2__state" text, "ya_p03_digi_ya05v2__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p03__activity_state" text, "psycap_p02_new_ya_p03__activity_state" text, "psycap_p02_old_ya_p03__activity_state" text, "ya_p03__activity_state" text, "ya_p03_digi_ya03v2__activity_state" text, "ya_p03_digi_ya04v2__activity_state" text, "ya_p03_digi_ya05v2__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p03__created_at" text, "psycap_p02_new_ya_p03__created_at" text, "psycap_p02_old_ya_p03__created_at" text, "ya_p03__created_at" text, "ya_p03_digi_ya03v2__created_at" text, "ya_p03_digi_ya04v2__created_at" text, "ya_p03_digi_ya05v2__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p03__accepted_at" text, "psycap_p02_new_ya_p03__accepted_at" text, "psycap_p02_old_ya_p03__accepted_at" text, "ya_p03__accepted_at" text, "ya_p03_digi_ya03v2__accepted_at" text, "ya_p03_digi_ya04v2__accepted_at" text, "ya_p03_digi_ya05v2__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p03__cancelled_at" text, "psycap_p02_new_ya_p03__cancelled_at" text, "psycap_p02_old_ya_p03__cancelled_at" text, "ya_p03__cancelled_at" text, "ya_p03_digi_ya03v2__cancelled_at" text, "ya_p03_digi_ya04v2__cancelled_at" text, "ya_p03_digi_ya05v2__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p03__revoked_at" text, "psycap_p02_new_ya_p03__revoked_at" text, "psycap_p02_old_ya_p03__revoked_at" text, "ya_p03__revoked_at" text, "ya_p03_digi_ya03v2__revoked_at" text, "ya_p03_digi_ya04v2__revoked_at" text, "ya_p03_digi_ya05v2__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p03__paused_at" text, "psycap_p02_new_ya_p03__paused_at" text, "psycap_p02_old_ya_p03__paused_at" text, "ya_p03__paused_at" text, "ya_p03_digi_ya03v2__paused_at" text, "ya_p03_digi_ya04v2__paused_at" text, "ya_p03_digi_ya05v2__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p03_ic_buccal_swab_proband'), ('ya_p03_ic_urine_proband'), ('ya_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p03_ic_buccal_swab_proband" text, "ya_p03_ic_urine_proband" text, "ya_p03_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p03_ic_anam_qs'), ('ya_p03_ic_aneurysm'), ('ya_p03_ic_anthropometry'), ('ya_p03_ic_arch_foot'), ('ya_p03_ic_basic_qs'), ('ya_p03_ic_blood_pressure'), ('ya_p03_ic_braces_piercing_iud'), ('ya_p03_ic_cognition_test'), ('ya_p03_ic_da_health_registry'), ('ya_p03_ic_dexa'), ('ya_p03_ic_enviro_qs'), ('ya_p03_ic_follow_up_studies'), ('ya_p03_ic_fracture_lower_body_last_3m'), ('ya_p03_ic_fracture_upper_body_last_3m'), ('ya_p03_ic_hand_grip'), ('ya_p03_ic_hearing_vision_impairment'), ('ya_p03_ic_heart_disease'), ('ya_p03_ic_hemoptysis_ns'), ('ya_p03_ic_hernia'), ('ya_p03_ic_hyperthyroidism'), ('ya_p03_ic_inability_hold_pencil'), ('ya_p03_ic_inability_stand_both_legs'), ('ya_p03_ic_inability_talk_cze'), ('ya_p03_ic_inability_walk'), ('ya_p03_ic_inbody'), ('ya_p03_ic_infectious_resp_diseases'), ('ya_p03_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p03_ic_knee_stability'), ('ya_p03_ic_nutri_qs'), ('ya_p03_ic_over_weight_200_height_195'), ('ya_p03_ic_pacemaker_defibrillator'), ('ya_p03_ic_pneumothorax'), ('ya_p03_ic_pregnancy'), ('ya_p03_ic_recent_eye_abdominal_chest_surgery'), ('ya_p03_ic_recent_myocardial_infarction'), ('ya_p03_ic_spirometry'), ('ya_p03_ic_surgical_metal_body'), ('ya_p03_ic_unstable_angina_pectoris'), ('ya_p03_ic_ya_dl_elspac'), ('ya_p03_ic_ya_med_find'), ('ya_p03_ic_ya_newsletter') $$ ) AS extra_state ("subject_id" int, "ya_p03_ic_anam_qs" text, "ya_p03_ic_aneurysm" text, "ya_p03_ic_anthropometry" text, "ya_p03_ic_arch_foot" text, "ya_p03_ic_basic_qs" text, "ya_p03_ic_blood_pressure" text, "ya_p03_ic_braces_piercing_iud" text, "ya_p03_ic_cognition_test" text, "ya_p03_ic_da_health_registry" text, "ya_p03_ic_dexa" text, "ya_p03_ic_enviro_qs" text, "ya_p03_ic_follow_up_studies" text, "ya_p03_ic_fracture_lower_body_last_3m" text, "ya_p03_ic_fracture_upper_body_last_3m" text, "ya_p03_ic_hand_grip" text, "ya_p03_ic_hearing_vision_impairment" text, "ya_p03_ic_heart_disease" text, "ya_p03_ic_hemoptysis_ns" text, "ya_p03_ic_hernia" text, "ya_p03_ic_hyperthyroidism" text, "ya_p03_ic_inability_hold_pencil" text, "ya_p03_ic_inability_stand_both_legs" text, "ya_p03_ic_inability_talk_cze" text, "ya_p03_ic_inability_walk" text, "ya_p03_ic_inbody" text, "ya_p03_ic_infectious_resp_diseases" text, "ya_p03_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p03_ic_knee_stability" text, "ya_p03_ic_nutri_qs" text, "ya_p03_ic_over_weight_200_height_195" text, "ya_p03_ic_pacemaker_defibrillator" text, "ya_p03_ic_pneumothorax" text, "ya_p03_ic_pregnancy" text, "ya_p03_ic_recent_eye_abdominal_chest_surgery" text, "ya_p03_ic_recent_myocardial_infarction" text, "ya_p03_ic_spirometry" text, "ya_p03_ic_surgical_metal_body" text, "ya_p03_ic_unstable_angina_pectoris" text, "ya_p03_ic_ya_dl_elspac" text, "ya_p03_ic_ya_med_find" text, "ya_p03_ic_ya_newsletter" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p03__role, psc_role.psycap_p02_new_ya_p03__role, psc_role.psycap_p02_old_ya_p03__role, psc_role.ya_p03__role, psc_role.ya_p03_digi_ya03v2__role, psc_role.ya_p03_digi_ya04v2__role, psc_role.ya_p03_digi_ya05v2__role, psc_state.psycap_p01_ya_p03__state, psc_state.psycap_p02_new_ya_p03__state, psc_state.psycap_p02_old_ya_p03__state, psc_state.ya_p03__state, psc_state.ya_p03_digi_ya03v2__state, psc_state.ya_p03_digi_ya04v2__state, psc_state.ya_p03_digi_ya05v2__state, psc_activity_state.psycap_p01_ya_p03__activity_state, psc_activity_state.psycap_p02_new_ya_p03__activity_state, psc_activity_state.psycap_p02_old_ya_p03__activity_state, psc_activity_state.ya_p03__activity_state, psc_activity_state.ya_p03_digi_ya03v2__activity_state, psc_activity_state.ya_p03_digi_ya04v2__activity_state, psc_activity_state.ya_p03_digi_ya05v2__activity_state, psc_created_at.psycap_p01_ya_p03__created_at, psc_created_at.psycap_p02_new_ya_p03__created_at, psc_created_at.psycap_p02_old_ya_p03__created_at, psc_created_at.ya_p03__created_at, psc_created_at.ya_p03_digi_ya03v2__created_at, psc_created_at.ya_p03_digi_ya04v2__created_at, psc_created_at.ya_p03_digi_ya05v2__created_at, psc_accepted_at.psycap_p01_ya_p03__accepted_at, psc_accepted_at.psycap_p02_new_ya_p03__accepted_at, psc_accepted_at.psycap_p02_old_ya_p03__accepted_at, psc_accepted_at.ya_p03__accepted_at, psc_accepted_at.ya_p03_digi_ya03v2__accepted_at, psc_accepted_at.ya_p03_digi_ya04v2__accepted_at, psc_accepted_at.ya_p03_digi_ya05v2__accepted_at, psc_cancelled_at.psycap_p01_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_new_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p03__cancelled_at, psc_cancelled_at.ya_p03__cancelled_at, psc_cancelled_at.ya_p03_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya05v2__cancelled_at, psc_revoked_at.psycap_p01_ya_p03__revoked_at, psc_revoked_at.psycap_p02_new_ya_p03__revoked_at, psc_revoked_at.psycap_p02_old_ya_p03__revoked_at, psc_revoked_at.ya_p03__revoked_at, psc_revoked_at.ya_p03_digi_ya03v2__revoked_at, psc_revoked_at.ya_p03_digi_ya04v2__revoked_at, psc_revoked_at.ya_p03_digi_ya05v2__revoked_at, psc_paused_at.psycap_p01_ya_p03__paused_at, psc_paused_at.psycap_p02_new_ya_p03__paused_at, psc_paused_at.psycap_p02_old_ya_p03__paused_at, psc_paused_at.ya_p03__paused_at, psc_paused_at.ya_p03_digi_ya03v2__paused_at, psc_paused_at.ya_p03_digi_ya04v2__paused_at, psc_paused_at.ya_p03_digi_ya05v2__paused_at, ya_p03_ic_buccal_swab_proband, ya_p03_ic_urine_proband, ya_p03_ic_venous_blood_proband, ya_p03_ic_anam_qs, ya_p03_ic_aneurysm, ya_p03_ic_anthropometry, ya_p03_ic_arch_foot, ya_p03_ic_basic_qs, ya_p03_ic_blood_pressure, ya_p03_ic_braces_piercing_iud, ya_p03_ic_cognition_test, ya_p03_ic_da_health_registry, ya_p03_ic_dexa, ya_p03_ic_enviro_qs, ya_p03_ic_follow_up_studies, ya_p03_ic_fracture_lower_body_last_3m, ya_p03_ic_fracture_upper_body_last_3m, ya_p03_ic_hand_grip, ya_p03_ic_hearing_vision_impairment, ya_p03_ic_heart_disease, ya_p03_ic_hemoptysis_ns, ya_p03_ic_hernia, ya_p03_ic_hyperthyroidism, ya_p03_ic_inability_hold_pencil, ya_p03_ic_inability_stand_both_legs, ya_p03_ic_inability_talk_cze, ya_p03_ic_inability_walk, ya_p03_ic_inbody, ya_p03_ic_infectious_resp_diseases, ya_p03_ic_iodine_barium_radioisotopes_last_7d, ya_p03_ic_knee_stability, ya_p03_ic_nutri_qs, ya_p03_ic_over_weight_200_height_195, ya_p03_ic_pacemaker_defibrillator, ya_p03_ic_pneumothorax, ya_p03_ic_pregnancy, ya_p03_ic_recent_eye_abdominal_chest_surgery, ya_p03_ic_recent_myocardial_infarction, ya_p03_ic_spirometry, ya_p03_ic_surgical_metal_body, ya_p03_ic_unstable_angina_pectoris, ya_p03_ic_ya_dl_elspac, ya_p03_ic_ya_med_find, ya_p03_ic_ya_newsletter FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 21 -- Pilot ID );
Date: 2025-11-27 17:02:29 Duration: 2s352ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
7 13s269ms 2 2s853ms 10s415ms 6s634ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__20__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "dust_p01_tng_p11__role" text, "tng_p11__role" text, "tng_p11_monitor__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "dust_p01_tng_p11__state" text, "tng_p11__state" text, "tng_p11_monitor__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as activity ("subject_id" int, "dust_p01_tng_p11__activity_state" text, "tng_p11__activity_state" text, "tng_p11_monitor__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as created_at ("subject_id" int, "dust_p01_tng_p11__created_at" text, "tng_p11__created_at" text, "tng_p11_monitor__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "dust_p01_tng_p11__accepted_at" text, "tng_p11__accepted_at" text, "tng_p11_monitor__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "dust_p01_tng_p11__cancelled_at" text, "tng_p11__cancelled_at" text, "tng_p11_monitor__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "dust_p01_tng_p11__revoked_at" text, "tng_p11__revoked_at" text, "tng_p11_monitor__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as paused_at ("subject_id" int, "dust_p01_tng_p11__paused_at" text, "tng_p11__paused_at" text, "tng_p11_monitor__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "dust_p01_tng_p11_ic_dust_mother" text, "tng_p11_ic_buccal_swab_child" text, "tng_p11_ic_buccal_swab_mother" text, "tng_p11_ic_cord_blood_mother" text, "tng_p11_ic_drop_blood_child" text, "tng_p11_ic_stool_child" text, "tng_p11_ic_urine_mother" text, "tng_p11_ic_venous_blood_mother" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "dust_p01_tng_p11_ic_dl_celpac_studies" text, "dust_p01_tng_p11_ic_survey" text, "tng_p11_ic_celspac_newsletter" text, "tng_p11_ic_dl_celpac_studies" text, "tng_p11_ic_med_find" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.dust_p01_tng_p11__role, psc_role.tng_p11__role, psc_role.tng_p11_monitor__role, psc_state.dust_p01_tng_p11__state, psc_state.tng_p11__state, psc_state.tng_p11_monitor__state, psc_activity_state.dust_p01_tng_p11__activity_state, psc_activity_state.tng_p11__activity_state, psc_activity_state.tng_p11_monitor__activity_state, psc_created_at.dust_p01_tng_p11__created_at, psc_created_at.tng_p11__created_at, psc_created_at.tng_p11_monitor__created_at, psc_accepted_at.dust_p01_tng_p11__accepted_at, psc_accepted_at.tng_p11__accepted_at, psc_accepted_at.tng_p11_monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p11__cancelled_at, psc_cancelled_at.tng_p11__cancelled_at, psc_cancelled_at.tng_p11_monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p11__revoked_at, psc_revoked_at.tng_p11__revoked_at, psc_revoked_at.tng_p11_monitor__revoked_at, psc_paused_at.dust_p01_tng_p11__paused_at, psc_paused_at.tng_p11__paused_at, psc_paused_at.tng_p11_monitor__paused_at, dust_p01_tng_p11_ic_dust_mother, tng_p11_ic_buccal_swab_child, tng_p11_ic_buccal_swab_mother, tng_p11_ic_cord_blood_mother, tng_p11_ic_drop_blood_child, tng_p11_ic_stool_child, tng_p11_ic_urine_mother, tng_p11_ic_venous_blood_mother, dust_p01_tng_p11_ic_dl_celpac_studies, dust_p01_tng_p11_ic_survey, tng_p11_ic_celspac_newsletter, tng_p11_ic_dl_celpac_studies, tng_p11_ic_med_find from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #7
Day Hour Count Duration Avg duration Nov 27 05 1 10s415ms 10s415ms 17 1 2s853ms 2s853ms [ User: tng_migration_user - Total duration: 13s269ms - Times executed: 2 ]
[ Application: dbt - Total duration: 13s269ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__20"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__20__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: TNG, Pilot ID: 20 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p11__role" text, "tng_p11__role" text, "tng_p11_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p11__state" text, "tng_p11__state" text, "tng_p11_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p11__activity_state" text, "tng_p11__activity_state" text, "tng_p11_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p11__created_at" text, "tng_p11__created_at" text, "tng_p11_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p11__accepted_at" text, "tng_p11__accepted_at" text, "tng_p11_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p11__cancelled_at" text, "tng_p11__cancelled_at" text, "tng_p11_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p11__revoked_at" text, "tng_p11__revoked_at" text, "tng_p11_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p11__paused_at" text, "tng_p11__paused_at" text, "tng_p11_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11_ic_dust_mother'), ('tng_p11_ic_buccal_swab_child'), ('tng_p11_ic_buccal_swab_mother'), ('tng_p11_ic_cord_blood_mother'), ('tng_p11_ic_drop_blood_child'), ('tng_p11_ic_stool_child'), ('tng_p11_ic_urine_mother'), ('tng_p11_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p11_ic_dust_mother" text, "tng_p11_ic_buccal_swab_child" text, "tng_p11_ic_buccal_swab_mother" text, "tng_p11_ic_cord_blood_mother" text, "tng_p11_ic_drop_blood_child" text, "tng_p11_ic_stool_child" text, "tng_p11_ic_urine_mother" text, "tng_p11_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11_ic_dl_celpac_studies'), ('dust_p01_tng_p11_ic_survey'), ('tng_p11_ic_celspac_newsletter'), ('tng_p11_ic_dl_celpac_studies'), ('tng_p11_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p11_ic_dl_celpac_studies" text, "dust_p01_tng_p11_ic_survey" text, "tng_p11_ic_celspac_newsletter" text, "tng_p11_ic_dl_celpac_studies" text, "tng_p11_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p11__role, psc_role.tng_p11__role, psc_role.tng_p11_monitor__role, psc_state.dust_p01_tng_p11__state, psc_state.tng_p11__state, psc_state.tng_p11_monitor__state, psc_activity_state.dust_p01_tng_p11__activity_state, psc_activity_state.tng_p11__activity_state, psc_activity_state.tng_p11_monitor__activity_state, psc_created_at.dust_p01_tng_p11__created_at, psc_created_at.tng_p11__created_at, psc_created_at.tng_p11_monitor__created_at, psc_accepted_at.dust_p01_tng_p11__accepted_at, psc_accepted_at.tng_p11__accepted_at, psc_accepted_at.tng_p11_monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p11__cancelled_at, psc_cancelled_at.tng_p11__cancelled_at, psc_cancelled_at.tng_p11_monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p11__revoked_at, psc_revoked_at.tng_p11__revoked_at, psc_revoked_at.tng_p11_monitor__revoked_at, psc_paused_at.dust_p01_tng_p11__paused_at, psc_paused_at.tng_p11__paused_at, psc_paused_at.tng_p11_monitor__paused_at, dust_p01_tng_p11_ic_dust_mother, tng_p11_ic_buccal_swab_child, tng_p11_ic_buccal_swab_mother, tng_p11_ic_cord_blood_mother, tng_p11_ic_drop_blood_child, tng_p11_ic_stool_child, tng_p11_ic_urine_mother, tng_p11_ic_venous_blood_mother, dust_p01_tng_p11_ic_dl_celpac_studies, dust_p01_tng_p11_ic_survey, tng_p11_ic_celspac_newsletter, tng_p11_ic_dl_celpac_studies, tng_p11_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 20 -- Pilot ID );
Date: 2025-11-27 05:02:34 Duration: 10s415ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__20"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__20__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: TNG, Pilot ID: 20 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p11__role" text, "tng_p11__role" text, "tng_p11_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p11__state" text, "tng_p11__state" text, "tng_p11_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p11__activity_state" text, "tng_p11__activity_state" text, "tng_p11_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p11__created_at" text, "tng_p11__created_at" text, "tng_p11_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p11__accepted_at" text, "tng_p11__accepted_at" text, "tng_p11_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p11__cancelled_at" text, "tng_p11__cancelled_at" text, "tng_p11_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p11__revoked_at" text, "tng_p11__revoked_at" text, "tng_p11_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p11__paused_at" text, "tng_p11__paused_at" text, "tng_p11_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11_ic_dust_mother'), ('tng_p11_ic_buccal_swab_child'), ('tng_p11_ic_buccal_swab_mother'), ('tng_p11_ic_cord_blood_mother'), ('tng_p11_ic_drop_blood_child'), ('tng_p11_ic_stool_child'), ('tng_p11_ic_urine_mother'), ('tng_p11_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p11_ic_dust_mother" text, "tng_p11_ic_buccal_swab_child" text, "tng_p11_ic_buccal_swab_mother" text, "tng_p11_ic_cord_blood_mother" text, "tng_p11_ic_drop_blood_child" text, "tng_p11_ic_stool_child" text, "tng_p11_ic_urine_mother" text, "tng_p11_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11_ic_dl_celpac_studies'), ('dust_p01_tng_p11_ic_survey'), ('tng_p11_ic_celspac_newsletter'), ('tng_p11_ic_dl_celpac_studies'), ('tng_p11_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p11_ic_dl_celpac_studies" text, "dust_p01_tng_p11_ic_survey" text, "tng_p11_ic_celspac_newsletter" text, "tng_p11_ic_dl_celpac_studies" text, "tng_p11_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p11__role, psc_role.tng_p11__role, psc_role.tng_p11_monitor__role, psc_state.dust_p01_tng_p11__state, psc_state.tng_p11__state, psc_state.tng_p11_monitor__state, psc_activity_state.dust_p01_tng_p11__activity_state, psc_activity_state.tng_p11__activity_state, psc_activity_state.tng_p11_monitor__activity_state, psc_created_at.dust_p01_tng_p11__created_at, psc_created_at.tng_p11__created_at, psc_created_at.tng_p11_monitor__created_at, psc_accepted_at.dust_p01_tng_p11__accepted_at, psc_accepted_at.tng_p11__accepted_at, psc_accepted_at.tng_p11_monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p11__cancelled_at, psc_cancelled_at.tng_p11__cancelled_at, psc_cancelled_at.tng_p11_monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p11__revoked_at, psc_revoked_at.tng_p11__revoked_at, psc_revoked_at.tng_p11_monitor__revoked_at, psc_paused_at.dust_p01_tng_p11__paused_at, psc_paused_at.tng_p11__paused_at, psc_paused_at.tng_p11_monitor__paused_at, dust_p01_tng_p11_ic_dust_mother, tng_p11_ic_buccal_swab_child, tng_p11_ic_buccal_swab_mother, tng_p11_ic_cord_blood_mother, tng_p11_ic_drop_blood_child, tng_p11_ic_stool_child, tng_p11_ic_urine_mother, tng_p11_ic_venous_blood_mother, dust_p01_tng_p11_ic_dl_celpac_studies, dust_p01_tng_p11_ic_survey, tng_p11_ic_celspac_newsletter, tng_p11_ic_dl_celpac_studies, tng_p11_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 20 -- Pilot ID );
Date: 2025-11-27 17:02:30 Duration: 2s853ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
8 12s763ms 156 31ms 175ms 81ms with values as ( select label as value from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? group by label order by ? ) select value from values;Times Reported Time consuming queries #8
Day Hour Count Duration Avg duration Nov 27 05 78 5s497ms 70ms 17 78 7s266ms 93ms [ User: tng_migration_user - Total duration: 12s763ms - Times executed: 156 ]
[ Application: dbt - Total duration: 12s763ms - Times executed: 156 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__21"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 21 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-11-27 17:02:27 Duration: 175ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__21"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 21 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-11-27 17:02:27 Duration: 165ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__22"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 22 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-11-27 17:02:27 Duration: 164ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
9 12s369ms 22,113 0ms 3ms 0ms select m0_.id as id_0, m0_.result_date as result_date_1, m0_.use_alternative as use_alternative_2, m0_.subject_subcohort_id as subject_subcohort_id_3, m0_.subject_id as subject_id_4, m0_.subject_about_id as subject_about_id_5, m0_.subject_extend_id as subject_extend_id_6, m0_.subject_role_code as subject_role_code_7, m0_.timeing_t0_type_code as timeing_t0_type_code_8, m0_.pilot_id as pilot_id_9, m0_.subcohort_id as subcohort_id_10, m0_.subject_subcohort_id as subject_subcohort_id_11, m0_.form_structure_variant_id as form_structure_variant_id_12, m0_.form_id as form_id_13, m0_.form_state_code as form_state_code_14 from core.mv_subject_form m0_ where m0_.form_structure_variant_id in (...) and m0_.form_id is null and m0_.result_date <= ? and m0_.use_alternative <> ?;Times Reported Time consuming queries #9
Day Hour Count Duration Avg duration Nov 27 05 1,170 649ms 0ms 06 1,170 658ms 0ms 07 1,170 669ms 0ms 08 1,170 639ms 0ms 09 1,170 632ms 0ms 10 1,170 639ms 0ms 11 1,170 657ms 0ms 12 1,170 673ms 0ms 13 1,170 670ms 0ms 14 1,170 669ms 0ms 15 1,170 646ms 0ms 16 1,170 641ms 0ms 17 1,053 587ms 0ms 18 1,170 653ms 0ms 19 1,170 679ms 0ms 20 1,170 657ms 0ms 21 1,170 645ms 0ms 22 1,170 658ms 0ms 23 1,170 640ms 0ms [ User: tng_migration_user - Total duration: 12s369ms - Times executed: 22113 ]
[ Application: [unknown] - Total duration: 12s369ms - Times executed: 22113 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('82') AND m0_.form_id IS NULL AND m0_.result_date <= '2021-12-13 12:30:01' AND m0_.use_alternative <> 't';
Date: 2025-11-27 12:30:03 Duration: 3ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('80') AND m0_.form_id IS NULL AND m0_.result_date <= '2020-12-13 12:30:01' AND m0_.use_alternative <> 't';
Date: 2025-11-27 12:30:03 Duration: 3ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('83') AND m0_.form_id IS NULL AND m0_.result_date <= '2020-12-13 12:30:01' AND m0_.use_alternative <> 't';
Date: 2025-11-27 12:30:03 Duration: 3ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
10 12s6ms 3,156 0ms 977ms 3ms commit;Times Reported Time consuming queries #10
Day Hour Count Duration Avg duration Nov 27 00 100 298ms 2ms 05 657 3s799ms 5ms 06 417 760ms 1ms 07 137 158ms 1ms 08 126 290ms 2ms 09 109 242ms 2ms 10 122 145ms 1ms 11 114 306ms 2ms 12 123 169ms 1ms 13 106 205ms 1ms 14 104 180ms 1ms 15 109 174ms 1ms 16 111 1s146ms 10ms 17 147 2s779ms 18ms 18 123 258ms 2ms 19 107 211ms 1ms 20 104 136ms 1ms 21 105 329ms 3ms 22 118 282ms 2ms 23 117 128ms 1ms [ User: tng_migration_user - Total duration: 12s6ms - Times executed: 3156 ]
[ Application: [unknown] - Total duration: 6s737ms - Times executed: 3062 ]
[ Application: dbt - Total duration: 5s268ms - Times executed: 94 ]
-
COMMIT;
Date: 2025-11-27 17:02:25 Duration: 977ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
COMMIT;
Date: 2025-11-27 17:02:25 Duration: 898ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
COMMIT;
Date: 2025-11-27 16:23:02 Duration: 819ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
11 11s827ms 2 1s168ms 10s659ms 5s913ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__18__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as role ("subject_id" int, "hba_p01__role" text, "psycap_p01_hba_p01__role" text, "psycap_p02_new_hba_p01__role" text, "psycap_p02_old_hba_p01__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as role ("subject_id" int, "hba_p01__state" text, "psycap_p01_hba_p01__state" text, "psycap_p02_new_hba_p01__state" text, "psycap_p02_old_hba_p01__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as activity ("subject_id" int, "hba_p01__activity_state" text, "psycap_p01_hba_p01__activity_state" text, "psycap_p02_new_hba_p01__activity_state" text, "psycap_p02_old_hba_p01__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as created_at ("subject_id" int, "hba_p01__created_at" text, "psycap_p01_hba_p01__created_at" text, "psycap_p02_new_hba_p01__created_at" text, "psycap_p02_old_hba_p01__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "hba_p01__accepted_at" text, "psycap_p01_hba_p01__accepted_at" text, "psycap_p02_new_hba_p01__accepted_at" text, "psycap_p02_old_hba_p01__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "hba_p01__cancelled_at" text, "psycap_p01_hba_p01__cancelled_at" text, "psycap_p02_new_hba_p01__cancelled_at" text, "psycap_p02_old_hba_p01__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "hba_p01__revoked_at" text, "psycap_p01_hba_p01__revoked_at" text, "psycap_p02_new_hba_p01__revoked_at" text, "psycap_p02_old_hba_p01__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as paused_at ("subject_id" int, "hba_p01__paused_at" text, "psycap_p01_hba_p01__paused_at" text, "psycap_p02_new_hba_p01__paused_at" text, "psycap_p02_old_hba_p01__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as biomaterial_state ("subject_id" int, "hba_p01_ic_buccal_swab_proband" text, "hba_p01_ic_venous_blood_proband" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "hba_p01_ic_anthropometry" text, "hba_p01_ic_blood_pressure" text, "hba_p01_ic_da_health_registry" text, "hba_p01_ic_dl_elspac" text, "hba_p01_ic_dl_hba_future_studies" text, "hba_p01_ic_dl_tng" text, "hba_p01_ic_dl_tooth" text, "hba_p01_ic_dl_vulde" text, "hba_p01_ic_dl_ya" text, "hba_p01_ic_hba_med_find" text, "hba_p01_ic_hba_newsletter" text, "hba_p01_ic_mri" text, "hba_p01_ic_spirometry" text, "hba_p01_ic_survey" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.hba_p01__role, psc_role.psycap_p01_hba_p01__role, psc_role.psycap_p02_new_hba_p01__role, psc_role.psycap_p02_old_hba_p01__role, psc_state.hba_p01__state, psc_state.psycap_p01_hba_p01__state, psc_state.psycap_p02_new_hba_p01__state, psc_state.psycap_p02_old_hba_p01__state, psc_activity_state.hba_p01__activity_state, psc_activity_state.psycap_p01_hba_p01__activity_state, psc_activity_state.psycap_p02_new_hba_p01__activity_state, psc_activity_state.psycap_p02_old_hba_p01__activity_state, psc_created_at.hba_p01__created_at, psc_created_at.psycap_p01_hba_p01__created_at, psc_created_at.psycap_p02_new_hba_p01__created_at, psc_created_at.psycap_p02_old_hba_p01__created_at, psc_accepted_at.hba_p01__accepted_at, psc_accepted_at.psycap_p01_hba_p01__accepted_at, psc_accepted_at.psycap_p02_new_hba_p01__accepted_at, psc_accepted_at.psycap_p02_old_hba_p01__accepted_at, psc_cancelled_at.hba_p01__cancelled_at, psc_cancelled_at.psycap_p01_hba_p01__cancelled_at, psc_cancelled_at.psycap_p02_new_hba_p01__cancelled_at, psc_cancelled_at.psycap_p02_old_hba_p01__cancelled_at, psc_revoked_at.hba_p01__revoked_at, psc_revoked_at.psycap_p01_hba_p01__revoked_at, psc_revoked_at.psycap_p02_new_hba_p01__revoked_at, psc_revoked_at.psycap_p02_old_hba_p01__revoked_at, psc_paused_at.hba_p01__paused_at, psc_paused_at.psycap_p01_hba_p01__paused_at, psc_paused_at.psycap_p02_new_hba_p01__paused_at, psc_paused_at.psycap_p02_old_hba_p01__paused_at, hba_p01_ic_buccal_swab_proband, hba_p01_ic_venous_blood_proband, hba_p01_ic_anthropometry, hba_p01_ic_blood_pressure, hba_p01_ic_da_health_registry, hba_p01_ic_dl_elspac, hba_p01_ic_dl_hba_future_studies, hba_p01_ic_dl_tng, hba_p01_ic_dl_tooth, hba_p01_ic_dl_vulde, hba_p01_ic_dl_ya, hba_p01_ic_hba_med_find, hba_p01_ic_hba_newsletter, hba_p01_ic_mri, hba_p01_ic_spirometry, hba_p01_ic_survey from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #11
Day Hour Count Duration Avg duration Nov 27 05 1 10s659ms 10s659ms 17 1 1s168ms 1s168ms [ User: tng_migration_user - Total duration: 11s827ms - Times executed: 2 ]
[ Application: dbt - Total duration: 11s827ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__18"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__18__dbt_tmp" as ( -- suject (proband) patrici do kohorty HBA, Pilot ID: 18 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS role ("subject_id" int, "hba_p01__role" text, "psycap_p01_hba_p01__role" text, "psycap_p02_new_hba_p01__role" text, "psycap_p02_old_hba_p01__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS role ("subject_id" int, "hba_p01__state" text, "psycap_p01_hba_p01__state" text, "psycap_p02_new_hba_p01__state" text, "psycap_p02_old_hba_p01__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS activity ("subject_id" int, "hba_p01__activity_state" text, "psycap_p01_hba_p01__activity_state" text, "psycap_p02_new_hba_p01__activity_state" text, "psycap_p02_old_hba_p01__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS created_at ("subject_id" int, "hba_p01__created_at" text, "psycap_p01_hba_p01__created_at" text, "psycap_p02_new_hba_p01__created_at" text, "psycap_p02_old_hba_p01__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS accepted_at ("subject_id" int, "hba_p01__accepted_at" text, "psycap_p01_hba_p01__accepted_at" text, "psycap_p02_new_hba_p01__accepted_at" text, "psycap_p02_old_hba_p01__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS cancelled_at ("subject_id" int, "hba_p01__cancelled_at" text, "psycap_p01_hba_p01__cancelled_at" text, "psycap_p02_new_hba_p01__cancelled_at" text, "psycap_p02_old_hba_p01__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS revoked_at ("subject_id" int, "hba_p01__revoked_at" text, "psycap_p01_hba_p01__revoked_at" text, "psycap_p02_new_hba_p01__revoked_at" text, "psycap_p02_old_hba_p01__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS paused_at ("subject_id" int, "hba_p01__paused_at" text, "psycap_p01_hba_p01__paused_at" text, "psycap_p02_new_hba_p01__paused_at" text, "psycap_p02_old_hba_p01__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01_ic_buccal_swab_proband'), ('hba_p01_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "hba_p01_ic_buccal_swab_proband" text, "hba_p01_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01_ic_anthropometry'), ('hba_p01_ic_blood_pressure'), ('hba_p01_ic_da_health_registry'), ('hba_p01_ic_dl_elspac'), ('hba_p01_ic_dl_hba_future_studies'), ('hba_p01_ic_dl_tng'), ('hba_p01_ic_dl_tooth'), ('hba_p01_ic_dl_vulde'), ('hba_p01_ic_dl_ya'), ('hba_p01_ic_hba_med_find'), ('hba_p01_ic_hba_newsletter'), ('hba_p01_ic_mri'), ('hba_p01_ic_spirometry'), ('hba_p01_ic_survey') $$ ) AS extra_state ("subject_id" int, "hba_p01_ic_anthropometry" text, "hba_p01_ic_blood_pressure" text, "hba_p01_ic_da_health_registry" text, "hba_p01_ic_dl_elspac" text, "hba_p01_ic_dl_hba_future_studies" text, "hba_p01_ic_dl_tng" text, "hba_p01_ic_dl_tooth" text, "hba_p01_ic_dl_vulde" text, "hba_p01_ic_dl_ya" text, "hba_p01_ic_hba_med_find" text, "hba_p01_ic_hba_newsletter" text, "hba_p01_ic_mri" text, "hba_p01_ic_spirometry" text, "hba_p01_ic_survey" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.hba_p01__role, psc_role.psycap_p01_hba_p01__role, psc_role.psycap_p02_new_hba_p01__role, psc_role.psycap_p02_old_hba_p01__role, psc_state.hba_p01__state, psc_state.psycap_p01_hba_p01__state, psc_state.psycap_p02_new_hba_p01__state, psc_state.psycap_p02_old_hba_p01__state, psc_activity_state.hba_p01__activity_state, psc_activity_state.psycap_p01_hba_p01__activity_state, psc_activity_state.psycap_p02_new_hba_p01__activity_state, psc_activity_state.psycap_p02_old_hba_p01__activity_state, psc_created_at.hba_p01__created_at, psc_created_at.psycap_p01_hba_p01__created_at, psc_created_at.psycap_p02_new_hba_p01__created_at, psc_created_at.psycap_p02_old_hba_p01__created_at, psc_accepted_at.hba_p01__accepted_at, psc_accepted_at.psycap_p01_hba_p01__accepted_at, psc_accepted_at.psycap_p02_new_hba_p01__accepted_at, psc_accepted_at.psycap_p02_old_hba_p01__accepted_at, psc_cancelled_at.hba_p01__cancelled_at, psc_cancelled_at.psycap_p01_hba_p01__cancelled_at, psc_cancelled_at.psycap_p02_new_hba_p01__cancelled_at, psc_cancelled_at.psycap_p02_old_hba_p01__cancelled_at, psc_revoked_at.hba_p01__revoked_at, psc_revoked_at.psycap_p01_hba_p01__revoked_at, psc_revoked_at.psycap_p02_new_hba_p01__revoked_at, psc_revoked_at.psycap_p02_old_hba_p01__revoked_at, psc_paused_at.hba_p01__paused_at, psc_paused_at.psycap_p01_hba_p01__paused_at, psc_paused_at.psycap_p02_new_hba_p01__paused_at, psc_paused_at.psycap_p02_old_hba_p01__paused_at, hba_p01_ic_buccal_swab_proband, hba_p01_ic_venous_blood_proband, hba_p01_ic_anthropometry, hba_p01_ic_blood_pressure, hba_p01_ic_da_health_registry, hba_p01_ic_dl_elspac, hba_p01_ic_dl_hba_future_studies, hba_p01_ic_dl_tng, hba_p01_ic_dl_tooth, hba_p01_ic_dl_vulde, hba_p01_ic_dl_ya, hba_p01_ic_hba_med_find, hba_p01_ic_hba_newsletter, hba_p01_ic_mri, hba_p01_ic_spirometry, hba_p01_ic_survey FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 18 -- Pilot ID );
Date: 2025-11-27 05:02:34 Duration: 10s659ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__18"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__18__dbt_tmp" as ( -- suject (proband) patrici do kohorty HBA, Pilot ID: 18 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS role ("subject_id" int, "hba_p01__role" text, "psycap_p01_hba_p01__role" text, "psycap_p02_new_hba_p01__role" text, "psycap_p02_old_hba_p01__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS role ("subject_id" int, "hba_p01__state" text, "psycap_p01_hba_p01__state" text, "psycap_p02_new_hba_p01__state" text, "psycap_p02_old_hba_p01__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS activity ("subject_id" int, "hba_p01__activity_state" text, "psycap_p01_hba_p01__activity_state" text, "psycap_p02_new_hba_p01__activity_state" text, "psycap_p02_old_hba_p01__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS created_at ("subject_id" int, "hba_p01__created_at" text, "psycap_p01_hba_p01__created_at" text, "psycap_p02_new_hba_p01__created_at" text, "psycap_p02_old_hba_p01__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS accepted_at ("subject_id" int, "hba_p01__accepted_at" text, "psycap_p01_hba_p01__accepted_at" text, "psycap_p02_new_hba_p01__accepted_at" text, "psycap_p02_old_hba_p01__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS cancelled_at ("subject_id" int, "hba_p01__cancelled_at" text, "psycap_p01_hba_p01__cancelled_at" text, "psycap_p02_new_hba_p01__cancelled_at" text, "psycap_p02_old_hba_p01__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS revoked_at ("subject_id" int, "hba_p01__revoked_at" text, "psycap_p01_hba_p01__revoked_at" text, "psycap_p02_new_hba_p01__revoked_at" text, "psycap_p02_old_hba_p01__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS paused_at ("subject_id" int, "hba_p01__paused_at" text, "psycap_p01_hba_p01__paused_at" text, "psycap_p02_new_hba_p01__paused_at" text, "psycap_p02_old_hba_p01__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01_ic_buccal_swab_proband'), ('hba_p01_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "hba_p01_ic_buccal_swab_proband" text, "hba_p01_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01_ic_anthropometry'), ('hba_p01_ic_blood_pressure'), ('hba_p01_ic_da_health_registry'), ('hba_p01_ic_dl_elspac'), ('hba_p01_ic_dl_hba_future_studies'), ('hba_p01_ic_dl_tng'), ('hba_p01_ic_dl_tooth'), ('hba_p01_ic_dl_vulde'), ('hba_p01_ic_dl_ya'), ('hba_p01_ic_hba_med_find'), ('hba_p01_ic_hba_newsletter'), ('hba_p01_ic_mri'), ('hba_p01_ic_spirometry'), ('hba_p01_ic_survey') $$ ) AS extra_state ("subject_id" int, "hba_p01_ic_anthropometry" text, "hba_p01_ic_blood_pressure" text, "hba_p01_ic_da_health_registry" text, "hba_p01_ic_dl_elspac" text, "hba_p01_ic_dl_hba_future_studies" text, "hba_p01_ic_dl_tng" text, "hba_p01_ic_dl_tooth" text, "hba_p01_ic_dl_vulde" text, "hba_p01_ic_dl_ya" text, "hba_p01_ic_hba_med_find" text, "hba_p01_ic_hba_newsletter" text, "hba_p01_ic_mri" text, "hba_p01_ic_spirometry" text, "hba_p01_ic_survey" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.hba_p01__role, psc_role.psycap_p01_hba_p01__role, psc_role.psycap_p02_new_hba_p01__role, psc_role.psycap_p02_old_hba_p01__role, psc_state.hba_p01__state, psc_state.psycap_p01_hba_p01__state, psc_state.psycap_p02_new_hba_p01__state, psc_state.psycap_p02_old_hba_p01__state, psc_activity_state.hba_p01__activity_state, psc_activity_state.psycap_p01_hba_p01__activity_state, psc_activity_state.psycap_p02_new_hba_p01__activity_state, psc_activity_state.psycap_p02_old_hba_p01__activity_state, psc_created_at.hba_p01__created_at, psc_created_at.psycap_p01_hba_p01__created_at, psc_created_at.psycap_p02_new_hba_p01__created_at, psc_created_at.psycap_p02_old_hba_p01__created_at, psc_accepted_at.hba_p01__accepted_at, psc_accepted_at.psycap_p01_hba_p01__accepted_at, psc_accepted_at.psycap_p02_new_hba_p01__accepted_at, psc_accepted_at.psycap_p02_old_hba_p01__accepted_at, psc_cancelled_at.hba_p01__cancelled_at, psc_cancelled_at.psycap_p01_hba_p01__cancelled_at, psc_cancelled_at.psycap_p02_new_hba_p01__cancelled_at, psc_cancelled_at.psycap_p02_old_hba_p01__cancelled_at, psc_revoked_at.hba_p01__revoked_at, psc_revoked_at.psycap_p01_hba_p01__revoked_at, psc_revoked_at.psycap_p02_new_hba_p01__revoked_at, psc_revoked_at.psycap_p02_old_hba_p01__revoked_at, psc_paused_at.hba_p01__paused_at, psc_paused_at.psycap_p01_hba_p01__paused_at, psc_paused_at.psycap_p02_new_hba_p01__paused_at, psc_paused_at.psycap_p02_old_hba_p01__paused_at, hba_p01_ic_buccal_swab_proband, hba_p01_ic_venous_blood_proband, hba_p01_ic_anthropometry, hba_p01_ic_blood_pressure, hba_p01_ic_da_health_registry, hba_p01_ic_dl_elspac, hba_p01_ic_dl_hba_future_studies, hba_p01_ic_dl_tng, hba_p01_ic_dl_tooth, hba_p01_ic_dl_vulde, hba_p01_ic_dl_ya, hba_p01_ic_hba_med_find, hba_p01_ic_hba_newsletter, hba_p01_ic_mri, hba_p01_ic_spirometry, hba_p01_ic_survey FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 18 -- Pilot ID );
Date: 2025-11-27 17:02:26 Duration: 1s168ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
12 10s968ms 2 5s81ms 5s886ms 5s484ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__26__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "tng_p13__role" text, "tng_p13_monitor__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "tng_p13__state" text, "tng_p13_monitor__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as activity ("subject_id" int, "tng_p13__activity_state" text, "tng_p13_monitor__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as created_at ("subject_id" int, "tng_p13__created_at" text, "tng_p13_monitor__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as accepted_at ("subject_id" int, "tng_p13__accepted_at" text, "tng_p13_monitor__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as cancelled_at ("subject_id" int, "tng_p13__cancelled_at" text, "tng_p13_monitor__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as revoked_at ("subject_id" int, "tng_p13__revoked_at" text, "tng_p13_monitor__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as paused_at ("subject_id" int, "tng_p13__paused_at" text, "tng_p13_monitor__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "tng_p13_ic_buccal_swab_child" text, "tng_p13_ic_buccal_swab_mother" text, "tng_p13_ic_cord_blood_child" text, "tng_p13_ic_drop_blood_child" text, "tng_p13_ic_stool_child" text, "tng_p13_ic_urine_mother" text, "tng_p13_ic_venous_blood_mother" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as extra_state ("subject_id" int, "tng_p13_ic_celspac_newsletter" text, "tng_p13_ic_dl_celpac_studies" text, "tng_p13_ic_med_find" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.tng_p13__role, psc_role.tng_p13_monitor__role, psc_state.tng_p13__state, psc_state.tng_p13_monitor__state, psc_activity_state.tng_p13__activity_state, psc_activity_state.tng_p13_monitor__activity_state, psc_created_at.tng_p13__created_at, psc_created_at.tng_p13_monitor__created_at, psc_accepted_at.tng_p13__accepted_at, psc_accepted_at.tng_p13_monitor__accepted_at, psc_cancelled_at.tng_p13__cancelled_at, psc_cancelled_at.tng_p13_monitor__cancelled_at, psc_revoked_at.tng_p13__revoked_at, psc_revoked_at.tng_p13_monitor__revoked_at, psc_paused_at.tng_p13__paused_at, psc_paused_at.tng_p13_monitor__paused_at, tng_p13_ic_buccal_swab_child, tng_p13_ic_buccal_swab_mother, tng_p13_ic_cord_blood_child, tng_p13_ic_drop_blood_child, tng_p13_ic_stool_child, tng_p13_ic_urine_mother, tng_p13_ic_venous_blood_mother, tng_p13_ic_celspac_newsletter, tng_p13_ic_dl_celpac_studies, tng_p13_ic_med_find from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #12
Day Hour Count Duration Avg duration Nov 27 05 1 5s81ms 5s81ms 17 1 5s886ms 5s886ms [ User: tng_migration_user - Total duration: 10s968ms - Times executed: 2 ]
[ Application: dbt - Total duration: 10s968ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__26"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__26__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... TNG Pilot XIII, Pilot ID: 26 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS role ("subject_id" int, "tng_p13__role" text, "tng_p13_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS role ("subject_id" int, "tng_p13__state" text, "tng_p13_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS activity ("subject_id" int, "tng_p13__activity_state" text, "tng_p13_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS created_at ("subject_id" int, "tng_p13__created_at" text, "tng_p13_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p13__accepted_at" text, "tng_p13_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p13__cancelled_at" text, "tng_p13_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p13__revoked_at" text, "tng_p13_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS paused_at ("subject_id" int, "tng_p13__paused_at" text, "tng_p13_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13_ic_buccal_swab_child'), ('tng_p13_ic_buccal_swab_mother'), ('tng_p13_ic_cord_blood_child'), ('tng_p13_ic_drop_blood_child'), ('tng_p13_ic_stool_child'), ('tng_p13_ic_urine_mother'), ('tng_p13_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p13_ic_buccal_swab_child" text, "tng_p13_ic_buccal_swab_mother" text, "tng_p13_ic_cord_blood_child" text, "tng_p13_ic_drop_blood_child" text, "tng_p13_ic_stool_child" text, "tng_p13_ic_urine_mother" text, "tng_p13_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13_ic_celspac_newsletter'), ('tng_p13_ic_dl_celpac_studies'), ('tng_p13_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p13_ic_celspac_newsletter" text, "tng_p13_ic_dl_celpac_studies" text, "tng_p13_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p13__role, psc_role.tng_p13_monitor__role, psc_state.tng_p13__state, psc_state.tng_p13_monitor__state, psc_activity_state.tng_p13__activity_state, psc_activity_state.tng_p13_monitor__activity_state, psc_created_at.tng_p13__created_at, psc_created_at.tng_p13_monitor__created_at, psc_accepted_at.tng_p13__accepted_at, psc_accepted_at.tng_p13_monitor__accepted_at, psc_cancelled_at.tng_p13__cancelled_at, psc_cancelled_at.tng_p13_monitor__cancelled_at, psc_revoked_at.tng_p13__revoked_at, psc_revoked_at.tng_p13_monitor__revoked_at, psc_paused_at.tng_p13__paused_at, psc_paused_at.tng_p13_monitor__paused_at, tng_p13_ic_buccal_swab_child, tng_p13_ic_buccal_swab_mother, tng_p13_ic_cord_blood_child, tng_p13_ic_drop_blood_child, tng_p13_ic_stool_child, tng_p13_ic_urine_mother, tng_p13_ic_venous_blood_mother, tng_p13_ic_celspac_newsletter, tng_p13_ic_dl_celpac_studies, tng_p13_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 26 -- Pilot ID );
Date: 2025-11-27 17:02:37 Duration: 5s886ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__26"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__26__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... TNG Pilot XIII, Pilot ID: 26 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS role ("subject_id" int, "tng_p13__role" text, "tng_p13_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS role ("subject_id" int, "tng_p13__state" text, "tng_p13_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS activity ("subject_id" int, "tng_p13__activity_state" text, "tng_p13_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS created_at ("subject_id" int, "tng_p13__created_at" text, "tng_p13_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p13__accepted_at" text, "tng_p13_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p13__cancelled_at" text, "tng_p13_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p13__revoked_at" text, "tng_p13_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS paused_at ("subject_id" int, "tng_p13__paused_at" text, "tng_p13_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13_ic_buccal_swab_child'), ('tng_p13_ic_buccal_swab_mother'), ('tng_p13_ic_cord_blood_child'), ('tng_p13_ic_drop_blood_child'), ('tng_p13_ic_stool_child'), ('tng_p13_ic_urine_mother'), ('tng_p13_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p13_ic_buccal_swab_child" text, "tng_p13_ic_buccal_swab_mother" text, "tng_p13_ic_cord_blood_child" text, "tng_p13_ic_drop_blood_child" text, "tng_p13_ic_stool_child" text, "tng_p13_ic_urine_mother" text, "tng_p13_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13_ic_celspac_newsletter'), ('tng_p13_ic_dl_celpac_studies'), ('tng_p13_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p13_ic_celspac_newsletter" text, "tng_p13_ic_dl_celpac_studies" text, "tng_p13_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p13__role, psc_role.tng_p13_monitor__role, psc_state.tng_p13__state, psc_state.tng_p13_monitor__state, psc_activity_state.tng_p13__activity_state, psc_activity_state.tng_p13_monitor__activity_state, psc_created_at.tng_p13__created_at, psc_created_at.tng_p13_monitor__created_at, psc_accepted_at.tng_p13__accepted_at, psc_accepted_at.tng_p13_monitor__accepted_at, psc_cancelled_at.tng_p13__cancelled_at, psc_cancelled_at.tng_p13_monitor__cancelled_at, psc_revoked_at.tng_p13__revoked_at, psc_revoked_at.tng_p13_monitor__revoked_at, psc_paused_at.tng_p13__paused_at, psc_paused_at.tng_p13_monitor__paused_at, tng_p13_ic_buccal_swab_child, tng_p13_ic_buccal_swab_mother, tng_p13_ic_cord_blood_child, tng_p13_ic_drop_blood_child, tng_p13_ic_stool_child, tng_p13_ic_urine_mother, tng_p13_ic_venous_blood_mother, tng_p13_ic_celspac_newsletter, tng_p13_ic_dl_celpac_studies, tng_p13_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 26 -- Pilot ID );
Date: 2025-11-27 05:02:34 Duration: 5s81ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
13 10s509ms 2 4s907ms 5s602ms 5s254ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__27__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as role ("subject_id" int, "hapiee_p02__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as role ("subject_id" int, "hapiee_p02__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as activity ("subject_id" int, "hapiee_p02__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as created_at ("subject_id" int, "hapiee_p02__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as accepted_at ("subject_id" int, "hapiee_p02__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as cancelled_at ("subject_id" int, "hapiee_p02__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as revoked_at ("subject_id" int, "hapiee_p02__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as paused_at ("subject_id" int, "hapiee_p02__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as biomaterial_state ("subject_id" int, "hapiee_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "hapiee_p02_ic_dl_hapiee" text, "hapiee_p02_ic_dl_statistics" text, "hapiee_p02_ic_examination" text, "hapiee_p02_ic_health_qs" text, "hapiee_p02_ic_samples_storage" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.hapiee_p02__role, psc_state.hapiee_p02__state, psc_activity_state.hapiee_p02__activity_state, psc_created_at.hapiee_p02__created_at, psc_accepted_at.hapiee_p02__accepted_at, psc_cancelled_at.hapiee_p02__cancelled_at, psc_revoked_at.hapiee_p02__revoked_at, psc_paused_at.hapiee_p02__paused_at, hapiee_p02_ic_venous_blood_proband, hapiee_p02_ic_dl_hapiee, hapiee_p02_ic_dl_statistics, hapiee_p02_ic_examination, hapiee_p02_ic_health_qs, hapiee_p02_ic_samples_storage from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #13
Day Hour Count Duration Avg duration Nov 27 05 1 4s907ms 4s907ms 17 1 5s602ms 5s602ms [ User: tng_migration_user - Total duration: 10s509ms - Times executed: 2 ]
[ Application: dbt - Total duration: 10s509ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__27"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__27__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... HAPIEE Pilot II, Pilot ID: 27 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS activity ("subject_id" int, "hapiee_p02__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS created_at ("subject_id" int, "hapiee_p02__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS accepted_at ("subject_id" int, "hapiee_p02__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS cancelled_at ("subject_id" int, "hapiee_p02__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS revoked_at ("subject_id" int, "hapiee_p02__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS paused_at ("subject_id" int, "hapiee_p02__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "hapiee_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_dl_hapiee'), ('hapiee_p02_ic_dl_statistics'), ('hapiee_p02_ic_examination'), ('hapiee_p02_ic_health_qs'), ('hapiee_p02_ic_samples_storage') $$ ) AS extra_state ("subject_id" int, "hapiee_p02_ic_dl_hapiee" text, "hapiee_p02_ic_dl_statistics" text, "hapiee_p02_ic_examination" text, "hapiee_p02_ic_health_qs" text, "hapiee_p02_ic_samples_storage" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.hapiee_p02__role, psc_state.hapiee_p02__state, psc_activity_state.hapiee_p02__activity_state, psc_created_at.hapiee_p02__created_at, psc_accepted_at.hapiee_p02__accepted_at, psc_cancelled_at.hapiee_p02__cancelled_at, psc_revoked_at.hapiee_p02__revoked_at, psc_paused_at.hapiee_p02__paused_at, hapiee_p02_ic_venous_blood_proband, hapiee_p02_ic_dl_hapiee, hapiee_p02_ic_dl_statistics, hapiee_p02_ic_examination, hapiee_p02_ic_health_qs, hapiee_p02_ic_samples_storage FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 27 -- Pilot ID );
Date: 2025-11-27 17:02:37 Duration: 5s602ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__27"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__27__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... HAPIEE Pilot II, Pilot ID: 27 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS activity ("subject_id" int, "hapiee_p02__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS created_at ("subject_id" int, "hapiee_p02__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS accepted_at ("subject_id" int, "hapiee_p02__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS cancelled_at ("subject_id" int, "hapiee_p02__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS revoked_at ("subject_id" int, "hapiee_p02__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS paused_at ("subject_id" int, "hapiee_p02__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "hapiee_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_dl_hapiee'), ('hapiee_p02_ic_dl_statistics'), ('hapiee_p02_ic_examination'), ('hapiee_p02_ic_health_qs'), ('hapiee_p02_ic_samples_storage') $$ ) AS extra_state ("subject_id" int, "hapiee_p02_ic_dl_hapiee" text, "hapiee_p02_ic_dl_statistics" text, "hapiee_p02_ic_examination" text, "hapiee_p02_ic_health_qs" text, "hapiee_p02_ic_samples_storage" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.hapiee_p02__role, psc_state.hapiee_p02__state, psc_activity_state.hapiee_p02__activity_state, psc_created_at.hapiee_p02__created_at, psc_accepted_at.hapiee_p02__accepted_at, psc_cancelled_at.hapiee_p02__cancelled_at, psc_revoked_at.hapiee_p02__revoked_at, psc_paused_at.hapiee_p02__paused_at, hapiee_p02_ic_venous_blood_proband, hapiee_p02_ic_dl_hapiee, hapiee_p02_ic_dl_statistics, hapiee_p02_ic_examination, hapiee_p02_ic_health_qs, hapiee_p02_ic_samples_storage FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 27 -- Pilot ID );
Date: 2025-11-27 05:02:34 Duration: 4s907ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
14 5s462ms 2 2s399ms 3s62ms 2s731ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__17__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as role ("subject_id" int, "dust_p01_tng_p10__role" text, "tng__monitor__role" text, "tng_p10__role" text, "tng_p10_test_tp__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as role ("subject_id" int, "dust_p01_tng_p10__state" text, "tng__monitor__state" text, "tng_p10__state" text, "tng_p10_test_tp__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as activity ("subject_id" int, "dust_p01_tng_p10__activity_state" text, "tng__monitor__activity_state" text, "tng_p10__activity_state" text, "tng_p10_test_tp__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as created_at ("subject_id" int, "dust_p01_tng_p10__created_at" text, "tng__monitor__created_at" text, "tng_p10__created_at" text, "tng_p10_test_tp__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "dust_p01_tng_p10__accepted_at" text, "tng__monitor__accepted_at" text, "tng_p10__accepted_at" text, "tng_p10_test_tp__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "dust_p01_tng_p10__cancelled_at" text, "tng__monitor__cancelled_at" text, "tng_p10__cancelled_at" text, "tng_p10_test_tp__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "dust_p01_tng_p10__revoked_at" text, "tng__monitor__revoked_at" text, "tng_p10__revoked_at" text, "tng_p10_test_tp__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as paused_at ("subject_id" int, "dust_p01_tng_p10__paused_at" text, "tng__monitor__paused_at" text, "tng_p10__paused_at" text, "tng_p10_test_tp__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "dust_p01_tng_p10_ic_dust_mother" text, "tng_p10_ic_buccal_swab_child" text, "tng_p10_ic_buccal_swab_mother" text, "tng_p10_ic_cord_blood_mother" text, "tng_p10_ic_drop_blood_child" text, "tng_p10_ic_stool_child" text, "tng_p10_ic_urine_mother" text, "tng_p10_ic_venous_blood_mother" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "dust_p01_tng_p10_ic_dl_celpac_studies" text, "dust_p01_tng_p10_ic_survey" text, "tng_p10_ic_follow_up_studies" text, "tng_p10_ic_med_find" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.dust_p01_tng_p10__role, psc_role.tng__monitor__role, psc_role.tng_p10__role, psc_role.tng_p10_test_tp__role, psc_state.dust_p01_tng_p10__state, psc_state.tng__monitor__state, psc_state.tng_p10__state, psc_state.tng_p10_test_tp__state, psc_activity_state.dust_p01_tng_p10__activity_state, psc_activity_state.tng__monitor__activity_state, psc_activity_state.tng_p10__activity_state, psc_activity_state.tng_p10_test_tp__activity_state, psc_created_at.dust_p01_tng_p10__created_at, psc_created_at.tng__monitor__created_at, psc_created_at.tng_p10__created_at, psc_created_at.tng_p10_test_tp__created_at, psc_accepted_at.dust_p01_tng_p10__accepted_at, psc_accepted_at.tng__monitor__accepted_at, psc_accepted_at.tng_p10__accepted_at, psc_accepted_at.tng_p10_test_tp__accepted_at, psc_cancelled_at.dust_p01_tng_p10__cancelled_at, psc_cancelled_at.tng__monitor__cancelled_at, psc_cancelled_at.tng_p10__cancelled_at, psc_cancelled_at.tng_p10_test_tp__cancelled_at, psc_revoked_at.dust_p01_tng_p10__revoked_at, psc_revoked_at.tng__monitor__revoked_at, psc_revoked_at.tng_p10__revoked_at, psc_revoked_at.tng_p10_test_tp__revoked_at, psc_paused_at.dust_p01_tng_p10__paused_at, psc_paused_at.tng__monitor__paused_at, psc_paused_at.tng_p10__paused_at, psc_paused_at.tng_p10_test_tp__paused_at, dust_p01_tng_p10_ic_dust_mother, tng_p10_ic_buccal_swab_child, tng_p10_ic_buccal_swab_mother, tng_p10_ic_cord_blood_mother, tng_p10_ic_drop_blood_child, tng_p10_ic_stool_child, tng_p10_ic_urine_mother, tng_p10_ic_venous_blood_mother, dust_p01_tng_p10_ic_dl_celpac_studies, dust_p01_tng_p10_ic_survey, tng_p10_ic_follow_up_studies, tng_p10_ic_med_find from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #14
Day Hour Count Duration Avg duration Nov 27 05 1 2s399ms 2s399ms 17 1 3s62ms 3s62ms [ User: tng_migration_user - Total duration: 5s462ms - Times executed: 2 ]
[ Application: dbt - Total duration: 5s462ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__17"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__17__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot X, Pilot ID: 17 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__role" text, "tng__monitor__role" text, "tng_p10__role" text, "tng_p10_test_tp__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__state" text, "tng__monitor__state" text, "tng_p10__state" text, "tng_p10_test_tp__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p10__activity_state" text, "tng__monitor__activity_state" text, "tng_p10__activity_state" text, "tng_p10_test_tp__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p10__created_at" text, "tng__monitor__created_at" text, "tng_p10__created_at" text, "tng_p10_test_tp__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p10__accepted_at" text, "tng__monitor__accepted_at" text, "tng_p10__accepted_at" text, "tng_p10_test_tp__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p10__cancelled_at" text, "tng__monitor__cancelled_at" text, "tng_p10__cancelled_at" text, "tng_p10_test_tp__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p10__revoked_at" text, "tng__monitor__revoked_at" text, "tng_p10__revoked_at" text, "tng_p10_test_tp__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p10__paused_at" text, "tng__monitor__paused_at" text, "tng_p10__paused_at" text, "tng_p10_test_tp__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dust_mother'), ('tng_p10_ic_buccal_swab_child'), ('tng_p10_ic_buccal_swab_mother'), ('tng_p10_ic_cord_blood_mother'), ('tng_p10_ic_drop_blood_child'), ('tng_p10_ic_stool_child'), ('tng_p10_ic_urine_mother'), ('tng_p10_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p10_ic_dust_mother" text, "tng_p10_ic_buccal_swab_child" text, "tng_p10_ic_buccal_swab_mother" text, "tng_p10_ic_cord_blood_mother" text, "tng_p10_ic_drop_blood_child" text, "tng_p10_ic_stool_child" text, "tng_p10_ic_urine_mother" text, "tng_p10_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dl_celpac_studies'), ('dust_p01_tng_p10_ic_survey'), ('tng_p10_ic_follow_up_studies'), ('tng_p10_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p10_ic_dl_celpac_studies" text, "dust_p01_tng_p10_ic_survey" text, "tng_p10_ic_follow_up_studies" text, "tng_p10_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p10__role, psc_role.tng__monitor__role, psc_role.tng_p10__role, psc_role.tng_p10_test_tp__role, psc_state.dust_p01_tng_p10__state, psc_state.tng__monitor__state, psc_state.tng_p10__state, psc_state.tng_p10_test_tp__state, psc_activity_state.dust_p01_tng_p10__activity_state, psc_activity_state.tng__monitor__activity_state, psc_activity_state.tng_p10__activity_state, psc_activity_state.tng_p10_test_tp__activity_state, psc_created_at.dust_p01_tng_p10__created_at, psc_created_at.tng__monitor__created_at, psc_created_at.tng_p10__created_at, psc_created_at.tng_p10_test_tp__created_at, psc_accepted_at.dust_p01_tng_p10__accepted_at, psc_accepted_at.tng__monitor__accepted_at, psc_accepted_at.tng_p10__accepted_at, psc_accepted_at.tng_p10_test_tp__accepted_at, psc_cancelled_at.dust_p01_tng_p10__cancelled_at, psc_cancelled_at.tng__monitor__cancelled_at, psc_cancelled_at.tng_p10__cancelled_at, psc_cancelled_at.tng_p10_test_tp__cancelled_at, psc_revoked_at.dust_p01_tng_p10__revoked_at, psc_revoked_at.tng__monitor__revoked_at, psc_revoked_at.tng_p10__revoked_at, psc_revoked_at.tng_p10_test_tp__revoked_at, psc_paused_at.dust_p01_tng_p10__paused_at, psc_paused_at.tng__monitor__paused_at, psc_paused_at.tng_p10__paused_at, psc_paused_at.tng_p10_test_tp__paused_at, dust_p01_tng_p10_ic_dust_mother, tng_p10_ic_buccal_swab_child, tng_p10_ic_buccal_swab_mother, tng_p10_ic_cord_blood_mother, tng_p10_ic_drop_blood_child, tng_p10_ic_stool_child, tng_p10_ic_urine_mother, tng_p10_ic_venous_blood_mother, dust_p01_tng_p10_ic_dl_celpac_studies, dust_p01_tng_p10_ic_survey, tng_p10_ic_follow_up_studies, tng_p10_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 17 -- Pilot ID );
Date: 2025-11-27 17:02:27 Duration: 3s62ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__17"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__17__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot X, Pilot ID: 17 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__role" text, "tng__monitor__role" text, "tng_p10__role" text, "tng_p10_test_tp__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__state" text, "tng__monitor__state" text, "tng_p10__state" text, "tng_p10_test_tp__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p10__activity_state" text, "tng__monitor__activity_state" text, "tng_p10__activity_state" text, "tng_p10_test_tp__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p10__created_at" text, "tng__monitor__created_at" text, "tng_p10__created_at" text, "tng_p10_test_tp__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p10__accepted_at" text, "tng__monitor__accepted_at" text, "tng_p10__accepted_at" text, "tng_p10_test_tp__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p10__cancelled_at" text, "tng__monitor__cancelled_at" text, "tng_p10__cancelled_at" text, "tng_p10_test_tp__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p10__revoked_at" text, "tng__monitor__revoked_at" text, "tng_p10__revoked_at" text, "tng_p10_test_tp__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p10__paused_at" text, "tng__monitor__paused_at" text, "tng_p10__paused_at" text, "tng_p10_test_tp__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dust_mother'), ('tng_p10_ic_buccal_swab_child'), ('tng_p10_ic_buccal_swab_mother'), ('tng_p10_ic_cord_blood_mother'), ('tng_p10_ic_drop_blood_child'), ('tng_p10_ic_stool_child'), ('tng_p10_ic_urine_mother'), ('tng_p10_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p10_ic_dust_mother" text, "tng_p10_ic_buccal_swab_child" text, "tng_p10_ic_buccal_swab_mother" text, "tng_p10_ic_cord_blood_mother" text, "tng_p10_ic_drop_blood_child" text, "tng_p10_ic_stool_child" text, "tng_p10_ic_urine_mother" text, "tng_p10_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dl_celpac_studies'), ('dust_p01_tng_p10_ic_survey'), ('tng_p10_ic_follow_up_studies'), ('tng_p10_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p10_ic_dl_celpac_studies" text, "dust_p01_tng_p10_ic_survey" text, "tng_p10_ic_follow_up_studies" text, "tng_p10_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p10__role, psc_role.tng__monitor__role, psc_role.tng_p10__role, psc_role.tng_p10_test_tp__role, psc_state.dust_p01_tng_p10__state, psc_state.tng__monitor__state, psc_state.tng_p10__state, psc_state.tng_p10_test_tp__state, psc_activity_state.dust_p01_tng_p10__activity_state, psc_activity_state.tng__monitor__activity_state, psc_activity_state.tng_p10__activity_state, psc_activity_state.tng_p10_test_tp__activity_state, psc_created_at.dust_p01_tng_p10__created_at, psc_created_at.tng__monitor__created_at, psc_created_at.tng_p10__created_at, psc_created_at.tng_p10_test_tp__created_at, psc_accepted_at.dust_p01_tng_p10__accepted_at, psc_accepted_at.tng__monitor__accepted_at, psc_accepted_at.tng_p10__accepted_at, psc_accepted_at.tng_p10_test_tp__accepted_at, psc_cancelled_at.dust_p01_tng_p10__cancelled_at, psc_cancelled_at.tng__monitor__cancelled_at, psc_cancelled_at.tng_p10__cancelled_at, psc_cancelled_at.tng_p10_test_tp__cancelled_at, psc_revoked_at.dust_p01_tng_p10__revoked_at, psc_revoked_at.tng__monitor__revoked_at, psc_revoked_at.tng_p10__revoked_at, psc_revoked_at.tng_p10_test_tp__revoked_at, psc_paused_at.dust_p01_tng_p10__paused_at, psc_paused_at.tng__monitor__paused_at, psc_paused_at.tng_p10__paused_at, psc_paused_at.tng_p10_test_tp__paused_at, dust_p01_tng_p10_ic_dust_mother, tng_p10_ic_buccal_swab_child, tng_p10_ic_buccal_swab_mother, tng_p10_ic_cord_blood_mother, tng_p10_ic_drop_blood_child, tng_p10_ic_stool_child, tng_p10_ic_urine_mother, tng_p10_ic_venous_blood_mother, dust_p01_tng_p10_ic_dl_celpac_studies, dust_p01_tng_p10_ic_survey, tng_p10_ic_follow_up_studies, tng_p10_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 17 -- Pilot ID );
Date: 2025-11-27 05:02:24 Duration: 2s399ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
15 4s109ms 2 1s684ms 2s424ms 2s54ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__22__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "tng_p12__role" text, "tng_p12_monitor__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "tng_p12__state" text, "tng_p12_monitor__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as activity ("subject_id" int, "tng_p12__activity_state" text, "tng_p12_monitor__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as created_at ("subject_id" int, "tng_p12__created_at" text, "tng_p12_monitor__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as accepted_at ("subject_id" int, "tng_p12__accepted_at" text, "tng_p12_monitor__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as cancelled_at ("subject_id" int, "tng_p12__cancelled_at" text, "tng_p12_monitor__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as revoked_at ("subject_id" int, "tng_p12__revoked_at" text, "tng_p12_monitor__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as paused_at ("subject_id" int, "tng_p12__paused_at" text, "tng_p12_monitor__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "tng_p12_ic_buccal_swab_child" text, "tng_p12_ic_buccal_swab_mother" text, "tng_p12_ic_cord_blood_mother" text, "tng_p12_ic_drop_blood_child" text, "tng_p12_ic_stool_child" text, "tng_p12_ic_urine_mother" text, "tng_p12_ic_venous_blood_mother" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as extra_state ("subject_id" int, "tng_p12_ic_celspac_newsletter" text, "tng_p12_ic_dl_celpac_studies" text, "tng_p12_ic_med_find" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.tng_p12__role, psc_role.tng_p12_monitor__role, psc_state.tng_p12__state, psc_state.tng_p12_monitor__state, psc_activity_state.tng_p12__activity_state, psc_activity_state.tng_p12_monitor__activity_state, psc_created_at.tng_p12__created_at, psc_created_at.tng_p12_monitor__created_at, psc_accepted_at.tng_p12__accepted_at, psc_accepted_at.tng_p12_monitor__accepted_at, psc_cancelled_at.tng_p12__cancelled_at, psc_cancelled_at.tng_p12_monitor__cancelled_at, psc_revoked_at.tng_p12__revoked_at, psc_revoked_at.tng_p12_monitor__revoked_at, psc_paused_at.tng_p12__paused_at, psc_paused_at.tng_p12_monitor__paused_at, tng_p12_ic_buccal_swab_child, tng_p12_ic_buccal_swab_mother, tng_p12_ic_cord_blood_mother, tng_p12_ic_drop_blood_child, tng_p12_ic_stool_child, tng_p12_ic_urine_mother, tng_p12_ic_venous_blood_mother, tng_p12_ic_celspac_newsletter, tng_p12_ic_dl_celpac_studies, tng_p12_ic_med_find from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #15
Day Hour Count Duration Avg duration Nov 27 05 1 1s684ms 1s684ms 17 1 2s424ms 2s424ms [ User: tng_migration_user - Total duration: 4s109ms - Times executed: 2 ]
[ Application: dbt - Total duration: 4s109ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__22"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__22__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: TNG (nabor od 29.4.2022), Pilot ID: 22 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS role ("subject_id" int, "tng_p12__role" text, "tng_p12_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS role ("subject_id" int, "tng_p12__state" text, "tng_p12_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS activity ("subject_id" int, "tng_p12__activity_state" text, "tng_p12_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS created_at ("subject_id" int, "tng_p12__created_at" text, "tng_p12_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p12__accepted_at" text, "tng_p12_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p12__cancelled_at" text, "tng_p12_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p12__revoked_at" text, "tng_p12_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS paused_at ("subject_id" int, "tng_p12__paused_at" text, "tng_p12_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12_ic_buccal_swab_child'), ('tng_p12_ic_buccal_swab_mother'), ('tng_p12_ic_cord_blood_mother'), ('tng_p12_ic_drop_blood_child'), ('tng_p12_ic_stool_child'), ('tng_p12_ic_urine_mother'), ('tng_p12_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p12_ic_buccal_swab_child" text, "tng_p12_ic_buccal_swab_mother" text, "tng_p12_ic_cord_blood_mother" text, "tng_p12_ic_drop_blood_child" text, "tng_p12_ic_stool_child" text, "tng_p12_ic_urine_mother" text, "tng_p12_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12_ic_celspac_newsletter'), ('tng_p12_ic_dl_celpac_studies'), ('tng_p12_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p12_ic_celspac_newsletter" text, "tng_p12_ic_dl_celpac_studies" text, "tng_p12_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p12__role, psc_role.tng_p12_monitor__role, psc_state.tng_p12__state, psc_state.tng_p12_monitor__state, psc_activity_state.tng_p12__activity_state, psc_activity_state.tng_p12_monitor__activity_state, psc_created_at.tng_p12__created_at, psc_created_at.tng_p12_monitor__created_at, psc_accepted_at.tng_p12__accepted_at, psc_accepted_at.tng_p12_monitor__accepted_at, psc_cancelled_at.tng_p12__cancelled_at, psc_cancelled_at.tng_p12_monitor__cancelled_at, psc_revoked_at.tng_p12__revoked_at, psc_revoked_at.tng_p12_monitor__revoked_at, psc_paused_at.tng_p12__paused_at, psc_paused_at.tng_p12_monitor__paused_at, tng_p12_ic_buccal_swab_child, tng_p12_ic_buccal_swab_mother, tng_p12_ic_cord_blood_mother, tng_p12_ic_drop_blood_child, tng_p12_ic_stool_child, tng_p12_ic_urine_mother, tng_p12_ic_venous_blood_mother, tng_p12_ic_celspac_newsletter, tng_p12_ic_dl_celpac_studies, tng_p12_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 22 -- Pilot ID );
Date: 2025-11-27 17:02:29 Duration: 2s424ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__22"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__22__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: TNG (nabor od 29.4.2022), Pilot ID: 22 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS role ("subject_id" int, "tng_p12__role" text, "tng_p12_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS role ("subject_id" int, "tng_p12__state" text, "tng_p12_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS activity ("subject_id" int, "tng_p12__activity_state" text, "tng_p12_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS created_at ("subject_id" int, "tng_p12__created_at" text, "tng_p12_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p12__accepted_at" text, "tng_p12_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p12__cancelled_at" text, "tng_p12_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p12__revoked_at" text, "tng_p12_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS paused_at ("subject_id" int, "tng_p12__paused_at" text, "tng_p12_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12_ic_buccal_swab_child'), ('tng_p12_ic_buccal_swab_mother'), ('tng_p12_ic_cord_blood_mother'), ('tng_p12_ic_drop_blood_child'), ('tng_p12_ic_stool_child'), ('tng_p12_ic_urine_mother'), ('tng_p12_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p12_ic_buccal_swab_child" text, "tng_p12_ic_buccal_swab_mother" text, "tng_p12_ic_cord_blood_mother" text, "tng_p12_ic_drop_blood_child" text, "tng_p12_ic_stool_child" text, "tng_p12_ic_urine_mother" text, "tng_p12_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12_ic_celspac_newsletter'), ('tng_p12_ic_dl_celpac_studies'), ('tng_p12_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p12_ic_celspac_newsletter" text, "tng_p12_ic_dl_celpac_studies" text, "tng_p12_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p12__role, psc_role.tng_p12_monitor__role, psc_state.tng_p12__state, psc_state.tng_p12_monitor__state, psc_activity_state.tng_p12__activity_state, psc_activity_state.tng_p12_monitor__activity_state, psc_created_at.tng_p12__created_at, psc_created_at.tng_p12_monitor__created_at, psc_accepted_at.tng_p12__accepted_at, psc_accepted_at.tng_p12_monitor__accepted_at, psc_cancelled_at.tng_p12__cancelled_at, psc_cancelled_at.tng_p12_monitor__cancelled_at, psc_revoked_at.tng_p12__revoked_at, psc_revoked_at.tng_p12_monitor__revoked_at, psc_paused_at.tng_p12__paused_at, psc_paused_at.tng_p12_monitor__paused_at, tng_p12_ic_buccal_swab_child, tng_p12_ic_buccal_swab_mother, tng_p12_ic_cord_blood_mother, tng_p12_ic_drop_blood_child, tng_p12_ic_stool_child, tng_p12_ic_urine_mother, tng_p12_ic_venous_blood_mother, tng_p12_ic_celspac_newsletter, tng_p12_ic_dl_celpac_studies, tng_p12_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 22 -- Pilot ID );
Date: 2025-11-27 05:02:25 Duration: 1s684ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
16 3s707ms 2 1s541ms 2s165ms 1s853ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__11__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "dust_p01_tng_p09__role" text, "tng_p09__role" text, "tng_pilot_9__form_fix_2019_06__role" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__role" text, "tng_pilot_9__monitor__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "dust_p01_tng_p09__state" text, "tng_p09__state" text, "tng_pilot_9__form_fix_2019_06__state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__state" text, "tng_pilot_9__monitor__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as activity ("subject_id" int, "dust_p01_tng_p09__activity_state" text, "tng_p09__activity_state" text, "tng_pilot_9__form_fix_2019_06__activity_state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state" text, "tng_pilot_9__monitor__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as created_at ("subject_id" int, "dust_p01_tng_p09__created_at" text, "tng_p09__created_at" text, "tng_pilot_9__form_fix_2019_06__created_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__created_at" text, "tng_pilot_9__monitor__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "dust_p01_tng_p09__accepted_at" text, "tng_p09__accepted_at" text, "tng_pilot_9__form_fix_2019_06__accepted_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at" text, "tng_pilot_9__monitor__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "dust_p01_tng_p09__cancelled_at" text, "tng_p09__cancelled_at" text, "tng_pilot_9__form_fix_2019_06__cancelled_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at" text, "tng_pilot_9__monitor__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "dust_p01_tng_p09__revoked_at" text, "tng_p09__revoked_at" text, "tng_pilot_9__form_fix_2019_06__revoked_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at" text, "tng_pilot_9__monitor__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as paused_at ("subject_id" int, "dust_p01_tng_p09__paused_at" text, "tng_p09__paused_at" text, "tng_pilot_9__form_fix_2019_06__paused_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at" text, "tng_pilot_9__monitor__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "dust_p01_tng_p09_ic_dust_mother" text, "tng_p09_ic_buccal_swab_child" text, "tng_p09_ic_buccal_swab_mother" text, "tng_p09_ic_cord_blood_mother" text, "tng_p09_ic_drop_blood_child" text, "tng_p09_ic_stool_child" text, "tng_p09_ic_urine_mother" text, "tng_p09_ic_venous_blood_mother" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "dust_p01_tng_p09_ic_dl_celpac_studies" text, "dust_p01_tng_p09_ic_survey" text, "tng_p09_ic_follow_up_studies" text, "tng_p09_ic_med_find" text, "tng_pilot_9__monitor_ic_follow_up_studies" text, "tng_pilot_9__monitor_ic_med_find" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.dust_p01_tng_p09__role, psc_role.tng_p09__role, psc_role.tng_pilot_9__form_fix_2019_06__role, psc_role.tng_pilot_9__form_fix_mm38p01_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p02_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p03_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p04_v2_v2__role, psc_role.tng_pilot_9__monitor__role, psc_state.dust_p01_tng_p09__state, psc_state.tng_p09__state, psc_state.tng_pilot_9__form_fix_2019_06__state, psc_state.tng_pilot_9__form_fix_mm38p01_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p02_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p03_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p04_v2_v2__state, psc_state.tng_pilot_9__monitor__state, psc_activity_state.dust_p01_tng_p09__activity_state, psc_activity_state.tng_p09__activity_state, psc_activity_state.tng_pilot_9__form_fix_2019_06__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state, psc_activity_state.tng_pilot_9__monitor__activity_state, psc_created_at.dust_p01_tng_p09__created_at, psc_created_at.tng_p09__created_at, psc_created_at.tng_pilot_9__form_fix_2019_06__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p01_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p02_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p03_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p04_v2_v2__created_at, psc_created_at.tng_pilot_9__monitor__created_at, psc_accepted_at.dust_p01_tng_p09__accepted_at, psc_accepted_at.tng_p09__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_2019_06__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p09__cancelled_at, psc_cancelled_at.tng_p09__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_2019_06__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p09__revoked_at, psc_revoked_at.tng_p09__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_2019_06__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__monitor__revoked_at, psc_paused_at.dust_p01_tng_p09__paused_at, psc_paused_at.tng_p09__paused_at, psc_paused_at.tng_pilot_9__form_fix_2019_06__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at, psc_paused_at.tng_pilot_9__monitor__paused_at, dust_p01_tng_p09_ic_dust_mother, tng_p09_ic_buccal_swab_child, tng_p09_ic_buccal_swab_mother, tng_p09_ic_cord_blood_mother, tng_p09_ic_drop_blood_child, tng_p09_ic_stool_child, tng_p09_ic_urine_mother, tng_p09_ic_venous_blood_mother, dust_p01_tng_p09_ic_dl_celpac_studies, dust_p01_tng_p09_ic_survey, tng_p09_ic_follow_up_studies, tng_p09_ic_med_find, tng_pilot_9__monitor_ic_follow_up_studies, tng_pilot_9__monitor_ic_med_find from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #16
Day Hour Count Duration Avg duration Nov 27 05 1 1s541ms 1s541ms 17 1 2s165ms 2s165ms [ User: tng_migration_user - Total duration: 3s707ms - Times executed: 2 ]
[ Application: dbt - Total duration: 3s707ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__11"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__11__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot IX, Pilot ID: 11 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p09__role" text, "tng_p09__role" text, "tng_pilot_9__form_fix_2019_06__role" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__role" text, "tng_pilot_9__monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p09__state" text, "tng_p09__state" text, "tng_pilot_9__form_fix_2019_06__state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__state" text, "tng_pilot_9__monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p09__activity_state" text, "tng_p09__activity_state" text, "tng_pilot_9__form_fix_2019_06__activity_state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state" text, "tng_pilot_9__monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p09__created_at" text, "tng_p09__created_at" text, "tng_pilot_9__form_fix_2019_06__created_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__created_at" text, "tng_pilot_9__monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p09__accepted_at" text, "tng_p09__accepted_at" text, "tng_pilot_9__form_fix_2019_06__accepted_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at" text, "tng_pilot_9__monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p09__cancelled_at" text, "tng_p09__cancelled_at" text, "tng_pilot_9__form_fix_2019_06__cancelled_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at" text, "tng_pilot_9__monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p09__revoked_at" text, "tng_p09__revoked_at" text, "tng_pilot_9__form_fix_2019_06__revoked_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at" text, "tng_pilot_9__monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p09__paused_at" text, "tng_p09__paused_at" text, "tng_pilot_9__form_fix_2019_06__paused_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at" text, "tng_pilot_9__monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09_ic_dust_mother'), ('tng_p09_ic_buccal_swab_child'), ('tng_p09_ic_buccal_swab_mother'), ('tng_p09_ic_cord_blood_mother'), ('tng_p09_ic_drop_blood_child'), ('tng_p09_ic_stool_child'), ('tng_p09_ic_urine_mother'), ('tng_p09_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p09_ic_dust_mother" text, "tng_p09_ic_buccal_swab_child" text, "tng_p09_ic_buccal_swab_mother" text, "tng_p09_ic_cord_blood_mother" text, "tng_p09_ic_drop_blood_child" text, "tng_p09_ic_stool_child" text, "tng_p09_ic_urine_mother" text, "tng_p09_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09_ic_dl_celpac_studies'), ('dust_p01_tng_p09_ic_survey'), ('tng_p09_ic_follow_up_studies'), ('tng_p09_ic_med_find'), ('tng_pilot_9__monitor_ic_follow_up_studies'), ('tng_pilot_9__monitor_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p09_ic_dl_celpac_studies" text, "dust_p01_tng_p09_ic_survey" text, "tng_p09_ic_follow_up_studies" text, "tng_p09_ic_med_find" text, "tng_pilot_9__monitor_ic_follow_up_studies" text, "tng_pilot_9__monitor_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p09__role, psc_role.tng_p09__role, psc_role.tng_pilot_9__form_fix_2019_06__role, psc_role.tng_pilot_9__form_fix_mm38p01_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p02_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p03_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p04_v2_v2__role, psc_role.tng_pilot_9__monitor__role, psc_state.dust_p01_tng_p09__state, psc_state.tng_p09__state, psc_state.tng_pilot_9__form_fix_2019_06__state, psc_state.tng_pilot_9__form_fix_mm38p01_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p02_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p03_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p04_v2_v2__state, psc_state.tng_pilot_9__monitor__state, psc_activity_state.dust_p01_tng_p09__activity_state, psc_activity_state.tng_p09__activity_state, psc_activity_state.tng_pilot_9__form_fix_2019_06__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state, psc_activity_state.tng_pilot_9__monitor__activity_state, psc_created_at.dust_p01_tng_p09__created_at, psc_created_at.tng_p09__created_at, psc_created_at.tng_pilot_9__form_fix_2019_06__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p01_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p02_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p03_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p04_v2_v2__created_at, psc_created_at.tng_pilot_9__monitor__created_at, psc_accepted_at.dust_p01_tng_p09__accepted_at, psc_accepted_at.tng_p09__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_2019_06__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p09__cancelled_at, psc_cancelled_at.tng_p09__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_2019_06__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p09__revoked_at, psc_revoked_at.tng_p09__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_2019_06__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__monitor__revoked_at, psc_paused_at.dust_p01_tng_p09__paused_at, psc_paused_at.tng_p09__paused_at, psc_paused_at.tng_pilot_9__form_fix_2019_06__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at, psc_paused_at.tng_pilot_9__monitor__paused_at, dust_p01_tng_p09_ic_dust_mother, tng_p09_ic_buccal_swab_child, tng_p09_ic_buccal_swab_mother, tng_p09_ic_cord_blood_mother, tng_p09_ic_drop_blood_child, tng_p09_ic_stool_child, tng_p09_ic_urine_mother, tng_p09_ic_venous_blood_mother, dust_p01_tng_p09_ic_dl_celpac_studies, dust_p01_tng_p09_ic_survey, tng_p09_ic_follow_up_studies, tng_p09_ic_med_find, tng_pilot_9__monitor_ic_follow_up_studies, tng_pilot_9__monitor_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 11 -- Pilot ID );
Date: 2025-11-27 17:02:24 Duration: 2s165ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__11"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__11__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot IX, Pilot ID: 11 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p09__role" text, "tng_p09__role" text, "tng_pilot_9__form_fix_2019_06__role" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__role" text, "tng_pilot_9__monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p09__state" text, "tng_p09__state" text, "tng_pilot_9__form_fix_2019_06__state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__state" text, "tng_pilot_9__monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p09__activity_state" text, "tng_p09__activity_state" text, "tng_pilot_9__form_fix_2019_06__activity_state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state" text, "tng_pilot_9__monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p09__created_at" text, "tng_p09__created_at" text, "tng_pilot_9__form_fix_2019_06__created_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__created_at" text, "tng_pilot_9__monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p09__accepted_at" text, "tng_p09__accepted_at" text, "tng_pilot_9__form_fix_2019_06__accepted_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at" text, "tng_pilot_9__monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p09__cancelled_at" text, "tng_p09__cancelled_at" text, "tng_pilot_9__form_fix_2019_06__cancelled_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at" text, "tng_pilot_9__monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p09__revoked_at" text, "tng_p09__revoked_at" text, "tng_pilot_9__form_fix_2019_06__revoked_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at" text, "tng_pilot_9__monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p09__paused_at" text, "tng_p09__paused_at" text, "tng_pilot_9__form_fix_2019_06__paused_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at" text, "tng_pilot_9__monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09_ic_dust_mother'), ('tng_p09_ic_buccal_swab_child'), ('tng_p09_ic_buccal_swab_mother'), ('tng_p09_ic_cord_blood_mother'), ('tng_p09_ic_drop_blood_child'), ('tng_p09_ic_stool_child'), ('tng_p09_ic_urine_mother'), ('tng_p09_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p09_ic_dust_mother" text, "tng_p09_ic_buccal_swab_child" text, "tng_p09_ic_buccal_swab_mother" text, "tng_p09_ic_cord_blood_mother" text, "tng_p09_ic_drop_blood_child" text, "tng_p09_ic_stool_child" text, "tng_p09_ic_urine_mother" text, "tng_p09_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09_ic_dl_celpac_studies'), ('dust_p01_tng_p09_ic_survey'), ('tng_p09_ic_follow_up_studies'), ('tng_p09_ic_med_find'), ('tng_pilot_9__monitor_ic_follow_up_studies'), ('tng_pilot_9__monitor_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p09_ic_dl_celpac_studies" text, "dust_p01_tng_p09_ic_survey" text, "tng_p09_ic_follow_up_studies" text, "tng_p09_ic_med_find" text, "tng_pilot_9__monitor_ic_follow_up_studies" text, "tng_pilot_9__monitor_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p09__role, psc_role.tng_p09__role, psc_role.tng_pilot_9__form_fix_2019_06__role, psc_role.tng_pilot_9__form_fix_mm38p01_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p02_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p03_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p04_v2_v2__role, psc_role.tng_pilot_9__monitor__role, psc_state.dust_p01_tng_p09__state, psc_state.tng_p09__state, psc_state.tng_pilot_9__form_fix_2019_06__state, psc_state.tng_pilot_9__form_fix_mm38p01_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p02_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p03_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p04_v2_v2__state, psc_state.tng_pilot_9__monitor__state, psc_activity_state.dust_p01_tng_p09__activity_state, psc_activity_state.tng_p09__activity_state, psc_activity_state.tng_pilot_9__form_fix_2019_06__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state, psc_activity_state.tng_pilot_9__monitor__activity_state, psc_created_at.dust_p01_tng_p09__created_at, psc_created_at.tng_p09__created_at, psc_created_at.tng_pilot_9__form_fix_2019_06__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p01_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p02_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p03_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p04_v2_v2__created_at, psc_created_at.tng_pilot_9__monitor__created_at, psc_accepted_at.dust_p01_tng_p09__accepted_at, psc_accepted_at.tng_p09__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_2019_06__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p09__cancelled_at, psc_cancelled_at.tng_p09__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_2019_06__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p09__revoked_at, psc_revoked_at.tng_p09__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_2019_06__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__monitor__revoked_at, psc_paused_at.dust_p01_tng_p09__paused_at, psc_paused_at.tng_p09__paused_at, psc_paused_at.tng_pilot_9__form_fix_2019_06__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at, psc_paused_at.tng_pilot_9__monitor__paused_at, dust_p01_tng_p09_ic_dust_mother, tng_p09_ic_buccal_swab_child, tng_p09_ic_buccal_swab_mother, tng_p09_ic_cord_blood_mother, tng_p09_ic_drop_blood_child, tng_p09_ic_stool_child, tng_p09_ic_urine_mother, tng_p09_ic_venous_blood_mother, dust_p01_tng_p09_ic_dl_celpac_studies, dust_p01_tng_p09_ic_survey, tng_p09_ic_follow_up_studies, tng_p09_ic_med_find, tng_pilot_9__monitor_ic_follow_up_studies, tng_pilot_9__monitor_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 11 -- Pilot ID );
Date: 2025-11-27 05:02:22 Duration: 1s541ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
17 3s313ms 2 1s396ms 1s917ms 1s656ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__15__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "psycap_p01_ya_p02__role" text, "psycap_p02_old_ya_p02__role" text, "ya_p02__role" text, "ya_p02_digi_ya03v2__role" text, "ya_p02_digi_ya04v2__role" text, "ya_p02_digi_ya05v2__role" text, "ya_p02_test__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "psycap_p01_ya_p02__state" text, "psycap_p02_old_ya_p02__state" text, "ya_p02__state" text, "ya_p02_digi_ya03v2__state" text, "ya_p02_digi_ya04v2__state" text, "ya_p02_digi_ya05v2__state" text, "ya_p02_test__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as activity ("subject_id" int, "psycap_p01_ya_p02__activity_state" text, "psycap_p02_old_ya_p02__activity_state" text, "ya_p02__activity_state" text, "ya_p02_digi_ya03v2__activity_state" text, "ya_p02_digi_ya04v2__activity_state" text, "ya_p02_digi_ya05v2__activity_state" text, "ya_p02_test__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as created_at ("subject_id" int, "psycap_p01_ya_p02__created_at" text, "psycap_p02_old_ya_p02__created_at" text, "ya_p02__created_at" text, "ya_p02_digi_ya03v2__created_at" text, "ya_p02_digi_ya04v2__created_at" text, "ya_p02_digi_ya05v2__created_at" text, "ya_p02_test__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "psycap_p01_ya_p02__accepted_at" text, "psycap_p02_old_ya_p02__accepted_at" text, "ya_p02__accepted_at" text, "ya_p02_digi_ya03v2__accepted_at" text, "ya_p02_digi_ya04v2__accepted_at" text, "ya_p02_digi_ya05v2__accepted_at" text, "ya_p02_test__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "psycap_p01_ya_p02__cancelled_at" text, "psycap_p02_old_ya_p02__cancelled_at" text, "ya_p02__cancelled_at" text, "ya_p02_digi_ya03v2__cancelled_at" text, "ya_p02_digi_ya04v2__cancelled_at" text, "ya_p02_digi_ya05v2__cancelled_at" text, "ya_p02_test__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "psycap_p01_ya_p02__revoked_at" text, "psycap_p02_old_ya_p02__revoked_at" text, "ya_p02__revoked_at" text, "ya_p02_digi_ya03v2__revoked_at" text, "ya_p02_digi_ya04v2__revoked_at" text, "ya_p02_digi_ya05v2__revoked_at" text, "ya_p02_test__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as paused_at ("subject_id" int, "psycap_p01_ya_p02__paused_at" text, "psycap_p02_old_ya_p02__paused_at" text, "ya_p02__paused_at" text, "ya_p02_digi_ya03v2__paused_at" text, "ya_p02_digi_ya04v2__paused_at" text, "ya_p02_digi_ya05v2__paused_at" text, "ya_p02_test__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "ya_p02_ic_buccal_swab_proband" text, "ya_p02_ic_urine_proband" text, "ya_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "ya_p02_ic_anam_qs" text, "ya_p02_ic_aneurysm" text, "ya_p02_ic_anthropometry" text, "ya_p02_ic_arch_foot" text, "ya_p02_ic_basic_qs" text, "ya_p02_ic_blood_pressure" text, "ya_p02_ic_braces_piercing_iud" text, "ya_p02_ic_cognition_test" text, "ya_p02_ic_da_health_registry" text, "ya_p02_ic_dexa" text, "ya_p02_ic_enviro_qs" text, "ya_p02_ic_follow_up_studies" text, "ya_p02_ic_fracture_lower_body_last_3m" text, "ya_p02_ic_fracture_upper_body_last_3m" text, "ya_p02_ic_hand_grip" text, "ya_p02_ic_hearing_vision_impairment" text, "ya_p02_ic_heart_disease" text, "ya_p02_ic_hemoptysis_ns" text, "ya_p02_ic_hernia" text, "ya_p02_ic_hyperthyroidism" text, "ya_p02_ic_inability_hold_pencil" text, "ya_p02_ic_inability_stand_both_legs" text, "ya_p02_ic_inability_talk_cze" text, "ya_p02_ic_inability_walk" text, "ya_p02_ic_inbody" text, "ya_p02_ic_infectious_resp_diseases" text, "ya_p02_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p02_ic_knee_stability" text, "ya_p02_ic_nutri_qs" text, "ya_p02_ic_over_weight_200_height_195" text, "ya_p02_ic_pacemaker_defibrillator" text, "ya_p02_ic_pneumothorax" text, "ya_p02_ic_pregnancy" text, "ya_p02_ic_recent_eye_abdominal_chest_surgery" text, "ya_p02_ic_recent_myocardial_infarction" text, "ya_p02_ic_spirometry" text, "ya_p02_ic_surgical_metal_body" text, "ya_p02_ic_unstable_angina_pectoris" text, "ya_p02_ic_ya_dl_elspac" text, "ya_p02_ic_ya_med_find" text, "ya_p02_ic_ya_newsletter" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.psycap_p01_ya_p02__role, psc_role.psycap_p02_old_ya_p02__role, psc_role.ya_p02__role, psc_role.ya_p02_digi_ya03v2__role, psc_role.ya_p02_digi_ya04v2__role, psc_role.ya_p02_digi_ya05v2__role, psc_role.ya_p02_test__role, psc_state.psycap_p01_ya_p02__state, psc_state.psycap_p02_old_ya_p02__state, psc_state.ya_p02__state, psc_state.ya_p02_digi_ya03v2__state, psc_state.ya_p02_digi_ya04v2__state, psc_state.ya_p02_digi_ya05v2__state, psc_state.ya_p02_test__state, psc_activity_state.psycap_p01_ya_p02__activity_state, psc_activity_state.psycap_p02_old_ya_p02__activity_state, psc_activity_state.ya_p02__activity_state, psc_activity_state.ya_p02_digi_ya03v2__activity_state, psc_activity_state.ya_p02_digi_ya04v2__activity_state, psc_activity_state.ya_p02_digi_ya05v2__activity_state, psc_activity_state.ya_p02_test__activity_state, psc_created_at.psycap_p01_ya_p02__created_at, psc_created_at.psycap_p02_old_ya_p02__created_at, psc_created_at.ya_p02__created_at, psc_created_at.ya_p02_digi_ya03v2__created_at, psc_created_at.ya_p02_digi_ya04v2__created_at, psc_created_at.ya_p02_digi_ya05v2__created_at, psc_created_at.ya_p02_test__created_at, psc_accepted_at.psycap_p01_ya_p02__accepted_at, psc_accepted_at.psycap_p02_old_ya_p02__accepted_at, psc_accepted_at.ya_p02__accepted_at, psc_accepted_at.ya_p02_digi_ya03v2__accepted_at, psc_accepted_at.ya_p02_digi_ya04v2__accepted_at, psc_accepted_at.ya_p02_digi_ya05v2__accepted_at, psc_accepted_at.ya_p02_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p02__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p02__cancelled_at, psc_cancelled_at.ya_p02__cancelled_at, psc_cancelled_at.ya_p02_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p02_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p02__revoked_at, psc_revoked_at.psycap_p02_old_ya_p02__revoked_at, psc_revoked_at.ya_p02__revoked_at, psc_revoked_at.ya_p02_digi_ya03v2__revoked_at, psc_revoked_at.ya_p02_digi_ya04v2__revoked_at, psc_revoked_at.ya_p02_digi_ya05v2__revoked_at, psc_revoked_at.ya_p02_test__revoked_at, psc_paused_at.psycap_p01_ya_p02__paused_at, psc_paused_at.psycap_p02_old_ya_p02__paused_at, psc_paused_at.ya_p02__paused_at, psc_paused_at.ya_p02_digi_ya03v2__paused_at, psc_paused_at.ya_p02_digi_ya04v2__paused_at, psc_paused_at.ya_p02_digi_ya05v2__paused_at, psc_paused_at.ya_p02_test__paused_at, ya_p02_ic_buccal_swab_proband, ya_p02_ic_urine_proband, ya_p02_ic_venous_blood_proband, ya_p02_ic_anam_qs, ya_p02_ic_aneurysm, ya_p02_ic_anthropometry, ya_p02_ic_arch_foot, ya_p02_ic_basic_qs, ya_p02_ic_blood_pressure, ya_p02_ic_braces_piercing_iud, ya_p02_ic_cognition_test, ya_p02_ic_da_health_registry, ya_p02_ic_dexa, ya_p02_ic_enviro_qs, ya_p02_ic_follow_up_studies, ya_p02_ic_fracture_lower_body_last_3m, ya_p02_ic_fracture_upper_body_last_3m, ya_p02_ic_hand_grip, ya_p02_ic_hearing_vision_impairment, ya_p02_ic_heart_disease, ya_p02_ic_hemoptysis_ns, ya_p02_ic_hernia, ya_p02_ic_hyperthyroidism, ya_p02_ic_inability_hold_pencil, ya_p02_ic_inability_stand_both_legs, ya_p02_ic_inability_talk_cze, ya_p02_ic_inability_walk, ya_p02_ic_inbody, ya_p02_ic_infectious_resp_diseases, ya_p02_ic_iodine_barium_radioisotopes_last_7d, ya_p02_ic_knee_stability, ya_p02_ic_nutri_qs, ya_p02_ic_over_weight_200_height_195, ya_p02_ic_pacemaker_defibrillator, ya_p02_ic_pneumothorax, ya_p02_ic_pregnancy, ya_p02_ic_recent_eye_abdominal_chest_surgery, ya_p02_ic_recent_myocardial_infarction, ya_p02_ic_spirometry, ya_p02_ic_surgical_metal_body, ya_p02_ic_unstable_angina_pectoris, ya_p02_ic_ya_dl_elspac, ya_p02_ic_ya_med_find, ya_p02_ic_ya_newsletter from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #17
Day Hour Count Duration Avg duration Nov 27 05 1 1s396ms 1s396ms 17 1 1s917ms 1s917ms [ User: tng_migration_user - Total duration: 3s313ms - Times executed: 2 ]
[ Application: dbt - Total duration: 3s313ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__15"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__15__dbt_tmp" as ( -- suject (proband) patrici do kohorty YA, Pilot ID: 15 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p02__role" text, "psycap_p02_old_ya_p02__role" text, "ya_p02__role" text, "ya_p02_digi_ya03v2__role" text, "ya_p02_digi_ya04v2__role" text, "ya_p02_digi_ya05v2__role" text, "ya_p02_test__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p02__state" text, "psycap_p02_old_ya_p02__state" text, "ya_p02__state" text, "ya_p02_digi_ya03v2__state" text, "ya_p02_digi_ya04v2__state" text, "ya_p02_digi_ya05v2__state" text, "ya_p02_test__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p02__activity_state" text, "psycap_p02_old_ya_p02__activity_state" text, "ya_p02__activity_state" text, "ya_p02_digi_ya03v2__activity_state" text, "ya_p02_digi_ya04v2__activity_state" text, "ya_p02_digi_ya05v2__activity_state" text, "ya_p02_test__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p02__created_at" text, "psycap_p02_old_ya_p02__created_at" text, "ya_p02__created_at" text, "ya_p02_digi_ya03v2__created_at" text, "ya_p02_digi_ya04v2__created_at" text, "ya_p02_digi_ya05v2__created_at" text, "ya_p02_test__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p02__accepted_at" text, "psycap_p02_old_ya_p02__accepted_at" text, "ya_p02__accepted_at" text, "ya_p02_digi_ya03v2__accepted_at" text, "ya_p02_digi_ya04v2__accepted_at" text, "ya_p02_digi_ya05v2__accepted_at" text, "ya_p02_test__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p02__cancelled_at" text, "psycap_p02_old_ya_p02__cancelled_at" text, "ya_p02__cancelled_at" text, "ya_p02_digi_ya03v2__cancelled_at" text, "ya_p02_digi_ya04v2__cancelled_at" text, "ya_p02_digi_ya05v2__cancelled_at" text, "ya_p02_test__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p02__revoked_at" text, "psycap_p02_old_ya_p02__revoked_at" text, "ya_p02__revoked_at" text, "ya_p02_digi_ya03v2__revoked_at" text, "ya_p02_digi_ya04v2__revoked_at" text, "ya_p02_digi_ya05v2__revoked_at" text, "ya_p02_test__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p02__paused_at" text, "psycap_p02_old_ya_p02__paused_at" text, "ya_p02__paused_at" text, "ya_p02_digi_ya03v2__paused_at" text, "ya_p02_digi_ya04v2__paused_at" text, "ya_p02_digi_ya05v2__paused_at" text, "ya_p02_test__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p02_ic_buccal_swab_proband'), ('ya_p02_ic_urine_proband'), ('ya_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p02_ic_buccal_swab_proband" text, "ya_p02_ic_urine_proband" text, "ya_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p02_ic_anam_qs'), ('ya_p02_ic_aneurysm'), ('ya_p02_ic_anthropometry'), ('ya_p02_ic_arch_foot'), ('ya_p02_ic_basic_qs'), ('ya_p02_ic_blood_pressure'), ('ya_p02_ic_braces_piercing_iud'), ('ya_p02_ic_cognition_test'), ('ya_p02_ic_da_health_registry'), ('ya_p02_ic_dexa'), ('ya_p02_ic_enviro_qs'), ('ya_p02_ic_follow_up_studies'), ('ya_p02_ic_fracture_lower_body_last_3m'), ('ya_p02_ic_fracture_upper_body_last_3m'), ('ya_p02_ic_hand_grip'), ('ya_p02_ic_hearing_vision_impairment'), ('ya_p02_ic_heart_disease'), ('ya_p02_ic_hemoptysis_ns'), ('ya_p02_ic_hernia'), ('ya_p02_ic_hyperthyroidism'), ('ya_p02_ic_inability_hold_pencil'), ('ya_p02_ic_inability_stand_both_legs'), ('ya_p02_ic_inability_talk_cze'), ('ya_p02_ic_inability_walk'), ('ya_p02_ic_inbody'), ('ya_p02_ic_infectious_resp_diseases'), ('ya_p02_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p02_ic_knee_stability'), ('ya_p02_ic_nutri_qs'), ('ya_p02_ic_over_weight_200_height_195'), ('ya_p02_ic_pacemaker_defibrillator'), ('ya_p02_ic_pneumothorax'), ('ya_p02_ic_pregnancy'), ('ya_p02_ic_recent_eye_abdominal_chest_surgery'), ('ya_p02_ic_recent_myocardial_infarction'), ('ya_p02_ic_spirometry'), ('ya_p02_ic_surgical_metal_body'), ('ya_p02_ic_unstable_angina_pectoris'), ('ya_p02_ic_ya_dl_elspac'), ('ya_p02_ic_ya_med_find'), ('ya_p02_ic_ya_newsletter') $$ ) AS extra_state ("subject_id" int, "ya_p02_ic_anam_qs" text, "ya_p02_ic_aneurysm" text, "ya_p02_ic_anthropometry" text, "ya_p02_ic_arch_foot" text, "ya_p02_ic_basic_qs" text, "ya_p02_ic_blood_pressure" text, "ya_p02_ic_braces_piercing_iud" text, "ya_p02_ic_cognition_test" text, "ya_p02_ic_da_health_registry" text, "ya_p02_ic_dexa" text, "ya_p02_ic_enviro_qs" text, "ya_p02_ic_follow_up_studies" text, "ya_p02_ic_fracture_lower_body_last_3m" text, "ya_p02_ic_fracture_upper_body_last_3m" text, "ya_p02_ic_hand_grip" text, "ya_p02_ic_hearing_vision_impairment" text, "ya_p02_ic_heart_disease" text, "ya_p02_ic_hemoptysis_ns" text, "ya_p02_ic_hernia" text, "ya_p02_ic_hyperthyroidism" text, "ya_p02_ic_inability_hold_pencil" text, "ya_p02_ic_inability_stand_both_legs" text, "ya_p02_ic_inability_talk_cze" text, "ya_p02_ic_inability_walk" text, "ya_p02_ic_inbody" text, "ya_p02_ic_infectious_resp_diseases" text, "ya_p02_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p02_ic_knee_stability" text, "ya_p02_ic_nutri_qs" text, "ya_p02_ic_over_weight_200_height_195" text, "ya_p02_ic_pacemaker_defibrillator" text, "ya_p02_ic_pneumothorax" text, "ya_p02_ic_pregnancy" text, "ya_p02_ic_recent_eye_abdominal_chest_surgery" text, "ya_p02_ic_recent_myocardial_infarction" text, "ya_p02_ic_spirometry" text, "ya_p02_ic_surgical_metal_body" text, "ya_p02_ic_unstable_angina_pectoris" text, "ya_p02_ic_ya_dl_elspac" text, "ya_p02_ic_ya_med_find" text, "ya_p02_ic_ya_newsletter" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p02__role, psc_role.psycap_p02_old_ya_p02__role, psc_role.ya_p02__role, psc_role.ya_p02_digi_ya03v2__role, psc_role.ya_p02_digi_ya04v2__role, psc_role.ya_p02_digi_ya05v2__role, psc_role.ya_p02_test__role, psc_state.psycap_p01_ya_p02__state, psc_state.psycap_p02_old_ya_p02__state, psc_state.ya_p02__state, psc_state.ya_p02_digi_ya03v2__state, psc_state.ya_p02_digi_ya04v2__state, psc_state.ya_p02_digi_ya05v2__state, psc_state.ya_p02_test__state, psc_activity_state.psycap_p01_ya_p02__activity_state, psc_activity_state.psycap_p02_old_ya_p02__activity_state, psc_activity_state.ya_p02__activity_state, psc_activity_state.ya_p02_digi_ya03v2__activity_state, psc_activity_state.ya_p02_digi_ya04v2__activity_state, psc_activity_state.ya_p02_digi_ya05v2__activity_state, psc_activity_state.ya_p02_test__activity_state, psc_created_at.psycap_p01_ya_p02__created_at, psc_created_at.psycap_p02_old_ya_p02__created_at, psc_created_at.ya_p02__created_at, psc_created_at.ya_p02_digi_ya03v2__created_at, psc_created_at.ya_p02_digi_ya04v2__created_at, psc_created_at.ya_p02_digi_ya05v2__created_at, psc_created_at.ya_p02_test__created_at, psc_accepted_at.psycap_p01_ya_p02__accepted_at, psc_accepted_at.psycap_p02_old_ya_p02__accepted_at, psc_accepted_at.ya_p02__accepted_at, psc_accepted_at.ya_p02_digi_ya03v2__accepted_at, psc_accepted_at.ya_p02_digi_ya04v2__accepted_at, psc_accepted_at.ya_p02_digi_ya05v2__accepted_at, psc_accepted_at.ya_p02_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p02__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p02__cancelled_at, psc_cancelled_at.ya_p02__cancelled_at, psc_cancelled_at.ya_p02_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p02_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p02__revoked_at, psc_revoked_at.psycap_p02_old_ya_p02__revoked_at, psc_revoked_at.ya_p02__revoked_at, psc_revoked_at.ya_p02_digi_ya03v2__revoked_at, psc_revoked_at.ya_p02_digi_ya04v2__revoked_at, psc_revoked_at.ya_p02_digi_ya05v2__revoked_at, psc_revoked_at.ya_p02_test__revoked_at, psc_paused_at.psycap_p01_ya_p02__paused_at, psc_paused_at.psycap_p02_old_ya_p02__paused_at, psc_paused_at.ya_p02__paused_at, psc_paused_at.ya_p02_digi_ya03v2__paused_at, psc_paused_at.ya_p02_digi_ya04v2__paused_at, psc_paused_at.ya_p02_digi_ya05v2__paused_at, psc_paused_at.ya_p02_test__paused_at, ya_p02_ic_buccal_swab_proband, ya_p02_ic_urine_proband, ya_p02_ic_venous_blood_proband, ya_p02_ic_anam_qs, ya_p02_ic_aneurysm, ya_p02_ic_anthropometry, ya_p02_ic_arch_foot, ya_p02_ic_basic_qs, ya_p02_ic_blood_pressure, ya_p02_ic_braces_piercing_iud, ya_p02_ic_cognition_test, ya_p02_ic_da_health_registry, ya_p02_ic_dexa, ya_p02_ic_enviro_qs, ya_p02_ic_follow_up_studies, ya_p02_ic_fracture_lower_body_last_3m, ya_p02_ic_fracture_upper_body_last_3m, ya_p02_ic_hand_grip, ya_p02_ic_hearing_vision_impairment, ya_p02_ic_heart_disease, ya_p02_ic_hemoptysis_ns, ya_p02_ic_hernia, ya_p02_ic_hyperthyroidism, ya_p02_ic_inability_hold_pencil, ya_p02_ic_inability_stand_both_legs, ya_p02_ic_inability_talk_cze, ya_p02_ic_inability_walk, ya_p02_ic_inbody, ya_p02_ic_infectious_resp_diseases, ya_p02_ic_iodine_barium_radioisotopes_last_7d, ya_p02_ic_knee_stability, ya_p02_ic_nutri_qs, ya_p02_ic_over_weight_200_height_195, ya_p02_ic_pacemaker_defibrillator, ya_p02_ic_pneumothorax, ya_p02_ic_pregnancy, ya_p02_ic_recent_eye_abdominal_chest_surgery, ya_p02_ic_recent_myocardial_infarction, ya_p02_ic_spirometry, ya_p02_ic_surgical_metal_body, ya_p02_ic_unstable_angina_pectoris, ya_p02_ic_ya_dl_elspac, ya_p02_ic_ya_med_find, ya_p02_ic_ya_newsletter FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 15 -- Pilot ID );
Date: 2025-11-27 17:02:25 Duration: 1s917ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__15"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__15__dbt_tmp" as ( -- suject (proband) patrici do kohorty YA, Pilot ID: 15 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p02__role" text, "psycap_p02_old_ya_p02__role" text, "ya_p02__role" text, "ya_p02_digi_ya03v2__role" text, "ya_p02_digi_ya04v2__role" text, "ya_p02_digi_ya05v2__role" text, "ya_p02_test__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p02__state" text, "psycap_p02_old_ya_p02__state" text, "ya_p02__state" text, "ya_p02_digi_ya03v2__state" text, "ya_p02_digi_ya04v2__state" text, "ya_p02_digi_ya05v2__state" text, "ya_p02_test__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p02__activity_state" text, "psycap_p02_old_ya_p02__activity_state" text, "ya_p02__activity_state" text, "ya_p02_digi_ya03v2__activity_state" text, "ya_p02_digi_ya04v2__activity_state" text, "ya_p02_digi_ya05v2__activity_state" text, "ya_p02_test__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p02__created_at" text, "psycap_p02_old_ya_p02__created_at" text, "ya_p02__created_at" text, "ya_p02_digi_ya03v2__created_at" text, "ya_p02_digi_ya04v2__created_at" text, "ya_p02_digi_ya05v2__created_at" text, "ya_p02_test__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p02__accepted_at" text, "psycap_p02_old_ya_p02__accepted_at" text, "ya_p02__accepted_at" text, "ya_p02_digi_ya03v2__accepted_at" text, "ya_p02_digi_ya04v2__accepted_at" text, "ya_p02_digi_ya05v2__accepted_at" text, "ya_p02_test__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p02__cancelled_at" text, "psycap_p02_old_ya_p02__cancelled_at" text, "ya_p02__cancelled_at" text, "ya_p02_digi_ya03v2__cancelled_at" text, "ya_p02_digi_ya04v2__cancelled_at" text, "ya_p02_digi_ya05v2__cancelled_at" text, "ya_p02_test__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p02__revoked_at" text, "psycap_p02_old_ya_p02__revoked_at" text, "ya_p02__revoked_at" text, "ya_p02_digi_ya03v2__revoked_at" text, "ya_p02_digi_ya04v2__revoked_at" text, "ya_p02_digi_ya05v2__revoked_at" text, "ya_p02_test__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p02__paused_at" text, "psycap_p02_old_ya_p02__paused_at" text, "ya_p02__paused_at" text, "ya_p02_digi_ya03v2__paused_at" text, "ya_p02_digi_ya04v2__paused_at" text, "ya_p02_digi_ya05v2__paused_at" text, "ya_p02_test__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p02_ic_buccal_swab_proband'), ('ya_p02_ic_urine_proband'), ('ya_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p02_ic_buccal_swab_proband" text, "ya_p02_ic_urine_proband" text, "ya_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p02_ic_anam_qs'), ('ya_p02_ic_aneurysm'), ('ya_p02_ic_anthropometry'), ('ya_p02_ic_arch_foot'), ('ya_p02_ic_basic_qs'), ('ya_p02_ic_blood_pressure'), ('ya_p02_ic_braces_piercing_iud'), ('ya_p02_ic_cognition_test'), ('ya_p02_ic_da_health_registry'), ('ya_p02_ic_dexa'), ('ya_p02_ic_enviro_qs'), ('ya_p02_ic_follow_up_studies'), ('ya_p02_ic_fracture_lower_body_last_3m'), ('ya_p02_ic_fracture_upper_body_last_3m'), ('ya_p02_ic_hand_grip'), ('ya_p02_ic_hearing_vision_impairment'), ('ya_p02_ic_heart_disease'), ('ya_p02_ic_hemoptysis_ns'), ('ya_p02_ic_hernia'), ('ya_p02_ic_hyperthyroidism'), ('ya_p02_ic_inability_hold_pencil'), ('ya_p02_ic_inability_stand_both_legs'), ('ya_p02_ic_inability_talk_cze'), ('ya_p02_ic_inability_walk'), ('ya_p02_ic_inbody'), ('ya_p02_ic_infectious_resp_diseases'), ('ya_p02_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p02_ic_knee_stability'), ('ya_p02_ic_nutri_qs'), ('ya_p02_ic_over_weight_200_height_195'), ('ya_p02_ic_pacemaker_defibrillator'), ('ya_p02_ic_pneumothorax'), ('ya_p02_ic_pregnancy'), ('ya_p02_ic_recent_eye_abdominal_chest_surgery'), ('ya_p02_ic_recent_myocardial_infarction'), ('ya_p02_ic_spirometry'), ('ya_p02_ic_surgical_metal_body'), ('ya_p02_ic_unstable_angina_pectoris'), ('ya_p02_ic_ya_dl_elspac'), ('ya_p02_ic_ya_med_find'), ('ya_p02_ic_ya_newsletter') $$ ) AS extra_state ("subject_id" int, "ya_p02_ic_anam_qs" text, "ya_p02_ic_aneurysm" text, "ya_p02_ic_anthropometry" text, "ya_p02_ic_arch_foot" text, "ya_p02_ic_basic_qs" text, "ya_p02_ic_blood_pressure" text, "ya_p02_ic_braces_piercing_iud" text, "ya_p02_ic_cognition_test" text, "ya_p02_ic_da_health_registry" text, "ya_p02_ic_dexa" text, "ya_p02_ic_enviro_qs" text, "ya_p02_ic_follow_up_studies" text, "ya_p02_ic_fracture_lower_body_last_3m" text, "ya_p02_ic_fracture_upper_body_last_3m" text, "ya_p02_ic_hand_grip" text, "ya_p02_ic_hearing_vision_impairment" text, "ya_p02_ic_heart_disease" text, "ya_p02_ic_hemoptysis_ns" text, "ya_p02_ic_hernia" text, "ya_p02_ic_hyperthyroidism" text, "ya_p02_ic_inability_hold_pencil" text, "ya_p02_ic_inability_stand_both_legs" text, "ya_p02_ic_inability_talk_cze" text, "ya_p02_ic_inability_walk" text, "ya_p02_ic_inbody" text, "ya_p02_ic_infectious_resp_diseases" text, "ya_p02_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p02_ic_knee_stability" text, "ya_p02_ic_nutri_qs" text, "ya_p02_ic_over_weight_200_height_195" text, "ya_p02_ic_pacemaker_defibrillator" text, "ya_p02_ic_pneumothorax" text, "ya_p02_ic_pregnancy" text, "ya_p02_ic_recent_eye_abdominal_chest_surgery" text, "ya_p02_ic_recent_myocardial_infarction" text, "ya_p02_ic_spirometry" text, "ya_p02_ic_surgical_metal_body" text, "ya_p02_ic_unstable_angina_pectoris" text, "ya_p02_ic_ya_dl_elspac" text, "ya_p02_ic_ya_med_find" text, "ya_p02_ic_ya_newsletter" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p02__role, psc_role.psycap_p02_old_ya_p02__role, psc_role.ya_p02__role, psc_role.ya_p02_digi_ya03v2__role, psc_role.ya_p02_digi_ya04v2__role, psc_role.ya_p02_digi_ya05v2__role, psc_role.ya_p02_test__role, psc_state.psycap_p01_ya_p02__state, psc_state.psycap_p02_old_ya_p02__state, psc_state.ya_p02__state, psc_state.ya_p02_digi_ya03v2__state, psc_state.ya_p02_digi_ya04v2__state, psc_state.ya_p02_digi_ya05v2__state, psc_state.ya_p02_test__state, psc_activity_state.psycap_p01_ya_p02__activity_state, psc_activity_state.psycap_p02_old_ya_p02__activity_state, psc_activity_state.ya_p02__activity_state, psc_activity_state.ya_p02_digi_ya03v2__activity_state, psc_activity_state.ya_p02_digi_ya04v2__activity_state, psc_activity_state.ya_p02_digi_ya05v2__activity_state, psc_activity_state.ya_p02_test__activity_state, psc_created_at.psycap_p01_ya_p02__created_at, psc_created_at.psycap_p02_old_ya_p02__created_at, psc_created_at.ya_p02__created_at, psc_created_at.ya_p02_digi_ya03v2__created_at, psc_created_at.ya_p02_digi_ya04v2__created_at, psc_created_at.ya_p02_digi_ya05v2__created_at, psc_created_at.ya_p02_test__created_at, psc_accepted_at.psycap_p01_ya_p02__accepted_at, psc_accepted_at.psycap_p02_old_ya_p02__accepted_at, psc_accepted_at.ya_p02__accepted_at, psc_accepted_at.ya_p02_digi_ya03v2__accepted_at, psc_accepted_at.ya_p02_digi_ya04v2__accepted_at, psc_accepted_at.ya_p02_digi_ya05v2__accepted_at, psc_accepted_at.ya_p02_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p02__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p02__cancelled_at, psc_cancelled_at.ya_p02__cancelled_at, psc_cancelled_at.ya_p02_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p02_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p02__revoked_at, psc_revoked_at.psycap_p02_old_ya_p02__revoked_at, psc_revoked_at.ya_p02__revoked_at, psc_revoked_at.ya_p02_digi_ya03v2__revoked_at, psc_revoked_at.ya_p02_digi_ya04v2__revoked_at, psc_revoked_at.ya_p02_digi_ya05v2__revoked_at, psc_revoked_at.ya_p02_test__revoked_at, psc_paused_at.psycap_p01_ya_p02__paused_at, psc_paused_at.psycap_p02_old_ya_p02__paused_at, psc_paused_at.ya_p02__paused_at, psc_paused_at.ya_p02_digi_ya03v2__paused_at, psc_paused_at.ya_p02_digi_ya04v2__paused_at, psc_paused_at.ya_p02_digi_ya05v2__paused_at, psc_paused_at.ya_p02_test__paused_at, ya_p02_ic_buccal_swab_proband, ya_p02_ic_urine_proband, ya_p02_ic_venous_blood_proband, ya_p02_ic_anam_qs, ya_p02_ic_aneurysm, ya_p02_ic_anthropometry, ya_p02_ic_arch_foot, ya_p02_ic_basic_qs, ya_p02_ic_blood_pressure, ya_p02_ic_braces_piercing_iud, ya_p02_ic_cognition_test, ya_p02_ic_da_health_registry, ya_p02_ic_dexa, ya_p02_ic_enviro_qs, ya_p02_ic_follow_up_studies, ya_p02_ic_fracture_lower_body_last_3m, ya_p02_ic_fracture_upper_body_last_3m, ya_p02_ic_hand_grip, ya_p02_ic_hearing_vision_impairment, ya_p02_ic_heart_disease, ya_p02_ic_hemoptysis_ns, ya_p02_ic_hernia, ya_p02_ic_hyperthyroidism, ya_p02_ic_inability_hold_pencil, ya_p02_ic_inability_stand_both_legs, ya_p02_ic_inability_talk_cze, ya_p02_ic_inability_walk, ya_p02_ic_inbody, ya_p02_ic_infectious_resp_diseases, ya_p02_ic_iodine_barium_radioisotopes_last_7d, ya_p02_ic_knee_stability, ya_p02_ic_nutri_qs, ya_p02_ic_over_weight_200_height_195, ya_p02_ic_pacemaker_defibrillator, ya_p02_ic_pneumothorax, ya_p02_ic_pregnancy, ya_p02_ic_recent_eye_abdominal_chest_surgery, ya_p02_ic_recent_myocardial_infarction, ya_p02_ic_spirometry, ya_p02_ic_surgical_metal_body, ya_p02_ic_unstable_angina_pectoris, ya_p02_ic_ya_dl_elspac, ya_p02_ic_ya_med_find, ya_p02_ic_ya_newsletter FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 15 -- Pilot ID );
Date: 2025-11-27 05:02:22 Duration: 1s396ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
18 3s127ms 2 1s459ms 1s667ms 1s563ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__12__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "psycap_p01_ya_p01__role" text, "psycap_p02_old_ya_p01__role" text, "ya_p01__role" text, "ya_p01_digi_ya03v2__role" text, "ya_p01_digi_ya04v2__role" text, "ya_p01_digi_ya05v2__role" text, "ya_p01_test__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "psycap_p01_ya_p01__state" text, "psycap_p02_old_ya_p01__state" text, "ya_p01__state" text, "ya_p01_digi_ya03v2__state" text, "ya_p01_digi_ya04v2__state" text, "ya_p01_digi_ya05v2__state" text, "ya_p01_test__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as activity ("subject_id" int, "psycap_p01_ya_p01__activity_state" text, "psycap_p02_old_ya_p01__activity_state" text, "ya_p01__activity_state" text, "ya_p01_digi_ya03v2__activity_state" text, "ya_p01_digi_ya04v2__activity_state" text, "ya_p01_digi_ya05v2__activity_state" text, "ya_p01_test__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as created_at ("subject_id" int, "psycap_p01_ya_p01__created_at" text, "psycap_p02_old_ya_p01__created_at" text, "ya_p01__created_at" text, "ya_p01_digi_ya03v2__created_at" text, "ya_p01_digi_ya04v2__created_at" text, "ya_p01_digi_ya05v2__created_at" text, "ya_p01_test__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "psycap_p01_ya_p01__accepted_at" text, "psycap_p02_old_ya_p01__accepted_at" text, "ya_p01__accepted_at" text, "ya_p01_digi_ya03v2__accepted_at" text, "ya_p01_digi_ya04v2__accepted_at" text, "ya_p01_digi_ya05v2__accepted_at" text, "ya_p01_test__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "psycap_p01_ya_p01__cancelled_at" text, "psycap_p02_old_ya_p01__cancelled_at" text, "ya_p01__cancelled_at" text, "ya_p01_digi_ya03v2__cancelled_at" text, "ya_p01_digi_ya04v2__cancelled_at" text, "ya_p01_digi_ya05v2__cancelled_at" text, "ya_p01_test__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "psycap_p01_ya_p01__revoked_at" text, "psycap_p02_old_ya_p01__revoked_at" text, "ya_p01__revoked_at" text, "ya_p01_digi_ya03v2__revoked_at" text, "ya_p01_digi_ya04v2__revoked_at" text, "ya_p01_digi_ya05v2__revoked_at" text, "ya_p01_test__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as paused_at ("subject_id" int, "psycap_p01_ya_p01__paused_at" text, "psycap_p02_old_ya_p01__paused_at" text, "ya_p01__paused_at" text, "ya_p01_digi_ya03v2__paused_at" text, "ya_p01_digi_ya04v2__paused_at" text, "ya_p01_digi_ya05v2__paused_at" text, "ya_p01_test__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "ya_p01_ic_buccal_swab_proband" text, "ya_p01_ic_urine_proband" text, "ya_p01_ic_venous_blood_proband" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "ya_p01_ic_anam_qs" text, "ya_p01_ic_aneurysm" text, "ya_p01_ic_anthropometry" text, "ya_p01_ic_arch_foot" text, "ya_p01_ic_basic_qs" text, "ya_p01_ic_blood_pressure" text, "ya_p01_ic_braces_piercing_iud" text, "ya_p01_ic_cognition_test" text, "ya_p01_ic_da_health_registry" text, "ya_p01_ic_dexa" text, "ya_p01_ic_enviro_qs" text, "ya_p01_ic_follow_up_studies" text, "ya_p01_ic_fracture_lower_body_last_3m" text, "ya_p01_ic_fracture_upper_body_last_3m" text, "ya_p01_ic_hand_grip" text, "ya_p01_ic_hearing_vision_impairment" text, "ya_p01_ic_heart_disease" text, "ya_p01_ic_hemoptysis_ns" text, "ya_p01_ic_hernia" text, "ya_p01_ic_hyperthyroidism" text, "ya_p01_ic_inability_hold_pencil" text, "ya_p01_ic_inability_stand_both_legs" text, "ya_p01_ic_inability_talk_cze" text, "ya_p01_ic_inability_walk" text, "ya_p01_ic_inbody" text, "ya_p01_ic_infectious_resp_diseases" text, "ya_p01_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p01_ic_knee_stability" text, "ya_p01_ic_med_find" text, "ya_p01_ic_nutri_qs" text, "ya_p01_ic_over_weight_200_height_195" text, "ya_p01_ic_pacemaker_defibrillator" text, "ya_p01_ic_pneumothorax" text, "ya_p01_ic_pregnancy" text, "ya_p01_ic_recent_eye_abdominal_chest_surgery" text, "ya_p01_ic_recent_myocardial_infarction" text, "ya_p01_ic_spirometry" text, "ya_p01_ic_surgical_metal_body" text, "ya_p01_ic_unstable_angina_pectoris" text, "ya_p01_ic_ya_dl_elspac" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.psycap_p01_ya_p01__role, psc_role.psycap_p02_old_ya_p01__role, psc_role.ya_p01__role, psc_role.ya_p01_digi_ya03v2__role, psc_role.ya_p01_digi_ya04v2__role, psc_role.ya_p01_digi_ya05v2__role, psc_role.ya_p01_test__role, psc_state.psycap_p01_ya_p01__state, psc_state.psycap_p02_old_ya_p01__state, psc_state.ya_p01__state, psc_state.ya_p01_digi_ya03v2__state, psc_state.ya_p01_digi_ya04v2__state, psc_state.ya_p01_digi_ya05v2__state, psc_state.ya_p01_test__state, psc_activity_state.psycap_p01_ya_p01__activity_state, psc_activity_state.psycap_p02_old_ya_p01__activity_state, psc_activity_state.ya_p01__activity_state, psc_activity_state.ya_p01_digi_ya03v2__activity_state, psc_activity_state.ya_p01_digi_ya04v2__activity_state, psc_activity_state.ya_p01_digi_ya05v2__activity_state, psc_activity_state.ya_p01_test__activity_state, psc_created_at.psycap_p01_ya_p01__created_at, psc_created_at.psycap_p02_old_ya_p01__created_at, psc_created_at.ya_p01__created_at, psc_created_at.ya_p01_digi_ya03v2__created_at, psc_created_at.ya_p01_digi_ya04v2__created_at, psc_created_at.ya_p01_digi_ya05v2__created_at, psc_created_at.ya_p01_test__created_at, psc_accepted_at.psycap_p01_ya_p01__accepted_at, psc_accepted_at.psycap_p02_old_ya_p01__accepted_at, psc_accepted_at.ya_p01__accepted_at, psc_accepted_at.ya_p01_digi_ya03v2__accepted_at, psc_accepted_at.ya_p01_digi_ya04v2__accepted_at, psc_accepted_at.ya_p01_digi_ya05v2__accepted_at, psc_accepted_at.ya_p01_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p01__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p01__cancelled_at, psc_cancelled_at.ya_p01__cancelled_at, psc_cancelled_at.ya_p01_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p01_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p01_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p01_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p01__revoked_at, psc_revoked_at.psycap_p02_old_ya_p01__revoked_at, psc_revoked_at.ya_p01__revoked_at, psc_revoked_at.ya_p01_digi_ya03v2__revoked_at, psc_revoked_at.ya_p01_digi_ya04v2__revoked_at, psc_revoked_at.ya_p01_digi_ya05v2__revoked_at, psc_revoked_at.ya_p01_test__revoked_at, psc_paused_at.psycap_p01_ya_p01__paused_at, psc_paused_at.psycap_p02_old_ya_p01__paused_at, psc_paused_at.ya_p01__paused_at, psc_paused_at.ya_p01_digi_ya03v2__paused_at, psc_paused_at.ya_p01_digi_ya04v2__paused_at, psc_paused_at.ya_p01_digi_ya05v2__paused_at, psc_paused_at.ya_p01_test__paused_at, ya_p01_ic_buccal_swab_proband, ya_p01_ic_urine_proband, ya_p01_ic_venous_blood_proband, ya_p01_ic_anam_qs, ya_p01_ic_aneurysm, ya_p01_ic_anthropometry, ya_p01_ic_arch_foot, ya_p01_ic_basic_qs, ya_p01_ic_blood_pressure, ya_p01_ic_braces_piercing_iud, ya_p01_ic_cognition_test, ya_p01_ic_da_health_registry, ya_p01_ic_dexa, ya_p01_ic_enviro_qs, ya_p01_ic_follow_up_studies, ya_p01_ic_fracture_lower_body_last_3m, ya_p01_ic_fracture_upper_body_last_3m, ya_p01_ic_hand_grip, ya_p01_ic_hearing_vision_impairment, ya_p01_ic_heart_disease, ya_p01_ic_hemoptysis_ns, ya_p01_ic_hernia, ya_p01_ic_hyperthyroidism, ya_p01_ic_inability_hold_pencil, ya_p01_ic_inability_stand_both_legs, ya_p01_ic_inability_talk_cze, ya_p01_ic_inability_walk, ya_p01_ic_inbody, ya_p01_ic_infectious_resp_diseases, ya_p01_ic_iodine_barium_radioisotopes_last_7d, ya_p01_ic_knee_stability, ya_p01_ic_med_find, ya_p01_ic_nutri_qs, ya_p01_ic_over_weight_200_height_195, ya_p01_ic_pacemaker_defibrillator, ya_p01_ic_pneumothorax, ya_p01_ic_pregnancy, ya_p01_ic_recent_eye_abdominal_chest_surgery, ya_p01_ic_recent_myocardial_infarction, ya_p01_ic_spirometry, ya_p01_ic_surgical_metal_body, ya_p01_ic_unstable_angina_pectoris, ya_p01_ic_ya_dl_elspac from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #18
Day Hour Count Duration Avg duration Nov 27 05 1 1s459ms 1s459ms 17 1 1s667ms 1s667ms [ User: tng_migration_user - Total duration: 3s127ms - Times executed: 2 ]
[ Application: dbt - Total duration: 3s127ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__12"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__12__dbt_tmp" as ( -- suject (proband) patrici do kohorty YA Pilot I, Pilot ID: 12 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p01__role" text, "psycap_p02_old_ya_p01__role" text, "ya_p01__role" text, "ya_p01_digi_ya03v2__role" text, "ya_p01_digi_ya04v2__role" text, "ya_p01_digi_ya05v2__role" text, "ya_p01_test__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p01__state" text, "psycap_p02_old_ya_p01__state" text, "ya_p01__state" text, "ya_p01_digi_ya03v2__state" text, "ya_p01_digi_ya04v2__state" text, "ya_p01_digi_ya05v2__state" text, "ya_p01_test__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p01__activity_state" text, "psycap_p02_old_ya_p01__activity_state" text, "ya_p01__activity_state" text, "ya_p01_digi_ya03v2__activity_state" text, "ya_p01_digi_ya04v2__activity_state" text, "ya_p01_digi_ya05v2__activity_state" text, "ya_p01_test__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p01__created_at" text, "psycap_p02_old_ya_p01__created_at" text, "ya_p01__created_at" text, "ya_p01_digi_ya03v2__created_at" text, "ya_p01_digi_ya04v2__created_at" text, "ya_p01_digi_ya05v2__created_at" text, "ya_p01_test__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p01__accepted_at" text, "psycap_p02_old_ya_p01__accepted_at" text, "ya_p01__accepted_at" text, "ya_p01_digi_ya03v2__accepted_at" text, "ya_p01_digi_ya04v2__accepted_at" text, "ya_p01_digi_ya05v2__accepted_at" text, "ya_p01_test__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p01__cancelled_at" text, "psycap_p02_old_ya_p01__cancelled_at" text, "ya_p01__cancelled_at" text, "ya_p01_digi_ya03v2__cancelled_at" text, "ya_p01_digi_ya04v2__cancelled_at" text, "ya_p01_digi_ya05v2__cancelled_at" text, "ya_p01_test__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p01__revoked_at" text, "psycap_p02_old_ya_p01__revoked_at" text, "ya_p01__revoked_at" text, "ya_p01_digi_ya03v2__revoked_at" text, "ya_p01_digi_ya04v2__revoked_at" text, "ya_p01_digi_ya05v2__revoked_at" text, "ya_p01_test__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p01__paused_at" text, "psycap_p02_old_ya_p01__paused_at" text, "ya_p01__paused_at" text, "ya_p01_digi_ya03v2__paused_at" text, "ya_p01_digi_ya04v2__paused_at" text, "ya_p01_digi_ya05v2__paused_at" text, "ya_p01_test__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p01_ic_buccal_swab_proband'), ('ya_p01_ic_urine_proband'), ('ya_p01_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p01_ic_buccal_swab_proband" text, "ya_p01_ic_urine_proband" text, "ya_p01_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p01_ic_anam_qs'), ('ya_p01_ic_aneurysm'), ('ya_p01_ic_anthropometry'), ('ya_p01_ic_arch_foot'), ('ya_p01_ic_basic_qs'), ('ya_p01_ic_blood_pressure'), ('ya_p01_ic_braces_piercing_iud'), ('ya_p01_ic_cognition_test'), ('ya_p01_ic_da_health_registry'), ('ya_p01_ic_dexa'), ('ya_p01_ic_enviro_qs'), ('ya_p01_ic_follow_up_studies'), ('ya_p01_ic_fracture_lower_body_last_3m'), ('ya_p01_ic_fracture_upper_body_last_3m'), ('ya_p01_ic_hand_grip'), ('ya_p01_ic_hearing_vision_impairment'), ('ya_p01_ic_heart_disease'), ('ya_p01_ic_hemoptysis_ns'), ('ya_p01_ic_hernia'), ('ya_p01_ic_hyperthyroidism'), ('ya_p01_ic_inability_hold_pencil'), ('ya_p01_ic_inability_stand_both_legs'), ('ya_p01_ic_inability_talk_cze'), ('ya_p01_ic_inability_walk'), ('ya_p01_ic_inbody'), ('ya_p01_ic_infectious_resp_diseases'), ('ya_p01_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p01_ic_knee_stability'), ('ya_p01_ic_med_find'), ('ya_p01_ic_nutri_qs'), ('ya_p01_ic_over_weight_200_height_195'), ('ya_p01_ic_pacemaker_defibrillator'), ('ya_p01_ic_pneumothorax'), ('ya_p01_ic_pregnancy'), ('ya_p01_ic_recent_eye_abdominal_chest_surgery'), ('ya_p01_ic_recent_myocardial_infarction'), ('ya_p01_ic_spirometry'), ('ya_p01_ic_surgical_metal_body'), ('ya_p01_ic_unstable_angina_pectoris'), ('ya_p01_ic_ya_dl_elspac') $$ ) AS extra_state ("subject_id" int, "ya_p01_ic_anam_qs" text, "ya_p01_ic_aneurysm" text, "ya_p01_ic_anthropometry" text, "ya_p01_ic_arch_foot" text, "ya_p01_ic_basic_qs" text, "ya_p01_ic_blood_pressure" text, "ya_p01_ic_braces_piercing_iud" text, "ya_p01_ic_cognition_test" text, "ya_p01_ic_da_health_registry" text, "ya_p01_ic_dexa" text, "ya_p01_ic_enviro_qs" text, "ya_p01_ic_follow_up_studies" text, "ya_p01_ic_fracture_lower_body_last_3m" text, "ya_p01_ic_fracture_upper_body_last_3m" text, "ya_p01_ic_hand_grip" text, "ya_p01_ic_hearing_vision_impairment" text, "ya_p01_ic_heart_disease" text, "ya_p01_ic_hemoptysis_ns" text, "ya_p01_ic_hernia" text, "ya_p01_ic_hyperthyroidism" text, "ya_p01_ic_inability_hold_pencil" text, "ya_p01_ic_inability_stand_both_legs" text, "ya_p01_ic_inability_talk_cze" text, "ya_p01_ic_inability_walk" text, "ya_p01_ic_inbody" text, "ya_p01_ic_infectious_resp_diseases" text, "ya_p01_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p01_ic_knee_stability" text, "ya_p01_ic_med_find" text, "ya_p01_ic_nutri_qs" text, "ya_p01_ic_over_weight_200_height_195" text, "ya_p01_ic_pacemaker_defibrillator" text, "ya_p01_ic_pneumothorax" text, "ya_p01_ic_pregnancy" text, "ya_p01_ic_recent_eye_abdominal_chest_surgery" text, "ya_p01_ic_recent_myocardial_infarction" text, "ya_p01_ic_spirometry" text, "ya_p01_ic_surgical_metal_body" text, "ya_p01_ic_unstable_angina_pectoris" text, "ya_p01_ic_ya_dl_elspac" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p01__role, psc_role.psycap_p02_old_ya_p01__role, psc_role.ya_p01__role, psc_role.ya_p01_digi_ya03v2__role, psc_role.ya_p01_digi_ya04v2__role, psc_role.ya_p01_digi_ya05v2__role, psc_role.ya_p01_test__role, psc_state.psycap_p01_ya_p01__state, psc_state.psycap_p02_old_ya_p01__state, psc_state.ya_p01__state, psc_state.ya_p01_digi_ya03v2__state, psc_state.ya_p01_digi_ya04v2__state, psc_state.ya_p01_digi_ya05v2__state, psc_state.ya_p01_test__state, psc_activity_state.psycap_p01_ya_p01__activity_state, psc_activity_state.psycap_p02_old_ya_p01__activity_state, psc_activity_state.ya_p01__activity_state, psc_activity_state.ya_p01_digi_ya03v2__activity_state, psc_activity_state.ya_p01_digi_ya04v2__activity_state, psc_activity_state.ya_p01_digi_ya05v2__activity_state, psc_activity_state.ya_p01_test__activity_state, psc_created_at.psycap_p01_ya_p01__created_at, psc_created_at.psycap_p02_old_ya_p01__created_at, psc_created_at.ya_p01__created_at, psc_created_at.ya_p01_digi_ya03v2__created_at, psc_created_at.ya_p01_digi_ya04v2__created_at, psc_created_at.ya_p01_digi_ya05v2__created_at, psc_created_at.ya_p01_test__created_at, psc_accepted_at.psycap_p01_ya_p01__accepted_at, psc_accepted_at.psycap_p02_old_ya_p01__accepted_at, psc_accepted_at.ya_p01__accepted_at, psc_accepted_at.ya_p01_digi_ya03v2__accepted_at, psc_accepted_at.ya_p01_digi_ya04v2__accepted_at, psc_accepted_at.ya_p01_digi_ya05v2__accepted_at, psc_accepted_at.ya_p01_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p01__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p01__cancelled_at, psc_cancelled_at.ya_p01__cancelled_at, psc_cancelled_at.ya_p01_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p01_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p01_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p01_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p01__revoked_at, psc_revoked_at.psycap_p02_old_ya_p01__revoked_at, psc_revoked_at.ya_p01__revoked_at, psc_revoked_at.ya_p01_digi_ya03v2__revoked_at, psc_revoked_at.ya_p01_digi_ya04v2__revoked_at, psc_revoked_at.ya_p01_digi_ya05v2__revoked_at, psc_revoked_at.ya_p01_test__revoked_at, psc_paused_at.psycap_p01_ya_p01__paused_at, psc_paused_at.psycap_p02_old_ya_p01__paused_at, psc_paused_at.ya_p01__paused_at, psc_paused_at.ya_p01_digi_ya03v2__paused_at, psc_paused_at.ya_p01_digi_ya04v2__paused_at, psc_paused_at.ya_p01_digi_ya05v2__paused_at, psc_paused_at.ya_p01_test__paused_at, ya_p01_ic_buccal_swab_proband, ya_p01_ic_urine_proband, ya_p01_ic_venous_blood_proband, ya_p01_ic_anam_qs, ya_p01_ic_aneurysm, ya_p01_ic_anthropometry, ya_p01_ic_arch_foot, ya_p01_ic_basic_qs, ya_p01_ic_blood_pressure, ya_p01_ic_braces_piercing_iud, ya_p01_ic_cognition_test, ya_p01_ic_da_health_registry, ya_p01_ic_dexa, ya_p01_ic_enviro_qs, ya_p01_ic_follow_up_studies, ya_p01_ic_fracture_lower_body_last_3m, ya_p01_ic_fracture_upper_body_last_3m, ya_p01_ic_hand_grip, ya_p01_ic_hearing_vision_impairment, ya_p01_ic_heart_disease, ya_p01_ic_hemoptysis_ns, ya_p01_ic_hernia, ya_p01_ic_hyperthyroidism, ya_p01_ic_inability_hold_pencil, ya_p01_ic_inability_stand_both_legs, ya_p01_ic_inability_talk_cze, ya_p01_ic_inability_walk, ya_p01_ic_inbody, ya_p01_ic_infectious_resp_diseases, ya_p01_ic_iodine_barium_radioisotopes_last_7d, ya_p01_ic_knee_stability, ya_p01_ic_med_find, ya_p01_ic_nutri_qs, ya_p01_ic_over_weight_200_height_195, ya_p01_ic_pacemaker_defibrillator, ya_p01_ic_pneumothorax, ya_p01_ic_pregnancy, ya_p01_ic_recent_eye_abdominal_chest_surgery, ya_p01_ic_recent_myocardial_infarction, ya_p01_ic_spirometry, ya_p01_ic_surgical_metal_body, ya_p01_ic_unstable_angina_pectoris, ya_p01_ic_ya_dl_elspac FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 12 -- Pilot ID );
Date: 2025-11-27 17:02:24 Duration: 1s667ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__12"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__12__dbt_tmp" as ( -- suject (proband) patrici do kohorty YA Pilot I, Pilot ID: 12 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p01__role" text, "psycap_p02_old_ya_p01__role" text, "ya_p01__role" text, "ya_p01_digi_ya03v2__role" text, "ya_p01_digi_ya04v2__role" text, "ya_p01_digi_ya05v2__role" text, "ya_p01_test__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p01__state" text, "psycap_p02_old_ya_p01__state" text, "ya_p01__state" text, "ya_p01_digi_ya03v2__state" text, "ya_p01_digi_ya04v2__state" text, "ya_p01_digi_ya05v2__state" text, "ya_p01_test__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p01__activity_state" text, "psycap_p02_old_ya_p01__activity_state" text, "ya_p01__activity_state" text, "ya_p01_digi_ya03v2__activity_state" text, "ya_p01_digi_ya04v2__activity_state" text, "ya_p01_digi_ya05v2__activity_state" text, "ya_p01_test__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p01__created_at" text, "psycap_p02_old_ya_p01__created_at" text, "ya_p01__created_at" text, "ya_p01_digi_ya03v2__created_at" text, "ya_p01_digi_ya04v2__created_at" text, "ya_p01_digi_ya05v2__created_at" text, "ya_p01_test__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p01__accepted_at" text, "psycap_p02_old_ya_p01__accepted_at" text, "ya_p01__accepted_at" text, "ya_p01_digi_ya03v2__accepted_at" text, "ya_p01_digi_ya04v2__accepted_at" text, "ya_p01_digi_ya05v2__accepted_at" text, "ya_p01_test__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p01__cancelled_at" text, "psycap_p02_old_ya_p01__cancelled_at" text, "ya_p01__cancelled_at" text, "ya_p01_digi_ya03v2__cancelled_at" text, "ya_p01_digi_ya04v2__cancelled_at" text, "ya_p01_digi_ya05v2__cancelled_at" text, "ya_p01_test__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p01__revoked_at" text, "psycap_p02_old_ya_p01__revoked_at" text, "ya_p01__revoked_at" text, "ya_p01_digi_ya03v2__revoked_at" text, "ya_p01_digi_ya04v2__revoked_at" text, "ya_p01_digi_ya05v2__revoked_at" text, "ya_p01_test__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p01__paused_at" text, "psycap_p02_old_ya_p01__paused_at" text, "ya_p01__paused_at" text, "ya_p01_digi_ya03v2__paused_at" text, "ya_p01_digi_ya04v2__paused_at" text, "ya_p01_digi_ya05v2__paused_at" text, "ya_p01_test__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p01_ic_buccal_swab_proband'), ('ya_p01_ic_urine_proband'), ('ya_p01_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p01_ic_buccal_swab_proband" text, "ya_p01_ic_urine_proband" text, "ya_p01_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p01_ic_anam_qs'), ('ya_p01_ic_aneurysm'), ('ya_p01_ic_anthropometry'), ('ya_p01_ic_arch_foot'), ('ya_p01_ic_basic_qs'), ('ya_p01_ic_blood_pressure'), ('ya_p01_ic_braces_piercing_iud'), ('ya_p01_ic_cognition_test'), ('ya_p01_ic_da_health_registry'), ('ya_p01_ic_dexa'), ('ya_p01_ic_enviro_qs'), ('ya_p01_ic_follow_up_studies'), ('ya_p01_ic_fracture_lower_body_last_3m'), ('ya_p01_ic_fracture_upper_body_last_3m'), ('ya_p01_ic_hand_grip'), ('ya_p01_ic_hearing_vision_impairment'), ('ya_p01_ic_heart_disease'), ('ya_p01_ic_hemoptysis_ns'), ('ya_p01_ic_hernia'), ('ya_p01_ic_hyperthyroidism'), ('ya_p01_ic_inability_hold_pencil'), ('ya_p01_ic_inability_stand_both_legs'), ('ya_p01_ic_inability_talk_cze'), ('ya_p01_ic_inability_walk'), ('ya_p01_ic_inbody'), ('ya_p01_ic_infectious_resp_diseases'), ('ya_p01_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p01_ic_knee_stability'), ('ya_p01_ic_med_find'), ('ya_p01_ic_nutri_qs'), ('ya_p01_ic_over_weight_200_height_195'), ('ya_p01_ic_pacemaker_defibrillator'), ('ya_p01_ic_pneumothorax'), ('ya_p01_ic_pregnancy'), ('ya_p01_ic_recent_eye_abdominal_chest_surgery'), ('ya_p01_ic_recent_myocardial_infarction'), ('ya_p01_ic_spirometry'), ('ya_p01_ic_surgical_metal_body'), ('ya_p01_ic_unstable_angina_pectoris'), ('ya_p01_ic_ya_dl_elspac') $$ ) AS extra_state ("subject_id" int, "ya_p01_ic_anam_qs" text, "ya_p01_ic_aneurysm" text, "ya_p01_ic_anthropometry" text, "ya_p01_ic_arch_foot" text, "ya_p01_ic_basic_qs" text, "ya_p01_ic_blood_pressure" text, "ya_p01_ic_braces_piercing_iud" text, "ya_p01_ic_cognition_test" text, "ya_p01_ic_da_health_registry" text, "ya_p01_ic_dexa" text, "ya_p01_ic_enviro_qs" text, "ya_p01_ic_follow_up_studies" text, "ya_p01_ic_fracture_lower_body_last_3m" text, "ya_p01_ic_fracture_upper_body_last_3m" text, "ya_p01_ic_hand_grip" text, "ya_p01_ic_hearing_vision_impairment" text, "ya_p01_ic_heart_disease" text, "ya_p01_ic_hemoptysis_ns" text, "ya_p01_ic_hernia" text, "ya_p01_ic_hyperthyroidism" text, "ya_p01_ic_inability_hold_pencil" text, "ya_p01_ic_inability_stand_both_legs" text, "ya_p01_ic_inability_talk_cze" text, "ya_p01_ic_inability_walk" text, "ya_p01_ic_inbody" text, "ya_p01_ic_infectious_resp_diseases" text, "ya_p01_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p01_ic_knee_stability" text, "ya_p01_ic_med_find" text, "ya_p01_ic_nutri_qs" text, "ya_p01_ic_over_weight_200_height_195" text, "ya_p01_ic_pacemaker_defibrillator" text, "ya_p01_ic_pneumothorax" text, "ya_p01_ic_pregnancy" text, "ya_p01_ic_recent_eye_abdominal_chest_surgery" text, "ya_p01_ic_recent_myocardial_infarction" text, "ya_p01_ic_spirometry" text, "ya_p01_ic_surgical_metal_body" text, "ya_p01_ic_unstable_angina_pectoris" text, "ya_p01_ic_ya_dl_elspac" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p01__role, psc_role.psycap_p02_old_ya_p01__role, psc_role.ya_p01__role, psc_role.ya_p01_digi_ya03v2__role, psc_role.ya_p01_digi_ya04v2__role, psc_role.ya_p01_digi_ya05v2__role, psc_role.ya_p01_test__role, psc_state.psycap_p01_ya_p01__state, psc_state.psycap_p02_old_ya_p01__state, psc_state.ya_p01__state, psc_state.ya_p01_digi_ya03v2__state, psc_state.ya_p01_digi_ya04v2__state, psc_state.ya_p01_digi_ya05v2__state, psc_state.ya_p01_test__state, psc_activity_state.psycap_p01_ya_p01__activity_state, psc_activity_state.psycap_p02_old_ya_p01__activity_state, psc_activity_state.ya_p01__activity_state, psc_activity_state.ya_p01_digi_ya03v2__activity_state, psc_activity_state.ya_p01_digi_ya04v2__activity_state, psc_activity_state.ya_p01_digi_ya05v2__activity_state, psc_activity_state.ya_p01_test__activity_state, psc_created_at.psycap_p01_ya_p01__created_at, psc_created_at.psycap_p02_old_ya_p01__created_at, psc_created_at.ya_p01__created_at, psc_created_at.ya_p01_digi_ya03v2__created_at, psc_created_at.ya_p01_digi_ya04v2__created_at, psc_created_at.ya_p01_digi_ya05v2__created_at, psc_created_at.ya_p01_test__created_at, psc_accepted_at.psycap_p01_ya_p01__accepted_at, psc_accepted_at.psycap_p02_old_ya_p01__accepted_at, psc_accepted_at.ya_p01__accepted_at, psc_accepted_at.ya_p01_digi_ya03v2__accepted_at, psc_accepted_at.ya_p01_digi_ya04v2__accepted_at, psc_accepted_at.ya_p01_digi_ya05v2__accepted_at, psc_accepted_at.ya_p01_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p01__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p01__cancelled_at, psc_cancelled_at.ya_p01__cancelled_at, psc_cancelled_at.ya_p01_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p01_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p01_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p01_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p01__revoked_at, psc_revoked_at.psycap_p02_old_ya_p01__revoked_at, psc_revoked_at.ya_p01__revoked_at, psc_revoked_at.ya_p01_digi_ya03v2__revoked_at, psc_revoked_at.ya_p01_digi_ya04v2__revoked_at, psc_revoked_at.ya_p01_digi_ya05v2__revoked_at, psc_revoked_at.ya_p01_test__revoked_at, psc_paused_at.psycap_p01_ya_p01__paused_at, psc_paused_at.psycap_p02_old_ya_p01__paused_at, psc_paused_at.ya_p01__paused_at, psc_paused_at.ya_p01_digi_ya03v2__paused_at, psc_paused_at.ya_p01_digi_ya04v2__paused_at, psc_paused_at.ya_p01_digi_ya05v2__paused_at, psc_paused_at.ya_p01_test__paused_at, ya_p01_ic_buccal_swab_proband, ya_p01_ic_urine_proband, ya_p01_ic_venous_blood_proband, ya_p01_ic_anam_qs, ya_p01_ic_aneurysm, ya_p01_ic_anthropometry, ya_p01_ic_arch_foot, ya_p01_ic_basic_qs, ya_p01_ic_blood_pressure, ya_p01_ic_braces_piercing_iud, ya_p01_ic_cognition_test, ya_p01_ic_da_health_registry, ya_p01_ic_dexa, ya_p01_ic_enviro_qs, ya_p01_ic_follow_up_studies, ya_p01_ic_fracture_lower_body_last_3m, ya_p01_ic_fracture_upper_body_last_3m, ya_p01_ic_hand_grip, ya_p01_ic_hearing_vision_impairment, ya_p01_ic_heart_disease, ya_p01_ic_hemoptysis_ns, ya_p01_ic_hernia, ya_p01_ic_hyperthyroidism, ya_p01_ic_inability_hold_pencil, ya_p01_ic_inability_stand_both_legs, ya_p01_ic_inability_talk_cze, ya_p01_ic_inability_walk, ya_p01_ic_inbody, ya_p01_ic_infectious_resp_diseases, ya_p01_ic_iodine_barium_radioisotopes_last_7d, ya_p01_ic_knee_stability, ya_p01_ic_med_find, ya_p01_ic_nutri_qs, ya_p01_ic_over_weight_200_height_195, ya_p01_ic_pacemaker_defibrillator, ya_p01_ic_pneumothorax, ya_p01_ic_pregnancy, ya_p01_ic_recent_eye_abdominal_chest_surgery, ya_p01_ic_recent_myocardial_infarction, ya_p01_ic_spirometry, ya_p01_ic_surgical_metal_body, ya_p01_ic_unstable_angina_pectoris, ya_p01_ic_ya_dl_elspac FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 12 -- Pilot ID );
Date: 2025-11-27 05:02:22 Duration: 1s459ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
19 2s861ms 2 930ms 1s931ms 1s430ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__38__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "horpark__role" text, "horpark_patients__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "horpark__state" text, "horpark_patients__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as activity ("subject_id" int, "horpark__activity_state" text, "horpark_patients__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as created_at ("subject_id" int, "horpark__created_at" text, "horpark_patients__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as accepted_at ("subject_id" int, "horpark__accepted_at" text, "horpark_patients__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as cancelled_at ("subject_id" int, "horpark__cancelled_at" text, "horpark_patients__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as revoked_at ("subject_id" int, "horpark__revoked_at" text, "horpark_patients__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as paused_at ("subject_id" int, "horpark__paused_at" text, "horpark_patients__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "horpark_ic_urine_proband" text, "horpark_ic_venous_blood_proband" text, "horpark_patients_likvor_proband" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "horpark_expozicni_dotaznik" text, "horpark_patients_chronicke_onemocneni" text, "horpark_patients_ic_pregnancy" text, "horpark_patients_krevni_podlitiny" text, "horpark_patients_krvaceni" text, "horpark_patients_ryma_astma_precitlivelost" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.horpark__role, psc_role.horpark_patients__role, psc_state.horpark__state, psc_state.horpark_patients__state, psc_activity_state.horpark__activity_state, psc_activity_state.horpark_patients__activity_state, psc_created_at.horpark__created_at, psc_created_at.horpark_patients__created_at, psc_accepted_at.horpark__accepted_at, psc_accepted_at.horpark_patients__accepted_at, psc_cancelled_at.horpark__cancelled_at, psc_cancelled_at.horpark_patients__cancelled_at, psc_revoked_at.horpark__revoked_at, psc_revoked_at.horpark_patients__revoked_at, psc_paused_at.horpark__paused_at, psc_paused_at.horpark_patients__paused_at, horpark_ic_urine_proband, horpark_ic_venous_blood_proband, horpark_patients_likvor_proband, horpark_expozicni_dotaznik, horpark_patients_chronicke_onemocneni, horpark_patients_ic_pregnancy, horpark_patients_krevni_podlitiny, horpark_patients_krvaceni, horpark_patients_ryma_astma_precitlivelost from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #19
Day Hour Count Duration Avg duration Nov 27 05 1 930ms 930ms 17 1 1s931ms 1s931ms [ User: tng_migration_user - Total duration: 2s861ms - Times executed: 2 ]
[ Application: dbt - Total duration: 2s861ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__38"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__38__dbt_tmp" as ( -- suject (proband) patrici do kohorty HorPARK, Pilot ID: 38 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS role ("subject_id" int, "horpark__role" text, "horpark_patients__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS role ("subject_id" int, "horpark__state" text, "horpark_patients__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS activity ("subject_id" int, "horpark__activity_state" text, "horpark_patients__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS created_at ("subject_id" int, "horpark__created_at" text, "horpark_patients__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS accepted_at ("subject_id" int, "horpark__accepted_at" text, "horpark_patients__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS cancelled_at ("subject_id" int, "horpark__cancelled_at" text, "horpark_patients__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS revoked_at ("subject_id" int, "horpark__revoked_at" text, "horpark_patients__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS paused_at ("subject_id" int, "horpark__paused_at" text, "horpark_patients__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark_ic_urine_proband'), ('horpark_ic_venous_blood_proband'), ('horpark_patients_likvor_proband') $$ ) AS biomaterial_state ("subject_id" int, "horpark_ic_urine_proband" text, "horpark_ic_venous_blood_proband" text, "horpark_patients_likvor_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark_expozicni_dotaznik'), ('horpark_patients_chronicke_onemocneni'), ('horpark_patients_ic_pregnancy'), ('horpark_patients_krevni_podlitiny'), ('horpark_patients_krvaceni'), ('horpark_patients_ryma_astma_precitlivelost') $$ ) AS extra_state ("subject_id" int, "horpark_expozicni_dotaznik" text, "horpark_patients_chronicke_onemocneni" text, "horpark_patients_ic_pregnancy" text, "horpark_patients_krevni_podlitiny" text, "horpark_patients_krvaceni" text, "horpark_patients_ryma_astma_precitlivelost" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.horpark__role, psc_role.horpark_patients__role, psc_state.horpark__state, psc_state.horpark_patients__state, psc_activity_state.horpark__activity_state, psc_activity_state.horpark_patients__activity_state, psc_created_at.horpark__created_at, psc_created_at.horpark_patients__created_at, psc_accepted_at.horpark__accepted_at, psc_accepted_at.horpark_patients__accepted_at, psc_cancelled_at.horpark__cancelled_at, psc_cancelled_at.horpark_patients__cancelled_at, psc_revoked_at.horpark__revoked_at, psc_revoked_at.horpark_patients__revoked_at, psc_paused_at.horpark__paused_at, psc_paused_at.horpark_patients__paused_at, horpark_ic_urine_proband, horpark_ic_venous_blood_proband, horpark_patients_likvor_proband, horpark_expozicni_dotaznik, horpark_patients_chronicke_onemocneni, horpark_patients_ic_pregnancy, horpark_patients_krevni_podlitiny, horpark_patients_krvaceni, horpark_patients_ryma_astma_precitlivelost FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 38 -- Pilot ID );
Date: 2025-11-27 17:02:40 Duration: 1s931ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__38"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__38__dbt_tmp" as ( -- suject (proband) patrici do kohorty HorPARK, Pilot ID: 38 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS role ("subject_id" int, "horpark__role" text, "horpark_patients__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS role ("subject_id" int, "horpark__state" text, "horpark_patients__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS activity ("subject_id" int, "horpark__activity_state" text, "horpark_patients__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS created_at ("subject_id" int, "horpark__created_at" text, "horpark_patients__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS accepted_at ("subject_id" int, "horpark__accepted_at" text, "horpark_patients__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS cancelled_at ("subject_id" int, "horpark__cancelled_at" text, "horpark_patients__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS revoked_at ("subject_id" int, "horpark__revoked_at" text, "horpark_patients__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS paused_at ("subject_id" int, "horpark__paused_at" text, "horpark_patients__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark_ic_urine_proband'), ('horpark_ic_venous_blood_proband'), ('horpark_patients_likvor_proband') $$ ) AS biomaterial_state ("subject_id" int, "horpark_ic_urine_proband" text, "horpark_ic_venous_blood_proband" text, "horpark_patients_likvor_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark_expozicni_dotaznik'), ('horpark_patients_chronicke_onemocneni'), ('horpark_patients_ic_pregnancy'), ('horpark_patients_krevni_podlitiny'), ('horpark_patients_krvaceni'), ('horpark_patients_ryma_astma_precitlivelost') $$ ) AS extra_state ("subject_id" int, "horpark_expozicni_dotaznik" text, "horpark_patients_chronicke_onemocneni" text, "horpark_patients_ic_pregnancy" text, "horpark_patients_krevni_podlitiny" text, "horpark_patients_krvaceni" text, "horpark_patients_ryma_astma_precitlivelost" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.horpark__role, psc_role.horpark_patients__role, psc_state.horpark__state, psc_state.horpark_patients__state, psc_activity_state.horpark__activity_state, psc_activity_state.horpark_patients__activity_state, psc_created_at.horpark__created_at, psc_created_at.horpark_patients__created_at, psc_accepted_at.horpark__accepted_at, psc_accepted_at.horpark_patients__accepted_at, psc_cancelled_at.horpark__cancelled_at, psc_cancelled_at.horpark_patients__cancelled_at, psc_revoked_at.horpark__revoked_at, psc_revoked_at.horpark_patients__revoked_at, psc_paused_at.horpark__paused_at, psc_paused_at.horpark_patients__paused_at, horpark_ic_urine_proband, horpark_ic_venous_blood_proband, horpark_patients_likvor_proband, horpark_expozicni_dotaznik, horpark_patients_chronicke_onemocneni, horpark_patients_ic_pregnancy, horpark_patients_krevni_podlitiny, horpark_patients_krvaceni, horpark_patients_ryma_astma_precitlivelost FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 38 -- Pilot ID );
Date: 2025-11-27 05:02:37 Duration: 930ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
20 2s847ms 2 1s349ms 1s498ms 1s423ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__1__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "tng_p08__role" text, "tng_p08_test__role" text, "tng_pilot_8__monitor__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "tng_p08__state" text, "tng_p08_test__state" text, "tng_pilot_8__monitor__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as activity ("subject_id" int, "tng_p08__activity_state" text, "tng_p08_test__activity_state" text, "tng_pilot_8__monitor__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as created_at ("subject_id" int, "tng_p08__created_at" text, "tng_p08_test__created_at" text, "tng_pilot_8__monitor__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "tng_p08__accepted_at" text, "tng_p08_test__accepted_at" text, "tng_pilot_8__monitor__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "tng_p08__cancelled_at" text, "tng_p08_test__cancelled_at" text, "tng_pilot_8__monitor__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "tng_p08__revoked_at" text, "tng_p08_test__revoked_at" text, "tng_pilot_8__monitor__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as paused_at ("subject_id" int, "tng_p08__paused_at" text, "tng_p08_test__paused_at" text, "tng_pilot_8__monitor__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "tng_p08_ic_buccal_swab_child" text, "tng_p08_ic_buccal_swab_mother" text, "tng_p08_ic_cord_blood_mother" text, "tng_p08_ic_drop_blood_child" text, "tng_p08_ic_stool_child" text, "tng_p08_ic_urine_mother" text, "tng_p08_ic_venous_blood_mother" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "tng_p08_ic_follow_up_studies" text, "tng_p08_ic_med_find" text, "tng_p08_test_ic_follow_up_studies" text, "tng_p08_test_ic_med_find" text, "tng_pilot_8__monitor_ic_follow_up_studies" text, "tng_pilot_8__monitor_ic_med_find" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.tng_p08__role, psc_role.tng_p08_test__role, psc_role.tng_pilot_8__monitor__role, psc_state.tng_p08__state, psc_state.tng_p08_test__state, psc_state.tng_pilot_8__monitor__state, psc_activity_state.tng_p08__activity_state, psc_activity_state.tng_p08_test__activity_state, psc_activity_state.tng_pilot_8__monitor__activity_state, psc_created_at.tng_p08__created_at, psc_created_at.tng_p08_test__created_at, psc_created_at.tng_pilot_8__monitor__created_at, psc_accepted_at.tng_p08__accepted_at, psc_accepted_at.tng_p08_test__accepted_at, psc_accepted_at.tng_pilot_8__monitor__accepted_at, psc_cancelled_at.tng_p08__cancelled_at, psc_cancelled_at.tng_p08_test__cancelled_at, psc_cancelled_at.tng_pilot_8__monitor__cancelled_at, psc_revoked_at.tng_p08__revoked_at, psc_revoked_at.tng_p08_test__revoked_at, psc_revoked_at.tng_pilot_8__monitor__revoked_at, psc_paused_at.tng_p08__paused_at, psc_paused_at.tng_p08_test__paused_at, psc_paused_at.tng_pilot_8__monitor__paused_at, tng_p08_ic_buccal_swab_child, tng_p08_ic_buccal_swab_mother, tng_p08_ic_cord_blood_mother, tng_p08_ic_drop_blood_child, tng_p08_ic_stool_child, tng_p08_ic_urine_mother, tng_p08_ic_venous_blood_mother, tng_p08_ic_follow_up_studies, tng_p08_ic_med_find, tng_p08_test_ic_follow_up_studies, tng_p08_test_ic_med_find, tng_pilot_8__monitor_ic_follow_up_studies, tng_pilot_8__monitor_ic_med_find from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #20
Day Hour Count Duration Avg duration Nov 27 05 1 1s349ms 1s349ms 17 1 1s498ms 1s498ms [ User: tng_migration_user - Total duration: 2s847ms - Times executed: 2 ]
[ Application: dbt - Total duration: 2s847ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__1"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__1__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot VIII, Pilot ID: 1 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS role ("subject_id" int, "tng_p08__role" text, "tng_p08_test__role" text, "tng_pilot_8__monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS role ("subject_id" int, "tng_p08__state" text, "tng_p08_test__state" text, "tng_pilot_8__monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS activity ("subject_id" int, "tng_p08__activity_state" text, "tng_p08_test__activity_state" text, "tng_pilot_8__monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS created_at ("subject_id" int, "tng_p08__created_at" text, "tng_p08_test__created_at" text, "tng_pilot_8__monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p08__accepted_at" text, "tng_p08_test__accepted_at" text, "tng_pilot_8__monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p08__cancelled_at" text, "tng_p08_test__cancelled_at" text, "tng_pilot_8__monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p08__revoked_at" text, "tng_p08_test__revoked_at" text, "tng_pilot_8__monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS paused_at ("subject_id" int, "tng_p08__paused_at" text, "tng_p08_test__paused_at" text, "tng_pilot_8__monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08_ic_buccal_swab_child'), ('tng_p08_ic_buccal_swab_mother'), ('tng_p08_ic_cord_blood_mother'), ('tng_p08_ic_drop_blood_child'), ('tng_p08_ic_stool_child'), ('tng_p08_ic_urine_mother'), ('tng_p08_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p08_ic_buccal_swab_child" text, "tng_p08_ic_buccal_swab_mother" text, "tng_p08_ic_cord_blood_mother" text, "tng_p08_ic_drop_blood_child" text, "tng_p08_ic_stool_child" text, "tng_p08_ic_urine_mother" text, "tng_p08_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08_ic_follow_up_studies'), ('tng_p08_ic_med_find'), ('tng_p08_test_ic_follow_up_studies'), ('tng_p08_test_ic_med_find'), ('tng_pilot_8__monitor_ic_follow_up_studies'), ('tng_pilot_8__monitor_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p08_ic_follow_up_studies" text, "tng_p08_ic_med_find" text, "tng_p08_test_ic_follow_up_studies" text, "tng_p08_test_ic_med_find" text, "tng_pilot_8__monitor_ic_follow_up_studies" text, "tng_pilot_8__monitor_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p08__role, psc_role.tng_p08_test__role, psc_role.tng_pilot_8__monitor__role, psc_state.tng_p08__state, psc_state.tng_p08_test__state, psc_state.tng_pilot_8__monitor__state, psc_activity_state.tng_p08__activity_state, psc_activity_state.tng_p08_test__activity_state, psc_activity_state.tng_pilot_8__monitor__activity_state, psc_created_at.tng_p08__created_at, psc_created_at.tng_p08_test__created_at, psc_created_at.tng_pilot_8__monitor__created_at, psc_accepted_at.tng_p08__accepted_at, psc_accepted_at.tng_p08_test__accepted_at, psc_accepted_at.tng_pilot_8__monitor__accepted_at, psc_cancelled_at.tng_p08__cancelled_at, psc_cancelled_at.tng_p08_test__cancelled_at, psc_cancelled_at.tng_pilot_8__monitor__cancelled_at, psc_revoked_at.tng_p08__revoked_at, psc_revoked_at.tng_p08_test__revoked_at, psc_revoked_at.tng_pilot_8__monitor__revoked_at, psc_paused_at.tng_p08__paused_at, psc_paused_at.tng_p08_test__paused_at, psc_paused_at.tng_pilot_8__monitor__paused_at, tng_p08_ic_buccal_swab_child, tng_p08_ic_buccal_swab_mother, tng_p08_ic_cord_blood_mother, tng_p08_ic_drop_blood_child, tng_p08_ic_stool_child, tng_p08_ic_urine_mother, tng_p08_ic_venous_blood_mother, tng_p08_ic_follow_up_studies, tng_p08_ic_med_find, tng_p08_test_ic_follow_up_studies, tng_p08_test_ic_med_find, tng_pilot_8__monitor_ic_follow_up_studies, tng_pilot_8__monitor_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 1 -- Pilot ID );
Date: 2025-11-27 17:02:24 Duration: 1s498ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__1"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__1__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot VIII, Pilot ID: 1 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS role ("subject_id" int, "tng_p08__role" text, "tng_p08_test__role" text, "tng_pilot_8__monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS role ("subject_id" int, "tng_p08__state" text, "tng_p08_test__state" text, "tng_pilot_8__monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS activity ("subject_id" int, "tng_p08__activity_state" text, "tng_p08_test__activity_state" text, "tng_pilot_8__monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS created_at ("subject_id" int, "tng_p08__created_at" text, "tng_p08_test__created_at" text, "tng_pilot_8__monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p08__accepted_at" text, "tng_p08_test__accepted_at" text, "tng_pilot_8__monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p08__cancelled_at" text, "tng_p08_test__cancelled_at" text, "tng_pilot_8__monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p08__revoked_at" text, "tng_p08_test__revoked_at" text, "tng_pilot_8__monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS paused_at ("subject_id" int, "tng_p08__paused_at" text, "tng_p08_test__paused_at" text, "tng_pilot_8__monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08_ic_buccal_swab_child'), ('tng_p08_ic_buccal_swab_mother'), ('tng_p08_ic_cord_blood_mother'), ('tng_p08_ic_drop_blood_child'), ('tng_p08_ic_stool_child'), ('tng_p08_ic_urine_mother'), ('tng_p08_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p08_ic_buccal_swab_child" text, "tng_p08_ic_buccal_swab_mother" text, "tng_p08_ic_cord_blood_mother" text, "tng_p08_ic_drop_blood_child" text, "tng_p08_ic_stool_child" text, "tng_p08_ic_urine_mother" text, "tng_p08_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08_ic_follow_up_studies'), ('tng_p08_ic_med_find'), ('tng_p08_test_ic_follow_up_studies'), ('tng_p08_test_ic_med_find'), ('tng_pilot_8__monitor_ic_follow_up_studies'), ('tng_pilot_8__monitor_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p08_ic_follow_up_studies" text, "tng_p08_ic_med_find" text, "tng_p08_test_ic_follow_up_studies" text, "tng_p08_test_ic_med_find" text, "tng_pilot_8__monitor_ic_follow_up_studies" text, "tng_pilot_8__monitor_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p08__role, psc_role.tng_p08_test__role, psc_role.tng_pilot_8__monitor__role, psc_state.tng_p08__state, psc_state.tng_p08_test__state, psc_state.tng_pilot_8__monitor__state, psc_activity_state.tng_p08__activity_state, psc_activity_state.tng_p08_test__activity_state, psc_activity_state.tng_pilot_8__monitor__activity_state, psc_created_at.tng_p08__created_at, psc_created_at.tng_p08_test__created_at, psc_created_at.tng_pilot_8__monitor__created_at, psc_accepted_at.tng_p08__accepted_at, psc_accepted_at.tng_p08_test__accepted_at, psc_accepted_at.tng_pilot_8__monitor__accepted_at, psc_cancelled_at.tng_p08__cancelled_at, psc_cancelled_at.tng_p08_test__cancelled_at, psc_cancelled_at.tng_pilot_8__monitor__cancelled_at, psc_revoked_at.tng_p08__revoked_at, psc_revoked_at.tng_p08_test__revoked_at, psc_revoked_at.tng_pilot_8__monitor__revoked_at, psc_paused_at.tng_p08__paused_at, psc_paused_at.tng_p08_test__paused_at, psc_paused_at.tng_pilot_8__monitor__paused_at, tng_p08_ic_buccal_swab_child, tng_p08_ic_buccal_swab_mother, tng_p08_ic_cord_blood_mother, tng_p08_ic_drop_blood_child, tng_p08_ic_stool_child, tng_p08_ic_urine_mother, tng_p08_ic_venous_blood_mother, tng_p08_ic_follow_up_studies, tng_p08_ic_med_find, tng_p08_test_ic_follow_up_studies, tng_p08_test_ic_med_find, tng_pilot_8__monitor_ic_follow_up_studies, tng_pilot_8__monitor_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 1 -- Pilot ID );
Date: 2025-11-27 05:02:21 Duration: 1s349ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
Most frequent queries (N)
Rank Times executed Total duration Min duration Max duration Avg duration Query 1 64,281 1s179ms 0ms 6ms 0ms select t0.is_archived as is_archived_1, t0.created_at as created_at_2, t0.updated_at as updated_at_3, t0.code as code_4, t0.name as name_5, t0.description as description_6 from core.notif_type t0 inner join core.notif_type_state on t0.code = core.notif_type_state.notif_type_code where core.notif_type_state.notif_state_code = ?;Times Reported Time consuming queries #1
Day Hour Count Duration Avg duration Nov 27 00 2,520 45ms 0ms 01 2,520 46ms 0ms 02 2,520 46ms 0ms 03 2,520 46ms 0ms 04 2,520 45ms 0ms 05 2,527 45ms 0ms 06 2,737 49ms 0ms 07 2,730 49ms 0ms 08 2,730 49ms 0ms 09 2,730 49ms 0ms 10 2,772 49ms 0ms 11 2,730 49ms 0ms 12 2,730 49ms 0ms 13 2,730 49ms 0ms 14 2,730 48ms 0ms 15 2,730 48ms 0ms 16 2,730 48ms 0ms 17 2,695 56ms 0ms 18 2,730 51ms 0ms 19 2,730 51ms 0ms 20 2,730 50ms 0ms 21 2,730 50ms 0ms 22 2,730 50ms 0ms 23 2,730 50ms 0ms [ User: tng_migration_user - Total duration: 1s179ms - Times executed: 64281 ]
[ Application: [unknown] - Total duration: 1s179ms - Times executed: 64281 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_type t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_type_code WHERE core.notif_type_state.notif_state_code = 'ERROR';
Date: 2025-11-27 17:02:25 Duration: 6ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_type t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_type_code WHERE core.notif_type_state.notif_state_code = 'ERROR';
Date: 2025-11-27 09:02:15 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_type t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_type_code WHERE core.notif_type_state.notif_state_code = 'ERROR';
Date: 2025-11-27 20:18:42 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
2 36,732 596ms 0ms 0ms 0ms select t0.is_archived as is_archived_1, t0.created_at as created_at_2, t0.updated_at as updated_at_3, t0.code as code_4, t0.name as name_5, t0.description as description_6 from core.notif_state t0 inner join core.notif_type_state on t0.code = core.notif_type_state.notif_state_code where core.notif_type_state.notif_type_code = ?;Times Reported Time consuming queries #2
Day Hour Count Duration Avg duration Nov 27 00 1,440 23ms 0ms 01 1,440 23ms 0ms 02 1,440 23ms 0ms 03 1,440 23ms 0ms 04 1,440 23ms 0ms 05 1,444 23ms 0ms 06 1,564 25ms 0ms 07 1,560 24ms 0ms 08 1,560 25ms 0ms 09 1,560 25ms 0ms 10 1,584 25ms 0ms 11 1,560 25ms 0ms 12 1,560 24ms 0ms 13 1,560 25ms 0ms 14 1,560 25ms 0ms 15 1,560 25ms 0ms 16 1,560 25ms 0ms 17 1,540 25ms 0ms 18 1,560 25ms 0ms 19 1,560 25ms 0ms 20 1,560 25ms 0ms 21 1,560 25ms 0ms 22 1,560 25ms 0ms 23 1,560 25ms 0ms [ User: tng_migration_user - Total duration: 596ms - Times executed: 36732 ]
[ Application: [unknown] - Total duration: 596ms - Times executed: 36732 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = 'EMAIL_RECEIVED';
Date: 2025-11-27 17:35:26 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = 'EMAIL_SENDED';
Date: 2025-11-27 11:34:29 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = 'EMAIL_SENDED';
Date: 2025-11-27 21:11:25 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
3 30,088 839ms 0ms 0ms 0ms select t0.is_archived as is_archived_1, t0.created_at as created_at_2, t0.updated_at as updated_at_3, t0.id as id_4, t0.name as name_5, t0.description as description_6, t0.is_automatic as is_automatic_7, t0.is_recruitment as is_recruitment_8, t0.is_welcome as is_welcome_9, t0.welcome_message as welcome_message_10, t0.biobank_id as biobank_id_11, t0.owner_user_id as owner_user_id_12, t0.owner_group_id as owner_group_id_13, t0.pilot_id as pilot_id_14, t0.subcohort_state_code as subcohort_state_code_15, t0.inform_consent_id as inform_consent_id_16 from core.subcohort t0 inner join core.subcohort_form_structure_variant on t0.id = core.subcohort_form_structure_variant.subcohort_id where core.subcohort_form_structure_variant.form_structure_variant_id = ?;Times Reported Time consuming queries #3
Day Hour Count Duration Avg duration Nov 27 05 1,540 43ms 0ms 06 1,540 42ms 0ms 07 1,705 47ms 0ms 08 1,649 46ms 0ms 09 1,543 42ms 0ms 10 1,609 45ms 0ms 11 1,572 43ms 0ms 12 1,674 46ms 0ms 13 1,540 42ms 0ms 14 1,540 43ms 0ms 15 1,604 46ms 0ms 16 1,555 42ms 0ms 17 1,441 40ms 0ms 18 1,684 46ms 0ms 19 1,541 43ms 0ms 20 1,540 42ms 0ms 21 1,540 42ms 0ms 22 1,615 45ms 0ms 23 1,656 46ms 0ms [ User: tng_migration_user - Total duration: 839ms - Times executed: 30088 ]
[ Application: [unknown] - Total duration: 839ms - Times executed: 30088 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.name AS name_5, t0.description AS description_6, t0.is_automatic AS is_automatic_7, t0.is_recruitment AS is_recruitment_8, t0.is_welcome AS is_welcome_9, t0.welcome_message AS welcome_message_10, t0.biobank_id AS biobank_id_11, t0.owner_user_id AS owner_user_id_12, t0.owner_group_id AS owner_group_id_13, t0.pilot_id AS pilot_id_14, t0.subcohort_state_code AS subcohort_state_code_15, t0.inform_consent_id AS inform_consent_id_16 FROM core.subcohort t0 INNER JOIN core.subcohort_form_structure_variant ON t0.id = core.subcohort_form_structure_variant.subcohort_id WHERE core.subcohort_form_structure_variant.form_structure_variant_id = '124';
Date: 2025-11-27 19:30:01 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.name AS name_5, t0.description AS description_6, t0.is_automatic AS is_automatic_7, t0.is_recruitment AS is_recruitment_8, t0.is_welcome AS is_welcome_9, t0.welcome_message AS welcome_message_10, t0.biobank_id AS biobank_id_11, t0.owner_user_id AS owner_user_id_12, t0.owner_group_id AS owner_group_id_13, t0.pilot_id AS pilot_id_14, t0.subcohort_state_code AS subcohort_state_code_15, t0.inform_consent_id AS inform_consent_id_16 FROM core.subcohort t0 INNER JOIN core.subcohort_form_structure_variant ON t0.id = core.subcohort_form_structure_variant.subcohort_id WHERE core.subcohort_form_structure_variant.form_structure_variant_id = '84';
Date: 2025-11-27 07:55:40 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.name AS name_5, t0.description AS description_6, t0.is_automatic AS is_automatic_7, t0.is_recruitment AS is_recruitment_8, t0.is_welcome AS is_welcome_9, t0.welcome_message AS welcome_message_10, t0.biobank_id AS biobank_id_11, t0.owner_user_id AS owner_user_id_12, t0.owner_group_id AS owner_group_id_13, t0.pilot_id AS pilot_id_14, t0.subcohort_state_code AS subcohort_state_code_15, t0.inform_consent_id AS inform_consent_id_16 FROM core.subcohort t0 INNER JOIN core.subcohort_form_structure_variant ON t0.id = core.subcohort_form_structure_variant.subcohort_id WHERE core.subcohort_form_structure_variant.form_structure_variant_id = '138';
Date: 2025-11-27 06:24:01 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
4 22,113 12s369ms 0ms 3ms 0ms select m0_.id as id_0, m0_.result_date as result_date_1, m0_.use_alternative as use_alternative_2, m0_.subject_subcohort_id as subject_subcohort_id_3, m0_.subject_id as subject_id_4, m0_.subject_about_id as subject_about_id_5, m0_.subject_extend_id as subject_extend_id_6, m0_.subject_role_code as subject_role_code_7, m0_.timeing_t0_type_code as timeing_t0_type_code_8, m0_.pilot_id as pilot_id_9, m0_.subcohort_id as subcohort_id_10, m0_.subject_subcohort_id as subject_subcohort_id_11, m0_.form_structure_variant_id as form_structure_variant_id_12, m0_.form_id as form_id_13, m0_.form_state_code as form_state_code_14 from core.mv_subject_form m0_ where m0_.form_structure_variant_id in (...) and m0_.form_id is null and m0_.result_date <= ? and m0_.use_alternative <> ?;Times Reported Time consuming queries #4
Day Hour Count Duration Avg duration Nov 27 05 1,170 649ms 0ms 06 1,170 658ms 0ms 07 1,170 669ms 0ms 08 1,170 639ms 0ms 09 1,170 632ms 0ms 10 1,170 639ms 0ms 11 1,170 657ms 0ms 12 1,170 673ms 0ms 13 1,170 670ms 0ms 14 1,170 669ms 0ms 15 1,170 646ms 0ms 16 1,170 641ms 0ms 17 1,053 587ms 0ms 18 1,170 653ms 0ms 19 1,170 679ms 0ms 20 1,170 657ms 0ms 21 1,170 645ms 0ms 22 1,170 658ms 0ms 23 1,170 640ms 0ms [ User: tng_migration_user - Total duration: 12s369ms - Times executed: 22113 ]
[ Application: [unknown] - Total duration: 12s369ms - Times executed: 22113 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('82') AND m0_.form_id IS NULL AND m0_.result_date <= '2021-12-13 12:30:01' AND m0_.use_alternative <> 't';
Date: 2025-11-27 12:30:03 Duration: 3ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('80') AND m0_.form_id IS NULL AND m0_.result_date <= '2020-12-13 12:30:01' AND m0_.use_alternative <> 't';
Date: 2025-11-27 12:30:03 Duration: 3ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('83') AND m0_.form_id IS NULL AND m0_.result_date <= '2020-12-13 12:30:01' AND m0_.use_alternative <> 't';
Date: 2025-11-27 12:30:03 Duration: 3ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
5 11,181 207ms 0ms 0ms 0ms select t0.is_archived as is_archived_1, t0.created_at as created_at_2, t0.updated_at as updated_at_3, t0.id as id_4, t0.rc as rc_5, t0.tng_id as tng_id_6, t0.birthdate as birthdate_7, t0.name as name_8, t0.surname as surname_9, t0.maiden_name as maiden_name_10, t0.titles_before as titles_before_11, t0.titles_after as titles_after_12, t0.description as description_13, t0.test_proband as test_proband_14, t0.puk as puk_15, t0.is_origin_elspac as is_origin_elspac_16, t0.family_code as family_code_17, t0.enrolled_at as enrolled_at_18, t0.anonym_at as anonym_at_19, t0.elspac_family_relationship_type_code as elspac_family_relationship_type_code_20, t0.subject_state_code as subject_state_code_21, t0.sex_code as sex_code_22, t0.family_id as family_id_23, t0.user_id as user_id_24, t0.created_by as created_by_25, t0.enrolled_by as enrolled_by_26, t0.anonym_by as anonym_by_27, t28.id as id_29, t28.death_at as death_at_30, t28.date_of_death as date_of_death_31, t28.cause_of_death as cause_of_death_32, t28.subject_id as subject_id_33, t28.death_by as death_by_34, t0.owner_user_id as owner_user_id_35, t0.owner_group_id as owner_group_id_36 from core.subject t0 left join core.subject_dead t28 on t28.subject_id = t0.id where t0.id = ?;Times Reported Time consuming queries #5
Day Hour Count Duration Avg duration Nov 27 05 432 7ms 0ms 06 590 11ms 0ms 07 559 10ms 0ms 08 704 12ms 0ms 09 642 11ms 0ms 10 852 16ms 0ms 11 545 10ms 0ms 12 804 15ms 0ms 13 538 9ms 0ms 14 538 9ms 0ms 15 540 9ms 0ms 16 639 11ms 0ms 17 543 10ms 0ms 18 546 10ms 0ms 19 539 10ms 0ms 20 538 9ms 0ms 21 538 9ms 0ms 22 545 10ms 0ms 23 549 9ms 0ms [ User: tng_migration_user - Total duration: 207ms - Times executed: 11181 ]
[ Application: [unknown] - Total duration: 207ms - Times executed: 11181 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = '40948';
Date: 2025-11-27 06:14:01 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = '44363';
Date: 2025-11-27 11:21:06 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = '36019';
Date: 2025-11-27 06:00:03 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
6 10,385 915ms 0ms 1ms 0ms set names ?;Times Reported Time consuming queries #6
Day Hour Count Duration Avg duration Nov 27 00 421 38ms 0ms 01 420 38ms 0ms 02 420 38ms 0ms 03 420 38ms 0ms 04 420 37ms 0ms 05 419 36ms 0ms 06 420 36ms 0ms 07 459 42ms 0ms 08 466 40ms 0ms 09 430 37ms 0ms 10 463 39ms 0ms 11 434 37ms 0ms 12 485 42ms 0ms 13 425 36ms 0ms 14 420 35ms 0ms 15 431 37ms 0ms 16 437 36ms 0ms 17 419 36ms 0ms 18 443 40ms 0ms 19 421 39ms 0ms 20 420 37ms 0ms 21 421 35ms 0ms 22 430 36ms 0ms 23 441 38ms 0ms [ User: tng_migration_user - Total duration: 915ms - Times executed: 10385 ]
[ Application: [unknown] - Total duration: 915ms - Times executed: 10385 ]
-
SET NAMES 'utf8';
Date: 2025-11-27 19:21:25 Duration: 1ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SET NAMES 'utf8';
Date: 2025-11-27 03:22:14 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SET NAMES 'utf8';
Date: 2025-11-27 01:30:16 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
7 10,096 125ms 0ms 7ms 0ms select t0.is_archived as is_archived_1, t0.created_at as created_at_2, t0.updated_at as updated_at_3, t0.id as id_4, t0.clade_id as clade_id_5, t0.expired_at as expired_at_6, t0.owner_user_id as owner_user_id_7, t0.owner_group_id as owner_group_id_8, t0.form_structure_variant_id as form_structure_variant_id_9, t0.form_state_code as form_state_code_10, t0.subject_id as subject_id_11, t0.about_subject_id as about_subject_id_12, t0.notif_state as notif_state_13 from core.form t0 where t0.id = ?;Times Reported Time consuming queries #7
Day Hour Count Duration Avg duration Nov 27 05 585 6ms 0ms 06 528 6ms 0ms 07 534 6ms 0ms 08 531 6ms 0ms 09 527 6ms 0ms 10 527 5ms 0ms 11 531 13ms 0ms 12 527 6ms 0ms 13 527 6ms 0ms 14 527 6ms 0ms 15 527 5ms 0ms 16 527 6ms 0ms 17 529 6ms 0ms 18 529 6ms 0ms 19 527 6ms 0ms 20 527 6ms 0ms 21 527 5ms 0ms 22 529 6ms 0ms 23 530 5ms 0ms [ User: tng_migration_user - Total duration: 125ms - Times executed: 10096 ]
[ Application: [unknown] - Total duration: 125ms - Times executed: 10096 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = '80305';
Date: 2025-11-27 11:21:59 Duration: 7ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = '136025';
Date: 2025-11-27 14:00:03 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = '135004';
Date: 2025-11-27 08:00:03 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
8 10,069 343ms 0ms 0ms 0ms select t0.id as id_1, t0.version as version_2, t0.created_at as created_at_3, t0.name as name_4, t0.command as command_5, t0.arguments as arguments_6, t0.cron_expression as cron_expression_7, t0.last_execution as last_execution_8, t0.last_return_code as last_return_code_9, t0.log_file as log_file_10, t0.priority as priority_11, t0.execute_immediately as execute_immediately_12, t0.disabled as disabled_13, t0.locked as locked_14, t0.ping_back_url as ping_back_url_15, t0.ping_back_failed_url as ping_back_failed_url_16, t0.notes as notes_17 from scheduled_command t0 where t0.disabled = ? and t0.locked = ? order by t0.priority desc;Times Reported Time consuming queries #8
Day Hour Count Duration Avg duration Nov 27 00 420 11ms 0ms 01 420 12ms 0ms 02 420 12ms 0ms 03 420 12ms 0ms 04 420 11ms 0ms 05 419 14ms 0ms 06 420 15ms 0ms 07 420 15ms 0ms 08 420 14ms 0ms 09 420 15ms 0ms 10 420 15ms 0ms 11 420 15ms 0ms 12 420 15ms 0ms 13 420 15ms 0ms 14 420 16ms 0ms 15 420 15ms 0ms 16 420 15ms 0ms 17 410 15ms 0ms 18 420 13ms 0ms 19 420 13ms 0ms 20 420 13ms 0ms 21 420 13ms 0ms 22 420 14ms 0ms 23 420 14ms 0ms [ User: tng_migration_user - Total duration: 343ms - Times executed: 10069 ]
[ Application: [unknown] - Total duration: 343ms - Times executed: 10069 ]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 WHERE t0.disabled = 'f' AND t0.locked = 'f' ORDER BY t0.priority DESC;
Date: 2025-11-27 09:35:01 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 WHERE t0.disabled = 'f' AND t0.locked = 't' ORDER BY t0.priority DESC;
Date: 2025-11-27 07:16:16 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 WHERE t0.disabled = 'f' AND t0.locked = 'f' ORDER BY t0.priority DESC;
Date: 2025-11-27 14:43:02 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
9 9,439 209ms 0ms 4ms 0ms select t0.is_archived as is_archived_1, t0.created_at as created_at_2, t0.updated_at as updated_at_3, t0.code as code_4, t0.name as name_5, t0.description as description_6 from core.notif_state t0 where t0.code = ? limit ?;Times Reported Time consuming queries #9
Day Hour Count Duration Avg duration Nov 27 00 360 9ms 0ms 01 360 9ms 0ms 02 360 9ms 0ms 03 360 9ms 0ms 04 360 9ms 0ms 05 360 8ms 0ms 06 652 11ms 0ms 07 390 10ms 0ms 08 390 9ms 0ms 09 390 9ms 0ms 10 392 9ms 0ms 11 390 9ms 0ms 12 390 9ms 0ms 13 390 9ms 0ms 14 390 9ms 0ms 15 390 9ms 0ms 16 390 8ms 0ms 17 385 10ms 0ms 18 390 6ms 0ms 19 390 6ms 0ms 20 390 6ms 0ms 21 390 6ms 0ms 22 390 6ms 0ms 23 390 6ms 0ms [ User: tng_migration_user - Total duration: 209ms - Times executed: 9439 ]
[ Application: [unknown] - Total duration: 209ms - Times executed: 9439 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = 'ERROR' LIMIT 1;
Date: 2025-11-27 17:02:25 Duration: 4ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = 'ERROR' LIMIT 1;
Date: 2025-11-27 04:16:15 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = 'ERROR' LIMIT 1;
Date: 2025-11-27 19:36:25 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
10 8,640 2s109ms 0ms 229ms 0ms select count(n0_.id) as sclr_0 from core.notif n0_ where n0_.notif_state_code = ? and n0_.processed_time >= ?;Times Reported Time consuming queries #10
Day Hour Count Duration Avg duration Nov 27 00 360 88ms 0ms 01 360 89ms 0ms 02 360 87ms 0ms 03 360 90ms 0ms 04 360 83ms 0ms 05 360 82ms 0ms 06 360 89ms 0ms 07 360 92ms 0ms 08 360 86ms 0ms 09 360 84ms 0ms 10 360 84ms 0ms 11 360 83ms 0ms 12 360 85ms 0ms 13 360 84ms 0ms 14 360 83ms 0ms 15 360 84ms 0ms 16 360 78ms 0ms 17 360 290ms 0ms 18 360 63ms 0ms 19 360 63ms 0ms 20 360 60ms 0ms 21 360 56ms 0ms 22 360 58ms 0ms 23 360 58ms 0ms [ User: tng_migration_user - Total duration: 2s109ms - Times executed: 8640 ]
[ Application: [unknown] - Total duration: 2s109ms - Times executed: 8640 ]
-
SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = 'ERROR' AND n0_.processed_time >= '2025-11-20 17:02:25';
Date: 2025-11-27 17:02:26 Duration: 229ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = 'ERROR' AND n0_.processed_time >= '2025-11-20 14:02:24';
Date: 2025-11-27 14:02:24 Duration: 1ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = 'ERROR' AND n0_.processed_time >= '2025-11-20 11:42:31';
Date: 2025-11-27 11:42:31 Duration: 1ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
11 8,640 1s79ms 0ms 11ms 0ms select t0.id as id_1, t0.version as version_2, t0.created_at as created_at_3, t0.name as name_4, t0.command as command_5, t0.arguments as arguments_6, t0.cron_expression as cron_expression_7, t0.last_execution as last_execution_8, t0.last_return_code as last_return_code_9, t0.log_file as log_file_10, t0.priority as priority_11, t0.execute_immediately as execute_immediately_12, t0.disabled as disabled_13, t0.locked as locked_14, t0.ping_back_url as ping_back_url_15, t0.ping_back_failed_url as ping_back_failed_url_16, t0.notes as notes_17 from scheduled_command t0 order by t0.disabled asc, t0.priority desc;Times Reported Time consuming queries #11
Day Hour Count Duration Avg duration Nov 27 00 360 45ms 0ms 01 360 44ms 0ms 02 360 44ms 0ms 03 360 45ms 0ms 04 360 43ms 0ms 05 360 43ms 0ms 06 360 45ms 0ms 07 360 48ms 0ms 08 360 45ms 0ms 09 360 45ms 0ms 10 360 44ms 0ms 11 360 45ms 0ms 12 360 46ms 0ms 13 360 45ms 0ms 14 360 45ms 0ms 15 360 46ms 0ms 16 360 44ms 0ms 17 360 57ms 0ms 18 360 43ms 0ms 19 360 43ms 0ms 20 360 42ms 0ms 21 360 40ms 0ms 22 360 41ms 0ms 23 360 42ms 0ms [ User: tng_migration_user - Total duration: 1s79ms - Times executed: 8640 ]
[ Application: [unknown] - Total duration: 1s79ms - Times executed: 8640 ]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-11-27 17:02:25 Duration: 11ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-11-27 04:12:43 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-11-27 03:33:16 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
12 8,640 127ms 0ms 0ms 0ms select s0_.id as id_0, s0_.version as version_1, s0_.created_at as created_at_2, s0_.name as name_3, s0_.command as command_4, s0_.arguments as arguments_5, s0_.cron_expression as cron_expression_6, s0_.last_execution as last_execution_7, s0_.last_return_code as last_return_code_8, s0_.log_file as log_file_9, s0_.priority as priority_10, s0_.execute_immediately as execute_immediately_11, s0_.disabled as disabled_12, s0_.locked as locked_13, s0_.ping_back_url as ping_back_url_14, s0_.ping_back_failed_url as ping_back_failed_url_15, s0_.notes as notes_16 from scheduled_command s0_ where s0_.disabled = ? and s0_.last_return_code <> ?;Times Reported Time consuming queries #12
Day Hour Count Duration Avg duration Nov 27 00 360 4ms 0ms 01 360 4ms 0ms 02 360 4ms 0ms 03 360 4ms 0ms 04 360 3ms 0ms 05 360 4ms 0ms 06 360 5ms 0ms 07 360 6ms 0ms 08 360 5ms 0ms 09 360 5ms 0ms 10 360 5ms 0ms 11 360 5ms 0ms 12 360 6ms 0ms 13 360 6ms 0ms 14 360 6ms 0ms 15 360 6ms 0ms 16 360 6ms 0ms 17 360 6ms 0ms 18 360 4ms 0ms 19 360 4ms 0ms 20 360 4ms 0ms 21 360 4ms 0ms 22 360 4ms 0ms 23 360 5ms 0ms [ User: tng_migration_user - Total duration: 127ms - Times executed: 8640 ]
[ Application: [unknown] - Total duration: 127ms - Times executed: 8640 ]
-
SELECT s0_.id AS id_0, s0_.version AS version_1, s0_.created_at AS created_at_2, s0_.name AS name_3, s0_.command AS command_4, s0_.arguments AS arguments_5, s0_.cron_expression AS cron_expression_6, s0_.last_execution AS last_execution_7, s0_.last_return_code AS last_return_code_8, s0_.log_file AS log_file_9, s0_.priority AS priority_10, s0_.execute_immediately AS execute_immediately_11, s0_.disabled AS disabled_12, s0_.locked AS locked_13, s0_.ping_back_url AS ping_back_url_14, s0_.ping_back_failed_url AS ping_back_failed_url_15, s0_.notes AS notes_16 FROM scheduled_command s0_ WHERE s0_.disabled = 'f' AND s0_.last_return_code <> '0';
Date: 2025-11-27 12:03:29 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT s0_.id AS id_0, s0_.version AS version_1, s0_.created_at AS created_at_2, s0_.name AS name_3, s0_.command AS command_4, s0_.arguments AS arguments_5, s0_.cron_expression AS cron_expression_6, s0_.last_execution AS last_execution_7, s0_.last_return_code AS last_return_code_8, s0_.log_file AS log_file_9, s0_.priority AS priority_10, s0_.execute_immediately AS execute_immediately_11, s0_.disabled AS disabled_12, s0_.locked AS locked_13, s0_.ping_back_url AS ping_back_url_14, s0_.ping_back_failed_url AS ping_back_failed_url_15, s0_.notes AS notes_16 FROM scheduled_command s0_ WHERE s0_.disabled = 'f' AND s0_.last_return_code <> '0';
Date: 2025-11-27 18:10:26 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT s0_.id AS id_0, s0_.version AS version_1, s0_.created_at AS created_at_2, s0_.name AS name_3, s0_.command AS command_4, s0_.arguments AS arguments_5, s0_.cron_expression AS cron_expression_6, s0_.last_execution AS last_execution_7, s0_.last_return_code AS last_return_code_8, s0_.log_file AS log_file_9, s0_.priority AS priority_10, s0_.execute_immediately AS execute_immediately_11, s0_.disabled AS disabled_12, s0_.locked AS locked_13, s0_.ping_back_url AS ping_back_url_14, s0_.ping_back_failed_url AS ping_back_failed_url_15, s0_.notes AS notes_16 FROM scheduled_command s0_ WHERE s0_.disabled = 'f' AND s0_.last_return_code <> '0';
Date: 2025-11-27 10:14:29 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
13 5,683 1s517ms 0ms 1ms 0ms fetch ? from c1;Times Reported Time consuming queries #13
Day Hour Count Duration Avg duration Nov 27 23 5,683 1s517ms 0ms [ User: tng__dwh_celspac_fdw - Total duration: 1s517ms - Times executed: 5683 ]
[ Application: postgres_fdw - Total duration: 1s517ms - Times executed: 5683 ]
-
FETCH 100 FROM c1;
Date: 2025-11-27 23:35:16 Duration: 1ms Database: celspac User: tng__dwh_celspac_fdw Remote: 10.16.50.4 Application: postgres_fdw Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
FETCH 100 FROM c1;
Date: 2025-11-27 23:35:16 Duration: 1ms Database: celspac User: tng__dwh_celspac_fdw Remote: 10.16.50.4 Application: postgres_fdw Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
FETCH 100 FROM c1;
Date: 2025-11-27 23:35:15 Duration: 1ms Database: celspac User: tng__dwh_celspac_fdw Remote: 10.16.50.4 Application: postgres_fdw Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
14 5,548 502ms 0ms 0ms 0ms select m0_.id as id_0, m0_.result_date as result_date_1, m0_.use_alternative as use_alternative_2, m0_.subject_subcohort_id as subject_subcohort_id_3, m0_.subject_id as subject_id_4, m0_.subject_about_id as subject_about_id_5, m0_.subject_extend_id as subject_extend_id_6, m0_.subject_role_code as subject_role_code_7, m0_.timeing_t0_type_code as timeing_t0_type_code_8, m0_.pilot_id as pilot_id_9, m0_.subcohort_id as subcohort_id_10, m0_.subject_subcohort_id as subject_subcohort_id_11, m0_.form_structure_variant_id as form_structure_variant_id_12, m0_.form_id as form_id_13, m0_.form_state_code as form_state_code_14 from core.mv_subject_form m0_ where m0_.form_structure_variant_id = ? and m0_.form_state_code not in (...) and m0_.use_alternative <> ? and m0_.result_date is not null and (m0_.result_date between ? and ?);Times Reported Time consuming queries #14
Day Hour Count Duration Avg duration Nov 27 05 292 26ms 0ms 06 292 26ms 0ms 07 292 26ms 0ms 08 292 24ms 0ms 09 292 26ms 0ms 10 292 25ms 0ms 11 292 26ms 0ms 12 292 26ms 0ms 13 292 27ms 0ms 14 292 27ms 0ms 15 292 25ms 0ms 16 292 26ms 0ms 17 292 25ms 0ms 18 292 28ms 0ms 19 292 28ms 0ms 20 292 25ms 0ms 21 292 26ms 0ms 22 292 26ms 0ms 23 292 24ms 0ms [ User: tng_migration_user - Total duration: 502ms - Times executed: 5548 ]
[ Application: [unknown] - Total duration: 502ms - Times executed: 5548 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id = '78' AND m0_.form_state_code NOT IN ('READY', 'PROCESSING', 'DONE', 'CLOSED', 'EXPIRED', 'EXPIRED_EMPTY') AND m0_.use_alternative <> 't' AND m0_.result_date IS NOT NULL AND (m0_.result_date BETWEEN '2023-11-14 12:00:01' AND '2023-12-13 12:00:01');
Date: 2025-11-27 12:00:03 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id = '77' AND m0_.form_state_code NOT IN ('READY', 'PROCESSING', 'DONE', 'CLOSED', 'EXPIRED', 'EXPIRED_EMPTY') AND m0_.use_alternative <> 't' AND m0_.result_date IS NOT NULL AND (m0_.result_date BETWEEN '2023-05-14 06:00:01' AND '2023-06-13 06:00:01');
Date: 2025-11-27 06:00:03 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id = '78' AND m0_.form_state_code NOT IN ('READY', 'PROCESSING', 'DONE', 'CLOSED', 'EXPIRED', 'EXPIRED_EMPTY') AND m0_.use_alternative <> 't' AND m0_.result_date IS NOT NULL AND (m0_.result_date BETWEEN '2023-11-14 06:00:01' AND '2023-12-13 06:00:01');
Date: 2025-11-27 06:00:03 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
15 5,040 76ms 0ms 0ms 0ms select m0_.id as id_0, m0_.result_date as result_date_1, m0_.use_alternative as use_alternative_2, m0_.subject_subcohort_id as subject_subcohort_id_3, m0_.subject_id as subject_id_4, m0_.subject_about_id as subject_about_id_5, m0_.subject_extend_id as subject_extend_id_6, m0_.subject_role_code as subject_role_code_7, m0_.timeing_t0_type_code as timeing_t0_type_code_8, m0_.pilot_id as pilot_id_9, m0_.subcohort_id as subcohort_id_10, m0_.plan_id as plan_id_11, m0_.proband_event_id as proband_event_id_12, m0_.state_code as state_code_13, m0_.subject_subcohort_id as subject_subcohort_id_14 from core.mv_subject_event m0_ inner join core.proband_event p1_ on m0_.proband_event_id = p1_.id where m0_.plan_id in (...) and m0_.proband_event_id is not null and p1_.state_code not in (...) and (m0_.result_date between ? and ?);Times Reported Time consuming queries #15
Day Hour Count Duration Avg duration Nov 27 06 280 4ms 0ms 07 280 4ms 0ms 08 280 4ms 0ms 09 280 4ms 0ms 10 280 4ms 0ms 11 280 4ms 0ms 12 280 4ms 0ms 13 280 4ms 0ms 14 280 4ms 0ms 15 280 4ms 0ms 16 280 4ms 0ms 17 280 4ms 0ms 18 280 4ms 0ms 19 280 4ms 0ms 20 280 4ms 0ms 21 280 4ms 0ms 22 280 4ms 0ms 23 280 4ms 0ms [ User: tng_migration_user - Total duration: 76ms - Times executed: 5040 ]
[ Application: [unknown] - Total duration: 76ms - Times executed: 5040 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ('117') AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ('AWAITING', 'MISSED', 'DONE', 'CANCELED') AND (m0_.result_date BETWEEN '2025-08-13 14:23:01' AND '2025-08-30 14:23:01');
Date: 2025-11-27 14:23:01 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ('114') AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ('AWAITING', 'MISSED', 'DONE', 'CANCELED') AND (m0_.result_date BETWEEN '2025-02-17 17:41:01' AND '2025-02-21 17:41:01');
Date: 2025-11-27 17:41:01 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ('100') AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ('AWAITING', 'MISSED', 'DONE', 'CANCELED') AND (m0_.result_date BETWEEN '2025-06-09 20:59:01' AND '2025-06-13 20:59:01');
Date: 2025-11-27 20:59:02 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
16 4,725 1s632ms 0ms 1ms 0ms select m0_.id as id_0, m0_.result_date as result_date_1, m0_.use_alternative as use_alternative_2, m0_.subject_subcohort_id as subject_subcohort_id_3, m0_.subject_id as subject_id_4, m0_.subject_about_id as subject_about_id_5, m0_.subject_extend_id as subject_extend_id_6, m0_.subject_role_code as subject_role_code_7, m0_.timeing_t0_type_code as timeing_t0_type_code_8, m0_.pilot_id as pilot_id_9, m0_.subcohort_id as subcohort_id_10, m0_.subject_subcohort_id as subject_subcohort_id_11, m0_.form_structure_variant_id as form_structure_variant_id_12, m0_.form_id as form_id_13, m0_.form_state_code as form_state_code_14 from core.mv_subject_form m0_ where m0_.form_structure_variant_id in (...) and m0_.form_id is null;Times Reported Time consuming queries #16
Day Hour Count Duration Avg duration Nov 27 05 250 84ms 0ms 06 250 89ms 0ms 07 250 87ms 0ms 08 250 85ms 0ms 09 250 83ms 0ms 10 250 83ms 0ms 11 250 87ms 0ms 12 250 87ms 0ms 13 250 86ms 0ms 14 250 89ms 0ms 15 250 87ms 0ms 16 250 83ms 0ms 17 225 78ms 0ms 18 250 85ms 0ms 19 250 90ms 0ms 20 250 86ms 0ms 21 250 85ms 0ms 22 250 85ms 0ms 23 250 84ms 0ms [ User: tng_migration_user - Total duration: 1s632ms - Times executed: 4725 ]
[ Application: [unknown] - Total duration: 1s632ms - Times executed: 4725 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('128') AND m0_.form_id IS NULL;
Date: 2025-11-27 14:48:03 Duration: 1ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('30') AND m0_.form_id IS NULL;
Date: 2025-11-27 14:48:02 Duration: 1ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('87') AND m0_.form_id IS NULL;
Date: 2025-11-27 06:00:03 Duration: 1ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
17 3,276 828ms 0ms 0ms 0ms select m0_.id as id_0, m0_.result_date as result_date_1, m0_.use_alternative as use_alternative_2, m0_.subject_subcohort_id as subject_subcohort_id_3, m0_.subject_id as subject_id_4, m0_.subject_about_id as subject_about_id_5, m0_.subject_extend_id as subject_extend_id_6, m0_.subject_role_code as subject_role_code_7, m0_.timeing_t0_type_code as timeing_t0_type_code_8, m0_.pilot_id as pilot_id_9, m0_.subcohort_id as subcohort_id_10, m0_.plan_id as plan_id_11, m0_.proband_event_id as proband_event_id_12, m0_.state_code as state_code_13, m0_.subject_subcohort_id as subject_subcohort_id_14 from core.mv_subject_event m0_ inner join core.proband_event p1_ on m0_.proband_event_id = p1_.id where m0_.plan_id in (...) and m0_.proband_event_id is not null and p1_.state_code not in (...) and m0_.use_alternative <> ? and m0_.result_date <= ?;Times Reported Time consuming queries #17
Day Hour Count Duration Avg duration Nov 27 06 182 46ms 0ms 07 182 44ms 0ms 08 182 46ms 0ms 09 182 44ms 0ms 10 182 45ms 0ms 11 182 50ms 0ms 12 182 47ms 0ms 13 182 44ms 0ms 14 182 46ms 0ms 15 182 46ms 0ms 16 182 47ms 0ms 17 182 46ms 0ms 18 182 45ms 0ms 19 182 44ms 0ms 20 182 46ms 0ms 21 182 45ms 0ms 22 182 45ms 0ms 23 182 44ms 0ms [ User: tng_migration_user - Total duration: 828ms - Times executed: 3276 ]
[ Application: [unknown] - Total duration: 828ms - Times executed: 3276 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ('115') AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ('AWAITING', 'MISSED', 'DONE', 'CANCELED') AND m0_.use_alternative <> 't' AND m0_.result_date <= '2024-11-25 15:50:01';
Date: 2025-11-27 15:50:01 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ('97') AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ('AWAITING', 'MISSED', 'DONE', 'CANCELED') AND m0_.use_alternative <> 't' AND m0_.result_date <= '2025-10-06 08:23:01';
Date: 2025-11-27 08:23:01 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ('110') AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ('AWAITING', 'MISSED', 'DONE', 'CANCELED') AND m0_.use_alternative <> 't' AND m0_.result_date <= '2025-10-06 17:32:02';
Date: 2025-11-27 17:32:02 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
18 3,276 101ms 0ms 0ms 0ms select m0_.id as id_0, m0_.result_date as result_date_1, m0_.use_alternative as use_alternative_2, m0_.subject_subcohort_id as subject_subcohort_id_3, m0_.subject_id as subject_id_4, m0_.subject_about_id as subject_about_id_5, m0_.subject_extend_id as subject_extend_id_6, m0_.subject_role_code as subject_role_code_7, m0_.timeing_t0_type_code as timeing_t0_type_code_8, m0_.pilot_id as pilot_id_9, m0_.subcohort_id as subcohort_id_10, m0_.plan_id as plan_id_11, m0_.proband_event_id as proband_event_id_12, m0_.state_code as state_code_13, m0_.subject_subcohort_id as subject_subcohort_id_14 from core.mv_subject_event m0_ inner join core.proband_event p1_ on m0_.proband_event_id = p1_.id where m0_.plan_id in (...) and m0_.proband_event_id is not null and p1_.state_code not in (...) and m0_.use_alternative <> ? and (m0_.result_date between ? and ?);Times Reported Time consuming queries #18
Day Hour Count Duration Avg duration Nov 27 06 182 5ms 0ms 07 182 5ms 0ms 08 182 5ms 0ms 09 182 5ms 0ms 10 182 6ms 0ms 11 182 5ms 0ms 12 182 5ms 0ms 13 182 5ms 0ms 14 182 5ms 0ms 15 182 5ms 0ms 16 182 5ms 0ms 17 182 5ms 0ms 18 182 5ms 0ms 19 182 5ms 0ms 20 182 5ms 0ms 21 182 5ms 0ms 22 182 5ms 0ms 23 182 5ms 0ms [ User: tng_migration_user - Total duration: 101ms - Times executed: 3276 ]
[ Application: [unknown] - Total duration: 101ms - Times executed: 3276 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ('117') AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ('READY', 'AWAITING', 'MISSED', 'DONE', 'CANCELED') AND m0_.use_alternative <> 't' AND (m0_.result_date BETWEEN '2025-08-06 10:32:01' AND '2025-10-15 10:32:01');
Date: 2025-11-27 10:32:01 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ('117') AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ('READY', 'AWAITING', 'MISSED', 'DONE', 'CANCELED') AND m0_.use_alternative <> 't' AND (m0_.result_date BETWEEN '2025-08-06 12:05:01' AND '2025-10-15 12:05:01');
Date: 2025-11-27 12:05:01 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ('117') AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ('READY', 'AWAITING', 'MISSED', 'DONE', 'CANCELED') AND m0_.use_alternative <> 't' AND (m0_.result_date BETWEEN '2025-08-06 19:41:01' AND '2025-10-15 19:41:01');
Date: 2025-11-27 19:41:02 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
19 3,276 96ms 0ms 0ms 0ms select m0_.id as id_0, m0_.result_date as result_date_1, m0_.use_alternative as use_alternative_2, m0_.subject_subcohort_id as subject_subcohort_id_3, m0_.subject_id as subject_id_4, m0_.subject_about_id as subject_about_id_5, m0_.subject_extend_id as subject_extend_id_6, m0_.subject_role_code as subject_role_code_7, m0_.timeing_t0_type_code as timeing_t0_type_code_8, m0_.pilot_id as pilot_id_9, m0_.subcohort_id as subcohort_id_10, m0_.plan_id as plan_id_11, m0_.proband_event_id as proband_event_id_12, m0_.state_code as state_code_13, m0_.subject_subcohort_id as subject_subcohort_id_14 from core.mv_subject_event m0_ where m0_.plan_id in (...) and m0_.proband_event_id is null and m0_.result_date <= ? and m0_.use_alternative <> ?;Times Reported Time consuming queries #19
Day Hour Count Duration Avg duration Nov 27 06 182 5ms 0ms 07 182 5ms 0ms 08 182 5ms 0ms 09 182 5ms 0ms 10 182 5ms 0ms 11 182 5ms 0ms 12 182 5ms 0ms 13 182 5ms 0ms 14 182 5ms 0ms 15 182 5ms 0ms 16 182 5ms 0ms 17 182 5ms 0ms 18 182 5ms 0ms 19 182 5ms 0ms 20 182 5ms 0ms 21 182 5ms 0ms 22 182 5ms 0ms 23 182 5ms 0ms [ User: tng_migration_user - Total duration: 96ms - Times executed: 3276 ]
[ Application: [unknown] - Total duration: 96ms - Times executed: 3276 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ WHERE m0_.plan_id IN ('90') AND m0_.proband_event_id IS NULL AND m0_.result_date <= '2025-04-25 16:50:02' AND m0_.use_alternative <> 't';
Date: 2025-11-27 16:50:02 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ WHERE m0_.plan_id IN ('111') AND m0_.proband_event_id IS NULL AND m0_.result_date <= '2025-08-08 12:05:01' AND m0_.use_alternative <> 't';
Date: 2025-11-27 12:05:01 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ WHERE m0_.plan_id IN ('114') AND m0_.proband_event_id IS NULL AND m0_.result_date <= '2025-02-28 12:05:01' AND m0_.use_alternative <> 't';
Date: 2025-11-27 12:05:01 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
20 3,272 58ms 0ms 3ms 0ms begin;Times Reported Time consuming queries #20
Day Hour Count Duration Avg duration Nov 27 00 100 0ms 0ms 05 715 20ms 0ms 06 417 8ms 0ms 07 137 1ms 0ms 08 126 1ms 0ms 09 109 1ms 0ms 10 122 1ms 0ms 11 114 1ms 0ms 12 123 1ms 0ms 13 106 1ms 0ms 14 104 1ms 0ms 15 109 1ms 0ms 16 111 1ms 0ms 17 205 7ms 0ms 18 123 1ms 0ms 19 107 1ms 0ms 20 104 1ms 0ms 21 105 1ms 0ms 22 118 1ms 0ms 23 117 1ms 0ms [ User: tng_migration_user - Total duration: 58ms - Times executed: 3272 ]
[ Application: [unknown] - Total duration: 43ms - Times executed: 3062 ]
[ Application: dbt - Total duration: 15ms - Times executed: 210 ]
-
BEGIN;
Date: 2025-11-27 05:02:17 Duration: 3ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
BEGIN;
Date: 2025-11-27 17:02:14 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
BEGIN;
Date: 2025-11-27 05:02:36 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
Normalized slowest queries (N)
Rank Min duration Max duration Avg duration Times executed Total duration Query 1 4s738ms 9m43s 4m54s 2 9m48s create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #1
Day Hour Count Duration Avg duration Nov 27 05 1 4s738ms 4s738ms 17 1 9m43s 9m43s [ User: tng_migration_user - Total duration: 9m48s - Times executed: 2 ]
[ Application: dbt - Total duration: 9m48s - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );
Date: 2025-11-27 17:12:09 Duration: 9m43s Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );
Date: 2025-11-27 05:02:28 Duration: 4s738ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );
Date: 2025-11-27 05:02:28 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
2 1s673ms 36s762ms 19s218ms 2 38s436ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__23__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "celspac_pr_celspac_p01__role" text, "celspac_pr_elspac_p01__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "celspac_pr_celspac_p01__state" text, "celspac_pr_elspac_p01__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as activity ("subject_id" int, "celspac_pr_celspac_p01__activity_state" text, "celspac_pr_elspac_p01__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as created_at ("subject_id" int, "celspac_pr_celspac_p01__created_at" text, "celspac_pr_elspac_p01__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as accepted_at ("subject_id" int, "celspac_pr_celspac_p01__accepted_at" text, "celspac_pr_elspac_p01__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as cancelled_at ("subject_id" int, "celspac_pr_celspac_p01__cancelled_at" text, "celspac_pr_elspac_p01__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as revoked_at ("subject_id" int, "celspac_pr_celspac_p01__revoked_at" text, "celspac_pr_elspac_p01__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as paused_at ("subject_id" int, "celspac_pr_celspac_p01__paused_at" text, "celspac_pr_elspac_p01__paused_at" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.celspac_pr_celspac_p01__role, psc_role.celspac_pr_elspac_p01__role, psc_state.celspac_pr_celspac_p01__state, psc_state.celspac_pr_elspac_p01__state, psc_activity_state.celspac_pr_celspac_p01__activity_state, psc_activity_state.celspac_pr_elspac_p01__activity_state, psc_created_at.celspac_pr_celspac_p01__created_at, psc_created_at.celspac_pr_elspac_p01__created_at, psc_accepted_at.celspac_pr_celspac_p01__accepted_at, psc_accepted_at.celspac_pr_elspac_p01__accepted_at, psc_cancelled_at.celspac_pr_celspac_p01__cancelled_at, psc_cancelled_at.celspac_pr_elspac_p01__cancelled_at, psc_revoked_at.celspac_pr_celspac_p01__revoked_at, psc_revoked_at.celspac_pr_elspac_p01__revoked_at, psc_paused_at.celspac_pr_celspac_p01__paused_at, psc_paused_at.celspac_pr_elspac_p01__paused_at from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #2
Day Hour Count Duration Avg duration Nov 27 05 1 1s673ms 1s673ms 17 1 36s762ms 36s762ms [ User: tng_migration_user - Total duration: 38s436ms - Times executed: 2 ]
[ Application: dbt - Total duration: 38s436ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__23"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__23__dbt_tmp" as ( -- suject (proband) patrici do kohorty ..., Pilot ID: 23 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__role" text, "celspac_pr_elspac_p01__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__state" text, "celspac_pr_elspac_p01__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS activity ("subject_id" int, "celspac_pr_celspac_p01__activity_state" text, "celspac_pr_elspac_p01__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS created_at ("subject_id" int, "celspac_pr_celspac_p01__created_at" text, "celspac_pr_elspac_p01__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS accepted_at ("subject_id" int, "celspac_pr_celspac_p01__accepted_at" text, "celspac_pr_elspac_p01__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS cancelled_at ("subject_id" int, "celspac_pr_celspac_p01__cancelled_at" text, "celspac_pr_elspac_p01__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS revoked_at ("subject_id" int, "celspac_pr_celspac_p01__revoked_at" text, "celspac_pr_elspac_p01__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS paused_at ("subject_id" int, "celspac_pr_celspac_p01__paused_at" text, "celspac_pr_elspac_p01__paused_at" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.celspac_pr_celspac_p01__role, psc_role.celspac_pr_elspac_p01__role, psc_state.celspac_pr_celspac_p01__state, psc_state.celspac_pr_elspac_p01__state, psc_activity_state.celspac_pr_celspac_p01__activity_state, psc_activity_state.celspac_pr_elspac_p01__activity_state, psc_created_at.celspac_pr_celspac_p01__created_at, psc_created_at.celspac_pr_elspac_p01__created_at, psc_accepted_at.celspac_pr_celspac_p01__accepted_at, psc_accepted_at.celspac_pr_elspac_p01__accepted_at, psc_cancelled_at.celspac_pr_celspac_p01__cancelled_at, psc_cancelled_at.celspac_pr_elspac_p01__cancelled_at, psc_revoked_at.celspac_pr_celspac_p01__revoked_at, psc_revoked_at.celspac_pr_elspac_p01__revoked_at, psc_paused_at.celspac_pr_celspac_p01__paused_at, psc_paused_at.celspac_pr_elspac_p01__paused_at FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 23 -- Pilot ID );
Date: 2025-11-27 17:03:04 Duration: 36s762ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__23"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__23__dbt_tmp" as ( -- suject (proband) patrici do kohorty ..., Pilot ID: 23 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__role" text, "celspac_pr_elspac_p01__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__state" text, "celspac_pr_elspac_p01__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS activity ("subject_id" int, "celspac_pr_celspac_p01__activity_state" text, "celspac_pr_elspac_p01__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS created_at ("subject_id" int, "celspac_pr_celspac_p01__created_at" text, "celspac_pr_elspac_p01__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS accepted_at ("subject_id" int, "celspac_pr_celspac_p01__accepted_at" text, "celspac_pr_elspac_p01__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS cancelled_at ("subject_id" int, "celspac_pr_celspac_p01__cancelled_at" text, "celspac_pr_elspac_p01__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS revoked_at ("subject_id" int, "celspac_pr_celspac_p01__revoked_at" text, "celspac_pr_elspac_p01__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS paused_at ("subject_id" int, "celspac_pr_celspac_p01__paused_at" text, "celspac_pr_elspac_p01__paused_at" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.celspac_pr_celspac_p01__role, psc_role.celspac_pr_elspac_p01__role, psc_state.celspac_pr_celspac_p01__state, psc_state.celspac_pr_elspac_p01__state, psc_activity_state.celspac_pr_celspac_p01__activity_state, psc_activity_state.celspac_pr_elspac_p01__activity_state, psc_created_at.celspac_pr_celspac_p01__created_at, psc_created_at.celspac_pr_elspac_p01__created_at, psc_accepted_at.celspac_pr_celspac_p01__accepted_at, psc_accepted_at.celspac_pr_elspac_p01__accepted_at, psc_cancelled_at.celspac_pr_celspac_p01__cancelled_at, psc_cancelled_at.celspac_pr_elspac_p01__cancelled_at, psc_revoked_at.celspac_pr_celspac_p01__revoked_at, psc_revoked_at.celspac_pr_elspac_p01__revoked_at, psc_paused_at.celspac_pr_celspac_p01__paused_at, psc_paused_at.celspac_pr_elspac_p01__paused_at FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 23 -- Pilot ID );
Date: 2025-11-27 05:02:26 Duration: 1s673ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
3 2s352ms 11s347ms 6s850ms 2 13s700ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__21__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "psycap_p01_ya_p03__role" text, "psycap_p02_new_ya_p03__role" text, "psycap_p02_old_ya_p03__role" text, "ya_p03__role" text, "ya_p03_digi_ya03v2__role" text, "ya_p03_digi_ya04v2__role" text, "ya_p03_digi_ya05v2__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "psycap_p01_ya_p03__state" text, "psycap_p02_new_ya_p03__state" text, "psycap_p02_old_ya_p03__state" text, "ya_p03__state" text, "ya_p03_digi_ya03v2__state" text, "ya_p03_digi_ya04v2__state" text, "ya_p03_digi_ya05v2__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as activity ("subject_id" int, "psycap_p01_ya_p03__activity_state" text, "psycap_p02_new_ya_p03__activity_state" text, "psycap_p02_old_ya_p03__activity_state" text, "ya_p03__activity_state" text, "ya_p03_digi_ya03v2__activity_state" text, "ya_p03_digi_ya04v2__activity_state" text, "ya_p03_digi_ya05v2__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as created_at ("subject_id" int, "psycap_p01_ya_p03__created_at" text, "psycap_p02_new_ya_p03__created_at" text, "psycap_p02_old_ya_p03__created_at" text, "ya_p03__created_at" text, "ya_p03_digi_ya03v2__created_at" text, "ya_p03_digi_ya04v2__created_at" text, "ya_p03_digi_ya05v2__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "psycap_p01_ya_p03__accepted_at" text, "psycap_p02_new_ya_p03__accepted_at" text, "psycap_p02_old_ya_p03__accepted_at" text, "ya_p03__accepted_at" text, "ya_p03_digi_ya03v2__accepted_at" text, "ya_p03_digi_ya04v2__accepted_at" text, "ya_p03_digi_ya05v2__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "psycap_p01_ya_p03__cancelled_at" text, "psycap_p02_new_ya_p03__cancelled_at" text, "psycap_p02_old_ya_p03__cancelled_at" text, "ya_p03__cancelled_at" text, "ya_p03_digi_ya03v2__cancelled_at" text, "ya_p03_digi_ya04v2__cancelled_at" text, "ya_p03_digi_ya05v2__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "psycap_p01_ya_p03__revoked_at" text, "psycap_p02_new_ya_p03__revoked_at" text, "psycap_p02_old_ya_p03__revoked_at" text, "ya_p03__revoked_at" text, "ya_p03_digi_ya03v2__revoked_at" text, "ya_p03_digi_ya04v2__revoked_at" text, "ya_p03_digi_ya05v2__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as paused_at ("subject_id" int, "psycap_p01_ya_p03__paused_at" text, "psycap_p02_new_ya_p03__paused_at" text, "psycap_p02_old_ya_p03__paused_at" text, "ya_p03__paused_at" text, "ya_p03_digi_ya03v2__paused_at" text, "ya_p03_digi_ya04v2__paused_at" text, "ya_p03_digi_ya05v2__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "ya_p03_ic_buccal_swab_proband" text, "ya_p03_ic_urine_proband" text, "ya_p03_ic_venous_blood_proband" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "ya_p03_ic_anam_qs" text, "ya_p03_ic_aneurysm" text, "ya_p03_ic_anthropometry" text, "ya_p03_ic_arch_foot" text, "ya_p03_ic_basic_qs" text, "ya_p03_ic_blood_pressure" text, "ya_p03_ic_braces_piercing_iud" text, "ya_p03_ic_cognition_test" text, "ya_p03_ic_da_health_registry" text, "ya_p03_ic_dexa" text, "ya_p03_ic_enviro_qs" text, "ya_p03_ic_follow_up_studies" text, "ya_p03_ic_fracture_lower_body_last_3m" text, "ya_p03_ic_fracture_upper_body_last_3m" text, "ya_p03_ic_hand_grip" text, "ya_p03_ic_hearing_vision_impairment" text, "ya_p03_ic_heart_disease" text, "ya_p03_ic_hemoptysis_ns" text, "ya_p03_ic_hernia" text, "ya_p03_ic_hyperthyroidism" text, "ya_p03_ic_inability_hold_pencil" text, "ya_p03_ic_inability_stand_both_legs" text, "ya_p03_ic_inability_talk_cze" text, "ya_p03_ic_inability_walk" text, "ya_p03_ic_inbody" text, "ya_p03_ic_infectious_resp_diseases" text, "ya_p03_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p03_ic_knee_stability" text, "ya_p03_ic_nutri_qs" text, "ya_p03_ic_over_weight_200_height_195" text, "ya_p03_ic_pacemaker_defibrillator" text, "ya_p03_ic_pneumothorax" text, "ya_p03_ic_pregnancy" text, "ya_p03_ic_recent_eye_abdominal_chest_surgery" text, "ya_p03_ic_recent_myocardial_infarction" text, "ya_p03_ic_spirometry" text, "ya_p03_ic_surgical_metal_body" text, "ya_p03_ic_unstable_angina_pectoris" text, "ya_p03_ic_ya_dl_elspac" text, "ya_p03_ic_ya_med_find" text, "ya_p03_ic_ya_newsletter" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.psycap_p01_ya_p03__role, psc_role.psycap_p02_new_ya_p03__role, psc_role.psycap_p02_old_ya_p03__role, psc_role.ya_p03__role, psc_role.ya_p03_digi_ya03v2__role, psc_role.ya_p03_digi_ya04v2__role, psc_role.ya_p03_digi_ya05v2__role, psc_state.psycap_p01_ya_p03__state, psc_state.psycap_p02_new_ya_p03__state, psc_state.psycap_p02_old_ya_p03__state, psc_state.ya_p03__state, psc_state.ya_p03_digi_ya03v2__state, psc_state.ya_p03_digi_ya04v2__state, psc_state.ya_p03_digi_ya05v2__state, psc_activity_state.psycap_p01_ya_p03__activity_state, psc_activity_state.psycap_p02_new_ya_p03__activity_state, psc_activity_state.psycap_p02_old_ya_p03__activity_state, psc_activity_state.ya_p03__activity_state, psc_activity_state.ya_p03_digi_ya03v2__activity_state, psc_activity_state.ya_p03_digi_ya04v2__activity_state, psc_activity_state.ya_p03_digi_ya05v2__activity_state, psc_created_at.psycap_p01_ya_p03__created_at, psc_created_at.psycap_p02_new_ya_p03__created_at, psc_created_at.psycap_p02_old_ya_p03__created_at, psc_created_at.ya_p03__created_at, psc_created_at.ya_p03_digi_ya03v2__created_at, psc_created_at.ya_p03_digi_ya04v2__created_at, psc_created_at.ya_p03_digi_ya05v2__created_at, psc_accepted_at.psycap_p01_ya_p03__accepted_at, psc_accepted_at.psycap_p02_new_ya_p03__accepted_at, psc_accepted_at.psycap_p02_old_ya_p03__accepted_at, psc_accepted_at.ya_p03__accepted_at, psc_accepted_at.ya_p03_digi_ya03v2__accepted_at, psc_accepted_at.ya_p03_digi_ya04v2__accepted_at, psc_accepted_at.ya_p03_digi_ya05v2__accepted_at, psc_cancelled_at.psycap_p01_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_new_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p03__cancelled_at, psc_cancelled_at.ya_p03__cancelled_at, psc_cancelled_at.ya_p03_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya05v2__cancelled_at, psc_revoked_at.psycap_p01_ya_p03__revoked_at, psc_revoked_at.psycap_p02_new_ya_p03__revoked_at, psc_revoked_at.psycap_p02_old_ya_p03__revoked_at, psc_revoked_at.ya_p03__revoked_at, psc_revoked_at.ya_p03_digi_ya03v2__revoked_at, psc_revoked_at.ya_p03_digi_ya04v2__revoked_at, psc_revoked_at.ya_p03_digi_ya05v2__revoked_at, psc_paused_at.psycap_p01_ya_p03__paused_at, psc_paused_at.psycap_p02_new_ya_p03__paused_at, psc_paused_at.psycap_p02_old_ya_p03__paused_at, psc_paused_at.ya_p03__paused_at, psc_paused_at.ya_p03_digi_ya03v2__paused_at, psc_paused_at.ya_p03_digi_ya04v2__paused_at, psc_paused_at.ya_p03_digi_ya05v2__paused_at, ya_p03_ic_buccal_swab_proband, ya_p03_ic_urine_proband, ya_p03_ic_venous_blood_proband, ya_p03_ic_anam_qs, ya_p03_ic_aneurysm, ya_p03_ic_anthropometry, ya_p03_ic_arch_foot, ya_p03_ic_basic_qs, ya_p03_ic_blood_pressure, ya_p03_ic_braces_piercing_iud, ya_p03_ic_cognition_test, ya_p03_ic_da_health_registry, ya_p03_ic_dexa, ya_p03_ic_enviro_qs, ya_p03_ic_follow_up_studies, ya_p03_ic_fracture_lower_body_last_3m, ya_p03_ic_fracture_upper_body_last_3m, ya_p03_ic_hand_grip, ya_p03_ic_hearing_vision_impairment, ya_p03_ic_heart_disease, ya_p03_ic_hemoptysis_ns, ya_p03_ic_hernia, ya_p03_ic_hyperthyroidism, ya_p03_ic_inability_hold_pencil, ya_p03_ic_inability_stand_both_legs, ya_p03_ic_inability_talk_cze, ya_p03_ic_inability_walk, ya_p03_ic_inbody, ya_p03_ic_infectious_resp_diseases, ya_p03_ic_iodine_barium_radioisotopes_last_7d, ya_p03_ic_knee_stability, ya_p03_ic_nutri_qs, ya_p03_ic_over_weight_200_height_195, ya_p03_ic_pacemaker_defibrillator, ya_p03_ic_pneumothorax, ya_p03_ic_pregnancy, ya_p03_ic_recent_eye_abdominal_chest_surgery, ya_p03_ic_recent_myocardial_infarction, ya_p03_ic_spirometry, ya_p03_ic_surgical_metal_body, ya_p03_ic_unstable_angina_pectoris, ya_p03_ic_ya_dl_elspac, ya_p03_ic_ya_med_find, ya_p03_ic_ya_newsletter from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #3
Day Hour Count Duration Avg duration Nov 27 05 1 11s347ms 11s347ms 17 1 2s352ms 2s352ms [ User: tng_migration_user - Total duration: 13s700ms - Times executed: 2 ]
[ Application: dbt - Total duration: 13s700ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__21"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__21__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: Young Adults, Pilot ID: 21 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p03__role" text, "psycap_p02_new_ya_p03__role" text, "psycap_p02_old_ya_p03__role" text, "ya_p03__role" text, "ya_p03_digi_ya03v2__role" text, "ya_p03_digi_ya04v2__role" text, "ya_p03_digi_ya05v2__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p03__state" text, "psycap_p02_new_ya_p03__state" text, "psycap_p02_old_ya_p03__state" text, "ya_p03__state" text, "ya_p03_digi_ya03v2__state" text, "ya_p03_digi_ya04v2__state" text, "ya_p03_digi_ya05v2__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p03__activity_state" text, "psycap_p02_new_ya_p03__activity_state" text, "psycap_p02_old_ya_p03__activity_state" text, "ya_p03__activity_state" text, "ya_p03_digi_ya03v2__activity_state" text, "ya_p03_digi_ya04v2__activity_state" text, "ya_p03_digi_ya05v2__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p03__created_at" text, "psycap_p02_new_ya_p03__created_at" text, "psycap_p02_old_ya_p03__created_at" text, "ya_p03__created_at" text, "ya_p03_digi_ya03v2__created_at" text, "ya_p03_digi_ya04v2__created_at" text, "ya_p03_digi_ya05v2__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p03__accepted_at" text, "psycap_p02_new_ya_p03__accepted_at" text, "psycap_p02_old_ya_p03__accepted_at" text, "ya_p03__accepted_at" text, "ya_p03_digi_ya03v2__accepted_at" text, "ya_p03_digi_ya04v2__accepted_at" text, "ya_p03_digi_ya05v2__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p03__cancelled_at" text, "psycap_p02_new_ya_p03__cancelled_at" text, "psycap_p02_old_ya_p03__cancelled_at" text, "ya_p03__cancelled_at" text, "ya_p03_digi_ya03v2__cancelled_at" text, "ya_p03_digi_ya04v2__cancelled_at" text, "ya_p03_digi_ya05v2__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p03__revoked_at" text, "psycap_p02_new_ya_p03__revoked_at" text, "psycap_p02_old_ya_p03__revoked_at" text, "ya_p03__revoked_at" text, "ya_p03_digi_ya03v2__revoked_at" text, "ya_p03_digi_ya04v2__revoked_at" text, "ya_p03_digi_ya05v2__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p03__paused_at" text, "psycap_p02_new_ya_p03__paused_at" text, "psycap_p02_old_ya_p03__paused_at" text, "ya_p03__paused_at" text, "ya_p03_digi_ya03v2__paused_at" text, "ya_p03_digi_ya04v2__paused_at" text, "ya_p03_digi_ya05v2__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p03_ic_buccal_swab_proband'), ('ya_p03_ic_urine_proband'), ('ya_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p03_ic_buccal_swab_proband" text, "ya_p03_ic_urine_proband" text, "ya_p03_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p03_ic_anam_qs'), ('ya_p03_ic_aneurysm'), ('ya_p03_ic_anthropometry'), ('ya_p03_ic_arch_foot'), ('ya_p03_ic_basic_qs'), ('ya_p03_ic_blood_pressure'), ('ya_p03_ic_braces_piercing_iud'), ('ya_p03_ic_cognition_test'), ('ya_p03_ic_da_health_registry'), ('ya_p03_ic_dexa'), ('ya_p03_ic_enviro_qs'), ('ya_p03_ic_follow_up_studies'), ('ya_p03_ic_fracture_lower_body_last_3m'), ('ya_p03_ic_fracture_upper_body_last_3m'), ('ya_p03_ic_hand_grip'), ('ya_p03_ic_hearing_vision_impairment'), ('ya_p03_ic_heart_disease'), ('ya_p03_ic_hemoptysis_ns'), ('ya_p03_ic_hernia'), ('ya_p03_ic_hyperthyroidism'), ('ya_p03_ic_inability_hold_pencil'), ('ya_p03_ic_inability_stand_both_legs'), ('ya_p03_ic_inability_talk_cze'), ('ya_p03_ic_inability_walk'), ('ya_p03_ic_inbody'), ('ya_p03_ic_infectious_resp_diseases'), ('ya_p03_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p03_ic_knee_stability'), ('ya_p03_ic_nutri_qs'), ('ya_p03_ic_over_weight_200_height_195'), ('ya_p03_ic_pacemaker_defibrillator'), ('ya_p03_ic_pneumothorax'), ('ya_p03_ic_pregnancy'), ('ya_p03_ic_recent_eye_abdominal_chest_surgery'), ('ya_p03_ic_recent_myocardial_infarction'), ('ya_p03_ic_spirometry'), ('ya_p03_ic_surgical_metal_body'), ('ya_p03_ic_unstable_angina_pectoris'), ('ya_p03_ic_ya_dl_elspac'), ('ya_p03_ic_ya_med_find'), ('ya_p03_ic_ya_newsletter') $$ ) AS extra_state ("subject_id" int, "ya_p03_ic_anam_qs" text, "ya_p03_ic_aneurysm" text, "ya_p03_ic_anthropometry" text, "ya_p03_ic_arch_foot" text, "ya_p03_ic_basic_qs" text, "ya_p03_ic_blood_pressure" text, "ya_p03_ic_braces_piercing_iud" text, "ya_p03_ic_cognition_test" text, "ya_p03_ic_da_health_registry" text, "ya_p03_ic_dexa" text, "ya_p03_ic_enviro_qs" text, "ya_p03_ic_follow_up_studies" text, "ya_p03_ic_fracture_lower_body_last_3m" text, "ya_p03_ic_fracture_upper_body_last_3m" text, "ya_p03_ic_hand_grip" text, "ya_p03_ic_hearing_vision_impairment" text, "ya_p03_ic_heart_disease" text, "ya_p03_ic_hemoptysis_ns" text, "ya_p03_ic_hernia" text, "ya_p03_ic_hyperthyroidism" text, "ya_p03_ic_inability_hold_pencil" text, "ya_p03_ic_inability_stand_both_legs" text, "ya_p03_ic_inability_talk_cze" text, "ya_p03_ic_inability_walk" text, "ya_p03_ic_inbody" text, "ya_p03_ic_infectious_resp_diseases" text, "ya_p03_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p03_ic_knee_stability" text, "ya_p03_ic_nutri_qs" text, "ya_p03_ic_over_weight_200_height_195" text, "ya_p03_ic_pacemaker_defibrillator" text, "ya_p03_ic_pneumothorax" text, "ya_p03_ic_pregnancy" text, "ya_p03_ic_recent_eye_abdominal_chest_surgery" text, "ya_p03_ic_recent_myocardial_infarction" text, "ya_p03_ic_spirometry" text, "ya_p03_ic_surgical_metal_body" text, "ya_p03_ic_unstable_angina_pectoris" text, "ya_p03_ic_ya_dl_elspac" text, "ya_p03_ic_ya_med_find" text, "ya_p03_ic_ya_newsletter" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p03__role, psc_role.psycap_p02_new_ya_p03__role, psc_role.psycap_p02_old_ya_p03__role, psc_role.ya_p03__role, psc_role.ya_p03_digi_ya03v2__role, psc_role.ya_p03_digi_ya04v2__role, psc_role.ya_p03_digi_ya05v2__role, psc_state.psycap_p01_ya_p03__state, psc_state.psycap_p02_new_ya_p03__state, psc_state.psycap_p02_old_ya_p03__state, psc_state.ya_p03__state, psc_state.ya_p03_digi_ya03v2__state, psc_state.ya_p03_digi_ya04v2__state, psc_state.ya_p03_digi_ya05v2__state, psc_activity_state.psycap_p01_ya_p03__activity_state, psc_activity_state.psycap_p02_new_ya_p03__activity_state, psc_activity_state.psycap_p02_old_ya_p03__activity_state, psc_activity_state.ya_p03__activity_state, psc_activity_state.ya_p03_digi_ya03v2__activity_state, psc_activity_state.ya_p03_digi_ya04v2__activity_state, psc_activity_state.ya_p03_digi_ya05v2__activity_state, psc_created_at.psycap_p01_ya_p03__created_at, psc_created_at.psycap_p02_new_ya_p03__created_at, psc_created_at.psycap_p02_old_ya_p03__created_at, psc_created_at.ya_p03__created_at, psc_created_at.ya_p03_digi_ya03v2__created_at, psc_created_at.ya_p03_digi_ya04v2__created_at, psc_created_at.ya_p03_digi_ya05v2__created_at, psc_accepted_at.psycap_p01_ya_p03__accepted_at, psc_accepted_at.psycap_p02_new_ya_p03__accepted_at, psc_accepted_at.psycap_p02_old_ya_p03__accepted_at, psc_accepted_at.ya_p03__accepted_at, psc_accepted_at.ya_p03_digi_ya03v2__accepted_at, psc_accepted_at.ya_p03_digi_ya04v2__accepted_at, psc_accepted_at.ya_p03_digi_ya05v2__accepted_at, psc_cancelled_at.psycap_p01_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_new_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p03__cancelled_at, psc_cancelled_at.ya_p03__cancelled_at, psc_cancelled_at.ya_p03_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya05v2__cancelled_at, psc_revoked_at.psycap_p01_ya_p03__revoked_at, psc_revoked_at.psycap_p02_new_ya_p03__revoked_at, psc_revoked_at.psycap_p02_old_ya_p03__revoked_at, psc_revoked_at.ya_p03__revoked_at, psc_revoked_at.ya_p03_digi_ya03v2__revoked_at, psc_revoked_at.ya_p03_digi_ya04v2__revoked_at, psc_revoked_at.ya_p03_digi_ya05v2__revoked_at, psc_paused_at.psycap_p01_ya_p03__paused_at, psc_paused_at.psycap_p02_new_ya_p03__paused_at, psc_paused_at.psycap_p02_old_ya_p03__paused_at, psc_paused_at.ya_p03__paused_at, psc_paused_at.ya_p03_digi_ya03v2__paused_at, psc_paused_at.ya_p03_digi_ya04v2__paused_at, psc_paused_at.ya_p03_digi_ya05v2__paused_at, ya_p03_ic_buccal_swab_proband, ya_p03_ic_urine_proband, ya_p03_ic_venous_blood_proband, ya_p03_ic_anam_qs, ya_p03_ic_aneurysm, ya_p03_ic_anthropometry, ya_p03_ic_arch_foot, ya_p03_ic_basic_qs, ya_p03_ic_blood_pressure, ya_p03_ic_braces_piercing_iud, ya_p03_ic_cognition_test, ya_p03_ic_da_health_registry, ya_p03_ic_dexa, ya_p03_ic_enviro_qs, ya_p03_ic_follow_up_studies, ya_p03_ic_fracture_lower_body_last_3m, ya_p03_ic_fracture_upper_body_last_3m, ya_p03_ic_hand_grip, ya_p03_ic_hearing_vision_impairment, ya_p03_ic_heart_disease, ya_p03_ic_hemoptysis_ns, ya_p03_ic_hernia, ya_p03_ic_hyperthyroidism, ya_p03_ic_inability_hold_pencil, ya_p03_ic_inability_stand_both_legs, ya_p03_ic_inability_talk_cze, ya_p03_ic_inability_walk, ya_p03_ic_inbody, ya_p03_ic_infectious_resp_diseases, ya_p03_ic_iodine_barium_radioisotopes_last_7d, ya_p03_ic_knee_stability, ya_p03_ic_nutri_qs, ya_p03_ic_over_weight_200_height_195, ya_p03_ic_pacemaker_defibrillator, ya_p03_ic_pneumothorax, ya_p03_ic_pregnancy, ya_p03_ic_recent_eye_abdominal_chest_surgery, ya_p03_ic_recent_myocardial_infarction, ya_p03_ic_spirometry, ya_p03_ic_surgical_metal_body, ya_p03_ic_unstable_angina_pectoris, ya_p03_ic_ya_dl_elspac, ya_p03_ic_ya_med_find, ya_p03_ic_ya_newsletter FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 21 -- Pilot ID );
Date: 2025-11-27 05:02:35 Duration: 11s347ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__21"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__21__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: Young Adults, Pilot ID: 21 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p03__role" text, "psycap_p02_new_ya_p03__role" text, "psycap_p02_old_ya_p03__role" text, "ya_p03__role" text, "ya_p03_digi_ya03v2__role" text, "ya_p03_digi_ya04v2__role" text, "ya_p03_digi_ya05v2__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p03__state" text, "psycap_p02_new_ya_p03__state" text, "psycap_p02_old_ya_p03__state" text, "ya_p03__state" text, "ya_p03_digi_ya03v2__state" text, "ya_p03_digi_ya04v2__state" text, "ya_p03_digi_ya05v2__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p03__activity_state" text, "psycap_p02_new_ya_p03__activity_state" text, "psycap_p02_old_ya_p03__activity_state" text, "ya_p03__activity_state" text, "ya_p03_digi_ya03v2__activity_state" text, "ya_p03_digi_ya04v2__activity_state" text, "ya_p03_digi_ya05v2__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p03__created_at" text, "psycap_p02_new_ya_p03__created_at" text, "psycap_p02_old_ya_p03__created_at" text, "ya_p03__created_at" text, "ya_p03_digi_ya03v2__created_at" text, "ya_p03_digi_ya04v2__created_at" text, "ya_p03_digi_ya05v2__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p03__accepted_at" text, "psycap_p02_new_ya_p03__accepted_at" text, "psycap_p02_old_ya_p03__accepted_at" text, "ya_p03__accepted_at" text, "ya_p03_digi_ya03v2__accepted_at" text, "ya_p03_digi_ya04v2__accepted_at" text, "ya_p03_digi_ya05v2__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p03__cancelled_at" text, "psycap_p02_new_ya_p03__cancelled_at" text, "psycap_p02_old_ya_p03__cancelled_at" text, "ya_p03__cancelled_at" text, "ya_p03_digi_ya03v2__cancelled_at" text, "ya_p03_digi_ya04v2__cancelled_at" text, "ya_p03_digi_ya05v2__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p03__revoked_at" text, "psycap_p02_new_ya_p03__revoked_at" text, "psycap_p02_old_ya_p03__revoked_at" text, "ya_p03__revoked_at" text, "ya_p03_digi_ya03v2__revoked_at" text, "ya_p03_digi_ya04v2__revoked_at" text, "ya_p03_digi_ya05v2__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p03__paused_at" text, "psycap_p02_new_ya_p03__paused_at" text, "psycap_p02_old_ya_p03__paused_at" text, "ya_p03__paused_at" text, "ya_p03_digi_ya03v2__paused_at" text, "ya_p03_digi_ya04v2__paused_at" text, "ya_p03_digi_ya05v2__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p03_ic_buccal_swab_proband'), ('ya_p03_ic_urine_proband'), ('ya_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p03_ic_buccal_swab_proband" text, "ya_p03_ic_urine_proband" text, "ya_p03_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p03_ic_anam_qs'), ('ya_p03_ic_aneurysm'), ('ya_p03_ic_anthropometry'), ('ya_p03_ic_arch_foot'), ('ya_p03_ic_basic_qs'), ('ya_p03_ic_blood_pressure'), ('ya_p03_ic_braces_piercing_iud'), ('ya_p03_ic_cognition_test'), ('ya_p03_ic_da_health_registry'), ('ya_p03_ic_dexa'), ('ya_p03_ic_enviro_qs'), ('ya_p03_ic_follow_up_studies'), ('ya_p03_ic_fracture_lower_body_last_3m'), ('ya_p03_ic_fracture_upper_body_last_3m'), ('ya_p03_ic_hand_grip'), ('ya_p03_ic_hearing_vision_impairment'), ('ya_p03_ic_heart_disease'), ('ya_p03_ic_hemoptysis_ns'), ('ya_p03_ic_hernia'), ('ya_p03_ic_hyperthyroidism'), ('ya_p03_ic_inability_hold_pencil'), ('ya_p03_ic_inability_stand_both_legs'), ('ya_p03_ic_inability_talk_cze'), ('ya_p03_ic_inability_walk'), ('ya_p03_ic_inbody'), ('ya_p03_ic_infectious_resp_diseases'), ('ya_p03_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p03_ic_knee_stability'), ('ya_p03_ic_nutri_qs'), ('ya_p03_ic_over_weight_200_height_195'), ('ya_p03_ic_pacemaker_defibrillator'), ('ya_p03_ic_pneumothorax'), ('ya_p03_ic_pregnancy'), ('ya_p03_ic_recent_eye_abdominal_chest_surgery'), ('ya_p03_ic_recent_myocardial_infarction'), ('ya_p03_ic_spirometry'), ('ya_p03_ic_surgical_metal_body'), ('ya_p03_ic_unstable_angina_pectoris'), ('ya_p03_ic_ya_dl_elspac'), ('ya_p03_ic_ya_med_find'), ('ya_p03_ic_ya_newsletter') $$ ) AS extra_state ("subject_id" int, "ya_p03_ic_anam_qs" text, "ya_p03_ic_aneurysm" text, "ya_p03_ic_anthropometry" text, "ya_p03_ic_arch_foot" text, "ya_p03_ic_basic_qs" text, "ya_p03_ic_blood_pressure" text, "ya_p03_ic_braces_piercing_iud" text, "ya_p03_ic_cognition_test" text, "ya_p03_ic_da_health_registry" text, "ya_p03_ic_dexa" text, "ya_p03_ic_enviro_qs" text, "ya_p03_ic_follow_up_studies" text, "ya_p03_ic_fracture_lower_body_last_3m" text, "ya_p03_ic_fracture_upper_body_last_3m" text, "ya_p03_ic_hand_grip" text, "ya_p03_ic_hearing_vision_impairment" text, "ya_p03_ic_heart_disease" text, "ya_p03_ic_hemoptysis_ns" text, "ya_p03_ic_hernia" text, "ya_p03_ic_hyperthyroidism" text, "ya_p03_ic_inability_hold_pencil" text, "ya_p03_ic_inability_stand_both_legs" text, "ya_p03_ic_inability_talk_cze" text, "ya_p03_ic_inability_walk" text, "ya_p03_ic_inbody" text, "ya_p03_ic_infectious_resp_diseases" text, "ya_p03_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p03_ic_knee_stability" text, "ya_p03_ic_nutri_qs" text, "ya_p03_ic_over_weight_200_height_195" text, "ya_p03_ic_pacemaker_defibrillator" text, "ya_p03_ic_pneumothorax" text, "ya_p03_ic_pregnancy" text, "ya_p03_ic_recent_eye_abdominal_chest_surgery" text, "ya_p03_ic_recent_myocardial_infarction" text, "ya_p03_ic_spirometry" text, "ya_p03_ic_surgical_metal_body" text, "ya_p03_ic_unstable_angina_pectoris" text, "ya_p03_ic_ya_dl_elspac" text, "ya_p03_ic_ya_med_find" text, "ya_p03_ic_ya_newsletter" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p03__role, psc_role.psycap_p02_new_ya_p03__role, psc_role.psycap_p02_old_ya_p03__role, psc_role.ya_p03__role, psc_role.ya_p03_digi_ya03v2__role, psc_role.ya_p03_digi_ya04v2__role, psc_role.ya_p03_digi_ya05v2__role, psc_state.psycap_p01_ya_p03__state, psc_state.psycap_p02_new_ya_p03__state, psc_state.psycap_p02_old_ya_p03__state, psc_state.ya_p03__state, psc_state.ya_p03_digi_ya03v2__state, psc_state.ya_p03_digi_ya04v2__state, psc_state.ya_p03_digi_ya05v2__state, psc_activity_state.psycap_p01_ya_p03__activity_state, psc_activity_state.psycap_p02_new_ya_p03__activity_state, psc_activity_state.psycap_p02_old_ya_p03__activity_state, psc_activity_state.ya_p03__activity_state, psc_activity_state.ya_p03_digi_ya03v2__activity_state, psc_activity_state.ya_p03_digi_ya04v2__activity_state, psc_activity_state.ya_p03_digi_ya05v2__activity_state, psc_created_at.psycap_p01_ya_p03__created_at, psc_created_at.psycap_p02_new_ya_p03__created_at, psc_created_at.psycap_p02_old_ya_p03__created_at, psc_created_at.ya_p03__created_at, psc_created_at.ya_p03_digi_ya03v2__created_at, psc_created_at.ya_p03_digi_ya04v2__created_at, psc_created_at.ya_p03_digi_ya05v2__created_at, psc_accepted_at.psycap_p01_ya_p03__accepted_at, psc_accepted_at.psycap_p02_new_ya_p03__accepted_at, psc_accepted_at.psycap_p02_old_ya_p03__accepted_at, psc_accepted_at.ya_p03__accepted_at, psc_accepted_at.ya_p03_digi_ya03v2__accepted_at, psc_accepted_at.ya_p03_digi_ya04v2__accepted_at, psc_accepted_at.ya_p03_digi_ya05v2__accepted_at, psc_cancelled_at.psycap_p01_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_new_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p03__cancelled_at, psc_cancelled_at.ya_p03__cancelled_at, psc_cancelled_at.ya_p03_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya05v2__cancelled_at, psc_revoked_at.psycap_p01_ya_p03__revoked_at, psc_revoked_at.psycap_p02_new_ya_p03__revoked_at, psc_revoked_at.psycap_p02_old_ya_p03__revoked_at, psc_revoked_at.ya_p03__revoked_at, psc_revoked_at.ya_p03_digi_ya03v2__revoked_at, psc_revoked_at.ya_p03_digi_ya04v2__revoked_at, psc_revoked_at.ya_p03_digi_ya05v2__revoked_at, psc_paused_at.psycap_p01_ya_p03__paused_at, psc_paused_at.psycap_p02_new_ya_p03__paused_at, psc_paused_at.psycap_p02_old_ya_p03__paused_at, psc_paused_at.ya_p03__paused_at, psc_paused_at.ya_p03_digi_ya03v2__paused_at, psc_paused_at.ya_p03_digi_ya04v2__paused_at, psc_paused_at.ya_p03_digi_ya05v2__paused_at, ya_p03_ic_buccal_swab_proband, ya_p03_ic_urine_proband, ya_p03_ic_venous_blood_proband, ya_p03_ic_anam_qs, ya_p03_ic_aneurysm, ya_p03_ic_anthropometry, ya_p03_ic_arch_foot, ya_p03_ic_basic_qs, ya_p03_ic_blood_pressure, ya_p03_ic_braces_piercing_iud, ya_p03_ic_cognition_test, ya_p03_ic_da_health_registry, ya_p03_ic_dexa, ya_p03_ic_enviro_qs, ya_p03_ic_follow_up_studies, ya_p03_ic_fracture_lower_body_last_3m, ya_p03_ic_fracture_upper_body_last_3m, ya_p03_ic_hand_grip, ya_p03_ic_hearing_vision_impairment, ya_p03_ic_heart_disease, ya_p03_ic_hemoptysis_ns, ya_p03_ic_hernia, ya_p03_ic_hyperthyroidism, ya_p03_ic_inability_hold_pencil, ya_p03_ic_inability_stand_both_legs, ya_p03_ic_inability_talk_cze, ya_p03_ic_inability_walk, ya_p03_ic_inbody, ya_p03_ic_infectious_resp_diseases, ya_p03_ic_iodine_barium_radioisotopes_last_7d, ya_p03_ic_knee_stability, ya_p03_ic_nutri_qs, ya_p03_ic_over_weight_200_height_195, ya_p03_ic_pacemaker_defibrillator, ya_p03_ic_pneumothorax, ya_p03_ic_pregnancy, ya_p03_ic_recent_eye_abdominal_chest_surgery, ya_p03_ic_recent_myocardial_infarction, ya_p03_ic_spirometry, ya_p03_ic_surgical_metal_body, ya_p03_ic_unstable_angina_pectoris, ya_p03_ic_ya_dl_elspac, ya_p03_ic_ya_med_find, ya_p03_ic_ya_newsletter FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 21 -- Pilot ID );
Date: 2025-11-27 17:02:29 Duration: 2s352ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
4 2s853ms 10s415ms 6s634ms 2 13s269ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__20__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "dust_p01_tng_p11__role" text, "tng_p11__role" text, "tng_p11_monitor__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "dust_p01_tng_p11__state" text, "tng_p11__state" text, "tng_p11_monitor__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as activity ("subject_id" int, "dust_p01_tng_p11__activity_state" text, "tng_p11__activity_state" text, "tng_p11_monitor__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as created_at ("subject_id" int, "dust_p01_tng_p11__created_at" text, "tng_p11__created_at" text, "tng_p11_monitor__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "dust_p01_tng_p11__accepted_at" text, "tng_p11__accepted_at" text, "tng_p11_monitor__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "dust_p01_tng_p11__cancelled_at" text, "tng_p11__cancelled_at" text, "tng_p11_monitor__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "dust_p01_tng_p11__revoked_at" text, "tng_p11__revoked_at" text, "tng_p11_monitor__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as paused_at ("subject_id" int, "dust_p01_tng_p11__paused_at" text, "tng_p11__paused_at" text, "tng_p11_monitor__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "dust_p01_tng_p11_ic_dust_mother" text, "tng_p11_ic_buccal_swab_child" text, "tng_p11_ic_buccal_swab_mother" text, "tng_p11_ic_cord_blood_mother" text, "tng_p11_ic_drop_blood_child" text, "tng_p11_ic_stool_child" text, "tng_p11_ic_urine_mother" text, "tng_p11_ic_venous_blood_mother" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "dust_p01_tng_p11_ic_dl_celpac_studies" text, "dust_p01_tng_p11_ic_survey" text, "tng_p11_ic_celspac_newsletter" text, "tng_p11_ic_dl_celpac_studies" text, "tng_p11_ic_med_find" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.dust_p01_tng_p11__role, psc_role.tng_p11__role, psc_role.tng_p11_monitor__role, psc_state.dust_p01_tng_p11__state, psc_state.tng_p11__state, psc_state.tng_p11_monitor__state, psc_activity_state.dust_p01_tng_p11__activity_state, psc_activity_state.tng_p11__activity_state, psc_activity_state.tng_p11_monitor__activity_state, psc_created_at.dust_p01_tng_p11__created_at, psc_created_at.tng_p11__created_at, psc_created_at.tng_p11_monitor__created_at, psc_accepted_at.dust_p01_tng_p11__accepted_at, psc_accepted_at.tng_p11__accepted_at, psc_accepted_at.tng_p11_monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p11__cancelled_at, psc_cancelled_at.tng_p11__cancelled_at, psc_cancelled_at.tng_p11_monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p11__revoked_at, psc_revoked_at.tng_p11__revoked_at, psc_revoked_at.tng_p11_monitor__revoked_at, psc_paused_at.dust_p01_tng_p11__paused_at, psc_paused_at.tng_p11__paused_at, psc_paused_at.tng_p11_monitor__paused_at, dust_p01_tng_p11_ic_dust_mother, tng_p11_ic_buccal_swab_child, tng_p11_ic_buccal_swab_mother, tng_p11_ic_cord_blood_mother, tng_p11_ic_drop_blood_child, tng_p11_ic_stool_child, tng_p11_ic_urine_mother, tng_p11_ic_venous_blood_mother, dust_p01_tng_p11_ic_dl_celpac_studies, dust_p01_tng_p11_ic_survey, tng_p11_ic_celspac_newsletter, tng_p11_ic_dl_celpac_studies, tng_p11_ic_med_find from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #4
Day Hour Count Duration Avg duration Nov 27 05 1 10s415ms 10s415ms 17 1 2s853ms 2s853ms [ User: tng_migration_user - Total duration: 13s269ms - Times executed: 2 ]
[ Application: dbt - Total duration: 13s269ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__20"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__20__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: TNG, Pilot ID: 20 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p11__role" text, "tng_p11__role" text, "tng_p11_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p11__state" text, "tng_p11__state" text, "tng_p11_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p11__activity_state" text, "tng_p11__activity_state" text, "tng_p11_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p11__created_at" text, "tng_p11__created_at" text, "tng_p11_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p11__accepted_at" text, "tng_p11__accepted_at" text, "tng_p11_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p11__cancelled_at" text, "tng_p11__cancelled_at" text, "tng_p11_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p11__revoked_at" text, "tng_p11__revoked_at" text, "tng_p11_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p11__paused_at" text, "tng_p11__paused_at" text, "tng_p11_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11_ic_dust_mother'), ('tng_p11_ic_buccal_swab_child'), ('tng_p11_ic_buccal_swab_mother'), ('tng_p11_ic_cord_blood_mother'), ('tng_p11_ic_drop_blood_child'), ('tng_p11_ic_stool_child'), ('tng_p11_ic_urine_mother'), ('tng_p11_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p11_ic_dust_mother" text, "tng_p11_ic_buccal_swab_child" text, "tng_p11_ic_buccal_swab_mother" text, "tng_p11_ic_cord_blood_mother" text, "tng_p11_ic_drop_blood_child" text, "tng_p11_ic_stool_child" text, "tng_p11_ic_urine_mother" text, "tng_p11_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11_ic_dl_celpac_studies'), ('dust_p01_tng_p11_ic_survey'), ('tng_p11_ic_celspac_newsletter'), ('tng_p11_ic_dl_celpac_studies'), ('tng_p11_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p11_ic_dl_celpac_studies" text, "dust_p01_tng_p11_ic_survey" text, "tng_p11_ic_celspac_newsletter" text, "tng_p11_ic_dl_celpac_studies" text, "tng_p11_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p11__role, psc_role.tng_p11__role, psc_role.tng_p11_monitor__role, psc_state.dust_p01_tng_p11__state, psc_state.tng_p11__state, psc_state.tng_p11_monitor__state, psc_activity_state.dust_p01_tng_p11__activity_state, psc_activity_state.tng_p11__activity_state, psc_activity_state.tng_p11_monitor__activity_state, psc_created_at.dust_p01_tng_p11__created_at, psc_created_at.tng_p11__created_at, psc_created_at.tng_p11_monitor__created_at, psc_accepted_at.dust_p01_tng_p11__accepted_at, psc_accepted_at.tng_p11__accepted_at, psc_accepted_at.tng_p11_monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p11__cancelled_at, psc_cancelled_at.tng_p11__cancelled_at, psc_cancelled_at.tng_p11_monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p11__revoked_at, psc_revoked_at.tng_p11__revoked_at, psc_revoked_at.tng_p11_monitor__revoked_at, psc_paused_at.dust_p01_tng_p11__paused_at, psc_paused_at.tng_p11__paused_at, psc_paused_at.tng_p11_monitor__paused_at, dust_p01_tng_p11_ic_dust_mother, tng_p11_ic_buccal_swab_child, tng_p11_ic_buccal_swab_mother, tng_p11_ic_cord_blood_mother, tng_p11_ic_drop_blood_child, tng_p11_ic_stool_child, tng_p11_ic_urine_mother, tng_p11_ic_venous_blood_mother, dust_p01_tng_p11_ic_dl_celpac_studies, dust_p01_tng_p11_ic_survey, tng_p11_ic_celspac_newsletter, tng_p11_ic_dl_celpac_studies, tng_p11_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 20 -- Pilot ID );
Date: 2025-11-27 05:02:34 Duration: 10s415ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__20"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__20__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: TNG, Pilot ID: 20 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p11__role" text, "tng_p11__role" text, "tng_p11_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p11__state" text, "tng_p11__state" text, "tng_p11_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p11__activity_state" text, "tng_p11__activity_state" text, "tng_p11_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p11__created_at" text, "tng_p11__created_at" text, "tng_p11_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p11__accepted_at" text, "tng_p11__accepted_at" text, "tng_p11_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p11__cancelled_at" text, "tng_p11__cancelled_at" text, "tng_p11_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p11__revoked_at" text, "tng_p11__revoked_at" text, "tng_p11_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p11__paused_at" text, "tng_p11__paused_at" text, "tng_p11_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11_ic_dust_mother'), ('tng_p11_ic_buccal_swab_child'), ('tng_p11_ic_buccal_swab_mother'), ('tng_p11_ic_cord_blood_mother'), ('tng_p11_ic_drop_blood_child'), ('tng_p11_ic_stool_child'), ('tng_p11_ic_urine_mother'), ('tng_p11_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p11_ic_dust_mother" text, "tng_p11_ic_buccal_swab_child" text, "tng_p11_ic_buccal_swab_mother" text, "tng_p11_ic_cord_blood_mother" text, "tng_p11_ic_drop_blood_child" text, "tng_p11_ic_stool_child" text, "tng_p11_ic_urine_mother" text, "tng_p11_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11_ic_dl_celpac_studies'), ('dust_p01_tng_p11_ic_survey'), ('tng_p11_ic_celspac_newsletter'), ('tng_p11_ic_dl_celpac_studies'), ('tng_p11_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p11_ic_dl_celpac_studies" text, "dust_p01_tng_p11_ic_survey" text, "tng_p11_ic_celspac_newsletter" text, "tng_p11_ic_dl_celpac_studies" text, "tng_p11_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p11__role, psc_role.tng_p11__role, psc_role.tng_p11_monitor__role, psc_state.dust_p01_tng_p11__state, psc_state.tng_p11__state, psc_state.tng_p11_monitor__state, psc_activity_state.dust_p01_tng_p11__activity_state, psc_activity_state.tng_p11__activity_state, psc_activity_state.tng_p11_monitor__activity_state, psc_created_at.dust_p01_tng_p11__created_at, psc_created_at.tng_p11__created_at, psc_created_at.tng_p11_monitor__created_at, psc_accepted_at.dust_p01_tng_p11__accepted_at, psc_accepted_at.tng_p11__accepted_at, psc_accepted_at.tng_p11_monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p11__cancelled_at, psc_cancelled_at.tng_p11__cancelled_at, psc_cancelled_at.tng_p11_monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p11__revoked_at, psc_revoked_at.tng_p11__revoked_at, psc_revoked_at.tng_p11_monitor__revoked_at, psc_paused_at.dust_p01_tng_p11__paused_at, psc_paused_at.tng_p11__paused_at, psc_paused_at.tng_p11_monitor__paused_at, dust_p01_tng_p11_ic_dust_mother, tng_p11_ic_buccal_swab_child, tng_p11_ic_buccal_swab_mother, tng_p11_ic_cord_blood_mother, tng_p11_ic_drop_blood_child, tng_p11_ic_stool_child, tng_p11_ic_urine_mother, tng_p11_ic_venous_blood_mother, dust_p01_tng_p11_ic_dl_celpac_studies, dust_p01_tng_p11_ic_survey, tng_p11_ic_celspac_newsletter, tng_p11_ic_dl_celpac_studies, tng_p11_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 20 -- Pilot ID );
Date: 2025-11-27 17:02:30 Duration: 2s853ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
5 1s168ms 10s659ms 5s913ms 2 11s827ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__18__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as role ("subject_id" int, "hba_p01__role" text, "psycap_p01_hba_p01__role" text, "psycap_p02_new_hba_p01__role" text, "psycap_p02_old_hba_p01__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as role ("subject_id" int, "hba_p01__state" text, "psycap_p01_hba_p01__state" text, "psycap_p02_new_hba_p01__state" text, "psycap_p02_old_hba_p01__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as activity ("subject_id" int, "hba_p01__activity_state" text, "psycap_p01_hba_p01__activity_state" text, "psycap_p02_new_hba_p01__activity_state" text, "psycap_p02_old_hba_p01__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as created_at ("subject_id" int, "hba_p01__created_at" text, "psycap_p01_hba_p01__created_at" text, "psycap_p02_new_hba_p01__created_at" text, "psycap_p02_old_hba_p01__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "hba_p01__accepted_at" text, "psycap_p01_hba_p01__accepted_at" text, "psycap_p02_new_hba_p01__accepted_at" text, "psycap_p02_old_hba_p01__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "hba_p01__cancelled_at" text, "psycap_p01_hba_p01__cancelled_at" text, "psycap_p02_new_hba_p01__cancelled_at" text, "psycap_p02_old_hba_p01__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "hba_p01__revoked_at" text, "psycap_p01_hba_p01__revoked_at" text, "psycap_p02_new_hba_p01__revoked_at" text, "psycap_p02_old_hba_p01__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as paused_at ("subject_id" int, "hba_p01__paused_at" text, "psycap_p01_hba_p01__paused_at" text, "psycap_p02_new_hba_p01__paused_at" text, "psycap_p02_old_hba_p01__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as biomaterial_state ("subject_id" int, "hba_p01_ic_buccal_swab_proband" text, "hba_p01_ic_venous_blood_proband" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "hba_p01_ic_anthropometry" text, "hba_p01_ic_blood_pressure" text, "hba_p01_ic_da_health_registry" text, "hba_p01_ic_dl_elspac" text, "hba_p01_ic_dl_hba_future_studies" text, "hba_p01_ic_dl_tng" text, "hba_p01_ic_dl_tooth" text, "hba_p01_ic_dl_vulde" text, "hba_p01_ic_dl_ya" text, "hba_p01_ic_hba_med_find" text, "hba_p01_ic_hba_newsletter" text, "hba_p01_ic_mri" text, "hba_p01_ic_spirometry" text, "hba_p01_ic_survey" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.hba_p01__role, psc_role.psycap_p01_hba_p01__role, psc_role.psycap_p02_new_hba_p01__role, psc_role.psycap_p02_old_hba_p01__role, psc_state.hba_p01__state, psc_state.psycap_p01_hba_p01__state, psc_state.psycap_p02_new_hba_p01__state, psc_state.psycap_p02_old_hba_p01__state, psc_activity_state.hba_p01__activity_state, psc_activity_state.psycap_p01_hba_p01__activity_state, psc_activity_state.psycap_p02_new_hba_p01__activity_state, psc_activity_state.psycap_p02_old_hba_p01__activity_state, psc_created_at.hba_p01__created_at, psc_created_at.psycap_p01_hba_p01__created_at, psc_created_at.psycap_p02_new_hba_p01__created_at, psc_created_at.psycap_p02_old_hba_p01__created_at, psc_accepted_at.hba_p01__accepted_at, psc_accepted_at.psycap_p01_hba_p01__accepted_at, psc_accepted_at.psycap_p02_new_hba_p01__accepted_at, psc_accepted_at.psycap_p02_old_hba_p01__accepted_at, psc_cancelled_at.hba_p01__cancelled_at, psc_cancelled_at.psycap_p01_hba_p01__cancelled_at, psc_cancelled_at.psycap_p02_new_hba_p01__cancelled_at, psc_cancelled_at.psycap_p02_old_hba_p01__cancelled_at, psc_revoked_at.hba_p01__revoked_at, psc_revoked_at.psycap_p01_hba_p01__revoked_at, psc_revoked_at.psycap_p02_new_hba_p01__revoked_at, psc_revoked_at.psycap_p02_old_hba_p01__revoked_at, psc_paused_at.hba_p01__paused_at, psc_paused_at.psycap_p01_hba_p01__paused_at, psc_paused_at.psycap_p02_new_hba_p01__paused_at, psc_paused_at.psycap_p02_old_hba_p01__paused_at, hba_p01_ic_buccal_swab_proband, hba_p01_ic_venous_blood_proband, hba_p01_ic_anthropometry, hba_p01_ic_blood_pressure, hba_p01_ic_da_health_registry, hba_p01_ic_dl_elspac, hba_p01_ic_dl_hba_future_studies, hba_p01_ic_dl_tng, hba_p01_ic_dl_tooth, hba_p01_ic_dl_vulde, hba_p01_ic_dl_ya, hba_p01_ic_hba_med_find, hba_p01_ic_hba_newsletter, hba_p01_ic_mri, hba_p01_ic_spirometry, hba_p01_ic_survey from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #5
Day Hour Count Duration Avg duration Nov 27 05 1 10s659ms 10s659ms 17 1 1s168ms 1s168ms [ User: tng_migration_user - Total duration: 11s827ms - Times executed: 2 ]
[ Application: dbt - Total duration: 11s827ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__18"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__18__dbt_tmp" as ( -- suject (proband) patrici do kohorty HBA, Pilot ID: 18 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS role ("subject_id" int, "hba_p01__role" text, "psycap_p01_hba_p01__role" text, "psycap_p02_new_hba_p01__role" text, "psycap_p02_old_hba_p01__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS role ("subject_id" int, "hba_p01__state" text, "psycap_p01_hba_p01__state" text, "psycap_p02_new_hba_p01__state" text, "psycap_p02_old_hba_p01__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS activity ("subject_id" int, "hba_p01__activity_state" text, "psycap_p01_hba_p01__activity_state" text, "psycap_p02_new_hba_p01__activity_state" text, "psycap_p02_old_hba_p01__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS created_at ("subject_id" int, "hba_p01__created_at" text, "psycap_p01_hba_p01__created_at" text, "psycap_p02_new_hba_p01__created_at" text, "psycap_p02_old_hba_p01__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS accepted_at ("subject_id" int, "hba_p01__accepted_at" text, "psycap_p01_hba_p01__accepted_at" text, "psycap_p02_new_hba_p01__accepted_at" text, "psycap_p02_old_hba_p01__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS cancelled_at ("subject_id" int, "hba_p01__cancelled_at" text, "psycap_p01_hba_p01__cancelled_at" text, "psycap_p02_new_hba_p01__cancelled_at" text, "psycap_p02_old_hba_p01__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS revoked_at ("subject_id" int, "hba_p01__revoked_at" text, "psycap_p01_hba_p01__revoked_at" text, "psycap_p02_new_hba_p01__revoked_at" text, "psycap_p02_old_hba_p01__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS paused_at ("subject_id" int, "hba_p01__paused_at" text, "psycap_p01_hba_p01__paused_at" text, "psycap_p02_new_hba_p01__paused_at" text, "psycap_p02_old_hba_p01__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01_ic_buccal_swab_proband'), ('hba_p01_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "hba_p01_ic_buccal_swab_proband" text, "hba_p01_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01_ic_anthropometry'), ('hba_p01_ic_blood_pressure'), ('hba_p01_ic_da_health_registry'), ('hba_p01_ic_dl_elspac'), ('hba_p01_ic_dl_hba_future_studies'), ('hba_p01_ic_dl_tng'), ('hba_p01_ic_dl_tooth'), ('hba_p01_ic_dl_vulde'), ('hba_p01_ic_dl_ya'), ('hba_p01_ic_hba_med_find'), ('hba_p01_ic_hba_newsletter'), ('hba_p01_ic_mri'), ('hba_p01_ic_spirometry'), ('hba_p01_ic_survey') $$ ) AS extra_state ("subject_id" int, "hba_p01_ic_anthropometry" text, "hba_p01_ic_blood_pressure" text, "hba_p01_ic_da_health_registry" text, "hba_p01_ic_dl_elspac" text, "hba_p01_ic_dl_hba_future_studies" text, "hba_p01_ic_dl_tng" text, "hba_p01_ic_dl_tooth" text, "hba_p01_ic_dl_vulde" text, "hba_p01_ic_dl_ya" text, "hba_p01_ic_hba_med_find" text, "hba_p01_ic_hba_newsletter" text, "hba_p01_ic_mri" text, "hba_p01_ic_spirometry" text, "hba_p01_ic_survey" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.hba_p01__role, psc_role.psycap_p01_hba_p01__role, psc_role.psycap_p02_new_hba_p01__role, psc_role.psycap_p02_old_hba_p01__role, psc_state.hba_p01__state, psc_state.psycap_p01_hba_p01__state, psc_state.psycap_p02_new_hba_p01__state, psc_state.psycap_p02_old_hba_p01__state, psc_activity_state.hba_p01__activity_state, psc_activity_state.psycap_p01_hba_p01__activity_state, psc_activity_state.psycap_p02_new_hba_p01__activity_state, psc_activity_state.psycap_p02_old_hba_p01__activity_state, psc_created_at.hba_p01__created_at, psc_created_at.psycap_p01_hba_p01__created_at, psc_created_at.psycap_p02_new_hba_p01__created_at, psc_created_at.psycap_p02_old_hba_p01__created_at, psc_accepted_at.hba_p01__accepted_at, psc_accepted_at.psycap_p01_hba_p01__accepted_at, psc_accepted_at.psycap_p02_new_hba_p01__accepted_at, psc_accepted_at.psycap_p02_old_hba_p01__accepted_at, psc_cancelled_at.hba_p01__cancelled_at, psc_cancelled_at.psycap_p01_hba_p01__cancelled_at, psc_cancelled_at.psycap_p02_new_hba_p01__cancelled_at, psc_cancelled_at.psycap_p02_old_hba_p01__cancelled_at, psc_revoked_at.hba_p01__revoked_at, psc_revoked_at.psycap_p01_hba_p01__revoked_at, psc_revoked_at.psycap_p02_new_hba_p01__revoked_at, psc_revoked_at.psycap_p02_old_hba_p01__revoked_at, psc_paused_at.hba_p01__paused_at, psc_paused_at.psycap_p01_hba_p01__paused_at, psc_paused_at.psycap_p02_new_hba_p01__paused_at, psc_paused_at.psycap_p02_old_hba_p01__paused_at, hba_p01_ic_buccal_swab_proband, hba_p01_ic_venous_blood_proband, hba_p01_ic_anthropometry, hba_p01_ic_blood_pressure, hba_p01_ic_da_health_registry, hba_p01_ic_dl_elspac, hba_p01_ic_dl_hba_future_studies, hba_p01_ic_dl_tng, hba_p01_ic_dl_tooth, hba_p01_ic_dl_vulde, hba_p01_ic_dl_ya, hba_p01_ic_hba_med_find, hba_p01_ic_hba_newsletter, hba_p01_ic_mri, hba_p01_ic_spirometry, hba_p01_ic_survey FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 18 -- Pilot ID );
Date: 2025-11-27 05:02:34 Duration: 10s659ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__18"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__18__dbt_tmp" as ( -- suject (proband) patrici do kohorty HBA, Pilot ID: 18 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS role ("subject_id" int, "hba_p01__role" text, "psycap_p01_hba_p01__role" text, "psycap_p02_new_hba_p01__role" text, "psycap_p02_old_hba_p01__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS role ("subject_id" int, "hba_p01__state" text, "psycap_p01_hba_p01__state" text, "psycap_p02_new_hba_p01__state" text, "psycap_p02_old_hba_p01__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS activity ("subject_id" int, "hba_p01__activity_state" text, "psycap_p01_hba_p01__activity_state" text, "psycap_p02_new_hba_p01__activity_state" text, "psycap_p02_old_hba_p01__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS created_at ("subject_id" int, "hba_p01__created_at" text, "psycap_p01_hba_p01__created_at" text, "psycap_p02_new_hba_p01__created_at" text, "psycap_p02_old_hba_p01__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS accepted_at ("subject_id" int, "hba_p01__accepted_at" text, "psycap_p01_hba_p01__accepted_at" text, "psycap_p02_new_hba_p01__accepted_at" text, "psycap_p02_old_hba_p01__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS cancelled_at ("subject_id" int, "hba_p01__cancelled_at" text, "psycap_p01_hba_p01__cancelled_at" text, "psycap_p02_new_hba_p01__cancelled_at" text, "psycap_p02_old_hba_p01__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS revoked_at ("subject_id" int, "hba_p01__revoked_at" text, "psycap_p01_hba_p01__revoked_at" text, "psycap_p02_new_hba_p01__revoked_at" text, "psycap_p02_old_hba_p01__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01'), ('psycap_p01_hba_p01'), ('psycap_p02_new_hba_p01'), ('psycap_p02_old_hba_p01') $$ ) AS paused_at ("subject_id" int, "hba_p01__paused_at" text, "psycap_p01_hba_p01__paused_at" text, "psycap_p02_new_hba_p01__paused_at" text, "psycap_p02_old_hba_p01__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01_ic_buccal_swab_proband'), ('hba_p01_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "hba_p01_ic_buccal_swab_proband" text, "hba_p01_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 18 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hba_p01_ic_anthropometry'), ('hba_p01_ic_blood_pressure'), ('hba_p01_ic_da_health_registry'), ('hba_p01_ic_dl_elspac'), ('hba_p01_ic_dl_hba_future_studies'), ('hba_p01_ic_dl_tng'), ('hba_p01_ic_dl_tooth'), ('hba_p01_ic_dl_vulde'), ('hba_p01_ic_dl_ya'), ('hba_p01_ic_hba_med_find'), ('hba_p01_ic_hba_newsletter'), ('hba_p01_ic_mri'), ('hba_p01_ic_spirometry'), ('hba_p01_ic_survey') $$ ) AS extra_state ("subject_id" int, "hba_p01_ic_anthropometry" text, "hba_p01_ic_blood_pressure" text, "hba_p01_ic_da_health_registry" text, "hba_p01_ic_dl_elspac" text, "hba_p01_ic_dl_hba_future_studies" text, "hba_p01_ic_dl_tng" text, "hba_p01_ic_dl_tooth" text, "hba_p01_ic_dl_vulde" text, "hba_p01_ic_dl_ya" text, "hba_p01_ic_hba_med_find" text, "hba_p01_ic_hba_newsletter" text, "hba_p01_ic_mri" text, "hba_p01_ic_spirometry" text, "hba_p01_ic_survey" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.hba_p01__role, psc_role.psycap_p01_hba_p01__role, psc_role.psycap_p02_new_hba_p01__role, psc_role.psycap_p02_old_hba_p01__role, psc_state.hba_p01__state, psc_state.psycap_p01_hba_p01__state, psc_state.psycap_p02_new_hba_p01__state, psc_state.psycap_p02_old_hba_p01__state, psc_activity_state.hba_p01__activity_state, psc_activity_state.psycap_p01_hba_p01__activity_state, psc_activity_state.psycap_p02_new_hba_p01__activity_state, psc_activity_state.psycap_p02_old_hba_p01__activity_state, psc_created_at.hba_p01__created_at, psc_created_at.psycap_p01_hba_p01__created_at, psc_created_at.psycap_p02_new_hba_p01__created_at, psc_created_at.psycap_p02_old_hba_p01__created_at, psc_accepted_at.hba_p01__accepted_at, psc_accepted_at.psycap_p01_hba_p01__accepted_at, psc_accepted_at.psycap_p02_new_hba_p01__accepted_at, psc_accepted_at.psycap_p02_old_hba_p01__accepted_at, psc_cancelled_at.hba_p01__cancelled_at, psc_cancelled_at.psycap_p01_hba_p01__cancelled_at, psc_cancelled_at.psycap_p02_new_hba_p01__cancelled_at, psc_cancelled_at.psycap_p02_old_hba_p01__cancelled_at, psc_revoked_at.hba_p01__revoked_at, psc_revoked_at.psycap_p01_hba_p01__revoked_at, psc_revoked_at.psycap_p02_new_hba_p01__revoked_at, psc_revoked_at.psycap_p02_old_hba_p01__revoked_at, psc_paused_at.hba_p01__paused_at, psc_paused_at.psycap_p01_hba_p01__paused_at, psc_paused_at.psycap_p02_new_hba_p01__paused_at, psc_paused_at.psycap_p02_old_hba_p01__paused_at, hba_p01_ic_buccal_swab_proband, hba_p01_ic_venous_blood_proband, hba_p01_ic_anthropometry, hba_p01_ic_blood_pressure, hba_p01_ic_da_health_registry, hba_p01_ic_dl_elspac, hba_p01_ic_dl_hba_future_studies, hba_p01_ic_dl_tng, hba_p01_ic_dl_tooth, hba_p01_ic_dl_vulde, hba_p01_ic_dl_ya, hba_p01_ic_hba_med_find, hba_p01_ic_hba_newsletter, hba_p01_ic_mri, hba_p01_ic_spirometry, hba_p01_ic_survey FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 18 -- Pilot ID );
Date: 2025-11-27 17:02:26 Duration: 1s168ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
6 5s81ms 5s886ms 5s484ms 2 10s968ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__26__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "tng_p13__role" text, "tng_p13_monitor__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "tng_p13__state" text, "tng_p13_monitor__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as activity ("subject_id" int, "tng_p13__activity_state" text, "tng_p13_monitor__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as created_at ("subject_id" int, "tng_p13__created_at" text, "tng_p13_monitor__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as accepted_at ("subject_id" int, "tng_p13__accepted_at" text, "tng_p13_monitor__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as cancelled_at ("subject_id" int, "tng_p13__cancelled_at" text, "tng_p13_monitor__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as revoked_at ("subject_id" int, "tng_p13__revoked_at" text, "tng_p13_monitor__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as paused_at ("subject_id" int, "tng_p13__paused_at" text, "tng_p13_monitor__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "tng_p13_ic_buccal_swab_child" text, "tng_p13_ic_buccal_swab_mother" text, "tng_p13_ic_cord_blood_child" text, "tng_p13_ic_drop_blood_child" text, "tng_p13_ic_stool_child" text, "tng_p13_ic_urine_mother" text, "tng_p13_ic_venous_blood_mother" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as extra_state ("subject_id" int, "tng_p13_ic_celspac_newsletter" text, "tng_p13_ic_dl_celpac_studies" text, "tng_p13_ic_med_find" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.tng_p13__role, psc_role.tng_p13_monitor__role, psc_state.tng_p13__state, psc_state.tng_p13_monitor__state, psc_activity_state.tng_p13__activity_state, psc_activity_state.tng_p13_monitor__activity_state, psc_created_at.tng_p13__created_at, psc_created_at.tng_p13_monitor__created_at, psc_accepted_at.tng_p13__accepted_at, psc_accepted_at.tng_p13_monitor__accepted_at, psc_cancelled_at.tng_p13__cancelled_at, psc_cancelled_at.tng_p13_monitor__cancelled_at, psc_revoked_at.tng_p13__revoked_at, psc_revoked_at.tng_p13_monitor__revoked_at, psc_paused_at.tng_p13__paused_at, psc_paused_at.tng_p13_monitor__paused_at, tng_p13_ic_buccal_swab_child, tng_p13_ic_buccal_swab_mother, tng_p13_ic_cord_blood_child, tng_p13_ic_drop_blood_child, tng_p13_ic_stool_child, tng_p13_ic_urine_mother, tng_p13_ic_venous_blood_mother, tng_p13_ic_celspac_newsletter, tng_p13_ic_dl_celpac_studies, tng_p13_ic_med_find from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #6
Day Hour Count Duration Avg duration Nov 27 05 1 5s81ms 5s81ms 17 1 5s886ms 5s886ms [ User: tng_migration_user - Total duration: 10s968ms - Times executed: 2 ]
[ Application: dbt - Total duration: 10s968ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__26"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__26__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... TNG Pilot XIII, Pilot ID: 26 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS role ("subject_id" int, "tng_p13__role" text, "tng_p13_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS role ("subject_id" int, "tng_p13__state" text, "tng_p13_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS activity ("subject_id" int, "tng_p13__activity_state" text, "tng_p13_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS created_at ("subject_id" int, "tng_p13__created_at" text, "tng_p13_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p13__accepted_at" text, "tng_p13_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p13__cancelled_at" text, "tng_p13_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p13__revoked_at" text, "tng_p13_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS paused_at ("subject_id" int, "tng_p13__paused_at" text, "tng_p13_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13_ic_buccal_swab_child'), ('tng_p13_ic_buccal_swab_mother'), ('tng_p13_ic_cord_blood_child'), ('tng_p13_ic_drop_blood_child'), ('tng_p13_ic_stool_child'), ('tng_p13_ic_urine_mother'), ('tng_p13_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p13_ic_buccal_swab_child" text, "tng_p13_ic_buccal_swab_mother" text, "tng_p13_ic_cord_blood_child" text, "tng_p13_ic_drop_blood_child" text, "tng_p13_ic_stool_child" text, "tng_p13_ic_urine_mother" text, "tng_p13_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13_ic_celspac_newsletter'), ('tng_p13_ic_dl_celpac_studies'), ('tng_p13_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p13_ic_celspac_newsletter" text, "tng_p13_ic_dl_celpac_studies" text, "tng_p13_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p13__role, psc_role.tng_p13_monitor__role, psc_state.tng_p13__state, psc_state.tng_p13_monitor__state, psc_activity_state.tng_p13__activity_state, psc_activity_state.tng_p13_monitor__activity_state, psc_created_at.tng_p13__created_at, psc_created_at.tng_p13_monitor__created_at, psc_accepted_at.tng_p13__accepted_at, psc_accepted_at.tng_p13_monitor__accepted_at, psc_cancelled_at.tng_p13__cancelled_at, psc_cancelled_at.tng_p13_monitor__cancelled_at, psc_revoked_at.tng_p13__revoked_at, psc_revoked_at.tng_p13_monitor__revoked_at, psc_paused_at.tng_p13__paused_at, psc_paused_at.tng_p13_monitor__paused_at, tng_p13_ic_buccal_swab_child, tng_p13_ic_buccal_swab_mother, tng_p13_ic_cord_blood_child, tng_p13_ic_drop_blood_child, tng_p13_ic_stool_child, tng_p13_ic_urine_mother, tng_p13_ic_venous_blood_mother, tng_p13_ic_celspac_newsletter, tng_p13_ic_dl_celpac_studies, tng_p13_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 26 -- Pilot ID );
Date: 2025-11-27 17:02:37 Duration: 5s886ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__26"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__26__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... TNG Pilot XIII, Pilot ID: 26 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS role ("subject_id" int, "tng_p13__role" text, "tng_p13_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS role ("subject_id" int, "tng_p13__state" text, "tng_p13_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS activity ("subject_id" int, "tng_p13__activity_state" text, "tng_p13_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS created_at ("subject_id" int, "tng_p13__created_at" text, "tng_p13_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p13__accepted_at" text, "tng_p13_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p13__cancelled_at" text, "tng_p13_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p13__revoked_at" text, "tng_p13_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS paused_at ("subject_id" int, "tng_p13__paused_at" text, "tng_p13_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13_ic_buccal_swab_child'), ('tng_p13_ic_buccal_swab_mother'), ('tng_p13_ic_cord_blood_child'), ('tng_p13_ic_drop_blood_child'), ('tng_p13_ic_stool_child'), ('tng_p13_ic_urine_mother'), ('tng_p13_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p13_ic_buccal_swab_child" text, "tng_p13_ic_buccal_swab_mother" text, "tng_p13_ic_cord_blood_child" text, "tng_p13_ic_drop_blood_child" text, "tng_p13_ic_stool_child" text, "tng_p13_ic_urine_mother" text, "tng_p13_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13_ic_celspac_newsletter'), ('tng_p13_ic_dl_celpac_studies'), ('tng_p13_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p13_ic_celspac_newsletter" text, "tng_p13_ic_dl_celpac_studies" text, "tng_p13_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p13__role, psc_role.tng_p13_monitor__role, psc_state.tng_p13__state, psc_state.tng_p13_monitor__state, psc_activity_state.tng_p13__activity_state, psc_activity_state.tng_p13_monitor__activity_state, psc_created_at.tng_p13__created_at, psc_created_at.tng_p13_monitor__created_at, psc_accepted_at.tng_p13__accepted_at, psc_accepted_at.tng_p13_monitor__accepted_at, psc_cancelled_at.tng_p13__cancelled_at, psc_cancelled_at.tng_p13_monitor__cancelled_at, psc_revoked_at.tng_p13__revoked_at, psc_revoked_at.tng_p13_monitor__revoked_at, psc_paused_at.tng_p13__paused_at, psc_paused_at.tng_p13_monitor__paused_at, tng_p13_ic_buccal_swab_child, tng_p13_ic_buccal_swab_mother, tng_p13_ic_cord_blood_child, tng_p13_ic_drop_blood_child, tng_p13_ic_stool_child, tng_p13_ic_urine_mother, tng_p13_ic_venous_blood_mother, tng_p13_ic_celspac_newsletter, tng_p13_ic_dl_celpac_studies, tng_p13_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 26 -- Pilot ID );
Date: 2025-11-27 05:02:34 Duration: 5s81ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
7 4s907ms 5s602ms 5s254ms 2 10s509ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__27__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as role ("subject_id" int, "hapiee_p02__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as role ("subject_id" int, "hapiee_p02__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as activity ("subject_id" int, "hapiee_p02__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as created_at ("subject_id" int, "hapiee_p02__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as accepted_at ("subject_id" int, "hapiee_p02__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as cancelled_at ("subject_id" int, "hapiee_p02__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as revoked_at ("subject_id" int, "hapiee_p02__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as paused_at ("subject_id" int, "hapiee_p02__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as biomaterial_state ("subject_id" int, "hapiee_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "hapiee_p02_ic_dl_hapiee" text, "hapiee_p02_ic_dl_statistics" text, "hapiee_p02_ic_examination" text, "hapiee_p02_ic_health_qs" text, "hapiee_p02_ic_samples_storage" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.hapiee_p02__role, psc_state.hapiee_p02__state, psc_activity_state.hapiee_p02__activity_state, psc_created_at.hapiee_p02__created_at, psc_accepted_at.hapiee_p02__accepted_at, psc_cancelled_at.hapiee_p02__cancelled_at, psc_revoked_at.hapiee_p02__revoked_at, psc_paused_at.hapiee_p02__paused_at, hapiee_p02_ic_venous_blood_proband, hapiee_p02_ic_dl_hapiee, hapiee_p02_ic_dl_statistics, hapiee_p02_ic_examination, hapiee_p02_ic_health_qs, hapiee_p02_ic_samples_storage from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #7
Day Hour Count Duration Avg duration Nov 27 05 1 4s907ms 4s907ms 17 1 5s602ms 5s602ms [ User: tng_migration_user - Total duration: 10s509ms - Times executed: 2 ]
[ Application: dbt - Total duration: 10s509ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__27"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__27__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... HAPIEE Pilot II, Pilot ID: 27 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS activity ("subject_id" int, "hapiee_p02__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS created_at ("subject_id" int, "hapiee_p02__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS accepted_at ("subject_id" int, "hapiee_p02__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS cancelled_at ("subject_id" int, "hapiee_p02__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS revoked_at ("subject_id" int, "hapiee_p02__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS paused_at ("subject_id" int, "hapiee_p02__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "hapiee_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_dl_hapiee'), ('hapiee_p02_ic_dl_statistics'), ('hapiee_p02_ic_examination'), ('hapiee_p02_ic_health_qs'), ('hapiee_p02_ic_samples_storage') $$ ) AS extra_state ("subject_id" int, "hapiee_p02_ic_dl_hapiee" text, "hapiee_p02_ic_dl_statistics" text, "hapiee_p02_ic_examination" text, "hapiee_p02_ic_health_qs" text, "hapiee_p02_ic_samples_storage" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.hapiee_p02__role, psc_state.hapiee_p02__state, psc_activity_state.hapiee_p02__activity_state, psc_created_at.hapiee_p02__created_at, psc_accepted_at.hapiee_p02__accepted_at, psc_cancelled_at.hapiee_p02__cancelled_at, psc_revoked_at.hapiee_p02__revoked_at, psc_paused_at.hapiee_p02__paused_at, hapiee_p02_ic_venous_blood_proband, hapiee_p02_ic_dl_hapiee, hapiee_p02_ic_dl_statistics, hapiee_p02_ic_examination, hapiee_p02_ic_health_qs, hapiee_p02_ic_samples_storage FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 27 -- Pilot ID );
Date: 2025-11-27 17:02:37 Duration: 5s602ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__27"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__27__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... HAPIEE Pilot II, Pilot ID: 27 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS activity ("subject_id" int, "hapiee_p02__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS created_at ("subject_id" int, "hapiee_p02__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS accepted_at ("subject_id" int, "hapiee_p02__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS cancelled_at ("subject_id" int, "hapiee_p02__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS revoked_at ("subject_id" int, "hapiee_p02__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS paused_at ("subject_id" int, "hapiee_p02__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "hapiee_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_dl_hapiee'), ('hapiee_p02_ic_dl_statistics'), ('hapiee_p02_ic_examination'), ('hapiee_p02_ic_health_qs'), ('hapiee_p02_ic_samples_storage') $$ ) AS extra_state ("subject_id" int, "hapiee_p02_ic_dl_hapiee" text, "hapiee_p02_ic_dl_statistics" text, "hapiee_p02_ic_examination" text, "hapiee_p02_ic_health_qs" text, "hapiee_p02_ic_samples_storage" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.hapiee_p02__role, psc_state.hapiee_p02__state, psc_activity_state.hapiee_p02__activity_state, psc_created_at.hapiee_p02__created_at, psc_accepted_at.hapiee_p02__accepted_at, psc_cancelled_at.hapiee_p02__cancelled_at, psc_revoked_at.hapiee_p02__revoked_at, psc_paused_at.hapiee_p02__paused_at, hapiee_p02_ic_venous_blood_proband, hapiee_p02_ic_dl_hapiee, hapiee_p02_ic_dl_statistics, hapiee_p02_ic_examination, hapiee_p02_ic_health_qs, hapiee_p02_ic_samples_storage FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 27 -- Pilot ID );
Date: 2025-11-27 05:02:34 Duration: 4s907ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
8 2s399ms 3s62ms 2s731ms 2 5s462ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__17__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as role ("subject_id" int, "dust_p01_tng_p10__role" text, "tng__monitor__role" text, "tng_p10__role" text, "tng_p10_test_tp__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as role ("subject_id" int, "dust_p01_tng_p10__state" text, "tng__monitor__state" text, "tng_p10__state" text, "tng_p10_test_tp__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as activity ("subject_id" int, "dust_p01_tng_p10__activity_state" text, "tng__monitor__activity_state" text, "tng_p10__activity_state" text, "tng_p10_test_tp__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as created_at ("subject_id" int, "dust_p01_tng_p10__created_at" text, "tng__monitor__created_at" text, "tng_p10__created_at" text, "tng_p10_test_tp__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "dust_p01_tng_p10__accepted_at" text, "tng__monitor__accepted_at" text, "tng_p10__accepted_at" text, "tng_p10_test_tp__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "dust_p01_tng_p10__cancelled_at" text, "tng__monitor__cancelled_at" text, "tng_p10__cancelled_at" text, "tng_p10_test_tp__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "dust_p01_tng_p10__revoked_at" text, "tng__monitor__revoked_at" text, "tng_p10__revoked_at" text, "tng_p10_test_tp__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as paused_at ("subject_id" int, "dust_p01_tng_p10__paused_at" text, "tng__monitor__paused_at" text, "tng_p10__paused_at" text, "tng_p10_test_tp__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "dust_p01_tng_p10_ic_dust_mother" text, "tng_p10_ic_buccal_swab_child" text, "tng_p10_ic_buccal_swab_mother" text, "tng_p10_ic_cord_blood_mother" text, "tng_p10_ic_drop_blood_child" text, "tng_p10_ic_stool_child" text, "tng_p10_ic_urine_mother" text, "tng_p10_ic_venous_blood_mother" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "dust_p01_tng_p10_ic_dl_celpac_studies" text, "dust_p01_tng_p10_ic_survey" text, "tng_p10_ic_follow_up_studies" text, "tng_p10_ic_med_find" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.dust_p01_tng_p10__role, psc_role.tng__monitor__role, psc_role.tng_p10__role, psc_role.tng_p10_test_tp__role, psc_state.dust_p01_tng_p10__state, psc_state.tng__monitor__state, psc_state.tng_p10__state, psc_state.tng_p10_test_tp__state, psc_activity_state.dust_p01_tng_p10__activity_state, psc_activity_state.tng__monitor__activity_state, psc_activity_state.tng_p10__activity_state, psc_activity_state.tng_p10_test_tp__activity_state, psc_created_at.dust_p01_tng_p10__created_at, psc_created_at.tng__monitor__created_at, psc_created_at.tng_p10__created_at, psc_created_at.tng_p10_test_tp__created_at, psc_accepted_at.dust_p01_tng_p10__accepted_at, psc_accepted_at.tng__monitor__accepted_at, psc_accepted_at.tng_p10__accepted_at, psc_accepted_at.tng_p10_test_tp__accepted_at, psc_cancelled_at.dust_p01_tng_p10__cancelled_at, psc_cancelled_at.tng__monitor__cancelled_at, psc_cancelled_at.tng_p10__cancelled_at, psc_cancelled_at.tng_p10_test_tp__cancelled_at, psc_revoked_at.dust_p01_tng_p10__revoked_at, psc_revoked_at.tng__monitor__revoked_at, psc_revoked_at.tng_p10__revoked_at, psc_revoked_at.tng_p10_test_tp__revoked_at, psc_paused_at.dust_p01_tng_p10__paused_at, psc_paused_at.tng__monitor__paused_at, psc_paused_at.tng_p10__paused_at, psc_paused_at.tng_p10_test_tp__paused_at, dust_p01_tng_p10_ic_dust_mother, tng_p10_ic_buccal_swab_child, tng_p10_ic_buccal_swab_mother, tng_p10_ic_cord_blood_mother, tng_p10_ic_drop_blood_child, tng_p10_ic_stool_child, tng_p10_ic_urine_mother, tng_p10_ic_venous_blood_mother, dust_p01_tng_p10_ic_dl_celpac_studies, dust_p01_tng_p10_ic_survey, tng_p10_ic_follow_up_studies, tng_p10_ic_med_find from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #8
Day Hour Count Duration Avg duration Nov 27 05 1 2s399ms 2s399ms 17 1 3s62ms 3s62ms [ User: tng_migration_user - Total duration: 5s462ms - Times executed: 2 ]
[ Application: dbt - Total duration: 5s462ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__17"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__17__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot X, Pilot ID: 17 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__role" text, "tng__monitor__role" text, "tng_p10__role" text, "tng_p10_test_tp__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__state" text, "tng__monitor__state" text, "tng_p10__state" text, "tng_p10_test_tp__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p10__activity_state" text, "tng__monitor__activity_state" text, "tng_p10__activity_state" text, "tng_p10_test_tp__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p10__created_at" text, "tng__monitor__created_at" text, "tng_p10__created_at" text, "tng_p10_test_tp__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p10__accepted_at" text, "tng__monitor__accepted_at" text, "tng_p10__accepted_at" text, "tng_p10_test_tp__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p10__cancelled_at" text, "tng__monitor__cancelled_at" text, "tng_p10__cancelled_at" text, "tng_p10_test_tp__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p10__revoked_at" text, "tng__monitor__revoked_at" text, "tng_p10__revoked_at" text, "tng_p10_test_tp__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p10__paused_at" text, "tng__monitor__paused_at" text, "tng_p10__paused_at" text, "tng_p10_test_tp__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dust_mother'), ('tng_p10_ic_buccal_swab_child'), ('tng_p10_ic_buccal_swab_mother'), ('tng_p10_ic_cord_blood_mother'), ('tng_p10_ic_drop_blood_child'), ('tng_p10_ic_stool_child'), ('tng_p10_ic_urine_mother'), ('tng_p10_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p10_ic_dust_mother" text, "tng_p10_ic_buccal_swab_child" text, "tng_p10_ic_buccal_swab_mother" text, "tng_p10_ic_cord_blood_mother" text, "tng_p10_ic_drop_blood_child" text, "tng_p10_ic_stool_child" text, "tng_p10_ic_urine_mother" text, "tng_p10_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dl_celpac_studies'), ('dust_p01_tng_p10_ic_survey'), ('tng_p10_ic_follow_up_studies'), ('tng_p10_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p10_ic_dl_celpac_studies" text, "dust_p01_tng_p10_ic_survey" text, "tng_p10_ic_follow_up_studies" text, "tng_p10_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p10__role, psc_role.tng__monitor__role, psc_role.tng_p10__role, psc_role.tng_p10_test_tp__role, psc_state.dust_p01_tng_p10__state, psc_state.tng__monitor__state, psc_state.tng_p10__state, psc_state.tng_p10_test_tp__state, psc_activity_state.dust_p01_tng_p10__activity_state, psc_activity_state.tng__monitor__activity_state, psc_activity_state.tng_p10__activity_state, psc_activity_state.tng_p10_test_tp__activity_state, psc_created_at.dust_p01_tng_p10__created_at, psc_created_at.tng__monitor__created_at, psc_created_at.tng_p10__created_at, psc_created_at.tng_p10_test_tp__created_at, psc_accepted_at.dust_p01_tng_p10__accepted_at, psc_accepted_at.tng__monitor__accepted_at, psc_accepted_at.tng_p10__accepted_at, psc_accepted_at.tng_p10_test_tp__accepted_at, psc_cancelled_at.dust_p01_tng_p10__cancelled_at, psc_cancelled_at.tng__monitor__cancelled_at, psc_cancelled_at.tng_p10__cancelled_at, psc_cancelled_at.tng_p10_test_tp__cancelled_at, psc_revoked_at.dust_p01_tng_p10__revoked_at, psc_revoked_at.tng__monitor__revoked_at, psc_revoked_at.tng_p10__revoked_at, psc_revoked_at.tng_p10_test_tp__revoked_at, psc_paused_at.dust_p01_tng_p10__paused_at, psc_paused_at.tng__monitor__paused_at, psc_paused_at.tng_p10__paused_at, psc_paused_at.tng_p10_test_tp__paused_at, dust_p01_tng_p10_ic_dust_mother, tng_p10_ic_buccal_swab_child, tng_p10_ic_buccal_swab_mother, tng_p10_ic_cord_blood_mother, tng_p10_ic_drop_blood_child, tng_p10_ic_stool_child, tng_p10_ic_urine_mother, tng_p10_ic_venous_blood_mother, dust_p01_tng_p10_ic_dl_celpac_studies, dust_p01_tng_p10_ic_survey, tng_p10_ic_follow_up_studies, tng_p10_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 17 -- Pilot ID );
Date: 2025-11-27 17:02:27 Duration: 3s62ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__17"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__17__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot X, Pilot ID: 17 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__role" text, "tng__monitor__role" text, "tng_p10__role" text, "tng_p10_test_tp__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__state" text, "tng__monitor__state" text, "tng_p10__state" text, "tng_p10_test_tp__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p10__activity_state" text, "tng__monitor__activity_state" text, "tng_p10__activity_state" text, "tng_p10_test_tp__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p10__created_at" text, "tng__monitor__created_at" text, "tng_p10__created_at" text, "tng_p10_test_tp__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p10__accepted_at" text, "tng__monitor__accepted_at" text, "tng_p10__accepted_at" text, "tng_p10_test_tp__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p10__cancelled_at" text, "tng__monitor__cancelled_at" text, "tng_p10__cancelled_at" text, "tng_p10_test_tp__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p10__revoked_at" text, "tng__monitor__revoked_at" text, "tng_p10__revoked_at" text, "tng_p10_test_tp__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p10__paused_at" text, "tng__monitor__paused_at" text, "tng_p10__paused_at" text, "tng_p10_test_tp__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dust_mother'), ('tng_p10_ic_buccal_swab_child'), ('tng_p10_ic_buccal_swab_mother'), ('tng_p10_ic_cord_blood_mother'), ('tng_p10_ic_drop_blood_child'), ('tng_p10_ic_stool_child'), ('tng_p10_ic_urine_mother'), ('tng_p10_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p10_ic_dust_mother" text, "tng_p10_ic_buccal_swab_child" text, "tng_p10_ic_buccal_swab_mother" text, "tng_p10_ic_cord_blood_mother" text, "tng_p10_ic_drop_blood_child" text, "tng_p10_ic_stool_child" text, "tng_p10_ic_urine_mother" text, "tng_p10_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dl_celpac_studies'), ('dust_p01_tng_p10_ic_survey'), ('tng_p10_ic_follow_up_studies'), ('tng_p10_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p10_ic_dl_celpac_studies" text, "dust_p01_tng_p10_ic_survey" text, "tng_p10_ic_follow_up_studies" text, "tng_p10_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p10__role, psc_role.tng__monitor__role, psc_role.tng_p10__role, psc_role.tng_p10_test_tp__role, psc_state.dust_p01_tng_p10__state, psc_state.tng__monitor__state, psc_state.tng_p10__state, psc_state.tng_p10_test_tp__state, psc_activity_state.dust_p01_tng_p10__activity_state, psc_activity_state.tng__monitor__activity_state, psc_activity_state.tng_p10__activity_state, psc_activity_state.tng_p10_test_tp__activity_state, psc_created_at.dust_p01_tng_p10__created_at, psc_created_at.tng__monitor__created_at, psc_created_at.tng_p10__created_at, psc_created_at.tng_p10_test_tp__created_at, psc_accepted_at.dust_p01_tng_p10__accepted_at, psc_accepted_at.tng__monitor__accepted_at, psc_accepted_at.tng_p10__accepted_at, psc_accepted_at.tng_p10_test_tp__accepted_at, psc_cancelled_at.dust_p01_tng_p10__cancelled_at, psc_cancelled_at.tng__monitor__cancelled_at, psc_cancelled_at.tng_p10__cancelled_at, psc_cancelled_at.tng_p10_test_tp__cancelled_at, psc_revoked_at.dust_p01_tng_p10__revoked_at, psc_revoked_at.tng__monitor__revoked_at, psc_revoked_at.tng_p10__revoked_at, psc_revoked_at.tng_p10_test_tp__revoked_at, psc_paused_at.dust_p01_tng_p10__paused_at, psc_paused_at.tng__monitor__paused_at, psc_paused_at.tng_p10__paused_at, psc_paused_at.tng_p10_test_tp__paused_at, dust_p01_tng_p10_ic_dust_mother, tng_p10_ic_buccal_swab_child, tng_p10_ic_buccal_swab_mother, tng_p10_ic_cord_blood_mother, tng_p10_ic_drop_blood_child, tng_p10_ic_stool_child, tng_p10_ic_urine_mother, tng_p10_ic_venous_blood_mother, dust_p01_tng_p10_ic_dl_celpac_studies, dust_p01_tng_p10_ic_survey, tng_p10_ic_follow_up_studies, tng_p10_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 17 -- Pilot ID );
Date: 2025-11-27 05:02:24 Duration: 2s399ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
9 1s684ms 2s424ms 2s54ms 2 4s109ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__22__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "tng_p12__role" text, "tng_p12_monitor__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "tng_p12__state" text, "tng_p12_monitor__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as activity ("subject_id" int, "tng_p12__activity_state" text, "tng_p12_monitor__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as created_at ("subject_id" int, "tng_p12__created_at" text, "tng_p12_monitor__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as accepted_at ("subject_id" int, "tng_p12__accepted_at" text, "tng_p12_monitor__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as cancelled_at ("subject_id" int, "tng_p12__cancelled_at" text, "tng_p12_monitor__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as revoked_at ("subject_id" int, "tng_p12__revoked_at" text, "tng_p12_monitor__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as paused_at ("subject_id" int, "tng_p12__paused_at" text, "tng_p12_monitor__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "tng_p12_ic_buccal_swab_child" text, "tng_p12_ic_buccal_swab_mother" text, "tng_p12_ic_cord_blood_mother" text, "tng_p12_ic_drop_blood_child" text, "tng_p12_ic_stool_child" text, "tng_p12_ic_urine_mother" text, "tng_p12_ic_venous_blood_mother" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as extra_state ("subject_id" int, "tng_p12_ic_celspac_newsletter" text, "tng_p12_ic_dl_celpac_studies" text, "tng_p12_ic_med_find" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.tng_p12__role, psc_role.tng_p12_monitor__role, psc_state.tng_p12__state, psc_state.tng_p12_monitor__state, psc_activity_state.tng_p12__activity_state, psc_activity_state.tng_p12_monitor__activity_state, psc_created_at.tng_p12__created_at, psc_created_at.tng_p12_monitor__created_at, psc_accepted_at.tng_p12__accepted_at, psc_accepted_at.tng_p12_monitor__accepted_at, psc_cancelled_at.tng_p12__cancelled_at, psc_cancelled_at.tng_p12_monitor__cancelled_at, psc_revoked_at.tng_p12__revoked_at, psc_revoked_at.tng_p12_monitor__revoked_at, psc_paused_at.tng_p12__paused_at, psc_paused_at.tng_p12_monitor__paused_at, tng_p12_ic_buccal_swab_child, tng_p12_ic_buccal_swab_mother, tng_p12_ic_cord_blood_mother, tng_p12_ic_drop_blood_child, tng_p12_ic_stool_child, tng_p12_ic_urine_mother, tng_p12_ic_venous_blood_mother, tng_p12_ic_celspac_newsletter, tng_p12_ic_dl_celpac_studies, tng_p12_ic_med_find from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #9
Day Hour Count Duration Avg duration Nov 27 05 1 1s684ms 1s684ms 17 1 2s424ms 2s424ms [ User: tng_migration_user - Total duration: 4s109ms - Times executed: 2 ]
[ Application: dbt - Total duration: 4s109ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__22"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__22__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: TNG (nabor od 29.4.2022), Pilot ID: 22 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS role ("subject_id" int, "tng_p12__role" text, "tng_p12_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS role ("subject_id" int, "tng_p12__state" text, "tng_p12_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS activity ("subject_id" int, "tng_p12__activity_state" text, "tng_p12_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS created_at ("subject_id" int, "tng_p12__created_at" text, "tng_p12_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p12__accepted_at" text, "tng_p12_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p12__cancelled_at" text, "tng_p12_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p12__revoked_at" text, "tng_p12_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS paused_at ("subject_id" int, "tng_p12__paused_at" text, "tng_p12_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12_ic_buccal_swab_child'), ('tng_p12_ic_buccal_swab_mother'), ('tng_p12_ic_cord_blood_mother'), ('tng_p12_ic_drop_blood_child'), ('tng_p12_ic_stool_child'), ('tng_p12_ic_urine_mother'), ('tng_p12_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p12_ic_buccal_swab_child" text, "tng_p12_ic_buccal_swab_mother" text, "tng_p12_ic_cord_blood_mother" text, "tng_p12_ic_drop_blood_child" text, "tng_p12_ic_stool_child" text, "tng_p12_ic_urine_mother" text, "tng_p12_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12_ic_celspac_newsletter'), ('tng_p12_ic_dl_celpac_studies'), ('tng_p12_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p12_ic_celspac_newsletter" text, "tng_p12_ic_dl_celpac_studies" text, "tng_p12_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p12__role, psc_role.tng_p12_monitor__role, psc_state.tng_p12__state, psc_state.tng_p12_monitor__state, psc_activity_state.tng_p12__activity_state, psc_activity_state.tng_p12_monitor__activity_state, psc_created_at.tng_p12__created_at, psc_created_at.tng_p12_monitor__created_at, psc_accepted_at.tng_p12__accepted_at, psc_accepted_at.tng_p12_monitor__accepted_at, psc_cancelled_at.tng_p12__cancelled_at, psc_cancelled_at.tng_p12_monitor__cancelled_at, psc_revoked_at.tng_p12__revoked_at, psc_revoked_at.tng_p12_monitor__revoked_at, psc_paused_at.tng_p12__paused_at, psc_paused_at.tng_p12_monitor__paused_at, tng_p12_ic_buccal_swab_child, tng_p12_ic_buccal_swab_mother, tng_p12_ic_cord_blood_mother, tng_p12_ic_drop_blood_child, tng_p12_ic_stool_child, tng_p12_ic_urine_mother, tng_p12_ic_venous_blood_mother, tng_p12_ic_celspac_newsletter, tng_p12_ic_dl_celpac_studies, tng_p12_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 22 -- Pilot ID );
Date: 2025-11-27 17:02:29 Duration: 2s424ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__22"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__22__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: TNG (nabor od 29.4.2022), Pilot ID: 22 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS role ("subject_id" int, "tng_p12__role" text, "tng_p12_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS role ("subject_id" int, "tng_p12__state" text, "tng_p12_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS activity ("subject_id" int, "tng_p12__activity_state" text, "tng_p12_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS created_at ("subject_id" int, "tng_p12__created_at" text, "tng_p12_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p12__accepted_at" text, "tng_p12_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p12__cancelled_at" text, "tng_p12_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p12__revoked_at" text, "tng_p12_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS paused_at ("subject_id" int, "tng_p12__paused_at" text, "tng_p12_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12_ic_buccal_swab_child'), ('tng_p12_ic_buccal_swab_mother'), ('tng_p12_ic_cord_blood_mother'), ('tng_p12_ic_drop_blood_child'), ('tng_p12_ic_stool_child'), ('tng_p12_ic_urine_mother'), ('tng_p12_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p12_ic_buccal_swab_child" text, "tng_p12_ic_buccal_swab_mother" text, "tng_p12_ic_cord_blood_mother" text, "tng_p12_ic_drop_blood_child" text, "tng_p12_ic_stool_child" text, "tng_p12_ic_urine_mother" text, "tng_p12_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12_ic_celspac_newsletter'), ('tng_p12_ic_dl_celpac_studies'), ('tng_p12_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p12_ic_celspac_newsletter" text, "tng_p12_ic_dl_celpac_studies" text, "tng_p12_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p12__role, psc_role.tng_p12_monitor__role, psc_state.tng_p12__state, psc_state.tng_p12_monitor__state, psc_activity_state.tng_p12__activity_state, psc_activity_state.tng_p12_monitor__activity_state, psc_created_at.tng_p12__created_at, psc_created_at.tng_p12_monitor__created_at, psc_accepted_at.tng_p12__accepted_at, psc_accepted_at.tng_p12_monitor__accepted_at, psc_cancelled_at.tng_p12__cancelled_at, psc_cancelled_at.tng_p12_monitor__cancelled_at, psc_revoked_at.tng_p12__revoked_at, psc_revoked_at.tng_p12_monitor__revoked_at, psc_paused_at.tng_p12__paused_at, psc_paused_at.tng_p12_monitor__paused_at, tng_p12_ic_buccal_swab_child, tng_p12_ic_buccal_swab_mother, tng_p12_ic_cord_blood_mother, tng_p12_ic_drop_blood_child, tng_p12_ic_stool_child, tng_p12_ic_urine_mother, tng_p12_ic_venous_blood_mother, tng_p12_ic_celspac_newsletter, tng_p12_ic_dl_celpac_studies, tng_p12_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 22 -- Pilot ID );
Date: 2025-11-27 05:02:25 Duration: 1s684ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
10 1s541ms 2s165ms 1s853ms 2 3s707ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__11__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "dust_p01_tng_p09__role" text, "tng_p09__role" text, "tng_pilot_9__form_fix_2019_06__role" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__role" text, "tng_pilot_9__monitor__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "dust_p01_tng_p09__state" text, "tng_p09__state" text, "tng_pilot_9__form_fix_2019_06__state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__state" text, "tng_pilot_9__monitor__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as activity ("subject_id" int, "dust_p01_tng_p09__activity_state" text, "tng_p09__activity_state" text, "tng_pilot_9__form_fix_2019_06__activity_state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state" text, "tng_pilot_9__monitor__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as created_at ("subject_id" int, "dust_p01_tng_p09__created_at" text, "tng_p09__created_at" text, "tng_pilot_9__form_fix_2019_06__created_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__created_at" text, "tng_pilot_9__monitor__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "dust_p01_tng_p09__accepted_at" text, "tng_p09__accepted_at" text, "tng_pilot_9__form_fix_2019_06__accepted_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at" text, "tng_pilot_9__monitor__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "dust_p01_tng_p09__cancelled_at" text, "tng_p09__cancelled_at" text, "tng_pilot_9__form_fix_2019_06__cancelled_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at" text, "tng_pilot_9__monitor__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "dust_p01_tng_p09__revoked_at" text, "tng_p09__revoked_at" text, "tng_pilot_9__form_fix_2019_06__revoked_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at" text, "tng_pilot_9__monitor__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as paused_at ("subject_id" int, "dust_p01_tng_p09__paused_at" text, "tng_p09__paused_at" text, "tng_pilot_9__form_fix_2019_06__paused_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at" text, "tng_pilot_9__monitor__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "dust_p01_tng_p09_ic_dust_mother" text, "tng_p09_ic_buccal_swab_child" text, "tng_p09_ic_buccal_swab_mother" text, "tng_p09_ic_cord_blood_mother" text, "tng_p09_ic_drop_blood_child" text, "tng_p09_ic_stool_child" text, "tng_p09_ic_urine_mother" text, "tng_p09_ic_venous_blood_mother" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "dust_p01_tng_p09_ic_dl_celpac_studies" text, "dust_p01_tng_p09_ic_survey" text, "tng_p09_ic_follow_up_studies" text, "tng_p09_ic_med_find" text, "tng_pilot_9__monitor_ic_follow_up_studies" text, "tng_pilot_9__monitor_ic_med_find" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.dust_p01_tng_p09__role, psc_role.tng_p09__role, psc_role.tng_pilot_9__form_fix_2019_06__role, psc_role.tng_pilot_9__form_fix_mm38p01_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p02_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p03_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p04_v2_v2__role, psc_role.tng_pilot_9__monitor__role, psc_state.dust_p01_tng_p09__state, psc_state.tng_p09__state, psc_state.tng_pilot_9__form_fix_2019_06__state, psc_state.tng_pilot_9__form_fix_mm38p01_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p02_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p03_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p04_v2_v2__state, psc_state.tng_pilot_9__monitor__state, psc_activity_state.dust_p01_tng_p09__activity_state, psc_activity_state.tng_p09__activity_state, psc_activity_state.tng_pilot_9__form_fix_2019_06__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state, psc_activity_state.tng_pilot_9__monitor__activity_state, psc_created_at.dust_p01_tng_p09__created_at, psc_created_at.tng_p09__created_at, psc_created_at.tng_pilot_9__form_fix_2019_06__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p01_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p02_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p03_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p04_v2_v2__created_at, psc_created_at.tng_pilot_9__monitor__created_at, psc_accepted_at.dust_p01_tng_p09__accepted_at, psc_accepted_at.tng_p09__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_2019_06__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p09__cancelled_at, psc_cancelled_at.tng_p09__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_2019_06__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p09__revoked_at, psc_revoked_at.tng_p09__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_2019_06__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__monitor__revoked_at, psc_paused_at.dust_p01_tng_p09__paused_at, psc_paused_at.tng_p09__paused_at, psc_paused_at.tng_pilot_9__form_fix_2019_06__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at, psc_paused_at.tng_pilot_9__monitor__paused_at, dust_p01_tng_p09_ic_dust_mother, tng_p09_ic_buccal_swab_child, tng_p09_ic_buccal_swab_mother, tng_p09_ic_cord_blood_mother, tng_p09_ic_drop_blood_child, tng_p09_ic_stool_child, tng_p09_ic_urine_mother, tng_p09_ic_venous_blood_mother, dust_p01_tng_p09_ic_dl_celpac_studies, dust_p01_tng_p09_ic_survey, tng_p09_ic_follow_up_studies, tng_p09_ic_med_find, tng_pilot_9__monitor_ic_follow_up_studies, tng_pilot_9__monitor_ic_med_find from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #10
Day Hour Count Duration Avg duration Nov 27 05 1 1s541ms 1s541ms 17 1 2s165ms 2s165ms [ User: tng_migration_user - Total duration: 3s707ms - Times executed: 2 ]
[ Application: dbt - Total duration: 3s707ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__11"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__11__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot IX, Pilot ID: 11 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p09__role" text, "tng_p09__role" text, "tng_pilot_9__form_fix_2019_06__role" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__role" text, "tng_pilot_9__monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p09__state" text, "tng_p09__state" text, "tng_pilot_9__form_fix_2019_06__state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__state" text, "tng_pilot_9__monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p09__activity_state" text, "tng_p09__activity_state" text, "tng_pilot_9__form_fix_2019_06__activity_state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state" text, "tng_pilot_9__monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p09__created_at" text, "tng_p09__created_at" text, "tng_pilot_9__form_fix_2019_06__created_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__created_at" text, "tng_pilot_9__monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p09__accepted_at" text, "tng_p09__accepted_at" text, "tng_pilot_9__form_fix_2019_06__accepted_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at" text, "tng_pilot_9__monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p09__cancelled_at" text, "tng_p09__cancelled_at" text, "tng_pilot_9__form_fix_2019_06__cancelled_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at" text, "tng_pilot_9__monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p09__revoked_at" text, "tng_p09__revoked_at" text, "tng_pilot_9__form_fix_2019_06__revoked_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at" text, "tng_pilot_9__monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p09__paused_at" text, "tng_p09__paused_at" text, "tng_pilot_9__form_fix_2019_06__paused_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at" text, "tng_pilot_9__monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09_ic_dust_mother'), ('tng_p09_ic_buccal_swab_child'), ('tng_p09_ic_buccal_swab_mother'), ('tng_p09_ic_cord_blood_mother'), ('tng_p09_ic_drop_blood_child'), ('tng_p09_ic_stool_child'), ('tng_p09_ic_urine_mother'), ('tng_p09_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p09_ic_dust_mother" text, "tng_p09_ic_buccal_swab_child" text, "tng_p09_ic_buccal_swab_mother" text, "tng_p09_ic_cord_blood_mother" text, "tng_p09_ic_drop_blood_child" text, "tng_p09_ic_stool_child" text, "tng_p09_ic_urine_mother" text, "tng_p09_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09_ic_dl_celpac_studies'), ('dust_p01_tng_p09_ic_survey'), ('tng_p09_ic_follow_up_studies'), ('tng_p09_ic_med_find'), ('tng_pilot_9__monitor_ic_follow_up_studies'), ('tng_pilot_9__monitor_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p09_ic_dl_celpac_studies" text, "dust_p01_tng_p09_ic_survey" text, "tng_p09_ic_follow_up_studies" text, "tng_p09_ic_med_find" text, "tng_pilot_9__monitor_ic_follow_up_studies" text, "tng_pilot_9__monitor_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p09__role, psc_role.tng_p09__role, psc_role.tng_pilot_9__form_fix_2019_06__role, psc_role.tng_pilot_9__form_fix_mm38p01_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p02_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p03_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p04_v2_v2__role, psc_role.tng_pilot_9__monitor__role, psc_state.dust_p01_tng_p09__state, psc_state.tng_p09__state, psc_state.tng_pilot_9__form_fix_2019_06__state, psc_state.tng_pilot_9__form_fix_mm38p01_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p02_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p03_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p04_v2_v2__state, psc_state.tng_pilot_9__monitor__state, psc_activity_state.dust_p01_tng_p09__activity_state, psc_activity_state.tng_p09__activity_state, psc_activity_state.tng_pilot_9__form_fix_2019_06__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state, psc_activity_state.tng_pilot_9__monitor__activity_state, psc_created_at.dust_p01_tng_p09__created_at, psc_created_at.tng_p09__created_at, psc_created_at.tng_pilot_9__form_fix_2019_06__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p01_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p02_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p03_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p04_v2_v2__created_at, psc_created_at.tng_pilot_9__monitor__created_at, psc_accepted_at.dust_p01_tng_p09__accepted_at, psc_accepted_at.tng_p09__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_2019_06__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p09__cancelled_at, psc_cancelled_at.tng_p09__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_2019_06__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p09__revoked_at, psc_revoked_at.tng_p09__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_2019_06__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__monitor__revoked_at, psc_paused_at.dust_p01_tng_p09__paused_at, psc_paused_at.tng_p09__paused_at, psc_paused_at.tng_pilot_9__form_fix_2019_06__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at, psc_paused_at.tng_pilot_9__monitor__paused_at, dust_p01_tng_p09_ic_dust_mother, tng_p09_ic_buccal_swab_child, tng_p09_ic_buccal_swab_mother, tng_p09_ic_cord_blood_mother, tng_p09_ic_drop_blood_child, tng_p09_ic_stool_child, tng_p09_ic_urine_mother, tng_p09_ic_venous_blood_mother, dust_p01_tng_p09_ic_dl_celpac_studies, dust_p01_tng_p09_ic_survey, tng_p09_ic_follow_up_studies, tng_p09_ic_med_find, tng_pilot_9__monitor_ic_follow_up_studies, tng_pilot_9__monitor_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 11 -- Pilot ID );
Date: 2025-11-27 17:02:24 Duration: 2s165ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__11"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__11__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot IX, Pilot ID: 11 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p09__role" text, "tng_p09__role" text, "tng_pilot_9__form_fix_2019_06__role" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__role" text, "tng_pilot_9__monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p09__state" text, "tng_p09__state" text, "tng_pilot_9__form_fix_2019_06__state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__state" text, "tng_pilot_9__monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p09__activity_state" text, "tng_p09__activity_state" text, "tng_pilot_9__form_fix_2019_06__activity_state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state" text, "tng_pilot_9__monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p09__created_at" text, "tng_p09__created_at" text, "tng_pilot_9__form_fix_2019_06__created_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__created_at" text, "tng_pilot_9__monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p09__accepted_at" text, "tng_p09__accepted_at" text, "tng_pilot_9__form_fix_2019_06__accepted_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at" text, "tng_pilot_9__monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p09__cancelled_at" text, "tng_p09__cancelled_at" text, "tng_pilot_9__form_fix_2019_06__cancelled_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at" text, "tng_pilot_9__monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p09__revoked_at" text, "tng_p09__revoked_at" text, "tng_pilot_9__form_fix_2019_06__revoked_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at" text, "tng_pilot_9__monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p09__paused_at" text, "tng_p09__paused_at" text, "tng_pilot_9__form_fix_2019_06__paused_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at" text, "tng_pilot_9__monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09_ic_dust_mother'), ('tng_p09_ic_buccal_swab_child'), ('tng_p09_ic_buccal_swab_mother'), ('tng_p09_ic_cord_blood_mother'), ('tng_p09_ic_drop_blood_child'), ('tng_p09_ic_stool_child'), ('tng_p09_ic_urine_mother'), ('tng_p09_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p09_ic_dust_mother" text, "tng_p09_ic_buccal_swab_child" text, "tng_p09_ic_buccal_swab_mother" text, "tng_p09_ic_cord_blood_mother" text, "tng_p09_ic_drop_blood_child" text, "tng_p09_ic_stool_child" text, "tng_p09_ic_urine_mother" text, "tng_p09_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09_ic_dl_celpac_studies'), ('dust_p01_tng_p09_ic_survey'), ('tng_p09_ic_follow_up_studies'), ('tng_p09_ic_med_find'), ('tng_pilot_9__monitor_ic_follow_up_studies'), ('tng_pilot_9__monitor_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p09_ic_dl_celpac_studies" text, "dust_p01_tng_p09_ic_survey" text, "tng_p09_ic_follow_up_studies" text, "tng_p09_ic_med_find" text, "tng_pilot_9__monitor_ic_follow_up_studies" text, "tng_pilot_9__monitor_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p09__role, psc_role.tng_p09__role, psc_role.tng_pilot_9__form_fix_2019_06__role, psc_role.tng_pilot_9__form_fix_mm38p01_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p02_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p03_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p04_v2_v2__role, psc_role.tng_pilot_9__monitor__role, psc_state.dust_p01_tng_p09__state, psc_state.tng_p09__state, psc_state.tng_pilot_9__form_fix_2019_06__state, psc_state.tng_pilot_9__form_fix_mm38p01_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p02_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p03_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p04_v2_v2__state, psc_state.tng_pilot_9__monitor__state, psc_activity_state.dust_p01_tng_p09__activity_state, psc_activity_state.tng_p09__activity_state, psc_activity_state.tng_pilot_9__form_fix_2019_06__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state, psc_activity_state.tng_pilot_9__monitor__activity_state, psc_created_at.dust_p01_tng_p09__created_at, psc_created_at.tng_p09__created_at, psc_created_at.tng_pilot_9__form_fix_2019_06__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p01_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p02_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p03_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p04_v2_v2__created_at, psc_created_at.tng_pilot_9__monitor__created_at, psc_accepted_at.dust_p01_tng_p09__accepted_at, psc_accepted_at.tng_p09__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_2019_06__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p09__cancelled_at, psc_cancelled_at.tng_p09__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_2019_06__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p09__revoked_at, psc_revoked_at.tng_p09__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_2019_06__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__monitor__revoked_at, psc_paused_at.dust_p01_tng_p09__paused_at, psc_paused_at.tng_p09__paused_at, psc_paused_at.tng_pilot_9__form_fix_2019_06__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at, psc_paused_at.tng_pilot_9__monitor__paused_at, dust_p01_tng_p09_ic_dust_mother, tng_p09_ic_buccal_swab_child, tng_p09_ic_buccal_swab_mother, tng_p09_ic_cord_blood_mother, tng_p09_ic_drop_blood_child, tng_p09_ic_stool_child, tng_p09_ic_urine_mother, tng_p09_ic_venous_blood_mother, dust_p01_tng_p09_ic_dl_celpac_studies, dust_p01_tng_p09_ic_survey, tng_p09_ic_follow_up_studies, tng_p09_ic_med_find, tng_pilot_9__monitor_ic_follow_up_studies, tng_pilot_9__monitor_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 11 -- Pilot ID );
Date: 2025-11-27 05:02:22 Duration: 1s541ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
11 1s396ms 1s917ms 1s656ms 2 3s313ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__15__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "psycap_p01_ya_p02__role" text, "psycap_p02_old_ya_p02__role" text, "ya_p02__role" text, "ya_p02_digi_ya03v2__role" text, "ya_p02_digi_ya04v2__role" text, "ya_p02_digi_ya05v2__role" text, "ya_p02_test__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "psycap_p01_ya_p02__state" text, "psycap_p02_old_ya_p02__state" text, "ya_p02__state" text, "ya_p02_digi_ya03v2__state" text, "ya_p02_digi_ya04v2__state" text, "ya_p02_digi_ya05v2__state" text, "ya_p02_test__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as activity ("subject_id" int, "psycap_p01_ya_p02__activity_state" text, "psycap_p02_old_ya_p02__activity_state" text, "ya_p02__activity_state" text, "ya_p02_digi_ya03v2__activity_state" text, "ya_p02_digi_ya04v2__activity_state" text, "ya_p02_digi_ya05v2__activity_state" text, "ya_p02_test__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as created_at ("subject_id" int, "psycap_p01_ya_p02__created_at" text, "psycap_p02_old_ya_p02__created_at" text, "ya_p02__created_at" text, "ya_p02_digi_ya03v2__created_at" text, "ya_p02_digi_ya04v2__created_at" text, "ya_p02_digi_ya05v2__created_at" text, "ya_p02_test__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "psycap_p01_ya_p02__accepted_at" text, "psycap_p02_old_ya_p02__accepted_at" text, "ya_p02__accepted_at" text, "ya_p02_digi_ya03v2__accepted_at" text, "ya_p02_digi_ya04v2__accepted_at" text, "ya_p02_digi_ya05v2__accepted_at" text, "ya_p02_test__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "psycap_p01_ya_p02__cancelled_at" text, "psycap_p02_old_ya_p02__cancelled_at" text, "ya_p02__cancelled_at" text, "ya_p02_digi_ya03v2__cancelled_at" text, "ya_p02_digi_ya04v2__cancelled_at" text, "ya_p02_digi_ya05v2__cancelled_at" text, "ya_p02_test__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "psycap_p01_ya_p02__revoked_at" text, "psycap_p02_old_ya_p02__revoked_at" text, "ya_p02__revoked_at" text, "ya_p02_digi_ya03v2__revoked_at" text, "ya_p02_digi_ya04v2__revoked_at" text, "ya_p02_digi_ya05v2__revoked_at" text, "ya_p02_test__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as paused_at ("subject_id" int, "psycap_p01_ya_p02__paused_at" text, "psycap_p02_old_ya_p02__paused_at" text, "ya_p02__paused_at" text, "ya_p02_digi_ya03v2__paused_at" text, "ya_p02_digi_ya04v2__paused_at" text, "ya_p02_digi_ya05v2__paused_at" text, "ya_p02_test__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "ya_p02_ic_buccal_swab_proband" text, "ya_p02_ic_urine_proband" text, "ya_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "ya_p02_ic_anam_qs" text, "ya_p02_ic_aneurysm" text, "ya_p02_ic_anthropometry" text, "ya_p02_ic_arch_foot" text, "ya_p02_ic_basic_qs" text, "ya_p02_ic_blood_pressure" text, "ya_p02_ic_braces_piercing_iud" text, "ya_p02_ic_cognition_test" text, "ya_p02_ic_da_health_registry" text, "ya_p02_ic_dexa" text, "ya_p02_ic_enviro_qs" text, "ya_p02_ic_follow_up_studies" text, "ya_p02_ic_fracture_lower_body_last_3m" text, "ya_p02_ic_fracture_upper_body_last_3m" text, "ya_p02_ic_hand_grip" text, "ya_p02_ic_hearing_vision_impairment" text, "ya_p02_ic_heart_disease" text, "ya_p02_ic_hemoptysis_ns" text, "ya_p02_ic_hernia" text, "ya_p02_ic_hyperthyroidism" text, "ya_p02_ic_inability_hold_pencil" text, "ya_p02_ic_inability_stand_both_legs" text, "ya_p02_ic_inability_talk_cze" text, "ya_p02_ic_inability_walk" text, "ya_p02_ic_inbody" text, "ya_p02_ic_infectious_resp_diseases" text, "ya_p02_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p02_ic_knee_stability" text, "ya_p02_ic_nutri_qs" text, "ya_p02_ic_over_weight_200_height_195" text, "ya_p02_ic_pacemaker_defibrillator" text, "ya_p02_ic_pneumothorax" text, "ya_p02_ic_pregnancy" text, "ya_p02_ic_recent_eye_abdominal_chest_surgery" text, "ya_p02_ic_recent_myocardial_infarction" text, "ya_p02_ic_spirometry" text, "ya_p02_ic_surgical_metal_body" text, "ya_p02_ic_unstable_angina_pectoris" text, "ya_p02_ic_ya_dl_elspac" text, "ya_p02_ic_ya_med_find" text, "ya_p02_ic_ya_newsletter" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.psycap_p01_ya_p02__role, psc_role.psycap_p02_old_ya_p02__role, psc_role.ya_p02__role, psc_role.ya_p02_digi_ya03v2__role, psc_role.ya_p02_digi_ya04v2__role, psc_role.ya_p02_digi_ya05v2__role, psc_role.ya_p02_test__role, psc_state.psycap_p01_ya_p02__state, psc_state.psycap_p02_old_ya_p02__state, psc_state.ya_p02__state, psc_state.ya_p02_digi_ya03v2__state, psc_state.ya_p02_digi_ya04v2__state, psc_state.ya_p02_digi_ya05v2__state, psc_state.ya_p02_test__state, psc_activity_state.psycap_p01_ya_p02__activity_state, psc_activity_state.psycap_p02_old_ya_p02__activity_state, psc_activity_state.ya_p02__activity_state, psc_activity_state.ya_p02_digi_ya03v2__activity_state, psc_activity_state.ya_p02_digi_ya04v2__activity_state, psc_activity_state.ya_p02_digi_ya05v2__activity_state, psc_activity_state.ya_p02_test__activity_state, psc_created_at.psycap_p01_ya_p02__created_at, psc_created_at.psycap_p02_old_ya_p02__created_at, psc_created_at.ya_p02__created_at, psc_created_at.ya_p02_digi_ya03v2__created_at, psc_created_at.ya_p02_digi_ya04v2__created_at, psc_created_at.ya_p02_digi_ya05v2__created_at, psc_created_at.ya_p02_test__created_at, psc_accepted_at.psycap_p01_ya_p02__accepted_at, psc_accepted_at.psycap_p02_old_ya_p02__accepted_at, psc_accepted_at.ya_p02__accepted_at, psc_accepted_at.ya_p02_digi_ya03v2__accepted_at, psc_accepted_at.ya_p02_digi_ya04v2__accepted_at, psc_accepted_at.ya_p02_digi_ya05v2__accepted_at, psc_accepted_at.ya_p02_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p02__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p02__cancelled_at, psc_cancelled_at.ya_p02__cancelled_at, psc_cancelled_at.ya_p02_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p02_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p02__revoked_at, psc_revoked_at.psycap_p02_old_ya_p02__revoked_at, psc_revoked_at.ya_p02__revoked_at, psc_revoked_at.ya_p02_digi_ya03v2__revoked_at, psc_revoked_at.ya_p02_digi_ya04v2__revoked_at, psc_revoked_at.ya_p02_digi_ya05v2__revoked_at, psc_revoked_at.ya_p02_test__revoked_at, psc_paused_at.psycap_p01_ya_p02__paused_at, psc_paused_at.psycap_p02_old_ya_p02__paused_at, psc_paused_at.ya_p02__paused_at, psc_paused_at.ya_p02_digi_ya03v2__paused_at, psc_paused_at.ya_p02_digi_ya04v2__paused_at, psc_paused_at.ya_p02_digi_ya05v2__paused_at, psc_paused_at.ya_p02_test__paused_at, ya_p02_ic_buccal_swab_proband, ya_p02_ic_urine_proband, ya_p02_ic_venous_blood_proband, ya_p02_ic_anam_qs, ya_p02_ic_aneurysm, ya_p02_ic_anthropometry, ya_p02_ic_arch_foot, ya_p02_ic_basic_qs, ya_p02_ic_blood_pressure, ya_p02_ic_braces_piercing_iud, ya_p02_ic_cognition_test, ya_p02_ic_da_health_registry, ya_p02_ic_dexa, ya_p02_ic_enviro_qs, ya_p02_ic_follow_up_studies, ya_p02_ic_fracture_lower_body_last_3m, ya_p02_ic_fracture_upper_body_last_3m, ya_p02_ic_hand_grip, ya_p02_ic_hearing_vision_impairment, ya_p02_ic_heart_disease, ya_p02_ic_hemoptysis_ns, ya_p02_ic_hernia, ya_p02_ic_hyperthyroidism, ya_p02_ic_inability_hold_pencil, ya_p02_ic_inability_stand_both_legs, ya_p02_ic_inability_talk_cze, ya_p02_ic_inability_walk, ya_p02_ic_inbody, ya_p02_ic_infectious_resp_diseases, ya_p02_ic_iodine_barium_radioisotopes_last_7d, ya_p02_ic_knee_stability, ya_p02_ic_nutri_qs, ya_p02_ic_over_weight_200_height_195, ya_p02_ic_pacemaker_defibrillator, ya_p02_ic_pneumothorax, ya_p02_ic_pregnancy, ya_p02_ic_recent_eye_abdominal_chest_surgery, ya_p02_ic_recent_myocardial_infarction, ya_p02_ic_spirometry, ya_p02_ic_surgical_metal_body, ya_p02_ic_unstable_angina_pectoris, ya_p02_ic_ya_dl_elspac, ya_p02_ic_ya_med_find, ya_p02_ic_ya_newsletter from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #11
Day Hour Count Duration Avg duration Nov 27 05 1 1s396ms 1s396ms 17 1 1s917ms 1s917ms [ User: tng_migration_user - Total duration: 3s313ms - Times executed: 2 ]
[ Application: dbt - Total duration: 3s313ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__15"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__15__dbt_tmp" as ( -- suject (proband) patrici do kohorty YA, Pilot ID: 15 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p02__role" text, "psycap_p02_old_ya_p02__role" text, "ya_p02__role" text, "ya_p02_digi_ya03v2__role" text, "ya_p02_digi_ya04v2__role" text, "ya_p02_digi_ya05v2__role" text, "ya_p02_test__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p02__state" text, "psycap_p02_old_ya_p02__state" text, "ya_p02__state" text, "ya_p02_digi_ya03v2__state" text, "ya_p02_digi_ya04v2__state" text, "ya_p02_digi_ya05v2__state" text, "ya_p02_test__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p02__activity_state" text, "psycap_p02_old_ya_p02__activity_state" text, "ya_p02__activity_state" text, "ya_p02_digi_ya03v2__activity_state" text, "ya_p02_digi_ya04v2__activity_state" text, "ya_p02_digi_ya05v2__activity_state" text, "ya_p02_test__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p02__created_at" text, "psycap_p02_old_ya_p02__created_at" text, "ya_p02__created_at" text, "ya_p02_digi_ya03v2__created_at" text, "ya_p02_digi_ya04v2__created_at" text, "ya_p02_digi_ya05v2__created_at" text, "ya_p02_test__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p02__accepted_at" text, "psycap_p02_old_ya_p02__accepted_at" text, "ya_p02__accepted_at" text, "ya_p02_digi_ya03v2__accepted_at" text, "ya_p02_digi_ya04v2__accepted_at" text, "ya_p02_digi_ya05v2__accepted_at" text, "ya_p02_test__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p02__cancelled_at" text, "psycap_p02_old_ya_p02__cancelled_at" text, "ya_p02__cancelled_at" text, "ya_p02_digi_ya03v2__cancelled_at" text, "ya_p02_digi_ya04v2__cancelled_at" text, "ya_p02_digi_ya05v2__cancelled_at" text, "ya_p02_test__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p02__revoked_at" text, "psycap_p02_old_ya_p02__revoked_at" text, "ya_p02__revoked_at" text, "ya_p02_digi_ya03v2__revoked_at" text, "ya_p02_digi_ya04v2__revoked_at" text, "ya_p02_digi_ya05v2__revoked_at" text, "ya_p02_test__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p02__paused_at" text, "psycap_p02_old_ya_p02__paused_at" text, "ya_p02__paused_at" text, "ya_p02_digi_ya03v2__paused_at" text, "ya_p02_digi_ya04v2__paused_at" text, "ya_p02_digi_ya05v2__paused_at" text, "ya_p02_test__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p02_ic_buccal_swab_proband'), ('ya_p02_ic_urine_proband'), ('ya_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p02_ic_buccal_swab_proband" text, "ya_p02_ic_urine_proband" text, "ya_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p02_ic_anam_qs'), ('ya_p02_ic_aneurysm'), ('ya_p02_ic_anthropometry'), ('ya_p02_ic_arch_foot'), ('ya_p02_ic_basic_qs'), ('ya_p02_ic_blood_pressure'), ('ya_p02_ic_braces_piercing_iud'), ('ya_p02_ic_cognition_test'), ('ya_p02_ic_da_health_registry'), ('ya_p02_ic_dexa'), ('ya_p02_ic_enviro_qs'), ('ya_p02_ic_follow_up_studies'), ('ya_p02_ic_fracture_lower_body_last_3m'), ('ya_p02_ic_fracture_upper_body_last_3m'), ('ya_p02_ic_hand_grip'), ('ya_p02_ic_hearing_vision_impairment'), ('ya_p02_ic_heart_disease'), ('ya_p02_ic_hemoptysis_ns'), ('ya_p02_ic_hernia'), ('ya_p02_ic_hyperthyroidism'), ('ya_p02_ic_inability_hold_pencil'), ('ya_p02_ic_inability_stand_both_legs'), ('ya_p02_ic_inability_talk_cze'), ('ya_p02_ic_inability_walk'), ('ya_p02_ic_inbody'), ('ya_p02_ic_infectious_resp_diseases'), ('ya_p02_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p02_ic_knee_stability'), ('ya_p02_ic_nutri_qs'), ('ya_p02_ic_over_weight_200_height_195'), ('ya_p02_ic_pacemaker_defibrillator'), ('ya_p02_ic_pneumothorax'), ('ya_p02_ic_pregnancy'), ('ya_p02_ic_recent_eye_abdominal_chest_surgery'), ('ya_p02_ic_recent_myocardial_infarction'), ('ya_p02_ic_spirometry'), ('ya_p02_ic_surgical_metal_body'), ('ya_p02_ic_unstable_angina_pectoris'), ('ya_p02_ic_ya_dl_elspac'), ('ya_p02_ic_ya_med_find'), ('ya_p02_ic_ya_newsletter') $$ ) AS extra_state ("subject_id" int, "ya_p02_ic_anam_qs" text, "ya_p02_ic_aneurysm" text, "ya_p02_ic_anthropometry" text, "ya_p02_ic_arch_foot" text, "ya_p02_ic_basic_qs" text, "ya_p02_ic_blood_pressure" text, "ya_p02_ic_braces_piercing_iud" text, "ya_p02_ic_cognition_test" text, "ya_p02_ic_da_health_registry" text, "ya_p02_ic_dexa" text, "ya_p02_ic_enviro_qs" text, "ya_p02_ic_follow_up_studies" text, "ya_p02_ic_fracture_lower_body_last_3m" text, "ya_p02_ic_fracture_upper_body_last_3m" text, "ya_p02_ic_hand_grip" text, "ya_p02_ic_hearing_vision_impairment" text, "ya_p02_ic_heart_disease" text, "ya_p02_ic_hemoptysis_ns" text, "ya_p02_ic_hernia" text, "ya_p02_ic_hyperthyroidism" text, "ya_p02_ic_inability_hold_pencil" text, "ya_p02_ic_inability_stand_both_legs" text, "ya_p02_ic_inability_talk_cze" text, "ya_p02_ic_inability_walk" text, "ya_p02_ic_inbody" text, "ya_p02_ic_infectious_resp_diseases" text, "ya_p02_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p02_ic_knee_stability" text, "ya_p02_ic_nutri_qs" text, "ya_p02_ic_over_weight_200_height_195" text, "ya_p02_ic_pacemaker_defibrillator" text, "ya_p02_ic_pneumothorax" text, "ya_p02_ic_pregnancy" text, "ya_p02_ic_recent_eye_abdominal_chest_surgery" text, "ya_p02_ic_recent_myocardial_infarction" text, "ya_p02_ic_spirometry" text, "ya_p02_ic_surgical_metal_body" text, "ya_p02_ic_unstable_angina_pectoris" text, "ya_p02_ic_ya_dl_elspac" text, "ya_p02_ic_ya_med_find" text, "ya_p02_ic_ya_newsletter" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p02__role, psc_role.psycap_p02_old_ya_p02__role, psc_role.ya_p02__role, psc_role.ya_p02_digi_ya03v2__role, psc_role.ya_p02_digi_ya04v2__role, psc_role.ya_p02_digi_ya05v2__role, psc_role.ya_p02_test__role, psc_state.psycap_p01_ya_p02__state, psc_state.psycap_p02_old_ya_p02__state, psc_state.ya_p02__state, psc_state.ya_p02_digi_ya03v2__state, psc_state.ya_p02_digi_ya04v2__state, psc_state.ya_p02_digi_ya05v2__state, psc_state.ya_p02_test__state, psc_activity_state.psycap_p01_ya_p02__activity_state, psc_activity_state.psycap_p02_old_ya_p02__activity_state, psc_activity_state.ya_p02__activity_state, psc_activity_state.ya_p02_digi_ya03v2__activity_state, psc_activity_state.ya_p02_digi_ya04v2__activity_state, psc_activity_state.ya_p02_digi_ya05v2__activity_state, psc_activity_state.ya_p02_test__activity_state, psc_created_at.psycap_p01_ya_p02__created_at, psc_created_at.psycap_p02_old_ya_p02__created_at, psc_created_at.ya_p02__created_at, psc_created_at.ya_p02_digi_ya03v2__created_at, psc_created_at.ya_p02_digi_ya04v2__created_at, psc_created_at.ya_p02_digi_ya05v2__created_at, psc_created_at.ya_p02_test__created_at, psc_accepted_at.psycap_p01_ya_p02__accepted_at, psc_accepted_at.psycap_p02_old_ya_p02__accepted_at, psc_accepted_at.ya_p02__accepted_at, psc_accepted_at.ya_p02_digi_ya03v2__accepted_at, psc_accepted_at.ya_p02_digi_ya04v2__accepted_at, psc_accepted_at.ya_p02_digi_ya05v2__accepted_at, psc_accepted_at.ya_p02_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p02__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p02__cancelled_at, psc_cancelled_at.ya_p02__cancelled_at, psc_cancelled_at.ya_p02_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p02_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p02__revoked_at, psc_revoked_at.psycap_p02_old_ya_p02__revoked_at, psc_revoked_at.ya_p02__revoked_at, psc_revoked_at.ya_p02_digi_ya03v2__revoked_at, psc_revoked_at.ya_p02_digi_ya04v2__revoked_at, psc_revoked_at.ya_p02_digi_ya05v2__revoked_at, psc_revoked_at.ya_p02_test__revoked_at, psc_paused_at.psycap_p01_ya_p02__paused_at, psc_paused_at.psycap_p02_old_ya_p02__paused_at, psc_paused_at.ya_p02__paused_at, psc_paused_at.ya_p02_digi_ya03v2__paused_at, psc_paused_at.ya_p02_digi_ya04v2__paused_at, psc_paused_at.ya_p02_digi_ya05v2__paused_at, psc_paused_at.ya_p02_test__paused_at, ya_p02_ic_buccal_swab_proband, ya_p02_ic_urine_proband, ya_p02_ic_venous_blood_proband, ya_p02_ic_anam_qs, ya_p02_ic_aneurysm, ya_p02_ic_anthropometry, ya_p02_ic_arch_foot, ya_p02_ic_basic_qs, ya_p02_ic_blood_pressure, ya_p02_ic_braces_piercing_iud, ya_p02_ic_cognition_test, ya_p02_ic_da_health_registry, ya_p02_ic_dexa, ya_p02_ic_enviro_qs, ya_p02_ic_follow_up_studies, ya_p02_ic_fracture_lower_body_last_3m, ya_p02_ic_fracture_upper_body_last_3m, ya_p02_ic_hand_grip, ya_p02_ic_hearing_vision_impairment, ya_p02_ic_heart_disease, ya_p02_ic_hemoptysis_ns, ya_p02_ic_hernia, ya_p02_ic_hyperthyroidism, ya_p02_ic_inability_hold_pencil, ya_p02_ic_inability_stand_both_legs, ya_p02_ic_inability_talk_cze, ya_p02_ic_inability_walk, ya_p02_ic_inbody, ya_p02_ic_infectious_resp_diseases, ya_p02_ic_iodine_barium_radioisotopes_last_7d, ya_p02_ic_knee_stability, ya_p02_ic_nutri_qs, ya_p02_ic_over_weight_200_height_195, ya_p02_ic_pacemaker_defibrillator, ya_p02_ic_pneumothorax, ya_p02_ic_pregnancy, ya_p02_ic_recent_eye_abdominal_chest_surgery, ya_p02_ic_recent_myocardial_infarction, ya_p02_ic_spirometry, ya_p02_ic_surgical_metal_body, ya_p02_ic_unstable_angina_pectoris, ya_p02_ic_ya_dl_elspac, ya_p02_ic_ya_med_find, ya_p02_ic_ya_newsletter FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 15 -- Pilot ID );
Date: 2025-11-27 17:02:25 Duration: 1s917ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__15"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__15__dbt_tmp" as ( -- suject (proband) patrici do kohorty YA, Pilot ID: 15 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p02__role" text, "psycap_p02_old_ya_p02__role" text, "ya_p02__role" text, "ya_p02_digi_ya03v2__role" text, "ya_p02_digi_ya04v2__role" text, "ya_p02_digi_ya05v2__role" text, "ya_p02_test__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p02__state" text, "psycap_p02_old_ya_p02__state" text, "ya_p02__state" text, "ya_p02_digi_ya03v2__state" text, "ya_p02_digi_ya04v2__state" text, "ya_p02_digi_ya05v2__state" text, "ya_p02_test__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p02__activity_state" text, "psycap_p02_old_ya_p02__activity_state" text, "ya_p02__activity_state" text, "ya_p02_digi_ya03v2__activity_state" text, "ya_p02_digi_ya04v2__activity_state" text, "ya_p02_digi_ya05v2__activity_state" text, "ya_p02_test__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p02__created_at" text, "psycap_p02_old_ya_p02__created_at" text, "ya_p02__created_at" text, "ya_p02_digi_ya03v2__created_at" text, "ya_p02_digi_ya04v2__created_at" text, "ya_p02_digi_ya05v2__created_at" text, "ya_p02_test__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p02__accepted_at" text, "psycap_p02_old_ya_p02__accepted_at" text, "ya_p02__accepted_at" text, "ya_p02_digi_ya03v2__accepted_at" text, "ya_p02_digi_ya04v2__accepted_at" text, "ya_p02_digi_ya05v2__accepted_at" text, "ya_p02_test__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p02__cancelled_at" text, "psycap_p02_old_ya_p02__cancelled_at" text, "ya_p02__cancelled_at" text, "ya_p02_digi_ya03v2__cancelled_at" text, "ya_p02_digi_ya04v2__cancelled_at" text, "ya_p02_digi_ya05v2__cancelled_at" text, "ya_p02_test__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p02__revoked_at" text, "psycap_p02_old_ya_p02__revoked_at" text, "ya_p02__revoked_at" text, "ya_p02_digi_ya03v2__revoked_at" text, "ya_p02_digi_ya04v2__revoked_at" text, "ya_p02_digi_ya05v2__revoked_at" text, "ya_p02_test__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p02__paused_at" text, "psycap_p02_old_ya_p02__paused_at" text, "ya_p02__paused_at" text, "ya_p02_digi_ya03v2__paused_at" text, "ya_p02_digi_ya04v2__paused_at" text, "ya_p02_digi_ya05v2__paused_at" text, "ya_p02_test__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p02_ic_buccal_swab_proband'), ('ya_p02_ic_urine_proband'), ('ya_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p02_ic_buccal_swab_proband" text, "ya_p02_ic_urine_proband" text, "ya_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p02_ic_anam_qs'), ('ya_p02_ic_aneurysm'), ('ya_p02_ic_anthropometry'), ('ya_p02_ic_arch_foot'), ('ya_p02_ic_basic_qs'), ('ya_p02_ic_blood_pressure'), ('ya_p02_ic_braces_piercing_iud'), ('ya_p02_ic_cognition_test'), ('ya_p02_ic_da_health_registry'), ('ya_p02_ic_dexa'), ('ya_p02_ic_enviro_qs'), ('ya_p02_ic_follow_up_studies'), ('ya_p02_ic_fracture_lower_body_last_3m'), ('ya_p02_ic_fracture_upper_body_last_3m'), ('ya_p02_ic_hand_grip'), ('ya_p02_ic_hearing_vision_impairment'), ('ya_p02_ic_heart_disease'), ('ya_p02_ic_hemoptysis_ns'), ('ya_p02_ic_hernia'), ('ya_p02_ic_hyperthyroidism'), ('ya_p02_ic_inability_hold_pencil'), ('ya_p02_ic_inability_stand_both_legs'), ('ya_p02_ic_inability_talk_cze'), ('ya_p02_ic_inability_walk'), ('ya_p02_ic_inbody'), ('ya_p02_ic_infectious_resp_diseases'), ('ya_p02_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p02_ic_knee_stability'), ('ya_p02_ic_nutri_qs'), ('ya_p02_ic_over_weight_200_height_195'), ('ya_p02_ic_pacemaker_defibrillator'), ('ya_p02_ic_pneumothorax'), ('ya_p02_ic_pregnancy'), ('ya_p02_ic_recent_eye_abdominal_chest_surgery'), ('ya_p02_ic_recent_myocardial_infarction'), ('ya_p02_ic_spirometry'), ('ya_p02_ic_surgical_metal_body'), ('ya_p02_ic_unstable_angina_pectoris'), ('ya_p02_ic_ya_dl_elspac'), ('ya_p02_ic_ya_med_find'), ('ya_p02_ic_ya_newsletter') $$ ) AS extra_state ("subject_id" int, "ya_p02_ic_anam_qs" text, "ya_p02_ic_aneurysm" text, "ya_p02_ic_anthropometry" text, "ya_p02_ic_arch_foot" text, "ya_p02_ic_basic_qs" text, "ya_p02_ic_blood_pressure" text, "ya_p02_ic_braces_piercing_iud" text, "ya_p02_ic_cognition_test" text, "ya_p02_ic_da_health_registry" text, "ya_p02_ic_dexa" text, "ya_p02_ic_enviro_qs" text, "ya_p02_ic_follow_up_studies" text, "ya_p02_ic_fracture_lower_body_last_3m" text, "ya_p02_ic_fracture_upper_body_last_3m" text, "ya_p02_ic_hand_grip" text, "ya_p02_ic_hearing_vision_impairment" text, "ya_p02_ic_heart_disease" text, "ya_p02_ic_hemoptysis_ns" text, "ya_p02_ic_hernia" text, "ya_p02_ic_hyperthyroidism" text, "ya_p02_ic_inability_hold_pencil" text, "ya_p02_ic_inability_stand_both_legs" text, "ya_p02_ic_inability_talk_cze" text, "ya_p02_ic_inability_walk" text, "ya_p02_ic_inbody" text, "ya_p02_ic_infectious_resp_diseases" text, "ya_p02_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p02_ic_knee_stability" text, "ya_p02_ic_nutri_qs" text, "ya_p02_ic_over_weight_200_height_195" text, "ya_p02_ic_pacemaker_defibrillator" text, "ya_p02_ic_pneumothorax" text, "ya_p02_ic_pregnancy" text, "ya_p02_ic_recent_eye_abdominal_chest_surgery" text, "ya_p02_ic_recent_myocardial_infarction" text, "ya_p02_ic_spirometry" text, "ya_p02_ic_surgical_metal_body" text, "ya_p02_ic_unstable_angina_pectoris" text, "ya_p02_ic_ya_dl_elspac" text, "ya_p02_ic_ya_med_find" text, "ya_p02_ic_ya_newsletter" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p02__role, psc_role.psycap_p02_old_ya_p02__role, psc_role.ya_p02__role, psc_role.ya_p02_digi_ya03v2__role, psc_role.ya_p02_digi_ya04v2__role, psc_role.ya_p02_digi_ya05v2__role, psc_role.ya_p02_test__role, psc_state.psycap_p01_ya_p02__state, psc_state.psycap_p02_old_ya_p02__state, psc_state.ya_p02__state, psc_state.ya_p02_digi_ya03v2__state, psc_state.ya_p02_digi_ya04v2__state, psc_state.ya_p02_digi_ya05v2__state, psc_state.ya_p02_test__state, psc_activity_state.psycap_p01_ya_p02__activity_state, psc_activity_state.psycap_p02_old_ya_p02__activity_state, psc_activity_state.ya_p02__activity_state, psc_activity_state.ya_p02_digi_ya03v2__activity_state, psc_activity_state.ya_p02_digi_ya04v2__activity_state, psc_activity_state.ya_p02_digi_ya05v2__activity_state, psc_activity_state.ya_p02_test__activity_state, psc_created_at.psycap_p01_ya_p02__created_at, psc_created_at.psycap_p02_old_ya_p02__created_at, psc_created_at.ya_p02__created_at, psc_created_at.ya_p02_digi_ya03v2__created_at, psc_created_at.ya_p02_digi_ya04v2__created_at, psc_created_at.ya_p02_digi_ya05v2__created_at, psc_created_at.ya_p02_test__created_at, psc_accepted_at.psycap_p01_ya_p02__accepted_at, psc_accepted_at.psycap_p02_old_ya_p02__accepted_at, psc_accepted_at.ya_p02__accepted_at, psc_accepted_at.ya_p02_digi_ya03v2__accepted_at, psc_accepted_at.ya_p02_digi_ya04v2__accepted_at, psc_accepted_at.ya_p02_digi_ya05v2__accepted_at, psc_accepted_at.ya_p02_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p02__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p02__cancelled_at, psc_cancelled_at.ya_p02__cancelled_at, psc_cancelled_at.ya_p02_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p02_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p02__revoked_at, psc_revoked_at.psycap_p02_old_ya_p02__revoked_at, psc_revoked_at.ya_p02__revoked_at, psc_revoked_at.ya_p02_digi_ya03v2__revoked_at, psc_revoked_at.ya_p02_digi_ya04v2__revoked_at, psc_revoked_at.ya_p02_digi_ya05v2__revoked_at, psc_revoked_at.ya_p02_test__revoked_at, psc_paused_at.psycap_p01_ya_p02__paused_at, psc_paused_at.psycap_p02_old_ya_p02__paused_at, psc_paused_at.ya_p02__paused_at, psc_paused_at.ya_p02_digi_ya03v2__paused_at, psc_paused_at.ya_p02_digi_ya04v2__paused_at, psc_paused_at.ya_p02_digi_ya05v2__paused_at, psc_paused_at.ya_p02_test__paused_at, ya_p02_ic_buccal_swab_proband, ya_p02_ic_urine_proband, ya_p02_ic_venous_blood_proband, ya_p02_ic_anam_qs, ya_p02_ic_aneurysm, ya_p02_ic_anthropometry, ya_p02_ic_arch_foot, ya_p02_ic_basic_qs, ya_p02_ic_blood_pressure, ya_p02_ic_braces_piercing_iud, ya_p02_ic_cognition_test, ya_p02_ic_da_health_registry, ya_p02_ic_dexa, ya_p02_ic_enviro_qs, ya_p02_ic_follow_up_studies, ya_p02_ic_fracture_lower_body_last_3m, ya_p02_ic_fracture_upper_body_last_3m, ya_p02_ic_hand_grip, ya_p02_ic_hearing_vision_impairment, ya_p02_ic_heart_disease, ya_p02_ic_hemoptysis_ns, ya_p02_ic_hernia, ya_p02_ic_hyperthyroidism, ya_p02_ic_inability_hold_pencil, ya_p02_ic_inability_stand_both_legs, ya_p02_ic_inability_talk_cze, ya_p02_ic_inability_walk, ya_p02_ic_inbody, ya_p02_ic_infectious_resp_diseases, ya_p02_ic_iodine_barium_radioisotopes_last_7d, ya_p02_ic_knee_stability, ya_p02_ic_nutri_qs, ya_p02_ic_over_weight_200_height_195, ya_p02_ic_pacemaker_defibrillator, ya_p02_ic_pneumothorax, ya_p02_ic_pregnancy, ya_p02_ic_recent_eye_abdominal_chest_surgery, ya_p02_ic_recent_myocardial_infarction, ya_p02_ic_spirometry, ya_p02_ic_surgical_metal_body, ya_p02_ic_unstable_angina_pectoris, ya_p02_ic_ya_dl_elspac, ya_p02_ic_ya_med_find, ya_p02_ic_ya_newsletter FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 15 -- Pilot ID );
Date: 2025-11-27 05:02:22 Duration: 1s396ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
12 1s459ms 1s667ms 1s563ms 2 3s127ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__12__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "psycap_p01_ya_p01__role" text, "psycap_p02_old_ya_p01__role" text, "ya_p01__role" text, "ya_p01_digi_ya03v2__role" text, "ya_p01_digi_ya04v2__role" text, "ya_p01_digi_ya05v2__role" text, "ya_p01_test__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "psycap_p01_ya_p01__state" text, "psycap_p02_old_ya_p01__state" text, "ya_p01__state" text, "ya_p01_digi_ya03v2__state" text, "ya_p01_digi_ya04v2__state" text, "ya_p01_digi_ya05v2__state" text, "ya_p01_test__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as activity ("subject_id" int, "psycap_p01_ya_p01__activity_state" text, "psycap_p02_old_ya_p01__activity_state" text, "ya_p01__activity_state" text, "ya_p01_digi_ya03v2__activity_state" text, "ya_p01_digi_ya04v2__activity_state" text, "ya_p01_digi_ya05v2__activity_state" text, "ya_p01_test__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as created_at ("subject_id" int, "psycap_p01_ya_p01__created_at" text, "psycap_p02_old_ya_p01__created_at" text, "ya_p01__created_at" text, "ya_p01_digi_ya03v2__created_at" text, "ya_p01_digi_ya04v2__created_at" text, "ya_p01_digi_ya05v2__created_at" text, "ya_p01_test__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "psycap_p01_ya_p01__accepted_at" text, "psycap_p02_old_ya_p01__accepted_at" text, "ya_p01__accepted_at" text, "ya_p01_digi_ya03v2__accepted_at" text, "ya_p01_digi_ya04v2__accepted_at" text, "ya_p01_digi_ya05v2__accepted_at" text, "ya_p01_test__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "psycap_p01_ya_p01__cancelled_at" text, "psycap_p02_old_ya_p01__cancelled_at" text, "ya_p01__cancelled_at" text, "ya_p01_digi_ya03v2__cancelled_at" text, "ya_p01_digi_ya04v2__cancelled_at" text, "ya_p01_digi_ya05v2__cancelled_at" text, "ya_p01_test__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "psycap_p01_ya_p01__revoked_at" text, "psycap_p02_old_ya_p01__revoked_at" text, "ya_p01__revoked_at" text, "ya_p01_digi_ya03v2__revoked_at" text, "ya_p01_digi_ya04v2__revoked_at" text, "ya_p01_digi_ya05v2__revoked_at" text, "ya_p01_test__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as paused_at ("subject_id" int, "psycap_p01_ya_p01__paused_at" text, "psycap_p02_old_ya_p01__paused_at" text, "ya_p01__paused_at" text, "ya_p01_digi_ya03v2__paused_at" text, "ya_p01_digi_ya04v2__paused_at" text, "ya_p01_digi_ya05v2__paused_at" text, "ya_p01_test__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "ya_p01_ic_buccal_swab_proband" text, "ya_p01_ic_urine_proband" text, "ya_p01_ic_venous_blood_proband" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "ya_p01_ic_anam_qs" text, "ya_p01_ic_aneurysm" text, "ya_p01_ic_anthropometry" text, "ya_p01_ic_arch_foot" text, "ya_p01_ic_basic_qs" text, "ya_p01_ic_blood_pressure" text, "ya_p01_ic_braces_piercing_iud" text, "ya_p01_ic_cognition_test" text, "ya_p01_ic_da_health_registry" text, "ya_p01_ic_dexa" text, "ya_p01_ic_enviro_qs" text, "ya_p01_ic_follow_up_studies" text, "ya_p01_ic_fracture_lower_body_last_3m" text, "ya_p01_ic_fracture_upper_body_last_3m" text, "ya_p01_ic_hand_grip" text, "ya_p01_ic_hearing_vision_impairment" text, "ya_p01_ic_heart_disease" text, "ya_p01_ic_hemoptysis_ns" text, "ya_p01_ic_hernia" text, "ya_p01_ic_hyperthyroidism" text, "ya_p01_ic_inability_hold_pencil" text, "ya_p01_ic_inability_stand_both_legs" text, "ya_p01_ic_inability_talk_cze" text, "ya_p01_ic_inability_walk" text, "ya_p01_ic_inbody" text, "ya_p01_ic_infectious_resp_diseases" text, "ya_p01_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p01_ic_knee_stability" text, "ya_p01_ic_med_find" text, "ya_p01_ic_nutri_qs" text, "ya_p01_ic_over_weight_200_height_195" text, "ya_p01_ic_pacemaker_defibrillator" text, "ya_p01_ic_pneumothorax" text, "ya_p01_ic_pregnancy" text, "ya_p01_ic_recent_eye_abdominal_chest_surgery" text, "ya_p01_ic_recent_myocardial_infarction" text, "ya_p01_ic_spirometry" text, "ya_p01_ic_surgical_metal_body" text, "ya_p01_ic_unstable_angina_pectoris" text, "ya_p01_ic_ya_dl_elspac" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.psycap_p01_ya_p01__role, psc_role.psycap_p02_old_ya_p01__role, psc_role.ya_p01__role, psc_role.ya_p01_digi_ya03v2__role, psc_role.ya_p01_digi_ya04v2__role, psc_role.ya_p01_digi_ya05v2__role, psc_role.ya_p01_test__role, psc_state.psycap_p01_ya_p01__state, psc_state.psycap_p02_old_ya_p01__state, psc_state.ya_p01__state, psc_state.ya_p01_digi_ya03v2__state, psc_state.ya_p01_digi_ya04v2__state, psc_state.ya_p01_digi_ya05v2__state, psc_state.ya_p01_test__state, psc_activity_state.psycap_p01_ya_p01__activity_state, psc_activity_state.psycap_p02_old_ya_p01__activity_state, psc_activity_state.ya_p01__activity_state, psc_activity_state.ya_p01_digi_ya03v2__activity_state, psc_activity_state.ya_p01_digi_ya04v2__activity_state, psc_activity_state.ya_p01_digi_ya05v2__activity_state, psc_activity_state.ya_p01_test__activity_state, psc_created_at.psycap_p01_ya_p01__created_at, psc_created_at.psycap_p02_old_ya_p01__created_at, psc_created_at.ya_p01__created_at, psc_created_at.ya_p01_digi_ya03v2__created_at, psc_created_at.ya_p01_digi_ya04v2__created_at, psc_created_at.ya_p01_digi_ya05v2__created_at, psc_created_at.ya_p01_test__created_at, psc_accepted_at.psycap_p01_ya_p01__accepted_at, psc_accepted_at.psycap_p02_old_ya_p01__accepted_at, psc_accepted_at.ya_p01__accepted_at, psc_accepted_at.ya_p01_digi_ya03v2__accepted_at, psc_accepted_at.ya_p01_digi_ya04v2__accepted_at, psc_accepted_at.ya_p01_digi_ya05v2__accepted_at, psc_accepted_at.ya_p01_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p01__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p01__cancelled_at, psc_cancelled_at.ya_p01__cancelled_at, psc_cancelled_at.ya_p01_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p01_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p01_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p01_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p01__revoked_at, psc_revoked_at.psycap_p02_old_ya_p01__revoked_at, psc_revoked_at.ya_p01__revoked_at, psc_revoked_at.ya_p01_digi_ya03v2__revoked_at, psc_revoked_at.ya_p01_digi_ya04v2__revoked_at, psc_revoked_at.ya_p01_digi_ya05v2__revoked_at, psc_revoked_at.ya_p01_test__revoked_at, psc_paused_at.psycap_p01_ya_p01__paused_at, psc_paused_at.psycap_p02_old_ya_p01__paused_at, psc_paused_at.ya_p01__paused_at, psc_paused_at.ya_p01_digi_ya03v2__paused_at, psc_paused_at.ya_p01_digi_ya04v2__paused_at, psc_paused_at.ya_p01_digi_ya05v2__paused_at, psc_paused_at.ya_p01_test__paused_at, ya_p01_ic_buccal_swab_proband, ya_p01_ic_urine_proband, ya_p01_ic_venous_blood_proband, ya_p01_ic_anam_qs, ya_p01_ic_aneurysm, ya_p01_ic_anthropometry, ya_p01_ic_arch_foot, ya_p01_ic_basic_qs, ya_p01_ic_blood_pressure, ya_p01_ic_braces_piercing_iud, ya_p01_ic_cognition_test, ya_p01_ic_da_health_registry, ya_p01_ic_dexa, ya_p01_ic_enviro_qs, ya_p01_ic_follow_up_studies, ya_p01_ic_fracture_lower_body_last_3m, ya_p01_ic_fracture_upper_body_last_3m, ya_p01_ic_hand_grip, ya_p01_ic_hearing_vision_impairment, ya_p01_ic_heart_disease, ya_p01_ic_hemoptysis_ns, ya_p01_ic_hernia, ya_p01_ic_hyperthyroidism, ya_p01_ic_inability_hold_pencil, ya_p01_ic_inability_stand_both_legs, ya_p01_ic_inability_talk_cze, ya_p01_ic_inability_walk, ya_p01_ic_inbody, ya_p01_ic_infectious_resp_diseases, ya_p01_ic_iodine_barium_radioisotopes_last_7d, ya_p01_ic_knee_stability, ya_p01_ic_med_find, ya_p01_ic_nutri_qs, ya_p01_ic_over_weight_200_height_195, ya_p01_ic_pacemaker_defibrillator, ya_p01_ic_pneumothorax, ya_p01_ic_pregnancy, ya_p01_ic_recent_eye_abdominal_chest_surgery, ya_p01_ic_recent_myocardial_infarction, ya_p01_ic_spirometry, ya_p01_ic_surgical_metal_body, ya_p01_ic_unstable_angina_pectoris, ya_p01_ic_ya_dl_elspac from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #12
Day Hour Count Duration Avg duration Nov 27 05 1 1s459ms 1s459ms 17 1 1s667ms 1s667ms [ User: tng_migration_user - Total duration: 3s127ms - Times executed: 2 ]
[ Application: dbt - Total duration: 3s127ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__12"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__12__dbt_tmp" as ( -- suject (proband) patrici do kohorty YA Pilot I, Pilot ID: 12 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p01__role" text, "psycap_p02_old_ya_p01__role" text, "ya_p01__role" text, "ya_p01_digi_ya03v2__role" text, "ya_p01_digi_ya04v2__role" text, "ya_p01_digi_ya05v2__role" text, "ya_p01_test__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p01__state" text, "psycap_p02_old_ya_p01__state" text, "ya_p01__state" text, "ya_p01_digi_ya03v2__state" text, "ya_p01_digi_ya04v2__state" text, "ya_p01_digi_ya05v2__state" text, "ya_p01_test__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p01__activity_state" text, "psycap_p02_old_ya_p01__activity_state" text, "ya_p01__activity_state" text, "ya_p01_digi_ya03v2__activity_state" text, "ya_p01_digi_ya04v2__activity_state" text, "ya_p01_digi_ya05v2__activity_state" text, "ya_p01_test__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p01__created_at" text, "psycap_p02_old_ya_p01__created_at" text, "ya_p01__created_at" text, "ya_p01_digi_ya03v2__created_at" text, "ya_p01_digi_ya04v2__created_at" text, "ya_p01_digi_ya05v2__created_at" text, "ya_p01_test__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p01__accepted_at" text, "psycap_p02_old_ya_p01__accepted_at" text, "ya_p01__accepted_at" text, "ya_p01_digi_ya03v2__accepted_at" text, "ya_p01_digi_ya04v2__accepted_at" text, "ya_p01_digi_ya05v2__accepted_at" text, "ya_p01_test__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p01__cancelled_at" text, "psycap_p02_old_ya_p01__cancelled_at" text, "ya_p01__cancelled_at" text, "ya_p01_digi_ya03v2__cancelled_at" text, "ya_p01_digi_ya04v2__cancelled_at" text, "ya_p01_digi_ya05v2__cancelled_at" text, "ya_p01_test__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p01__revoked_at" text, "psycap_p02_old_ya_p01__revoked_at" text, "ya_p01__revoked_at" text, "ya_p01_digi_ya03v2__revoked_at" text, "ya_p01_digi_ya04v2__revoked_at" text, "ya_p01_digi_ya05v2__revoked_at" text, "ya_p01_test__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p01__paused_at" text, "psycap_p02_old_ya_p01__paused_at" text, "ya_p01__paused_at" text, "ya_p01_digi_ya03v2__paused_at" text, "ya_p01_digi_ya04v2__paused_at" text, "ya_p01_digi_ya05v2__paused_at" text, "ya_p01_test__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p01_ic_buccal_swab_proband'), ('ya_p01_ic_urine_proband'), ('ya_p01_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p01_ic_buccal_swab_proband" text, "ya_p01_ic_urine_proband" text, "ya_p01_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p01_ic_anam_qs'), ('ya_p01_ic_aneurysm'), ('ya_p01_ic_anthropometry'), ('ya_p01_ic_arch_foot'), ('ya_p01_ic_basic_qs'), ('ya_p01_ic_blood_pressure'), ('ya_p01_ic_braces_piercing_iud'), ('ya_p01_ic_cognition_test'), ('ya_p01_ic_da_health_registry'), ('ya_p01_ic_dexa'), ('ya_p01_ic_enviro_qs'), ('ya_p01_ic_follow_up_studies'), ('ya_p01_ic_fracture_lower_body_last_3m'), ('ya_p01_ic_fracture_upper_body_last_3m'), ('ya_p01_ic_hand_grip'), ('ya_p01_ic_hearing_vision_impairment'), ('ya_p01_ic_heart_disease'), ('ya_p01_ic_hemoptysis_ns'), ('ya_p01_ic_hernia'), ('ya_p01_ic_hyperthyroidism'), ('ya_p01_ic_inability_hold_pencil'), ('ya_p01_ic_inability_stand_both_legs'), ('ya_p01_ic_inability_talk_cze'), ('ya_p01_ic_inability_walk'), ('ya_p01_ic_inbody'), ('ya_p01_ic_infectious_resp_diseases'), ('ya_p01_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p01_ic_knee_stability'), ('ya_p01_ic_med_find'), ('ya_p01_ic_nutri_qs'), ('ya_p01_ic_over_weight_200_height_195'), ('ya_p01_ic_pacemaker_defibrillator'), ('ya_p01_ic_pneumothorax'), ('ya_p01_ic_pregnancy'), ('ya_p01_ic_recent_eye_abdominal_chest_surgery'), ('ya_p01_ic_recent_myocardial_infarction'), ('ya_p01_ic_spirometry'), ('ya_p01_ic_surgical_metal_body'), ('ya_p01_ic_unstable_angina_pectoris'), ('ya_p01_ic_ya_dl_elspac') $$ ) AS extra_state ("subject_id" int, "ya_p01_ic_anam_qs" text, "ya_p01_ic_aneurysm" text, "ya_p01_ic_anthropometry" text, "ya_p01_ic_arch_foot" text, "ya_p01_ic_basic_qs" text, "ya_p01_ic_blood_pressure" text, "ya_p01_ic_braces_piercing_iud" text, "ya_p01_ic_cognition_test" text, "ya_p01_ic_da_health_registry" text, "ya_p01_ic_dexa" text, "ya_p01_ic_enviro_qs" text, "ya_p01_ic_follow_up_studies" text, "ya_p01_ic_fracture_lower_body_last_3m" text, "ya_p01_ic_fracture_upper_body_last_3m" text, "ya_p01_ic_hand_grip" text, "ya_p01_ic_hearing_vision_impairment" text, "ya_p01_ic_heart_disease" text, "ya_p01_ic_hemoptysis_ns" text, "ya_p01_ic_hernia" text, "ya_p01_ic_hyperthyroidism" text, "ya_p01_ic_inability_hold_pencil" text, "ya_p01_ic_inability_stand_both_legs" text, "ya_p01_ic_inability_talk_cze" text, "ya_p01_ic_inability_walk" text, "ya_p01_ic_inbody" text, "ya_p01_ic_infectious_resp_diseases" text, "ya_p01_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p01_ic_knee_stability" text, "ya_p01_ic_med_find" text, "ya_p01_ic_nutri_qs" text, "ya_p01_ic_over_weight_200_height_195" text, "ya_p01_ic_pacemaker_defibrillator" text, "ya_p01_ic_pneumothorax" text, "ya_p01_ic_pregnancy" text, "ya_p01_ic_recent_eye_abdominal_chest_surgery" text, "ya_p01_ic_recent_myocardial_infarction" text, "ya_p01_ic_spirometry" text, "ya_p01_ic_surgical_metal_body" text, "ya_p01_ic_unstable_angina_pectoris" text, "ya_p01_ic_ya_dl_elspac" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p01__role, psc_role.psycap_p02_old_ya_p01__role, psc_role.ya_p01__role, psc_role.ya_p01_digi_ya03v2__role, psc_role.ya_p01_digi_ya04v2__role, psc_role.ya_p01_digi_ya05v2__role, psc_role.ya_p01_test__role, psc_state.psycap_p01_ya_p01__state, psc_state.psycap_p02_old_ya_p01__state, psc_state.ya_p01__state, psc_state.ya_p01_digi_ya03v2__state, psc_state.ya_p01_digi_ya04v2__state, psc_state.ya_p01_digi_ya05v2__state, psc_state.ya_p01_test__state, psc_activity_state.psycap_p01_ya_p01__activity_state, psc_activity_state.psycap_p02_old_ya_p01__activity_state, psc_activity_state.ya_p01__activity_state, psc_activity_state.ya_p01_digi_ya03v2__activity_state, psc_activity_state.ya_p01_digi_ya04v2__activity_state, psc_activity_state.ya_p01_digi_ya05v2__activity_state, psc_activity_state.ya_p01_test__activity_state, psc_created_at.psycap_p01_ya_p01__created_at, psc_created_at.psycap_p02_old_ya_p01__created_at, psc_created_at.ya_p01__created_at, psc_created_at.ya_p01_digi_ya03v2__created_at, psc_created_at.ya_p01_digi_ya04v2__created_at, psc_created_at.ya_p01_digi_ya05v2__created_at, psc_created_at.ya_p01_test__created_at, psc_accepted_at.psycap_p01_ya_p01__accepted_at, psc_accepted_at.psycap_p02_old_ya_p01__accepted_at, psc_accepted_at.ya_p01__accepted_at, psc_accepted_at.ya_p01_digi_ya03v2__accepted_at, psc_accepted_at.ya_p01_digi_ya04v2__accepted_at, psc_accepted_at.ya_p01_digi_ya05v2__accepted_at, psc_accepted_at.ya_p01_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p01__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p01__cancelled_at, psc_cancelled_at.ya_p01__cancelled_at, psc_cancelled_at.ya_p01_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p01_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p01_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p01_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p01__revoked_at, psc_revoked_at.psycap_p02_old_ya_p01__revoked_at, psc_revoked_at.ya_p01__revoked_at, psc_revoked_at.ya_p01_digi_ya03v2__revoked_at, psc_revoked_at.ya_p01_digi_ya04v2__revoked_at, psc_revoked_at.ya_p01_digi_ya05v2__revoked_at, psc_revoked_at.ya_p01_test__revoked_at, psc_paused_at.psycap_p01_ya_p01__paused_at, psc_paused_at.psycap_p02_old_ya_p01__paused_at, psc_paused_at.ya_p01__paused_at, psc_paused_at.ya_p01_digi_ya03v2__paused_at, psc_paused_at.ya_p01_digi_ya04v2__paused_at, psc_paused_at.ya_p01_digi_ya05v2__paused_at, psc_paused_at.ya_p01_test__paused_at, ya_p01_ic_buccal_swab_proband, ya_p01_ic_urine_proband, ya_p01_ic_venous_blood_proband, ya_p01_ic_anam_qs, ya_p01_ic_aneurysm, ya_p01_ic_anthropometry, ya_p01_ic_arch_foot, ya_p01_ic_basic_qs, ya_p01_ic_blood_pressure, ya_p01_ic_braces_piercing_iud, ya_p01_ic_cognition_test, ya_p01_ic_da_health_registry, ya_p01_ic_dexa, ya_p01_ic_enviro_qs, ya_p01_ic_follow_up_studies, ya_p01_ic_fracture_lower_body_last_3m, ya_p01_ic_fracture_upper_body_last_3m, ya_p01_ic_hand_grip, ya_p01_ic_hearing_vision_impairment, ya_p01_ic_heart_disease, ya_p01_ic_hemoptysis_ns, ya_p01_ic_hernia, ya_p01_ic_hyperthyroidism, ya_p01_ic_inability_hold_pencil, ya_p01_ic_inability_stand_both_legs, ya_p01_ic_inability_talk_cze, ya_p01_ic_inability_walk, ya_p01_ic_inbody, ya_p01_ic_infectious_resp_diseases, ya_p01_ic_iodine_barium_radioisotopes_last_7d, ya_p01_ic_knee_stability, ya_p01_ic_med_find, ya_p01_ic_nutri_qs, ya_p01_ic_over_weight_200_height_195, ya_p01_ic_pacemaker_defibrillator, ya_p01_ic_pneumothorax, ya_p01_ic_pregnancy, ya_p01_ic_recent_eye_abdominal_chest_surgery, ya_p01_ic_recent_myocardial_infarction, ya_p01_ic_spirometry, ya_p01_ic_surgical_metal_body, ya_p01_ic_unstable_angina_pectoris, ya_p01_ic_ya_dl_elspac FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 12 -- Pilot ID );
Date: 2025-11-27 17:02:24 Duration: 1s667ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__12"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__12__dbt_tmp" as ( -- suject (proband) patrici do kohorty YA Pilot I, Pilot ID: 12 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p01__role" text, "psycap_p02_old_ya_p01__role" text, "ya_p01__role" text, "ya_p01_digi_ya03v2__role" text, "ya_p01_digi_ya04v2__role" text, "ya_p01_digi_ya05v2__role" text, "ya_p01_test__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p01__state" text, "psycap_p02_old_ya_p01__state" text, "ya_p01__state" text, "ya_p01_digi_ya03v2__state" text, "ya_p01_digi_ya04v2__state" text, "ya_p01_digi_ya05v2__state" text, "ya_p01_test__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p01__activity_state" text, "psycap_p02_old_ya_p01__activity_state" text, "ya_p01__activity_state" text, "ya_p01_digi_ya03v2__activity_state" text, "ya_p01_digi_ya04v2__activity_state" text, "ya_p01_digi_ya05v2__activity_state" text, "ya_p01_test__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p01__created_at" text, "psycap_p02_old_ya_p01__created_at" text, "ya_p01__created_at" text, "ya_p01_digi_ya03v2__created_at" text, "ya_p01_digi_ya04v2__created_at" text, "ya_p01_digi_ya05v2__created_at" text, "ya_p01_test__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p01__accepted_at" text, "psycap_p02_old_ya_p01__accepted_at" text, "ya_p01__accepted_at" text, "ya_p01_digi_ya03v2__accepted_at" text, "ya_p01_digi_ya04v2__accepted_at" text, "ya_p01_digi_ya05v2__accepted_at" text, "ya_p01_test__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p01__cancelled_at" text, "psycap_p02_old_ya_p01__cancelled_at" text, "ya_p01__cancelled_at" text, "ya_p01_digi_ya03v2__cancelled_at" text, "ya_p01_digi_ya04v2__cancelled_at" text, "ya_p01_digi_ya05v2__cancelled_at" text, "ya_p01_test__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p01__revoked_at" text, "psycap_p02_old_ya_p01__revoked_at" text, "ya_p01__revoked_at" text, "ya_p01_digi_ya03v2__revoked_at" text, "ya_p01_digi_ya04v2__revoked_at" text, "ya_p01_digi_ya05v2__revoked_at" text, "ya_p01_test__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p01__paused_at" text, "psycap_p02_old_ya_p01__paused_at" text, "ya_p01__paused_at" text, "ya_p01_digi_ya03v2__paused_at" text, "ya_p01_digi_ya04v2__paused_at" text, "ya_p01_digi_ya05v2__paused_at" text, "ya_p01_test__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p01_ic_buccal_swab_proband'), ('ya_p01_ic_urine_proband'), ('ya_p01_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p01_ic_buccal_swab_proband" text, "ya_p01_ic_urine_proband" text, "ya_p01_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p01_ic_anam_qs'), ('ya_p01_ic_aneurysm'), ('ya_p01_ic_anthropometry'), ('ya_p01_ic_arch_foot'), ('ya_p01_ic_basic_qs'), ('ya_p01_ic_blood_pressure'), ('ya_p01_ic_braces_piercing_iud'), ('ya_p01_ic_cognition_test'), ('ya_p01_ic_da_health_registry'), ('ya_p01_ic_dexa'), ('ya_p01_ic_enviro_qs'), ('ya_p01_ic_follow_up_studies'), ('ya_p01_ic_fracture_lower_body_last_3m'), ('ya_p01_ic_fracture_upper_body_last_3m'), ('ya_p01_ic_hand_grip'), ('ya_p01_ic_hearing_vision_impairment'), ('ya_p01_ic_heart_disease'), ('ya_p01_ic_hemoptysis_ns'), ('ya_p01_ic_hernia'), ('ya_p01_ic_hyperthyroidism'), ('ya_p01_ic_inability_hold_pencil'), ('ya_p01_ic_inability_stand_both_legs'), ('ya_p01_ic_inability_talk_cze'), ('ya_p01_ic_inability_walk'), ('ya_p01_ic_inbody'), ('ya_p01_ic_infectious_resp_diseases'), ('ya_p01_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p01_ic_knee_stability'), ('ya_p01_ic_med_find'), ('ya_p01_ic_nutri_qs'), ('ya_p01_ic_over_weight_200_height_195'), ('ya_p01_ic_pacemaker_defibrillator'), ('ya_p01_ic_pneumothorax'), ('ya_p01_ic_pregnancy'), ('ya_p01_ic_recent_eye_abdominal_chest_surgery'), ('ya_p01_ic_recent_myocardial_infarction'), ('ya_p01_ic_spirometry'), ('ya_p01_ic_surgical_metal_body'), ('ya_p01_ic_unstable_angina_pectoris'), ('ya_p01_ic_ya_dl_elspac') $$ ) AS extra_state ("subject_id" int, "ya_p01_ic_anam_qs" text, "ya_p01_ic_aneurysm" text, "ya_p01_ic_anthropometry" text, "ya_p01_ic_arch_foot" text, "ya_p01_ic_basic_qs" text, "ya_p01_ic_blood_pressure" text, "ya_p01_ic_braces_piercing_iud" text, "ya_p01_ic_cognition_test" text, "ya_p01_ic_da_health_registry" text, "ya_p01_ic_dexa" text, "ya_p01_ic_enviro_qs" text, "ya_p01_ic_follow_up_studies" text, "ya_p01_ic_fracture_lower_body_last_3m" text, "ya_p01_ic_fracture_upper_body_last_3m" text, "ya_p01_ic_hand_grip" text, "ya_p01_ic_hearing_vision_impairment" text, "ya_p01_ic_heart_disease" text, "ya_p01_ic_hemoptysis_ns" text, "ya_p01_ic_hernia" text, "ya_p01_ic_hyperthyroidism" text, "ya_p01_ic_inability_hold_pencil" text, "ya_p01_ic_inability_stand_both_legs" text, "ya_p01_ic_inability_talk_cze" text, "ya_p01_ic_inability_walk" text, "ya_p01_ic_inbody" text, "ya_p01_ic_infectious_resp_diseases" text, "ya_p01_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p01_ic_knee_stability" text, "ya_p01_ic_med_find" text, "ya_p01_ic_nutri_qs" text, "ya_p01_ic_over_weight_200_height_195" text, "ya_p01_ic_pacemaker_defibrillator" text, "ya_p01_ic_pneumothorax" text, "ya_p01_ic_pregnancy" text, "ya_p01_ic_recent_eye_abdominal_chest_surgery" text, "ya_p01_ic_recent_myocardial_infarction" text, "ya_p01_ic_spirometry" text, "ya_p01_ic_surgical_metal_body" text, "ya_p01_ic_unstable_angina_pectoris" text, "ya_p01_ic_ya_dl_elspac" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p01__role, psc_role.psycap_p02_old_ya_p01__role, psc_role.ya_p01__role, psc_role.ya_p01_digi_ya03v2__role, psc_role.ya_p01_digi_ya04v2__role, psc_role.ya_p01_digi_ya05v2__role, psc_role.ya_p01_test__role, psc_state.psycap_p01_ya_p01__state, psc_state.psycap_p02_old_ya_p01__state, psc_state.ya_p01__state, psc_state.ya_p01_digi_ya03v2__state, psc_state.ya_p01_digi_ya04v2__state, psc_state.ya_p01_digi_ya05v2__state, psc_state.ya_p01_test__state, psc_activity_state.psycap_p01_ya_p01__activity_state, psc_activity_state.psycap_p02_old_ya_p01__activity_state, psc_activity_state.ya_p01__activity_state, psc_activity_state.ya_p01_digi_ya03v2__activity_state, psc_activity_state.ya_p01_digi_ya04v2__activity_state, psc_activity_state.ya_p01_digi_ya05v2__activity_state, psc_activity_state.ya_p01_test__activity_state, psc_created_at.psycap_p01_ya_p01__created_at, psc_created_at.psycap_p02_old_ya_p01__created_at, psc_created_at.ya_p01__created_at, psc_created_at.ya_p01_digi_ya03v2__created_at, psc_created_at.ya_p01_digi_ya04v2__created_at, psc_created_at.ya_p01_digi_ya05v2__created_at, psc_created_at.ya_p01_test__created_at, psc_accepted_at.psycap_p01_ya_p01__accepted_at, psc_accepted_at.psycap_p02_old_ya_p01__accepted_at, psc_accepted_at.ya_p01__accepted_at, psc_accepted_at.ya_p01_digi_ya03v2__accepted_at, psc_accepted_at.ya_p01_digi_ya04v2__accepted_at, psc_accepted_at.ya_p01_digi_ya05v2__accepted_at, psc_accepted_at.ya_p01_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p01__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p01__cancelled_at, psc_cancelled_at.ya_p01__cancelled_at, psc_cancelled_at.ya_p01_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p01_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p01_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p01_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p01__revoked_at, psc_revoked_at.psycap_p02_old_ya_p01__revoked_at, psc_revoked_at.ya_p01__revoked_at, psc_revoked_at.ya_p01_digi_ya03v2__revoked_at, psc_revoked_at.ya_p01_digi_ya04v2__revoked_at, psc_revoked_at.ya_p01_digi_ya05v2__revoked_at, psc_revoked_at.ya_p01_test__revoked_at, psc_paused_at.psycap_p01_ya_p01__paused_at, psc_paused_at.psycap_p02_old_ya_p01__paused_at, psc_paused_at.ya_p01__paused_at, psc_paused_at.ya_p01_digi_ya03v2__paused_at, psc_paused_at.ya_p01_digi_ya04v2__paused_at, psc_paused_at.ya_p01_digi_ya05v2__paused_at, psc_paused_at.ya_p01_test__paused_at, ya_p01_ic_buccal_swab_proband, ya_p01_ic_urine_proband, ya_p01_ic_venous_blood_proband, ya_p01_ic_anam_qs, ya_p01_ic_aneurysm, ya_p01_ic_anthropometry, ya_p01_ic_arch_foot, ya_p01_ic_basic_qs, ya_p01_ic_blood_pressure, ya_p01_ic_braces_piercing_iud, ya_p01_ic_cognition_test, ya_p01_ic_da_health_registry, ya_p01_ic_dexa, ya_p01_ic_enviro_qs, ya_p01_ic_follow_up_studies, ya_p01_ic_fracture_lower_body_last_3m, ya_p01_ic_fracture_upper_body_last_3m, ya_p01_ic_hand_grip, ya_p01_ic_hearing_vision_impairment, ya_p01_ic_heart_disease, ya_p01_ic_hemoptysis_ns, ya_p01_ic_hernia, ya_p01_ic_hyperthyroidism, ya_p01_ic_inability_hold_pencil, ya_p01_ic_inability_stand_both_legs, ya_p01_ic_inability_talk_cze, ya_p01_ic_inability_walk, ya_p01_ic_inbody, ya_p01_ic_infectious_resp_diseases, ya_p01_ic_iodine_barium_radioisotopes_last_7d, ya_p01_ic_knee_stability, ya_p01_ic_med_find, ya_p01_ic_nutri_qs, ya_p01_ic_over_weight_200_height_195, ya_p01_ic_pacemaker_defibrillator, ya_p01_ic_pneumothorax, ya_p01_ic_pregnancy, ya_p01_ic_recent_eye_abdominal_chest_surgery, ya_p01_ic_recent_myocardial_infarction, ya_p01_ic_spirometry, ya_p01_ic_surgical_metal_body, ya_p01_ic_unstable_angina_pectoris, ya_p01_ic_ya_dl_elspac FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 12 -- Pilot ID );
Date: 2025-11-27 05:02:22 Duration: 1s459ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
13 930ms 1s931ms 1s430ms 2 2s861ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__38__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "horpark__role" text, "horpark_patients__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "horpark__state" text, "horpark_patients__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as activity ("subject_id" int, "horpark__activity_state" text, "horpark_patients__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as created_at ("subject_id" int, "horpark__created_at" text, "horpark_patients__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as accepted_at ("subject_id" int, "horpark__accepted_at" text, "horpark_patients__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as cancelled_at ("subject_id" int, "horpark__cancelled_at" text, "horpark_patients__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as revoked_at ("subject_id" int, "horpark__revoked_at" text, "horpark_patients__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as paused_at ("subject_id" int, "horpark__paused_at" text, "horpark_patients__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "horpark_ic_urine_proband" text, "horpark_ic_venous_blood_proband" text, "horpark_patients_likvor_proband" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "horpark_expozicni_dotaznik" text, "horpark_patients_chronicke_onemocneni" text, "horpark_patients_ic_pregnancy" text, "horpark_patients_krevni_podlitiny" text, "horpark_patients_krvaceni" text, "horpark_patients_ryma_astma_precitlivelost" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.horpark__role, psc_role.horpark_patients__role, psc_state.horpark__state, psc_state.horpark_patients__state, psc_activity_state.horpark__activity_state, psc_activity_state.horpark_patients__activity_state, psc_created_at.horpark__created_at, psc_created_at.horpark_patients__created_at, psc_accepted_at.horpark__accepted_at, psc_accepted_at.horpark_patients__accepted_at, psc_cancelled_at.horpark__cancelled_at, psc_cancelled_at.horpark_patients__cancelled_at, psc_revoked_at.horpark__revoked_at, psc_revoked_at.horpark_patients__revoked_at, psc_paused_at.horpark__paused_at, psc_paused_at.horpark_patients__paused_at, horpark_ic_urine_proband, horpark_ic_venous_blood_proband, horpark_patients_likvor_proband, horpark_expozicni_dotaznik, horpark_patients_chronicke_onemocneni, horpark_patients_ic_pregnancy, horpark_patients_krevni_podlitiny, horpark_patients_krvaceni, horpark_patients_ryma_astma_precitlivelost from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #13
Day Hour Count Duration Avg duration Nov 27 05 1 930ms 930ms 17 1 1s931ms 1s931ms [ User: tng_migration_user - Total duration: 2s861ms - Times executed: 2 ]
[ Application: dbt - Total duration: 2s861ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__38"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__38__dbt_tmp" as ( -- suject (proband) patrici do kohorty HorPARK, Pilot ID: 38 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS role ("subject_id" int, "horpark__role" text, "horpark_patients__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS role ("subject_id" int, "horpark__state" text, "horpark_patients__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS activity ("subject_id" int, "horpark__activity_state" text, "horpark_patients__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS created_at ("subject_id" int, "horpark__created_at" text, "horpark_patients__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS accepted_at ("subject_id" int, "horpark__accepted_at" text, "horpark_patients__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS cancelled_at ("subject_id" int, "horpark__cancelled_at" text, "horpark_patients__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS revoked_at ("subject_id" int, "horpark__revoked_at" text, "horpark_patients__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS paused_at ("subject_id" int, "horpark__paused_at" text, "horpark_patients__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark_ic_urine_proband'), ('horpark_ic_venous_blood_proband'), ('horpark_patients_likvor_proband') $$ ) AS biomaterial_state ("subject_id" int, "horpark_ic_urine_proband" text, "horpark_ic_venous_blood_proband" text, "horpark_patients_likvor_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark_expozicni_dotaznik'), ('horpark_patients_chronicke_onemocneni'), ('horpark_patients_ic_pregnancy'), ('horpark_patients_krevni_podlitiny'), ('horpark_patients_krvaceni'), ('horpark_patients_ryma_astma_precitlivelost') $$ ) AS extra_state ("subject_id" int, "horpark_expozicni_dotaznik" text, "horpark_patients_chronicke_onemocneni" text, "horpark_patients_ic_pregnancy" text, "horpark_patients_krevni_podlitiny" text, "horpark_patients_krvaceni" text, "horpark_patients_ryma_astma_precitlivelost" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.horpark__role, psc_role.horpark_patients__role, psc_state.horpark__state, psc_state.horpark_patients__state, psc_activity_state.horpark__activity_state, psc_activity_state.horpark_patients__activity_state, psc_created_at.horpark__created_at, psc_created_at.horpark_patients__created_at, psc_accepted_at.horpark__accepted_at, psc_accepted_at.horpark_patients__accepted_at, psc_cancelled_at.horpark__cancelled_at, psc_cancelled_at.horpark_patients__cancelled_at, psc_revoked_at.horpark__revoked_at, psc_revoked_at.horpark_patients__revoked_at, psc_paused_at.horpark__paused_at, psc_paused_at.horpark_patients__paused_at, horpark_ic_urine_proband, horpark_ic_venous_blood_proband, horpark_patients_likvor_proband, horpark_expozicni_dotaznik, horpark_patients_chronicke_onemocneni, horpark_patients_ic_pregnancy, horpark_patients_krevni_podlitiny, horpark_patients_krvaceni, horpark_patients_ryma_astma_precitlivelost FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 38 -- Pilot ID );
Date: 2025-11-27 17:02:40 Duration: 1s931ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__38"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__38__dbt_tmp" as ( -- suject (proband) patrici do kohorty HorPARK, Pilot ID: 38 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS role ("subject_id" int, "horpark__role" text, "horpark_patients__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS role ("subject_id" int, "horpark__state" text, "horpark_patients__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS activity ("subject_id" int, "horpark__activity_state" text, "horpark_patients__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS created_at ("subject_id" int, "horpark__created_at" text, "horpark_patients__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS accepted_at ("subject_id" int, "horpark__accepted_at" text, "horpark_patients__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS cancelled_at ("subject_id" int, "horpark__cancelled_at" text, "horpark_patients__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS revoked_at ("subject_id" int, "horpark__revoked_at" text, "horpark_patients__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark'), ('horpark_patients') $$ ) AS paused_at ("subject_id" int, "horpark__paused_at" text, "horpark_patients__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark_ic_urine_proband'), ('horpark_ic_venous_blood_proband'), ('horpark_patients_likvor_proband') $$ ) AS biomaterial_state ("subject_id" int, "horpark_ic_urine_proband" text, "horpark_ic_venous_blood_proband" text, "horpark_patients_likvor_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 38 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('horpark_expozicni_dotaznik'), ('horpark_patients_chronicke_onemocneni'), ('horpark_patients_ic_pregnancy'), ('horpark_patients_krevni_podlitiny'), ('horpark_patients_krvaceni'), ('horpark_patients_ryma_astma_precitlivelost') $$ ) AS extra_state ("subject_id" int, "horpark_expozicni_dotaznik" text, "horpark_patients_chronicke_onemocneni" text, "horpark_patients_ic_pregnancy" text, "horpark_patients_krevni_podlitiny" text, "horpark_patients_krvaceni" text, "horpark_patients_ryma_astma_precitlivelost" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.horpark__role, psc_role.horpark_patients__role, psc_state.horpark__state, psc_state.horpark_patients__state, psc_activity_state.horpark__activity_state, psc_activity_state.horpark_patients__activity_state, psc_created_at.horpark__created_at, psc_created_at.horpark_patients__created_at, psc_accepted_at.horpark__accepted_at, psc_accepted_at.horpark_patients__accepted_at, psc_cancelled_at.horpark__cancelled_at, psc_cancelled_at.horpark_patients__cancelled_at, psc_revoked_at.horpark__revoked_at, psc_revoked_at.horpark_patients__revoked_at, psc_paused_at.horpark__paused_at, psc_paused_at.horpark_patients__paused_at, horpark_ic_urine_proband, horpark_ic_venous_blood_proband, horpark_patients_likvor_proband, horpark_expozicni_dotaznik, horpark_patients_chronicke_onemocneni, horpark_patients_ic_pregnancy, horpark_patients_krevni_podlitiny, horpark_patients_krvaceni, horpark_patients_ryma_astma_precitlivelost FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 38 -- Pilot ID );
Date: 2025-11-27 05:02:37 Duration: 930ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
14 1s349ms 1s498ms 1s423ms 2 2s847ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__1__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "tng_p08__role" text, "tng_p08_test__role" text, "tng_pilot_8__monitor__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "tng_p08__state" text, "tng_p08_test__state" text, "tng_pilot_8__monitor__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as activity ("subject_id" int, "tng_p08__activity_state" text, "tng_p08_test__activity_state" text, "tng_pilot_8__monitor__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as created_at ("subject_id" int, "tng_p08__created_at" text, "tng_p08_test__created_at" text, "tng_pilot_8__monitor__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "tng_p08__accepted_at" text, "tng_p08_test__accepted_at" text, "tng_pilot_8__monitor__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "tng_p08__cancelled_at" text, "tng_p08_test__cancelled_at" text, "tng_pilot_8__monitor__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "tng_p08__revoked_at" text, "tng_p08_test__revoked_at" text, "tng_pilot_8__monitor__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as paused_at ("subject_id" int, "tng_p08__paused_at" text, "tng_p08_test__paused_at" text, "tng_pilot_8__monitor__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "tng_p08_ic_buccal_swab_child" text, "tng_p08_ic_buccal_swab_mother" text, "tng_p08_ic_cord_blood_mother" text, "tng_p08_ic_drop_blood_child" text, "tng_p08_ic_stool_child" text, "tng_p08_ic_urine_mother" text, "tng_p08_ic_venous_blood_mother" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "tng_p08_ic_follow_up_studies" text, "tng_p08_ic_med_find" text, "tng_p08_test_ic_follow_up_studies" text, "tng_p08_test_ic_med_find" text, "tng_pilot_8__monitor_ic_follow_up_studies" text, "tng_pilot_8__monitor_ic_med_find" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.tng_p08__role, psc_role.tng_p08_test__role, psc_role.tng_pilot_8__monitor__role, psc_state.tng_p08__state, psc_state.tng_p08_test__state, psc_state.tng_pilot_8__monitor__state, psc_activity_state.tng_p08__activity_state, psc_activity_state.tng_p08_test__activity_state, psc_activity_state.tng_pilot_8__monitor__activity_state, psc_created_at.tng_p08__created_at, psc_created_at.tng_p08_test__created_at, psc_created_at.tng_pilot_8__monitor__created_at, psc_accepted_at.tng_p08__accepted_at, psc_accepted_at.tng_p08_test__accepted_at, psc_accepted_at.tng_pilot_8__monitor__accepted_at, psc_cancelled_at.tng_p08__cancelled_at, psc_cancelled_at.tng_p08_test__cancelled_at, psc_cancelled_at.tng_pilot_8__monitor__cancelled_at, psc_revoked_at.tng_p08__revoked_at, psc_revoked_at.tng_p08_test__revoked_at, psc_revoked_at.tng_pilot_8__monitor__revoked_at, psc_paused_at.tng_p08__paused_at, psc_paused_at.tng_p08_test__paused_at, psc_paused_at.tng_pilot_8__monitor__paused_at, tng_p08_ic_buccal_swab_child, tng_p08_ic_buccal_swab_mother, tng_p08_ic_cord_blood_mother, tng_p08_ic_drop_blood_child, tng_p08_ic_stool_child, tng_p08_ic_urine_mother, tng_p08_ic_venous_blood_mother, tng_p08_ic_follow_up_studies, tng_p08_ic_med_find, tng_p08_test_ic_follow_up_studies, tng_p08_test_ic_med_find, tng_pilot_8__monitor_ic_follow_up_studies, tng_pilot_8__monitor_ic_med_find from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #14
Day Hour Count Duration Avg duration Nov 27 05 1 1s349ms 1s349ms 17 1 1s498ms 1s498ms [ User: tng_migration_user - Total duration: 2s847ms - Times executed: 2 ]
[ Application: dbt - Total duration: 2s847ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__1"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__1__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot VIII, Pilot ID: 1 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS role ("subject_id" int, "tng_p08__role" text, "tng_p08_test__role" text, "tng_pilot_8__monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS role ("subject_id" int, "tng_p08__state" text, "tng_p08_test__state" text, "tng_pilot_8__monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS activity ("subject_id" int, "tng_p08__activity_state" text, "tng_p08_test__activity_state" text, "tng_pilot_8__monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS created_at ("subject_id" int, "tng_p08__created_at" text, "tng_p08_test__created_at" text, "tng_pilot_8__monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p08__accepted_at" text, "tng_p08_test__accepted_at" text, "tng_pilot_8__monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p08__cancelled_at" text, "tng_p08_test__cancelled_at" text, "tng_pilot_8__monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p08__revoked_at" text, "tng_p08_test__revoked_at" text, "tng_pilot_8__monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS paused_at ("subject_id" int, "tng_p08__paused_at" text, "tng_p08_test__paused_at" text, "tng_pilot_8__monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08_ic_buccal_swab_child'), ('tng_p08_ic_buccal_swab_mother'), ('tng_p08_ic_cord_blood_mother'), ('tng_p08_ic_drop_blood_child'), ('tng_p08_ic_stool_child'), ('tng_p08_ic_urine_mother'), ('tng_p08_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p08_ic_buccal_swab_child" text, "tng_p08_ic_buccal_swab_mother" text, "tng_p08_ic_cord_blood_mother" text, "tng_p08_ic_drop_blood_child" text, "tng_p08_ic_stool_child" text, "tng_p08_ic_urine_mother" text, "tng_p08_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08_ic_follow_up_studies'), ('tng_p08_ic_med_find'), ('tng_p08_test_ic_follow_up_studies'), ('tng_p08_test_ic_med_find'), ('tng_pilot_8__monitor_ic_follow_up_studies'), ('tng_pilot_8__monitor_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p08_ic_follow_up_studies" text, "tng_p08_ic_med_find" text, "tng_p08_test_ic_follow_up_studies" text, "tng_p08_test_ic_med_find" text, "tng_pilot_8__monitor_ic_follow_up_studies" text, "tng_pilot_8__monitor_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p08__role, psc_role.tng_p08_test__role, psc_role.tng_pilot_8__monitor__role, psc_state.tng_p08__state, psc_state.tng_p08_test__state, psc_state.tng_pilot_8__monitor__state, psc_activity_state.tng_p08__activity_state, psc_activity_state.tng_p08_test__activity_state, psc_activity_state.tng_pilot_8__monitor__activity_state, psc_created_at.tng_p08__created_at, psc_created_at.tng_p08_test__created_at, psc_created_at.tng_pilot_8__monitor__created_at, psc_accepted_at.tng_p08__accepted_at, psc_accepted_at.tng_p08_test__accepted_at, psc_accepted_at.tng_pilot_8__monitor__accepted_at, psc_cancelled_at.tng_p08__cancelled_at, psc_cancelled_at.tng_p08_test__cancelled_at, psc_cancelled_at.tng_pilot_8__monitor__cancelled_at, psc_revoked_at.tng_p08__revoked_at, psc_revoked_at.tng_p08_test__revoked_at, psc_revoked_at.tng_pilot_8__monitor__revoked_at, psc_paused_at.tng_p08__paused_at, psc_paused_at.tng_p08_test__paused_at, psc_paused_at.tng_pilot_8__monitor__paused_at, tng_p08_ic_buccal_swab_child, tng_p08_ic_buccal_swab_mother, tng_p08_ic_cord_blood_mother, tng_p08_ic_drop_blood_child, tng_p08_ic_stool_child, tng_p08_ic_urine_mother, tng_p08_ic_venous_blood_mother, tng_p08_ic_follow_up_studies, tng_p08_ic_med_find, tng_p08_test_ic_follow_up_studies, tng_p08_test_ic_med_find, tng_pilot_8__monitor_ic_follow_up_studies, tng_pilot_8__monitor_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 1 -- Pilot ID );
Date: 2025-11-27 17:02:24 Duration: 1s498ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__1"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__1__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot VIII, Pilot ID: 1 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS role ("subject_id" int, "tng_p08__role" text, "tng_p08_test__role" text, "tng_pilot_8__monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS role ("subject_id" int, "tng_p08__state" text, "tng_p08_test__state" text, "tng_pilot_8__monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS activity ("subject_id" int, "tng_p08__activity_state" text, "tng_p08_test__activity_state" text, "tng_pilot_8__monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS created_at ("subject_id" int, "tng_p08__created_at" text, "tng_p08_test__created_at" text, "tng_pilot_8__monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p08__accepted_at" text, "tng_p08_test__accepted_at" text, "tng_pilot_8__monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p08__cancelled_at" text, "tng_p08_test__cancelled_at" text, "tng_pilot_8__monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p08__revoked_at" text, "tng_p08_test__revoked_at" text, "tng_pilot_8__monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS paused_at ("subject_id" int, "tng_p08__paused_at" text, "tng_p08_test__paused_at" text, "tng_pilot_8__monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08_ic_buccal_swab_child'), ('tng_p08_ic_buccal_swab_mother'), ('tng_p08_ic_cord_blood_mother'), ('tng_p08_ic_drop_blood_child'), ('tng_p08_ic_stool_child'), ('tng_p08_ic_urine_mother'), ('tng_p08_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p08_ic_buccal_swab_child" text, "tng_p08_ic_buccal_swab_mother" text, "tng_p08_ic_cord_blood_mother" text, "tng_p08_ic_drop_blood_child" text, "tng_p08_ic_stool_child" text, "tng_p08_ic_urine_mother" text, "tng_p08_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08_ic_follow_up_studies'), ('tng_p08_ic_med_find'), ('tng_p08_test_ic_follow_up_studies'), ('tng_p08_test_ic_med_find'), ('tng_pilot_8__monitor_ic_follow_up_studies'), ('tng_pilot_8__monitor_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p08_ic_follow_up_studies" text, "tng_p08_ic_med_find" text, "tng_p08_test_ic_follow_up_studies" text, "tng_p08_test_ic_med_find" text, "tng_pilot_8__monitor_ic_follow_up_studies" text, "tng_pilot_8__monitor_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p08__role, psc_role.tng_p08_test__role, psc_role.tng_pilot_8__monitor__role, psc_state.tng_p08__state, psc_state.tng_p08_test__state, psc_state.tng_pilot_8__monitor__state, psc_activity_state.tng_p08__activity_state, psc_activity_state.tng_p08_test__activity_state, psc_activity_state.tng_pilot_8__monitor__activity_state, psc_created_at.tng_p08__created_at, psc_created_at.tng_p08_test__created_at, psc_created_at.tng_pilot_8__monitor__created_at, psc_accepted_at.tng_p08__accepted_at, psc_accepted_at.tng_p08_test__accepted_at, psc_accepted_at.tng_pilot_8__monitor__accepted_at, psc_cancelled_at.tng_p08__cancelled_at, psc_cancelled_at.tng_p08_test__cancelled_at, psc_cancelled_at.tng_pilot_8__monitor__cancelled_at, psc_revoked_at.tng_p08__revoked_at, psc_revoked_at.tng_p08_test__revoked_at, psc_revoked_at.tng_pilot_8__monitor__revoked_at, psc_paused_at.tng_p08__paused_at, psc_paused_at.tng_p08_test__paused_at, psc_paused_at.tng_pilot_8__monitor__paused_at, tng_p08_ic_buccal_swab_child, tng_p08_ic_buccal_swab_mother, tng_p08_ic_cord_blood_mother, tng_p08_ic_drop_blood_child, tng_p08_ic_stool_child, tng_p08_ic_urine_mother, tng_p08_ic_venous_blood_mother, tng_p08_ic_follow_up_studies, tng_p08_ic_med_find, tng_p08_test_ic_follow_up_studies, tng_p08_test_ic_med_find, tng_pilot_8__monitor_ic_follow_up_studies, tng_pilot_8__monitor_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 1 -- Pilot ID );
Date: 2025-11-27 05:02:21 Duration: 1s349ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
15 1s150ms 2s341ms 1s288ms 189 4m3s refresh materialized view core.mv_subject_form with data;Times Reported Time consuming queries #15
Day Hour Count Duration Avg duration Nov 27 05 10 12s912ms 1s291ms 06 10 12s836ms 1s283ms 07 10 12s994ms 1s299ms 08 10 12s956ms 1s295ms 09 10 13s400ms 1s340ms 10 10 12s487ms 1s248ms 11 10 12s594ms 1s259ms 12 10 14s931ms 1s493ms 13 10 13s661ms 1s366ms 14 10 12s469ms 1s246ms 15 10 13s49ms 1s304ms 16 10 12s322ms 1s232ms 17 9 11s80ms 1s231ms 18 10 12s521ms 1s252ms 19 10 12s663ms 1s266ms 20 10 13s30ms 1s303ms 21 10 12s341ms 1s234ms 22 10 12s658ms 1s265ms 23 10 12s634ms 1s263ms [ User: tng_migration_user - Total duration: 4m3s - Times executed: 189 ]
[ Application: [unknown] - Total duration: 4m3s - Times executed: 189 ]
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-27 13:12:03 Duration: 2s341ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-27 15:06:03 Duration: 2s201ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-27 12:12:03 Duration: 2s29ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
16 115ms 384ms 140ms 126 17s699ms refresh materialized view core.mv_subject_event with data;Times Reported Time consuming queries #16
Day Hour Count Duration Avg duration Nov 27 06 7 913ms 130ms 07 7 1s324ms 189ms 08 7 1s10ms 144ms 09 7 1s53ms 150ms 10 7 901ms 128ms 11 7 893ms 127ms 12 7 956ms 136ms 13 7 905ms 129ms 14 7 1s24ms 146ms 15 7 918ms 131ms 16 7 975ms 139ms 17 7 887ms 126ms 18 7 923ms 131ms 19 7 906ms 129ms 20 7 897ms 128ms 21 7 954ms 136ms 22 7 1s108ms 158ms 23 7 1s144ms 163ms [ User: tng_migration_user - Total duration: 17s699ms - Times executed: 126 ]
[ Application: [unknown] - Total duration: 17s699ms - Times executed: 126 ]
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-11-27 07:05:02 Duration: 384ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-11-27 23:05:01 Duration: 373ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-11-27 07:59:01 Duration: 314ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
17 37ms 254ms 86ms 160 13s916ms with values as ( select label as value from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? group by label order by ? ) select value from values;Times Reported Time consuming queries #17
Day Hour Count Duration Avg duration Nov 27 05 80 6s170ms 77ms 17 80 7s746ms 96ms [ User: tng_migration_user - Total duration: 13s916ms - Times executed: 160 ]
[ Application: dbt - Total duration: 13s916ms - Times executed: 160 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-11-27 17:02:25 Duration: 254ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-11-27 17:02:25 Duration: 221ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-11-27 05:02:23 Duration: 208ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
18 31ms 175ms 81ms 156 12s763ms with values as ( select label as value from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? group by label order by ? ) select value from values;Times Reported Time consuming queries #18
Day Hour Count Duration Avg duration Nov 27 05 78 5s497ms 70ms 17 78 7s266ms 93ms [ User: tng_migration_user - Total duration: 12s763ms - Times executed: 156 ]
[ Application: dbt - Total duration: 12s763ms - Times executed: 156 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__21"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 21 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-11-27 17:02:27 Duration: 175ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__21"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 21 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-11-27 17:02:27 Duration: 165ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__22"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 22 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-11-27 17:02:27 Duration: 164ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
19 0ms 977ms 3ms 3,156 12s6ms commit;Times Reported Time consuming queries #19
Day Hour Count Duration Avg duration Nov 27 00 100 298ms 2ms 05 657 3s799ms 5ms 06 417 760ms 1ms 07 137 158ms 1ms 08 126 290ms 2ms 09 109 242ms 2ms 10 122 145ms 1ms 11 114 306ms 2ms 12 123 169ms 1ms 13 106 205ms 1ms 14 104 180ms 1ms 15 109 174ms 1ms 16 111 1s146ms 10ms 17 147 2s779ms 18ms 18 123 258ms 2ms 19 107 211ms 1ms 20 104 136ms 1ms 21 105 329ms 3ms 22 118 282ms 2ms 23 117 128ms 1ms [ User: tng_migration_user - Total duration: 12s6ms - Times executed: 3156 ]
[ Application: [unknown] - Total duration: 6s737ms - Times executed: 3062 ]
[ Application: dbt - Total duration: 5s268ms - Times executed: 94 ]
-
COMMIT;
Date: 2025-11-27 17:02:25 Duration: 977ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
COMMIT;
Date: 2025-11-27 17:02:25 Duration: 898ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
COMMIT;
Date: 2025-11-27 16:23:02 Duration: 819ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
20 0ms 3ms 0ms 22,113 12s369ms select m0_.id as id_0, m0_.result_date as result_date_1, m0_.use_alternative as use_alternative_2, m0_.subject_subcohort_id as subject_subcohort_id_3, m0_.subject_id as subject_id_4, m0_.subject_about_id as subject_about_id_5, m0_.subject_extend_id as subject_extend_id_6, m0_.subject_role_code as subject_role_code_7, m0_.timeing_t0_type_code as timeing_t0_type_code_8, m0_.pilot_id as pilot_id_9, m0_.subcohort_id as subcohort_id_10, m0_.subject_subcohort_id as subject_subcohort_id_11, m0_.form_structure_variant_id as form_structure_variant_id_12, m0_.form_id as form_id_13, m0_.form_state_code as form_state_code_14 from core.mv_subject_form m0_ where m0_.form_structure_variant_id in (...) and m0_.form_id is null and m0_.result_date <= ? and m0_.use_alternative <> ?;Times Reported Time consuming queries #20
Day Hour Count Duration Avg duration Nov 27 05 1,170 649ms 0ms 06 1,170 658ms 0ms 07 1,170 669ms 0ms 08 1,170 639ms 0ms 09 1,170 632ms 0ms 10 1,170 639ms 0ms 11 1,170 657ms 0ms 12 1,170 673ms 0ms 13 1,170 670ms 0ms 14 1,170 669ms 0ms 15 1,170 646ms 0ms 16 1,170 641ms 0ms 17 1,053 587ms 0ms 18 1,170 653ms 0ms 19 1,170 679ms 0ms 20 1,170 657ms 0ms 21 1,170 645ms 0ms 22 1,170 658ms 0ms 23 1,170 640ms 0ms [ User: tng_migration_user - Total duration: 12s369ms - Times executed: 22113 ]
[ Application: [unknown] - Total duration: 12s369ms - Times executed: 22113 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('82') AND m0_.form_id IS NULL AND m0_.result_date <= '2021-12-13 12:30:01' AND m0_.use_alternative <> 't';
Date: 2025-11-27 12:30:03 Duration: 3ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('80') AND m0_.form_id IS NULL AND m0_.result_date <= '2020-12-13 12:30:01' AND m0_.use_alternative <> 't';
Date: 2025-11-27 12:30:03 Duration: 3ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('83') AND m0_.form_id IS NULL AND m0_.result_date <= '2020-12-13 12:30:01' AND m0_.use_alternative <> 't';
Date: 2025-11-27 12:30:03 Duration: 3ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
Time consuming prepare
Rank Total duration Times executed Min duration Max duration Avg duration Query 1 13s125ms 15,799 0ms 16ms 0ms SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;Times Reported Time consuming prepare #1
Day Hour Count Duration Avg duration Nov 27 04 319 270ms 0ms 05 360 292ms 0ms 06 360 302ms 0ms 07 360 310ms 0ms 08 360 308ms 0ms 09 360 304ms 0ms 10 360 308ms 0ms 11 360 300ms 0ms 12 360 301ms 0ms 13 360 310ms 0ms 14 360 304ms 0ms 15 360 307ms 0ms 16 360 312ms 0ms 17 360 305ms 0ms 18 360 295ms 0ms 19 360 313ms 0ms 20 360 317ms 0ms 21 360 280ms 0ms 22 360 288ms 0ms 23 360 301ms 0ms Nov 27 00 360 301ms 0ms 01 360 305ms 0ms 02 360 299ms 0ms 03 360 302ms 0ms 04 360 289ms 0ms 05 360 292ms 0ms 06 360 299ms 0ms 07 360 312ms 0ms 08 360 296ms 0ms 09 360 293ms 0ms 10 360 285ms 0ms 11 360 287ms 0ms 12 360 291ms 0ms 13 360 290ms 0ms 14 360 288ms 0ms 15 360 290ms 0ms 16 360 281ms 0ms 17 360 307ms 0ms 18 360 303ms 0ms 19 360 308ms 0ms 20 360 299ms 0ms 21 360 282ms 0ms 22 360 285ms 0ms 23 360 295ms 0ms [ User: tng_migration_user - Total duration: 2s24ms - Times executed: 15799 ]
[ Application: [unknown] - Total duration: 2s24ms - Times executed: 15799 ]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-11-27 17:02:25 Duration: 16ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-11-27 23:19:42 Duration: 5ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-11-26 19:25:17 Duration: 5ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
2 6s971ms 17,396 0ms 25ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = $1 LIMIT 1;Times Reported Time consuming prepare #2
Day Hour Count Duration Avg duration 03 319 135ms 0ms 04 360 148ms 0ms 05 642 166ms 0ms 06 390 159ms 0ms 07 390 159ms 0ms 08 390 159ms 0ms 09 390 159ms 0ms 10 390 157ms 0ms 11 390 160ms 0ms 12 390 163ms 0ms 13 390 159ms 0ms 14 390 163ms 0ms 15 390 161ms 0ms 16 386 161ms 0ms 17 400 158ms 0ms 18 390 160ms 0ms 19 390 166ms 0ms 20 390 154ms 0ms 21 390 157ms 0ms 22 390 160ms 0ms 23 360 150ms 0ms 00 360 150ms 0ms 01 360 148ms 0ms 02 360 151ms 0ms 03 360 146ms 0ms 04 360 147ms 0ms 05 652 170ms 0ms 06 390 164ms 0ms 07 390 159ms 0ms 08 390 158ms 0ms 09 392 156ms 0ms 10 390 157ms 0ms 11 390 157ms 0ms 12 390 156ms 0ms 13 390 154ms 0ms 14 390 156ms 0ms 15 390 151ms 0ms 16 385 183ms 0ms 17 390 166ms 0ms 18 390 166ms 0ms 19 390 163ms 0ms 20 390 158ms 0ms 21 390 160ms 0ms 22 390 160ms 0ms [ User: tng_migration_user - Total duration: 405ms - Times executed: 17396 ]
[ Application: [unknown] - Total duration: 405ms - Times executed: 17396 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = $1 LIMIT 1;
Date: 2025-11-27 17:02:25 Duration: 25ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = $1 LIMIT 1;
Date: 2025-11-26 04:37:15 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = $1 LIMIT 1;
Date: 2025-11-26 22:45:15 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
3 5s883ms 118,167 0ms 1ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_type t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_type_code WHERE core.notif_type_state.notif_state_code = $1;Times Reported Time consuming prepare #3
Day Hour Count Duration Avg duration 03 2,233 113ms 0ms 04 2,527 125ms 0ms 05 2,737 136ms 0ms 06 2,730 135ms 0ms 07 2,730 136ms 0ms 08 2,730 135ms 0ms 09 2,730 135ms 0ms 10 2,730 136ms 0ms 11 2,730 138ms 0ms 12 2,730 137ms 0ms 13 2,730 137ms 0ms 14 2,730 138ms 0ms 15 2,730 136ms 0ms 16 2,702 135ms 0ms 17 2,737 135ms 0ms 18 2,730 136ms 0ms 19 2,730 138ms 0ms 20 2,730 133ms 0ms 21 2,730 136ms 0ms 22 2,730 136ms 0ms 23 2,520 126ms 0ms 00 2,520 125ms 0ms 01 2,520 124ms 0ms 02 2,520 126ms 0ms 03 2,520 124ms 0ms 04 2,527 124ms 0ms 05 2,737 136ms 0ms 06 2,730 135ms 0ms 07 2,730 135ms 0ms 08 2,730 135ms 0ms 09 2,772 136ms 0ms 10 2,730 136ms 0ms 11 2,730 134ms 0ms 12 2,730 135ms 0ms 13 2,730 134ms 0ms 14 2,730 135ms 0ms 15 2,730 133ms 0ms 16 2,695 134ms 0ms 17 2,730 136ms 0ms 18 2,730 136ms 0ms 19 2,730 136ms 0ms 20 2,730 134ms 0ms 21 2,730 135ms 0ms 22 2,730 134ms 0ms [ User: tng_migration_user - Total duration: 2s160ms - Times executed: 118167 ]
[ Application: [unknown] - Total duration: 2s160ms - Times executed: 118167 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_type t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_type_code WHERE core.notif_type_state.notif_state_code = $1;
Date: 2025-11-26 20:39:16 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_type t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_type_code WHERE core.notif_type_state.notif_state_code = $1;
Date: 2025-11-26 20:17:17 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_type t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_type_code WHERE core.notif_type_state.notif_state_code = $1;
Date: 2025-11-27 21:47:25 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
4 3s523ms 15,799 0ms 28ms 0ms SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = $1 AND n0_.processed_time >= $2;Times Reported Time consuming prepare #4
Day Hour Count Duration Avg duration 03 319 70ms 0ms 04 360 76ms 0ms 05 360 74ms 0ms 06 360 79ms 0ms 07 360 78ms 0ms 08 360 77ms 0ms 09 360 77ms 0ms 10 360 78ms 0ms 11 360 77ms 0ms 12 360 79ms 0ms 13 360 78ms 0ms 14 360 80ms 0ms 15 360 80ms 0ms 16 360 78ms 0ms 17 360 75ms 0ms 18 360 78ms 0ms 19 360 80ms 0ms 20 360 74ms 0ms 21 360 76ms 0ms 22 360 76ms 0ms 23 360 78ms 0ms 00 360 78ms 0ms 01 360 77ms 0ms 02 360 77ms 0ms 03 360 74ms 0ms 04 360 74ms 0ms 05 360 77ms 0ms 06 360 80ms 0ms 07 360 77ms 0ms 08 360 75ms 0ms 09 360 74ms 0ms 10 360 75ms 0ms 11 360 76ms 0ms 12 360 75ms 0ms 13 360 75ms 0ms 14 360 75ms 0ms 15 360 73ms 0ms 16 360 120ms 0ms 17 360 94ms 0ms 18 360 96ms 0ms 19 360 93ms 0ms 20 360 88ms 0ms 21 360 90ms 0ms 22 360 90ms 0ms [ User: tng_migration_user - Total duration: 3s861ms - Times executed: 15799 ]
[ Application: [unknown] - Total duration: 3s861ms - Times executed: 15799 ]
-
SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = $1 AND n0_.processed_time >= $2;
Date: 2025-11-27 17:02:25 Duration: 28ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = $1 AND n0_.processed_time >= $2;
Date: 2025-11-26 11:15:16 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = $1 AND n0_.processed_time >= $2;
Date: 2025-11-27 06:09:16 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
5 3s96ms 18,402 0ms 2ms 0ms SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 WHERE t0.disabled = $1 AND t0.locked = $2 ORDER BY t0.priority DESC;Times Reported Time consuming prepare #5
Day Hour Count Duration Avg duration 03 372 64ms 0ms 04 410 61ms 0ms 05 420 69ms 0ms 06 420 72ms 0ms 07 420 70ms 0ms 08 420 72ms 0ms 09 420 73ms 0ms 10 420 70ms 0ms 11 420 69ms 0ms 12 420 70ms 0ms 13 420 70ms 0ms 14 420 73ms 0ms 15 420 71ms 0ms 16 411 68ms 0ms 17 420 75ms 0ms 18 420 74ms 0ms 19 420 72ms 0ms 20 420 69ms 0ms 21 420 70ms 0ms 22 420 72ms 0ms 23 420 73ms 0ms 00 420 74ms 0ms 01 420 74ms 0ms 02 420 73ms 0ms 03 420 72ms 0ms 04 419 71ms 0ms 05 420 70ms 0ms 06 420 73ms 0ms 07 420 67ms 0ms 08 420 69ms 0ms 09 420 68ms 0ms 10 420 69ms 0ms 11 420 69ms 0ms 12 420 68ms 0ms 13 420 68ms 0ms 14 420 69ms 0ms 15 420 68ms 0ms 16 410 62ms 0ms 17 420 72ms 0ms 18 420 70ms 0ms 19 420 70ms 0ms 20 420 67ms 0ms 21 420 69ms 0ms 22 420 68ms 0ms [ User: tng_migration_user - Total duration: 641ms - Times executed: 18402 ]
[ Application: [unknown] - Total duration: 641ms - Times executed: 18402 ]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 WHERE t0.disabled = $1 AND t0.locked = $2 ORDER BY t0.priority DESC;
Date: 2025-11-27 02:28:01 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 WHERE t0.disabled = $1 AND t0.locked = $2 ORDER BY t0.priority DESC;
Date: 2025-11-26 07:23:01 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 WHERE t0.disabled = $1 AND t0.locked = $2 ORDER BY t0.priority DESC;
Date: 2025-11-26 10:11:01 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
6 2s951ms 60,779 0ms 0ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.name AS name_5, t0.description AS description_6, t0.is_automatic AS is_automatic_7, t0.is_recruitment AS is_recruitment_8, t0.is_welcome AS is_welcome_9, t0.welcome_message AS welcome_message_10, t0.biobank_id AS biobank_id_11, t0.owner_user_id AS owner_user_id_12, t0.owner_group_id AS owner_group_id_13, t0.pilot_id AS pilot_id_14, t0.subcohort_state_code AS subcohort_state_code_15, t0.inform_consent_id AS inform_consent_id_16 FROM core.subcohort t0 INNER JOIN core.subcohort_form_structure_variant ON t0.id = core.subcohort_form_structure_variant.subcohort_id WHERE core.subcohort_form_structure_variant.form_structure_variant_id = $1;Times Reported Time consuming prepare #6
Day Hour Count Duration Avg duration 04 1,386 65ms 0ms 05 1,540 71ms 0ms 06 1,558 73ms 0ms 07 1,804 86ms 0ms 08 1,699 84ms 0ms 09 1,540 71ms 0ms 10 1,885 99ms 0ms 11 1,582 76ms 0ms 12 1,592 75ms 0ms 13 1,636 79ms 0ms 14 1,561 77ms 0ms 15 1,643 79ms 0ms 16 1,386 66ms 0ms 17 1,688 83ms 0ms 18 1,564 74ms 0ms 19 1,585 76ms 0ms 20 1,672 80ms 0ms 21 1,830 94ms 0ms 22 1,540 74ms 0ms 04 1,540 77ms 0ms 05 1,540 71ms 0ms 06 1,705 84ms 0ms 07 1,649 81ms 0ms 08 1,543 74ms 0ms 09 1,609 79ms 0ms 10 1,572 75ms 0ms 11 1,674 79ms 0ms 12 1,540 74ms 0ms 13 1,540 75ms 0ms 14 1,604 80ms 0ms 15 1,555 72ms 0ms 16 1,441 69ms 0ms 17 1,684 81ms 0ms 18 1,541 74ms 0ms 19 1,540 73ms 0ms 20 1,540 72ms 0ms 21 1,615 79ms 0ms 22 1,656 81ms 0ms [ User: tng_migration_user - Total duration: 1s698ms - Times executed: 60779 ]
[ Application: [unknown] - Total duration: 1s698ms - Times executed: 60779 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.name AS name_5, t0.description AS description_6, t0.is_automatic AS is_automatic_7, t0.is_recruitment AS is_recruitment_8, t0.is_welcome AS is_welcome_9, t0.welcome_message AS welcome_message_10, t0.biobank_id AS biobank_id_11, t0.owner_user_id AS owner_user_id_12, t0.owner_group_id AS owner_group_id_13, t0.pilot_id AS pilot_id_14, t0.subcohort_state_code AS subcohort_state_code_15, t0.inform_consent_id AS inform_consent_id_16 FROM core.subcohort t0 INNER JOIN core.subcohort_form_structure_variant ON t0.id = core.subcohort_form_structure_variant.subcohort_id WHERE core.subcohort_form_structure_variant.form_structure_variant_id = $1;
Date: 2025-11-26 08:42:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.name AS name_5, t0.description AS description_6, t0.is_automatic AS is_automatic_7, t0.is_recruitment AS is_recruitment_8, t0.is_welcome AS is_welcome_9, t0.welcome_message AS welcome_message_10, t0.biobank_id AS biobank_id_11, t0.owner_user_id AS owner_user_id_12, t0.owner_group_id AS owner_group_id_13, t0.pilot_id AS pilot_id_14, t0.subcohort_state_code AS subcohort_state_code_15, t0.inform_consent_id AS inform_consent_id_16 FROM core.subcohort t0 INNER JOIN core.subcohort_form_structure_variant ON t0.id = core.subcohort_form_structure_variant.subcohort_id WHERE core.subcohort_form_structure_variant.form_structure_variant_id = $1;
Date: 2025-11-26 18:42:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.name AS name_5, t0.description AS description_6, t0.is_automatic AS is_automatic_7, t0.is_recruitment AS is_recruitment_8, t0.is_welcome AS is_welcome_9, t0.welcome_message AS welcome_message_10, t0.biobank_id AS biobank_id_11, t0.owner_user_id AS owner_user_id_12, t0.owner_group_id AS owner_group_id_13, t0.pilot_id AS pilot_id_14, t0.subcohort_state_code AS subcohort_state_code_15, t0.inform_consent_id AS inform_consent_id_16 FROM core.subcohort t0 INNER JOIN core.subcohort_form_structure_variant ON t0.id = core.subcohort_form_structure_variant.subcohort_id WHERE core.subcohort_form_structure_variant.form_structure_variant_id = $1;
Date: 2025-11-26 11:57:07 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
7 2s773ms 15,799 0ms 2ms 0ms SELECT s0_.id AS id_0, s0_.version AS version_1, s0_.created_at AS created_at_2, s0_.name AS name_3, s0_.command AS command_4, s0_.arguments AS arguments_5, s0_.cron_expression AS cron_expression_6, s0_.last_execution AS last_execution_7, s0_.last_return_code AS last_return_code_8, s0_.log_file AS log_file_9, s0_.priority AS priority_10, s0_.execute_immediately AS execute_immediately_11, s0_.disabled AS disabled_12, s0_.locked AS locked_13, s0_.ping_back_url AS ping_back_url_14, s0_.ping_back_failed_url AS ping_back_failed_url_15, s0_.notes AS notes_16 FROM scheduled_command s0_ WHERE s0_.disabled = $1 AND s0_.last_return_code <> $2;Times Reported Time consuming prepare #7
Day Hour Count Duration Avg duration 03 319 58ms 0ms 04 360 62ms 0ms 05 360 62ms 0ms 06 360 63ms 0ms 07 360 63ms 0ms 08 360 63ms 0ms 09 360 63ms 0ms 10 360 61ms 0ms 11 360 62ms 0ms 12 360 64ms 0ms 13 360 63ms 0ms 14 360 65ms 0ms 15 360 64ms 0ms 16 360 66ms 0ms 17 360 62ms 0ms 18 360 64ms 0ms 19 360 66ms 0ms 20 360 60ms 0ms 21 360 61ms 0ms 22 360 63ms 0ms 23 360 63ms 0ms 00 360 64ms 0ms 01 360 63ms 0ms 02 360 66ms 0ms 03 360 62ms 0ms 04 360 61ms 0ms 05 360 63ms 0ms 06 360 66ms 0ms 07 360 64ms 0ms 08 360 62ms 0ms 09 360 61ms 0ms 10 360 61ms 0ms 11 360 63ms 0ms 12 360 62ms 0ms 13 360 61ms 0ms 14 360 61ms 0ms 15 360 60ms 0ms 16 360 64ms 0ms 17 360 63ms 0ms 18 360 64ms 0ms 19 360 62ms 0ms 20 360 59ms 0ms 21 360 60ms 0ms 22 360 60ms 0ms [ User: tng_migration_user - Total duration: 242ms - Times executed: 15799 ]
[ Application: [unknown] - Total duration: 242ms - Times executed: 15799 ]
-
SELECT s0_.id AS id_0, s0_.version AS version_1, s0_.created_at AS created_at_2, s0_.name AS name_3, s0_.command AS command_4, s0_.arguments AS arguments_5, s0_.cron_expression AS cron_expression_6, s0_.last_execution AS last_execution_7, s0_.last_return_code AS last_return_code_8, s0_.log_file AS log_file_9, s0_.priority AS priority_10, s0_.execute_immediately AS execute_immediately_11, s0_.disabled AS disabled_12, s0_.locked AS locked_13, s0_.ping_back_url AS ping_back_url_14, s0_.ping_back_failed_url AS ping_back_failed_url_15, s0_.notes AS notes_16 FROM scheduled_command s0_ WHERE s0_.disabled = $1 AND s0_.last_return_code <> $2;
Date: 2025-11-27 17:02:25 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT s0_.id AS id_0, s0_.version AS version_1, s0_.created_at AS created_at_2, s0_.name AS name_3, s0_.command AS command_4, s0_.arguments AS arguments_5, s0_.cron_expression AS cron_expression_6, s0_.last_execution AS last_execution_7, s0_.last_return_code AS last_return_code_8, s0_.log_file AS log_file_9, s0_.priority AS priority_10, s0_.execute_immediately AS execute_immediately_11, s0_.disabled AS disabled_12, s0_.locked AS locked_13, s0_.ping_back_url AS ping_back_url_14, s0_.ping_back_failed_url AS ping_back_failed_url_15, s0_.notes AS notes_16 FROM scheduled_command s0_ WHERE s0_.disabled = $1 AND s0_.last_return_code <> $2;
Date: 2025-11-27 12:48:42 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT s0_.id AS id_0, s0_.version AS version_1, s0_.created_at AS created_at_2, s0_.name AS name_3, s0_.command AS command_4, s0_.arguments AS arguments_5, s0_.cron_expression AS cron_expression_6, s0_.last_execution AS last_execution_7, s0_.last_return_code AS last_return_code_8, s0_.log_file AS log_file_9, s0_.priority AS priority_10, s0_.execute_immediately AS execute_immediately_11, s0_.disabled AS disabled_12, s0_.locked AS locked_13, s0_.ping_back_url AS ping_back_url_14, s0_.ping_back_failed_url AS ping_back_failed_url_15, s0_.notes AS notes_16 FROM scheduled_command s0_ WHERE s0_.disabled = $1 AND s0_.last_return_code <> $2;
Date: 2025-11-26 17:18:16 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
8 2s470ms 67,524 0ms 0ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = $1;Times Reported Time consuming prepare #8
Day Hour Count Duration Avg duration 03 1,276 47ms 0ms 04 1,444 52ms 0ms 05 1,564 57ms 0ms 06 1,560 56ms 0ms 07 1,560 57ms 0ms 08 1,560 56ms 0ms 09 1,560 56ms 0ms 10 1,560 57ms 0ms 11 1,560 57ms 0ms 12 1,560 57ms 0ms 13 1,560 57ms 0ms 14 1,560 57ms 0ms 15 1,560 56ms 0ms 16 1,544 56ms 0ms 17 1,564 56ms 0ms 18 1,560 56ms 0ms 19 1,560 57ms 0ms 20 1,560 57ms 0ms 21 1,560 57ms 0ms 22 1,560 56ms 0ms 23 1,440 52ms 0ms 00 1,440 52ms 0ms 01 1,440 52ms 0ms 02 1,440 52ms 0ms 03 1,440 53ms 0ms 04 1,444 52ms 0ms 05 1,564 57ms 0ms 06 1,560 56ms 0ms 07 1,560 56ms 0ms 08 1,560 56ms 0ms 09 1,584 57ms 0ms 10 1,560 57ms 0ms 11 1,560 56ms 0ms 12 1,560 56ms 0ms 13 1,560 56ms 0ms 14 1,560 56ms 0ms 15 1,560 57ms 0ms 16 1,540 55ms 0ms 17 1,560 56ms 0ms 18 1,560 57ms 0ms 19 1,560 57ms 0ms 20 1,560 56ms 0ms 21 1,560 57ms 0ms 22 1,560 57ms 0ms [ User: tng_migration_user - Total duration: 1s96ms - Times executed: 67524 ]
[ Application: [unknown] - Total duration: 1s96ms - Times executed: 67524 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = $1;
Date: 2025-11-27 02:47:15 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = $1;
Date: 2025-11-26 04:12:42 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = $1;
Date: 2025-11-27 00:07:14 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
9 2s124ms 44,109 0ms 1ms 0ms SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ($1) AND m0_.form_id IS NULL AND m0_.result_date <= $2 AND m0_.use_alternative <> $3;Times Reported Time consuming prepare #9
Day Hour Count Duration Avg duration 04 1,053 50ms 0ms 05 1,170 56ms 0ms 06 1,170 57ms 0ms 07 1,170 56ms 0ms 08 1,170 56ms 0ms 09 1,170 56ms 0ms 10 1,170 57ms 0ms 11 1,170 56ms 0ms 12 1,170 56ms 0ms 13 1,170 57ms 0ms 14 1,170 57ms 0ms 15 1,170 57ms 0ms 16 1,053 49ms 0ms 17 1,170 54ms 0ms 18 1,170 55ms 0ms 19 1,170 56ms 0ms 20 1,170 55ms 0ms 21 1,170 57ms 0ms 22 1,170 56ms 0ms 04 1,170 56ms 0ms 05 1,170 57ms 0ms 06 1,170 58ms 0ms 07 1,170 55ms 0ms 08 1,170 54ms 0ms 09 1,170 55ms 0ms 10 1,170 57ms 0ms 11 1,170 56ms 0ms 12 1,170 57ms 0ms 13 1,170 57ms 0ms 14 1,170 55ms 0ms 15 1,170 55ms 0ms 16 1,053 49ms 0ms 17 1,170 55ms 0ms 18 1,170 56ms 0ms 19 1,170 56ms 0ms 20 1,170 55ms 0ms 21 1,170 56ms 0ms 22 1,170 54ms 0ms [ User: tng_migration_user - Total duration: 24s734ms - Times executed: 44109 ]
[ Application: [unknown] - Total duration: 24s734ms - Times executed: 44109 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ($1) AND m0_.form_id IS NULL AND m0_.result_date <= $2 AND m0_.use_alternative <> $3;
Date: 2025-11-27 14:48:02 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ($1) AND m0_.form_id IS NULL AND m0_.result_date <= $2 AND m0_.use_alternative <> $3;
Date: 2025-11-26 15:24:02 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ($1) AND m0_.form_id IS NULL AND m0_.result_date <= $2 AND m0_.use_alternative <> $3;
Date: 2025-11-26 07:24:03 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
10 1s488ms 20,236 0ms 1ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = $1;Times Reported Time consuming prepare #10
Day Hour Count Duration Avg duration 04 441 30ms 0ms 05 504 36ms 0ms 06 458 35ms 0ms 07 470 37ms 0ms 08 471 35ms 0ms 09 449 31ms 0ms 10 641 52ms 0ms 11 453 36ms 0ms 12 455 32ms 0ms 13 458 32ms 0ms 14 453 32ms 0ms 15 470 36ms 0ms 16 447 31ms 0ms 17 615 47ms 0ms 18 449 30ms 0ms 19 453 33ms 0ms 20 449 31ms 0ms 21 474 37ms 0ms 22 445 32ms 0ms 04 432 30ms 0ms 05 590 42ms 0ms 06 559 42ms 0ms 07 704 51ms 0ms 08 642 44ms 0ms 09 852 62ms 0ms 10 545 40ms 0ms 11 804 60ms 0ms 12 538 39ms 0ms 13 538 38ms 0ms 14 540 38ms 0ms 15 639 46ms 0ms 16 543 38ms 0ms 17 546 41ms 0ms 18 539 39ms 0ms 19 538 38ms 0ms 20 538 38ms 0ms 21 545 40ms 0ms 22 549 39ms 0ms [ User: tng_migration_user - Total duration: 378ms - Times executed: 20236 ]
[ Application: [unknown] - Total duration: 378ms - Times executed: 20236 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = $1;
Date: 2025-11-26 18:31:24 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = $1;
Date: 2025-11-26 09:58:56 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = $1;
Date: 2025-11-26 18:31:42 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
11 722ms 20,128 0ms 1ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = $1;Times Reported Time consuming prepare #11
Day Hour Count Duration Avg duration 04 596 20ms 0ms 05 524 18ms 0ms 06 524 20ms 0ms 07 527 19ms 0ms 08 531 20ms 0ms 09 522 18ms 0ms 10 533 21ms 0ms 11 526 21ms 0ms 12 524 18ms 0ms 13 523 17ms 0ms 14 523 17ms 0ms 15 525 18ms 0ms 16 520 19ms 0ms 17 524 21ms 0ms 18 521 17ms 0ms 19 522 18ms 0ms 20 520 18ms 0ms 21 528 19ms 0ms 22 519 18ms 0ms 04 585 20ms 0ms 05 528 18ms 0ms 06 534 20ms 0ms 07 531 18ms 0ms 08 527 17ms 0ms 09 527 18ms 0ms 10 531 18ms 0ms 11 527 19ms 0ms 12 527 18ms 0ms 13 527 18ms 0ms 14 527 18ms 0ms 15 527 18ms 0ms 16 529 18ms 0ms 17 529 19ms 0ms 18 527 18ms 0ms 19 527 19ms 0ms 20 527 17ms 0ms 21 529 18ms 0ms 22 530 17ms 0ms [ User: tng_migration_user - Total duration: 249ms - Times executed: 20128 ]
[ Application: [unknown] - Total duration: 249ms - Times executed: 20128 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = $1;
Date: 2025-11-26 18:31:42 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = $1;
Date: 2025-11-27 07:50:42 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = $1;
Date: 2025-11-26 18:38:20 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
12 586ms 828 0ms 2ms 0ms SELECT t0.ID AS id_1, t0.LOGIN AS login_2, t0.EMAIL AS email_3, t0.NAME AS name_4, t0.ACTIVE AS active_5, t0.AUTH_CODE AS auth_code_6, t0.IS_EMAIL_TWO_FACTOR_AUTHENTICATION AS is_email_two_factor_authentication_7, t0.TITLE_BEFORE AS title_before_8, t0.TITLE_AFTER AS title_after_9, t0.PHONE AS phone_10, t0.SALT AS salt_11, t0.PASSWORD AS password_12, t0.PASSWORD_HASH_ALGORITHM AS password_hash_algorithm_13, t0.PASSWORD_HASH_COST AS password_hash_cost_14, t0.INFO AS info_15, t0.INFO_PUBLIC AS info_public_16, t0.datecreated AS datecreated_17, t0.datechanged AS datechanged_18, t0.PASSWORD_EXPIRE AS password_expire_19, t0.PASSWORD_RESET_HASH AS password_reset_hash_20, t0.PASSWORD_RESET_HASH_VALIDITY AS password_reset_hash_validity_21, t0.CREDENTIALS_SENT_LAST_ON AS credentials_sent_last_on_22, t0.SEND_CREDENTIALS_IMMEDIATELY AS send_credentials_immediately_23, t0.DEACTIVATED_LAST_ON AS deactivated_last_on_24, t0.PASSWORD_CHANGED_LAST_ON AS password_changed_last_on_25, t0.EXPIRATION_EMAIL_SENT_LAST_ON AS expiration_email_sent_last_on_26, t0.OWNER_USER_ID AS owner_user_id_27, t0.OWNER_GROUP_ID AS owner_group_id_28, t0.userchanged AS userchanged_29 FROM ACL_user t0 WHERE t0.ID = $1;Times Reported Time consuming prepare #12
Day Hour Count Duration Avg duration 06 31 21ms 0ms 07 70 47ms 0ms 08 60 44ms 0ms 09 1 0ms 0ms 10 180 130ms 0ms 11 21 14ms 0ms 12 6 4ms 0ms 13 28 18ms 0ms 14 3 2ms 0ms 15 45 33ms 0ms 17 25 18ms 0ms 18 2 1ms 0ms 19 7 5ms 0ms 20 20 14ms 0ms 21 37 27ms 0ms 06 30 23ms 0ms 07 39 26ms 0ms 08 11 6ms 0ms 09 50 31ms 0ms 10 14 10ms 0ms 11 71 46ms 0ms 12 4 2ms 0ms 14 9 5ms 0ms 15 16 10ms 0ms 16 7 5ms 0ms 17 19 14ms 0ms 20 1 0ms 0ms 21 6 4ms 0ms 22 15 11ms 0ms [ User: tng_migration_user - Total duration: 42ms - Times executed: 828 ]
[ Application: [unknown] - Total duration: 42ms - Times executed: 828 ]
-
SELECT t0.ID AS id_1, t0.LOGIN AS login_2, t0.EMAIL AS email_3, t0.NAME AS name_4, t0.ACTIVE AS active_5, t0.AUTH_CODE AS auth_code_6, t0.IS_EMAIL_TWO_FACTOR_AUTHENTICATION AS is_email_two_factor_authentication_7, t0.TITLE_BEFORE AS title_before_8, t0.TITLE_AFTER AS title_after_9, t0.PHONE AS phone_10, t0.SALT AS salt_11, t0.PASSWORD AS password_12, t0.PASSWORD_HASH_ALGORITHM AS password_hash_algorithm_13, t0.PASSWORD_HASH_COST AS password_hash_cost_14, t0.INFO AS info_15, t0.INFO_PUBLIC AS info_public_16, t0.datecreated AS datecreated_17, t0.datechanged AS datechanged_18, t0.PASSWORD_EXPIRE AS password_expire_19, t0.PASSWORD_RESET_HASH AS password_reset_hash_20, t0.PASSWORD_RESET_HASH_VALIDITY AS password_reset_hash_validity_21, t0.CREDENTIALS_SENT_LAST_ON AS credentials_sent_last_on_22, t0.SEND_CREDENTIALS_IMMEDIATELY AS send_credentials_immediately_23, t0.DEACTIVATED_LAST_ON AS deactivated_last_on_24, t0.PASSWORD_CHANGED_LAST_ON AS password_changed_last_on_25, t0.EXPIRATION_EMAIL_SENT_LAST_ON AS expiration_email_sent_last_on_26, t0.OWNER_USER_ID AS owner_user_id_27, t0.OWNER_GROUP_ID AS owner_group_id_28, t0.userchanged AS userchanged_29 FROM ACL_user t0 WHERE t0.ID = $1;
Date: 2025-11-27 18:18:54 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.ID AS id_1, t0.LOGIN AS login_2, t0.EMAIL AS email_3, t0.NAME AS name_4, t0.ACTIVE AS active_5, t0.AUTH_CODE AS auth_code_6, t0.IS_EMAIL_TWO_FACTOR_AUTHENTICATION AS is_email_two_factor_authentication_7, t0.TITLE_BEFORE AS title_before_8, t0.TITLE_AFTER AS title_after_9, t0.PHONE AS phone_10, t0.SALT AS salt_11, t0.PASSWORD AS password_12, t0.PASSWORD_HASH_ALGORITHM AS password_hash_algorithm_13, t0.PASSWORD_HASH_COST AS password_hash_cost_14, t0.INFO AS info_15, t0.INFO_PUBLIC AS info_public_16, t0.datecreated AS datecreated_17, t0.datechanged AS datechanged_18, t0.PASSWORD_EXPIRE AS password_expire_19, t0.PASSWORD_RESET_HASH AS password_reset_hash_20, t0.PASSWORD_RESET_HASH_VALIDITY AS password_reset_hash_validity_21, t0.CREDENTIALS_SENT_LAST_ON AS credentials_sent_last_on_22, t0.SEND_CREDENTIALS_IMMEDIATELY AS send_credentials_immediately_23, t0.DEACTIVATED_LAST_ON AS deactivated_last_on_24, t0.PASSWORD_CHANGED_LAST_ON AS password_changed_last_on_25, t0.EXPIRATION_EMAIL_SENT_LAST_ON AS expiration_email_sent_last_on_26, t0.OWNER_USER_ID AS owner_user_id_27, t0.OWNER_GROUP_ID AS owner_group_id_28, t0.userchanged AS userchanged_29 FROM ACL_user t0 WHERE t0.ID = $1;
Date: 2025-11-26 16:20:04 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.ID AS id_1, t0.LOGIN AS login_2, t0.EMAIL AS email_3, t0.NAME AS name_4, t0.ACTIVE AS active_5, t0.AUTH_CODE AS auth_code_6, t0.IS_EMAIL_TWO_FACTOR_AUTHENTICATION AS is_email_two_factor_authentication_7, t0.TITLE_BEFORE AS title_before_8, t0.TITLE_AFTER AS title_after_9, t0.PHONE AS phone_10, t0.SALT AS salt_11, t0.PASSWORD AS password_12, t0.PASSWORD_HASH_ALGORITHM AS password_hash_algorithm_13, t0.PASSWORD_HASH_COST AS password_hash_cost_14, t0.INFO AS info_15, t0.INFO_PUBLIC AS info_public_16, t0.datecreated AS datecreated_17, t0.datechanged AS datechanged_18, t0.PASSWORD_EXPIRE AS password_expire_19, t0.PASSWORD_RESET_HASH AS password_reset_hash_20, t0.PASSWORD_RESET_HASH_VALIDITY AS password_reset_hash_validity_21, t0.CREDENTIALS_SENT_LAST_ON AS credentials_sent_last_on_22, t0.SEND_CREDENTIALS_IMMEDIATELY AS send_credentials_immediately_23, t0.DEACTIVATED_LAST_ON AS deactivated_last_on_24, t0.PASSWORD_CHANGED_LAST_ON AS password_changed_last_on_25, t0.EXPIRATION_EMAIL_SENT_LAST_ON AS expiration_email_sent_last_on_26, t0.OWNER_USER_ID AS owner_user_id_27, t0.OWNER_GROUP_ID AS owner_group_id_28, t0.userchanged AS userchanged_29 FROM ACL_user t0 WHERE t0.ID = $1;
Date: 2025-11-27 12:29:25 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
13 536ms 6,552 0ms 1ms 0ms SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date <= $7;Times Reported Time consuming prepare #13
Day Hour Count Duration Avg duration 05 182 14ms 0ms 06 182 14ms 0ms 07 182 15ms 0ms 08 182 14ms 0ms 09 182 14ms 0ms 10 182 15ms 0ms 11 182 16ms 0ms 12 182 15ms 0ms 13 182 15ms 0ms 14 182 15ms 0ms 15 182 15ms 0ms 16 182 14ms 0ms 17 182 14ms 0ms 18 182 15ms 0ms 19 182 15ms 0ms 20 182 14ms 0ms 21 182 14ms 0ms 22 182 15ms 0ms 05 182 15ms 0ms 06 182 14ms 0ms 07 182 14ms 0ms 08 182 14ms 0ms 09 182 14ms 0ms 10 182 15ms 0ms 11 182 15ms 0ms 12 182 14ms 0ms 13 182 15ms 0ms 14 182 14ms 0ms 15 182 15ms 0ms 16 182 15ms 0ms 17 182 15ms 0ms 18 182 14ms 0ms 19 182 14ms 0ms 20 182 14ms 0ms 21 182 14ms 0ms 22 182 14ms 0ms [ User: tng_migration_user - Total duration: 1s643ms - Times executed: 6552 ]
[ Application: [unknown] - Total duration: 1s643ms - Times executed: 6552 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date <= $7;
Date: 2025-11-27 06:14:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date <= $7;
Date: 2025-11-26 12:23:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date <= $7;
Date: 2025-11-27 11:05:02 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
14 528ms 8,568 0ms 0ms 0ms SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND (m0_.result_date BETWEEN $6 AND $7);Times Reported Time consuming prepare #14
Day Hour Count Duration Avg duration 05 238 14ms 0ms 06 238 14ms 0ms 07 238 14ms 0ms 08 238 14ms 0ms 09 238 14ms 0ms 10 238 15ms 0ms 11 238 15ms 0ms 12 238 15ms 0ms 13 238 14ms 0ms 14 238 14ms 0ms 15 238 14ms 0ms 16 238 14ms 0ms 17 238 14ms 0ms 18 238 14ms 0ms 19 238 14ms 0ms 20 238 14ms 0ms 21 238 14ms 0ms 22 238 14ms 0ms 05 238 14ms 0ms 06 238 15ms 0ms 07 238 14ms 0ms 08 238 14ms 0ms 09 238 14ms 0ms 10 238 15ms 0ms 11 238 15ms 0ms 12 238 14ms 0ms 13 238 14ms 0ms 14 238 14ms 0ms 15 238 15ms 0ms 16 238 15ms 0ms 17 238 14ms 0ms 18 238 14ms 0ms 19 238 14ms 0ms 20 238 14ms 0ms 21 238 14ms 0ms 22 238 14ms 0ms [ User: tng_migration_user - Total duration: 125ms - Times executed: 8568 ]
[ Application: [unknown] - Total duration: 125ms - Times executed: 8568 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND (m0_.result_date BETWEEN $6 AND $7);
Date: 2025-11-27 07:05:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND (m0_.result_date BETWEEN $6 AND $7);
Date: 2025-11-26 13:59:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND (m0_.result_date BETWEEN $6 AND $7);
Date: 2025-11-27 14:23:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
15 512ms 4,656 0ms 0ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.subject_inform_consent_state t0 WHERE t0.code = $1 LIMIT 1;Times Reported Time consuming prepare #15
Day Hour Count Duration Avg duration 04 36 4ms 0ms 05 68 7ms 0ms 06 164 16ms 0ms 07 292 28ms 0ms 08 208 21ms 0ms 09 68 8ms 0ms 10 460 44ms 0ms 11 104 12ms 0ms 12 92 11ms 0ms 13 128 14ms 0ms 14 84 11ms 0ms 15 180 18ms 0ms 16 60 8ms 0ms 17 136 14ms 0ms 18 76 9ms 0ms 19 92 11ms 0ms 20 104 11ms 0ms 21 188 19ms 0ms 22 68 8ms 0ms 04 40 5ms 0ms 05 68 7ms 0ms 06 148 14ms 0ms 07 148 14ms 0ms 08 96 10ms 0ms 09 208 21ms 0ms 10 88 10ms 0ms 11 272 25ms 0ms 12 68 8ms 0ms 13 68 8ms 0ms 14 100 11ms 0ms 15 120 12ms 0ms 16 80 10ms 0ms 17 116 13ms 0ms 18 72 9ms 0ms 19 68 8ms 0ms 20 68 9ms 0ms 21 96 12ms 0ms 22 124 13ms 0ms [ User: tng_migration_user - Total duration: 42ms - Times executed: 4656 ]
[ Application: [unknown] - Total duration: 42ms - Times executed: 4656 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.subject_inform_consent_state t0 WHERE t0.code = $1 LIMIT 1;
Date: 2025-11-27 13:06:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.subject_inform_consent_state t0 WHERE t0.code = $1 LIMIT 1;
Date: 2025-11-26 23:41:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.subject_inform_consent_state t0 WHERE t0.code = $1 LIMIT 1;
Date: 2025-11-26 15:12:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
16 416ms 6,552 0ms 0ms 0ms SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5, $6) AND m0_.use_alternative <> $7 AND (m0_.result_date BETWEEN $8 AND $9);Times Reported Time consuming prepare #16
Day Hour Count Duration Avg duration 05 182 11ms 0ms 06 182 11ms 0ms 07 182 11ms 0ms 08 182 11ms 0ms 09 182 11ms 0ms 10 182 11ms 0ms 11 182 12ms 0ms 12 182 11ms 0ms 13 182 11ms 0ms 14 182 11ms 0ms 15 182 11ms 0ms 16 182 11ms 0ms 17 182 11ms 0ms 18 182 11ms 0ms 19 182 11ms 0ms 20 182 11ms 0ms 21 182 11ms 0ms 22 182 11ms 0ms 05 182 11ms 0ms 06 182 11ms 0ms 07 182 11ms 0ms 08 182 11ms 0ms 09 182 11ms 0ms 10 182 12ms 0ms 11 182 11ms 0ms 12 182 11ms 0ms 13 182 11ms 0ms 14 182 11ms 0ms 15 182 11ms 0ms 16 182 11ms 0ms 17 182 11ms 0ms 18 182 11ms 0ms 19 182 11ms 0ms 20 182 11ms 0ms 21 182 11ms 0ms 22 182 11ms 0ms [ User: tng_migration_user - Total duration: 201ms - Times executed: 6552 ]
[ Application: [unknown] - Total duration: 201ms - Times executed: 6552 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5, $6) AND m0_.use_alternative <> $7 AND (m0_.result_date BETWEEN $8 AND $9);
Date: 2025-11-27 19:41:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5, $6) AND m0_.use_alternative <> $7 AND (m0_.result_date BETWEEN $8 AND $9);
Date: 2025-11-27 17:14:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5, $6) AND m0_.use_alternative <> $7 AND (m0_.result_date BETWEEN $8 AND $9);
Date: 2025-11-27 11:50:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
17 391ms 4,875 0ms 0ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.assigned_at AS assigned_at_5, t0.revoke_at AS revoke_at_6, t0.cancelled_at AS cancelled_at_7, t0.upload_at AS upload_at_8, t0.paused_at AS paused_at_9, t0.owner_user_id AS owner_user_id_10, t0.owner_group_id AS owner_group_id_11, t0.subject_id AS subject_id_12, t0.subject_about_id AS subject_about_id_13, t0.subcohort_inform_consent_id AS subcohort_inform_consent_id_14, t0.subject_inform_consent_state_code AS subject_inform_consent_state_code_15, t0.activity_state_code AS activity_state_code_16, t0.terminated_state_code AS terminated_state_code_17, t0.assigned_by AS assigned_by_18, t0.revoke_by AS revoke_by_19, t0.created_by AS created_by_20, t0.cancelled_by AS cancelled_by_21, t0.upload_by AS upload_by_22, t0.paused_by AS paused_by_23, t0.subject_plugin_id AS subject_plugin_id_24, t25.is_archived AS is_archived_26, t25.created_at AS created_at_27, t25.updated_at AS updated_at_28, t25.id AS id_29, t25.extend AS extend_30, t25.description AS description_31, t25.description_internal AS description_internal_32, t25.owner_user_id AS owner_user_id_33, t25.owner_group_id AS owner_group_id_34, t25.subject_id AS subject_id_35 FROM core.subject_inform_consent t0 LEFT JOIN core.subject_extend t25 ON t0.subject_plugin_id = t25.id WHERE t0.subject_about_id = $1 AND t0.subcohort_inform_consent_id IN ($2, $3) LIMIT 1;Times Reported Time consuming prepare #17
Day Hour Count Duration Avg duration 05 13 1ms 0ms 06 69 7ms 0ms 07 479 40ms 0ms 08 342 27ms 0ms 10 287 26ms 0ms 11 17 1ms 0ms 12 82 6ms 0ms 13 99 8ms 0ms 14 61 4ms 0ms 15 149 10ms 0ms 17 310 23ms 0ms 18 79 5ms 0ms 19 140 10ms 0ms 20 210 15ms 0ms 21 608 46ms 0ms 05 14 1ms 0ms 06 529 38ms 0ms 07 357 28ms 0ms 08 21 2ms 0ms 09 58 8ms 0ms 10 13 1ms 0ms 11 115 12ms 0ms 14 208 15ms 0ms 15 11 0ms 0ms 16 74 5ms 0ms 17 183 14ms 0ms 21 146 10ms 0ms 22 201 15ms 0ms [ User: tng_migration_user - Total duration: 159ms - Times executed: 4875 ]
[ Application: [unknown] - Total duration: 159ms - Times executed: 4875 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.assigned_at AS assigned_at_5, t0.revoke_at AS revoke_at_6, t0.cancelled_at AS cancelled_at_7, t0.upload_at AS upload_at_8, t0.paused_at AS paused_at_9, t0.owner_user_id AS owner_user_id_10, t0.owner_group_id AS owner_group_id_11, t0.subject_id AS subject_id_12, t0.subject_about_id AS subject_about_id_13, t0.subcohort_inform_consent_id AS subcohort_inform_consent_id_14, t0.subject_inform_consent_state_code AS subject_inform_consent_state_code_15, t0.activity_state_code AS activity_state_code_16, t0.terminated_state_code AS terminated_state_code_17, t0.assigned_by AS assigned_by_18, t0.revoke_by AS revoke_by_19, t0.created_by AS created_by_20, t0.cancelled_by AS cancelled_by_21, t0.upload_by AS upload_by_22, t0.paused_by AS paused_by_23, t0.subject_plugin_id AS subject_plugin_id_24, t25.is_archived AS is_archived_26, t25.created_at AS created_at_27, t25.updated_at AS updated_at_28, t25.id AS id_29, t25.extend AS extend_30, t25.description AS description_31, t25.description_internal AS description_internal_32, t25.owner_user_id AS owner_user_id_33, t25.owner_group_id AS owner_group_id_34, t25.subject_id AS subject_id_35 FROM core.subject_inform_consent t0 LEFT JOIN core.subject_extend t25 ON t0.subject_plugin_id = t25.id WHERE t0.subject_about_id = $1 AND t0.subcohort_inform_consent_id IN ($2, $3) LIMIT 1;
Date: 2025-11-27 12:54:25 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.assigned_at AS assigned_at_5, t0.revoke_at AS revoke_at_6, t0.cancelled_at AS cancelled_at_7, t0.upload_at AS upload_at_8, t0.paused_at AS paused_at_9, t0.owner_user_id AS owner_user_id_10, t0.owner_group_id AS owner_group_id_11, t0.subject_id AS subject_id_12, t0.subject_about_id AS subject_about_id_13, t0.subcohort_inform_consent_id AS subcohort_inform_consent_id_14, t0.subject_inform_consent_state_code AS subject_inform_consent_state_code_15, t0.activity_state_code AS activity_state_code_16, t0.terminated_state_code AS terminated_state_code_17, t0.assigned_by AS assigned_by_18, t0.revoke_by AS revoke_by_19, t0.created_by AS created_by_20, t0.cancelled_by AS cancelled_by_21, t0.upload_by AS upload_by_22, t0.paused_by AS paused_by_23, t0.subject_plugin_id AS subject_plugin_id_24, t25.is_archived AS is_archived_26, t25.created_at AS created_at_27, t25.updated_at AS updated_at_28, t25.id AS id_29, t25.extend AS extend_30, t25.description AS description_31, t25.description_internal AS description_internal_32, t25.owner_user_id AS owner_user_id_33, t25.owner_group_id AS owner_group_id_34, t25.subject_id AS subject_id_35 FROM core.subject_inform_consent t0 LEFT JOIN core.subject_extend t25 ON t0.subject_plugin_id = t25.id WHERE t0.subject_about_id = $1 AND t0.subcohort_inform_consent_id IN ($2, $3) LIMIT 1;
Date: 2025-11-27 08:54:21 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.assigned_at AS assigned_at_5, t0.revoke_at AS revoke_at_6, t0.cancelled_at AS cancelled_at_7, t0.upload_at AS upload_at_8, t0.paused_at AS paused_at_9, t0.owner_user_id AS owner_user_id_10, t0.owner_group_id AS owner_group_id_11, t0.subject_id AS subject_id_12, t0.subject_about_id AS subject_about_id_13, t0.subcohort_inform_consent_id AS subcohort_inform_consent_id_14, t0.subject_inform_consent_state_code AS subject_inform_consent_state_code_15, t0.activity_state_code AS activity_state_code_16, t0.terminated_state_code AS terminated_state_code_17, t0.assigned_by AS assigned_by_18, t0.revoke_by AS revoke_by_19, t0.created_by AS created_by_20, t0.cancelled_by AS cancelled_by_21, t0.upload_by AS upload_by_22, t0.paused_by AS paused_by_23, t0.subject_plugin_id AS subject_plugin_id_24, t25.is_archived AS is_archived_26, t25.created_at AS created_at_27, t25.updated_at AS updated_at_28, t25.id AS id_29, t25.extend AS extend_30, t25.description AS description_31, t25.description_internal AS description_internal_32, t25.owner_user_id AS owner_user_id_33, t25.owner_group_id AS owner_group_id_34, t25.subject_id AS subject_id_35 FROM core.subject_inform_consent t0 LEFT JOIN core.subject_extend t25 ON t0.subject_plugin_id = t25.id WHERE t0.subject_about_id = $1 AND t0.subcohort_inform_consent_id IN ($2, $3) LIMIT 1;
Date: 2025-11-26 11:30:54 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
18 368ms 9,425 0ms 0ms 0ms SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ($1) AND m0_.form_id IS NULL;Times Reported Time consuming prepare #18
Day Hour Count Duration Avg duration 04 225 8ms 0ms 05 250 9ms 0ms 06 250 9ms 0ms 07 250 9ms 0ms 08 250 9ms 0ms 09 250 9ms 0ms 10 250 9ms 0ms 11 250 9ms 0ms 12 250 9ms 0ms 13 250 9ms 0ms 14 250 9ms 0ms 15 250 9ms 0ms 16 225 8ms 0ms 17 250 9ms 0ms 18 250 9ms 0ms 19 250 10ms 0ms 20 250 9ms 0ms 21 250 9ms 0ms 22 250 9ms 0ms 04 250 9ms 0ms 05 250 9ms 0ms 06 250 9ms 0ms 07 250 9ms 0ms 08 250 9ms 0ms 09 250 9ms 0ms 10 250 10ms 0ms 11 250 9ms 0ms 12 250 9ms 0ms 13 250 9ms 0ms 14 250 9ms 0ms 15 250 9ms 0ms 16 225 8ms 0ms 17 250 9ms 0ms 18 250 9ms 0ms 19 250 9ms 0ms 20 250 9ms 0ms 21 250 9ms 0ms 22 250 9ms 0ms [ User: tng_migration_user - Total duration: 3s252ms - Times executed: 9425 ]
[ Application: [unknown] - Total duration: 3s252ms - Times executed: 9425 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ($1) AND m0_.form_id IS NULL;
Date: 2025-11-27 21:42:03 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ($1) AND m0_.form_id IS NULL;
Date: 2025-11-26 09:42:03 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ($1) AND m0_.form_id IS NULL;
Date: 2025-11-26 20:00:04 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
19 360ms 6,688 0ms 0ms 0ms SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id = $1 AND m0_.form_state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date IS NOT NULL AND (m0_.result_date BETWEEN $7 AND $8);Times Reported Time consuming prepare #19
Day Hour Count Duration Avg duration 04 176 9ms 0ms 05 176 9ms 0ms 06 176 9ms 0ms 07 176 9ms 0ms 08 176 9ms 0ms 09 176 9ms 0ms 10 176 9ms 0ms 11 176 12ms 0ms 12 176 9ms 0ms 13 176 9ms 0ms 14 176 8ms 0ms 15 176 9ms 0ms 16 176 9ms 0ms 17 176 9ms 0ms 18 176 9ms 0ms 19 176 9ms 0ms 20 176 9ms 0ms 21 176 10ms 0ms 22 176 9ms 0ms 04 176 9ms 0ms 05 176 9ms 0ms 06 176 9ms 0ms 07 176 9ms 0ms 08 176 9ms 0ms 09 176 9ms 0ms 10 176 9ms 0ms 11 176 10ms 0ms 12 176 9ms 0ms 13 176 9ms 0ms 14 176 9ms 0ms 15 176 9ms 0ms 16 176 9ms 0ms 17 176 9ms 0ms 18 176 9ms 0ms 19 176 9ms 0ms 20 176 9ms 0ms 21 176 9ms 0ms 22 176 9ms 0ms [ User: tng_migration_user - Total duration: 448ms - Times executed: 6688 ]
[ Application: [unknown] - Total duration: 448ms - Times executed: 6688 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id = $1 AND m0_.form_state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date IS NOT NULL AND (m0_.result_date BETWEEN $7 AND $8);
Date: 2025-11-26 12:00:03 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id = $1 AND m0_.form_state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date IS NOT NULL AND (m0_.result_date BETWEEN $7 AND $8);
Date: 2025-11-26 22:00:03 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id = $1 AND m0_.form_state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date IS NOT NULL AND (m0_.result_date BETWEEN $7 AND $8);
Date: 2025-11-26 12:00:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
20 304ms 6,744 0ms 0ms 0ms SELECT s0_.is_archived AS is_archived_0, s0_.created_at AS created_at_1, s0_.updated_at AS updated_at_2, s0_.ordering AS ordering_3, s0_.id AS id_4, s0_.is_required AS is_required_5, s0_.subcohort_id AS subcohort_id_6, s0_.info_consent_id AS info_consent_id_7, s0_.subject_role_code AS subject_role_code_8 FROM core.subcohort_inform_consent s0_ INNER JOIN core.subcohort s1_ ON s0_.subcohort_id = s1_.id WHERE s0_.info_consent_id = s1_.inform_consent_id AND s0_.subcohort_id IN ($1);Times Reported Time consuming prepare #20
Day Hour Count Duration Avg duration 04 122 6ms 0ms 06 42 2ms 0ms 07 487 22ms 0ms 08 446 20ms 0ms 10 452 21ms 0ms 11 28 1ms 0ms 12 128 5ms 0ms 13 107 4ms 0ms 14 79 3ms 0ms 15 388 17ms 0ms 17 411 18ms 0ms 18 102 4ms 0ms 19 181 8ms 0ms 20 272 11ms 0ms 21 886 38ms 0ms 04 117 6ms 0ms 06 682 28ms 0ms 07 448 20ms 0ms 08 2 0ms 0ms 09 15 1ms 0ms 10 9 0ms 0ms 11 43 2ms 0ms 14 270 11ms 0ms 15 50 2ms 0ms 16 166 7ms 0ms 17 329 14ms 0ms 21 214 9ms 0ms 22 268 11ms 0ms [ User: tng_migration_user - Total duration: 129ms - Times executed: 6744 ]
[ Application: [unknown] - Total duration: 129ms - Times executed: 6744 ]
-
SELECT s0_.is_archived AS is_archived_0, s0_.created_at AS created_at_1, s0_.updated_at AS updated_at_2, s0_.ordering AS ordering_3, s0_.id AS id_4, s0_.is_required AS is_required_5, s0_.subcohort_id AS subcohort_id_6, s0_.info_consent_id AS info_consent_id_7, s0_.subject_role_code AS subject_role_code_8 FROM core.subcohort_inform_consent s0_ INNER JOIN core.subcohort s1_ ON s0_.subcohort_id = s1_.id WHERE s0_.info_consent_id = s1_.inform_consent_id AND s0_.subcohort_id IN ($1);
Date: 2025-11-26 18:06:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT s0_.is_archived AS is_archived_0, s0_.created_at AS created_at_1, s0_.updated_at AS updated_at_2, s0_.ordering AS ordering_3, s0_.id AS id_4, s0_.is_required AS is_required_5, s0_.subcohort_id AS subcohort_id_6, s0_.info_consent_id AS info_consent_id_7, s0_.subject_role_code AS subject_role_code_8 FROM core.subcohort_inform_consent s0_ INNER JOIN core.subcohort s1_ ON s0_.subcohort_id = s1_.id WHERE s0_.info_consent_id = s1_.inform_consent_id AND s0_.subcohort_id IN ($1);
Date: 2025-11-27 08:54:09 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT s0_.is_archived AS is_archived_0, s0_.created_at AS created_at_1, s0_.updated_at AS updated_at_2, s0_.ordering AS ordering_3, s0_.id AS id_4, s0_.is_required AS is_required_5, s0_.subcohort_id AS subcohort_id_6, s0_.info_consent_id AS info_consent_id_7, s0_.subject_role_code AS subject_role_code_8 FROM core.subcohort_inform_consent s0_ INNER JOIN core.subcohort s1_ ON s0_.subcohort_id = s1_.id WHERE s0_.info_consent_id = s1_.inform_consent_id AND s0_.subcohort_id IN ($1);
Date: 2025-11-26 08:30:54 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
Time consuming bind
Rank Total duration Times executed Min duration Max duration Avg duration Query 1 13s872ms 118,167 0ms 11ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_type t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_type_code WHERE core.notif_type_state.notif_state_code = $1;Times Reported Time consuming bind #1
Day Hour Count Duration Avg duration Nov 27 04 2,233 264ms 0ms 05 2,527 295ms 0ms 06 2,737 320ms 0ms 07 2,730 318ms 0ms 08 2,730 318ms 0ms 09 2,730 317ms 0ms 10 2,730 319ms 0ms 11 2,730 318ms 0ms 12 2,730 324ms 0ms 13 2,730 323ms 0ms 14 2,730 320ms 0ms 15 2,730 325ms 0ms 16 2,730 318ms 0ms 17 2,702 318ms 0ms 18 2,737 318ms 0ms 19 2,730 319ms 0ms 20 2,730 323ms 0ms 21 2,730 317ms 0ms 22 2,730 318ms 0ms 23 2,730 318ms 0ms Nov 27 00 2,520 295ms 0ms 01 2,520 297ms 0ms 02 2,520 296ms 0ms 03 2,520 298ms 0ms 04 2,520 292ms 0ms 05 2,527 294ms 0ms 06 2,737 321ms 0ms 07 2,730 322ms 0ms 08 2,730 321ms 0ms 09 2,730 319ms 0ms 10 2,772 321ms 0ms 11 2,730 320ms 0ms 12 2,730 317ms 0ms 13 2,730 318ms 0ms 14 2,730 317ms 0ms 15 2,730 317ms 0ms 16 2,730 315ms 0ms 17 2,695 329ms 0ms 18 2,730 323ms 0ms 19 2,730 325ms 0ms 20 2,730 323ms 0ms 21 2,730 320ms 0ms 22 2,730 323ms 0ms 23 2,730 318ms 0ms [ User: tng_migration_user - Total duration: 2s160ms - Times executed: 118167 ]
[ Application: [unknown] - Total duration: 2s160ms - Times executed: 118167 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_type t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_type_code WHERE core.notif_type_state.notif_state_code = $1;
Date: 2025-11-27 17:02:25 Duration: 11ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_type t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_type_code WHERE core.notif_type_state.notif_state_code = $1;
Date: 2025-11-26 18:13:15 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_type t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_type_code WHERE core.notif_type_state.notif_state_code = $1;
Date: 2025-11-27 03:08:15 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR'
2 11s180ms 15,799 0ms 121ms 0ms SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;Times Reported Time consuming bind #2
Day Hour Count Duration Avg duration 03 319 229ms 0ms 04 360 250ms 0ms 05 360 254ms 0ms 06 360 268ms 0ms 07 360 262ms 0ms 08 360 255ms 0ms 09 360 260ms 0ms 10 360 256ms 0ms 11 360 254ms 0ms 12 360 264ms 0ms 13 360 257ms 0ms 14 360 262ms 0ms 15 360 264ms 0ms 16 360 258ms 0ms 17 360 251ms 0ms 18 360 260ms 0ms 19 360 269ms 0ms 20 360 239ms 0ms 21 360 245ms 0ms 22 360 260ms 0ms 23 360 262ms 0ms 00 360 260ms 0ms 01 360 256ms 0ms 02 360 264ms 0ms 03 360 252ms 0ms 04 360 247ms 0ms 05 360 253ms 0ms 06 360 267ms 0ms 07 360 252ms 0ms 08 360 250ms 0ms 09 360 245ms 0ms 10 360 246ms 0ms 11 360 249ms 0ms 12 360 247ms 0ms 13 360 244ms 0ms 14 360 248ms 0ms 15 360 240ms 0ms 16 360 356ms 0ms 17 360 240ms 0ms 18 360 246ms 0ms 19 360 236ms 0ms 20 360 225ms 0ms 21 360 228ms 0ms 22 360 231ms 0ms [ User: tng_migration_user - Total duration: 2s24ms - Times executed: 15799 ]
[ Application: [unknown] - Total duration: 2s24ms - Times executed: 15799 ]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-11-27 17:02:25 Duration: 121ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-11-27 03:06:42 Duration: 6ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-11-26 07:22:17 Duration: 4ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
3 8s9ms 60,779 0ms 1ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.name AS name_5, t0.description AS description_6, t0.is_automatic AS is_automatic_7, t0.is_recruitment AS is_recruitment_8, t0.is_welcome AS is_welcome_9, t0.welcome_message AS welcome_message_10, t0.biobank_id AS biobank_id_11, t0.owner_user_id AS owner_user_id_12, t0.owner_group_id AS owner_group_id_13, t0.pilot_id AS pilot_id_14, t0.subcohort_state_code AS subcohort_state_code_15, t0.inform_consent_id AS inform_consent_id_16 FROM core.subcohort t0 INNER JOIN core.subcohort_form_structure_variant ON t0.id = core.subcohort_form_structure_variant.subcohort_id WHERE core.subcohort_form_structure_variant.form_structure_variant_id = $1;Times Reported Time consuming bind #3
Day Hour Count Duration Avg duration 04 1,386 178ms 0ms 05 1,540 195ms 0ms 06 1,558 201ms 0ms 07 1,804 234ms 0ms 08 1,699 230ms 0ms 09 1,540 196ms 0ms 10 1,885 270ms 0ms 11 1,582 207ms 0ms 12 1,592 205ms 0ms 13 1,636 216ms 0ms 14 1,561 210ms 0ms 15 1,643 215ms 0ms 16 1,386 181ms 0ms 17 1,688 226ms 0ms 18 1,564 200ms 0ms 19 1,585 206ms 0ms 20 1,672 217ms 0ms 21 1,830 256ms 0ms 22 1,540 201ms 0ms 04 1,540 207ms 0ms 05 1,540 195ms 0ms 06 1,705 230ms 0ms 07 1,649 222ms 0ms 08 1,543 202ms 0ms 09 1,609 214ms 0ms 10 1,572 204ms 0ms 11 1,674 216ms 0ms 12 1,540 200ms 0ms 13 1,540 205ms 0ms 14 1,604 219ms 0ms 15 1,555 198ms 0ms 16 1,441 186ms 0ms 17 1,684 219ms 0ms 18 1,541 203ms 0ms 19 1,540 199ms 0ms 20 1,540 195ms 0ms 21 1,615 215ms 0ms 22 1,656 220ms 0ms [ User: tng_migration_user - Total duration: 1s698ms - Times executed: 60779 ]
[ Application: [unknown] - Total duration: 1s698ms - Times executed: 60779 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.name AS name_5, t0.description AS description_6, t0.is_automatic AS is_automatic_7, t0.is_recruitment AS is_recruitment_8, t0.is_welcome AS is_welcome_9, t0.welcome_message AS welcome_message_10, t0.biobank_id AS biobank_id_11, t0.owner_user_id AS owner_user_id_12, t0.owner_group_id AS owner_group_id_13, t0.pilot_id AS pilot_id_14, t0.subcohort_state_code AS subcohort_state_code_15, t0.inform_consent_id AS inform_consent_id_16 FROM core.subcohort t0 INNER JOIN core.subcohort_form_structure_variant ON t0.id = core.subcohort_form_structure_variant.subcohort_id WHERE core.subcohort_form_structure_variant.form_structure_variant_id = $1;
Date: 2025-11-27 15:42:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '13'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.name AS name_5, t0.description AS description_6, t0.is_automatic AS is_automatic_7, t0.is_recruitment AS is_recruitment_8, t0.is_welcome AS is_welcome_9, t0.welcome_message AS welcome_message_10, t0.biobank_id AS biobank_id_11, t0.owner_user_id AS owner_user_id_12, t0.owner_group_id AS owner_group_id_13, t0.pilot_id AS pilot_id_14, t0.subcohort_state_code AS subcohort_state_code_15, t0.inform_consent_id AS inform_consent_id_16 FROM core.subcohort t0 INNER JOIN core.subcohort_form_structure_variant ON t0.id = core.subcohort_form_structure_variant.subcohort_id WHERE core.subcohort_form_structure_variant.form_structure_variant_id = $1;
Date: 2025-11-27 07:12:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '207'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.name AS name_5, t0.description AS description_6, t0.is_automatic AS is_automatic_7, t0.is_recruitment AS is_recruitment_8, t0.is_welcome AS is_welcome_9, t0.welcome_message AS welcome_message_10, t0.biobank_id AS biobank_id_11, t0.owner_user_id AS owner_user_id_12, t0.owner_group_id AS owner_group_id_13, t0.pilot_id AS pilot_id_14, t0.subcohort_state_code AS subcohort_state_code_15, t0.inform_consent_id AS inform_consent_id_16 FROM core.subcohort t0 INNER JOIN core.subcohort_form_structure_variant ON t0.id = core.subcohort_form_structure_variant.subcohort_id WHERE core.subcohort_form_structure_variant.form_structure_variant_id = $1;
Date: 2025-11-27 07:26:11 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '90'
4 5s538ms 67,524 0ms 3ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = $1;Times Reported Time consuming bind #4
Day Hour Count Duration Avg duration 03 1,276 105ms 0ms 04 1,444 118ms 0ms 05 1,564 129ms 0ms 06 1,560 127ms 0ms 07 1,560 128ms 0ms 08 1,560 126ms 0ms 09 1,560 127ms 0ms 10 1,560 127ms 0ms 11 1,560 129ms 0ms 12 1,560 128ms 0ms 13 1,560 127ms 0ms 14 1,560 128ms 0ms 15 1,560 127ms 0ms 16 1,544 126ms 0ms 17 1,564 127ms 0ms 18 1,560 127ms 0ms 19 1,560 127ms 0ms 20 1,560 127ms 0ms 21 1,560 128ms 0ms 22 1,560 128ms 0ms 23 1,440 118ms 0ms 00 1,440 119ms 0ms 01 1,440 118ms 0ms 02 1,440 118ms 0ms 03 1,440 118ms 0ms 04 1,444 118ms 0ms 05 1,564 128ms 0ms 06 1,560 127ms 0ms 07 1,560 127ms 0ms 08 1,560 127ms 0ms 09 1,584 130ms 0ms 10 1,560 128ms 0ms 11 1,560 126ms 0ms 12 1,560 127ms 0ms 13 1,560 127ms 0ms 14 1,560 126ms 0ms 15 1,560 126ms 0ms 16 1,540 126ms 0ms 17 1,560 126ms 0ms 18 1,560 130ms 0ms 19 1,560 127ms 0ms 20 1,560 127ms 0ms 21 1,560 127ms 0ms 22 1,560 127ms 0ms [ User: tng_migration_user - Total duration: 1s96ms - Times executed: 67524 ]
[ Application: [unknown] - Total duration: 1s96ms - Times executed: 67524 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = $1;
Date: 2025-11-27 19:23:25 Duration: 3ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'EMAIL_SENDED'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = $1;
Date: 2025-11-26 23:04:16 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'EMAIL_SENDED'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = $1;
Date: 2025-11-26 04:30:15 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'EMAIL_SENDED'
5 4s697ms 15,799 0ms 69ms 0ms SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = $1 AND n0_.processed_time >= $2;Times Reported Time consuming bind #5
Day Hour Count Duration Avg duration 03 319 95ms 0ms 04 360 102ms 0ms 05 360 102ms 0ms 06 360 104ms 0ms 07 360 103ms 0ms 08 360 102ms 0ms 09 360 104ms 0ms 10 360 101ms 0ms 11 360 103ms 0ms 12 360 105ms 0ms 13 360 104ms 0ms 14 360 106ms 0ms 15 360 104ms 0ms 16 360 105ms 0ms 17 360 101ms 0ms 18 360 104ms 0ms 19 360 105ms 0ms 20 360 101ms 0ms 21 360 101ms 0ms 22 360 103ms 0ms 23 360 104ms 0ms 00 360 106ms 0ms 01 360 104ms 0ms 02 360 106ms 0ms 03 360 99ms 0ms 04 360 101ms 0ms 05 360 104ms 0ms 06 360 106ms 0ms 07 360 104ms 0ms 08 360 103ms 0ms 09 360 102ms 0ms 10 360 103ms 0ms 11 360 103ms 0ms 12 360 104ms 0ms 13 360 105ms 0ms 14 360 102ms 0ms 15 360 101ms 0ms 16 360 183ms 0ms 17 360 116ms 0ms 18 360 116ms 0ms 19 360 115ms 0ms 20 360 111ms 0ms 21 360 112ms 0ms 22 360 112ms 0ms [ User: tng_migration_user - Total duration: 3s861ms - Times executed: 15799 ]
[ Application: [unknown] - Total duration: 3s861ms - Times executed: 15799 ]
-
SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = $1 AND n0_.processed_time >= $2;
Date: 2025-11-27 17:02:25 Duration: 69ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR', $2 = '2025-11-20 17:02:25'
-
SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = $1 AND n0_.processed_time >= $2;
Date: 2025-11-27 13:10:26 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR', $2 = '2025-11-20 13:10:26'
-
SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = $1 AND n0_.processed_time >= $2;
Date: 2025-11-26 04:37:15 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR', $2 = '2025-11-19 04:37:15'
6 3s409ms 44,109 0ms 0ms 0ms SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ($1) AND m0_.form_id IS NULL AND m0_.result_date <= $2 AND m0_.use_alternative <> $3;Times Reported Time consuming bind #6
Day Hour Count Duration Avg duration 04 1,053 80ms 0ms 05 1,170 89ms 0ms 06 1,170 91ms 0ms 07 1,170 89ms 0ms 08 1,170 89ms 0ms 09 1,170 90ms 0ms 10 1,170 91ms 0ms 11 1,170 91ms 0ms 12 1,170 89ms 0ms 13 1,170 91ms 0ms 14 1,170 91ms 0ms 15 1,170 90ms 0ms 16 1,053 80ms 0ms 17 1,170 89ms 0ms 18 1,170 89ms 0ms 19 1,170 90ms 0ms 20 1,170 88ms 0ms 21 1,170 91ms 0ms 22 1,170 90ms 0ms 04 1,170 90ms 0ms 05 1,170 92ms 0ms 06 1,170 92ms 0ms 07 1,170 89ms 0ms 08 1,170 89ms 0ms 09 1,170 90ms 0ms 10 1,170 92ms 0ms 11 1,170 92ms 0ms 12 1,170 92ms 0ms 13 1,170 91ms 0ms 14 1,170 90ms 0ms 15 1,170 88ms 0ms 16 1,053 78ms 0ms 17 1,170 89ms 0ms 18 1,170 91ms 0ms 19 1,170 90ms 0ms 20 1,170 89ms 0ms 21 1,170 90ms 0ms 22 1,170 88ms 0ms [ User: tng_migration_user - Total duration: 24s734ms - Times executed: 44109 ]
[ Application: [unknown] - Total duration: 24s734ms - Times executed: 44109 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ($1) AND m0_.form_id IS NULL AND m0_.result_date <= $2 AND m0_.use_alternative <> $3;
Date: 2025-11-27 06:12:03 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '13', $2 = '2025-03-13 06:12:01', $3 = 't'
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ($1) AND m0_.form_id IS NULL AND m0_.result_date <= $2 AND m0_.use_alternative <> $3;
Date: 2025-11-27 14:48:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '13', $2 = '2025-03-13 14:48:01', $3 = 't'
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ($1) AND m0_.form_id IS NULL AND m0_.result_date <= $2 AND m0_.use_alternative <> $3;
Date: 2025-11-26 15:24:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '13', $2 = '2025-03-12 15:24:01', $3 = 't'
7 2s981ms 17,396 0ms 5ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = $1 LIMIT 1;Times Reported Time consuming bind #7
Day Hour Count Duration Avg duration 03 319 57ms 0ms 04 360 61ms 0ms 05 642 78ms 0ms 06 390 68ms 0ms 07 390 68ms 0ms 08 390 67ms 0ms 09 390 67ms 0ms 10 390 67ms 0ms 11 390 69ms 0ms 12 390 69ms 0ms 13 390 68ms 0ms 14 390 70ms 0ms 15 390 68ms 0ms 16 386 67ms 0ms 17 400 68ms 0ms 18 390 68ms 0ms 19 390 70ms 0ms 20 390 65ms 0ms 21 390 66ms 0ms 22 390 67ms 0ms 23 360 63ms 0ms 00 360 62ms 0ms 01 360 61ms 0ms 02 360 64ms 0ms 03 360 61ms 0ms 04 360 60ms 0ms 05 652 79ms 0ms 06 390 69ms 0ms 07 390 67ms 0ms 08 390 68ms 0ms 09 392 67ms 0ms 10 390 66ms 0ms 11 390 67ms 0ms 12 390 66ms 0ms 13 390 66ms 0ms 14 390 66ms 0ms 15 390 66ms 0ms 16 385 73ms 0ms 17 390 71ms 0ms 18 390 71ms 0ms 19 390 70ms 0ms 20 390 69ms 0ms 21 390 68ms 0ms 22 390 68ms 0ms [ User: tng_migration_user - Total duration: 405ms - Times executed: 17396 ]
[ Application: [unknown] - Total duration: 405ms - Times executed: 17396 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = $1 LIMIT 1;
Date: 2025-11-27 17:02:25 Duration: 5ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = $1 LIMIT 1;
Date: 2025-11-26 04:50:16 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = $1 LIMIT 1;
Date: 2025-11-26 18:43:18 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR'
8 2s872ms 18,402 0ms 2ms 0ms SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 WHERE t0.disabled = $1 AND t0.locked = $2 ORDER BY t0.priority DESC;Times Reported Time consuming bind #8
Day Hour Count Duration Avg duration 03 372 59ms 0ms 04 410 59ms 0ms 05 420 65ms 0ms 06 420 67ms 0ms 07 420 67ms 0ms 08 420 67ms 0ms 09 420 68ms 0ms 10 420 66ms 0ms 11 420 66ms 0ms 12 420 66ms 0ms 13 420 66ms 0ms 14 420 69ms 0ms 15 420 67ms 0ms 16 411 61ms 0ms 17 420 67ms 0ms 18 420 67ms 0ms 19 420 66ms 0ms 20 420 64ms 0ms 21 420 65ms 0ms 22 420 66ms 0ms 23 420 67ms 0ms 00 420 68ms 0ms 01 420 67ms 0ms 02 420 67ms 0ms 03 420 65ms 0ms 04 419 65ms 0ms 05 420 65ms 0ms 06 420 68ms 0ms 07 420 64ms 0ms 08 420 63ms 0ms 09 420 65ms 0ms 10 420 65ms 0ms 11 420 64ms 0ms 12 420 63ms 0ms 13 420 64ms 0ms 14 420 65ms 0ms 15 420 64ms 0ms 16 410 57ms 0ms 17 420 64ms 0ms 18 420 63ms 0ms 19 420 63ms 0ms 20 420 61ms 0ms 21 420 62ms 0ms 22 420 61ms 0ms [ User: tng_migration_user - Total duration: 641ms - Times executed: 18402 ]
[ Application: [unknown] - Total duration: 641ms - Times executed: 18402 ]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 WHERE t0.disabled = $1 AND t0.locked = $2 ORDER BY t0.priority DESC;
Date: 2025-11-26 22:08:01 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'f', $2 = 'f'
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 WHERE t0.disabled = $1 AND t0.locked = $2 ORDER BY t0.priority DESC;
Date: 2025-11-27 16:19:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'f', $2 = 'f'
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 WHERE t0.disabled = $1 AND t0.locked = $2 ORDER BY t0.priority DESC;
Date: 2025-11-26 09:47:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'f', $2 = 'f'
9 2s205ms 20,236 0ms 1ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = $1;Times Reported Time consuming bind #9
Day Hour Count Duration Avg duration 04 441 43ms 0ms 05 504 55ms 0ms 06 458 53ms 0ms 07 470 57ms 0ms 08 471 56ms 0ms 09 449 45ms 0ms 10 641 86ms 0ms 11 453 55ms 0ms 12 455 48ms 0ms 13 458 48ms 0ms 14 453 47ms 0ms 15 470 56ms 0ms 16 447 46ms 0ms 17 615 72ms 0ms 18 449 44ms 0ms 19 453 48ms 0ms 20 449 45ms 0ms 21 474 58ms 0ms 22 445 45ms 0ms 04 432 43ms 0ms 05 590 65ms 0ms 06 559 64ms 0ms 07 704 75ms 0ms 08 642 65ms 0ms 09 852 90ms 0ms 10 545 58ms 0ms 11 804 90ms 0ms 12 538 55ms 0ms 13 538 55ms 0ms 14 540 55ms 0ms 15 639 66ms 0ms 16 543 56ms 0ms 17 546 60ms 0ms 18 539 57ms 0ms 19 538 54ms 0ms 20 538 54ms 0ms 21 545 60ms 0ms 22 549 58ms 0ms [ User: tng_migration_user - Total duration: 378ms - Times executed: 20236 ]
[ Application: [unknown] - Total duration: 378ms - Times executed: 20236 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = $1;
Date: 2025-11-26 18:31:42 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '6228'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = $1;
Date: 2025-11-26 18:31:24 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '7919'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = $1;
Date: 2025-11-26 18:27:19 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '6228'
10 1s603ms 8,568 0ms 0ms 0ms SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND (m0_.result_date BETWEEN $6 AND $7);Times Reported Time consuming bind #10
Day Hour Count Duration Avg duration 05 238 44ms 0ms 06 238 43ms 0ms 07 238 43ms 0ms 08 238 43ms 0ms 09 238 43ms 0ms 10 238 45ms 0ms 11 238 46ms 0ms 12 238 44ms 0ms 13 238 44ms 0ms 14 238 45ms 0ms 15 238 44ms 0ms 16 238 43ms 0ms 17 238 43ms 0ms 18 238 43ms 0ms 19 238 44ms 0ms 20 238 43ms 0ms 21 238 43ms 0ms 22 238 45ms 0ms 05 238 44ms 0ms 06 238 44ms 0ms 07 238 44ms 0ms 08 238 44ms 0ms 09 238 44ms 0ms 10 238 47ms 0ms 11 238 45ms 0ms 12 238 43ms 0ms 13 238 44ms 0ms 14 238 44ms 0ms 15 238 46ms 0ms 16 238 44ms 0ms 17 238 43ms 0ms 18 238 44ms 0ms 19 238 43ms 0ms 20 238 44ms 0ms 21 238 44ms 0ms 22 238 44ms 0ms [ User: tng_migration_user - Total duration: 125ms - Times executed: 8568 ]
[ Application: [unknown] - Total duration: 125ms - Times executed: 8568 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND (m0_.result_date BETWEEN $6 AND $7);
Date: 2025-11-26 23:50:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '85', $2 = 'AWAITING', $3 = 'MISSED', $4 = 'DONE', $5 = 'CANCELED', $6 = '2026-03-07 23:50:02', $7 = '2026-03-11 23:50:02'
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND (m0_.result_date BETWEEN $6 AND $7);
Date: 2025-11-27 07:05:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '116', $2 = 'AWAITING', $3 = 'MISSED', $4 = 'DONE', $5 = 'CANCELED', $6 = '2025-08-06 07:05:01', $7 = '2025-08-13 07:05:01'
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND (m0_.result_date BETWEEN $6 AND $7);
Date: 2025-11-26 13:59:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '104', $2 = 'AWAITING', $3 = 'MISSED', $4 = 'DONE', $5 = 'CANCELED', $6 = '2025-10-05 13:59:01', $7 = '2025-10-09 13:59:01'
11 1s584ms 2,418 0ms 2ms 0ms SELECT string_agg(s0_.name::text, ', ') AS sclr_0 FROM core.subject_inform_consent s1_ LEFT JOIN core.subcohort_inform_consent s2_ ON s1_.subcohort_inform_consent_id = s2_.id LEFT JOIN core.subcohort s0_ ON s2_.subcohort_id = s0_.id LEFT JOIN core.pilot p3_ ON s0_.pilot_id = p3_.id LEFT JOIN core.cohort c4_ ON p3_.cohort_id = c4_.id WHERE s1_.subject_about_id = $1 AND p3_.default_subcohort_id = s2_.subcohort_id AND s0_.inform_consent_id = s2_.info_consent_id GROUP BY s1_.subject_about_id;Times Reported Time consuming bind #11
Day Hour Count Duration Avg duration 06 116 82ms 0ms 07 307 200ms 0ms 08 101 65ms 0ms 10 813 531ms 0ms 11 149 97ms 0ms 13 102 72ms 0ms 15 425 280ms 0ms 17 100 52ms 0ms 07 102 68ms 0ms 10 102 68ms 0ms 11 101 65ms 0ms [ User: tng_migration_user - Total duration: 3s80ms - Times executed: 2418 ]
[ Application: [unknown] - Total duration: 3s80ms - Times executed: 2418 ]
-
SELECT string_agg(s0_.name::text, ', ') AS sclr_0 FROM core.subject_inform_consent s1_ LEFT JOIN core.subcohort_inform_consent s2_ ON s1_.subcohort_inform_consent_id = s2_.id LEFT JOIN core.subcohort s0_ ON s2_.subcohort_id = s0_.id LEFT JOIN core.pilot p3_ ON s0_.pilot_id = p3_.id LEFT JOIN core.cohort c4_ ON p3_.cohort_id = c4_.id WHERE s1_.subject_about_id = $1 AND p3_.default_subcohort_id = s2_.subcohort_id AND s0_.inform_consent_id = s2_.info_consent_id GROUP BY s1_.subject_about_id;
Date: 2025-11-26 11:20:19 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '48865'
-
SELECT string_agg(s0_.name::text, ', ') AS sclr_0 FROM core.subject_inform_consent s1_ LEFT JOIN core.subcohort_inform_consent s2_ ON s1_.subcohort_inform_consent_id = s2_.id LEFT JOIN core.subcohort s0_ ON s2_.subcohort_id = s0_.id LEFT JOIN core.pilot p3_ ON s0_.pilot_id = p3_.id LEFT JOIN core.cohort c4_ ON p3_.cohort_id = c4_.id WHERE s1_.subject_about_id = $1 AND p3_.default_subcohort_id = s2_.subcohort_id AND s0_.inform_consent_id = s2_.info_consent_id GROUP BY s1_.subject_about_id;
Date: 2025-11-26 11:20:17 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '2417'
-
SELECT string_agg(s0_.name::text, ', ') AS sclr_0 FROM core.subject_inform_consent s1_ LEFT JOIN core.subcohort_inform_consent s2_ ON s1_.subcohort_inform_consent_id = s2_.id LEFT JOIN core.subcohort s0_ ON s2_.subcohort_id = s0_.id LEFT JOIN core.pilot p3_ ON s0_.pilot_id = p3_.id LEFT JOIN core.cohort c4_ ON p3_.cohort_id = c4_.id WHERE s1_.subject_about_id = $1 AND p3_.default_subcohort_id = s2_.subcohort_id AND s0_.inform_consent_id = s2_.info_consent_id GROUP BY s1_.subject_about_id;
Date: 2025-11-27 11:21:04 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '44363'
12 1s296ms 15,799 0ms 0ms 0ms SELECT s0_.id AS id_0, s0_.version AS version_1, s0_.created_at AS created_at_2, s0_.name AS name_3, s0_.command AS command_4, s0_.arguments AS arguments_5, s0_.cron_expression AS cron_expression_6, s0_.last_execution AS last_execution_7, s0_.last_return_code AS last_return_code_8, s0_.log_file AS log_file_9, s0_.priority AS priority_10, s0_.execute_immediately AS execute_immediately_11, s0_.disabled AS disabled_12, s0_.locked AS locked_13, s0_.ping_back_url AS ping_back_url_14, s0_.ping_back_failed_url AS ping_back_failed_url_15, s0_.notes AS notes_16 FROM scheduled_command s0_ WHERE s0_.disabled = $1 AND s0_.last_return_code <> $2;Times Reported Time consuming bind #12
Day Hour Count Duration Avg duration 03 319 26ms 0ms 04 360 28ms 0ms 05 360 28ms 0ms 06 360 29ms 0ms 07 360 29ms 0ms 08 360 29ms 0ms 09 360 29ms 0ms 10 360 28ms 0ms 11 360 28ms 0ms 12 360 29ms 0ms 13 360 29ms 0ms 14 360 29ms 0ms 15 360 29ms 0ms 16 360 30ms 0ms 17 360 29ms 0ms 18 360 30ms 0ms 19 360 30ms 0ms 20 360 29ms 0ms 21 360 29ms 0ms 22 360 29ms 0ms 23 360 30ms 0ms 00 360 30ms 0ms 01 360 30ms 0ms 02 360 30ms 0ms 03 360 28ms 0ms 04 360 29ms 0ms 05 360 30ms 0ms 06 360 31ms 0ms 07 360 29ms 0ms 08 360 29ms 0ms 09 360 29ms 0ms 10 360 29ms 0ms 11 360 29ms 0ms 12 360 29ms 0ms 13 360 29ms 0ms 14 360 29ms 0ms 15 360 29ms 0ms 16 360 29ms 0ms 17 360 29ms 0ms 18 360 29ms 0ms 19 360 29ms 0ms 20 360 28ms 0ms 21 360 28ms 0ms 22 360 28ms 0ms [ User: tng_migration_user - Total duration: 242ms - Times executed: 15799 ]
[ Application: [unknown] - Total duration: 242ms - Times executed: 15799 ]
-
SELECT s0_.id AS id_0, s0_.version AS version_1, s0_.created_at AS created_at_2, s0_.name AS name_3, s0_.command AS command_4, s0_.arguments AS arguments_5, s0_.cron_expression AS cron_expression_6, s0_.last_execution AS last_execution_7, s0_.last_return_code AS last_return_code_8, s0_.log_file AS log_file_9, s0_.priority AS priority_10, s0_.execute_immediately AS execute_immediately_11, s0_.disabled AS disabled_12, s0_.locked AS locked_13, s0_.ping_back_url AS ping_back_url_14, s0_.ping_back_failed_url AS ping_back_failed_url_15, s0_.notes AS notes_16 FROM scheduled_command s0_ WHERE s0_.disabled = $1 AND s0_.last_return_code <> $2;
Date: 2025-11-26 10:00:43 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'f', $2 = '0'
-
SELECT s0_.id AS id_0, s0_.version AS version_1, s0_.created_at AS created_at_2, s0_.name AS name_3, s0_.command AS command_4, s0_.arguments AS arguments_5, s0_.cron_expression AS cron_expression_6, s0_.last_execution AS last_execution_7, s0_.last_return_code AS last_return_code_8, s0_.log_file AS log_file_9, s0_.priority AS priority_10, s0_.execute_immediately AS execute_immediately_11, s0_.disabled AS disabled_12, s0_.locked AS locked_13, s0_.ping_back_url AS ping_back_url_14, s0_.ping_back_failed_url AS ping_back_failed_url_15, s0_.notes AS notes_16 FROM scheduled_command s0_ WHERE s0_.disabled = $1 AND s0_.last_return_code <> $2;
Date: 2025-11-27 06:09:15 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'f', $2 = '0'
-
SELECT s0_.id AS id_0, s0_.version AS version_1, s0_.created_at AS created_at_2, s0_.name AS name_3, s0_.command AS command_4, s0_.arguments AS arguments_5, s0_.cron_expression AS cron_expression_6, s0_.last_execution AS last_execution_7, s0_.last_return_code AS last_return_code_8, s0_.log_file AS log_file_9, s0_.priority AS priority_10, s0_.execute_immediately AS execute_immediately_11, s0_.disabled AS disabled_12, s0_.locked AS locked_13, s0_.ping_back_url AS ping_back_url_14, s0_.ping_back_failed_url AS ping_back_failed_url_15, s0_.notes AS notes_16 FROM scheduled_command s0_ WHERE s0_.disabled = $1 AND s0_.last_return_code <> $2;
Date: 2025-11-26 07:57:17 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'f', $2 = '0'
13 1s269ms 6,552 0ms 0ms 0ms SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date <= $7;Times Reported Time consuming bind #13
Day Hour Count Duration Avg duration 05 182 35ms 0ms 06 182 34ms 0ms 07 182 34ms 0ms 08 182 34ms 0ms 09 182 33ms 0ms 10 182 36ms 0ms 11 182 37ms 0ms 12 182 35ms 0ms 13 182 35ms 0ms 14 182 34ms 0ms 15 182 35ms 0ms 16 182 34ms 0ms 17 182 34ms 0ms 18 182 34ms 0ms 19 182 35ms 0ms 20 182 34ms 0ms 21 182 35ms 0ms 22 182 35ms 0ms 05 182 36ms 0ms 06 182 34ms 0ms 07 182 34ms 0ms 08 182 33ms 0ms 09 182 34ms 0ms 10 182 37ms 0ms 11 182 36ms 0ms 12 182 35ms 0ms 13 182 35ms 0ms 14 182 35ms 0ms 15 182 36ms 0ms 16 182 35ms 0ms 17 182 34ms 0ms 18 182 35ms 0ms 19 182 34ms 0ms 20 182 34ms 0ms 21 182 34ms 0ms 22 182 34ms 0ms [ User: tng_migration_user - Total duration: 1s643ms - Times executed: 6552 ]
[ Application: [unknown] - Total duration: 1s643ms - Times executed: 6552 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date <= $7;
Date: 2025-11-26 12:23:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '104', $2 = 'AWAITING', $3 = 'MISSED', $4 = 'DONE', $5 = 'CANCELED', $6 = 't', $7 = '2025-10-05 12:23:01'
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date <= $7;
Date: 2025-11-27 13:23:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '89', $2 = 'AWAITING', $3 = 'MISSED', $4 = 'DONE', $5 = 'CANCELED', $6 = 't', $7 = '2025-06-09 13:23:01'
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date <= $7;
Date: 2025-11-26 06:59:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '104', $2 = 'AWAITING', $3 = 'MISSED', $4 = 'DONE', $5 = 'CANCELED', $6 = 't', $7 = '2025-10-05 06:59:01'
14 1s269ms 6,552 0ms 0ms 0ms SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5, $6) AND m0_.use_alternative <> $7 AND (m0_.result_date BETWEEN $8 AND $9);Times Reported Time consuming bind #14
Day Hour Count Duration Avg duration 05 182 35ms 0ms 06 182 34ms 0ms 07 182 34ms 0ms 08 182 34ms 0ms 09 182 34ms 0ms 10 182 36ms 0ms 11 182 37ms 0ms 12 182 34ms 0ms 13 182 35ms 0ms 14 182 35ms 0ms 15 182 36ms 0ms 16 182 34ms 0ms 17 182 34ms 0ms 18 182 34ms 0ms 19 182 35ms 0ms 20 182 34ms 0ms 21 182 34ms 0ms 22 182 35ms 0ms 05 182 35ms 0ms 06 182 34ms 0ms 07 182 34ms 0ms 08 182 34ms 0ms 09 182 34ms 0ms 10 182 37ms 0ms 11 182 36ms 0ms 12 182 34ms 0ms 13 182 36ms 0ms 14 182 35ms 0ms 15 182 36ms 0ms 16 182 35ms 0ms 17 182 35ms 0ms 18 182 35ms 0ms 19 182 35ms 0ms 20 182 34ms 0ms 21 182 35ms 0ms 22 182 34ms 0ms [ User: tng_migration_user - Total duration: 201ms - Times executed: 6552 ]
[ Application: [unknown] - Total duration: 201ms - Times executed: 6552 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5, $6) AND m0_.use_alternative <> $7 AND (m0_.result_date BETWEEN $8 AND $9);
Date: 2025-11-26 15:32:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '109', $2 = 'READY', $3 = 'AWAITING', $4 = 'MISSED', $5 = 'DONE', $6 = 'CANCELED', $7 = 't', $8 = '2024-11-24 15:32:01', $9 = '2024-12-05 15:32:01'
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5, $6) AND m0_.use_alternative <> $7 AND (m0_.result_date BETWEEN $8 AND $9);
Date: 2025-11-27 13:23:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '91', $2 = 'READY', $3 = 'AWAITING', $4 = 'MISSED', $5 = 'DONE', $6 = 'CANCELED', $7 = 't', $8 = '2025-02-17 13:23:01', $9 = '2025-02-28 13:23:01'
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5, $6) AND m0_.use_alternative <> $7 AND (m0_.result_date BETWEEN $8 AND $9);
Date: 2025-11-27 11:41:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '108', $2 = 'READY', $3 = 'AWAITING', $4 = 'MISSED', $5 = 'DONE', $6 = 'CANCELED', $7 = 't', $8 = '2025-02-17 11:41:01', $9 = '2025-02-28 11:41:01'
15 1s104ms 4,875 0ms 1ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.assigned_at AS assigned_at_5, t0.revoke_at AS revoke_at_6, t0.cancelled_at AS cancelled_at_7, t0.upload_at AS upload_at_8, t0.paused_at AS paused_at_9, t0.owner_user_id AS owner_user_id_10, t0.owner_group_id AS owner_group_id_11, t0.subject_id AS subject_id_12, t0.subject_about_id AS subject_about_id_13, t0.subcohort_inform_consent_id AS subcohort_inform_consent_id_14, t0.subject_inform_consent_state_code AS subject_inform_consent_state_code_15, t0.activity_state_code AS activity_state_code_16, t0.terminated_state_code AS terminated_state_code_17, t0.assigned_by AS assigned_by_18, t0.revoke_by AS revoke_by_19, t0.created_by AS created_by_20, t0.cancelled_by AS cancelled_by_21, t0.upload_by AS upload_by_22, t0.paused_by AS paused_by_23, t0.subject_plugin_id AS subject_plugin_id_24, t25.is_archived AS is_archived_26, t25.created_at AS created_at_27, t25.updated_at AS updated_at_28, t25.id AS id_29, t25.extend AS extend_30, t25.description AS description_31, t25.description_internal AS description_internal_32, t25.owner_user_id AS owner_user_id_33, t25.owner_group_id AS owner_group_id_34, t25.subject_id AS subject_id_35 FROM core.subject_inform_consent t0 LEFT JOIN core.subject_extend t25 ON t0.subject_plugin_id = t25.id WHERE t0.subject_about_id = $1 AND t0.subcohort_inform_consent_id IN ($2, $3) LIMIT 1;Times Reported Time consuming bind #15
Day Hour Count Duration Avg duration 05 13 3ms 0ms 06 69 23ms 0ms 07 479 113ms 0ms 08 342 73ms 0ms 10 287 85ms 0ms 11 17 5ms 0ms 12 82 16ms 0ms 13 99 27ms 0ms 14 61 12ms 0ms 15 149 28ms 0ms 17 310 62ms 0ms 18 79 18ms 0ms 19 140 27ms 0ms 20 210 39ms 0ms 21 608 130ms 0ms 05 14 3ms 0ms 06 529 101ms 0ms 07 357 75ms 0ms 08 21 7ms 0ms 09 58 30ms 0ms 10 13 5ms 0ms 11 115 43ms 0ms 14 208 40ms 0ms 15 11 2ms 0ms 16 74 16ms 0ms 17 183 38ms 0ms 21 146 29ms 0ms 22 201 39ms 0ms [ User: tng_migration_user - Total duration: 159ms - Times executed: 4875 ]
[ Application: [unknown] - Total duration: 159ms - Times executed: 4875 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.assigned_at AS assigned_at_5, t0.revoke_at AS revoke_at_6, t0.cancelled_at AS cancelled_at_7, t0.upload_at AS upload_at_8, t0.paused_at AS paused_at_9, t0.owner_user_id AS owner_user_id_10, t0.owner_group_id AS owner_group_id_11, t0.subject_id AS subject_id_12, t0.subject_about_id AS subject_about_id_13, t0.subcohort_inform_consent_id AS subcohort_inform_consent_id_14, t0.subject_inform_consent_state_code AS subject_inform_consent_state_code_15, t0.activity_state_code AS activity_state_code_16, t0.terminated_state_code AS terminated_state_code_17, t0.assigned_by AS assigned_by_18, t0.revoke_by AS revoke_by_19, t0.created_by AS created_by_20, t0.cancelled_by AS cancelled_by_21, t0.upload_by AS upload_by_22, t0.paused_by AS paused_by_23, t0.subject_plugin_id AS subject_plugin_id_24, t25.is_archived AS is_archived_26, t25.created_at AS created_at_27, t25.updated_at AS updated_at_28, t25.id AS id_29, t25.extend AS extend_30, t25.description AS description_31, t25.description_internal AS description_internal_32, t25.owner_user_id AS owner_user_id_33, t25.owner_group_id AS owner_group_id_34, t25.subject_id AS subject_id_35 FROM core.subject_inform_consent t0 LEFT JOIN core.subject_extend t25 ON t0.subject_plugin_id = t25.id WHERE t0.subject_about_id = $1 AND t0.subcohort_inform_consent_id IN ($2, $3) LIMIT 1;
Date: 2025-11-26 11:21:19 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '2322', $2 = '591', $3 = '592'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.assigned_at AS assigned_at_5, t0.revoke_at AS revoke_at_6, t0.cancelled_at AS cancelled_at_7, t0.upload_at AS upload_at_8, t0.paused_at AS paused_at_9, t0.owner_user_id AS owner_user_id_10, t0.owner_group_id AS owner_group_id_11, t0.subject_id AS subject_id_12, t0.subject_about_id AS subject_about_id_13, t0.subcohort_inform_consent_id AS subcohort_inform_consent_id_14, t0.subject_inform_consent_state_code AS subject_inform_consent_state_code_15, t0.activity_state_code AS activity_state_code_16, t0.terminated_state_code AS terminated_state_code_17, t0.assigned_by AS assigned_by_18, t0.revoke_by AS revoke_by_19, t0.created_by AS created_by_20, t0.cancelled_by AS cancelled_by_21, t0.upload_by AS upload_by_22, t0.paused_by AS paused_by_23, t0.subject_plugin_id AS subject_plugin_id_24, t25.is_archived AS is_archived_26, t25.created_at AS created_at_27, t25.updated_at AS updated_at_28, t25.id AS id_29, t25.extend AS extend_30, t25.description AS description_31, t25.description_internal AS description_internal_32, t25.owner_user_id AS owner_user_id_33, t25.owner_group_id AS owner_group_id_34, t25.subject_id AS subject_id_35 FROM core.subject_inform_consent t0 LEFT JOIN core.subject_extend t25 ON t0.subject_plugin_id = t25.id WHERE t0.subject_about_id = $1 AND t0.subcohort_inform_consent_id IN ($2, $3) LIMIT 1;
Date: 2025-11-26 11:31:24 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '2425', $2 = '241', $3 = '242'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.assigned_at AS assigned_at_5, t0.revoke_at AS revoke_at_6, t0.cancelled_at AS cancelled_at_7, t0.upload_at AS upload_at_8, t0.paused_at AS paused_at_9, t0.owner_user_id AS owner_user_id_10, t0.owner_group_id AS owner_group_id_11, t0.subject_id AS subject_id_12, t0.subject_about_id AS subject_about_id_13, t0.subcohort_inform_consent_id AS subcohort_inform_consent_id_14, t0.subject_inform_consent_state_code AS subject_inform_consent_state_code_15, t0.activity_state_code AS activity_state_code_16, t0.terminated_state_code AS terminated_state_code_17, t0.assigned_by AS assigned_by_18, t0.revoke_by AS revoke_by_19, t0.created_by AS created_by_20, t0.cancelled_by AS cancelled_by_21, t0.upload_by AS upload_by_22, t0.paused_by AS paused_by_23, t0.subject_plugin_id AS subject_plugin_id_24, t25.is_archived AS is_archived_26, t25.created_at AS created_at_27, t25.updated_at AS updated_at_28, t25.id AS id_29, t25.extend AS extend_30, t25.description AS description_31, t25.description_internal AS description_internal_32, t25.owner_user_id AS owner_user_id_33, t25.owner_group_id AS owner_group_id_34, t25.subject_id AS subject_id_35 FROM core.subject_inform_consent t0 LEFT JOIN core.subject_extend t25 ON t0.subject_plugin_id = t25.id WHERE t0.subject_about_id = $1 AND t0.subcohort_inform_consent_id IN ($2, $3) LIMIT 1;
Date: 2025-11-27 12:54:21 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '1744', $2 = '591', $3 = '592'
16 1s31ms 6,744 0ms 0ms 0ms SELECT s0_.is_archived AS is_archived_0, s0_.created_at AS created_at_1, s0_.updated_at AS updated_at_2, s0_.ordering AS ordering_3, s0_.id AS id_4, s0_.is_required AS is_required_5, s0_.subcohort_id AS subcohort_id_6, s0_.info_consent_id AS info_consent_id_7, s0_.subject_role_code AS subject_role_code_8 FROM core.subcohort_inform_consent s0_ INNER JOIN core.subcohort s1_ ON s0_.subcohort_id = s1_.id WHERE s0_.info_consent_id = s1_.inform_consent_id AND s0_.subcohort_id IN ($1);Times Reported Time consuming bind #16
Day Hour Count Duration Avg duration 04 122 21ms 0ms 06 42 9ms 0ms 07 487 75ms 0ms 08 446 70ms 0ms 10 452 72ms 0ms 11 28 5ms 0ms 12 128 19ms 0ms 13 107 16ms 0ms 14 79 11ms 0ms 15 388 58ms 0ms 17 411 62ms 0ms 18 102 14ms 0ms 19 181 26ms 0ms 20 272 38ms 0ms 21 886 133ms 0ms 04 117 20ms 0ms 06 682 97ms 0ms 07 448 70ms 0ms 08 2 0ms 0ms 09 15 3ms 0ms 10 9 2ms 0ms 11 43 9ms 0ms 14 270 39ms 0ms 15 50 8ms 0ms 16 166 24ms 0ms 17 329 48ms 0ms 21 214 31ms 0ms 22 268 39ms 0ms [ User: tng_migration_user - Total duration: 129ms - Times executed: 6744 ]
[ Application: [unknown] - Total duration: 129ms - Times executed: 6744 ]
-
SELECT s0_.is_archived AS is_archived_0, s0_.created_at AS created_at_1, s0_.updated_at AS updated_at_2, s0_.ordering AS ordering_3, s0_.id AS id_4, s0_.is_required AS is_required_5, s0_.subcohort_id AS subcohort_id_6, s0_.info_consent_id AS info_consent_id_7, s0_.subject_role_code AS subject_role_code_8 FROM core.subcohort_inform_consent s0_ INNER JOIN core.subcohort s1_ ON s0_.subcohort_id = s1_.id WHERE s0_.info_consent_id = s1_.inform_consent_id AND s0_.subcohort_id IN ($1);
Date: 2025-11-26 18:06:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '81'
-
SELECT s0_.is_archived AS is_archived_0, s0_.created_at AS created_at_1, s0_.updated_at AS updated_at_2, s0_.ordering AS ordering_3, s0_.id AS id_4, s0_.is_required AS is_required_5, s0_.subcohort_id AS subcohort_id_6, s0_.info_consent_id AS info_consent_id_7, s0_.subject_role_code AS subject_role_code_8 FROM core.subcohort_inform_consent s0_ INNER JOIN core.subcohort s1_ ON s0_.subcohort_id = s1_.id WHERE s0_.info_consent_id = s1_.inform_consent_id AND s0_.subcohort_id IN ($1);
Date: 2025-11-27 08:11:14 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '68'
-
SELECT s0_.is_archived AS is_archived_0, s0_.created_at AS created_at_1, s0_.updated_at AS updated_at_2, s0_.ordering AS ordering_3, s0_.id AS id_4, s0_.is_required AS is_required_5, s0_.subcohort_id AS subcohort_id_6, s0_.info_consent_id AS info_consent_id_7, s0_.subject_role_code AS subject_role_code_8 FROM core.subcohort_inform_consent s0_ INNER JOIN core.subcohort s1_ ON s0_.subcohort_id = s1_.id WHERE s0_.info_consent_id = s1_.inform_consent_id AND s0_.subcohort_id IN ($1);
Date: 2025-11-27 11:21:06 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '68'
17 1s5ms 820 0ms 4ms 1ms SELECT t0.ID AS id_1, t0.USER_ID AS user_id_2, t0.GROUP_ID AS group_id_3, t4.ID AS id_5, t4.NAME AS name_6, t4.ACRONYM AS acronym_7, t4.DESCRIPTION AS description_8, t4.STRUCTURE_ROOT_GROUP_ID AS structure_root_group_id_9, t4.STRUCTURE_LEFT_TREE AS structure_left_tree_10, t4.STRUCTURE_RIGHT_TREE AS structure_right_tree_11, t4.INFO AS info_12, t4.TYPE_ID AS type_id_13, t4.STRUCTURE_ROOT_GROUP_ID AS structure_root_group_id_14, t4.STRUCTURE_PARENT_GROUP_ID AS structure_parent_group_id_15, t4.OWNER_GROUP_ID AS owner_group_id_16, t4.OWNER_USER_ID AS owner_user_id_17, t0.ROLE_ID AS role_id_18, t19.ID AS id_20, t19.NAME AS name_21, t19.DESCRIPTION AS description_22 FROM ACL_USER_GROUP_ROLE t0 INNER JOIN ACL_GROUP t4 ON t0.GROUP_ID = t4.ID INNER JOIN ACL_Role t19 ON t0.ROLE_ID = t19.ID WHERE t0.USER_ID = $1;Times Reported Time consuming bind #17
Day Hour Count Duration Avg duration 06 28 33ms 1ms 07 62 77ms 1ms 08 60 74ms 1ms 09 2 2ms 1ms 10 173 219ms 1ms 11 19 22ms 1ms 12 8 9ms 1ms 13 29 35ms 1ms 14 3 4ms 1ms 15 47 58ms 1ms 17 25 30ms 1ms 18 3 3ms 1ms 19 8 9ms 1ms 20 21 23ms 1ms 21 40 48ms 1ms 06 31 39ms 1ms 07 43 51ms 1ms 08 10 11ms 1ms 09 43 52ms 1ms 10 14 17ms 1ms 11 65 79ms 1ms 12 5 5ms 1ms 14 11 12ms 1ms 15 17 19ms 1ms 16 8 9ms 1ms 17 20 23ms 1ms 20 1 1ms 1ms 21 7 7ms 1ms 22 17 20ms 1ms [ User: tng_migration_user - Total duration: 473ms - Times executed: 820 ]
[ Application: [unknown] - Total duration: 473ms - Times executed: 820 ]
-
SELECT t0.ID AS id_1, t0.USER_ID AS user_id_2, t0.GROUP_ID AS group_id_3, t4.ID AS id_5, t4.NAME AS name_6, t4.ACRONYM AS acronym_7, t4.DESCRIPTION AS description_8, t4.STRUCTURE_ROOT_GROUP_ID AS structure_root_group_id_9, t4.STRUCTURE_LEFT_TREE AS structure_left_tree_10, t4.STRUCTURE_RIGHT_TREE AS structure_right_tree_11, t4.INFO AS info_12, t4.TYPE_ID AS type_id_13, t4.STRUCTURE_ROOT_GROUP_ID AS structure_root_group_id_14, t4.STRUCTURE_PARENT_GROUP_ID AS structure_parent_group_id_15, t4.OWNER_GROUP_ID AS owner_group_id_16, t4.OWNER_USER_ID AS owner_user_id_17, t0.ROLE_ID AS role_id_18, t19.ID AS id_20, t19.NAME AS name_21, t19.DESCRIPTION AS description_22 FROM ACL_USER_GROUP_ROLE t0 INNER JOIN ACL_GROUP t4 ON t0.GROUP_ID = t4.ID INNER JOIN ACL_Role t19 ON t0.ROLE_ID = t19.ID WHERE t0.USER_ID = $1;
Date: 2025-11-26 11:40:11 Duration: 4ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '15930'
-
SELECT t0.ID AS id_1, t0.USER_ID AS user_id_2, t0.GROUP_ID AS group_id_3, t4.ID AS id_5, t4.NAME AS name_6, t4.ACRONYM AS acronym_7, t4.DESCRIPTION AS description_8, t4.STRUCTURE_ROOT_GROUP_ID AS structure_root_group_id_9, t4.STRUCTURE_LEFT_TREE AS structure_left_tree_10, t4.STRUCTURE_RIGHT_TREE AS structure_right_tree_11, t4.INFO AS info_12, t4.TYPE_ID AS type_id_13, t4.STRUCTURE_ROOT_GROUP_ID AS structure_root_group_id_14, t4.STRUCTURE_PARENT_GROUP_ID AS structure_parent_group_id_15, t4.OWNER_GROUP_ID AS owner_group_id_16, t4.OWNER_USER_ID AS owner_user_id_17, t0.ROLE_ID AS role_id_18, t19.ID AS id_20, t19.NAME AS name_21, t19.DESCRIPTION AS description_22 FROM ACL_USER_GROUP_ROLE t0 INNER JOIN ACL_GROUP t4 ON t0.GROUP_ID = t4.ID INNER JOIN ACL_Role t19 ON t0.ROLE_ID = t19.ID WHERE t0.USER_ID = $1;
Date: 2025-11-26 22:45:36 Duration: 3ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '14910'
-
SELECT t0.ID AS id_1, t0.USER_ID AS user_id_2, t0.GROUP_ID AS group_id_3, t4.ID AS id_5, t4.NAME AS name_6, t4.ACRONYM AS acronym_7, t4.DESCRIPTION AS description_8, t4.STRUCTURE_ROOT_GROUP_ID AS structure_root_group_id_9, t4.STRUCTURE_LEFT_TREE AS structure_left_tree_10, t4.STRUCTURE_RIGHT_TREE AS structure_right_tree_11, t4.INFO AS info_12, t4.TYPE_ID AS type_id_13, t4.STRUCTURE_ROOT_GROUP_ID AS structure_root_group_id_14, t4.STRUCTURE_PARENT_GROUP_ID AS structure_parent_group_id_15, t4.OWNER_GROUP_ID AS owner_group_id_16, t4.OWNER_USER_ID AS owner_user_id_17, t0.ROLE_ID AS role_id_18, t19.ID AS id_20, t19.NAME AS name_21, t19.DESCRIPTION AS description_22 FROM ACL_USER_GROUP_ROLE t0 INNER JOIN ACL_GROUP t4 ON t0.GROUP_ID = t4.ID INNER JOIN ACL_Role t19 ON t0.ROLE_ID = t19.ID WHERE t0.USER_ID = $1;
Date: 2025-11-27 07:19:18 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '14401'
18 971ms 20,128 0ms 1ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = $1;Times Reported Time consuming bind #18
Day Hour Count Duration Avg duration 04 596 27ms 0ms 05 524 24ms 0ms 06 524 26ms 0ms 07 527 25ms 0ms 08 531 27ms 0ms 09 522 23ms 0ms 10 533 30ms 0ms 11 526 31ms 0ms 12 524 24ms 0ms 13 523 24ms 0ms 14 523 23ms 0ms 15 525 26ms 0ms 16 520 26ms 0ms 17 524 28ms 0ms 18 521 23ms 0ms 19 522 24ms 0ms 20 520 23ms 0ms 21 528 27ms 0ms 22 519 23ms 0ms 04 585 27ms 0ms 05 528 24ms 0ms 06 534 27ms 0ms 07 531 25ms 0ms 08 527 24ms 0ms 09 527 23ms 0ms 10 531 25ms 0ms 11 527 25ms 0ms 12 527 25ms 0ms 13 527 24ms 0ms 14 527 24ms 0ms 15 527 25ms 0ms 16 529 24ms 0ms 17 529 26ms 0ms 18 527 25ms 0ms 19 527 24ms 0ms 20 527 24ms 0ms 21 529 25ms 0ms 22 530 24ms 0ms [ User: tng_migration_user - Total duration: 249ms - Times executed: 20128 ]
[ Application: [unknown] - Total duration: 249ms - Times executed: 20128 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = $1;
Date: 2025-11-26 18:31:42 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '137351'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = $1;
Date: 2025-11-26 18:38:20 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '137351'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = $1;
Date: 2025-11-26 09:22:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '135924'
19 728ms 828 0ms 1ms 0ms SELECT t0.ID AS id_1, t0.LOGIN AS login_2, t0.EMAIL AS email_3, t0.NAME AS name_4, t0.ACTIVE AS active_5, t0.AUTH_CODE AS auth_code_6, t0.IS_EMAIL_TWO_FACTOR_AUTHENTICATION AS is_email_two_factor_authentication_7, t0.TITLE_BEFORE AS title_before_8, t0.TITLE_AFTER AS title_after_9, t0.PHONE AS phone_10, t0.SALT AS salt_11, t0.PASSWORD AS password_12, t0.PASSWORD_HASH_ALGORITHM AS password_hash_algorithm_13, t0.PASSWORD_HASH_COST AS password_hash_cost_14, t0.INFO AS info_15, t0.INFO_PUBLIC AS info_public_16, t0.datecreated AS datecreated_17, t0.datechanged AS datechanged_18, t0.PASSWORD_EXPIRE AS password_expire_19, t0.PASSWORD_RESET_HASH AS password_reset_hash_20, t0.PASSWORD_RESET_HASH_VALIDITY AS password_reset_hash_validity_21, t0.CREDENTIALS_SENT_LAST_ON AS credentials_sent_last_on_22, t0.SEND_CREDENTIALS_IMMEDIATELY AS send_credentials_immediately_23, t0.DEACTIVATED_LAST_ON AS deactivated_last_on_24, t0.PASSWORD_CHANGED_LAST_ON AS password_changed_last_on_25, t0.EXPIRATION_EMAIL_SENT_LAST_ON AS expiration_email_sent_last_on_26, t0.OWNER_USER_ID AS owner_user_id_27, t0.OWNER_GROUP_ID AS owner_group_id_28, t0.userchanged AS userchanged_29 FROM ACL_user t0 WHERE t0.ID = $1;Times Reported Time consuming bind #19
Day Hour Count Duration Avg duration 06 31 25ms 0ms 07 70 56ms 0ms 08 60 53ms 0ms 09 1 0ms 0ms 10 180 158ms 0ms 11 21 17ms 0ms 12 6 5ms 0ms 13 28 22ms 0ms 14 3 3ms 1ms 15 45 41ms 0ms 17 25 23ms 0ms 18 2 1ms 0ms 19 7 6ms 0ms 20 20 17ms 0ms 21 37 34ms 0ms 06 30 29ms 0ms 07 39 34ms 0ms 08 11 8ms 0ms 09 50 40ms 0ms 10 14 13ms 0ms 11 71 60ms 0ms 12 4 3ms 0ms 14 9 7ms 0ms 15 16 13ms 0ms 16 7 6ms 0ms 17 19 17ms 0ms 20 1 0ms 0ms 21 6 5ms 0ms 22 15 14ms 0ms [ User: tng_migration_user - Total duration: 42ms - Times executed: 828 ]
[ Application: [unknown] - Total duration: 42ms - Times executed: 828 ]
-
SELECT t0.ID AS id_1, t0.LOGIN AS login_2, t0.EMAIL AS email_3, t0.NAME AS name_4, t0.ACTIVE AS active_5, t0.AUTH_CODE AS auth_code_6, t0.IS_EMAIL_TWO_FACTOR_AUTHENTICATION AS is_email_two_factor_authentication_7, t0.TITLE_BEFORE AS title_before_8, t0.TITLE_AFTER AS title_after_9, t0.PHONE AS phone_10, t0.SALT AS salt_11, t0.PASSWORD AS password_12, t0.PASSWORD_HASH_ALGORITHM AS password_hash_algorithm_13, t0.PASSWORD_HASH_COST AS password_hash_cost_14, t0.INFO AS info_15, t0.INFO_PUBLIC AS info_public_16, t0.datecreated AS datecreated_17, t0.datechanged AS datechanged_18, t0.PASSWORD_EXPIRE AS password_expire_19, t0.PASSWORD_RESET_HASH AS password_reset_hash_20, t0.PASSWORD_RESET_HASH_VALIDITY AS password_reset_hash_validity_21, t0.CREDENTIALS_SENT_LAST_ON AS credentials_sent_last_on_22, t0.SEND_CREDENTIALS_IMMEDIATELY AS send_credentials_immediately_23, t0.DEACTIVATED_LAST_ON AS deactivated_last_on_24, t0.PASSWORD_CHANGED_LAST_ON AS password_changed_last_on_25, t0.EXPIRATION_EMAIL_SENT_LAST_ON AS expiration_email_sent_last_on_26, t0.OWNER_USER_ID AS owner_user_id_27, t0.OWNER_GROUP_ID AS owner_group_id_28, t0.userchanged AS userchanged_29 FROM ACL_user t0 WHERE t0.ID = $1;
Date: 2025-11-27 18:18:54 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '13518'
-
SELECT t0.ID AS id_1, t0.LOGIN AS login_2, t0.EMAIL AS email_3, t0.NAME AS name_4, t0.ACTIVE AS active_5, t0.AUTH_CODE AS auth_code_6, t0.IS_EMAIL_TWO_FACTOR_AUTHENTICATION AS is_email_two_factor_authentication_7, t0.TITLE_BEFORE AS title_before_8, t0.TITLE_AFTER AS title_after_9, t0.PHONE AS phone_10, t0.SALT AS salt_11, t0.PASSWORD AS password_12, t0.PASSWORD_HASH_ALGORITHM AS password_hash_algorithm_13, t0.PASSWORD_HASH_COST AS password_hash_cost_14, t0.INFO AS info_15, t0.INFO_PUBLIC AS info_public_16, t0.datecreated AS datecreated_17, t0.datechanged AS datechanged_18, t0.PASSWORD_EXPIRE AS password_expire_19, t0.PASSWORD_RESET_HASH AS password_reset_hash_20, t0.PASSWORD_RESET_HASH_VALIDITY AS password_reset_hash_validity_21, t0.CREDENTIALS_SENT_LAST_ON AS credentials_sent_last_on_22, t0.SEND_CREDENTIALS_IMMEDIATELY AS send_credentials_immediately_23, t0.DEACTIVATED_LAST_ON AS deactivated_last_on_24, t0.PASSWORD_CHANGED_LAST_ON AS password_changed_last_on_25, t0.EXPIRATION_EMAIL_SENT_LAST_ON AS expiration_email_sent_last_on_26, t0.OWNER_USER_ID AS owner_user_id_27, t0.OWNER_GROUP_ID AS owner_group_id_28, t0.userchanged AS userchanged_29 FROM ACL_user t0 WHERE t0.ID = $1;
Date: 2025-11-27 11:21:12 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '15863'
-
SELECT t0.ID AS id_1, t0.LOGIN AS login_2, t0.EMAIL AS email_3, t0.NAME AS name_4, t0.ACTIVE AS active_5, t0.AUTH_CODE AS auth_code_6, t0.IS_EMAIL_TWO_FACTOR_AUTHENTICATION AS is_email_two_factor_authentication_7, t0.TITLE_BEFORE AS title_before_8, t0.TITLE_AFTER AS title_after_9, t0.PHONE AS phone_10, t0.SALT AS salt_11, t0.PASSWORD AS password_12, t0.PASSWORD_HASH_ALGORITHM AS password_hash_algorithm_13, t0.PASSWORD_HASH_COST AS password_hash_cost_14, t0.INFO AS info_15, t0.INFO_PUBLIC AS info_public_16, t0.datecreated AS datecreated_17, t0.datechanged AS datechanged_18, t0.PASSWORD_EXPIRE AS password_expire_19, t0.PASSWORD_RESET_HASH AS password_reset_hash_20, t0.PASSWORD_RESET_HASH_VALIDITY AS password_reset_hash_validity_21, t0.CREDENTIALS_SENT_LAST_ON AS credentials_sent_last_on_22, t0.SEND_CREDENTIALS_IMMEDIATELY AS send_credentials_immediately_23, t0.DEACTIVATED_LAST_ON AS deactivated_last_on_24, t0.PASSWORD_CHANGED_LAST_ON AS password_changed_last_on_25, t0.EXPIRATION_EMAIL_SENT_LAST_ON AS expiration_email_sent_last_on_26, t0.OWNER_USER_ID AS owner_user_id_27, t0.OWNER_GROUP_ID AS owner_group_id_28, t0.userchanged AS userchanged_29 FROM ACL_user t0 WHERE t0.ID = $1;
Date: 2025-11-26 22:38:25 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '14910'
20 694ms 6,688 0ms 0ms 0ms SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id = $1 AND m0_.form_state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date IS NOT NULL AND (m0_.result_date BETWEEN $7 AND $8);Times Reported Time consuming bind #20
Day Hour Count Duration Avg duration 04 176 17ms 0ms 05 176 17ms 0ms 06 176 18ms 0ms 07 176 18ms 0ms 08 176 17ms 0ms 09 176 18ms 0ms 10 176 18ms 0ms 11 176 22ms 0ms 12 176 17ms 0ms 13 176 18ms 0ms 14 176 17ms 0ms 15 176 17ms 0ms 16 176 18ms 0ms 17 176 18ms 0ms 18 176 17ms 0ms 19 176 17ms 0ms 20 176 17ms 0ms 21 176 19ms 0ms 22 176 18ms 0ms 04 176 18ms 0ms 05 176 18ms 0ms 06 176 18ms 0ms 07 176 18ms 0ms 08 176 17ms 0ms 09 176 18ms 0ms 10 176 18ms 0ms 11 176 18ms 0ms 12 176 18ms 0ms 13 176 18ms 0ms 14 176 17ms 0ms 15 176 17ms 0ms 16 176 17ms 0ms 17 176 19ms 0ms 18 176 19ms 0ms 19 176 17ms 0ms 20 176 17ms 0ms 21 176 18ms 0ms 22 176 17ms 0ms [ User: tng_migration_user - Total duration: 448ms - Times executed: 6688 ]
[ Application: [unknown] - Total duration: 448ms - Times executed: 6688 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id = $1 AND m0_.form_state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date IS NOT NULL AND (m0_.result_date BETWEEN $7 AND $8);
Date: 2025-11-27 14:00:04 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '135', $2 = 'DONE', $3 = 'CLOSED', $4 = 'EXPIRED', $5 = 'EXPIRED_EMPTY', $6 = 't', $7 = '2020-09-04 14:00:02', $8 = '2020-09-22 14:00:02'
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id = $1 AND m0_.form_state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date IS NOT NULL AND (m0_.result_date BETWEEN $7 AND $8);
Date: 2025-11-26 12:00:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '24', $2 = 'DONE', $3 = 'CLOSED', $4 = 'EXPIRED', $5 = 'EXPIRED_EMPTY', $6 = 't', $7 = '2025-11-08 12:00:01', $8 = '2025-11-12 12:00:01'
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id = $1 AND m0_.form_state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date IS NOT NULL AND (m0_.result_date BETWEEN $7 AND $8);
Date: 2025-11-26 12:00:03 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '118', $2 = 'DONE', $3 = 'CLOSED', $4 = 'EXPIRED', $5 = 'EXPIRED_EMPTY', $6 = 't', $7 = '2020-08-23 12:00:01', $8 = '2020-09-13 12:00:01'
-
Events
Log levels
Key values
- 1,694,899 Event entries
- (EVENTLOG entries are formaly LOG level entries that are not queries)
Events distribution (except queries)
Key values
- 0 PANIC entries
- 34184 FATAL entries
- 0 ERROR entries
- 102 WARNING entries
- 16 EVENTLOG entries
Most Frequent Errors/Events
Key values
- 34,184 Max number of times the same event was reported
- 34,302 Total events found
Rank Times reported Error 1 34,184 FATAL: password authentication failed for user "..."
Times Reported Most Frequent Error / Event #1
Day Hour Count Nov 27 00 1,430 01 1,434 02 1,418 03 1,434 04 1,434 05 1,432 06 1,434 07 1,428 08 1,434 09 1,430 10 1,416 11 1,410 12 1,420 13 1,410 14 1,416 15 1,422 16 1,428 17 1,426 18 1,424 19 1,426 20 1,418 21 1,424 22 1,418 23 1,418 - FATAL: password authentication failed for user "ismael"
Detail: Connection matched file "/etc/postgresql/16/main/pg_hba.conf" line 143: "host all all 10.16.50.12/32 md5"
Date: 2025-11-27 00:00:04 Database: celspac Application: [unknown] User: ismael Remote: 10.16.50.12 Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
2 102 WARNING: there is already a transaction in progress
Times Reported Most Frequent Error / Event #2
Day Hour Count Nov 27 05 51 17 51 3 16 LOG: could not receive data from client: Connection reset by peer
Times Reported Most Frequent Error / Event #3
Day Hour Count Nov 27 01 2 23 14