https://github.com/cqframework/cqf-exercises/blob/master/input/cql/Exercises10Key.cql
The USPSTF recommends annual screening for lung cancer with low-dose computed tomography (LDCT) in adults aged 55 to 80 years who have a 30 pack-year smoking history and currently smoke or have quit within the past 15 years. Screening should be discontinued once a person has not smoked for 15 years or develops a health problem that substantially limits life expectancy or the ability or willingness to have curative lung surgery
USPSTF 建議對55至80歲,曾經有每年抽30包之吸菸史,目前吸菸或在過去15年內戒菸的成年人每年進行一次低劑量電腦斷層掃描(LDCT)肺癌篩檢。一旦一個人15年不吸煙或出現嚴重限制預期壽命或進行治療性肺部手術的能力或意願的健康問題,就應停止篩檢。
Libbrary名稱
使用Model Info
使用外部程式碼
定義Terminilogy
定義value set
定義code
設定context為Patient
基本參數定義:使用CQL Retrieve語法,設定"Patient age in years based on date of birth", "Smoking status observation", "Lung cancer diagnosis"與"Chest CT procedure"四個基本參數。
"55 through 80":年齡範圍為55到80歲
"Most recent smoking status observation":目前吸菸狀況
"Former smoker observation":是否曾經抽菸
"Is current smoker":目前是否抽菸
"Is former smoker who quit within past 15 years":戒菸是否超過15年
"Pack-years":計算每年抽菸的數量(單位:Pack)
"Has 30 pack-year smoking history":是否曾經每年抽30包菸
"Has lung cancer":是否罹患肺癌
"Had chest CT in past year":過去一年內是否做過chest CT,由於Procedure.performed的資料型態為Choice,轉換較為複雜,因此需要呼叫外部函數FHIRCommon.ToInterval()。
"Inclusion Criteria":建議:條件如下:
"Exclusion Criteria":不建議,條件如下:
[Observation: "Tobacco Smoking Status"]
為例,表示要讀取的Observation資料必須滿則Observation.code.coding.code = 72166條件。實際FHIR資料如下:使用https://github.com/cqframework/cqf-exercises/tree/master/input/tests/Exercises10
測試資料可以得到預期的結果。若使用synthea產生合成資料時,"Has 30 pack-year smoking history",這個條件無法驗證,因為synthea並沒有產生對應資料。這一點是值得思考的問題,由於實際FHIR資料並無法保證資料是否完整,因此撰寫CQL時還是必須對既有資料有一定的基本認識。