FHIR Chat · NutritionIntake · finnish PHR

Stream: finnish PHR

Topic: NutritionIntake


view this post on Zulip Mikael Rinnetmäki (Nov 26 2018 at 12:02):

Hi,
I tried to add the StructureDefinition for the NutritionIntake, and it seemed to succeed. See http://fhirsandbox.kanta.fi/phr-resourceserver/baseStu3/StructureDefinition/74189f4f-9486-4867-be0b-26034b69be04. How can I now add NutritionIntake entries to Kanta PHR?
I tried adding this Observation

{
  "resourceType": "Observation",
  "meta": {
    "profile": "http://phr.kanta.fi/StructureDefinition/fiphr-sd-nutritionintake-stu3"
  },
  "identifier": [
    {
      "system": "urn:ietf:rfc:3986",
      "value": "b149307e-0ef7-4f8b-95e0-4d63e370e3d4"
    }
  ],
  "status": "final",
  "category": [{
    "coding": [{
      "system": "http://phr.kanta.fi/CodeSystem/fiphr-cs-observationcategory",
      "code": "nutrition",
      "display": "Ravintosisältö"
    }]
  }],
  "code": {
    "coding": [
      {
        "system": "http://loinc.org",
        "code": "9059-7",
        "display": "Carbohydrate intake Estimated_fi"
      }
    ],
    "text": "Arvioitu hiilihydraattimäärä"
  },
  "subject": {
    "reference": "Patient/812adecb-5358-413d-84cd-5eb8132f40a2"
  },
  "effectiveDateTime": "2018-11-26T09:35:55",
  "performer": [{
    "reference": "Patient/812adecb-5358-413d-84cd-5eb8132f40a2"
  }],
  "valueQuantity": {
    "value": 35,
    "unit": "g",
    "system": "http://unitsofmeasure.org",
    "code": "g"
  }
}

through the GUI, but got response

{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "error",
      "code": "processing",
      "details": {
        "coding": [
          {
            "system": "http://phr.kanta.fi/fiphr-cs-errorcodes",
            "code": "500620"
          }
        ],
        "text": "No profile found"
      },
      "diagnostics": "Unexpected failure while validating resource"
    }
  ]
}

Can you verify whether the error is in fact related to the profile resource not being found?
Should I perhaps somehow try to add a NutritionIntake resource instead of a profiled Observation?

view this post on Zulip Eeva Turkka (Nov 27 2018 at 08:33):

The nutrition-profile was missing and I added it. You could try again - and add language field to the observation resource, because its validation causes weird error (which has been noted).

view this post on Zulip Mikael Rinnetmäki (Nov 27 2018 at 08:34):

Thanks! I'll try again.

view this post on Zulip Mikael Rinnetmäki (Nov 27 2018 at 11:51):

Thanks for the support @Eeva Turkka , I was able to create resource http://fhirsandbox.kanta.fi/phr-resourceserver/baseStu3/Observation/16a93ad1-9379-42fc-8e07-29ea64e820c3?_pretty=true

view this post on Zulip Mikael Rinnetmäki (Nov 28 2018 at 13:36):

If I'd now like to modify the Finnish PHR Nutrition profile (the base profile added by @Eeva Turkka), what would be the appropriate process? Can I just add another StructureDefinition resource, with the same url, etc? Or is there a way for me to search the existing StructureDefinition and modify that one? And if so, how can we communicate changes to profile documents between all implementers?

view this post on Zulip Rita Ahde (Nov 30 2018 at 09:14):

Existing structure definitions can be found using the search parameter url. Here is an example for Nutrition base profile search: http://fhirsandbox.kanta.fi/phr-resourceserver/baseStu3/StructureDefinition?url=http://phr.kanta.fi/StructureDefinition/fiphr-sd-nutrition-stu3&_format=json

Adding another structure definition with an existing url is not possible. If you want to test a new version of existing data content, you should use a different url (for example adding a postfix after url, like fiphr-sd-nutrition-stu3_test). This way the tested data content won't be overwritten by automatic updates. Also other possible conflicts can be avoided.

See also the instructions at kanta.fi site https://www.kanta.fi/en/system-developers/sandbox-environments.

For communicating profile document changes chat.fhir.org and Finnish PHR PH SIG meetings are recommended.

