FHIR Chat · RequestGroup action offsets not relative · implementers

Stream: implementers

Topic: RequestGroup action offsets not relative


view this post on Zulip 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".

view this post on Zulip Lloyd McKenzie (Jan 06 2022 at 23:18):

@Bryn Rhodes

view this post on Zulip 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.

view this post on Zulip Lloyd McKenzie (Jan 11 2022 at 21:19):

I wouldn't encourage that. It's not really what units are for.

view this post on Zulip Kyle Thompson (Jan 11 2022 at 21:41):

Because the unit system I am thinking of defining isn't in UCUM?

view this post on Zulip Lloyd McKenzie (Jan 11 2022 at 21:56):

A unit is a type of measurement. "next 8am" isn't a type of measurement.

view this post on Zulip 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.

view this post on Zulip 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.

view this post on Zulip 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...

view this post on Zulip 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.

view this post on Zulip 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.

view this post on Zulip Elliot Silver (Jan 11 2022 at 22:39):

And temp isn't a unit -- temp is measured in units; just like age.

view this post on Zulip 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.

view this post on Zulip Kyle Thompson (Jan 11 2022 at 22:40):

And that's fair about temperature.

view this post on Zulip 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.

view this post on Zulip Kyle Thompson (Jan 11 2022 at 22:42):

@Elliot Silver yeah, that's exactly correct.

view this post on Zulip 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.)

view this post on Zulip 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.

view this post on Zulip 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