Physiology Mapping Functions #1348
awatson1978
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
With the new physiology models being introduced into Synthea, we have a need for some documentation around the physiology mapping functions. I originally described this as "write[ing] an expression that intersects the sine wave to create periods of sleep/awake". But instead of doing the optimizations ourselves, we will be leaving it as an exercise to the user to adjust the mapping functions for their specific use case. The following is proposed documentation notes to be included in the Wiki:
Physiology Generator Inputs/Outputs
Each of the new physiology models is managed by a generator function, which handles inputs and outputs into the set of partial differential equations contained within the model. Example input and outputs looks like the following:
Users of Synthea who wish to customize and optimize these physiology models to their use cases are encouraged to look at the
fromExp
field, which contains a mapping function that can be optimized for particular use cases. In particular, we note the following functionalities that users should be aware of:#{foo}
syntax.if then else
functionality is supported within the expressions.Max() and Min()
functions.to
field.With this syntax and grammar, motivated users can optimize these physiology functions to produce daily activity patterns that the simulated patients follow, such as taking medications each day, exercising, or other behaviors. Seasonal trends can be developed. Acute response to emergencies and accidents can be modeled. And so forth.
Intersecting the Graph
It's important to understand that the physiology models produce continuous theoretical data for the patient over a discrete time period. This data is
not
the kind of data that would be generated by any particular medical device or wearable; rather, these models describe a theoretical representation of the biological functions going on within a person; of which a medical device or wearable will take a discrete snapshot at any particular time.To put it in calculus terms, these models represent continuous functions; and any particular clinical observation will be a derivative function at a specific moment in time.
To visualize this, imaging the circadian cycle; which is roughly timed with the human sleep/wake cycle. Physiologically, this cycle is generally measured by melatonin and cortisol levels, which are increasing and decreasing throughout the day.
At certain thresholds, these melatonin and cortisol levels impact a person's natural sleep cycle, in both the time of day they go to sleep, and the length of sleep. We can represent that with an intersecting function, like so.
And what we're seeking with these optimized functions, is to take our continuous theoretical function, and filter it, such that it produces the same data that we might obtain from an empirical clinical measurement. So, for instance, wearing an iWatch with a sleep tracking app, might generate the following data:
Another use case for these intersecting functions, is that of setting sensitivity thresholds. Consider the case of an ECG monitor. In the following 10s example, we have an intersecting function that produces a count of N=7 beats per 10s, which could then be mapped to a FHIR Observation for a single vital signs measurement.
Alternatively, if we adjusting the threshold of our intersecting function, we could create a more permissive filter, with a count of N=11.
Such thresholding allows us to use the physiology models in increasingly complex ways. We may take the same model, and use it to generate physiology data:
Or, we might focus on a different part of the continuous function, and use the intersecting function to generate behavioral or mood data instead.
Similar, depending on thresholding levels, one might use a pulmonary oxygen intake model to model chest breathing vs diaphragmatic breathing.
Intersection Function
How these functions are used to represent discrete data generated by medical devices and wearables is left to the reader. Suffice it to say that you'll want something like the following:
Or better yet, perhaps the following
Get creative. Between
if/then
statements, functions, and input/output mapping, there's enough flexibility to get creative and use these physiology models to create all sorts of example wearables data.Beta Was this translation helpful? Give feedback.
All reactions