synthetichealth / synthea

Synthetic Patient Population Simulator

Home Page:https://synthetichealth.github.io/synthea

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I am trying to generate some dataset which contains bodySite in Condition (Condition.bodySite)

jegaths opened this issue · comments

Requested Feature

I am trying to generate some dataset which contains bodySite in condition. But I cannot find a way to do it.

https://www.hl7.org/fhir/condition.html -> It is mentioned here that we can have bodySite inside condition and I need that for a filter I am working on. But am not able to generate that.

These are the properties am using

exporter.fhir.export = true
exporter.fhir.transaction_bundle = true
exporter.metadata.export = false
generate.default_population = 2

This is the command I am using

java -jar synthea-with-dependencies.jar -c ./synthea.properties

Is there any way to add Condition.bodySite?

There's no simple flag or configurations setting that can be set to make the exported data contain Condition.bodySite, however you can use the Flexporter to add it. Instructions on using the flexporter are here: https://github.com/synthetichealth/synthea/wiki/Flexporter

Essentially what you can do with the flexporter is define a set of rules that add the field when some condition is met. If you don't care whether the bodySite is logically consistent with the Condition resource and just need it to be present, you could add a very simple rule along the lines of "add this to all Conditions". Or if there is a specific Condition you are interested in, you could add it to only those Conditions, based on the code. Two sample flexporter mappings are below, hopefully these are enough to get you started but feel free to ask if you have further questions:

Add a bodysite to all Conditions:

---
name: Add BodySite

applicability: true

actions:
 - set_values:
     - applicability: Condition
       fields:
         - location: Condition.bodySite[0].coding
           value:
               system: http://snomed.info/sct
               code: "23416004"
               display: "Bone structure of ulna (body structure)"

Add a bodysite to Conditions with code 65966004 (Fracture of forearm)

---
name: Add BodySite

applicability: true

actions:
 - set_values:
     - applicability: Condition.code.coding.where($this.code = '65966004')
       fields:
         - location: Condition.bodySite[0].coding
           value:
               system: http://snomed.info/sct
               code: "23416004"
               display: "Bone structure of ulna (body structure)"