Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate only patients that went through a specific Encounter or Procedure #1509

Open
TaisKha opened this issue Sep 19, 2024 · 1 comment
Open

Comments

@TaisKha
Copy link

TaisKha commented Sep 19, 2024

Requested Feature

Hello. We need to generate only patients that had a surgery - ideally insertion of a pacemaker. (Or if not possible with the pacemaker, then at least any surgery).
So, for example, I have found this module

and would like to generate the patients that went through the "Surgical encounter". Or from the same module, I would like to filter out patients that went through Procedure "LVAD insertion" .

I guess I need to use Keep module feature, but I cannot figure it out how to structure the JSON file in a way that it does what I want.

How can I achieve such a filtering?
Is there a module for the pacemaker insertion?

@dehall
Copy link
Contributor

dehall commented Sep 30, 2024

This isn't documented anywhere but because of how the health record entries are modeled in Synthea, you can also use the "Active Condition" logic to also represent "Procedure Performed". You might want something like this for your keep module:

{
  "name": "Generated Keep Module",
  "states": {
    "Initial": {
      "type": "Initial",
      "name": "Initial",
      "conditional_transition": [
        {
          "transition": "Keep",
          "condition": {
            "condition_type": "And",
            "conditions": [
              {
                "condition_type": "Active Condition",
                "codes": [
                  {
                    "system": "SNOMED-CT",
                    "code": "232967006",
                    "display": "Implantation of left ventricular assist device (procedure)"
                  }
                ]
              }
            ]
          }
        },
        {
          "transition": "Terminal"
        }
      ]
    },
    "Terminal": {
      "type": "Terminal",
      "name": "Terminal"
    },
    "Keep": {
      "type": "Terminal",
      "name": "Keep"
    }
  },
  "gmf_version": 2
}

(created using the customizer at https://synthetichealth.github.io/spt/#/customizer )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants