synthetichealth / synthea

Synthetic Patient Population Simulator
https://synthetichealth.github.io/synthea
Apache License 2.0
2.19k stars 655 forks source link

Observations with referenceRange and Interpretation #731

Open jdelucaa opened 4 years ago

jdelucaa commented 4 years ago

I use Synthea to generate some laboratory and vital signs observations, but I don't see the referenceRange neither the interpretation being generated for those observations.

How can I have observations with that content included?

Thanks in advance.

jawalonoski commented 4 years ago

@jdelucaa That is not currently a supported option.

Theoretically, a change could be implemented that would fill out some of the reference ranges using the biometrics.yml file, but that would not be comprehensive.

I'm not sure there is an easy path towards populating interpretation.

jdelucaa commented 4 years ago

Hey @jawalonoski, thanks for the answer.

Should I close this issue?

jawalonoski commented 4 years ago

Let's leave it open for now. Maybe this will be addressed in the future and this tracks the issue.

TerriblyVexed commented 3 years ago

I am also having the same issue. This functionality interests me very much. @jawalonoski could you expound on your theory? I have followed what you intend conceptually but am unable to figure out how to implement it. Is it just a matter of adding lines in the YAML file for low, high, etc.? Specifically for BP. As in metabolic: blood_pressure: normal: systolic: [100,139] # mmHg diastolic: [70,89] # mmHg hypertensive: systolic: [140,160,200] # mmHg diastolic: [90,120] # mmHg low: systolic: [99,0] #mmHg diastolic: [69,0] #mmHg high: systolic: [140,200] #mmHg diastolic: [90,120] #mmHg

Are there other changes that would need to be made? Like to BiometricsConfig.java and BloodPressureValueGenerator.java? Or would it require a completely new class (like BloodPressureReferenceRangeGenerator.java)?

jawalonoski commented 3 years ago

Currently, the biometrics.yml file has ranges that are used for vital signs. The thought was to add reference ranges to this list. So, for example:

metabolic:
  blood_pressure:
    normal:
      systolic: [100,139] # mmHg
      diastolic: [70,89]  # mmHg
    hypertensive:
      systolic: [140,160,200] # mmHg
      diastolic: [90,120] # mmHg
    reference: # new section
      systolic: [100, 120] # made up range
      diastolic: [70,90] # made up range

That is probably a bad example though, because I'm not sure reference ranges are typically used for blood pressure.

Instead, they are more useful for lab results, e.g. White Blood Cell counts in a Blood Panel, Amino Acids in a Urine Panel, that sort of thing.

One problem: where do all these references ranges come from?

A second problem: how do you encode them in Synthea?

A third problem: how do you match them observations or panels in the modules and the exporters?

TerriblyVexed commented 3 years ago

Thank you so much for the swift reply. I really appreciate your time. I tried your example as well as my own. There's something I'm not understanding about how to tell Synthea about these changes. I will make a change in a particular file (syhthea.properties), move to a different code file and come back and it has been updated by another program and my changes rolled back. So I thought it was a build issue, but a gradle build fails with errors talking about file lengths not being the correct amount of characters and such. So there is some kind of manifest file or something I'm not seeing. So I'm sure that is a me thing - if you could help me overcome that I'd appreciate it.

Then, I understand what you mean about BP being a bad example, but it is my control for testing this reference range functionality. Once it's correct I can apply it in a targeted fashion elsewhere.

The whole thrust behind wanting to do this is that I'm building a FHIR parser and currently working on Observation. I don't think referenceRange will be used very often in the real world, but as soon as I let it go don't you know that'll be the one requirement that was "most needed". More than anything I'm trying to cover off on the parser being fully functional in case the need arises.

As far as source for the ranges, those will be coming from the end user. So whatever they deem reference is what I will implement.

I think for the 2nd and 3rd problems that is what I meant about "other changes" that would be needed. I have been looking for code snippets in Synthea that may provide clues as to where they would be implemented. Ergo the reference to BloodPressureValueGenerator and BiometricsConfig.

jawalonoski commented 3 years ago

Regarding "my changes rolled back" -- this probably goes without saying, but make sure you are editing the files in the src folder, and not build or bin.

I'm not familiar with gradle failing with file length issues, I haven't seen that before.

hadleynet commented 3 years ago

I've seen path length issues on Windows in the past. If you have the Synthea code in a set of nested directories then you could try moving it to your home directory to see if that helps.

TerriblyVexed commented 3 years ago

Yea-I'm a dork! Was editing build files, not src files.

I will try again and post back my results.

TerriblyVexed commented 3 years ago

Ok I couldn't figure it all out. I just resorted to adding the referenceRange data manually to test my parser. It proves that if the data files have that element it will be populated in the database. If there is a way to make this happen in Synthea I'd still be interested in that.

Also if anyone knows of a comprehensive source for exercising all the possible values for all the resources that would be of great interest. Somehow I go ahold of observation.ndjson and that has a lot of examples. But I don't know where I got it from. Thought it may have been from HL7.org directly but now I can't find it.