FHIR Chat · Fitness data · implementers

Stream: implementers

Topic: Fitness data


view this post on Zulip kinnari ajmera (Jul 20 2017 at 13:24):

Hello,
I am a student from University College London and me and my team are working on an industrial project where we are trying to convert the fitness data from google fit and apple health kit into the fhir format.
I have followed the instructions given in the article (http://www.healthintersections.com.au/?p=2487) and have succesfully created an observation fhir json file for heart rate.
I just wanted to know whether there are any existing projects that are doing this or any example fhir json files for google fit/apple health kit data.

view this post on Zulip Grahame Grieve (Jul 21 2017 at 10:53):

looks like not, but you could try talking to openMHealth who we are working with on this kind of stuff now

view this post on Zulip kinnari ajmera (Jul 24 2017 at 18:22):

looks like not, but you could try talking to openMHealth who we are working with on this kind of stuff now

Yes thanks a lot for the reply.

view this post on Zulip kinnari ajmera (Jul 30 2017 at 10:24):

looks like not, but you could try talking to openMHealth who we are working with on this kind of stuff now

I am currently trying to build a profile that can support fitness data from various applications but there is not enough documentation available . Do you know where I can find help ?

view this post on Zulip Kevin Mayfield (Jul 30 2017 at 11:29):

What kind of observations are you getting back? I've had a brief look at Strava data and would map the heart rate, fitness duration to SNOMED codes and use Observation FHIR resource.

view this post on Zulip kinnari ajmera (Jul 30 2017 at 12:35):

Hello,

I am looking at observations like sleep logs, activity logs etc along with the general observations like heart rate, step count, bmi. Also wanted to know whether you created a new profile or used an existing one?

view this post on Zulip Kevin Mayfield (Jul 30 2017 at 19:54):

I like Grahame's approach but it seems we're missing a number of SNOMED codes for activities (and others).. FYI the UK profiles and API for observation can be found here https://nhsconnect.github.io/CareConnectAPI/api_diagnostics_observation.html

view this post on Zulip Kevin Mayfield (Jul 30 2017 at 19:56):

You may be able to use the related property link the observations together?

view this post on Zulip Kevin Mayfield (Jul 30 2017 at 19:56):

but doesn't get around the missing SNOMED codes

view this post on Zulip kinnari ajmera (Aug 01 2017 at 12:29):

I like Grahame's approach but it seems we're missing a number of SNOMED codes for activities (and others).. FYI the UK profiles and API for observation can be found here https://nhsconnect.github.io/CareConnectAPI/api_diagnostics_observation.html

@Grahame Grieve could you suggest an appropriate way to represent such data ( activity logs, sleep logs ect) ? I have also sent a request to join Open mHealth developer mailing list. Is there any other way I can contact them directly?

view this post on Zulip Eric Haas (Aug 01 2017 at 17:33):

Not clear what you mean by 'logs' Observations are atomic and represent a single measurement. A group of Observations could be considered a log. you could group them in a variety of ways.... e.g. a List

view this post on Zulip kinnari ajmera (Aug 02 2017 at 11:11):

@Eric Haas Thanks that was very helpful. By logs I mean the user's sleep log entries and sleep data for the entire day. I am trying to represent the sleep log data from fitbit (https://dev.fitbit.com/docs/sleep/) in fhir format. I also wanted to know whether I could represent the entire sleep data as a single observation and make it more granular by adding sub sections inside it like sleep duration, sleep levels, sleep date etc.

view this post on Zulip Eric Haas (Aug 02 2017 at 16:10):

" I could represent the entire sleep data as a single observation and make it more granular by adding sub sections inside it like sleep duration, sleep levels, sleep date etc."

I would have a single Observation for each day and each Observation would use component or related for the stuff like duration, levels, etc - assuming a weeks worth of data you would have 7 Observations. Depending on your use case then bundle them with a DiagnosticReport, Bundle, List.

view this post on Zulip kinnari ajmera (Aug 02 2017 at 20:36):

@Eric Haas Thanks a lot for your reply. According to what you suggested, I have made a simple Observation for sleep and added sub-sections to it using component. I was a bit confused about how to add sub-sub-sections like the various sleep levels (wake, light etc) inside the subsection sleep levels. I have currently added them using extensions inside the subsection 'sleepLevels'. I was trying to map this data from fitbit to be specific :
"levels": {
"summary": {
"deep": {
"count": <value>,
"minutes": <value>,
"thirtyDayAvgMinutes": <value>
},
"light": {
"count": <value>,
"minutes": <value>,
"thirtyDayAvgMinutes": <value>
},
"rem": {
"count": <value>,
"minutes": <value>,
"thirtyDayAvgMinutes": <value>
},
"wake": {
"count": <value>,
"minutes": <value>,
"thirtyDayAvgMinutes": <value>
}
},
I am attaching the file for sleep observation here observation.json . Could you please have a look and let me know whether it looks right?

Thanks again for your help.

view this post on Zulip Eric Haas (Aug 02 2017 at 21:03):

You can't really nest any deeper than a single component layer.

view this post on Zulip Eric Haas (Aug 02 2017 at 21:03):

so that is your leaf and work back from there...

view this post on Zulip kinnari ajmera (Aug 02 2017 at 21:06):

How about using extensions inside the component?

view this post on Zulip Eric Haas (Aug 02 2017 at 21:07):

observation.code = levels
observation.value "deep": {
obsservation.component.code = count observation.value = <value>
etc.

grouping all the observation by DiagnosticReport to me is the best. alternatively use the Observatino.related to group

view this post on Zulip Eric Haas (Aug 02 2017 at 21:08):

extensions are permitted but in this case I think not very interoperable and why not use the existing resources. Why do you want to use only a single Observation?

view this post on Zulip kinnari ajmera (Aug 02 2017 at 21:09):

Alright that sounds good. So you mean I should make a single Observation for each sleep level and group all of them using DiagnosticReport or related?

view this post on Zulip kinnari ajmera (Aug 02 2017 at 21:14):

Does the json file look fine otherwise?

view this post on Zulip Eric Haas (Aug 02 2017 at 21:20):

sounds like you have 3 or 4 layer: which you can apply like this.

log (weeks worth of measurements) --> DiagnosticReport
daily summary ( levels, duration, etc) --> Observation
individual measuremetn summary ( levels summary) --> .related Observation
measured values --> Components

A similar structural pattern can be seen here for microbiology culture and susceptibiility whiich also has deeply nested data. in your case the leaf node would be an observation.component instead of a related observation

view this post on Zulip kinnari ajmera (Aug 02 2017 at 21:23):

Alright thanks. I will have a look at it and try to implement accordingly.

view this post on Zulip kinnari ajmera (Aug 03 2017 at 13:20):

Hi @Eric Haas I have made the format as you had suggested. Would be really nice if you could have a look and suggest changes wherever necessary. This is an outline of how I have nested it
Observation - DiagnosticReport
-Observation.contained-sleepLevels
-Observation.contained-deep
-observation.component - minutes
-observation.component - count
-Observation.contained-light
-observation.component-minutes
-observation.component-count
-Observation.contained- sleepDuration
-Observation.extension- isMainSleep (boolean)

observation-1.json

view this post on Zulip Kevin Mayfield (Aug 03 2017 at 13:31):

You can't use id for your codes, they need to go in the code section. Have a look at the code section here https://www.hl7.org/fhir/observation-example.xml.html

view this post on Zulip Kevin Mayfield (Aug 03 2017 at 13:34):

Don't think you need to use contained resources.

view this post on Zulip kinnari ajmera (Aug 03 2017 at 13:35):

Alright thank you. Will make the changes.

view this post on Zulip kinnari ajmera (Aug 03 2017 at 13:35):

what can I use instead of contained resources?

view this post on Zulip Kevin Mayfield (Aug 03 2017 at 13:51):

@Eric Haas comments bout using DiagnosticReport which has a list of Observation results (DiagnosticReport->results) for first layer and then Observation using related property.

view this post on Zulip Kevin Mayfield (Aug 03 2017 at 13:51):

How are you planning for this API to work. Are you sending the results from A to B or will this be a query

view this post on Zulip kinnari ajmera (Aug 03 2017 at 13:57):

Hi we are just sending the results from A to B

view this post on Zulip Mikael Rinnetmäki (Aug 03 2017 at 14:48):

I know there's been some activity related to Fitness data in Finnish PHR scene. See https://simplifier.net/DailyActivityObx for instance.

view this post on Zulip Lloyd McKenzie (Aug 03 2017 at 15:15):

Data that is intended to be separatable should be in individual resources. You can package them all up in a Bundle for transmission if you like.

view this post on Zulip Kevin Mayfield (Aug 03 2017 at 15:18):

If your sending them from A to B, I would use a Bundle as @Lloyd McKenzie has mentioned. So you'd be using something more like FHIR Messaging https://www.hl7.org/fhir/messaging.html

view this post on Zulip kinnari ajmera (Aug 03 2017 at 15:21):

So DiagnosticReport should be replaced by bundle?

view this post on Zulip Kevin Mayfield (Aug 03 2017 at 15:23):

In your bundle the first entry would be MessageHeader (who it's from and to, etc), second entry DiagnosticReport and the following entries Observations. No contained resources but you may still have componets.

view this post on Zulip kinnari ajmera (Aug 03 2017 at 15:28):

Could you please send me an example of what you are trying to explain?

view this post on Zulip Lloyd McKenzie (Aug 03 2017 at 16:20):

DiagnosticReport would be the logical grouper - you still need that. Bundle is the packaging mechanism to let you send multiple things at one time. I don't think you'd need to go full messaging - transaction would probably work fine, so no need for MessageHeader

view this post on Zulip Eric Haas (Aug 03 2017 at 16:49):

example here: http://build.fhir.org/diagnosticreport-example-lri.xml.html

view this post on Zulip Kevin Mayfield (Aug 04 2017 at 07:34):

Is their guidance on when to use a transaction verse message. I'm working on a Task which because of the number of contained resources, I've moved from FHIR RESTful/Resource API to messaging.

view this post on Zulip Lloyd McKenzie (Aug 04 2017 at 15:46):

The idea of "contained" is not about convenience of packaging for transmission, it's about the ability to stand alone independently. If a resource has enough information that it could be usefully stored as a stand-alone instance, then it should be represented as a stand-alone instance. If you want to avoid having multiple RESTful calls, you can look at batch, transaction, messaging, documents or services. (Which of those you choose will depend on the characteristics of your use-case.)

view this post on Zulip Kevin Mayfield (Aug 04 2017 at 16:04):

So a contained resource would not be a full resource and couldn't stand alone independently. [This question is for a different use case]

view this post on Zulip Eric Haas (Aug 04 2017 at 19:13):

yes here is doco: http://build.fhir.org/references.html#contained

view this post on Zulip kinnari ajmera (Aug 07 2017 at 12:25):

DiagnosticReport would be the logical grouper - you still need that. Bundle is the packaging mechanism to let you send multiple things at one time. I don't think you'd need to go full messaging - transaction would probably work fine, so no need for MessageHeader

Not sure whether I have understood this. Should I replace the contained resources inside the Diagnostic Report with bundles?

view this post on Zulip kinnari ajmera (Aug 07 2017 at 15:49):

I have attempted to make something. If you could please review it.
bundle_sleep-log.json

view this post on Zulip Eric Haas (Aug 07 2017 at 16:45):

that looks about right.

view this post on Zulip kinnari ajmera (Aug 07 2017 at 19:41):

Thats great. Thank you

view this post on Zulip kinnari ajmera (Aug 15 2017 at 11:43):

Could someone please briefly explain the purpose of Implementation Guide and Conformance resources? How do we create a StructureDefinition for the sleep log profile created using Diagnostic Report and Observations bundle?

view this post on Zulip Lloyd McKenzie (Aug 15 2017 at 13:57):

ImplementationGuide is for defining a "package" of profiles, value sets, Conformance/CapabilityStatements, example instances, etc. that are used together to define the expected behavior of a group of systems in a particular environment. Conformance/CapabilityStatement deals with defining the "behavioral" capabilities of systems. It's used to document a specific system instance's capabilities (i.e. what resources the system supports, what operations it supports, what kinds of messages or documents it can work with, etc.). It can also be used to define capabilities a system should have. (The latter use would be for inclusion in an implementation guide.)

view this post on Zulip Lloyd McKenzie (Aug 15 2017 at 13:58):

I'd recommend using a tool like Forge or Trifolia to create your profiles. While you can create StructureDefinitions by hand, it's a bit of a pain.

view this post on Zulip Eric Haas (Aug 15 2017 at 16:10):

I think of the IG resource as a glorified Table of Contents and the Capability Statements where you formally stipulate what you need to support. To get started figure out your IG layout and focus on the profiles and pages for your IG. You can always add the capstatement once you established the requirements and flesh out the IG later. I would suggest you attend a HL7 sponsored Profiling tutorial - I believe Michel is giving one in San Diego at the HL7 September WGM

view this post on Zulip kinnari ajmera (Aug 15 2017 at 21:21):

Thanks for your replies. Will try and work out the IG. @Eric Haas I would really like to attend the tutorial and the connectathon but we are based in London so its a bit difficult to be present there.

view this post on Zulip Grahame Grieve (Aug 16 2017 at 02:21):

you could try DevDays in Amsterdam in November

view this post on Zulip kinnari ajmera (Aug 16 2017 at 10:32):

@Grahame Grieve Sure if I get a chance and if I am still in London :) My course ends in September so might move back to India.

view this post on Zulip kinnari ajmera (Aug 16 2017 at 11:47):

Hi,

With the help received from this channel, we created profiles for lifestyle data. To make it easy for future developers, we have written an article about how we built the profile. Here is a link to the website : http://www.fhirdata.exchange/
The link to our Github repo is : https://github.com/fhirfli/Extended-FHIR
We have also built a fhir converter as an npm package that converts the data from various formats (healthkit, fitbit, google fit) to fhir format. Here is the link to our converter : https://www.npmjs.com/package/fhir-converter

Please have a look and let me know if you have any suggestions :)

Thanks!

view this post on Zulip kinnari ajmera (Aug 16 2017 at 13:27):

@Eric Haas @Lloyd McKenzie Is there any tutorial online or example on how to create the structure definition file?

view this post on Zulip Lloyd McKenzie (Aug 16 2017 at 14:50):

There are some good tutorials from Dev Days:
https://vimeopro.com/user12740828/hl7-fhir-developer-days-2016-amsterdam/video/191771322
https://vimeopro.com/user12740828/hl7-fhir-developer-days-2016-amsterdam/video/191936148
https://vimeopro.com/user12740828/hl7-fhir-developer-days-2016-amsterdam/video/191957060
https://vimeopro.com/user12740828/hl7-fhir-developer-days-2016-amsterdam/video/192101829
(You can find a full list of the dev-days tutorials here: https://vimeopro.com/user12740828/hl7-fhir-developer-days-2016-amsterdam)

view this post on Zulip kinnari ajmera (Aug 16 2017 at 15:04):

Thanks a lot!

view this post on Zulip kinnari ajmera (Aug 29 2017 at 20:30):

Hi,
I was looking at attending the track 'Patient Reported Observations' at the Connectathon in September this year since we have worked on using FHIR Observation resources to represent Lifestyle data.
I wanted to know whether there is any funding available for students to attend the Connectathon?

view this post on Zulip Lloyd McKenzie (Aug 29 2017 at 21:30):

I believe the FHIR Foundation has talked about the possibility of setting up scholarships, but I'm pretty sure nothing like that is in place yet unfortunately. One thing we could look at doing is establishing student rates for the connectathon that are a bit more accessible. I'll add this to the agenda for the FHIR management group. It's too late to get that in place for the San Diego meeting, but we might be able to make something work for New Orleans in January.

view this post on Zulip Harri Honko (Sep 01 2017 at 08:25):

Hi, I'm coming to the Connectathon on 9-10th Sep thanks to sponsorship of HL7 Finland - I could introduce the Finnish PHR fitness profiles (and co-work with Kinnari if she can make it to SD to develop the sleep observation profile. One key thing missing - I didn't yet find the Connectathon web pages, can someone link me there please?

view this post on Zulip Michel Rutten (Sep 01 2017 at 08:53):

Hi @Harri Honko, are you looking for these wiki pages?
http://wiki.hl7.org/index.php?title=FHIR_Connectathon_16
BTW See you in San Diego!

view this post on Zulip kinnari ajmera (Sep 01 2017 at 23:41):

Hi ,
Thanks for your replies. Hopefully I will be able to attend if something works out.

view this post on Zulip Craig McClendon (Nov 02 2018 at 14:11):

Does anyone have a suggestion of a codesystem/value to use for a fitness tracker/activity monitor type of device - for populating Device.type?

view this post on Zulip John Moehrke (Nov 02 2018 at 14:38):

There is a profile for Device Metrics on Observation http://build.fhir.org/observation-profiles.html

view this post on Zulip Craig McClendon (Nov 02 2018 at 15:04):

Thanks @John Moehrke . But I don't see anything helpful there. I'm specifically looking for a code to classify a device like a fitbit in the Device.type attribute.

view this post on Zulip John Moehrke (Nov 02 2018 at 15:09):

Well, given that Device resource is at FMM 0 (zero), this is not surprising that there is a lack of helpful content. FMM of zero is an indication by the committee that owns that Resource that they are NOT ready for anyone outside of the committee members working on developing the resource to use the resource. This FMM of zero is a flag to you that they are not happy with the definition, and that radical changes will happen...
That said, a FMM of zero should also tell you that you should engage with the committee and be a driving force that helps develop and mature that resource. Questions here are good, not trying to discourage questions here.. .just trying to prepare you to quickly move your unfulfilled questions into Change Requests, where you outline the problem you have AND recommend the solution that would make you most happy.

view this post on Zulip Craig McClendon (Nov 02 2018 at 15:22):

Understand. But this could be a general terminology question. I know of several research programs that issue fitness tracking devices to patients. I can usually find a SNOMED code for most medical devices, but no luck so far with fitness trackers. So was just reaching out to the community at large to see if anyway knew of a codesystem/code that has a fitness tracker/activity monitor concept which might be appropriate.

view this post on Zulip Craig McClendon (Nov 02 2018 at 15:28):

..

view this post on Zulip Jose Costa Teixeira (Nov 02 2018 at 22:16):

SCTID: 462329005
462329005 | Physical activity long-term ambulatory recorder (physical object) |
???

view this post on Zulip Grahame Grieve (Nov 06 2018 at 06:46):

@Eric Haas has this come up in the work with openMHealth?

view this post on Zulip Eric Haas (Nov 06 2018 at 17:56):

It has and I brought up the fact that SNOMED requires a licence and talked about getting these concept in LOINC. There is also an IEEE project and working on phyical activities that would be a good place to bring this up. IEEE P1752 WG

view this post on Zulip Armin Griebler (Dec 03 2019 at 08:06):

Hello everybody. Is it possible to represent several time series with FHIR? For example, I would like to represent a total sleep period and within that period, I would like to measure the length of several sleep levels, such as "light sleep / deep sleep / rem sleep, etc." and each of these sleep levels (light, deep, rem..) could occur more often.
Any suggestions if this would be possible?

view this post on Zulip Lloyd McKenzie (Dec 03 2019 at 14:20):

You could use a grouping Observation for the overall period and have the sub-observations as 'members'

view this post on Zulip Armin Griebler (Dec 03 2019 at 15:25):

You could use a grouping Observation for the overall period and have the sub-observations as 'members'

Thank you @Lloyd McKenzie ! Just for a better understanding: Am I right, that I would have to define for example three light-sleep sub-observations (as ‘members’) to get the three light-sleep-periods that occurred during my overall sleep period?

view this post on Zulip John Silva (Dec 03 2019 at 17:34):

@Lloyd McKenzie - are you suggesting that @Armin use Observation.component (as 'members') or separate Observations with some kind of linkage (partOf?) ? Also, aren't the "Devices on FHIR" folks already working with folks on this? @Todd Cooper

view this post on Zulip Lloyd McKenzie (Dec 03 2019 at 17:50):

@John Silva There's no partOf in Observation. There's "hasMember". Each measurement would be a stand-alone Observation, but there'd be a linkage between them that says that the qualified sleep period measurements would be members of the overall sleep period observation.


Last updated: Apr 12 2022 at 19:14 UTC