Data Sources visit drilldown returns an empty visitDurationByType for Achilles 1.7+ results (query still reads analysis 211)

オープン 初心者向け
#2,582 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@DG47 がすでに取り組んでいます。

2026年11月4日 から。

  • #2583 @DG47 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
77/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java, postgresql, sql
領域
api, databases

調査の方向性

src/main/resources/resources/cdmresults/sql/report/visit/drilldown/visitDurationByType.sql と src/main/resources/resources/cdmresults/sql/report/visit/drilldownsummary/visitDurationByType.sql を読みます。どちらも analysis 211 を使って入院期間の分布を絞り込んでいますが、issue によると Achilles 1.7+ では analysis 213 の下に保存されています。関連するクエリのテストやfixtureを確認し、Achilles 1.7+ の結果スキーマに対して両方の visit エンドポイントが分布フィールドを返すことを検証してください。

索引モデルが issue の本文から書いたものです。

説明

Expected behavior

GET /cdmresults/{sourceKey}/visit/{conceptId} (and the drilldown summary GET /cdmresults/{sourceKey}/visit) return the length of stay distribution for the visit concept in visitDurationByType, with minValue, p10Value, p25Value, medianValue, p75Value, p90Value and maxValue.

Actual behavior

visitDurationByType is always an empty array when the results schema was produced by Achilles 1.7.0 or later, even though achilles_results_dist contains the length of stay distribution. The Achilles cache warm-up (AchillesCacheTasklet includes visitDurationByType in the visit domain) caches the empty result.

Cause: Achilles 1.7.0 renumbered "Distribution of length of stay by visit_concept_id" from analysis 211 to analysis 213 (inst/csv/achilles/achilles_analysis_details.csv; in 1.6.3 the line is 211,1,0,,Distribution of length of stay by visit_concept_id,visit_concept_id, in 1.7.0 it is 213,1,,Distribution of length of stay by visit_concept_id,visit_concept_id and 211 became Number of visit records with end date < start date, a count written to achilles_results). Both

  • src/main/resources/resources/cdmresults/sql/report/visit/drilldown/visitDurationByType.sql
  • src/main/resources/resources/cdmresults/sql/report/visit/drilldownsummary/visitDurationByType.sql

still filter achilles_results_dist on analysis_id = 211, which no longer has any rows in that table.

Steps to reproduce behavior
  1. Run Achilles 1.7.x on a CDM that has visit_occurrence records (for example Eunomia) and point a WebAPI source's results daimon at the results schema.
  2. Check that the distribution exists: SELECT analysis_id, stratum_1, median_value FROM <results>.achilles_results_dist WHERE analysis_id IN (211, 213); returns rows for 213 only.
  3. Call GET /WebAPI/cdmresults/<sourceKey>/visit/9201 (Inpatient Visit, or any visit concept present in step 2).
  4. visitDurationByType is []; ageAtFirstOccurrence, prevalenceByMonth and prevalenceByGenderAgeYear are populated.

Environment: WebAPI master (3.0.1-SNAPSHOT) and 2.15.x; Achilles 1.7.0 through 1.7.2; reproduced with the embedded PostgreSQL test database, the query is dialect-independent.

主要言語
Java
スター
153
フォーク
186
平均マージ
2日 14時間
マージ済み PR(30日)
18

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

OHDSI/WebAPI のほかの issue

OHDSI/WebAPI の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。