view this post on Zulip Rita Ahde (Dec 07 2018 at 12:20):

@Mikael Rinnetmäki

As it was agreed in the last PH SIG meeting, here is the feedback on profile https://simplifier.net/finnishphrnutritionintake/fiphr-sd-nutritionintake-stu3

Observation.code.coding.code is now binded to fiphr-vs-nutrition, which includes also the code for FluidIntake, that is not allowed for resources that conform to this profile (FluidIntake has its own profile).

Observation.valueQuantity.unit/code allows now any unit, so it is not possible to validate that the unit is correct.

Please inform us when you have finalized the new version of the base profile and the NutritionIntake profile, including the components.

view this post on Zulip Mikael Rinnetmäki (Dec 12 2018 at 12:55):

Thanks, will do!

view this post on Zulip Mikael Rinnetmäki (Dec 28 2018 at 08:40):

I updated the Nutrition Intake profile to include components, http://fhirsandbox.kanta.fi/phr-resourceserver/baseStu3/StructureDefinition/74189f4f-9486-4867-be0b-26034b69be04?_format=json&_pretty=true

view this post on Zulip Mikael Rinnetmäki (Dec 28 2018 at 08:40):

It still does not enforce units, though.

view this post on Zulip Mikael Rinnetmäki (Dec 28 2018 at 08:43):

It would be nice to get the code for the base entry added into https://simplifier.net/finnishphr/fiphr-vs-nutrition. As presented in last meeting, our proposal is 9052-2 Calorie intake total.

view this post on Zulip Mikael Rinnetmäki (Dec 28 2018 at 08:45):

Regarding unit validation, I believe it would be _possible_ to build a validator that would validate the entries based on LOINC definitions, without having to duplicate the information in various profiles. Right?

view this post on Zulip Mikael Rinnetmäki (Jan 04 2019 at 12:31):

The recent message from @Lloyd McKenzie led at least me to rethink storing the nutrition intake as components. See
https://chat.fhir.org/#narrow/stream/179166-implementers/subject/variable.20value.20and.20percentage.20in.20component/near/154246708

So what do we think? Should a meal-logging app always store each macronutrient as a separate Observation? A diabetes treatment app might only be interested in carbohydrates and care less about fat and protein intake.

In addition to storing each macronutrient separately, the meal-logging app could then also store one more observation for total calorie consumption that would perhaps include a reference to each of the marconutrient observations.

view this post on Zulip Mikael Rinnetmäki (Jan 04 2019 at 12:35):

And how about when we include micronutrients? The main reason they are not included in the currently proposed profile is that there's no LOINC code for point-in-time micronutrient consumption. The other reason is that we want to start with what matters most. But if we at some time do want to include all the micronutrients too (there are a lot of them), would it be best to store them as separate observations?

Are there currently known (or imagined) use cases for accessing that data?

view this post on Zulip Anna Korpela (Jan 09 2019 at 10:29):

@Mikael Rinnetmäki

Storing macronutrients as separate Observations does sound better for Kanta PHR, as well as storing the total calorie consumption as a separate Observation as you suggested.

Although there are a lot of micronutrients, it might be good to store them as separate Observations as well, based on the same reasoning as with macronutrients. Someone might be interested for example only in vitamin C intake if one's suffering from deficiency of vitamin C. Would you think this is enough, or do we need in addition a panel Observation linking all these together (proteins, carbohydrates, fats, total calorie consumption, and also micronutrients in the future)? For example per meal?

About the unit validation: It certainly would be possible to build such a validator, we'll look into this and get back to you after we've estimated the work amount and a possible timetable for implementing it.

So, what we need for now is something like this:

1) a profile for Nutrition Intake that would be used for storing proteins, carbohydrated and fats. For determining the allowed codes, one option could be to use slicing as used for example in https://simplifier.net/finnishphr/fiphr-stepstaken-stu3 or https://simplifier.net/finnishphr/fiphr-bodytemperature-stu3. And without the suggested validator not yet in place, the unit of the value would be fixed to 'g'. We also came to think is 'Nutrition Intake' a good name for the profile for proteins, carbohydrates and fats, or should it be renamed (for example 'Macronutrients')? What do you think?

2) a profile for Total Calorie Consumption with a fixed code of 9052-2 Calorie intake total (THL will hopefully shortly verify if the code itself is okay to use here). And also here, the unit of the value fixed to 'kcal'. And with references allowed to Nutrition Intake Observations.
How does this sound?

