Add tests for the CalculateAgeAt operators (clinical operators have none)
メンテナーはふだん 5 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 88/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 領域
- testing-qa
調査の方向性
tests/cql/CqlClinicalOperatorsTest.xml で作業し、提案された XML 構造と CalculateAgeAt 式を出発点として使用します。近くにある CQL テストファイルと比較し、新しい clinical-operators 機能がテストスイートで受け入れられることを確認します。完了とは、列挙された precision、birthday、DateTime、null のケースが表現され、検証に合格することです。
索引モデルが issue の本文から書いたものです。
説明
Gap
tests/cql has no test for any operator in Appendix B, section "Clinical Operators": there is no CalculateAge…At expression anywhere in the suite (grep -r CalculateAge tests/cql is empty at 9e92193), and none of the open pull requests adds one. The CalculateAgeAt family is one of the most used operators in real measure logic (every age-band population criterion), and it has its own edge cases (birthday not yet reached in the asOf year, null operands, the coarser-precision uncertainty the specification describes).
Proposal
A new file tests/cql/CqlClinicalOperatorsTest.xml with one group per precision. The values below are for someone born 1976-01-01 as of 2020-01-02: 44 years; 528 months; 16072 days (2296 weeks); 385728 hours, 23143680 minutes, 1388620800 seconds. Following the specification (CQL 1.5.3, Appendix B, "CalculateAgeAt": "if the given birthDate or asOf are not specified to the level of precision corresponding to the operator being invoked, the result will be an uncertainty"), the hour/minute/second cases use full DateTime literals, so their results are single values; the year/month/week/day cases use Date literals, which are precise enough for those precisions.
<?xml version="1.0" encoding="utf-8"?>
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://hl7.org/fhirpath/tests" xsi:schemaLocation="http://hl7.org/fhirpath/tests ../../testSchema/testSchema.xsd"
name="CqlClinicalOperatorsTest" reference="https://cql.hl7.org/09-b-cqlreference.html#clinical-operators-3" version="1.0">
<capability code="clinical-operators" />
<group name="CalculateAgeAt" version="1.0" reference="https://cql.hl7.org/09-b-cqlreference.html#calculateageat">
<capability code="clinical-operators" />
<test name="CalculateAgeInYearsAtSpecExample" version="1.0">
<!-- the specification's own example -->
<expression>CalculateAgeInYearsAt(@2000-01-01, @2015-01-01)</expression>
<output>15</output>
</test>
<test name="CalculateAgeInYearsAt" version="1.0">
<expression>CalculateAgeInYearsAt(@1976-01-01, @2020-01-02)</expression>
<output>44</output>
</test>
<test name="CalculateAgeInYearsAtDayBeforeBirthday" version="1.0">
<!-- the birthday in the asOf year has not been reached -->
<expression>CalculateAgeInYearsAt(@1976-01-02, @2020-01-01)</expression>
<output>43</output>
</test>
<test name="CalculateAgeInYearsAtDateTime" version="1.0">
<expression>CalculateAgeInYearsAt(@1976-01-01T00:00:00.000, @2020-01-02T00:00:00.000)</expression>
<output>44</output>
</test>
<test name="CalculateAgeInYearsAtNullAsOf" version="1.0">
<expression>CalculateAgeInYearsAt(@2000-01-01, null)</expression>
<output>null</output>
</test>
<test name="CalculateAgeInYearsAtNullBirthDate" version="1.0">
<expression>CalculateAgeInYearsAt(null, @2015-01-01)</expression>
<output>null</output>
</test>
<test name="CalculateAgeInMonthsAt" version="1.0">
<expression>CalculateAgeInMonthsAt(@1976-01-01, @2020-01-02)</expression>
<output>528</output>
</test>
<test name="CalculateAgeInWeeksAt" version="1.0">
<expression>CalculateAgeInWeeksAt(@1976-01-01, @2020-01-02)</expression>
<output>2296</output>
</test>
<test name="CalculateAgeInDaysAt" version="1.0">
<expression>CalculateAgeInDaysAt(@1976-01-01, @2020-01-02)</expression>
<output>16072</output>
</test>
<test name="CalculateAgeInHoursAt" version="1.0">
<expression>CalculateAgeInHoursAt(@1976-01-01T00:00:00.000, @2020-01-02T00:00:00.000)</expression>
<output>385728</output>
</test>
<test name="CalculateAgeInMinutesAt" version="1.0">
<expression>CalculateAgeInMinutesAt(@1976-01-01T00:00:00.000, @2020-01-02T00:00:00.000)</expression>
<output>23143680</output>
</test>
<test name="CalculateAgeInSecondsAt" version="1.0">
<expression>CalculateAgeInSecondsAt(@1976-01-01T00:00:00.000, @2020-01-02T00:00:00.000)</expression>
<output>1388620800</output>
</test>
</group>
</tests>
Notes:
clinical-operatorswould be a new capability code; none of the existing codes covers this section.AgeInYearsAtand the otherAge…operators without a birth date need aPatientcontext and a data model, so they are out of reach of this expression-only format; theCalculateAge…Atoverloads exercise the same duration logic without that dependency.- A case where the birth date is 29 February and
asOfis 28 February of a non-leap year would exercise the same rule asYearsBetweenLeapYearDatesEquals2; I left it out to keep this proposal independent of that test.
If the committers prefer a pull request, I can open one with this file.
- 主要言語
- 言語のデータがありません
- スター
- 8
- フォーク
- 9
- 平均マージ
- 4日 2時間
- マージ済み PR(30日)
- 3
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cqframework/cql-tests のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
cqframework/cql-tests#182 ·
メンテナーはふだん 5 日以内に返信
-
CqlComparisonOperatorsTest: NotEquivalentNullNull marks `null !~ null` invalid, where the specification gives it as false対応中かも @leftonmars が 13 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
cqframework/cql-tests#172 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
cqframework/cql-tests#170 ·
メンテナーはふだん 5 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
cqframework/cql-tests#158 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
cqframework/cql-tests#153 · コメント 2 件 ·
メンテナーはふだん 5 日以内に返信
cqframework/cql-tests の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 91/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
hermes hooks doctor smoke test never checks the hook exit code — a crashing hook (exit=1) renders ✓ "ran clean" and "All shell hooks look healthy"対応中かも @cestercian が今日担当しました。 オープンcomp/cli P2 type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
NousResearch/hermes-agent#162259 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信