Skip to content

Commit

Permalink
Merge pull request #41 from CEOsys/feat/ext-relative-time
Browse files Browse the repository at this point in the history
Feat/ext relative time
  • Loading branch information
glichtner authored May 22, 2024
2 parents fa3ad01 + 2a0aed1 commit 592a9e0
Show file tree
Hide file tree
Showing 17 changed files with 254 additions and 0 deletions.
32 changes: 32 additions & 0 deletions input/data/ig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,13 @@ definition:
- https://www.netzwerk-universitaetsmedizin.de/fhir/cpg-on-ebm-on-fhir/StructureDefinition/outcome-evidence-synthesis
reference:
reference: Evidence/ExampleOutcomeEvidenceSynthesis
- description: Example of a procedure action.
isExample: true
name: Example Procedure Action
profile:
- https://www.netzwerk-universitaetsmedizin.de/fhir/cpg-on-ebm-on-fhir/StructureDefinition/procedure-action
reference:
reference: ActivityDefinition/ExampleProcedureAction
- description: Example of a Citation of a clinical practice guideline recommendation
isExample: true
name: Example Recommendation Citation
Expand Down Expand Up @@ -606,6 +613,11 @@ definition:
name: Intervention Definition
reference:
reference: StructureDefinition/intervention-definition
- description: Klassifizierung eines Kontaktes mit einer Gesundheitseinrichtung
isExample: false
name: KontaktArtDe
reference:
reference: CodeSystem/KontaktArtDe
- description: Most important
isExample: false
name: Laboratory Observations
Expand Down Expand Up @@ -651,6 +663,11 @@ definition:
- https://www.netzwerk-universitaetsmedizin.de/fhir/cpg-on-ebm-on-fhir/StructureDefinition/recommendation-justification
reference:
reference: ArtifactAssessment/NoDexamethasoneRecommendationJustification
- description: Observable Entities from SNOMED CT
isExample: false
name: Observations SCT
reference:
reference: ValueSet/vs-observations-sct
- description: Description of the outcome element of a PICO construct that evidence
is about.
isExample: false
Expand Down Expand Up @@ -691,6 +708,16 @@ definition:
- https://www.netzwerk-universitaetsmedizin.de/fhir/cpg-on-ebm-on-fhir/StructureDefinition/recommendation-eligibility-criteria
reference:
reference: EvidenceVariable/PopulationCOVID19Ventilated
- description: Definition of a procedure action.
isExample: false
name: Procedure Action
reference:
reference: StructureDefinition/procedure-action
- description: Procedures
isExample: false
name: Procedures
reference:
reference: ValueSet/vs-procedures
- description: The quality of the evidence described. The code system used specifies
the quality scale used to grade this evidence source while the code specifies
the actual quality score (represented as a coded value) associated with the
Expand Down Expand Up @@ -818,6 +845,11 @@ definition:
name: Relative Effect Type
reference:
reference: ValueSet/vs-relative-effect-type
- description: Timing in which the characteristic is determined.
isExample: false
name: RelativeTime
reference:
reference: StructureDefinition/relative-time
- description: Enforces the minimum information set for the plan definition metadata
required by HL7 and other organizations that share and publish plan definitions
isExample: false
Expand Down
1 change: 1 addition & 0 deletions input/fsh/eligibility-criteria/p-eligibility-criteria.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Description: "Definition of a population (e.g. for guideline recommendation, cli

