...
Code Block | ||
---|---|---|
| ||
openEHR-ELOM.breast_cancer_treatment.v1 language original_language = <[ISO_639-1::en]> description lifecycle_state = <"unmanaged"> original_author = <...> use_model org.openehr.rm data_context in $cancer_diagnosis: Terminology_code in $has_metastasis, $er_positive, $pr_positive, $her2_positive: Boolean in $ki67: Real in $tnm_t, $tnm_n, $tnm_g: String in $has_dx_transmural_mi, $hs_dx_hf_stage_2_4, $has_dx_severe_diabetes: Boolean in $ejection_fraction: Real out $recommendation: String preconditions $cancer_diagnosis = [ICD_10::C50|Breast cancer|] definition tumor_molecular_subtype (is_er_positive, is_pr_positive, is_her2_positive: Boolean; ki67_level: Real): Terminology_code { if is_er_positive and not is_her2_positive and ki67_level < 0.20 then return [1111|luminal A|] elseif is_er_positive and not is_her2_positive and ki67_level >= 0.20 then return [2222|Luminal B (HER2 negative)|] elseif is_er_positive and is_her2_positive then return [3333|Luminal B (HER2 positive)|] elseif not is_er_positive and not is_pr_positive and is_her2_positive then return [4444|HER2|] elseif not is_er_positive and not is_pr_positive and not is_her2_positive then return [55555|Triple negative|] } has_contraindications_to_anthracyclines(): Boolean { return $has_dx_transmural_mi or $ejection_fraction < 0.4 or $hs_dx_hf_stage_2_4 } chemo_1_recommendation (): Message { -- RECOMMENDATION -- consider contraindications to anthracyclines if has_contraindications_to_anthracyclines() then return Recommend_cmf_message else -- RECOMMENDATION if $has_critical_cardio_pathology or $age > 75 then return Recommend_apirubicin_cycloPosphamide_message else return Recommend_ac_message end end } chemo_2_recommendation (): Message { -- RECOMMENDATION if $has_dx_severe_diabetes or $allergic_to_taxanes or $has_taxane_intolerance then if has_contraindications_to_anthracyclines() then return Recommend_dc_message else -- CHOICE return [Recommend_ac4p4_message, Recommend_ac4p12_message, Recommend_ac4d4_message] end else -- RECOMMENDATION return chemo_1_recommendation () end } -- REQUIRED if $has_metastasis then -- Luminal A if tumor_molecular_subtype ($er_positive, $pr_positive, $her2_positive, $ki67) = [1111|luminal A|] then -- Luminal B (HER2 negative) elseif tumor_molecular_subtype ($er_positive, $pr_positive, $her2_positive, $ki67) = [2222|Luminal B (HER2 negative)|] then -- Luminal B (HER2 positive) elseif tumor_molecular_subtype ($er_positive, $pr_positive, $her2_positive, $ki67) = [3333|Luminal B (HER2 positive)|] then -- HER2 type elseif tumor_molecular_subtype ($er_positive, $pr_positive, $her2_positive, $ki67) = [4444|HER2|] then -- Triple negative elseif tumor_molecular_subtype ($er_positive, $pr_positive, $her2_positive, $ki67) = [55555|Triple negative|] then end else -- REQUIRED -- Luminal A if tumor_molecular_subtype ($er_positive, $pr_positive, $her2_positive, $ki67) = [1111|luminal A|] then -- REQUIRED if tnm_major_number ($tnm_t) < 3 and tnm_major_number ($tnm_n) < 2 and tnm_major_number ($tnm_g) < 3 then $recommendation := No_intervention_message else -- RECOMMENDATION $recommendation := chemo_1_recommendation () end -- Luminal B (HER2 negative) elseif tumor_molecular_subtype ($er_positive, $pr_positive, $her2_positive, $ki67) = [2222|Luminal B (HER2 negative)|] then -- REQUIRED if $tnm_t = "1a" and tnm_major_number ($tnm_n) = 0 then $recommendation := No_intervention_message else -- RECOMMENDATION $recommendation := chemo_2_recommendation () end -- Luminal B (HER2 positive) elseif tumor_molecular_subtype ($er_positive, $pr_positive, $her2_positive, $ki67) = [3333|Luminal B (HER2 positive)|] then -- REQUIRED if $tnm_t = "1a" and tnm_major_number ($tnm_n) = 0 then $recommendation := No_intervention_message elseif $tnm_t matches {"T1b", "T1c"} and tnm_major_number ($tnm_n) = 0 then elseif tnm_major_number ($tnm_t) matches {|2..4|} and tnm_major_number ($tnm_n) > 0 then else end -- HER2 type elseif tumor_molecular_subtype ($er_positive, $pr_positive, $her2_positive, $ki67) = [4444|HER2|] then -- REQUIRED if $tnm_t = "1a" and tnm_major_number ($tnm_n) = 0 then $recommendation := No_intervention_message elseif $tnm_t matches {"T1b", "T1c"} and tnm_major_number ($tnm_n) = 0 then elseif tnm_major_number ($tnm_t) matches {|2..4|} and tnm_major_number ($tnm_n) > 0 then else end -- Triple negative elseif tumor_molecular_subtype ($er_positive, $pr_positive, $her2_positive, $ki67) = [55555|Triple negative|] then -- REQUIRED if $tnm_t = "1a" and tnm_major_number ($tnm_n) = 0 then $recommendation := No_intervention_message elseif tnm_major_number ($tnm_t) > 1 and tnm_major_number ($tnm_n) > 0 then -- RECOMMENDATION $recommendation := chemo_2_recommendation () end end user_alert ($recommendation) end terminology symbol_definitions = < ["en"] = < ["er_positive"] = < text = <"Oestrogen receptor positive"> description = <"Oestrogen receptor positive"> > > > data_bindings content_bindings = < ["openEHR-EHR-OBSERVATION.cancer_investigation.v1"] = < ["er_positive"] = < target = <"/data/events[id3]/data/items[id5]/value/magnitude"> direction = <"in"> > > query_bindings = < ["https://oncology.health.org/cdr/"] = < ["has_dx_transmural_mi"] = < query_id = <"dx_transmural_mi">, parameters = < ["$type"] = <"'xxx'"> > > > > |
...