And at some point later on, a separate(?) profile for micronutrients.

view this post on Zulip Anna Korpela (Jan 09 2019 at 10:37):

@Mikael Rinnetmäki Also, could you explain in which cases you will use the 'measured' codes, and when you'll use the 'estimated' codes for Nutrition Intake Observations?

view this post on Zulip Mikael Rinnetmäki (Jan 09 2019 at 10:43):

Thanks for the feedback @Anna Korpela!

OK, I'll roll the NutritionIntake profile back to the original proposal, with each nutrient in its own observation, no components. Regarding the codes, I agree slicing would be one option. I guess another would be to have a hierarchical value set, i.e., a ValueSet resource listing all the macronutrients, having a part-of relationship to the wider ValueSet for all nutrition info. Any feedback on that approach? That would feel much easier and more natural for me.

view this post on Zulip Mikael Rinnetmäki (Jan 09 2019 at 11:03):

The current view is that estimated would be the more widely used, and is used when a person either directly estimates the macronutrients of a meal, or estimates the portions of each meal component that are entered to a meal logging app which then calculates the macronutrient content. The measured codes would be used when there is no estimation involved from the person. For instance, when fully consuming a packaged meal with labelled nutrition info, or when the quantities of meals or meal components are in fact measured.

So

  • myself estimating carbohydrate content in a meal server to me is clearly estimated
  • myself estimating the components of the meal (3 medium size potatoes, 1,5 dl of sauce, ...) that I then enter to MealLogger app to get the macronutrients is still estimated, even if MealLogger gets the macronutrient info from a Fineli-like database that's based on measurements.
  • myself estimating to having eaten one third of a pack of ice-cream (the packaging having full nutrient info) is still estimated.
  • myself weighing and then consuming exactly half of that pack of ice-cream and entering the info based on the labeling would be measured.

  • myself calculating eating 10 spinach pancaces out of a package of 20 (with full announced nutrition content) and entering the nutrition info based on that would be measured.

I'd say in some cases we leave it as a selection available to the person using an app whether they consider the value estimated or calculated.
It may get a bit tricky when I'm for instance consuming one half of a pack of spinach pancakes from brand Saarioinen, and the database used by my meal logging app only has the information for spinach pancakes from brand Atria available. Personally, I think I'd still tag that case as measured, but I can be easily be convinced to tag that case otherwise.

view this post on Zulip Mikael Rinnetmäki (Jan 09 2019 at 11:14):

Regarding going further and including micronutrients, I think it would certainly be feasible to enter them. We would just need the point-in-time type LOINC-codes defined for all micronutrients. I personally don't see a need for a panel for these point-in-time measurements. I do see a use case for an app iterating through point-in-time observations and deriving panel observations like 81941-7 Micronutrient intake panel or 81942-5 Vitamin intake panel for daily intakes, based on individual meals.

For macronutrients, in my view the code 9052-2 Calorie intake total would be suitable for the "panel" observation grouping the diffferent macronutrient observations of a single meal.

view this post on Zulip Mikael Rinnetmäki (Jan 09 2019 at 11:24):

For the CalorieConsumption profile, do you have any views on whether it should refer to the (Macro)NutrientIntake observations using the hasMember or derivedFrom attribute? I can see justifications for both.

If it would have the same unit, i'd use hasMember. However, as the unit is different, I think you could argue that the calories are calculated (hence derivedFrom) the macronutrient observations. Any comments, anyone?

view this post on Zulip Anna Korpela (Jan 09 2019 at 14:55):

Thanks for the feedback @Anna Korpela!

OK, I'll roll the NutritionIntake profile back to the original proposal, with each nutrient in its own observation, no components. Regarding the codes, I agree slicing would be one option. I guess another would be to have a hierarchical value set, i.e., a ValueSet resource listing all the macronutrients, having a part-of relationship to the wider ValueSet for all nutrition info. Any feedback on that approach? That would feel much easier and more natural for me.

As long as this enables the platform to validate that one of the allowed codes is used, this would probably be okay. Maybe you could give an example of this?

view this post on Zulip Mikael Rinnetmäki (Jan 11 2019 at 13:59):

:+1: Will do.

