FHIR Chat · Timing · implementers

Stream: implementers

Topic: Timing


view this post on Zulip Pranitha Sruthi (Jan 09 2018 at 06:48):

Hi all, what would be the equivalent json format for "every other week", "in morning and at bed time" and "at bed time" using the Timing datatype? Thank you

view this post on Zulip Jose Costa Teixeira (Jan 09 2018 at 10:48):

"in morning and at bed time" every day:
"timing" : {
"period": 1,
"periodUnit": "d",
"when" : ["MORN", "HS"]
}

view this post on Zulip Jose Costa Teixeira (Jan 09 2018 at 10:50):

"every other week" = "once every 2 weeks" which translates to
"timing" : {
"frequency": 1,
"period": 2,
"periodUnit": "wk",
}

view this post on Zulip Pranitha Sruthi (Jan 09 2018 at 10:51):

@Jose Costa Teixeira How can I represent 'every other day' in json format?

view this post on Zulip Jose Costa Teixeira (Jan 09 2018 at 10:52):

replace wk by d in the period as described here: http://build.fhir.org/valueset-event-timing.html
"timing" : {
"frequency": 1,
"period": 2,
"periodUnit": "d",
}

view this post on Zulip kler (Jan 09 2018 at 10:52):

"every other week" = "once every 2 weeks" which translates to
"timing" : {
"frequency": 1,
"period": 2,
"periodUnit": "wk",
}

periorUnit will be "D"

view this post on Zulip Pranitha Sruthi (Jan 09 2018 at 11:00):

@kler @Jose Costa Teixeira Thank you

view this post on Zulip Pranitha Sruthi (Jan 09 2018 at 11:11):

How can I represent "every 4 hours (5 times/day)"?

view this post on Zulip Vijay Thangavelu (Jan 09 2018 at 12:12):

Check if this helps,

"timing" : {
     "repeat": {
         "frequency": 5,
          "period": 1,
           "periodUnit": "d"
      }
     "code":  "Q4H" -- Every 4 hours at institution specified times
}

ref: https://www.hl7.org/fhir/valueset-event-timing.html

view this post on Zulip Mounika (Jan 12 2018 at 05:29):

Hi all, how can I represent "2 times a day (3 days a week)" in json format ?

view this post on Zulip Lloyd McKenzie (Jan 12 2018 at 15:37):

You can do it if you pick specific days of the week (e.g. M/W/F), but there's no way to encode the statement you provided without using extensions

view this post on Zulip Josh Haskins (Jan 31 2019 at 20:56):

Hi,

I am working on mapping events into FHIR using the Timing datatype and I have two different cases that I am struggling to work out how they would look.

The first case is where you can specify the 1st, 2nd, 3rd, 4th or last day (Monday, Tuesday, etc.) of the month.
Examples:
-The 2nd Monday of Every Month
-The Last Friday of Every Month

The second case is where you can specify the day (1, 2, 3, ...., last) of the month.
Examples:
-The 4th Day of Every Month
-The Last Day of Every Month

I have checked out the FHIR documentation on Timing, but have not been able to see a method of achieving this.
https://www.hl7.org/fhir/datatypes.html#timing

Wondering if anyone can give me a hand?

Thanks,
-Josh

view this post on Zulip Grahame Grieve (Jan 31 2019 at 21:00):

the second case:

  • choose an arbitary 4th day of a particular month (usually, this month)
  • put that in Timing.event
  • repeat.frequency = 1
  • repeat.period = 1
  • repeat.unit = "mo"

view this post on Zulip Grahame Grieve (Jan 31 2019 at 21:00):

last day of every month - we have no language for that . that's a real use case?

view this post on Zulip Grahame Grieve (Jan 31 2019 at 21:01):

maybe hack it by saying 1 day before (using offset) the 1st day of the month

view this post on Zulip Grahame Grieve (Jan 31 2019 at 21:01):

the first is a real use case?

view this post on Zulip John Silva (Jan 31 2019 at 21:16):

