-
Global information
- Generated on Sun Nov 30 04:36:26 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,747,457 log entries in 36m23s
- Log start from 2025-11-29 00:00:01 to 2025-11-29 23:59:59
-
Overview
Global Stats
- 554 Number of unique normalized queries
- 323,569 Number of queries
- 28m15s Total query duration
- 2025-11-29 00:00:01 First query
- 2025-11-29 23:59:42 Last query
- 1,501 queries/s at 2025-11-29 21:00:03 Query peak
- 28m15s Total query duration
- 29s497ms Prepare/parse total duration
- 39s446ms Bind total duration
- 27m6s Execute total duration
- 34,400 Number of events
- 3 Number of unique normalized events
- 34,282 Max number of times the same event was reported
- 0 Number of cancellation
- 440 Total number of automatic vacuums
- 482 Total number of automatic analyzes
- 6,691 Number temporary file
- 14.36 MiB Max size of temporary file
- 2.08 MiB Average size of temporary file
- 14,725 Total number of sessions
- 2 sessions at 2025-11-29 18:46:18 Session peak
- 56m17s Total duration of sessions
- 229ms Average duration of sessions
- 21 Average queries per session
- 115ms Average queries duration per session
- 114ms Average idle time per session
- 14,725 Total number of connections
- 15 connections/s at 2025-11-29 05:02:04 Connection peak
- 3 Total number of databases
SQL Traffic
Key values
- 1,501 queries/s Query Peak
- 2025-11-29 21:00:03 Date
SELECT Traffic
Key values
- 1,500 queries/s Query Peak
- 2025-11-29 21:00:03 Date
INSERT/UPDATE/DELETE Traffic
Key values
- 1,272 queries/s Query Peak
- 2025-11-29 23:35:17 Date
Queries duration
Key values
- 28m15s 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 29 00 7,123 0ms 16ms 0ms 7ms 7ms 999ms 01 6,444 0ms 1ms 0ms 6ms 7ms 13ms 02 6,420 0ms 1ms 0ms 6ms 7ms 7ms 03 6,420 0ms 2ms 0ms 7ms 8ms 8ms 04 6,420 0ms 1ms 0ms 7ms 7ms 8ms 05 15,185 0ms 9m21s 44ms 1s297ms 2s808ms 9m22s 06 16,623 0ms 1s298ms 0ms 1s301ms 1s358ms 1s471ms 07 13,707 0ms 1s396ms 1ms 1s346ms 1s441ms 1s493ms 08 13,710 0ms 1s399ms 1ms 1s329ms 1s426ms 1s506ms 09 13,710 0ms 1s459ms 1ms 1s420ms 1s486ms 1s679ms 10 13,710 0ms 2s251ms 1ms 1s410ms 1s457ms 2s359ms 11 17,108 0ms 1s438ms 0ms 1s310ms 1s386ms 1s569ms 12 14,185 0ms 1s425ms 1ms 1s294ms 1s477ms 1s530ms 13 14,105 0ms 1s717ms 1ms 1s358ms 1s477ms 1s813ms 14 16,748 0ms 1s470ms 0ms 1s369ms 1s463ms 1s586ms 15 13,706 0ms 1s818ms 1ms 1s387ms 1s435ms 1s917ms 16 15,116 0ms 1s439ms 1ms 1s409ms 1s449ms 1s550ms 17 15,714 0ms 9m32s 43ms 1s471ms 1s652ms 9m32s 18 16,696 0ms 1s397ms 0ms 1s346ms 1s379ms 1s633ms 19 17,338 0ms 1s420ms 0ms 1s288ms 1s447ms 1s562ms 20 14,790 0ms 1s391ms 1ms 1s314ms 1s387ms 1s508ms 21 13,773 0ms 1s399ms 1ms 1s272ms 1s435ms 1s495ms 22 14,399 0ms 1s421ms 1ms 1s374ms 1s488ms 1s518ms 23 20,419 0ms 1s353ms 0ms 1s320ms 1s460ms 1s737ms Day Hour SELECT COPY TO Average Duration Latency Percentile(90) Latency Percentile(95) Latency Percentile(99) Nov 29 00 6,402 0 0ms 5ms 6ms 7ms 01 6,024 0 0ms 6ms 6ms 7ms 02 6,000 0 0ms 5ms 6ms 6ms 03 6,000 0 0ms 6ms 6ms 7ms 04 6,000 0 0ms 6ms 6ms 6ms 05 12,101 0 0ms 6ms 87ms 385ms 06 14,896 0 0ms 49ms 86ms 92ms 07 12,864 0 0ms 17ms 88ms 90ms 08 12,867 0 0ms 21ms 86ms 98ms 09 12,867 0 0ms 21ms 87ms 115ms 10 12,867 0 0ms 18ms 89ms 100ms 11 16,131 0 0ms 48ms 92ms 113ms 12 13,315 0 0ms 21ms 86ms 104ms 13 13,249 0 0ms 21ms 87ms 102ms 14 15,818 0 0ms 40ms 87ms 101ms 15 12,863 0 0ms 19ms 86ms 99ms 16 14,237 0 0ms 31ms 91ms 106ms 17 13,865 0 0ms 20ms 89ms 250ms 18 15,781 0 0ms 30ms 87ms 126ms 19 16,300 0 0ms 34ms 89ms 117ms 20 13,917 0 0ms 23ms 87ms 108ms 21 12,912 0 0ms 20ms 87ms 98ms 22 13,539 0 0ms 22ms 88ms 103ms 23 13,670 0 0ms 22ms 86ms 104ms Day Hour INSERT UPDATE DELETE COPY FROM Average Duration Latency Percentile(90) Latency Percentile(95) Latency Percentile(99) Nov 29 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 503 160 0 0 0ms 0ms 2ms 55ms 06 211 232 0 0 0ms 3ms 4ms 34ms 07 10 94 0 0 1ms 2ms 3ms 4ms 08 10 94 0 0 1ms 3ms 3ms 5ms 09 10 94 0 0 1ms 2ms 3ms 4ms 10 10 94 0 0 1ms 2ms 3ms 4ms 11 25 109 0 0 1ms 3ms 4ms 11ms 12 15 96 0 0 1ms 3ms 3ms 4ms 13 11 96 0 0 1ms 3ms 3ms 4ms 14 23 101 0 0 1ms 2ms 3ms 8ms 15 10 94 0 0 1ms 2ms 3ms 4ms 16 14 98 0 0 1ms 3ms 4ms 4ms 17 18 89 0 0 1ms 3ms 3ms 5ms 18 14 103 0 0 1ms 3ms 3ms 6ms 19 45 108 0 0 1ms 3ms 4ms 9ms 20 15 96 0 0 1ms 2ms 3ms 4ms 21 14 95 0 0 1ms 3ms 3ms 4ms 22 12 96 0 0 1ms 3ms 3ms 5ms 23 14 97 0 0 1ms 3ms 3ms 5ms Day Hour Prepare Bind Bind/Prepare Percentage of prepare Nov 29 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 12,555 12,555 1.00 85.12% 06 15,176 15,176 1.00 94.10% 07 12,808 12,808 1.00 96.86% 08 12,808 12,808 1.00 96.84% 09 12,808 12,808 1.00 96.84% 10 12,808 12,808 1.00 96.84% 11 16,102 16,102 1.00 97.12% 12 13,263 13,263 1.00 96.85% 13 13,193 13,193 1.00 96.89% 14 15,779 15,779 1.00 97.18% 15 12,804 12,804 1.00 96.84% 16 14,186 14,186 1.00 97.03% 17 13,770 13,770 1.00 90.46% 18 15,735 15,735 1.00 97.25% 19 16,290 16,290 1.00 96.93% 20 13,865 13,865 1.00 96.98% 21 12,858 12,858 1.00 96.78% 22 13,484 13,484 1.00 96.94% 23 13,634 13,634 1.00 68.66% Day Hour Count Average / Second Nov 29 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 643 0.18/s 06 611 0.17/s 07 597 0.17/s 08 600 0.17/s 09 600 0.17/s 10 600 0.17/s 11 644 0.18/s 12 606 0.17/s 13 604 0.17/s 14 627 0.17/s 15 600 0.17/s 16 612 0.17/s 17 659 0.18/s 18 631 0.18/s 19 648 0.18/s 20 609 0.17/s 21 603 0.17/s 22 605 0.17/s 23 623 0.17/s Day Hour Count Average Duration Average idle time Nov 29 00 601 20ms 18ms 01 602 18ms 17ms 02 600 18ms 17ms 03 600 18ms 18ms 04 600 18ms 18ms 05 643 2s138ms 1s90ms 06 611 92ms 67ms 07 597 51ms 26ms 08 600 51ms 25ms 09 600 52ms 26ms 10 600 53ms 26ms 11 644 71ms 46ms 12 606 52ms 27ms 13 604 56ms 29ms 14 627 58ms 33ms 15 600 54ms 26ms 16 612 56ms 31ms 17 659 2s17ms 980ms 18 631 67ms 42ms 19 648 61ms 37ms 20 609 52ms 27ms 21 603 51ms 26ms 22 605 56ms 30ms 23 623 63ms 36ms -
Connections
Established Connections
Key values
- 15 connections Connection Peak
- 2025-11-29 05:02:04 Date
Connections per database
Key values
- celspac Main Database
- 14,725 connections Total
Connections per user
Key values
- tng_migration_user Main User
- 14,725 connections Total
-
Sessions
Simultaneous sessions
Key values
- 2 sessions Session Peak
- 2025-11-29 18:46:18 Date
Histogram of session times
Key values
- 14,435 0-500ms duration
Sessions per database
Key values
- celspac Main Database
- 14,725 sessions Total
Sessions per user
Key values
- tng_migration_user Main User
- 14,725 sessions Total
Sessions per host
Key values
- 127.0.0.1 Main Host
- 14,725 sessions Total
-
Checkpoints / Restartpoints
Checkpoints Buffers
Key values
- 9,172 buffers Checkpoint Peak
- 2025-11-29 17:08:20 Date
- 269.656 seconds Highest write time
- 0.222 seconds Sync time
Checkpoints Wal files
Key values
- 15 files Wal files usage Peak
- 2025-11-29 05:08:11 Date
Checkpoints distance
Key values
- 456.66 Mo Distance Peak
- 2025-11-29 05:08:11 Date
Checkpoints Activity
↑ Back to the top of the Checkpoint Activity tableDay Hour Written buffers Write time Sync time Total time Nov 29 00 2,289 228.894s 0.009s 228.918s 01 0 0s 0s 0s 02 0 0s 0s 0s 03 0 0s 0s 0s 04 0 0s 0s 0s 05 22,415 1,691.57s 0.104s 1,691.79s 06 16,157 2,147.492s 0.096s 2,147.782s 07 14,131 1,892.546s 0.1s 1,892.808s 08 14,197 1,900.75s 0.096s 1,900.952s 09 14,246 1,907.504s 0.088s 1,907.746s 10 14,176 1,908.689s 0.101s 1,908.932s 11 14,090 1,901.157s 0.088s 1,901.389s 12 16,076 2,137.916s 0.096s 2,138.136s 13 16,027 2,119.463s 0.104s 2,119.768s 14 17,952 2,357.679s 0.12s 2,358.206s 15 14,052 1,914.78s 0.086s 1,915.016s 16 13,931 1,905.645s 0.103s 1,905.875s 17 23,928 1,979.057s 0.517s 1,979.764s 18 13,797 1,896.176s 0.112s 1,896.435s 19 15,666 2,133.311s 0.137s 2,133.594s 20 13,699 1,906.463s 0.104s 1,906.685s 21 13,696 1,900.85s 0.109s 1,901.198s 22 13,686 1,919.071s 0.111s 1,919.363s 23 13,684 1,904.622s 0.105s 1,904.832s Day Hour Added Removed Recycled Synced files Longest sync Average sync Nov 29 00 0 0 2 69 0.002s 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 30 663 0.008s 0.008s 06 0 7 14 778 0.003s 0.011s 07 0 3 18 634 0.009s 0.01s 08 0 0 21 622 0.009s 0.01s 09 0 0 21 631 0.002s 0.01s 10 0 0 20 639 0.008s 0.01s 11 0 0 21 677 0.004s 0.01s 12 0 0 21 727 0.004s 0.011s 13 0 0 21 690 0.003s 0.011s 14 0 1 20 813 0.004s 0.012s 15 0 0 21 644 0.005s 0.01s 16 0 0 23 676 0.006s 0.01s 17 0 8 23 933 0.206s 0.015s 18 0 0 21 659 0.012s 0.01s 19 0 1 20 783 0.010s 0.011s 20 0 0 21 687 0.005s 0.01s 21 0 0 21 652 0.005s 0.01s 22 0 0 21 656 0.008s 0.01s 23 0 0 20 656 0.007s 0.01s Day Hour Count Avg time (sec) Nov 29 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 29 00 33,705.00 kB 55,604.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 60,897.38 kB 176,132.00 kB 06 31,195.27 kB 87,893.64 kB 07 34,117.10 kB 60,538.50 kB 08 34,137.80 kB 59,867.20 kB 09 34,158.60 kB 59,969.70 kB 10 34,144.60 kB 59,878.70 kB 11 34,175.10 kB 59,935.00 kB 12 31,109.64 kB 52,511.45 kB 13 31,057.45 kB 54,709.55 kB 14 28,553.25 kB 37,432.08 kB 15 34,195.30 kB 55,921.40 kB 16 34,198.70 kB 59,945.40 kB 17 47,432.18 kB 149,985.64 kB 18 34,064.40 kB 77,534.10 kB 19 31,057.36 kB 54,688.18 kB 20 34,112.70 kB 57,352.60 kB 21 34,066.30 kB 59,776.70 kB 22 34,116.80 kB 59,825.20 kB 23 34,103.10 kB 59,847.10 kB -
Temporary Files
Size of temporary files
Key values
- 73.33 MiB Temp Files size Peak
- 2025-11-29 19:36:02 Date
Number of temporary files
Key values
- 36 per second Temp Files Peak
- 2025-11-29 09:18:02 Date
Temporary Files Activity
↑ Back to the top of the Temporary Files Activity tableDay Hour Count Total size Average size Nov 29 00 0 0 0 01 0 0 0 02 0 0 0 03 0 0 0 04 0 0 0 05 334 729.45 MiB 2.18 MiB 06 357 732.15 MiB 2.05 MiB 07 348 732.42 MiB 2.10 MiB 08 351 732.27 MiB 2.09 MiB 09 354 732.15 MiB 2.07 MiB 10 348 732.36 MiB 2.10 MiB 11 351 732.28 MiB 2.09 MiB 12 357 732.22 MiB 2.05 MiB 13 357 732.30 MiB 2.05 MiB 14 354 732.41 MiB 2.07 MiB 15 354 732.30 MiB 2.07 MiB 16 351 732.20 MiB 2.09 MiB 17 337 729.66 MiB 2.17 MiB 18 350 729.73 MiB 2.08 MiB 19 357 732.39 MiB 2.05 MiB 20 357 732.38 MiB 2.05 MiB 21 357 732.18 MiB 2.05 MiB 22 360 732.23 MiB 2.03 MiB 23 357 732.36 MiB 2.05 MiB Queries generating the most temporary files (N)
Rank Count Total size Min size Max size Avg size Query 1 6,659 13.44 GiB 696.00 KiB 8.56 MiB 2.07 MiB refresh materialized view core.mv_subject_form with data;-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-29 10:06:04 Duration: 2s251ms 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.1
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-29 15:42:03 Duration: 1s818ms 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.1
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-29 13:18:03 Duration: 1s717ms 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.1
2 8 1.97 MiB 8.00 KiB 728.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-29 17:02:18 Duration: 29ms 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.1
-
/* {"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-29 05:02:19 Duration: 26ms 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.1
-
/* {"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-29 05:02:19 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
3 8 12.19 MiB 8.00 KiB 3.82 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-29 17:02:04 Duration: 142ms 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.1
-
/* {"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-29 05:02:05 Duration: 129ms 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.1
-
/* {"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-29 05:02:05 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-29 05:02:19 Duration: 1s218ms 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.1
-
/* {"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-29 17:02:18 Duration: 1s186ms 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.1
-
/* {"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-29 05:02:18 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
5 4 41.22 MiB 8.70 MiB 11.91 MiB 10.31 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-29 17:11:55 Duration: 9m32s 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.1
-
/* {"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-29 05:11:42 Duration: 9m21s 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.1
-
/* {"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-29 05:11:42 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
6 4 35.88 MiB 8.16 MiB 9.77 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-29 17:02:04 Duration: 544ms 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.1
-
/* {"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-29 05:02:05 Duration: 523ms 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.1
-
/* {"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-29 05:02:05 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-29 17:02:19 Duration: 735ms 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.1
-
/* {"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-29 05:02:20 Duration: 723ms 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.1
-
/* {"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-29 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-29 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-29 17:02:18 - 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-29 05:11:42 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
4 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-29 17:11:55 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
5 9.77 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-29 05:02:05 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
6 9.51 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-29 17:02:04 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
7 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-29 05:11:42 - 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-29 17:11:55 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
9 8.56 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-29 09:12:02 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] ]
10 8.55 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-29 09:42:03 - 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-29 18:06:02 ]
12 8.54 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-29 10:48:02 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] ]
13 8.54 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-29 11:18:02 ]
14 8.54 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-29 18:00: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-29 06:12: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-29 13:48:02 ]
17 8.53 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-29 16:12:02 ]
18 8.53 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-29 19:42:02 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] ]
19 8.53 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-29 22:54:02 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] ]
20 8.50 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-29 13:06: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-29 05:02:37 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-29 05:02:37 Date
Analyzes per table
Key values
- core.mv_subject_form (188) Main table analyzed (database celspac)
- 482 analyzes Total
Table Number of analyzes celspac.core.mv_subject_form 188 celspac.core.mv_subject_event 126 celspac.pg_catalog.pg_class 35 celspac.public.scheduled_command 33 celspac.pg_catalog.pg_index 6 celspac.pg_catalog.pg_type 6 celspac.pg_catalog.pg_depend 5 celspac.pg_catalog.pg_attribute 4 celspac.pg_catalog.pg_shdepend 3 celspac.dbt_marts_dbt.export_proband_by_pilot__29 2 celspac.dbt_marts_dbt.export_proband_by_pilot__25 2 celspac.dbt_marts_dbt.export_proband_by_pilot__17 2 celspac.dbt_marts_dbt_all.export_proband_all 2 celspac.dbt_marts_dbt.export_proband_by_pilot__8 2 celspac.dbt_marts_dbt.export_proband_by_pilot__27 2 celspac.dbt_marts_dbt.export_proband_by_pilot__21 2 celspac.dbt_marts_dbt.export_proband_by_pilot__7 2 celspac.dbt_stg.inte_unique_subject_extend 2 celspac.dbt_marts_dbt.export_proband_by_pilot__19 2 celspac.dbt_stg.inte_subject_extend 2 celspac.dbt_marts_dbt.export_proband_by_pilot__5 2 celspac.dbt_marts_dbt.export_proband_by_pilot__4 2 celspac.dbt_stg.stg_celspac_admin__inform_consent 2 celspac.dbt_marts_dbt.test_export 2 celspac.dbt_marts_dbt.export_proband_by_pilot__22 2 celspac.dbt_marts_dbt.export_proband_by_pilot__9 2 celspac.dbt_marts_dbt.export_proband_by_pilot__20 2 celspac.dbt_stg.stg_celspac_admin__subcohort_inform_consent 2 template1.pg_catalog.pg_shdepend 2 celspac.dbt_marts_dbt.export_proband_by_pilot__18 2 celspac.dbt_stg.stg_celspac_admin__subject 2 celspac.dbt_stg.inte_unique_subject_extend_array 2 celspac.dbt_stg.inte_unique_subject_extend_columns 2 celspac.dbt_stg.stg_celspac_admin__subcohort 2 celspac.dbt_marts_dbt.export_proband_by_pilot__1 2 celspac.dbt_marts_dbt.export_proband_by_pilot__10 2 celspac.dbt_marts_dbt.export_proband_by_pilot__35 2 celspac.dbt_marts_dbt.export_proband_by_pilot__36 2 celspac.dbt_marts_dbt.export_proband_by_pilot__11 2 celspac.dbt_marts_dbt.export_proband_by_pilot__12 2 celspac.dbt_marts_dbt.export_proband_by_pilot__26 2 celspac.dbt_marts_dbt.export_proband_by_pilot__30 2 celspac.dbt_marts_dbt.export_proband_by_pilot__23 2 celspac.dbt_marts_dbt.export_proband_by_pilot__15 2 celspac.dbt_stg.stg_celspac_admin__subject_inform_consent 2 celspac.dbt_marts_dbt.export_proband_by_pilot__37 2 celspac.core.cohort 1 postgres.pg_catalog.pg_shdepend 1 Total 482 Vacuums per table
Key values
- core.mv_subject_form (188) Main table vacuumed on database celspac
- 440 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 188 0 882,976 0 36,948 0 0 412,472 188 25,914,108 0 0 celspac.core.mv_subject_event 126 0 25,906 0 504 0 0 4,158 126 1,299,312 0 0 celspac.pg_catalog.pg_class 48 1 8,799 0 279 0 0 976 272 884,124 98 286 celspac.pg_catalog.pg_attribute 23 2 37,551 0 1,350 0 0 3,156 1,278 4,028,241 37 1,078 celspac.pg_catalog.pg_type 9 7 2,972 0 562 0 0 1,449 417 648,739 90 179 celspac.pg_catalog.pg_depend 6 6 9,145 0 422 0 0 1,412 449 946,073 83 609 celspac.pg_catalog.pg_index 3 3 1,397 0 485 0 0 1,067 292 261,112 16 22 template1.pg_catalog.pg_shdepend 3 3 1,260 0 274 0 0 863 213 198,054 91 160 celspac.dbt_marts_dbt.export_proband_by_pilot__27 2 0 616 0 117 0 0 6 0 552 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__19 2 0 7,478 0 1,224 0 0 3,678 2 233,760 0 0 celspac.dbt_stg.inte_unique_subject_extend 2 0 4,451 0 3,860 0 0 3,854 2 244,038 0 0 celspac.dbt_stg.inte_unique_subject_extend_columns 2 0 2,827 0 1,438 0 0 1,436 2 101,316 0 0 celspac.dbt_stg.stg_celspac_admin__subject 2 0 9,049 0 8 0 0 4,441 2 278,671 0 0 celspac.dbt_stg.inte_unique_subject_extend_array 2 0 7,387 0 7,266 0 0 7,260 2 444,992 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__17 2 0 740 0 8 0 0 6 0 552 0 0 celspac.dbt_marts_dbt_all.export_proband_all 2 0 7,681 0 4,068 0 0 2 0 376 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__23 2 0 1,808 0 8 0 0 6 0 552 0 0 celspac.dbt_stg.stg_celspac_admin__subject_inform_consent 2 0 21,370 0 9,721 0 0 10,553 2 639,279 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__22 2 0 274 0 6 0 0 2 0 376 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__26 2 0 580 0 126 0 0 6 0 552 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__20 2 0 760 0 8 0 0 6 0 552 0 0 celspac.pg_catalog.pg_statistic 2 1 4,448 0 1,613 0 0 2,762 1,164 1,107,689 60 178 celspac.dbt_stg.inte_subject_extend 2 0 5,314 0 5,208 0 0 5,202 2 323,570 0 0 celspac.dbt_marts_dbt.test_export 2 0 90 0 22 0 0 6 0 552 0 0 celspac.pg_toast.pg_toast_2619 1 1 171 0 91 0 0 148 40 104,642 1 5 celspac.pg_catalog.pg_shdepend 1 1 399 0 94 0 0 240 27 47,637 0 0 Total 440 25 1,045,449 53,556 75,710 0 0 465,167 4,480 37,709,421 476 2,517 Vacuum throughput per table
Key values
- core.mv_subject_form (18.69) 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 18.69 celspac.core.mv_subject_event 0 0 0 celspac.pg_catalog.pg_class 0 0 0.08 celspac.pg_catalog.pg_attribute 0 0 1.18 celspac.pg_catalog.pg_type 0 0 0.16 celspac.pg_catalog.pg_depend 0 0 0.37 celspac.pg_catalog.pg_index 0 0 0.12 template1.pg_catalog.pg_shdepend 0 0 0.07 celspac.dbt_marts_dbt.export_proband_by_pilot__27 0 0 0.02 celspac.dbt_marts_dbt.export_proband_by_pilot__19 0 0 0.34 celspac.dbt_stg.inte_unique_subject_extend 0 0 0.94 celspac.dbt_stg.inte_unique_subject_extend_columns 0 0 0.33 celspac.dbt_stg.stg_celspac_admin__subject 0 0 0.1 celspac.dbt_stg.inte_unique_subject_extend_array 0 0 1.89 celspac.dbt_marts_dbt.export_proband_by_pilot__17 0 0 0 celspac.dbt_marts_dbt_all.export_proband_all 0 0 0.95 celspac.dbt_marts_dbt.export_proband_by_pilot__23 0 0 0.02 celspac.dbt_stg.stg_celspac_admin__subject_inform_consent 0 0 2.36 celspac.dbt_marts_dbt.export_proband_by_pilot__22 0 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__26 0 0 0.02 celspac.dbt_marts_dbt.export_proband_by_pilot__20 0 0 0 celspac.pg_catalog.pg_statistic 0 0 0.66 celspac.dbt_stg.inte_subject_extend 0 0 1.37 celspac.dbt_marts_dbt.test_export 0 0 0 celspac.pg_toast.pg_toast_2619 0 0 0.02 celspac.pg_catalog.pg_shdepend 0 0 0.03 Total 0 0 29.72 Tuples removed per table
Key values
- pg_catalog.pg_attribute (26251) Main table with removed tuples on database celspac
- 49643 tuples Total removed
Index Tuples Pages Table Vacuums scans removed remain not yet removable removed remain celspac.pg_catalog.pg_attribute 23 2 26,251 1,759,920 154,265 0 277,288 celspac.pg_catalog.pg_statistic 2 1 13,153 297,562 10,185 0 81,264 celspac.pg_catalog.pg_class 48 1 5,001 73,560 2,010 0 215,040 celspac.pg_catalog.pg_depend 6 6 3,082 73,655 174 0 4,290 celspac.pg_catalog.pg_type 9 7 1,097 20,011 634 0 6,462 celspac.pg_catalog.pg_index 3 3 400 2,834 29 0 822 template1.pg_catalog.pg_shdepend 3 3 360 3,052 58 0 306 celspac.pg_toast.pg_toast_2619 1 1 180 2,054 53 0 860 celspac.pg_catalog.pg_shdepend 1 1 119 1,034 58 0 102 celspac.dbt_marts_dbt.export_proband_by_pilot__27 2 0 0 4,476 0 38 218 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 2 0 0 100,248 0 0 3,968 celspac.dbt_stg.inte_unique_subject_extend_columns 2 0 0 100,248 0 106 1,430 celspac.core.mv_subject_event 126 0 0 284,508 0 252 3,780 celspac.dbt_stg.stg_celspac_admin__subject 2 0 0 100,340 0 0 4,480 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.core.mv_subject_form 188 0 0 30,995,748 0 0 421,120 celspac.dbt_marts_dbt_all.export_proband_all 2 0 0 100,202 0 0 4,352 celspac.dbt_marts_dbt.export_proband_by_pilot__23 2 0 0 15,346 0 122 646 celspac.dbt_stg.stg_celspac_admin__subject_inform_consent 2 0 0 635,234 0 0 10,624 celspac.dbt_marts_dbt.export_proband_by_pilot__22 2 0 0 2,394 0 0 128 celspac.dbt_marts_dbt.export_proband_by_pilot__26 2 0 0 4,372 0 20 236 celspac.dbt_marts_dbt.export_proband_by_pilot__20 2 0 0 2,688 0 110 146 celspac.dbt_stg.inte_subject_extend 2 0 0 104,002 0 0 5,248 celspac.dbt_marts_dbt.test_export 2 0 0 2,928 0 4 28 Total 440 25 49,643 34,851,322 167,466 752 1,054,002 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.pg_toast.pg_toast_2619 1 1 180 0 celspac.pg_catalog.pg_index 3 3 400 0 celspac.dbt_marts_dbt.export_proband_by_pilot__19 2 0 0 0 celspac.dbt_stg.inte_unique_subject_extend 2 0 0 0 celspac.pg_catalog.pg_class 48 1 5001 0 celspac.dbt_stg.stg_celspac_admin__subject 2 0 0 0 celspac.dbt_stg.inte_unique_subject_extend_array 2 0 0 0 celspac.pg_catalog.pg_shdepend 1 1 119 0 celspac.core.mv_subject_form 188 0 0 0 celspac.dbt_marts_dbt_all.export_proband_all 2 0 0 0 celspac.pg_catalog.pg_type 9 7 1097 0 celspac.dbt_stg.stg_celspac_admin__subject_inform_consent 2 0 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__22 2 0 0 0 template1.pg_catalog.pg_shdepend 3 3 360 0 celspac.pg_catalog.pg_statistic 2 1 13153 0 celspac.dbt_stg.inte_subject_extend 2 0 0 0 celspac.pg_catalog.pg_depend 6 6 3082 0 celspac.pg_catalog.pg_attribute 23 2 26251 0 Total 440 25 49,643 752 Autovacuum Activity
↑ Back to the top of the Autovacuum Activity tableDay Hour VACUUMs ANALYZEs Nov 29 00 0 0 01 0 0 02 0 0 03 0 0 04 0 0 05 52 55 06 20 21 07 19 21 08 19 23 09 21 21 10 20 21 11 19 21 12 20 23 13 19 21 14 19 22 15 21 23 16 20 23 17 52 58 18 21 22 19 19 21 20 19 22 21 20 22 22 20 22 23 20 20 - 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
- 294,485 Total read queries
- 17,549 Total write queries
Queries by database
Key values
- celspac Main database
- 320,667 Requests
- 27m4s (celspac)
- Main time consuming database
Queries by user
Key values
- tng_migration_user Main user
- 620,176 Requests
User Request type Count Duration postgres Total 7,920 5s409ms select 7,920 5s409ms tng__dwh_celspac_fdw Total 11,751 3s306ms cursor 11,555 3s299ms others 140 5ms tcl 56 0ms tng_migration_user Total 620,176 50m31s cte 2,616 49s724ms ddl 736 39m42s insert 2,671 2s242ms others 21,818 8m38s select 573,029 59s822ms tcl 14,976 12s314ms update 4,330 6s388ms Duration by user
Key values
- 50m31s (tng_migration_user) Main time consuming user
User Request type Count Duration postgres Total 7,920 5s409ms select 7,920 5s409ms tng__dwh_celspac_fdw Total 11,751 3s306ms cursor 11,555 3s299ms others 140 5ms tcl 56 0ms tng_migration_user Total 620,176 50m31s cte 2,616 49s724ms ddl 736 39m42s insert 2,671 2s242ms others 21,818 8m38s select 573,029 59s822ms tcl 14,976 12s314ms update 4,330 6s388ms Queries by host
Key values
- 127.0.0.1 Main host
- 620,200 Requests
- 50m31s (127.0.0.1)
- Main time consuming host
Host Request type Count Duration 10.16.50.4 Total 11,751 3s306ms cursor 11,555 3s299ms others 140 5ms tcl 56 0ms 127.0.0.1 Total 620,200 50m31s cte 2,616 49s724ms ddl 736 39m42s insert 2,671 2s242ms others 21,818 8m38s select 573,053 59s829ms tcl 14,976 12s314ms update 4,330 6s388ms [local] Total 7,896 5s402ms select 7,896 5s402ms Queries by application
Key values
- [unknown] Main application
- 315,593 Requests
- 22m9s (dbt)
- Main time consuming application
Application Request type Count Duration [unknown] Total 315,593 4m54s insert 1,084 639ms others 11,453 4m16s select 294,385 30s122ms tcl 6,625 4s242ms update 2,046 2s936ms dbt Total 2,076 22m9s cte 1,308 25s446ms ddl 368 21m42s others 12 166ms select 76 748ms tcl 312 1s84ms pg_dumpall Total 24 6ms select 24 6ms postgres_fdw Total 5,876 1s725ms cursor 5,778 1s722ms others 70 3ms tcl 28 0ms Number of cancelled queries
Key values
- 0 per second Cancelled query Peak
- 2025-11-29 07:48:02 Date
Number of cancelled queries (5 minutes period)
NO DATASET
-
Top Queries
Histogram of query times
Key values
- 314,893 0-1ms duration
Slowest individual queries
Rank Duration Query 1 9m32s /* {"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-29 17:11:55 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
2 9m21s /* {"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-29 05:11:42 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
3 37s388ms /* {"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-29 05:02:57 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
4 36s981ms /* {"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-29 17:02:56 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
5 5s487ms /* {"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-29 05:02:34 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
6 5s370ms /* {"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-29 17:02:33 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
7 5s126ms /* {"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-29 05:02:35 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
8 5s47ms /* {"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-29 17:02:33 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
9 3s223ms /* {"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-29 17:02:25 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
10 3s41ms /* {"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-29 05:02:26 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
11 2s820ms /* {"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-29 17:02:27 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
12 2s591ms /* {"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-29 05:02:27 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
13 2s418ms /* {"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-29 17:02:27 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
14 2s251ms REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-29 10:06:04 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] - Bind query: yes ]
15 2s227ms /* {"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-29 17:02:28 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
16 2s179ms /* {"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-29 05:02:29 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
17 1s938ms /* {"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-29 17:02:24 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
18 1s818ms REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-29 15:42:03 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] - Bind query: yes ]
19 1s762ms /* {"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-29 05:02:23 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
20 1s717ms REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-29 13:18:03 - 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 18m53s 2 9m21s 9m32s 9m26s 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 29 05 1 9m21s 9m21s 17 1 9m32s 9m32s [ User: tng_migration_user - Total duration: 18m53s - Times executed: 2 ]
[ Application: dbt - Total duration: 18m53s - 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-29 17:11:55 Duration: 9m32s 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.1
-
/* {"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-29 05:11:42 Duration: 9m21s 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.1
-
/* {"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-29 05:11:42 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
2 3m58s 188 1s135ms 2s251ms 1s268ms refresh materialized view core.mv_subject_form with data;Times Reported Time consuming queries #2
Day Hour Count Duration Avg duration Nov 29 05 9 10s870ms 1s207ms 06 10 12s147ms 1s214ms 07 10 12s595ms 1s259ms 08 10 12s504ms 1s250ms 09 10 13s254ms 1s325ms 10 10 13s745ms 1s374ms 11 10 12s508ms 1s250ms 12 10 12s492ms 1s249ms 13 10 13s364ms 1s336ms 14 10 12s735ms 1s273ms 15 10 13s170ms 1s317ms 16 10 12s805ms 1s280ms 17 9 11s628ms 1s292ms 18 10 12s467ms 1s246ms 19 10 12s445ms 1s244ms 20 10 12s344ms 1s234ms 21 10 12s190ms 1s219ms 22 10 12s857ms 1s285ms 23 10 12s421ms 1s242ms [ User: tng_migration_user - Total duration: 3m58s - Times executed: 188 ]
[ Application: [unknown] - Total duration: 3m58s - Times executed: 188 ]
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-29 10:06:04 Duration: 2s251ms 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.1
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-29 15:42:03 Duration: 1s818ms 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.1
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-29 13:18:03 Duration: 1s717ms 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.1
3 1m14s 2 36s981ms 37s388ms 37s185ms 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 29 05 1 37s388ms 37s388ms 17 1 36s981ms 36s981ms [ User: tng_migration_user - Total duration: 1m14s - Times executed: 2 ]
[ Application: dbt - Total duration: 1m14s - 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-29 05:02:57 Duration: 37s388ms 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.1
-
/* {"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-29 17:02:56 Duration: 36s981ms 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.1
4 17s469ms 126 113ms 704ms 138ms refresh materialized view core.mv_subject_event with data;Times Reported Time consuming queries #4
Day Hour Count Duration Avg duration Nov 29 06 7 926ms 132ms 07 7 891ms 127ms 08 7 922ms 131ms 09 7 930ms 132ms 10 7 864ms 123ms 11 7 907ms 129ms 12 7 893ms 127ms 13 7 920ms 131ms 14 7 1s7ms 143ms 15 7 1s492ms 213ms 16 7 888ms 126ms 17 7 945ms 135ms 18 7 1s232ms 176ms 19 7 895ms 127ms 20 7 949ms 135ms 21 7 916ms 130ms 22 7 988ms 141ms 23 7 896ms 128ms [ User: tng_migration_user - Total duration: 17s469ms - Times executed: 126 ]
[ Application: [unknown] - Total duration: 17s469ms - Times executed: 126 ]
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-11-29 15:05:02 Duration: 704ms 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.1
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-11-29 18:50:02 Duration: 407ms 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.1
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-11-29 18:41:02 Duration: 180ms 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.1
5 12s937ms 160 37ms 223ms 80ms 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 29 05 80 6s506ms 81ms 17 80 6s430ms 80ms [ User: tng_migration_user - Total duration: 12s937ms - Times executed: 160 ]
[ Application: dbt - Total duration: 12s937ms - 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-29 05:02:20 Duration: 223ms 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.1
-
/* {"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-29 17:02:23 Duration: 222ms 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.1
-
/* {"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-29 17:02:23 Duration: 218ms 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.1
6 12s368ms 21,996 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 #6
Day Hour Count Duration Avg duration Nov 29 05 1,053 580ms 0ms 06 1,170 637ms 0ms 07 1,170 641ms 0ms 08 1,170 644ms 0ms 09 1,170 659ms 0ms 10 1,170 665ms 0ms 11 1,170 652ms 0ms 12 1,170 655ms 0ms 13 1,170 650ms 0ms 14 1,170 656ms 0ms 15 1,170 666ms 0ms 16 1,170 678ms 0ms 17 1,053 595ms 0ms 18 1,170 651ms 0ms 19 1,170 681ms 0ms 20 1,170 660ms 0ms 21 1,170 642ms 0ms 22 1,170 679ms 0ms 23 1,170 667ms 0ms [ User: tng_migration_user - Total duration: 12s368ms - Times executed: 21996 ]
[ Application: [unknown] - Total duration: 12s368ms - Times executed: 21996 ]
-
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-15 20:12:01' AND m0_.use_alternative <> 't';
Date: 2025-11-29 20:12: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.1
-
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-15 23:36:01' AND m0_.use_alternative <> 't';
Date: 2025-11-29 23:36: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.1
-
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-15 19:54:01' AND m0_.use_alternative <> 't';
Date: 2025-11-29 19:54: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.1
7 12s270ms 156 42ms 203ms 78ms 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 #7
Day Hour Count Duration Avg duration Nov 29 05 78 6s167ms 79ms 17 78 6s102ms 78ms [ User: tng_migration_user - Total duration: 12s270ms - Times executed: 156 ]
[ Application: dbt - Total duration: 12s270ms - Times executed: 156 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__1"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 1 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-11-29 17:02:20 Duration: 203ms 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.1
-
/* {"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-29 17:02:24 Duration: 143ms 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.1
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__15"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 15 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-11-29 05:02:23 Duration: 130ms 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.1
8 10s534ms 2 5s47ms 5s487ms 5s267ms 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 #8
Day Hour Count Duration Avg duration Nov 29 05 1 5s487ms 5s487ms 17 1 5s47ms 5s47ms [ User: tng_migration_user - Total duration: 10s534ms - Times executed: 2 ]
[ Application: dbt - Total duration: 10s534ms - 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-29 05:02:34 Duration: 5s487ms 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.1
-
/* {"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-29 17:02:33 Duration: 5s47ms 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.1
9 10s497ms 2 5s126ms 5s370ms 5s248ms 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 #9
Day Hour Count Duration Avg duration Nov 29 05 1 5s126ms 5s126ms 17 1 5s370ms 5s370ms [ User: tng_migration_user - Total duration: 10s497ms - Times executed: 2 ]
[ Application: dbt - Total duration: 10s497ms - 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-29 17:02:33 Duration: 5s370ms 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.1
-
/* {"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-29 05:02:35 Duration: 5s126ms 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.1
10 6s265ms 2 3s41ms 3s223ms 3s132ms 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 #10
Day Hour Count Duration Avg duration Nov 29 05 1 3s41ms 3s41ms 17 1 3s223ms 3s223ms [ User: tng_migration_user - Total duration: 6s265ms - Times executed: 2 ]
[ Application: dbt - Total duration: 6s265ms - 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-29 17:02:25 Duration: 3s223ms 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.1
-
/* {"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-29 05:02:26 Duration: 3s41ms 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.1
11 5s412ms 2 2s591ms 2s820ms 2s706ms 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 #11
Day Hour Count Duration Avg duration Nov 29 05 1 2s591ms 2s591ms 17 1 2s820ms 2s820ms [ User: tng_migration_user - Total duration: 5s412ms - Times executed: 2 ]
[ Application: dbt - Total duration: 5s412ms - 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-29 17:02:27 Duration: 2s820ms 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.1
-
/* {"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-29 05:02:27 Duration: 2s591ms 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.1
12 5s258ms 2,980 0ms 536ms 1ms commit;Times Reported Time consuming queries #12
Day Hour Count Duration Avg duration Nov 29 00 100 226ms 2ms 05 538 1s588ms 2ms 06 371 648ms 1ms 07 104 132ms 1ms 08 104 112ms 1ms 09 104 128ms 1ms 10 104 145ms 1ms 11 134 266ms 1ms 12 111 144ms 1ms 13 107 148ms 1ms 14 124 171ms 1ms 15 104 153ms 1ms 16 112 99ms 0ms 17 154 421ms 2ms 18 117 169ms 1ms 19 153 152ms 0ms 20 111 145ms 1ms 21 109 151ms 1ms 22 108 138ms 1ms 23 111 112ms 1ms [ User: tng_migration_user - Total duration: 5s258ms - Times executed: 2980 ]
[ Application: [unknown] - Total duration: 4s184ms - Times executed: 2886 ]
[ Application: dbt - Total duration: 1s73ms - Times executed: 94 ]
-
COMMIT;
Date: 2025-11-29 05:02:29 Duration: 536ms 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.1
-
COMMIT;
Date: 2025-11-29 11:41:17 Duration: 43ms 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.1
-
COMMIT;
Date: 2025-11-29 05:02:18 Duration: 41ms 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.1
13 4s407ms 2 2s179ms 2s227ms 2s203ms 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 #13
Day Hour Count Duration Avg duration Nov 29 05 1 2s179ms 2s179ms 17 1 2s227ms 2s227ms [ User: tng_migration_user - Total duration: 4s407ms - Times executed: 2 ]
[ Application: dbt - Total duration: 4s407ms - 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-29 17:02:28 Duration: 2s227ms 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.1
-
/* {"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-29 05:02:29 Duration: 2s179ms 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.1
14 4s121ms 2 1s702ms 2s418ms 2s60ms 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 #14
Day Hour Count Duration Avg duration Nov 29 05 1 1s702ms 1s702ms 17 1 2s418ms 2s418ms [ User: tng_migration_user - Total duration: 4s121ms - Times executed: 2 ]
[ Application: dbt - Total duration: 4s121ms - 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-29 17:02:27 Duration: 2s418ms 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.1
-
/* {"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-29 05:02:27 Duration: 1s702ms 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.1
15 3s623ms 2 1s685ms 1s938ms 1s811ms 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 #15
Day Hour Count Duration Avg duration Nov 29 05 1 1s685ms 1s685ms 17 1 1s938ms 1s938ms [ User: tng_migration_user - Total duration: 3s623ms - Times executed: 2 ]
[ Application: dbt - Total duration: 3s623ms - 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-29 17:02:24 Duration: 1s938ms 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.1
-
/* {"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-29 05:02:25 Duration: 1s685ms 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.1
16 3s376ms 2 1s614ms 1s762ms 1s688ms 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 29 05 1 1s762ms 1s762ms 17 1 1s614ms 1s614ms [ User: tng_migration_user - Total duration: 3s376ms - Times executed: 2 ]
[ Application: dbt - Total duration: 3s376ms - 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-29 05:02:23 Duration: 1s762ms 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.1
-
/* {"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-29 17:02:22 Duration: 1s614ms 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.1
17 2s636ms 2 1s265ms 1s371ms 1s318ms 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 #17
Day Hour Count Duration Avg duration Nov 29 05 1 1s265ms 1s265ms 17 1 1s371ms 1s371ms [ User: tng_migration_user - Total duration: 2s636ms - Times executed: 2 ]
[ Application: dbt - Total duration: 2s636ms - 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-29 17:02:23 Duration: 1s371ms 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.1
-
/* {"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-29 05:02:23 Duration: 1s265ms 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.1
18 2s548ms 2 1s151ms 1s397ms 1s274ms 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 #18
Day Hour Count Duration Avg duration Nov 29 05 1 1s397ms 1s397ms 17 1 1s151ms 1s151ms [ User: tng_migration_user - Total duration: 2s548ms - Times executed: 2 ]
[ Application: dbt - Total duration: 2s548ms - 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-29 05:02:22 Duration: 1s397ms 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.1
-
/* {"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-29 17:02:21 Duration: 1s151ms 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.1
19 2s471ms 2 977ms 1s494ms 1s235ms 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 29 05 1 1s494ms 1s494ms 17 1 977ms 977ms [ User: tng_migration_user - Total duration: 2s471ms - Times executed: 2 ]
[ Application: dbt - Total duration: 2s471ms - 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-29 05:02:37 Duration: 1s494ms 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.1
-
/* {"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-29 17:02:35 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.1
20 2s437ms 2 1s139ms 1s298ms 1s218ms 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 #20
Day Hour Count Duration Avg duration Nov 29 05 1 1s298ms 1s298ms 17 1 1s139ms 1s139ms [ User: tng_migration_user - Total duration: 2s437ms - Times executed: 2 ]
[ Application: dbt - Total duration: 2s437ms - 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-29 05:02:25 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.1
-
/* {"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-29 17:02:23 Duration: 1s139ms 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.1
Most frequent queries (N)
Rank Times executed Total duration Min duration Max duration Avg duration Query 1 64,246 1s185ms 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_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 29 00 2,520 46ms 0ms 01 2,520 46ms 0ms 02 2,520 46ms 0ms 03 2,520 47ms 0ms 04 2,520 47ms 0ms 05 2,527 47ms 0ms 06 2,737 51ms 0ms 07 2,730 49ms 0ms 08 2,730 49ms 0ms 09 2,730 49ms 0ms 10 2,730 49ms 0ms 11 2,730 50ms 0ms 12 2,730 50ms 0ms 13 2,730 51ms 0ms 14 2,730 50ms 0ms 15 2,730 51ms 0ms 16 2,730 50ms 0ms 17 2,702 49ms 0ms 18 2,730 50ms 0ms 19 2,730 49ms 0ms 20 2,730 48ms 0ms 21 2,730 50ms 0ms 22 2,730 50ms 0ms 23 2,730 50ms 0ms [ User: tng_migration_user - Total duration: 1s185ms - Times executed: 64246 ]
[ Application: [unknown] - Total duration: 1s185ms - Times executed: 64246 ]
-
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 = 'READY';
Date: 2025-11-29 05:30: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.1
-
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-29 17:56: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.1
-
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-29 01:15: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
2 36,712 617ms 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 29 00 1,440 24ms 0ms 01 1,440 24ms 0ms 02 1,440 24ms 0ms 03 1,440 24ms 0ms 04 1,440 24ms 0ms 05 1,444 24ms 0ms 06 1,564 26ms 0ms 07 1,560 26ms 0ms 08 1,560 25ms 0ms 09 1,560 25ms 0ms 10 1,560 25ms 0ms 11 1,560 26ms 0ms 12 1,560 26ms 0ms 13 1,560 26ms 0ms 14 1,560 26ms 0ms 15 1,560 26ms 0ms 16 1,560 26ms 0ms 17 1,544 26ms 0ms 18 1,560 26ms 0ms 19 1,560 25ms 0ms 20 1,560 26ms 0ms 21 1,560 26ms 0ms 22 1,560 26ms 0ms 23 1,560 26ms 0ms [ User: tng_migration_user - Total duration: 617ms - Times executed: 36712 ]
[ Application: [unknown] - Total duration: 617ms - Times executed: 36712 ]
-
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-29 20:52: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.1
-
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-29 07:13: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.1
-
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-29 03:47:17 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,391 882ms 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 29 05 1,386 39ms 0ms 06 1,613 47ms 0ms 07 1,540 45ms 0ms 08 1,540 42ms 0ms 09 1,540 45ms 0ms 10 1,540 44ms 0ms 11 1,790 53ms 0ms 12 1,568 44ms 0ms 13 1,568 45ms 0ms 14 1,760 51ms 0ms 15 1,540 44ms 0ms 16 1,639 48ms 0ms 17 1,488 42ms 0ms 18 1,733 50ms 0ms 19 1,786 52ms 0ms 20 1,617 46ms 0ms 21 1,543 43ms 0ms 22 1,603 46ms 0ms 23 1,597 46ms 0ms [ User: tng_migration_user - Total duration: 882ms - Times executed: 30391 ]
[ Application: [unknown] - Total duration: 882ms - Times executed: 30391 ]
-
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 = '219';
Date: 2025-11-29 12:00: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.1
-
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-29 06:36: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.1
-
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 = '233';
Date: 2025-11-29 06:54: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.1
4 21,996 12s368ms 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 29 05 1,053 580ms 0ms 06 1,170 637ms 0ms 07 1,170 641ms 0ms 08 1,170 644ms 0ms 09 1,170 659ms 0ms 10 1,170 665ms 0ms 11 1,170 652ms 0ms 12 1,170 655ms 0ms 13 1,170 650ms 0ms 14 1,170 656ms 0ms 15 1,170 666ms 0ms 16 1,170 678ms 0ms 17 1,053 595ms 0ms 18 1,170 651ms 0ms 19 1,170 681ms 0ms 20 1,170 660ms 0ms 21 1,170 642ms 0ms 22 1,170 679ms 0ms 23 1,170 667ms 0ms [ User: tng_migration_user - Total duration: 12s368ms - Times executed: 21996 ]
[ Application: [unknown] - Total duration: 12s368ms - Times executed: 21996 ]
-
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-15 20:12:01' AND m0_.use_alternative <> 't';
Date: 2025-11-29 20:12: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.1
-
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-15 23:36:01' AND m0_.use_alternative <> 't';
Date: 2025-11-29 23:36: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.1
-
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-15 19:54:01' AND m0_.use_alternative <> 't';
Date: 2025-11-29 19:54: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.1
5 10,286 895ms 0ms 2ms 0ms set names ?;Times Reported Time consuming queries #5
Day Hour Count Duration Avg duration Nov 29 00 421 36ms 0ms 01 420 36ms 0ms 02 420 36ms 0ms 03 420 37ms 0ms 04 420 38ms 0ms 05 410 35ms 0ms 06 431 38ms 0ms 07 420 35ms 0ms 08 420 36ms 0ms 09 420 35ms 0ms 10 420 36ms 0ms 11 464 40ms 0ms 12 426 37ms 0ms 13 424 37ms 0ms 14 447 38ms 0ms 15 420 39ms 0ms 16 432 36ms 0ms 17 426 36ms 0ms 18 451 39ms 0ms 19 468 39ms 0ms 20 429 35ms 0ms 21 423 36ms 0ms 22 425 36ms 0ms 23 429 37ms 0ms [ User: tng_migration_user - Total duration: 895ms - Times executed: 10286 ]
[ Application: [unknown] - Total duration: 895ms - Times executed: 10286 ]
-
SET NAMES 'utf8';
Date: 2025-11-29 15:41:13 Duration: 2ms 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.1
-
SET NAMES 'utf8';
Date: 2025-11-29 21:14:15 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.1
-
SET NAMES 'utf8';
Date: 2025-11-29 04:13:13 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.1
6 10,061 363ms 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 #6
Day Hour Count Duration Avg duration Nov 29 00 420 15ms 0ms 01 420 15ms 0ms 02 420 15ms 0ms 03 420 15ms 0ms 04 420 16ms 0ms 05 410 13ms 0ms 06 420 14ms 0ms 07 420 14ms 0ms 08 420 14ms 0ms 09 420 14ms 0ms 10 420 14ms 0ms 11 420 15ms 0ms 12 420 15ms 0ms 13 420 16ms 0ms 14 420 15ms 0ms 15 420 16ms 0ms 16 420 15ms 0ms 17 411 15ms 0ms 18 420 17ms 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: 363ms - Times executed: 10061 ]
[ Application: [unknown] - Total duration: 363ms - Times executed: 10061 ]
-
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-29 18:21: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.1
-
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-29 06:55: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.1
-
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-29 07:06: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.1
7 9,842 116ms 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.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 29 05 573 6ms 0ms 06 521 6ms 0ms 07 516 5ms 0ms 08 516 6ms 0ms 09 516 5ms 0ms 10 516 6ms 0ms 11 522 5ms 0ms 12 517 5ms 0ms 13 515 5ms 0ms 14 518 6ms 0ms 15 514 7ms 0ms 16 516 5ms 0ms 17 516 6ms 0ms 18 510 6ms 0ms 19 522 6ms 0ms 20 508 5ms 0ms 21 509 5ms 0ms 22 508 5ms 0ms 23 509 5ms 0ms [ User: tng_migration_user - Total duration: 116ms - Times executed: 9842 ]
[ Application: [unknown] - Total duration: 116ms - Times executed: 9842 ]
-
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 = '137406';
Date: 2025-11-29 19:16:50 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.1
-
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 = '137958';
Date: 2025-11-29 19:15:36 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.1
-
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 = '137408';
Date: 2025-11-29 21:09:11 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.1
8 9,742 184ms 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 #8
Day Hour Count Duration Avg duration Nov 29 05 430 7ms 0ms 06 565 11ms 0ms 07 510 9ms 0ms 08 510 9ms 0ms 09 510 9ms 0ms 10 510 9ms 0ms 11 530 9ms 0ms 12 514 9ms 0ms 13 510 9ms 0ms 14 523 10ms 0ms 15 508 10ms 0ms 16 514 9ms 0ms 17 517 9ms 0ms 18 514 9ms 0ms 19 543 10ms 0ms 20 509 9ms 0ms 21 507 9ms 0ms 22 509 10ms 0ms 23 509 9ms 0ms [ User: tng_migration_user - Total duration: 184ms - Times executed: 9742 ]
[ Application: [unknown] - Total duration: 184ms - Times executed: 9742 ]
-
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 = '41928';
Date: 2025-11-29 13: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.1
-
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 = '41877';
Date: 2025-11-29 20:00:04 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.1
-
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 = '36094';
Date: 2025-11-29 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.1
9 9,364 109ms 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 where t0.code = ? limit ?;Times Reported Time consuming queries #9
Day Hour Count Duration Avg duration Nov 29 00 360 4ms 0ms 01 360 4ms 0ms 02 360 4ms 0ms 03 360 4ms 0ms 04 360 4ms 0ms 05 360 4ms 0ms 06 578 6ms 0ms 07 390 4ms 0ms 08 390 4ms 0ms 09 390 4ms 0ms 10 390 4ms 0ms 11 390 4ms 0ms 12 390 4ms 0ms 13 390 4ms 0ms 14 390 4ms 0ms 15 390 4ms 0ms 16 390 4ms 0ms 17 386 4ms 0ms 18 390 4ms 0ms 19 390 4ms 0ms 20 390 4ms 0ms 21 390 4ms 0ms 22 390 4ms 0ms 23 390 4ms 0ms [ User: tng_migration_user - Total duration: 109ms - Times executed: 9364 ]
[ Application: [unknown] - Total duration: 109ms - Times executed: 9364 ]
-
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-29 01:56: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
-
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-29 03:12: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-29 09:25: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.1
10 8,640 1s485ms 0ms 2ms 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 29 00 360 62ms 0ms 01 360 62ms 0ms 02 360 63ms 0ms 03 360 67ms 0ms 04 360 66ms 0ms 05 360 64ms 0ms 06 360 63ms 0ms 07 360 59ms 0ms 08 360 60ms 0ms 09 360 59ms 0ms 10 360 60ms 0ms 11 360 61ms 0ms 12 360 62ms 0ms 13 360 64ms 0ms 14 360 62ms 0ms 15 360 63ms 0ms 16 360 60ms 0ms 17 360 61ms 0ms 18 360 61ms 0ms 19 360 58ms 0ms 20 360 58ms 0ms 21 360 59ms 0ms 22 360 60ms 0ms 23 360 59ms 0ms [ User: tng_migration_user - Total duration: 1s485ms - Times executed: 8640 ]
[ Application: [unknown] - Total duration: 1s485ms - 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-22 03:11:15';
Date: 2025-11-29 03:11:15 Duration: 2ms 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-22 04:34:16';
Date: 2025-11-29 04:34: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.1
-
SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = 'ERROR' AND n0_.processed_time >= '2025-11-22 05:05:43';
Date: 2025-11-29 05:05: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.1
11 8,640 1s29ms 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 order by t0.disabled asc, t0.priority desc;Times Reported Time consuming queries #11
Day Hour Count Duration Avg duration Nov 29 00 360 43ms 0ms 01 360 42ms 0ms 02 360 43ms 0ms 03 360 45ms 0ms 04 360 44ms 0ms 05 360 43ms 0ms 06 360 43ms 0ms 07 360 40ms 0ms 08 360 41ms 0ms 09 360 41ms 0ms 10 360 42ms 0ms 11 360 43ms 0ms 12 360 43ms 0ms 13 360 44ms 0ms 14 360 43ms 0ms 15 360 45ms 0ms 16 360 43ms 0ms 17 360 44ms 0ms 18 360 44ms 0ms 19 360 39ms 0ms 20 360 39ms 0ms 21 360 40ms 0ms 22 360 41ms 0ms 23 360 42ms 0ms [ User: tng_migration_user - Total duration: 1s29ms - Times executed: 8640 ]
[ Application: [unknown] - Total duration: 1s29ms - 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-29 03:07: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.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-29 10:22:17 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.1
-
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-29 10:17:17 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.1
12 8,640 150ms 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 29 00 360 6ms 0ms 01 360 6ms 0ms 02 360 6ms 0ms 03 360 6ms 0ms 04 360 6ms 0ms 05 360 6ms 0ms 06 360 5ms 0ms 07 360 5ms 0ms 08 360 6ms 0ms 09 360 5ms 0ms 10 360 6ms 0ms 11 360 6ms 0ms 12 360 6ms 0ms 13 360 6ms 0ms 14 360 6ms 0ms 15 360 7ms 0ms 16 360 6ms 0ms 17 360 7ms 0ms 18 360 7ms 0ms 19 360 4ms 0ms 20 360 4ms 0ms 21 360 5ms 0ms 22 360 5ms 0ms 23 360 5ms 0ms [ User: tng_migration_user - Total duration: 150ms - Times executed: 8640 ]
[ Application: [unknown] - Total duration: 150ms - 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-29 08:27:14 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.1
-
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-29 13:57:13 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.1
-
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-29 08:24:17 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.1
13 5,685 1s705ms 0ms 2ms 0ms fetch ? from c1;Times Reported Time consuming queries #13
Day Hour Count Duration Avg duration Nov 29 23 5,685 1s705ms 0ms [ User: tng__dwh_celspac_fdw - Total duration: 1s705ms - Times executed: 5685 ]
[ Application: postgres_fdw - Total duration: 1s705ms - Times executed: 5685 ]
-
FETCH 100 FROM c1;
Date: 2025-11-29 23:35:19 Duration: 2ms 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.1
-
FETCH 100 FROM c1;
Date: 2025-11-29 23:35:19 Duration: 2ms 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.1
-
FETCH 100 FROM c1;
Date: 2025-11-29 23:35:19 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.1
14 5,548 519ms 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 29 05 292 29ms 0ms 06 292 26ms 0ms 07 292 25ms 0ms 08 292 26ms 0ms 09 292 26ms 0ms 10 292 28ms 0ms 11 292 25ms 0ms 12 292 27ms 0ms 13 292 25ms 0ms 14 292 28ms 0ms 15 292 32ms 0ms 16 292 25ms 0ms 17 292 30ms 0ms 18 292 27ms 0ms 19 292 29ms 0ms 20 292 25ms 0ms 21 292 24ms 0ms 22 292 28ms 0ms 23 292 25ms 0ms [ User: tng_migration_user - Total duration: 519ms - Times executed: 5548 ]
[ Application: [unknown] - Total duration: 519ms - 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 = '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-16 15:00:01' AND '2023-06-15 15:00:01');
Date: 2025-11-29 15:00: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.1
-
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 = '71' 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-16 15:00:01' AND '2023-12-15 15:00:01');
Date: 2025-11-29 15:00: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.1
-
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 = '171' 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 '2022-09-28 15:00:01' AND '2022-11-12 15:00:01');
Date: 2025-11-29 15: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.1
15 5,313 110ms 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 (...);Times Reported Time consuming queries #15
Day Hour Count Duration Avg duration Nov 29 05 88 2ms 0ms 06 322 6ms 0ms 11 832 16ms 0ms 12 113 2ms 0ms 13 123 2ms 0ms 14 805 18ms 0ms 16 410 8ms 0ms 17 408 8ms 0ms 18 826 17ms 0ms 19 677 14ms 0ms 20 248 4ms 0ms 22 215 3ms 0ms 23 246 5ms 0ms [ User: tng_migration_user - Total duration: 110ms - Times executed: 5313 ]
[ Application: [unknown] - Total duration: 110ms - Times executed: 5313 ]
-
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 ('39', '64', '66', '70', '20', '12', '4', '11', '1', '6', '7', '8', '9', '10', '41', '68', '53', '5', '40', '67', '43', '75', '72', '78', '79', '71', '73', '81', '37', '82');
Date: 2025-11-29 19:15:47 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.1
-
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 ('39', '64', '66', '70', '20', '12', '4', '11', '1', '6', '7', '8', '9', '10', '41', '68', '53', '5', '40', '67', '43', '75', '72', '78', '79', '71', '73', '81', '37', '82');
Date: 2025-11-29 19:42:23 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.1
-
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 ('39', '64', '66', '70', '20', '12', '4', '11', '1', '6', '7', '8', '9', '10', '41', '68', '53', '5', '40', '67', '43', '75', '72', '78', '79', '71', '73', '81', '37', '82');
Date: 2025-11-29 14:20:56 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.1
16 5,040 72ms 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 #16
Day Hour Count Duration Avg duration Nov 29 06 280 3ms 0ms 07 280 3ms 0ms 08 280 4ms 0ms 09 280 4ms 0ms 10 280 3ms 0ms 11 280 3ms 0ms 12 280 3ms 0ms 13 280 3ms 0ms 14 280 4ms 0ms 15 280 4ms 0ms 16 280 3ms 0ms 17 280 3ms 0ms 18 280 3ms 0ms 19 280 3ms 0ms 20 280 4ms 0ms 21 280 4ms 0ms 22 280 4ms 0ms 23 280 3ms 0ms [ User: tng_migration_user - Total duration: 72ms - Times executed: 5040 ]
[ Application: [unknown] - Total duration: 72ms - 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-15 14:41:01' AND '2025-09-01 14:41:01');
Date: 2025-11-29 14: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.1
-
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-15 21:23:01' AND '2025-09-01 21:23:01');
Date: 2025-11-29 21:23: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.1
-
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-15 15:59:01' AND '2025-09-01 15:59:01');
Date: 2025-11-29 15:59: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.1
17 4,700 1s621ms 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 #17
Day Hour Count Duration Avg duration Nov 29 05 225 75ms 0ms 06 250 84ms 0ms 07 250 85ms 0ms 08 250 85ms 0ms 09 250 88ms 0ms 10 250 88ms 0ms 11 250 83ms 0ms 12 250 85ms 0ms 13 250 87ms 0ms 14 250 85ms 0ms 15 250 84ms 0ms 16 250 89ms 0ms 17 225 77ms 0ms 18 250 86ms 0ms 19 250 88ms 0ms 20 250 84ms 0ms 21 250 86ms 0ms 22 250 86ms 0ms 23 250 87ms 0ms [ User: tng_migration_user - Total duration: 1s621ms - Times executed: 4700 ]
[ Application: [unknown] - Total duration: 1s621ms - Times executed: 4700 ]
-
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 ('127') AND m0_.form_id IS NULL;
Date: 2025-11-29 10: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.1
-
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-29 10: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.1
-
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-29 16:18: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.1
18 3,813 110ms 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 = ? and t0.subcohort_inform_consent_id in (...) limit ?;Times Reported Time consuming queries #18
Day Hour Count Duration Avg duration Nov 29 06 260 9ms 0ms 11 579 14ms 0ms 12 87 2ms 0ms 13 95 2ms 0ms 14 592 16ms 0ms 16 309 9ms 0ms 17 309 9ms 0ms 18 618 18ms 0ms 19 446 13ms 0ms 20 174 4ms 0ms 22 154 4ms 0ms 23 190 5ms 0ms [ User: tng_migration_user - Total duration: 110ms - Times executed: 3813 ]
[ Application: [unknown] - Total duration: 110ms - Times executed: 3813 ]
-
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 = '42969' AND t0.subcohort_inform_consent_id IN ('326', '325') LIMIT 1;
Date: 2025-11-29 14:20:13 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.1
-
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 = '3598' AND t0.subcohort_inform_consent_id IN ('241', '242') LIMIT 1;
Date: 2025-11-29 17:53:09 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.1
-
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 = '3598' AND t0.subcohort_inform_consent_id IN ('247', '246') LIMIT 1;
Date: 2025-11-29 18:22:22 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.1
19 3,276 913ms 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 #19
Day Hour Count Duration Avg duration Nov 29 06 182 51ms 0ms 07 182 48ms 0ms 08 182 52ms 0ms 09 182 49ms 0ms 10 182 46ms 0ms 11 182 48ms 0ms 12 182 49ms 0ms 13 182 50ms 0ms 14 182 55ms 0ms 15 182 48ms 0ms 16 182 47ms 0ms 17 182 48ms 0ms 18 182 53ms 0ms 19 182 48ms 0ms 20 182 56ms 0ms 21 182 51ms 0ms 22 182 53ms 0ms 23 182 52ms 0ms [ User: tng_migration_user - Total duration: 913ms - Times executed: 3276 ]
[ Application: [unknown] - Total duration: 913ms - 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 ('100') 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-06-11 06:05:01';
Date: 2025-11-29 06: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.1
-
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 ('88') 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-07-30 14:41:01';
Date: 2025-11-29 14: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.1
-
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 ('103') 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-27 06:05:01';
Date: 2025-11-29 06: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.1
20 3,276 110ms 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 #20
Day Hour Count Duration Avg duration Nov 29 06 182 5ms 0ms 07 182 6ms 0ms 08 182 6ms 0ms 09 182 6ms 0ms 10 182 5ms 0ms 11 182 5ms 0ms 12 182 6ms 0ms 13 182 6ms 0ms 14 182 6ms 0ms 15 182 5ms 0ms 16 182 5ms 0ms 17 182 5ms 0ms 18 182 6ms 0ms 19 182 5ms 0ms 20 182 6ms 0ms 21 182 6ms 0ms 22 182 6ms 0ms 23 182 6ms 0ms [ User: tng_migration_user - Total duration: 110ms - Times executed: 3276 ]
[ Application: [unknown] - Total duration: 110ms - 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-08 20:23:02' AND '2025-10-17 20:23:02');
Date: 2025-11-29 20:23: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.1
-
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-08 11:41:01' AND '2025-10-17 11:41:01');
Date: 2025-11-29 11: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.1
-
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-08 07:41:01' AND '2025-10-17 07:41:01');
Date: 2025-11-29 07: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.1
Normalized slowest queries (N)
Rank Min duration Max duration Avg duration Times executed Total duration Query 1 9m21s 9m32s 9m26s 2 18m53s 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 29 05 1 9m21s 9m21s 17 1 9m32s 9m32s [ User: tng_migration_user - Total duration: 18m53s - Times executed: 2 ]
[ Application: dbt - Total duration: 18m53s - 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-29 17:11:55 Duration: 9m32s 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.1
-
/* {"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-29 05:11:42 Duration: 9m21s 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.1
-
/* {"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-29 05:11:42 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
2 36s981ms 37s388ms 37s185ms 2 1m14s 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 29 05 1 37s388ms 37s388ms 17 1 36s981ms 36s981ms [ User: tng_migration_user - Total duration: 1m14s - Times executed: 2 ]
[ Application: dbt - Total duration: 1m14s - 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-29 05:02:57 Duration: 37s388ms 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.1
-
/* {"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-29 17:02:56 Duration: 36s981ms 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.1
3 5s47ms 5s487ms 5s267ms 2 10s534ms 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 #3
Day Hour Count Duration Avg duration Nov 29 05 1 5s487ms 5s487ms 17 1 5s47ms 5s47ms [ User: tng_migration_user - Total duration: 10s534ms - Times executed: 2 ]
[ Application: dbt - Total duration: 10s534ms - 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-29 05:02:34 Duration: 5s487ms 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.1
-
/* {"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-29 17:02:33 Duration: 5s47ms 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.1
4 5s126ms 5s370ms 5s248ms 2 10s497ms 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 #4
Day Hour Count Duration Avg duration Nov 29 05 1 5s126ms 5s126ms 17 1 5s370ms 5s370ms [ User: tng_migration_user - Total duration: 10s497ms - Times executed: 2 ]
[ Application: dbt - Total duration: 10s497ms - 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-29 17:02:33 Duration: 5s370ms 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.1
-
/* {"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-29 05:02:35 Duration: 5s126ms 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.1
5 3s41ms 3s223ms 3s132ms 2 6s265ms 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 #5
Day Hour Count Duration Avg duration Nov 29 05 1 3s41ms 3s41ms 17 1 3s223ms 3s223ms [ User: tng_migration_user - Total duration: 6s265ms - Times executed: 2 ]
[ Application: dbt - Total duration: 6s265ms - 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-29 17:02:25 Duration: 3s223ms 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.1
-
/* {"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-29 05:02:26 Duration: 3s41ms 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.1
6 2s591ms 2s820ms 2s706ms 2 5s412ms 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 #6
Day Hour Count Duration Avg duration Nov 29 05 1 2s591ms 2s591ms 17 1 2s820ms 2s820ms [ User: tng_migration_user - Total duration: 5s412ms - Times executed: 2 ]
[ Application: dbt - Total duration: 5s412ms - 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-29 17:02:27 Duration: 2s820ms 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.1
-
/* {"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-29 05:02:27 Duration: 2s591ms 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.1
7 2s179ms 2s227ms 2s203ms 2 4s407ms 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 #7
Day Hour Count Duration Avg duration Nov 29 05 1 2s179ms 2s179ms 17 1 2s227ms 2s227ms [ User: tng_migration_user - Total duration: 4s407ms - Times executed: 2 ]
[ Application: dbt - Total duration: 4s407ms - 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-29 17:02:28 Duration: 2s227ms 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.1
-
/* {"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-29 05:02:29 Duration: 2s179ms 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.1
8 1s702ms 2s418ms 2s60ms 2 4s121ms 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 #8
Day Hour Count Duration Avg duration Nov 29 05 1 1s702ms 1s702ms 17 1 2s418ms 2s418ms [ User: tng_migration_user - Total duration: 4s121ms - Times executed: 2 ]
[ Application: dbt - Total duration: 4s121ms - 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-29 17:02:27 Duration: 2s418ms 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.1
-
/* {"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-29 05:02:27 Duration: 1s702ms 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.1
9 1s685ms 1s938ms 1s811ms 2 3s623ms 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 #9
Day Hour Count Duration Avg duration Nov 29 05 1 1s685ms 1s685ms 17 1 1s938ms 1s938ms [ User: tng_migration_user - Total duration: 3s623ms - Times executed: 2 ]
[ Application: dbt - Total duration: 3s623ms - 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-29 17:02:24 Duration: 1s938ms 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.1
-
/* {"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-29 05:02:25 Duration: 1s685ms 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.1
10 1s614ms 1s762ms 1s688ms 2 3s376ms 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 29 05 1 1s762ms 1s762ms 17 1 1s614ms 1s614ms [ User: tng_migration_user - Total duration: 3s376ms - Times executed: 2 ]
[ Application: dbt - Total duration: 3s376ms - 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-29 05:02:23 Duration: 1s762ms 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.1
-
/* {"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-29 17:02:22 Duration: 1s614ms 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.1
11 1s265ms 1s371ms 1s318ms 2 2s636ms 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 #11
Day Hour Count Duration Avg duration Nov 29 05 1 1s265ms 1s265ms 17 1 1s371ms 1s371ms [ User: tng_migration_user - Total duration: 2s636ms - Times executed: 2 ]
[ Application: dbt - Total duration: 2s636ms - 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-29 17:02:23 Duration: 1s371ms 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.1
-
/* {"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-29 05:02:23 Duration: 1s265ms 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.1
12 1s151ms 1s397ms 1s274ms 2 2s548ms 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 #12
Day Hour Count Duration Avg duration Nov 29 05 1 1s397ms 1s397ms 17 1 1s151ms 1s151ms [ User: tng_migration_user - Total duration: 2s548ms - Times executed: 2 ]
[ Application: dbt - Total duration: 2s548ms - 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-29 05:02:22 Duration: 1s397ms 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.1
-
/* {"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-29 17:02:21 Duration: 1s151ms 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.1
13 1s135ms 2s251ms 1s268ms 188 3m58s refresh materialized view core.mv_subject_form with data;Times Reported Time consuming queries #13
Day Hour Count Duration Avg duration Nov 29 05 9 10s870ms 1s207ms 06 10 12s147ms 1s214ms 07 10 12s595ms 1s259ms 08 10 12s504ms 1s250ms 09 10 13s254ms 1s325ms 10 10 13s745ms 1s374ms 11 10 12s508ms 1s250ms 12 10 12s492ms 1s249ms 13 10 13s364ms 1s336ms 14 10 12s735ms 1s273ms 15 10 13s170ms 1s317ms 16 10 12s805ms 1s280ms 17 9 11s628ms 1s292ms 18 10 12s467ms 1s246ms 19 10 12s445ms 1s244ms 20 10 12s344ms 1s234ms 21 10 12s190ms 1s219ms 22 10 12s857ms 1s285ms 23 10 12s421ms 1s242ms [ User: tng_migration_user - Total duration: 3m58s - Times executed: 188 ]
[ Application: [unknown] - Total duration: 3m58s - Times executed: 188 ]
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-29 10:06:04 Duration: 2s251ms 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.1
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-29 15:42:03 Duration: 1s818ms 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.1
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-29 13:18:03 Duration: 1s717ms 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.1
14 977ms 1s494ms 1s235ms 2 2s471ms 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 #14
Day Hour Count Duration Avg duration Nov 29 05 1 1s494ms 1s494ms 17 1 977ms 977ms [ User: tng_migration_user - Total duration: 2s471ms - Times executed: 2 ]
[ Application: dbt - Total duration: 2s471ms - 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-29 05:02:37 Duration: 1s494ms 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.1
-
/* {"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-29 17:02:35 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.1
15 1s139ms 1s298ms 1s218ms 2 2s437ms 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 #15
Day Hour Count Duration Avg duration Nov 29 05 1 1s298ms 1s298ms 17 1 1s139ms 1s139ms [ User: tng_migration_user - Total duration: 2s437ms - Times executed: 2 ]
[ Application: dbt - Total duration: 2s437ms - 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-29 05:02:25 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.1
-
/* {"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-29 17:02:23 Duration: 1s139ms 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.1
16 113ms 704ms 138ms 126 17s469ms refresh materialized view core.mv_subject_event with data;Times Reported Time consuming queries #16
Day Hour Count Duration Avg duration Nov 29 06 7 926ms 132ms 07 7 891ms 127ms 08 7 922ms 131ms 09 7 930ms 132ms 10 7 864ms 123ms 11 7 907ms 129ms 12 7 893ms 127ms 13 7 920ms 131ms 14 7 1s7ms 143ms 15 7 1s492ms 213ms 16 7 888ms 126ms 17 7 945ms 135ms 18 7 1s232ms 176ms 19 7 895ms 127ms 20 7 949ms 135ms 21 7 916ms 130ms 22 7 988ms 141ms 23 7 896ms 128ms [ User: tng_migration_user - Total duration: 17s469ms - Times executed: 126 ]
[ Application: [unknown] - Total duration: 17s469ms - Times executed: 126 ]
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-11-29 15:05:02 Duration: 704ms 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.1
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-11-29 18:50:02 Duration: 407ms 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.1
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-11-29 18:41:02 Duration: 180ms 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.1
17 37ms 223ms 80ms 160 12s937ms 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 29 05 80 6s506ms 81ms 17 80 6s430ms 80ms [ User: tng_migration_user - Total duration: 12s937ms - Times executed: 160 ]
[ Application: dbt - Total duration: 12s937ms - 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-29 05:02:20 Duration: 223ms 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.1
-
/* {"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-29 17:02:23 Duration: 222ms 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.1
-
/* {"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-29 17:02:23 Duration: 218ms 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.1
18 42ms 203ms 78ms 156 12s270ms 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 29 05 78 6s167ms 79ms 17 78 6s102ms 78ms [ User: tng_migration_user - Total duration: 12s270ms - Times executed: 156 ]
[ Application: dbt - Total duration: 12s270ms - Times executed: 156 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__1"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 1 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-11-29 17:02:20 Duration: 203ms 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.1
-
/* {"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-29 17:02:24 Duration: 143ms 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.1
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__15"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 15 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-11-29 05:02:23 Duration: 130ms 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.1
19 0ms 536ms 1ms 2,980 5s258ms commit;Times Reported Time consuming queries #19
Day Hour Count Duration Avg duration Nov 29 00 100 226ms 2ms 05 538 1s588ms 2ms 06 371 648ms 1ms 07 104 132ms 1ms 08 104 112ms 1ms 09 104 128ms 1ms 10 104 145ms 1ms 11 134 266ms 1ms 12 111 144ms 1ms 13 107 148ms 1ms 14 124 171ms 1ms 15 104 153ms 1ms 16 112 99ms 0ms 17 154 421ms 2ms 18 117 169ms 1ms 19 153 152ms 0ms 20 111 145ms 1ms 21 109 151ms 1ms 22 108 138ms 1ms 23 111 112ms 1ms [ User: tng_migration_user - Total duration: 5s258ms - Times executed: 2980 ]
[ Application: [unknown] - Total duration: 4s184ms - Times executed: 2886 ]
[ Application: dbt - Total duration: 1s73ms - Times executed: 94 ]
-
COMMIT;
Date: 2025-11-29 05:02:29 Duration: 536ms 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.1
-
COMMIT;
Date: 2025-11-29 11:41:17 Duration: 43ms 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.1
-
COMMIT;
Date: 2025-11-29 05:02:18 Duration: 41ms 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.1
20 0ms 3ms 0ms 21,996 12s368ms 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 29 05 1,053 580ms 0ms 06 1,170 637ms 0ms 07 1,170 641ms 0ms 08 1,170 644ms 0ms 09 1,170 659ms 0ms 10 1,170 665ms 0ms 11 1,170 652ms 0ms 12 1,170 655ms 0ms 13 1,170 650ms 0ms 14 1,170 656ms 0ms 15 1,170 666ms 0ms 16 1,170 678ms 0ms 17 1,053 595ms 0ms 18 1,170 651ms 0ms 19 1,170 681ms 0ms 20 1,170 660ms 0ms 21 1,170 642ms 0ms 22 1,170 679ms 0ms 23 1,170 667ms 0ms [ User: tng_migration_user - Total duration: 12s368ms - Times executed: 21996 ]
[ Application: [unknown] - Total duration: 12s368ms - Times executed: 21996 ]
-
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-15 20:12:01' AND m0_.use_alternative <> 't';
Date: 2025-11-29 20:12: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.1
-
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-15 23:36:01' AND m0_.use_alternative <> 't';
Date: 2025-11-29 23:36: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.1
-
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-15 19:54:01' AND m0_.use_alternative <> 't';
Date: 2025-11-29 19:54: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.1
Time consuming prepare
Rank Total duration Times executed Min duration Max duration Avg duration Query 1 12s731ms 15,798 0ms 30ms 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 29 04 318 251ms 0ms 05 360 308ms 0ms 06 360 270ms 0ms 07 360 292ms 0ms 08 360 280ms 0ms 09 360 295ms 0ms 10 360 292ms 0ms 11 360 297ms 0ms 12 360 293ms 0ms 13 360 290ms 0ms 14 360 282ms 0ms 15 360 284ms 0ms 16 360 286ms 0ms 17 360 278ms 0ms 18 360 288ms 0ms 19 360 288ms 0ms 20 360 288ms 0ms 21 360 294ms 0ms 22 360 289ms 0ms 23 360 301ms 0ms Nov 29 00 360 290ms 0ms 01 360 290ms 0ms 02 360 292ms 0ms 03 360 299ms 0ms 04 360 304ms 0ms 05 360 296ms 0ms 06 360 297ms 0ms 07 360 282ms 0ms 08 360 282ms 0ms 09 360 284ms 0ms 10 360 286ms 0ms 11 360 291ms 0ms 12 360 293ms 0ms 13 360 302ms 0ms 14 360 292ms 0ms 15 360 302ms 0ms 16 360 287ms 0ms 17 360 287ms 0ms 18 360 291ms 0ms 19 360 278ms 0ms 20 360 279ms 0ms 21 360 284ms 0ms 22 360 290ms 0ms 23 360 287ms 0ms [ User: tng_migration_user - Total duration: 1s946ms - Times executed: 15798 ]
[ Application: [unknown] - Total duration: 1s946ms - Times executed: 15798 ]
-
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-28 05:02:25 Duration: 30ms 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-28 11:25:26 Duration: 3ms 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-29 05:52:16 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
2 7s605ms 17,287 0ms 8ms 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 318 131ms 0ms 04 360 159ms 0ms 05 616 165ms 0ms 06 390 166ms 0ms 07 390 162ms 0ms 08 390 167ms 0ms 09 392 167ms 0ms 10 390 175ms 0ms 11 390 176ms 0ms 12 390 174ms 0ms 13 390 168ms 0ms 14 390 171ms 0ms 15 390 170ms 0ms 16 387 176ms 0ms 17 390 176ms 0ms 18 390 174ms 0ms 19 390 176ms 0ms 20 390 181ms 0ms 21 390 178ms 0ms 22 390 185ms 0ms 23 360 164ms 0ms 00 360 166ms 0ms 01 360 166ms 0ms 02 360 171ms 0ms 03 360 174ms 0ms 04 360 169ms 0ms 05 578 190ms 0ms 06 390 168ms 0ms 07 390 172ms 0ms 08 390 170ms 0ms 09 390 173ms 0ms 10 390 178ms 0ms 11 390 177ms 0ms 12 390 182ms 0ms 13 390 178ms 0ms 14 390 183ms 0ms 15 390 174ms 0ms 16 386 176ms 0ms 17 390 177ms 0ms 18 390 171ms 0ms 19 390 170ms 0ms 20 390 174ms 0ms 21 390 180ms 0ms 22 390 180ms 0ms [ User: tng_migration_user - Total duration: 202ms - Times executed: 17287 ]
[ Application: [unknown] - Total duration: 202ms - Times executed: 17287 ]
-
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-28 05:02:25 Duration: 8ms 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-28 17:02:24 Duration: 6ms 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-29 14:52:15 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
3 5s978ms 118,132 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_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,226 112ms 0ms 04 2,527 125ms 0ms 05 2,737 135ms 0ms 06 2,730 135ms 0ms 07 2,730 135ms 0ms 08 2,730 135ms 0ms 09 2,737 136ms 0ms 10 2,730 139ms 0ms 11 2,730 141ms 0ms 12 2,730 141ms 0ms 13 2,730 139ms 0ms 14 2,730 139ms 0ms 15 2,730 138ms 0ms 16 2,709 135ms 0ms 17 2,730 138ms 0ms 18 2,730 136ms 0ms 19 2,730 137ms 0ms 20 2,730 139ms 0ms 21 2,730 138ms 0ms 22 2,730 140ms 0ms 23 2,520 128ms 0ms 00 2,520 127ms 0ms 01 2,520 127ms 0ms 02 2,520 130ms 0ms 03 2,520 131ms 0ms 04 2,527 129ms 0ms 05 2,737 142ms 0ms 06 2,730 135ms 0ms 07 2,730 137ms 0ms 08 2,730 134ms 0ms 09 2,730 136ms 0ms 10 2,730 138ms 0ms 11 2,730 137ms 0ms 12 2,730 140ms 0ms 13 2,730 137ms 0ms 14 2,730 139ms 0ms 15 2,730 137ms 0ms 16 2,702 137ms 0ms 17 2,730 138ms 0ms 18 2,730 136ms 0ms 19 2,730 135ms 0ms 20 2,730 136ms 0ms 21 2,730 139ms 0ms 22 2,730 140ms 0ms [ User: tng_migration_user - Total duration: 2s171ms - Times executed: 118132 ]
[ Application: [unknown] - Total duration: 2s171ms - Times executed: 118132 ]
-
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-29 19:05:16 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-29 18:30: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_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-28 04:15:26 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
4 3s470ms 15,798 0ms 23ms 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 318 79ms 0ms 04 360 102ms 0ms 05 360 76ms 0ms 06 360 82ms 0ms 07 360 79ms 0ms 08 360 82ms 0ms 09 360 83ms 0ms 10 360 85ms 0ms 11 360 84ms 0ms 12 360 82ms 0ms 13 360 80ms 0ms 14 360 81ms 0ms 15 360 80ms 0ms 16 360 74ms 0ms 17 360 76ms 0ms 18 360 75ms 0ms 19 360 76ms 0ms 20 360 78ms 0ms 21 360 76ms 0ms 22 360 81ms 0ms 23 360 77ms 0ms 00 360 77ms 0ms 01 360 78ms 0ms 02 360 80ms 0ms 03 360 80ms 0ms 04 360 79ms 0ms 05 360 79ms 0ms 06 360 74ms 0ms 07 360 74ms 0ms 08 360 73ms 0ms 09 360 75ms 0ms 10 360 77ms 0ms 11 360 77ms 0ms 12 360 79ms 0ms 13 360 77ms 0ms 14 360 79ms 0ms 15 360 76ms 0ms 16 360 78ms 0ms 17 360 77ms 0ms 18 360 73ms 0ms 19 360 73ms 0ms 20 360 76ms 0ms 21 360 77ms 0ms 22 360 77ms 0ms [ User: tng_migration_user - Total duration: 2s964ms - Times executed: 15798 ]
[ Application: [unknown] - Total duration: 2s964ms - Times executed: 15798 ]
-
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-28 05:02:26 Duration: 23ms 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-28 10:51:25 Duration: 0ms 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-29 21:57:13 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
5 3s83ms 18,395 0ms 1ms 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 370 62ms 0ms 04 410 58ms 0ms 05 420 66ms 0ms 06 420 67ms 0ms 07 420 68ms 0ms 08 420 68ms 0ms 09 420 67ms 0ms 10 420 71ms 0ms 11 420 69ms 0ms 12 420 71ms 0ms 13 420 68ms 0ms 14 420 69ms 0ms 15 420 69ms 0ms 16 414 64ms 0ms 17 420 70ms 0ms 18 420 71ms 0ms 19 420 70ms 0ms 20 420 69ms 0ms 21 420 68ms 0ms 22 420 71ms 0ms 23 420 72ms 0ms 00 420 69ms 0ms 01 420 72ms 0ms 02 420 73ms 0ms 03 420 73ms 0ms 04 410 65ms 0ms 05 420 74ms 0ms 06 420 71ms 0ms 07 420 74ms 0ms 08 420 72ms 0ms 09 420 72ms 0ms 10 420 73ms 0ms 11 420 72ms 0ms 12 420 75ms 0ms 13 420 71ms 0ms 14 420 73ms 0ms 15 420 73ms 0ms 16 411 62ms 0ms 17 420 69ms 0ms 18 420 69ms 0ms 19 420 68ms 0ms 20 420 69ms 0ms 21 420 71ms 0ms 22 420 73ms 0ms [ User: tng_migration_user - Total duration: 672ms - Times executed: 18395 ]
[ Application: [unknown] - Total duration: 672ms - Times executed: 18395 ]
-
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-29 07:20:01 Duration: 1ms 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-29 00:58:01 Duration: 1ms 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-29 02:37:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
6 3s28ms 60,551 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 67ms 0ms 05 1,540 74ms 0ms 06 1,540 74ms 0ms 07 1,680 83ms 0ms 08 1,583 77ms 0ms 09 1,543 74ms 0ms 10 1,660 88ms 0ms 11 1,679 85ms 0ms 12 1,685 87ms 0ms 13 1,648 82ms 0ms 14 1,574 81ms 0ms 15 1,540 77ms 0ms 16 1,540 77ms 0ms 17 1,612 79ms 0ms 18 1,564 78ms 0ms 19 1,542 77ms 0ms 20 1,740 87ms 0ms 21 1,564 74ms 0ms 22 1,540 76ms 0ms 04 1,386 67ms 0ms 05 1,613 80ms 0ms 06 1,540 77ms 0ms 07 1,540 73ms 0ms 08 1,540 78ms 0ms 09 1,540 75ms 0ms 10 1,790 92ms 0ms 11 1,568 77ms 0ms 12 1,568 77ms 0ms 13 1,760 88ms 0ms 14 1,540 75ms 0ms 15 1,639 83ms 0ms 16 1,488 75ms 0ms 17 1,733 87ms 0ms 18 1,786 94ms 0ms 19 1,617 79ms 0ms 20 1,543 76ms 0ms 21 1,603 80ms 0ms 22 1,597 80ms 0ms [ User: tng_migration_user - Total duration: 1s748ms - Times executed: 60551 ]
[ Application: [unknown] - Total duration: 1s748ms - Times executed: 60551 ]
-
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-28 09:01:07 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-29 16:27: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-29 13:18:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
7 2s816ms 15,798 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 318 53ms 0ms 04 360 62ms 0ms 05 360 57ms 0ms 06 360 61ms 0ms 07 360 59ms 0ms 08 360 61ms 0ms 09 360 62ms 0ms 10 360 62ms 0ms 11 360 63ms 0ms 12 360 62ms 0ms 13 360 60ms 0ms 14 360 61ms 0ms 15 360 61ms 0ms 16 360 62ms 0ms 17 360 65ms 0ms 18 360 64ms 0ms 19 360 64ms 0ms 20 360 66ms 0ms 21 360 64ms 0ms 22 360 68ms 0ms 23 360 64ms 0ms 00 360 64ms 0ms 01 360 65ms 0ms 02 360 67ms 0ms 03 360 69ms 0ms 04 360 66ms 0ms 05 360 68ms 0ms 06 360 63ms 0ms 07 360 63ms 0ms 08 360 63ms 0ms 09 360 64ms 0ms 10 360 65ms 0ms 11 360 65ms 0ms 12 360 67ms 0ms 13 360 65ms 0ms 14 360 68ms 0ms 15 360 64ms 0ms 16 360 64ms 0ms 17 360 66ms 0ms 18 360 63ms 0ms 19 360 62ms 0ms 20 360 63ms 0ms 21 360 65ms 0ms 22 360 65ms 0ms [ User: tng_migration_user - Total duration: 270ms - Times executed: 15798 ]
[ Application: [unknown] - Total duration: 270ms - Times executed: 15798 ]
-
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-28 05: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-29 19:05:16 Duration: 0ms 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-29 06:44:15 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
8 2s539ms 67,504 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_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,272 47ms 0ms 04 1,444 53ms 0ms 05 1,564 57ms 0ms 06 1,560 57ms 0ms 07 1,560 58ms 0ms 08 1,560 56ms 0ms 09 1,564 57ms 0ms 10 1,560 58ms 0ms 11 1,560 59ms 0ms 12 1,560 59ms 0ms 13 1,560 59ms 0ms 14 1,560 58ms 0ms 15 1,560 58ms 0ms 16 1,548 57ms 0ms 17 1,560 59ms 0ms 18 1,560 58ms 0ms 19 1,560 58ms 0ms 20 1,560 59ms 0ms 21 1,560 59ms 0ms 22 1,560 59ms 0ms 23 1,440 54ms 0ms 00 1,440 54ms 0ms 01 1,440 54ms 0ms 02 1,440 54ms 0ms 03 1,440 55ms 0ms 04 1,444 55ms 0ms 05 1,564 59ms 0ms 06 1,560 57ms 0ms 07 1,560 58ms 0ms 08 1,560 57ms 0ms 09 1,560 57ms 0ms 10 1,560 58ms 0ms 11 1,560 58ms 0ms 12 1,560 59ms 0ms 13 1,560 58ms 0ms 14 1,560 59ms 0ms 15 1,560 58ms 0ms 16 1,544 58ms 0ms 17 1,560 58ms 0ms 18 1,560 57ms 0ms 19 1,560 58ms 0ms 20 1,560 59ms 0ms 21 1,560 59ms 0ms 22 1,560 59ms 0ms [ User: tng_migration_user - Total duration: 1s127ms - Times executed: 67504 ]
[ Application: [unknown] - Total duration: 1s127ms - Times executed: 67504 ]
-
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-28 08:42: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.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-28 04:12: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.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-29 01:26:26 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
9 2s133ms 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 55ms 0ms 07 1,170 54ms 0ms 08 1,170 56ms 0ms 09 1,170 57ms 0ms 10 1,170 56ms 0ms 11 1,170 55ms 0ms 12 1,170 57ms 0ms 13 1,170 56ms 0ms 14 1,170 56ms 0ms 15 1,170 57ms 0ms 16 1,170 56ms 0ms 17 1,170 56ms 0ms 18 1,170 55ms 0ms 19 1,170 55ms 0ms 20 1,170 56ms 0ms 21 1,170 56ms 0ms 22 1,170 57ms 0ms 04 1,053 49ms 0ms 05 1,170 55ms 0ms 06 1,170 54ms 0ms 07 1,170 55ms 0ms 08 1,170 56ms 0ms 09 1,170 57ms 0ms 10 1,170 55ms 0ms 11 1,170 57ms 0ms 12 1,170 57ms 0ms 13 1,170 57ms 0ms 14 1,170 57ms 0ms 15 1,170 58ms 0ms 16 1,053 51ms 0ms 17 1,170 56ms 0ms 18 1,170 58ms 0ms 19 1,170 57ms 0ms 20 1,170 56ms 0ms 21 1,170 58ms 0ms 22 1,170 56ms 0ms [ User: tng_migration_user - Total duration: 24s622ms - Times executed: 44109 ]
[ Application: [unknown] - Total duration: 24s622ms - 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-28 23:24:03 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-28 16:24:04 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-29 13:42:03 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
10 1s548ms 20,657 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 = $1;Times Reported Time consuming prepare #10
Day Hour Count Duration Avg duration 04 450 31ms 0ms 05 583 42ms 0ms 06 537 37ms 0ms 07 673 48ms 0ms 08 648 48ms 0ms 09 756 55ms 0ms 10 768 63ms 0ms 11 556 43ms 0ms 12 559 47ms 0ms 13 544 39ms 0ms 14 537 37ms 0ms 15 533 37ms 0ms 16 533 36ms 0ms 17 539 39ms 0ms 18 535 38ms 0ms 19 536 38ms 0ms 20 560 45ms 0ms 21 535 39ms 0ms 22 533 41ms 0ms 04 430 30ms 0ms 05 565 43ms 0ms 06 510 36ms 0ms 07 510 37ms 0ms 08 510 36ms 0ms 09 510 37ms 0ms 10 530 39ms 0ms 11 514 38ms 0ms 12 510 36ms 0ms 13 523 41ms 0ms 14 508 39ms 0ms 15 514 37ms 0ms 16 517 39ms 0ms 17 514 37ms 0ms 18 543 46ms 0ms 19 509 38ms 0ms 20 507 37ms 0ms 21 509 39ms 0ms 22 509 38ms 0ms [ User: tng_migration_user - Total duration: 389ms - Times executed: 20657 ]
[ Application: [unknown] - Total duration: 389ms - Times executed: 20657 ]
-
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-29 19:16:50 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-29 17:05:50 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-29 19:42:06 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
11 727ms 20,052 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 626 21ms 0ms 05 532 18ms 0ms 06 532 18ms 0ms 07 532 18ms 0ms 08 534 19ms 0ms 09 534 18ms 0ms 10 535 19ms 0ms 11 539 19ms 0ms 12 538 23ms 0ms 13 533 19ms 0ms 14 530 17ms 0ms 15 529 17ms 0ms 16 529 17ms 0ms 17 531 18ms 0ms 18 529 18ms 0ms 19 531 18ms 0ms 20 538 19ms 0ms 21 529 19ms 0ms 22 529 20ms 0ms 04 573 20ms 0ms 05 521 19ms 0ms 06 516 18ms 0ms 07 516 17ms 0ms 08 516 18ms 0ms 09 516 18ms 0ms 10 522 18ms 0ms 11 517 18ms 0ms 12 515 18ms 0ms 13 518 19ms 0ms 14 514 19ms 0ms 15 516 18ms 0ms 16 516 19ms 0ms 17 510 18ms 0ms 18 522 23ms 0ms 19 508 17ms 0ms 20 509 18ms 0ms 21 508 19ms 0ms 22 509 18ms 0ms [ User: tng_migration_user - Total duration: 237ms - Times executed: 20052 ]
[ Application: [unknown] - Total duration: 237ms - Times executed: 20052 ]
-
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-29 19:16:50 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-29 19:42:06 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-29 21:09:11 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
12 547ms 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 #12
Day Hour Count Duration Avg duration 05 182 14ms 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 14ms 0ms 14 182 14ms 0ms 15 182 14ms 0ms 16 182 14ms 0ms 17 182 14ms 0ms 18 182 15ms 0ms 19 182 14ms 0ms 20 182 14ms 0ms 21 182 14ms 0ms 22 182 16ms 0ms 05 182 15ms 0ms 06 182 15ms 0ms 07 182 16ms 0ms 08 182 15ms 0ms 09 182 14ms 0ms 10 182 15ms 0ms 11 182 15ms 0ms 12 182 15ms 0ms 13 182 16ms 0ms 14 182 15ms 0ms 15 182 15ms 0ms 16 182 15ms 0ms 17 182 15ms 0ms 18 182 15ms 0ms 19 182 16ms 0ms 20 182 15ms 0ms 21 182 16ms 0ms 22 182 15ms 0ms [ User: tng_migration_user - Total duration: 1s771ms - Times executed: 6552 ]
[ Application: [unknown] - Total duration: 1s771ms - 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-29 08:59: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_.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-28 23:14: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_.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-29 16:59:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
13 537ms 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 #13
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 14ms 0ms 12 238 14ms 0ms 13 238 14ms 0ms 14 238 14ms 0ms 15 238 14ms 0ms 16 238 14ms 0ms 17 238 14ms 0ms 18 238 15ms 0ms 19 238 14ms 0ms 20 238 14ms 0ms 21 238 14ms 0ms 22 238 15ms 0ms 05 238 15ms 0ms 06 238 14ms 0ms 07 238 15ms 0ms 08 238 14ms 0ms 09 238 14ms 0ms 10 238 14ms 0ms 11 238 14ms 0ms 12 238 15ms 0ms 13 238 16ms 0ms 14 238 15ms 0ms 15 238 14ms 0ms 16 238 15ms 0ms 17 238 14ms 0ms 18 238 14ms 0ms 19 238 15ms 0ms 20 238 15ms 0ms 21 238 15ms 0ms 22 238 15ms 0ms [ User: tng_migration_user - Total duration: 137ms - Times executed: 8568 ]
[ Application: [unknown] - Total duration: 137ms - 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-29 17:59: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) AND (m0_.result_date BETWEEN $6 AND $7);
Date: 2025-11-29 10:50: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-28 23:41:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
14 509ms 3,996 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.subject_inform_consent_state t0 WHERE t0.code = $1 LIMIT 1;Times Reported Time consuming prepare #14
Day Hour Count Duration Avg duration 04 36 5ms 0ms 05 68 8ms 0ms 06 68 8ms 0ms 07 152 14ms 0ms 08 132 15ms 0ms 09 248 26ms 0ms 10 256 28ms 0ms 11 132 18ms 0ms 12 164 18ms 0ms 13 104 13ms 0ms 14 140 18ms 0ms 15 68 10ms 0ms 16 64 8ms 0ms 17 96 11ms 0ms 18 80 12ms 0ms 19 68 9ms 0ms 20 172 20ms 0ms 21 80 10ms 0ms 22 68 10ms 0ms 04 36 5ms 0ms 05 92 12ms 0ms 06 68 10ms 0ms 07 68 10ms 0ms 08 68 11ms 0ms 09 68 10ms 0ms 10 160 19ms 0ms 11 84 11ms 0ms 12 76 10ms 0ms 13 144 18ms 0ms 14 68 9ms 0ms 15 104 13ms 0ms 16 96 10ms 0ms 17 156 17ms 0ms 18 180 21ms 0ms 19 92 11ms 0ms 20 72 10ms 0ms 21 80 12ms 0ms 22 88 11ms 0ms [ User: tng_migration_user - Total duration: 36ms - Times executed: 3996 ]
[ Application: [unknown] - Total duration: 36ms - Times executed: 3996 ]
-
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-29 11:45:32 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.subject_inform_consent_state t0 WHERE t0.code = $1 LIMIT 1;
Date: 2025-11-28 14:00:01 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.subject_inform_consent_state t0 WHERE t0.code = $1 LIMIT 1;
Date: 2025-11-28 22:23:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
15 478ms 642 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 prepare #15
Day Hour Count Duration Avg duration 06 3 2ms 0ms 07 37 24ms 0ms 08 51 37ms 0ms 09 121 89ms 0ms 10 68 50ms 0ms 11 12 9ms 0ms 12 33 22ms 0ms 13 15 12ms 0ms 14 82 67ms 0ms 17 9 7ms 0ms 18 3 1ms 0ms 19 2 0ms 0ms 20 32 25ms 0ms 21 4 3ms 0ms 05 8 5ms 0ms 10 33 23ms 0ms 11 4 2ms 0ms 12 3 2ms 0ms 13 21 16ms 0ms 15 10 7ms 0ms 16 12 8ms 0ms 17 26 19ms 0ms 18 34 24ms 0ms 19 7 4ms 0ms 20 2 0ms 0ms 21 3 1ms 0ms 22 7 5ms 0ms [ User: tng_migration_user - Total duration: 32ms - Times executed: 642 ]
[ Application: [unknown] - Total duration: 32ms - Times executed: 642 ]
-
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-28 15:21:56 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-28 15:09:43 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-28 15:23:15 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
16 467ms 5,886 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 #16
Day Hour Count Duration Avg duration 05 8 0ms 0ms 07 51 5ms 0ms 08 137 10ms 0ms 09 132 14ms 0ms 10 187 18ms 0ms 11 111 10ms 0ms 12 359 28ms 0ms 13 256 22ms 0ms 14 69 5ms 0ms 17 237 17ms 0ms 18 79 6ms 0ms 20 506 39ms 0ms 21 79 6ms 0ms 05 212 16ms 0ms 10 579 43ms 0ms 11 87 6ms 0ms 12 95 6ms 0ms 13 592 45ms 0ms 15 309 23ms 0ms 16 309 24ms 0ms 17 618 46ms 0ms 18 392 31ms 0ms 19 138 10ms 0ms 21 154 11ms 0ms 22 190 14ms 0ms [ User: tng_migration_user - Total duration: 183ms - Times executed: 5886 ]
[ Application: [unknown] - Total duration: 183ms - Times executed: 5886 ]
-
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-28 10:10:59 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-28 10:21: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.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-28 13:51:40 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
17 425ms 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 #17
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 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 12ms 0ms 19 182 11ms 0ms 20 182 11ms 0ms 21 182 11ms 0ms 22 182 12ms 0ms 05 182 12ms 0ms 06 182 11ms 0ms 07 182 12ms 0ms 08 182 12ms 0ms 09 182 11ms 0ms 10 182 11ms 0ms 11 182 11ms 0ms 12 182 12ms 0ms 13 182 13ms 0ms 14 182 11ms 0ms 15 182 11ms 0ms 16 182 12ms 0ms 17 182 11ms 0ms 18 182 11ms 0ms 19 182 12ms 0ms 20 182 11ms 0ms 21 182 12ms 0ms 22 182 11ms 0ms [ User: tng_migration_user - Total duration: 213ms - Times executed: 6552 ]
[ Application: [unknown] - Total duration: 213ms - 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-29 14: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-28 09:05: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-28 22:23:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
18 369ms 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 250 9ms 0ms 17 250 9ms 0ms 18 250 9ms 0ms 19 250 9ms 0ms 20 250 9ms 0ms 21 250 9ms 0ms 22 250 10ms 0ms 04 225 8ms 0ms 05 250 9ms 0ms 06 250 9ms 0ms 07 250 10ms 0ms 08 250 10ms 0ms 09 250 9ms 0ms 10 250 9ms 0ms 11 250 9ms 0ms 12 250 10ms 0ms 13 250 9ms 0ms 14 250 9ms 0ms 15 250 10ms 0ms 16 225 9ms 0ms 17 250 9ms 0ms 18 250 10ms 0ms 19 250 9ms 0ms 20 250 9ms 0ms 21 250 9ms 0ms 22 250 9ms 0ms [ User: tng_migration_user - Total duration: 3s239ms - Times executed: 9425 ]
[ Application: [unknown] - Total duration: 3s239ms - 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-29 13: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 IN ($1) AND m0_.form_id IS NULL;
Date: 2025-11-29 09:30: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-29 05:48:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
19 365ms 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 9ms 0ms 12 176 10ms 0ms 13 176 9ms 0ms 14 176 9ms 0ms 15 176 9ms 0ms 16 176 8ms 0ms 17 176 9ms 0ms 18 176 9ms 0ms 19 176 9ms 0ms 20 176 9ms 0ms 21 176 9ms 0ms 22 176 11ms 0ms 04 176 9ms 0ms 05 176 9ms 0ms 06 176 9ms 0ms 07 176 9ms 0ms 08 176 9ms 0ms 09 176 10ms 0ms 10 176 9ms 0ms 11 176 9ms 0ms 12 176 9ms 0ms 13 176 9ms 0ms 14 176 11ms 0ms 15 176 9ms 0ms 16 176 10ms 0ms 17 176 9ms 0ms 18 176 10ms 0ms 19 176 9ms 0ms 20 176 9ms 0ms 21 176 9ms 0ms 22 176 9ms 0ms [ User: tng_migration_user - Total duration: 454ms - Times executed: 6688 ]
[ Application: [unknown] - Total duration: 454ms - 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-29 17:00:04 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-28 14: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-28 07:00:03 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
20 358ms 7,954 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 110 5ms 0ms 07 11 1ms 0ms 08 160 7ms 0ms 09 24 2ms 0ms 10 183 9ms 0ms 11 139 6ms 0ms 12 428 19ms 0ms 13 377 18ms 0ms 14 101 4ms 0ms 17 306 13ms 0ms 18 102 4ms 0ms 20 690 31ms 0ms 21 102 4ms 0ms 04 88 5ms 0ms 05 320 14ms 0ms 10 823 36ms 0ms 11 112 4ms 0ms 12 122 5ms 0ms 13 763 32ms 0ms 15 405 17ms 0ms 16 405 18ms 0ms 17 810 35ms 0ms 18 669 30ms 0ms 19 246 10ms 0ms 21 214 9ms 0ms 22 244 10ms 0ms [ User: tng_migration_user - Total duration: 153ms - Times executed: 7954 ]
[ Application: [unknown] - Total duration: 153ms - Times executed: 7954 ]
-
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-29 11:31:59 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-28 10:30:05 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-28 11:28:21 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 14s236ms 118,132 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.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 29 04 2,226 264ms 0ms 05 2,527 300ms 0ms 06 2,737 315ms 0ms 07 2,730 319ms 0ms 08 2,730 316ms 0ms 09 2,730 319ms 0ms 10 2,737 318ms 0ms 11 2,730 328ms 0ms 12 2,730 335ms 0ms 13 2,730 332ms 0ms 14 2,730 327ms 0ms 15 2,730 330ms 0ms 16 2,730 328ms 0ms 17 2,709 322ms 0ms 18 2,730 331ms 0ms 19 2,730 325ms 0ms 20 2,730 329ms 0ms 21 2,730 333ms 0ms 22 2,730 331ms 0ms 23 2,730 337ms 0ms Nov 29 00 2,520 309ms 0ms 01 2,520 304ms 0ms 02 2,520 306ms 0ms 03 2,520 310ms 0ms 04 2,520 314ms 0ms 05 2,527 312ms 0ms 06 2,737 341ms 0ms 07 2,730 320ms 0ms 08 2,730 326ms 0ms 09 2,730 323ms 0ms 10 2,730 326ms 0ms 11 2,730 329ms 0ms 12 2,730 331ms 0ms 13 2,730 334ms 0ms 14 2,730 329ms 0ms 15 2,730 335ms 0ms 16 2,730 330ms 0ms 17 2,702 325ms 0ms 18 2,730 330ms 0ms 19 2,730 324ms 0ms 20 2,730 322ms 0ms 21 2,730 328ms 0ms 22 2,730 335ms 0ms 23 2,730 334ms 0ms [ User: tng_migration_user - Total duration: 2s171ms - Times executed: 118132 ]
[ Application: [unknown] - Total duration: 2s171ms - Times executed: 118132 ]
-
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-28 05:02:26 Duration: 7ms 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-29 16:30:18 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_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-29 14:00:16 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR'
2 9s623ms 15,798 0ms 109ms 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 318 201ms 0ms 04 360 316ms 0ms 05 360 201ms 0ms 06 360 218ms 0ms 07 360 208ms 0ms 08 360 220ms 0ms 09 360 219ms 0ms 10 360 221ms 0ms 11 360 222ms 0ms 12 360 218ms 0ms 13 360 212ms 0ms 14 360 214ms 0ms 15 360 214ms 0ms 16 360 210ms 0ms 17 360 218ms 0ms 18 360 215ms 0ms 19 360 216ms 0ms 20 360 221ms 0ms 21 360 217ms 0ms 22 360 225ms 0ms 23 360 219ms 0ms 00 360 217ms 0ms 01 360 219ms 0ms 02 360 225ms 0ms 03 360 227ms 0ms 04 360 221ms 0ms 05 360 222ms 0ms 06 360 210ms 0ms 07 360 211ms 0ms 08 360 211ms 0ms 09 360 213ms 0ms 10 360 217ms 0ms 11 360 216ms 0ms 12 360 224ms 0ms 13 360 217ms 0ms 14 360 223ms 0ms 15 360 213ms 0ms 16 360 212ms 0ms 17 360 217ms 0ms 18 360 209ms 0ms 19 360 209ms 0ms 20 360 212ms 0ms 21 360 215ms 0ms 22 360 216ms 0ms [ User: tng_migration_user - Total duration: 1s946ms - Times executed: 15798 ]
[ Application: [unknown] - Total duration: 1s946ms - Times executed: 15798 ]
-
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-28 05:02:25 Duration: 109ms 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-29 03:07:15 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 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-11-28 17:02:24 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
3 8s229ms 60,551 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 181ms 0ms 05 1,540 200ms 0ms 06 1,540 202ms 0ms 07 1,680 225ms 0ms 08 1,583 207ms 0ms 09 1,543 200ms 0ms 10 1,660 241ms 0ms 11 1,679 229ms 0ms 12 1,685 236ms 0ms 13 1,648 225ms 0ms 14 1,574 220ms 0ms 15 1,540 209ms 0ms 16 1,540 209ms 0ms 17 1,612 214ms 0ms 18 1,564 213ms 0ms 19 1,542 208ms 0ms 20 1,740 238ms 0ms 21 1,564 202ms 0ms 22 1,540 207ms 0ms 04 1,386 182ms 0ms 05 1,613 220ms 0ms 06 1,540 211ms 0ms 07 1,540 200ms 0ms 08 1,540 214ms 0ms 09 1,540 204ms 0ms 10 1,790 255ms 0ms 11 1,568 212ms 0ms 12 1,568 211ms 0ms 13 1,760 243ms 0ms 14 1,540 207ms 0ms 15 1,639 230ms 0ms 16 1,488 204ms 0ms 17 1,733 237ms 0ms 18 1,786 258ms 0ms 19 1,617 215ms 0ms 20 1,543 206ms 0ms 21 1,603 219ms 0ms 22 1,597 218ms 0ms [ User: tng_migration_user - Total duration: 1s748ms - Times executed: 60551 ]
[ Application: [unknown] - Total duration: 1s748ms - Times executed: 60551 ]
-
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-29 11:45:32 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '215'
-
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-28 09:04:35 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '91'
-
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-29 19:38:40 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '221'
4 5s672ms 67,504 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 bind #4
Day Hour Count Duration Avg duration 03 1,272 105ms 0ms 04 1,444 118ms 0ms 05 1,564 127ms 0ms 06 1,560 127ms 0ms 07 1,560 127ms 0ms 08 1,560 127ms 0ms 09 1,564 128ms 0ms 10 1,560 130ms 0ms 11 1,560 132ms 0ms 12 1,560 132ms 0ms 13 1,560 131ms 0ms 14 1,560 131ms 0ms 15 1,560 130ms 0ms 16 1,548 129ms 0ms 17 1,560 131ms 0ms 18 1,560 130ms 0ms 19 1,560 130ms 0ms 20 1,560 131ms 0ms 21 1,560 132ms 0ms 22 1,560 133ms 0ms 23 1,440 122ms 0ms 00 1,440 122ms 0ms 01 1,440 120ms 0ms 02 1,440 123ms 0ms 03 1,440 123ms 0ms 04 1,444 124ms 0ms 05 1,564 134ms 0ms 06 1,560 128ms 0ms 07 1,560 130ms 0ms 08 1,560 129ms 0ms 09 1,560 130ms 0ms 10 1,560 131ms 0ms 11 1,560 131ms 0ms 12 1,560 132ms 0ms 13 1,560 131ms 0ms 14 1,560 133ms 0ms 15 1,560 131ms 0ms 16 1,544 130ms 0ms 17 1,560 132ms 0ms 18 1,560 129ms 0ms 19 1,560 128ms 0ms 20 1,560 131ms 0ms 21 1,560 134ms 0ms 22 1,560 132ms 0ms [ User: tng_migration_user - Total duration: 1s127ms - Times executed: 67504 ]
[ Application: [unknown] - Total duration: 1s127ms - Times executed: 67504 ]
-
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-29 14:09:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'PHONE'
-
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-28 22:28:26 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-28 18:12:25 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'EMAIL_SENDED'
5 4s573ms 15,798 0ms 39ms 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 318 99ms 0ms 04 360 137ms 0ms 05 360 94ms 0ms 06 360 98ms 0ms 07 360 100ms 0ms 08 360 97ms 0ms 09 360 99ms 0ms 10 360 102ms 0ms 11 360 104ms 0ms 12 360 101ms 0ms 13 360 99ms 0ms 14 360 100ms 0ms 15 360 101ms 0ms 16 360 101ms 0ms 17 360 104ms 0ms 18 360 103ms 0ms 19 360 102ms 0ms 20 360 104ms 0ms 21 360 104ms 0ms 22 360 107ms 0ms 23 360 107ms 0ms 00 360 105ms 0ms 01 360 105ms 0ms 02 360 106ms 0ms 03 360 108ms 0ms 04 360 106ms 0ms 05 360 107ms 0ms 06 360 99ms 0ms 07 360 101ms 0ms 08 360 101ms 0ms 09 360 102ms 0ms 10 360 104ms 0ms 11 360 105ms 0ms 12 360 108ms 0ms 13 360 103ms 0ms 14 360 106ms 0ms 15 360 103ms 0ms 16 360 105ms 0ms 17 360 104ms 0ms 18 360 98ms 0ms 19 360 100ms 0ms 20 360 105ms 0ms 21 360 105ms 0ms 22 360 103ms 0ms [ User: tng_migration_user - Total duration: 2s964ms - Times executed: 15798 ]
[ Application: [unknown] - Total duration: 2s964ms - Times executed: 15798 ]
-
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-28 05:02:26 Duration: 39ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR', $2 = '2025-11-21 05:02: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-28 04:26:26 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR', $2 = '2025-11-21 04:26: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-29 13:21:15 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR', $2 = '2025-11-22 13:21:15'
6 3s424ms 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 90ms 0ms 06 1,170 89ms 0ms 07 1,170 87ms 0ms 08 1,170 90ms 0ms 09 1,170 91ms 0ms 10 1,170 91ms 0ms 11 1,170 88ms 0ms 12 1,170 93ms 0ms 13 1,170 90ms 0ms 14 1,170 90ms 0ms 15 1,170 90ms 0ms 16 1,170 89ms 0ms 17 1,170 91ms 0ms 18 1,170 90ms 0ms 19 1,170 88ms 0ms 20 1,170 90ms 0ms 21 1,170 88ms 0ms 22 1,170 91ms 0ms 04 1,053 80ms 0ms 05 1,170 89ms 0ms 06 1,170 88ms 0ms 07 1,170 90ms 0ms 08 1,170 91ms 0ms 09 1,170 91ms 0ms 10 1,170 89ms 0ms 11 1,170 92ms 0ms 12 1,170 91ms 0ms 13 1,170 92ms 0ms 14 1,170 93ms 0ms 15 1,170 93ms 0ms 16 1,053 82ms 0ms 17 1,170 90ms 0ms 18 1,170 93ms 0ms 19 1,170 93ms 0ms 20 1,170 91ms 0ms 21 1,170 94ms 0ms 22 1,170 90ms 0ms [ User: tng_migration_user - Total duration: 24s622ms - Times executed: 44109 ]
[ Application: [unknown] - Total duration: 24s622ms - 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-29 22:18:03 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '13', $2 = '2025-03-15 22:18:02', $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-28 06:54:03 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '13', $2 = '2025-03-14 06:54: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-28 21:42:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '13', $2 = '2025-03-14 21:42:01', $3 = 't'
7 3s101ms 17,287 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 = $1 LIMIT 1;Times Reported Time consuming bind #7
Day Hour Count Duration Avg duration 03 318 55ms 0ms 04 360 66ms 0ms 05 616 75ms 0ms 06 390 69ms 0ms 07 390 67ms 0ms 08 390 69ms 0ms 09 392 70ms 0ms 10 390 72ms 0ms 11 390 72ms 0ms 12 390 71ms 0ms 13 390 69ms 0ms 14 390 71ms 0ms 15 390 69ms 0ms 16 387 69ms 0ms 17 390 71ms 0ms 18 390 71ms 0ms 19 390 71ms 0ms 20 390 72ms 0ms 21 390 71ms 0ms 22 390 74ms 0ms 23 360 66ms 0ms 00 360 65ms 0ms 01 360 65ms 0ms 02 360 68ms 0ms 03 360 68ms 0ms 04 360 67ms 0ms 05 578 82ms 0ms 06 390 68ms 0ms 07 390 70ms 0ms 08 390 69ms 0ms 09 390 70ms 0ms 10 390 71ms 0ms 11 390 71ms 0ms 12 390 74ms 0ms 13 390 72ms 0ms 14 390 73ms 0ms 15 390 70ms 0ms 16 386 70ms 0ms 17 390 71ms 0ms 18 390 70ms 0ms 19 390 69ms 0ms 20 390 70ms 0ms 21 390 71ms 0ms 22 390 73ms 0ms [ User: tng_migration_user - Total duration: 202ms - Times executed: 17287 ]
[ Application: [unknown] - Total duration: 202ms - Times executed: 17287 ]
-
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-28 05:02:26 Duration: 4ms 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-29 13:34:15 Duration: 0ms 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-29 23:07:16 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR'
8 2s655ms 18,395 0ms 1ms 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 370 56ms 0ms 04 410 52ms 0ms 05 420 58ms 0ms 06 420 59ms 0ms 07 420 60ms 0ms 08 420 61ms 0ms 09 420 60ms 0ms 10 420 63ms 0ms 11 420 62ms 0ms 12 420 63ms 0ms 13 420 61ms 0ms 14 420 61ms 0ms 15 420 61ms 0ms 16 414 56ms 0ms 17 420 61ms 0ms 18 420 62ms 0ms 19 420 61ms 0ms 20 420 61ms 0ms 21 420 59ms 0ms 22 420 63ms 0ms 23 420 63ms 0ms 00 420 61ms 0ms 01 420 62ms 0ms 02 420 62ms 0ms 03 420 63ms 0ms 04 410 55ms 0ms 05 420 60ms 0ms 06 420 58ms 0ms 07 420 59ms 0ms 08 420 59ms 0ms 09 420 58ms 0ms 10 420 59ms 0ms 11 420 59ms 0ms 12 420 61ms 0ms 13 420 57ms 0ms 14 420 59ms 0ms 15 420 59ms 0ms 16 411 56ms 0ms 17 420 61ms 0ms 18 420 59ms 0ms 19 420 59ms 0ms 20 420 61ms 0ms 21 420 63ms 0ms 22 420 64ms 0ms [ User: tng_migration_user - Total duration: 672ms - Times executed: 18395 ]
[ Application: [unknown] - Total duration: 672ms - Times executed: 18395 ]
-
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-28 19:56:02 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-28 11:13:02 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-28 04:16:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'f', $2 = 'f'
9 2s294ms 20,657 0ms 2ms 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 450 46ms 0ms 05 583 63ms 0ms 06 537 53ms 0ms 07 673 72ms 0ms 08 648 72ms 0ms 09 756 82ms 0ms 10 768 96ms 0ms 11 556 65ms 0ms 12 559 72ms 0ms 13 544 58ms 0ms 14 537 54ms 0ms 15 533 54ms 0ms 16 533 51ms 0ms 17 539 57ms 0ms 18 535 55ms 0ms 19 536 56ms 0ms 20 560 70ms 0ms 21 535 57ms 0ms 22 533 61ms 0ms 04 430 44ms 0ms 05 565 67ms 0ms 06 510 52ms 0ms 07 510 53ms 0ms 08 510 52ms 0ms 09 510 53ms 0ms 10 530 60ms 0ms 11 514 56ms 0ms 12 510 52ms 0ms 13 523 62ms 0ms 14 508 57ms 0ms 15 514 54ms 0ms 16 517 59ms 0ms 17 514 56ms 0ms 18 543 77ms 0ms 19 509 56ms 0ms 20 507 55ms 0ms 21 509 58ms 0ms 22 509 56ms 0ms [ User: tng_migration_user - Total duration: 389ms - Times executed: 20657 ]
[ Application: [unknown] - Total duration: 389ms - Times executed: 20657 ]
-
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-29 19:16:50 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '41999'
-
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-29 17:26:42 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '3663'
-
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-29 19:42:06 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '42024'
10 1s630ms 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 43ms 0ms 06 238 43ms 0ms 07 238 43ms 0ms 08 238 44ms 0ms 09 238 44ms 0ms 10 238 47ms 0ms 11 238 44ms 0ms 12 238 44ms 0ms 13 238 43ms 0ms 14 238 44ms 0ms 15 238 44ms 0ms 16 238 44ms 0ms 17 238 44ms 0ms 18 238 45ms 0ms 19 238 45ms 0ms 20 238 44ms 0ms 21 238 44ms 0ms 22 238 46ms 0ms 05 238 46ms 0ms 06 238 45ms 0ms 07 238 45ms 0ms 08 238 45ms 0ms 09 238 44ms 0ms 10 238 45ms 0ms 11 238 45ms 0ms 12 238 45ms 0ms 13 238 49ms 0ms 14 238 45ms 0ms 15 238 45ms 0ms 16 238 46ms 0ms 17 238 45ms 0ms 18 238 44ms 0ms 19 238 46ms 0ms 20 238 46ms 0ms 21 238 46ms 0ms 22 238 46ms 0ms [ User: tng_migration_user - Total duration: 137ms - Times executed: 8568 ]
[ Application: [unknown] - Total duration: 137ms - 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-29 17:59:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '108', $2 = 'AWAITING', $3 = 'MISSED', $4 = 'DONE', $5 = 'CANCELED', $6 = '2025-02-19 17:59:01', $7 = '2025-02-23 17:59: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-29 08: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-08 08:59:02', $7 = '2025-10-12 08:59: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-28 23:41:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '109', $2 = 'AWAITING', $3 = 'MISSED', $4 = 'DONE', $5 = 'CANCELED', $6 = '2024-11-26 23:41:01', $7 = '2024-11-30 23:41:01'
11 1s299ms 15,798 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 #11
Day Hour Count Duration Avg duration 03 318 25ms 0ms 04 360 28ms 0ms 05 360 27ms 0ms 06 360 29ms 0ms 07 360 28ms 0ms 08 360 28ms 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 28ms 0ms 16 360 28ms 0ms 17 360 29ms 0ms 18 360 28ms 0ms 19 360 29ms 0ms 20 360 29ms 0ms 21 360 29ms 0ms 22 360 30ms 0ms 23 360 29ms 0ms 00 360 29ms 0ms 01 360 29ms 0ms 02 360 30ms 0ms 03 360 31ms 0ms 04 360 31ms 0ms 05 360 31ms 0ms 06 360 29ms 0ms 07 360 29ms 0ms 08 360 29ms 0ms 09 360 29ms 0ms 10 360 30ms 0ms 11 360 30ms 0ms 12 360 31ms 0ms 13 360 30ms 0ms 14 360 31ms 0ms 15 360 30ms 0ms 16 360 29ms 0ms 17 360 29ms 0ms 18 360 28ms 0ms 19 360 28ms 0ms 20 360 29ms 0ms 21 360 29ms 0ms 22 360 29ms 0ms [ User: tng_migration_user - Total duration: 270ms - Times executed: 15798 ]
[ Application: [unknown] - Total duration: 270ms - Times executed: 15798 ]
-
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-28 07:03:42 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-29 16:28:18 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-28 10:04:26 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'f', $2 = '0'
12 1s297ms 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 #12
Day Hour Count Duration Avg duration 05 182 34ms 0ms 06 182 34ms 0ms 07 182 34ms 0ms 08 182 36ms 0ms 09 182 35ms 0ms 10 182 37ms 0ms 11 182 35ms 0ms 12 182 35ms 0ms 13 182 33ms 0ms 14 182 35ms 0ms 15 182 35ms 0ms 16 182 35ms 0ms 17 182 35ms 0ms 18 182 36ms 0ms 19 182 35ms 0ms 20 182 35ms 0ms 21 182 36ms 0ms 22 182 37ms 0ms 05 182 36ms 0ms 06 182 36ms 0ms 07 182 36ms 0ms 08 182 36ms 0ms 09 182 35ms 0ms 10 182 35ms 0ms 11 182 35ms 0ms 12 182 36ms 0ms 13 182 40ms 0ms 14 182 35ms 0ms 15 182 35ms 0ms 16 182 36ms 0ms 17 182 36ms 0ms 18 182 35ms 0ms 19 182 37ms 0ms 20 182 36ms 0ms 21 182 37ms 0ms 22 182 37ms 0ms [ User: tng_migration_user - Total duration: 213ms - Times executed: 6552 ]
[ Application: [unknown] - Total duration: 213ms - 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-28 09:05:01 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-26 09:05:01', $9 = '2024-12-07 09: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, $6) AND m0_.use_alternative <> $7 AND (m0_.result_date BETWEEN $8 AND $9);
Date: 2025-11-29 08:59:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '105', $2 = 'READY', $3 = 'AWAITING', $4 = 'MISSED', $5 = 'DONE', $6 = 'CANCELED', $7 = 't', $8 = '2025-07-30 08:59:02', $9 = '2025-08-10 08:59: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, $6) AND m0_.use_alternative <> $7 AND (m0_.result_date BETWEEN $8 AND $9);
Date: 2025-11-29 14:41:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '104', $2 = 'READY', $3 = 'AWAITING', $4 = 'MISSED', $5 = 'DONE', $6 = 'CANCELED', $7 = 't', $8 = '2025-10-08 14:41:01', $9 = '2025-10-19 14:41:01'
13 1s289ms 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 bind #13
Day Hour Count Duration Avg duration 05 182 34ms 0ms 06 182 34ms 0ms 07 182 34ms 0ms 08 182 35ms 0ms 09 182 34ms 0ms 10 182 36ms 0ms 11 182 35ms 0ms 12 182 35ms 0ms 13 182 34ms 0ms 14 182 34ms 0ms 15 182 35ms 0ms 16 182 35ms 0ms 17 182 34ms 0ms 18 182 36ms 0ms 19 182 35ms 0ms 20 182 35ms 0ms 21 182 35ms 0ms 22 182 37ms 0ms 05 182 36ms 0ms 06 182 35ms 0ms 07 182 36ms 0ms 08 182 35ms 0ms 09 182 35ms 0ms 10 182 36ms 0ms 11 182 35ms 0ms 12 182 36ms 0ms 13 182 39ms 0ms 14 182 35ms 0ms 15 182 35ms 0ms 16 182 36ms 0ms 17 182 36ms 0ms 18 182 34ms 0ms 19 182 37ms 0ms 20 182 36ms 0ms 21 182 37ms 0ms 22 182 36ms 0ms [ User: tng_migration_user - Total duration: 1s771ms - Times executed: 6552 ]
[ Application: [unknown] - Total duration: 1s771ms - 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-29 08:59:02 Duration: 1ms 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-08 08:59: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_.use_alternative <> $6 AND m0_.result_date <= $7;
Date: 2025-11-29 18:41:02 Duration: 1ms 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-08 18:41: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_.use_alternative <> $6 AND m0_.result_date <= $7;
Date: 2025-11-28 23:14: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 = 't', $7 = '2025-10-07 23:14:02'
14 1s269ms 5,886 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.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 #14
Day Hour Count Duration Avg duration 05 8 1ms 0ms 07 51 16ms 0ms 08 137 28ms 0ms 09 132 46ms 0ms 10 187 53ms 0ms 11 111 27ms 0ms 12 359 77ms 0ms 13 256 58ms 0ms 14 69 13ms 0ms 17 237 46ms 0ms 18 79 16ms 0ms 20 506 107ms 0ms 21 79 17ms 0ms 05 212 44ms 0ms 10 579 122ms 0ms 11 87 16ms 0ms 12 95 18ms 0ms 13 592 117ms 0ms 15 309 62ms 0ms 16 309 64ms 0ms 17 618 122ms 0ms 18 392 91ms 0ms 19 138 27ms 0ms 21 154 30ms 0ms 22 190 39ms 0ms [ User: tng_migration_user - Total duration: 183ms - Times executed: 5886 ]
[ Application: [unknown] - Total duration: 183ms - Times executed: 5886 ]
-
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-29 19:42:23 Duration: 4ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '50018', $2 = '561', $3 = '560'
-
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-28 10:21:15 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '2338', $2 = '592', $3 = '591'
-
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-28 10:10:59 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '2299', $2 = '591', $3 = '592'
15 1s216ms 7,954 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 #15
Day Hour Count Duration Avg duration 04 110 18ms 0ms 07 11 3ms 0ms 08 160 24ms 0ms 09 24 7ms 0ms 10 183 31ms 0ms 11 139 21ms 0ms 12 428 65ms 0ms 13 377 64ms 0ms 14 101 14ms 0ms 17 306 44ms 0ms 18 102 15ms 0ms 20 690 104ms 0ms 21 102 16ms 0ms 04 88 16ms 0ms 05 320 48ms 0ms 10 823 122ms 0ms 11 112 15ms 0ms 12 122 17ms 0ms 13 763 112ms 0ms 15 405 61ms 0ms 16 405 63ms 0ms 17 810 117ms 0ms 18 669 104ms 0ms 19 246 35ms 0ms 21 214 30ms 0ms 22 244 36ms 0ms [ User: tng_migration_user - Total duration: 153ms - Times executed: 7954 ]
[ Application: [unknown] - Total duration: 153ms - Times executed: 7954 ]
-
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-28 10:30:05 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '78'
-
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-28 10:18:19 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '79'
-
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-28 13:53:37 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '79'
16 981ms 20,052 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 #16
Day Hour Count Duration Avg duration 04 626 29ms 0ms 05 532 24ms 0ms 06 532 23ms 0ms 07 532 24ms 0ms 08 534 26ms 0ms 09 534 24ms 0ms 10 535 26ms 0ms 11 539 27ms 0ms 12 538 34ms 0ms 13 533 26ms 0ms 14 530 23ms 0ms 15 529 23ms 0ms 16 529 23ms 0ms 17 531 25ms 0ms 18 529 23ms 0ms 19 531 25ms 0ms 20 538 28ms 0ms 21 529 24ms 0ms 22 529 28ms 0ms 04 573 27ms 0ms 05 521 25ms 0ms 06 516 24ms 0ms 07 516 24ms 0ms 08 516 23ms 0ms 09 516 25ms 0ms 10 522 26ms 0ms 11 517 24ms 0ms 12 515 24ms 0ms 13 518 27ms 0ms 14 514 27ms 0ms 15 516 24ms 0ms 16 516 26ms 0ms 17 510 24ms 0ms 18 522 32ms 0ms 19 508 23ms 0ms 20 509 24ms 0ms 21 508 25ms 0ms 22 509 24ms 0ms [ User: tng_migration_user - Total duration: 237ms - Times executed: 20052 ]
[ Application: [unknown] - Total duration: 237ms - Times executed: 20052 ]
-
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-29 19:16:50 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '137406'
-
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-29 19:42:06 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '137952'
-
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-29 22:07:51 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '137878'
17 809ms 650 0ms 2ms 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 5 6ms 1ms 07 34 40ms 1ms 08 54 62ms 1ms 09 113 139ms 1ms 10 66 84ms 1ms 11 13 17ms 1ms 12 31 39ms 1ms 13 18 23ms 1ms 14 84 107ms 1ms 17 12 14ms 1ms 18 3 3ms 1ms 19 2 2ms 1ms 20 33 42ms 1ms 21 4 6ms 1ms 05 7 8ms 1ms 10 39 45ms 1ms 11 4 4ms 1ms 12 4 5ms 1ms 13 22 27ms 1ms 15 11 12ms 1ms 16 12 14ms 1ms 17 30 36ms 1ms 18 31 40ms 1ms 19 7 7ms 1ms 21 3 3ms 1ms 22 8 10ms 1ms [ User: tng_migration_user - Total duration: 74ms - Times executed: 650 ]
[ Application: [unknown] - Total duration: 74ms - Times executed: 650 ]
-
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-28 13:21:19 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '2452'
-
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-28 15:06:22 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '1840'
-
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-28 15:23:15 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '1840'
18 702ms 2,525 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.NAME = $1 LIMIT 1;Times Reported Time consuming bind #18
Day Hour Count Duration Avg duration 04 379 40ms 0ms 05 191 24ms 0ms 06 27 10ms 0ms 07 27 10ms 0ms 08 62 25ms 0ms 09 136 53ms 0ms 10 68 28ms 0ms 11 39 15ms 0ms 12 34 13ms 0ms 13 34 13ms 0ms 14 193 86ms 0ms 15 27 11ms 0ms 16 27 10ms 0ms 17 30 10ms 0ms 18 29 11ms 0ms 19 27 10ms 0ms 20 43 15ms 0ms 21 29 10ms 0ms 22 27 11ms 0ms 23 100 13ms 0ms 04 284 34ms 0ms 05 191 26ms 0ms 06 27 11ms 0ms 07 27 11ms 0ms 08 27 12ms 0ms 09 27 11ms 0ms 10 36 15ms 0ms 11 31 12ms 0ms 12 27 11ms 0ms 13 36 14ms 0ms 14 27 11ms 0ms 15 29 11ms 0ms 16 31 11ms 0ms 17 30 12ms 0ms 18 49 17ms 0ms 19 31 12ms 0ms 20 29 11ms 0ms 21 28 12ms 0ms 22 29 12ms 0ms [ User: tng_migration_user - Total duration: 1s246ms - Times executed: 2525 ]
[ Application: [unknown] - Total duration: 1s246ms - Times executed: 2525 ]
-
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.NAME = $1 LIMIT 1;
Date: 2025-11-28 23:05:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'system'
-
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.NAME = $1 LIMIT 1;
Date: 2025-11-28 15:06:02 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'system'
-
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.NAME = $1 LIMIT 1;
Date: 2025-11-28 20:24:02 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'system'
19 701ms 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 #19
Day Hour Count Duration Avg duration 04 176 18ms 0ms 05 176 17ms 0ms 06 176 17ms 0ms 07 176 17ms 0ms 08 176 17ms 0ms 09 176 18ms 0ms 10 176 19ms 0ms 11 176 18ms 0ms 12 176 21ms 0ms 13 176 18ms 0ms 14 176 17ms 0ms 15 176 17ms 0ms 16 176 17ms 0ms 17 176 17ms 0ms 18 176 17ms 0ms 19 176 17ms 0ms 20 176 17ms 0ms 21 176 18ms 0ms 22 176 20ms 0ms 04 176 19ms 0ms 05 176 18ms 0ms 06 176 18ms 0ms 07 176 17ms 0ms 08 176 17ms 0ms 09 176 20ms 0ms 10 176 17ms 0ms 11 176 19ms 0ms 12 176 18ms 0ms 13 176 19ms 0ms 14 176 20ms 0ms 15 176 17ms 0ms 16 176 19ms 0ms 17 176 18ms 0ms 18 176 20ms 0ms 19 176 18ms 0ms 20 176 17ms 0ms 21 176 18ms 0ms 22 176 18ms 0ms [ User: tng_migration_user - Total duration: 454ms - Times executed: 6688 ]
[ Application: [unknown] - Total duration: 454ms - 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-28 11:00:03 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '71', $2 = 'DONE', $3 = 'CLOSED', $4 = 'EXPIRED', $5 = 'EXPIRED_EMPTY', $6 = 't', $7 = '2023-11-15 11:00:01', $8 = '2023-11-25 11: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-29 17:00:04 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '99', $2 = 'DONE', $3 = 'CLOSED', $4 = 'EXPIRED', $5 = 'EXPIRED_EMPTY', $6 = 't', $7 = '2025-11-08 17:00:02', $8 = '2025-11-21 17: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-29 10:00:03 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '97', $2 = 'DONE', $3 = 'CLOSED', $4 = 'EXPIRED', $5 = 'EXPIRED_EMPTY', $6 = 't', $7 = '2025-07-03 10:00:01', $8 = '2025-07-10 10:00:01'
20 608ms 642 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 #20
Day Hour Count Duration Avg duration 06 3 2ms 0ms 07 37 30ms 0ms 08 51 47ms 0ms 09 121 113ms 0ms 10 68 64ms 0ms 11 12 12ms 1ms 12 33 29ms 0ms 13 15 16ms 1ms 14 82 83ms 1ms 17 9 8ms 0ms 18 3 2ms 0ms 19 2 1ms 0ms 20 32 30ms 0ms 21 4 4ms 1ms 05 8 6ms 0ms 10 33 30ms 0ms 11 4 3ms 0ms 12 3 3ms 1ms 13 21 20ms 0ms 15 10 9ms 0ms 16 12 11ms 0ms 17 26 25ms 0ms 18 34 33ms 0ms 19 7 6ms 0ms 20 2 0ms 0ms 21 3 2ms 0ms 22 7 7ms 1ms [ User: tng_migration_user - Total duration: 32ms - Times executed: 642 ]
[ Application: [unknown] - Total duration: 32ms - Times executed: 642 ]
-
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-28 15:23:15 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '1840'
-
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-28 13:51:40 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '14777'
-
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-29 19:15:47 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '15792'
-
Events
Log levels
Key values
- 1,653,997 Event entries
- (EVENTLOG entries are formaly LOG level entries that are not queries)
Events distribution (except queries)
Key values
- 0 PANIC entries
- 34282 FATAL entries
- 0 ERROR entries
- 102 WARNING entries
- 16 EVENTLOG entries
Most Frequent Errors/Events
Key values
- 34,282 Max number of times the same event was reported
- 34,400 Total events found
Rank Times reported Error 1 34,282 FATAL: password authentication failed for user "..."
Times Reported Most Frequent Error / Event #1
Day Hour Count Nov 29 00 1,428 01 1,434 02 1,424 03 1,430 04 1,428 05 1,428 06 1,436 07 1,432 08 1,426 09 1,434 10 1,428 11 1,426 12 1,430 13 1,428 14 1,430 15 1,428 16 1,432 17 1,436 18 1,430 19 1,428 20 1,424 21 1,422 22 1,424 23 1,416 - 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-29 00:00:02 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 29 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 29 01 2 23 14