view this post on Zulip Anna Korpela (Jan 14 2019 at 10:29):

For the CalorieConsumption profile, do you have any views on whether it should refer to the (Macro)NutrientIntake observations using the hasMember or derivedFrom attribute? I can see justifications for both.

If it would have the same unit, i'd use hasMember. However, as the unit is different, I think you could argue that the calories are calculated (hence derivedFrom) the macronutrient observations. Any comments, anyone?

We'd agree to use derived-from based on what you wrote here, as well as based on what R4 says about these http://hl7.org/fhir/observation.html#gr-other .

view this post on Zulip Esko Niinimäki (Jan 23 2019 at 12:45):

I'd say in some cases we leave it as a selection available to the person using an app whether they consider the value estimated or calculated.
It may get a bit tricky when I'm for instance consuming one half of a pack of spinach pancakes from brand Saarioinen, and the database used by my meal logging app only has the information for spinach pancakes from brand Atria available. Personally, I think I'd still tag that case as measured, but I can be easily be convinced to tag that case otherwise.

It depends on the product really. For example in pyttipannu the amount of sausage can be double on some brand compared to other brand -> I'd say estimated if it's convenience food (eines). But milk is the same regardless of the brand -> measured.

view this post on Zulip Mikael Rinnetmäki (Jan 27 2019 at 20:55):

The updates to the Nutrition Intake have been published at https://simplifier.net/finnishphrnutritionintake.

As proposed, the valueset is now split in two files. https://simplifier.net/finnishphrnutritionintake/fiphr-vs-macronutrients includes the codes for carbohydrate, fat, and protein intake. https://simplifier.net/finnishphrnutritionintake/fiphr-vs-nutrition imports that list and adds codes for fluid intake and calorie intake.

Macronutrient intake profile https://simplifier.net/finnishphrnutritionintake/fiphr-sd-macronutritientintake-stu3 limits the use to the macronutrient codes, and the unit to grams. This allows for adding another profile for micronutrients (in milligrams) in the future.

A separate profile, https://simplifier.net/finnishphrnutritionintake/fiphr-sd-calorieintake-stu3 can be used to express total calorie intake.

There's also a proposed profile for adding the URLs to the images by the MealLogger app, at https://simplifier.net/finnishphrnutritionintake/fiphr-sd-mediareference-stu3.

view this post on Zulip Mikael Rinnetmäki (Jan 27 2019 at 21:28):

The profiles are also stored in the sandbox environment, with -wellnessfoundry added to URLs, in order to avoid complications with existing resources and implementations.

Valuesets:
http://fhirsandbox.kanta.fi/phr-resourceserver/baseStu3/ValueSet/33751478-adfd-4cce-a53f-29ced82b64db (macronutrients)
http://fhirsandbox.kanta.fi/phr-resourceserver/baseStu3/ValueSet/b2f63801-6b4f-4d3b-9e17-0780a11612d9 (nutrition)

StructureDefitions:
http://fhirsandbox.kanta.fi/phr-resourceserver/baseStu3/StructureDefinition/696661ea-7600-4bb3-a17f-dd95d0b53386 (nutrition)
http://fhirsandbox.kanta.fi/phr-resourceserver/baseStu3/StructureDefinition/087f171c-eaf7-4511-b9a7-44a886bb2086 (macronutrient intake)
http://fhirsandbox.kanta.fi/phr-resourceserver/baseStu3/StructureDefinition/0083e392-db47-44e3-ab41-31adb41b72ef (calorie intake)
http://fhirsandbox.kanta.fi/phr-resourceserver/baseStu3/StructureDefinition/2cbb3538-463b-43d2-a8a0-e554b2156110 (media reference)

view this post on Zulip Mikael Rinnetmäki (Jan 27 2019 at 21:35):

There's also an example transaction for storing the resources based on a single meal (just the macronutrients) at https://simplifier.net/finnishphrnutritionintake/bundle-example. For some reason the sandbox environment does not like that bundle, rather rejects it with Error: HTTP 400 Bad Request: This is the base URL of FHIR server. Unable to handle this request, as it does not contain a resource type or operation name.. Any idea of what's failing? @Eeva Turkka are you able to check the logs?

The HAPI test server at https://fhirtest.uhn.ca/ processes the bundle OK (the patient id's need to be changed there).

view this post on Zulip Eeva Turkka (Jan 28 2019 at 09:37):

