-18539 |
+18513 |
452 |
1932-09-15 |
160 days |
@@ -2820,15 +2820,15 @@ Plot the phenotype for a random patient
random_patient <- sample(ami_obese_patients, 1)
message('Sampled patient: ', random_patient)
-#> Sampled patient: 593
+#> Sampled patient: 13542
ami_obese |>
select(
-height_value_as_number,
-ami_condition_start_datetime) |>
phea_plot(pid = random_patient)
#> Collecting lazy table, done. (turn this message off with `verbose = FALSE`)
-
-
+
+
Obtain the SQL query that computes the phenotype
@@ -2889,19 +2889,19 @@ Obtain the SQL query that computes the phenotype
row_number() over () AS "row_id",
"pid",
"ts",
- last_value(case when "name" = 'n369g28ybive' then "value_as_number" else null end) over (partition by "pid", "name" order by "ts" rows between unbounded preceding and 0 preceding) AS "weight_value_as_number",
- last_value(case when "name" = 'n369g28ybive' then "ts" else null end) over (partition by "pid", "name" order by "ts" rows between unbounded preceding and 0 preceding) AS "weight_ts",
- last_value(case when "name" = 'tq1tnz9b0pus' then "value_as_number" else null end) over (partition by "pid", "name" order by "ts" rows between unbounded preceding and 0 preceding) AS "height_value_as_number",
- last_value(case when "name" = 'tq1tnz9b0pus' then "ts" else null end) over (partition by "pid", "name" order by "ts" rows between unbounded preceding and 0 preceding) AS "height_ts",
- last_value(case when "name" = 'tzu6rfq23ybj' then "condition_start_datetime" else null end) over (partition by "pid", "name" order by "ts" rows between unbounded preceding and 0 preceding) AS "ami_condition_start_datetime",
- last_value(case when "name" = 'tzu6rfq23ybj' then "ts" else null end) over (partition by "pid", "name" order by "ts" rows between unbounded preceding and 0 preceding) AS "ami_ts"
+ last_value(case when "name" = 'zdmaw29y5loz' then "value_as_number" else null end) over (partition by "pid", "name" order by "ts" rows between unbounded preceding and 0 preceding) AS "weight_value_as_number",
+ last_value(case when "name" = 'zdmaw29y5loz' then "ts" else null end) over (partition by "pid", "name" order by "ts" rows between unbounded preceding and 0 preceding) AS "weight_ts",
+ last_value(case when "name" = 'a5pacry4bien' then "value_as_number" else null end) over (partition by "pid", "name" order by "ts" rows between unbounded preceding and 0 preceding) AS "height_value_as_number",
+ last_value(case when "name" = 'a5pacry4bien' then "ts" else null end) over (partition by "pid", "name" order by "ts" rows between unbounded preceding and 0 preceding) AS "height_ts",
+ last_value(case when "name" = 'p9vkjohxu25t' then "condition_start_datetime" else null end) over (partition by "pid", "name" order by "ts" rows between unbounded preceding and 0 preceding) AS "ami_condition_start_datetime",
+ last_value(case when "name" = 'p9vkjohxu25t' then "ts" else null end) over (partition by "pid", "name" order by "ts" rows between unbounded preceding and 0 preceding) AS "ami_ts"
FROM (
(
SELECT *, NULL AS "condition_start_datetime"
FROM (
(
SELECT
- 'n369g28ybive' AS "name",
+ 'zdmaw29y5loz' AS "name",
"person_id" AS "pid",
"measurement_datetime" AS "ts",
"value_as_number"
@@ -2911,7 +2911,7 @@ Obtain the SQL query that computes the phenotype
UNION ALL
(
SELECT
- 'tq1tnz9b0pus' AS "name",
+ 'a5pacry4bien' AS "name",
"person_id" AS "pid",
"measurement_datetime" AS "ts",
"value_as_number"
@@ -2930,7 +2930,7 @@ Obtain the SQL query that computes the phenotype
"condition_start_datetime"
FROM (
SELECT
- 'tzu6rfq23ybj' AS "name",
+ 'p9vkjohxu25t' AS "name",
"person_id" AS "pid",
"condition_start_datetime" AS "ts",
"condition_start_datetime"