Interesting --- has anyone looked at how iCalendar or other timing/event based standard deals with this? I'm sure all the calendar providers have a way to deal with this. https://stackoverflow.com/questions/43313738/ical-event-on-the-last-day-of-the-month

view this post on Zulip Josh Haskins (Jan 31 2019 at 21:19):

Hi Graham,

Thank you for your quick response.

Case two, your solution should work, especially with your 'hack'.

Case one, it is a real world use case. We have an application that allows visits (appointments) to be scheduled with a range of different scheduling patterns, and this one one of them. I suppose I could use an extension for this, and add a property for the actual day of the month.

view this post on Zulip Grahame Grieve (Jan 31 2019 at 21:31):

not obvious what the extension would be. What does iCal do for this?

view this post on Zulip Josh Haskins (Jan 31 2019 at 23:17):

If I had a timing property set to something like this, with an extension that indicated the day number:

{
"event": ["2019-02-21"],
"repeat": {
"boundsPeriod": {
"start": "2019-01-21"
},
"frequency": 1,
"periodUnit": "mo",
"extension": [{
"url": "http://example.com/dayNumber",
"valueInteger": 21
}]
}
}

This would indicate The 21st day of every month. Does that make sense?

view this post on Zulip Grahame Grieve (Jan 31 2019 at 23:18):

yes. every second monday is a little more challenging. Which is why I asked about iCal...

view this post on Zulip Josh Haskins (Jan 31 2019 at 23:32):

I could use:

{
"event": ["2019-02-21"],
"repeat": {
"boundsPeriod": {
"start": "2019-01-21"
},
"frequency": 1,
"periodUnit": "mo",
"dayOfWeek":["mon"],
"extension": [{
"url": "http://example.com/dayOfWeekOccurance",
"valueString": "2"
}]
}
}

for the 2nd Monday of Every Month.

Then if it were the Last Friday of Every Month:

{
"event": ["2019-02-21"],
"repeat": {
"boundsPeriod": {
"start": "2019-01-21"
},
"frequency": 1,
"periodUnit": "mo",
"dayOfWeek":["fri"],
"extension": [{
"url": "http://example.com/dayOfWeekOccurance",
"valueString": "last"
}]
}
}

I'm not too sure what John was suggesting with iCal...

view this post on Zulip John Silva (Feb 01 2019 at 10:08):

@Grahame Grieve - I wasn't suggesting using iCal directly but looking at their model of how they represent this so that maybe FHIR's Timing datatype could have an equivalent mechanism.

view this post on Zulip Grahame Grieve (Feb 01 2019 at 11:47):

yes that's what I had in mind

view this post on Zulip John Silva (Feb 01 2019 at 14:00):

Why 'reinvent the wheel' ;-)

view this post on Zulip Pietro Ghezzi (Feb 28 2019 at 15:43):

ServiceRequest has occurence field which is a Date DataType. I need to define a schedule for more than 1 period that repeats. Example:
Repeat the following
- 01.03 at 08:00
- 02.03 at 11:00
- 03.03 at 17:00


the 04.03 would restart from 08:00, 05.03 at 11:00 and so on.
Is it possible to implement this particular case with occurence?

view this post on Zulip Lloyd McKenzie (Feb 28 2019 at 15:45):

You'd probably need to define 3 separate timings each with a scheduled occurrence every 3 days. For MedicationRequest, that would be 3 repetitions of dosage. But for procedures, you might need 3 sub-procedures or some sort of extension. (You could also submit a change request.)

view this post on Zulip John Silva (Feb 28 2019 at 21:56):

Hm, this sounds a lot like Explicit Times Interval in HL7 V2 RI (Repeat Interval) data type. Is this another example of a V2 Timing mechanism that doesn't yet have an equivalent in FHIR?

http://hl7-definition.caristix.com:9010/HL7%20v2.5.1/Default.aspx?version=HL7%20v2.5.1&dataType=RI

view this post on Zulip Grahame Grieve (Mar 01 2019 at 22:26):

RI = TIming,code - but I'm really not sure what RI.2 is about

