Stream: implementers
Topic: RequestGroup action offsets not relative
Kyle Thompson (Jan 06 2022 at 23:03):
What is the best way to capture offsets of related actions in RequestGroups that aren't relative?
For example, I would like to say, "after completing action A, do action B after 8am the next day".
Lloyd McKenzie (Jan 06 2022 at 23:18):
@Bryn Rhodes
Kyle Thompson (Jan 11 2022 at 18:53):
The solution I am considering is to create new units to use in offsetRange which represents what I need. For example, "1 <need unit name>" would represent the next 8am, "2 <need unit name>" would represent the next next 8am, and so on.
Lloyd McKenzie (Jan 11 2022 at 21:19):
I wouldn't encourage that. It's not really what units are for.
Kyle Thompson (Jan 11 2022 at 21:41):
Because the unit system I am thinking of defining isn't in UCUM?
Lloyd McKenzie (Jan 11 2022 at 21:56):
A unit is a type of measurement. "next 8am" isn't a type of measurement.
Kyle Thompson (Jan 11 2022 at 22:26):
Sorry for my confusion on this topic. Is "age" considered a unit in FHIR? The "next 8am" "unit" I am contemplating is modelled based on age. Perhaps this is where my mistake is.
Elliot Silver (Jan 11 2022 at 22:28):
No, age isn't a unit. days, weeks, or years, which can be used to measure age, are though.
Lloyd McKenzie (Jan 11 2022 at 22:36):
One of the criteria for being a unit is "can you do math with it?" E.g. 2 days + 3 days = 5 days. 3 days * 2 = 6 days. "1 next 8am" * 2 doesn't really make sense...
Kyle Thompson (Jan 11 2022 at 22:37):
Is that true? Temperature is a unit and you can't do math with it (at least not unrestricted math or any math). For example, -500 * 1 C doesn't make sense as -500 C doesn't exist.
Elliot Silver (Jan 11 2022 at 22:39):
No but if the temp is 30 C and it goes up by 5 C then 30+5=35 C.
Elliot Silver (Jan 11 2022 at 22:39):
And temp isn't a unit -- temp is measured in units; just like age.
Kyle Thompson (Jan 11 2022 at 22:39):
I understand the point. I think the problem with what I want to define can't be defined in an "absolute" sense. 1 next 8am doesn't make sense by itself. It needs a dateTime or make sense.
Kyle Thompson (Jan 11 2022 at 22:40):
And that's fair about temperature.
Elliot Silver (Jan 11 2022 at 22:42):
I don't know the FHIR scheduling well, but it seems to me what you are trying to say is the "next morning" after an offset measured in days.
Kyle Thompson (Jan 11 2022 at 22:42):
@Elliot Silver yeah, that's exactly correct.
Lloyd McKenzie (Jan 12 2022 at 03:53):
I think you're going to need an extension. However, would still like to hear from @Bryn Rhodes. (He may not have bandwidth until post-connectathon though.)
Kyle Thompson (Jan 12 2022 at 13:05):
@Lloyd McKenzie Yeah, after everyone's feedback, this is where my mind was going too. I'll proceed using an extension. If Bryn (or anyone else) has any further thoughts on this topic, it would of course be welcome and much appreciated.
Bryn Rhodes (Jan 14 2022 at 03:15):
I agree, an extension is necessary. You could potentially do something dynamic with an expression extension (something like this admittedly contrived example):
<action>
<action id="a">
<title value="Do A"/>
</action>
<action id="b">
<title value="Do B after 8AM the next day"/>
<relatedAction>
<actionId value="a"/>
<relationship value="after-end"/>
<offsetRange>
<low>
<extension url="http://hl7.org/fhir/StructureDefinition/cqf-expression>
<valueExpression>
<language value="text/cql-expression"/>
<expression value="(date from ((%context.action.where(id = 'a').timing as dateTime) + 1 day)) + 8 hours"/>
</valueExpression>
</extension>
</low>
</offsetRange>
</relatedAction>
</action>
</action>
Last updated: Apr 12 2022 at 19:14 UTC