I'm able to check the logs, but the issue is that transactions are not currently one of the supported operations on the sandbox server. The documentation in the capability statement works a bit backwardly - transaction is not listed in the supported operations in the server interactions (see: https://simplifier.net/finnishphr/capabilitystatement3 ).

view this post on Zulip Mikael Rinnetmäki (Jan 28 2019 at 10:27):

OK, thanks! And :(, too.
Is there a reason for transactions not being supported? That may yet again affect the decision on whether we want to present each nutrient as a separate observation, or as components of a single observation.

view this post on Zulip Pirjo Vuorikallas (Jan 30 2019 at 14:02):

Hi, there is no single reason: we just have had to set some restrictions where to begin, so also these kind of change proposals are warmly welcome :-). Hope you can describe your needs more deeply at our Kanta PHR support meeting 13.2.2019 or even here before meeting, so we can think if we should support transactions.

view this post on Zulip Mikael Rinnetmäki (Feb 04 2019 at 09:53):

@Pirjo Vuorikallas the main point is for the client to be able to send all observations with one request, and either succeed or fail in a clerly defined manner.
This is important when the application is entering a meal with many macronutrients. It's a lot more complicated when you need to send each macronutrient observation separately, and maintain their relationships and ids to form a summary entry. It also causes many additional network requests.
There are now two examples at https://simplifier.net/finnishphrnutritionintake/~resources?category=Example&exampletype=Bundle&sortBy=RankScore_desc. The earlier one (https://simplifier.net/finnishphrnutritionintake/bundle-example) is a simple one, with just the macronutrients. Demonstrating how it would be much more convenient for the client to post just one message. The second example (https://simplifier.net/finnishphrnutritionintake/bundle-example-duplicate-2) is a more complex one, showing how the relationships between resources are a lot simpler to manage on client side when the client can use self-generated id's for new resources, which the server then updates to real id's for newly created resources.

view this post on Zulip Rita Ahde (Feb 04 2019 at 13:27):

@Mikael Rinnetmäki Have you already filled the PHR Data Content Proposal form for the media reference profile? If not, please do and send the form to kantakehitys@kanta.fi. Could you also offer a use case to clarify how media reference is to be utilized.

view this post on Zulip Mikael Rinnetmäki (Feb 05 2019 at 08:58):

Thanks @Rita Ahde, I just sent the form.

view this post on Zulip Mikael Rinnetmäki (Feb 05 2019 at 08:58):

The use case is:
MealLogger is an AI assisted nutrition diary app. It analyses the contents of a meal image and helps the user to select the contents of the meal. It then calculates the nutrition intake based on selected ingredients and amounts.
The application already stores information on the nutrition to Kanta PHR (test environment). It would be nice to be able to store information about the image too.
We propose not to store the image itself, rather only the metadata (the url where the image can be fetched from, and optionally the type, file size and dimensions of the image.

view this post on Zulip Mikael Rinnetmäki (Apr 01 2019 at 08:16):

The latest profiles don't seem to be updated into the sandbox yet. Is this correct?

For instance, http://fhirsandbox.kanta.fi/phr-resourceserver/baseStu3/StructureDefinition?url=http://phr.kanta.fi/StructureDefinition/fiphr-sd-macronutrientintake-stu3&_format=json returns an empty result set.

view this post on Zulip Mikael Rinnetmäki (Apr 01 2019 at 08:18):

On a related note, it seems it's no longer possible to search for the StructureDefinitions via the sanbox GUI.

http://fhirsandbox.kanta.fi/phr-resourceserver-ui/resource?serverId=home&pretty=false&resource=StructureDefinition does show the url as a possible search parameter, but does not allow it to be entered anywhere?

view this post on Zulip Eeva Turkka (Apr 01 2019 at 10:35):

The url-parameter in the Hapi tester-page has been buggy quite a while (at least 2017: https://github.com/jamesagnew/hapi-fhir/issues/721) and it's broken in the vanilla tester for me as well: http://hapi.fhir.org/resource?serverId=home_21&pretty=false&resource=StructureDefinition - the url parameter itself works though.

view this post on Zulip Anna Korpela (Apr 01 2019 at 11:20):

The latest profiles should be available in Sandbox now.


Last updated: Apr 12 2022 at 19:14 UTC