view this post on Zulip John Silva (Mar 01 2019 at 22:34):

@Grahame Grieve Explicit Time Interval -- I know of a use when you want to schedule Meds (in RXE-1) for specific times during the day. For example, I want BID (3-times a day) but at hospital specific times, 0400,1400,1900 (spec'd 'grammar' for this is that this is hours only within current day if I remember right). Maybe a strange use case but nevertheless it was used (and useful) in V2.

view this post on Zulip Grahame Grieve (Mar 02 2019 at 00:18):

So RI.2 is unspecified. - just a string. It’s pretty much an extension...

view this post on Zulip John Silva (Mar 02 2019 at 03:46):

@Grahame Grieve -- Not really; in the HL7 V2.s CH 2 A it specifically states the grammar for the RI.1 Explicit Time Interval field:

This component explicitly lists the actual times referenced by the code in the first component, in
the following format: HHMM,HHMM,HHMM,.… This second component will be used to clarify the first
component in cases where the actual times vary within an institution.

view this post on Zulip Grahame Grieve (Mar 02 2019 at 05:12):

I should have read the spec. Well, I think it's an extension anyway, on Timing.code

view this post on Zulip John Silva (Mar 04 2019 at 01:06):

It seems strange that something that was useful in V2 (yes, V2 was the 'union of all use cases') needs to be an extension in FHIR. I'm wondering how often Explicit Time Intervals were used in Pharmacy (V2) messages; is it sufficiently enough that is should be part of FHIR not an extension? Maybe folks in the Pharmacy group can give a better answer; I'm just asking the question because in my V2 experience with ORM/RDE/etc. messages we supported this Explicit Time Interval in RI data type.

view this post on Zulip Lloyd McKenzie (Mar 04 2019 at 01:09):

Most things in v2 are "useful" in at least some situation. The bar to determine whether something should be in core or an extension in the FHIR spec isn't based on "useful", it's based on "commonly implemented". The feeling of the committee was "no". And given the amount of implementation that's been done in this space, the fact that the question is only coming up now, suggests that that was probably the right call.

view this post on Zulip John Silva (Mar 04 2019 at 11:52):

@Lloyd McKenzie - it may be true that the committee didn't see the need for this and that it doesn't fit the 80% rule, but to someone 'late to the game' of FHIR it strikes me as "odd" that something that was obviously not just "useful" but a key part of inpatient medication ordering, is not in FHIR. (Sometimes I get the feeling with my minimal exposure to the FHIR Med resources, that much of the effort is/was focused on outpatient med workflow so things like this that seem to be important for inpatient med workflow are not seen as necessary -- again, just my impression from my minimal exposure/involvement.)

view this post on Zulip Grahame Grieve (Mar 04 2019 at 12:36):

if you can convince the committee that's a key part, then that's fine. It's not up to Lloyd and me. Were just saying, as observers of the general process, we think it's likely to be an extension

view this post on Zulip Jean Duteau (Mar 04 2019 at 16:17):

@John Silva we've asked you to come to the Pharmacy meetings so you can bring forward some of your concerns and even speak to some of the gForge trackers you have raised. To your point about inpatient, we looked at all of V2 and V3 to make our materials and we've had quite a lot of v2 implementers give us their feedback. If you have some implementations that are using pieces of v2 that we didn't incorporate, please let us know so we can explore those

view this post on Zulip John Silva (Mar 04 2019 at 17:30):

@Jean Duteau - thank you. Yes, I never seem to be able to make the Pharmacy meetings and my role is not as a 'standards person' just a "regular s/w developer". I can contribute by 'bits and pieces' in these threads but can't dedicate an hour in a meeting. I'm also not a clinician so my experience base is from a s/w developer's perspective and not sure I have enough of a convincing argument for things I've asked about since I'm only one voice with maybe one 'use case'. (Though I was pleased to see the committee included my suggestion of having an identifier property for the Medication resource in R4 and my other request about having more filled out V2 examples for medication-related data types like Dosage and TIming, thank you.)


Last updated: Apr 12 2022 at 19:14 UTC