Patient profile returns a server error for a person with observation periods but no clinical records
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 75/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- java, postgresql, spring-boot
调研方向
从 PersonService.java:156 的 PersonService.getPersonProfile 开始,这里会选择索引日期并用它计算观察期偏移量。使用一个有观察期但没有事件记录的人来重现此问题,分别测试不指定 cohort,以及指定一个该人不属于的 cohort。完成标准是两种请求都返回包含空记录列表和有效偏移量的个人资料,而不是 HTTP 500。
由索引模型根据 Issue 内容生成。
描述
Expected behavior
GET /{sourceKey}/person/{personId} returns the profile (demographics and observation periods, with an empty record list) for any person in the CDM. Its documentation says day offsets are relative to the cohort start date or the initial date of observation.
Actual behavior
When the person has at least one observation_period row but no rows in any of the record tables the profile reads (drug_exposure, drug_era, condition_occurrence, condition_era, observation, visit_occurrence, death, measurement, device_exposure, procedure_occurrence, specimen), the request fails with:
java.lang.NullPointerException: Cannot invoke "java.time.temporal.Temporal.until(java.time.temporal.Temporal, java.time.temporal.TemporalUnit)" because "temporal1Inclusive" is null
at org.ohdsi.webapi.person.PersonService.getPersonProfile(PersonService.java:156)
getPersonProfile takes the index date from the requested cohort's start, or else from the earliest record. With no records and no matching cohort entry, the index date stays null, and ChronoUnit.DAYS.between(null, ...) for the observation period offsets throws. This happens:
- with
/{sourceKey}/person/{personId}(nocohortparameter), for example an enrollee with coverage but no claims, which is common in claims-based CDMs; - with
?cohort={id}when the person is not in that cohort.
People in the requested cohort are not affected, because the cohort start date is used.
Steps to reproduce
On a Postgres CDM:
insert into cdm.person (person_id, gender_concept_id, year_of_birth, ...) values (1, 8532, 1970, ...);
insert into cdm.observation_period (observation_period_id, person_id, observation_period_start_date,
observation_period_end_date, period_type_concept_id) values (10, 1, '2019-01-01', '2019-12-31', 32813);
-- no rows for person 1 in the event tables
then GET /WebAPI/{sourceKey}/person/1, or open #/profiles/{sourceKey}/1 in ATLAS. Result: HTTP 500 with the NullPointerException above.
Versions
WebAPI master (89de588d, JDK 21 / Spring Boot 3), Postgres CDM. The index date code is unchanged from 2.x, so earlier releases behave the same.
- 主要语言
- Java
- 星标
- 153
- 派生
- 186
- 平均合并
- 2 天 19 小时
- 30 天内合并 PR
- 19
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
OHDSI/WebAPI 的其他 Issue
-
Cohort sample with age "not between" includes people from other cohorts and ignores the gender filter可能已有人在做 @DG47 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
CDM cache warming issues one record-count query per concept on Snowflake, Spark and BigQuery (getConceptsForBatch.sql relies on integer division)可能已有人在做 @DG47 于 1 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 66/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 67/100
维护者通常 1 天内回复
相似的 Issue
-
Test: Verify vault unlock max failed attempts and PIN brute-force protection可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 66/100
wultra/powerauth-tests#980 ·
-
Communication: Removing a link preview does nothing for some links可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭account bug communication lecture
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
line/centraldogma#1397 ·
维护者通常 2 天内回复
-
[Bug]: Fixed/recurring deposit accounts are treated as savings in ownership and listings可能已有人在做 @Aana123 今天认领。 未关闭bug Triage
难度 2/5 1-3 小时 新手友好度 76/100
apache/fineract-consumer-facing#252 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 76/100
ShaftHQ/SHAFT_ENGINE#7946 ·
维护者通常 1 天内回复