RuleSet: characteristic-definition
* characteristic 1..* MS
* extension contains RelativeTime named relativeTime 0..*
* characteristic ^slicing.discriminator.type = #pattern
* characteristic ^slicing.discriminator.path = "definitionByTypeAndValue.type"
* characteristic ^slicing.rules = #open
Expand Down
31 changes: 31 additions & 0 deletions input/fsh/ext-relative-time.fsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Extension: RelativeTime
Id: relative-time
Description: "Timing in which the characteristic is determined."
* ^context[0].type = #element
* ^context[0].expression = "EvidenceVariable.characteristic"
* ^context[1].type = #element
* ^context[1].expression = "PlanDefinition.action"
* ^context[2].type = #element
* ^context[2].expression = "ActivityDefinition"
* value[x] 0..0
* . ^short = "Timing in which the characteristic is determined"
* . ^definition = "Timing in which the characteristic is determined."
* extension contains contextReference 0..1 and contextDefinition 0..1 and contextPath 0..1 and contextCode 0..1 and offset 0..1 and text 0..1
* extension[contextReference].value[x] only Reference
* ^short = "The specific event occurrence or resource context used as a base point (reference point) in time"
* ^definition = "The specific event occurrence or resource context used as a base point (reference point) in time. This establishes the context in which the path is evaluated."
* extension[contextDefinition].value[x] only canonical
* ^short = "The type of event used as a base point"
* ^definition = "The type of event used as a base point. Instances of this definition will establish the context for evaluating the path to determine the base time for the offset."
* extension[contextPath].value[x] only string
* ^short = "Path to the element defining the point in time"
* ^definition = "Path to the element defining the point in time. Any valid FHIRPath expression."
* extension[contextCode].value[x] only CodeableConcept
* ^short = "Coded representation of the event used as a base point (reference point) in time"
* ^definition = "Coded representation of the event used as a base point (reference point) in time."
* extension[offset].value[x] only Duration or Range
* ^short = "An offset or offset range before (negative values) or after (positive values) the event"
* ^definition = "An offset or offset range before (negative values) or after (positive values) the event. Range is limited to time-valued quantities (Durations)."
* extension[text].value[x] only string
* ^short = "aFree-text description"
* ^definition = "Free-text (human-readable) description."
33 changes: 33 additions & 0 deletions input/fsh/intervention/actions/p-procedure-action.fsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Author: Gregor Lichtner @glichtner
Profile: ProcedureAction
Parent: RecommendationAction
Id: procedure-action
Title: "Procedure Action"
Description: "Definition of a procedure action."
* insert metadata(2024-05-22, #draft, 0.1.0)
* kind = $cs-fhir-types#ServiceRequest "ServiceRequest"
* code 1..1
* code from vs-procedures (required)
* timingTiming 1..1
* product[x] 0..0
* dosage 0..0
* quantity 0..0

Instance: ExampleProcedureAction
InstanceOf: procedure-action
Usage: #example
Title: "Example Procedure Action"
Description: "Example of a procedure action."
* name = "ExampleProcedureAction"
* version = "1.0"
* experimental = true
* publisher = "CPGonEBMonFHIR"
* description = "Example of a procedure action."
* timingTiming
* repeat
* frequency = 1
* period = 1
* periodUnit = #d "d"
* status = #active
* insert canonical-url(example/recommendation-action/procedure-example)
* code = $sct-int#172703006 "Destruction of lesion of middle ear (procedure)"
1 change: 1 addition & 0 deletions input/fsh/intervention/actions/p-recommendation-action.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Description: "Definition of an activity that is part of an intervention in the c
* timingTiming
* insert timing-restrictions
* timingTiming.repeat 1..1 MS
* extension contains RelativeTime named relativeTime 0..*
* product[x] MS
* quantity MS
* dosage MS
Expand Down
8 changes: 8 additions & 0 deletions input/fsh/intervention/actions/vs-procedures.fsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Author: Gregor Lichtner @glichtner
ValueSet: Procedures
Id: vs-procedures
Title: "Procedures"
Description: "Procedures"
* insert metadata(2024-05-22, #draft, 0.1.0)
* insert cpg-computable-valueset
* include codes from system $sct-int where concept is-a #71388002 "Procedure (procedure)"
5 changes: 5 additions & 0 deletions input/fsh/intervention/p-recommendation-plan.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,15 @@ RuleSet: rs-action-slices
sedationManagement 0..* and
painManagement 0..* and
assessment 0..* and
procedure 0..* and
other 0..*
//* selectionBehavior from vs-action-selection-behavior-required (required)
* action
* code 1..1 MS
* coding 1..*
* system 1..
* code 1..
* extension contains RelativeTime named timingRelativeTime 0..*
* action[combination]
* code = $sct#89780004 "Combined (qualifier value)"
* goalId 0..0
Expand Down Expand Up @@ -133,6 +135,9 @@ RuleSet: rs-action-slices
* insert rs-action-goal-definition-binding
* code = $sct#386053000 "Evaluation procedure (procedure)"
* definitionCanonical only Canonical(AssessmentAction)
* action[procedure]
* code = $sct#71388002 "Procedure (procedure)"
* definitionCanonical only Canonical(ProcedureAction)
* action[other]
* code = $sct#74964007 "Other (qualifier value)"
* insert rs-action-goal-definition-binding
Expand Down
17 changes: 17 additions & 0 deletions input/fsh/rs-timing.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,20 @@ RuleSet: timing-restrictions
* code 0..1 // This element can be expressed using the timing.repeat element, which is far more flexible, and we don't want to have double coding
* repeat 0..1 MS
* bounds[x] 0..0
* count
* ^short = "Minimal number of times this event should be repeated"
* countMax
* ^short = "Maximum number of times this event should be repeated"
* duration
* ^short = "Minimal duration this event should last"
* durationMax
* ^short = "Maximal duration this event should last"
* frequency
* ^short = "Indicates the minimal number of repetitions that should occur within a period. I.e. Event occurs frequency times per period"
* frequencyMax
* ^short = "Indicates the maximum number of repetitions that should occur within a period. I.e. Event occurs frequency times per period"
* period
* ^short = "The minimal duration to which the frequency applies. I.e. Event occurs frequency times per period"
* periodMax
* ^short = "The maximum duration to which the frequency applies. I.e. Event occurs frequency times per period"

1 change: 1 addition & 0 deletions input/includes/categories-intervention.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ The categories are defined as slices of the `action` element in the [Recommendat
| Sedation Management | sedationManagement | assessmentScale | n/a |
| Pain Management | painManagement | assessmentScale | n/a |
| Assessment | assessment | any | [Assessment Action][SD:Assessment Action] |
| Procedure | procedure | <center>❌ *not required* </center> | [Procedure Action][SD:Procedure Action] |
| Any other / Custom | other | <center>❌ *not required* </center> | *n/a* |
{:.grid}

Expand Down
77 changes: 77 additions & 0 deletions input/includes/datatype-timing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#### Timing Datatype Interpretation Modifications

This Implementation guide has a modified interpretation of the `Timing` datatype. Specifically, fields that have corresponding "Max" fields (`count`, `duration`, `frequency`, `period`) are now interpreted as minimum values. To specify an exact value, the base field and its corresponding `Max` field must be set to the same value.

These changes pertain to the following profiles / elements:

- [RecommendationEligibilityCriteria.characteristic][SD:Recommendation Eligibility Criteria]
- [RecommendationAction][SD:Recommendation Action]
- [RecommendationPlan.action][SD:Recommendation Plan]


**Changes to Timing Datatype**

| Field | Description | Example |
|--------------|-------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------|
| count | **Minimal number of times this event should be repeated.** | `count: 2` means the event should occur at least 2 times. |
| countMax | **Maximum number of times this event should be repeated.** | `countMax: 5` means the event should occur no more than 5 times. |
| duration | **Minimal duration this event should last.** | `duration: 1` (assuming units are hours) means the event should last at least 1 hour. |
| durationMax | **Maximal duration this event should last.** | `durationMax: 3` (assuming units are hours) means the event should last no more than 3 hours. |
| frequency | **Indicates the minimal number of repetitions that should occur within a period.** | `frequency: 1` means the event should occur at least once per period. |
| frequencyMax | **Indicates the maximum number of repetitions that should occur within a period.** | `frequencyMax: 4` means the event should occur no more than four times per period. |
| period | **The minimal duration to which the frequency applies.** | `period: 1` (assuming units are days) means the frequency applies to at least 1 day. |
| periodMax | **The maximum duration to which the frequency applies.** | `periodMax: 7` (assuming units are days) means the frequency applies to no more than 7 days. |
{:.grid}

**Examples**

* Example 1: Exact number of Occurrences
```json
{
"repeat": {
"count": 2,
"countMax": 2
}
}
```
- This indicates the event should occur exactly 2 times.

* Example 2: Occurrences Range
```json
{
"repeat": {
"count": 2,
"countMax": 5
}
}
```
- This indicates the event should occur at least 2 times but no more than 5 times.

* Example 3: Minimal Duration
```json
{
"repeat": {
"duration": 1,
"durationUnit": "h"
}
}
```
- This indicates the event should last one **or more** hours.

* Example 4: Maximal duration
```json
{
"repeat": {
"durationMax": 2,
"durationUnit": "h"
}
}
```
- This indicates the event should last no more than two hours.

**Implementation Notes**

- Ensure that when setting the exact value, both the base field and its corresponding "Max" field are set to the same value.
- These changes aim to provide more flexibility and clarity in specifying the timing and frequency of events, ensuring that minimal and maximal constraints are clear to implementers.

{% include link-list.md %}
5 changes: 5 additions & 0 deletions input/includes/link-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
[VS:Guideline Stage Classification]: ValueSet-vs-guideline-stage-classification.html
[VS:Laboratory Observations]: ValueSet-vs-laboratory-observations.html
[VS:Mean Difference Type]: ValueSet-vs-mean-difference-type.html
[VS:Observations SCT]: ValueSet-vs-observations-sct.html
[VS:Procedures]: ValueSet-vs-procedures.html
[VS:Radiologic Finding SCT]: ValueSet-vs-radiologic-finding-sct.html
[VS:Rating Acceptability]: ValueSet-vs-rating-acceptability.html
[VS:Rating Benefit And Harms]: ValueSet-vs-rating-benefit-and-harms.html
Expand All @@ -40,6 +42,7 @@
[CS:Evidence To Decision Certainty Rating]: CodeSystem-cs-evidence-to-decision-certainty-rating.html
[CS:Evidence To Decision Certainty type]: CodeSystem-cs-evidence-to-decision-certainty-type.html
[CS:Guideline Stage Classification]: CodeSystem-cs-guideline-stage-classification.html
[CS:KontaktArtDe]: CodeSystem-KontaktArtDe.html
[CS:Recommendation Strength]: CodeSystem-ceosys-cs-recommendation-strength.html
[CS:SynthesisType]: CodeSystem-synthesis-type.html

Expand Down Expand Up @@ -69,13 +72,15 @@
[SD:Outcome Evidence]: StructureDefinition-outcome-evidence.html
[SD:Outcome Evidence Synthesis]: StructureDefinition-outcome-evidence-synthesis.html
[SD:PICO Evidence Variable]: StructureDefinition-pico-evidence-variable.html
[SD:Procedure Action]: StructureDefinition-procedure-action.html
[SD:qualityOfEvidence]: StructureDefinition-cqf-qualityOfEvidence.html
[SD:Recommendation]: StructureDefinition-recommendation.html
[SD:Recommendation Action]: StructureDefinition-recommendation-action.html
[SD:Recommendation Citation]: StructureDefinition-recommendation-citation.html
[SD:Recommendation Eligibility Criteria]: StructureDefinition-recommendation-eligibility-criteria.html
[SD:Recommendation Justification]: StructureDefinition-recommendation-justification.html
[SD:Recommendation Plan]: StructureDefinition-recommendation-plan.html
[SD:RelativeTime]: StructureDefinition-relative-time.html
[SD:Shareable PlanDefinition]: StructureDefinition-shareableplandefinition.html
[SD:strengthOfRecommendation]: StructureDefinition-cqf-strengthOfRecommendation.html
[SD:Study Citation]: StructureDefinition-study-citation.html
Expand Down
15 changes: 15 additions & 0 deletions input/intro-notes/StructureDefinition-procedure-action-intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{% include variables.md %}
{% assign id = {{include.id}} %}
{% assign resource = site.data.structuredefinitions.[id] %}

### Guidance



{% capture resource_inheritance %}
This profile of a FHIR {{resource.type}} is derived from the [{{resource.base | split: '/' | last}}]({{resource.base}}) FHIR resource.
{% endcapture %}

{{ resource_inheritance | strip_newlines }}

{% include link-list.md %}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ The actions defined using this profile are combined to a plan using the [Recomme
The following profiles are used to define specific actions:
* [Body Positioning Action][SD:Body Positioning Action] - for describing the action of positioning a patient
* [Drug Administration Action][SD:Drug Administration Action] - for describing the action of administering a drug
* [Assessment Action][SD:Assessment Action] - for describing the action of assessing a patient
* [Procedure Action][SD:Procedure Action] - for describing the action of performing a procedure

The [RelativeTime][SD:RelativeTime] datatype can be used via the [RelativeTime extension][SD:RelativeTime] to define the timing of the action.

{% include datatype-timing.md %}

{% include fhir-structure-detailed.md name='08-intervention-activity' alt='FHIR Intervention Activity' %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ This resource is used to define the eligibility criteria for a specific [Recomme

{% include categories-population.md %}

The [RelativeTime][SD:RelativeTime] datatype can be used via the [RelativeTime extension][SD:RelativeTime] on the `characteristic` field to define the timing of the action.

{% capture resource_inheritance %}
This profile of a FHIR {{resource.type}} is derived from the [{{resource.base | split: '/' | last}}]({{resource.base}}) FHIR resource.
{% endcapture %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ The actions to be performed are specified using the [Recommendation Action][SD:R

{% include categories-intervention.md %}

The [RelativeTime][SD:RelativeTime] datatype can be used via the [RelativeTime extension][SD:RelativeTime] on the `action` field to define the timing of the action.

{% include fhir-structure-detailed.md name='07-intervention-plan' alt='FHIR Intervention Plan' %}

{% capture resource_inheritance %}
Expand Down
15 changes: 15 additions & 0 deletions input/intro-notes/StructureDefinition-relative-time-intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{% include variables.md %}
{% assign id = {{include.id}} %}
{% assign resource = site.data.structuredefinitions.[id] %}

### Guidance

This extension allows the use of the FHIR R6 [RelativeTime Datatype](https://build.fhir.org/datatypes.html#RelativeTime) in the context of the CPG-on-EBM-on-FHIR project.

The extension can be used in the following places:

- [`RecommendationEligibilityCriteria.characteristic`][SD:Recommendation Eligibility Criteria]
- [`RecommendationAction`][SD:Recommendation Action]
- [`RecommendationPlan.action`][SD:Recommendation Plan]

{% include link-list.md %}
3 changes: 3 additions & 0 deletions input/pagecontent/profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
{% include profile-reference.md name='Recommendation Action' %}
{% include profile-reference.md name='Drug Administration Action' %}
{% include profile-reference.md name='Body Positioning Action' %}
{% include profile-reference.md name='Assessment Action' %}
{% include profile-reference.md name='Procedure Action' %}


#### Studies
{% include profile-reference.md name='Intervention Definition' %}
Expand Down

0 comments on commit 592a9e0

Please sign in to comment.