|
| 1 | + |
| 2 | +/* |
| 3 | + * Library: IMMZD2DTMeaslesDose0 (IMMZ.D2.DT.Measles.MCV dose 0) |
| 4 | + * Rule: Determine if the client is due for a measles vaccination according to the national immunization schedule |
| 5 | + * Decision Table: Measles-containing vaccine dose 0 (MCV0) administration |
| 6 | + * Trigger: IMMZ.D2 Determine required vaccination(s) if any |
| 7 | + */ |
| 8 | +library IMMZD2DTMeaslesDose0 |
| 9 | + |
| 10 | +using FHIR version '4.0.1' |
| 11 | +include FHIRHelpers version '4.0.1' |
| 12 | + |
| 13 | +include IMMZCommon called Common |
| 14 | +include IMMZConcepts called Concepts |
| 15 | + |
| 16 | +include IMMZEncounterElements called IE |
| 17 | +include IMMZD2DTMeaslesEncounterElements called Encounter |
| 18 | + |
| 19 | +parameter Today default Today() |
| 20 | + |
| 21 | +context Patient |
| 22 | + |
| 23 | + |
| 24 | +/* |
| 25 | +@dynamicValue: Guidance |
| 26 | +*/ |
| 27 | +define "Guidance": |
| 28 | + case |
| 29 | + when "Client is not due for MCV0" then "Client is not due for MCV0 Guidance" |
| 30 | + when "Consider MCV0." then "Consider MCV0. Guidance" |
| 31 | + else '' |
| 32 | + end |
| 33 | + |
| 34 | +/* |
| 35 | +@output: Client is not due for MCV0 Case 1 |
| 36 | +@pseudocode: "Immunization recommendation status" = "Not due" |
| 37 | +*/ |
| 38 | +define "Client is not due for MCV0 Case 1": |
| 39 | + IE."Client's age is less than 6 months" |
| 40 | + |
| 41 | +/* |
| 42 | +@output: Client is not due for MCV0 Case 2 |
| 43 | +@pseudocode: "Immunization recommendation status" = "Not due" |
| 44 | +*/ |
| 45 | +define "Client is not due for MCV0 Case 2": |
| 46 | + Encounter."MCV0 was not administered" |
| 47 | + and IE."Client's age is between 6 months and 9 months" |
| 48 | + and IE."Live vaccine was administered in the last 4 weeks" |
| 49 | + |
| 50 | +/* |
| 51 | +@output: Client is not due for MCV0 Case 3 |
| 52 | +@pseudocode: "Immunization recommendation status" = "Not due" |
| 53 | +*/ |
| 54 | +define "Client is not due for MCV0 Case 3": |
| 55 | + IE."Client's age is more than or equal to 9 months" |
| 56 | + |
| 57 | +/* |
| 58 | +@output: Client is not due for MCV0 Case 4 |
| 59 | +@pseudocode: "Immunization recommendation status" = "Not due" |
| 60 | +*/ |
| 61 | +define "Client is not due for MCV0 Case 4": |
| 62 | + Encounter."MCV0 was administered" |
| 63 | + |
| 64 | +/* |
| 65 | +@output: Client is not due for MCV0 |
| 66 | +@pseudocode: "Immunization recommendation status" = "Not due" |
| 67 | +*/ |
| 68 | +define "Client is not due for MCV0": |
| 69 | + "Client is not due for MCV0 Case 1" |
| 70 | + or "Client is not due for MCV0 Case 2" |
| 71 | + or "Client is not due for MCV0 Case 3" |
| 72 | + or "Client is not due for MCV0 Case 4" |
| 73 | + |
| 74 | +/* |
| 75 | +@output: Client is not due for MCV0 Guidance |
| 76 | +@guidance: Should not vaccinate client with MCV0 as client's age is less than 6 months. Check for any vaccines due and inform the caregiver of when to come back for MCV0. |
| 77 | +@guidance: Should not vaccinate client with MCV0 as live vaccine was administered in the past 4 weeks. Check for any vaccines due and inform the caregiver of when to come back for MCV0. |
| 78 | +@guidance: Should not vaccinate client with MCV0 as client's age is more than 9 months. |
| 79 | +Check measles routine immunization schedule. |
| 80 | +@guidance: MCV0 was administered. |
| 81 | +Check measles routine immunization schedule. |
| 82 | +*/ |
| 83 | +define "Client is not due for MCV0 Guidance": |
| 84 | + case |
| 85 | + when "Client is not due for MCV0 Case 1" then 'Should not vaccinate client with MCV0 as client\'s age is less than 6 months. Check for any vaccines due and inform the caregiver of when to come back for MCV0.' |
| 86 | + when "Client is not due for MCV0 Case 2" then 'Should not vaccinate client with MCV0 as live vaccine was administered in the past 4 weeks. Check for any vaccines due and inform the caregiver of when to come back for MCV0.' |
| 87 | + when "Client is not due for MCV0 Case 3" then 'Should not vaccinate client with MCV0 as client\'s age is more than 9 months. |
| 88 | +Check measles routine immunization schedule.' |
| 89 | + when "Client is not due for MCV0 Case 4" then 'MCV0 was administered. |
| 90 | +Check measles routine immunization schedule.' |
| 91 | + else '' |
| 92 | + end |
| 93 | + |
| 94 | +/* |
| 95 | +@output: Consider MCV0. |
| 96 | +@pseudocode: Create a clinical note. |
| 97 | +*/ |
| 98 | +define "Consider MCV0.": |
| 99 | + Encounter."MCV0 was not administered" |
| 100 | + and IE."Client's age is between 6 months and 9 months" |
| 101 | + and IE."No live vaccine was administered in the last 4 weeks" |
| 102 | + |
| 103 | +/* |
| 104 | +@output: Consider MCV0. Guidance |
| 105 | +@guidance: May vaccinate client with MCV0 as client is within appropriate age range, MCV0 was not administered and no live vaccine was administered in the past 4 weeks. Check if one of the MCV0 specific scenarios is applicable. |
| 106 | +*/ |
| 107 | +define "Consider MCV0. Guidance": |
| 108 | + 'May vaccinate client with MCV0 as client is within appropriate age range, MCV0 was not administered and no live vaccine was administered in the past 4 weeks. Check if one of the MCV0 specific scenarios is applicable.' |
| 109 | + |
| 110 | + |
| 111 | +/* |
| 112 | +@test: Test expected results based on example patients |
| 113 | +*/ |
| 114 | +define "Test Validation": |
| 115 | + case |
| 116 | + when Patient.id = '36.Alt6m' then "Client is not due for MCV0 Case 1" and "Guidance" = 'Should not vaccinate client with MCV0 as client\'s age is less than 6 months. Check for any vaccines due and inform the caregiver of when to come back for MCV0.' |
| 117 | + when Patient.id = '37.Abt6m9mLVlt4w' then "Client is not due for MCV0 Case 2" and "Guidance" = 'Should not vaccinate client with MCV0 as live vaccine was administered in the past 4 weeks. Check for any vaccines due and inform the caregiver of when to come back for MCV0.' |
| 118 | + when Patient.id = '38.Abt6m9mLVgt4w' then "Consider MCV0." and "Guidance" = 'May vaccinate client with MCV0 as client is within appropriate age range, MCV0 was not administered and no live vaccine was administered in the past 4 weeks. Check if one of the MCV0 specific scenarios is applicable.' |
| 119 | + when Patient.id = '39.Agt9m' then "Client is not due for MCV0 Case 3" and "Guidance" = 'Should not vaccinate client with MCV0 as client\'s age is more than 9 months. |
| 120 | +Check measles routine immunization schedule.' |
| 121 | + when Patient.id = '40.D1' then "Client is not due for MCV0 Case 4" and "Guidance" = 'MCV0 was administered. |
| 122 | +Check measles routine immunization schedule.' |
| 123 | + else 'No test case set' |
| 124 | + end |
0 commit comments