- [Instructor] Synthea is essentially a tool
for generating patient populations.
So, basically if you wanna create real data
or real adjacent data for patients
without it being real patient data,
this lets you build those patients
based on kind of useful expected clinical workflows.
So, using prevalence and demographic statistics
and stuff like that, to determine, you know,
what should this population look like?
What would we expect to see in a patient record?
So with that in mind,
basically Synthea sends patients through Modules
and these Modules,
there's kind of a bunch of the top things
that, you know, people experience,
but you could definitely build additional Modules
to include additional clinical information.
Just to kinda understand how the Modules work,
this is the Appendicitis Module.
And so, I think it's kind of helpful to like,
think about, okay, if there's a patient
that were going through this Module,
this Module were being applied to a patient
as it would be applied to every patient
in the set Synthea creates when you run it.
What would that look like going through it?
It essentially works by stepping through a week at a time.
And so, there's some number of patients,
you know, and then there's some max age
that a patient could be.
So if we said,
you know, a patient could at max age be 100,
Synthea would start a hundred years ago
and then go week by week,
and run patients as they start existing through the Modules.
Let's say that
our patient was born in 1992,
then it kind of step through, step through.
And then when it gets to 1992,
okay, our patient is born
and we go and we execute the Module here.
So, we start at initial and if we,
we can go to gender, male, gender, female
or else is the other option over here.
And else just goes to the Terminal State
which means basically nothing in this Module,
it'll apply to that patient.
But at our Initial State here,
just based on that patient when it's born,
basic demographic information
that's generated for that patient.
Let's say that patient is male.
So, we go down this transition here.
So, we're from the Initial State
through a transition to a Simple State here.
So the Simple State male is just saying,
you know, it's simple,
there's really nothing else here that's gonna happen
but it's something to help kind of control our flow.
So, if we're in the male state,
for a male
the prevalence of appendicitis is 8.6%.
So at some 8.6% of males will get appendicitis
in their lifetime.
Similarly for females is 6.7%.
So if we look at the two transitions
coming off of male here, we see 8.6% there.
And the other transition all the way down here, 91.4%,
so that's the other, you know,
up to 100%, they need to a add up
'cause it's two transitions going out.
So otherwise, you know, they're not getting appendicitis.
So again, we go to Terminal
and anything else in this Module
doesn't execute for that patient.
So, if we go assume that our male gets appendicitis,
so he's in that 8.6%.
So we transition to this Pre-appendicitis State
and this state is just representative
at some point in this person's life
they will have appendicitis
but when that happens, it varies by age,
so how common it is.
So it's only 9.3% of people who get appendicitis
at some point in their life,
get it when they're greater than 65 years old.
And then, so let's say that just,
we had to roll the die here
and our male gets appendicitis
between the ages of one and 17.
So this state here,
so once we've kind of determined we've moved to this state,
this is a Delay State.
So the way a Delay State works is
you can give it a amount of time or a range of time
with which the Module will just stay here
until that point in time is reached.
So as we said, we started in 1992,
let's say our, so our patient gets appendicitis at 16,
so this is essentially a random number is chosen
between one and 17 years later.
So, let's say 16 years later.
So, this Module will delay
until that age 16 has been reached.
So it'll tick through week by week,
you know, we're going from 1992 to 2008,
and then we reach 2008
and then this state, this Delay State is like,
okay, we've reached 2008 and it evaluates.
And it goes through to the next state
which is Appendicitis Symptom one here.
The next few states are a series of symptoms.
So we're sometime in, you know, 2008.
Let's say, I dunno, it's September 1st, 2008.
September 1st, 2008, we have the onset of symptoms.
So what we can imagine kind of from here
is as we go through certain things
will be added to the Model of this patient.
So we're kind of building up the Model of this patient
which we could eventually export
in a couple of different formats
but we're starting to build up the Model here.
So in September 1st, 2008,
we have the onset of a symptom, Abdominal Pain.
So for a Symptom State,
so this is one of several Clinical States.
The Symptom State has this range here,
so if the symptom is somewhere in the range of certain value
then that's when you'd say,
you know, yes, this is,
you're gonna transition to the next state.
So, the symptom pain here,
Abdominal Pain here,
we assume it's somewhere in this range, randomly chosen.
So we're gonna assign, I don't know,
Abdominal Pain level 75 to the Symptom in our Model
and then similar for the next few.
The symptom, Fever, let's say, you know,
we assign randomly 70,
the symptom Loss of Appetite,
we can say is, you know, 90,
the symptom Nausea/Vomiting
as somewhere between zero and 50,
so that could be like 10.
And then we have Diarrhea,
is also zero to 50,
Bleeding and Gas zero to 50
and Constipation, zero to 50.
So we can put all of those at a random number
somewhere between zero and 50 to build up our Model here.
So the next thing we have here is the Symptom Period.
So, this is a Delay State again,
so it's similar to the Delay State
we saw up here with age years,
but this Delay State instead of being for age
is waiting a period.
So, this will wait one to three days.
So, we briefly mentioned earlier
that Synthea will take every seven days.
So when there's a delay, that's actually,
you know, you might hit this off of that tick, right?
So we are on September 1st.
Let's say this randomly selected delay is two days.
So, two days selected from one to three
but if we do one tick, we're going up to September 8th.
So what will happen is Synthea
actually does a tick forward to September 8th.
And then when it realizes it's kind of
past the point for this delay clause,
it'll actually rewind back to September 3rd,
and then continue on this Module.
And once it does get to a state where it's kind of stuck
it'll replay that tick to September 8th.
So the next thing that we're hitting here,
once we get to September 3rd
is the Appendicitis Condition Onset.
So the Condition Onset is another Clinical State.
This is also a little bit special.
So, condition onset is in the Model,
would start on September 3rd in this case
but it actually won't set a diagnosis date
until there is an encounter that is associated with it.
So in this case, it won't set the diagnosis date
until the Appendicitis Encounter.
So, it'll be either a concurrent or future encounter
for which it will set the diagnosis.
So then if we look, we can go 30% of the transitions
go to a Rupture versus 70% go to Appendicitis Encounter.
So if we assume that there's a Rupture,
there's an additional condition onset here
of Rupture of Appendix.
So, both of those have diagnosed at Appendicitis Encounter.
So once we get to the next date here
we immediately transition to Appendicitis Encounter.
Again, this is still on September 3rd,
because we're not really doing any delays.
There's no kind of time captures here
to make this state different, so this is concurrent.
So concurrently the appendicitis counter
will set the diagnosis for both the Appendicitis
and Rupture condition onset.
So at this encounter here
we have Emergency Room Admission, reason, Appendicitis.
So, Encounters are kind of a special Clinical State
where in Synthea, it will set the Current Encounter
whenever you have an Encounter State come up.
So, this Appendicitis Encounter
will be our Current Encounter
until we reach an Encounter End.
So, the next state we transition to
is the History of Appendectomy State.
So this is now a new Condition Onset.
And again, we have a Diagnosis Encounter coming up.
So the diagnosis at Appendectomy Encounter
will be the Concurrent Encounter
which this diagnosis will start.
In order for that encounter to start,
first we're going to end the Current Encounter,
so there's Encounter End here.
And that is for the transfer to inpatient.
So that state can then move us into the next encounter,
which is the Appendectomy Encounter.
This becomes our new Current Encounter
until the end of this encounter.
And we can see this Clinical State here
using the SNOMED code
to show that it is an encounter inpatient with the,
and then we can set the reason to Appendicitis
before moving to the next state.
So, that gets added to our Patient Model
and then the Appendectomy Procedure
gets added to our Patient Model.
So, the procedure has a duration of 40 to 70 minutes.
So the duration in our Patient Model
is gonna be randomly chosen between 40 and 70 minutes.
And that gets added to our Model
before we go to the Appendicitis Symptom one ends.
So we're gonna go through a couple of Symptom Ends
before we end this encounter.
And this procedure is kind of embedded
as part of this encounter.
So, it will be associated with whatever
the Current Encounter is at the time of the procedure.
So, we set all of the symptoms to zero
that we set before to higher symptom levels.
And so, that will transition one to the next
all the way through to Recovery.
And so this is the Delay State
and this will actually wait here
for our next tick in Synthea.
So, all of this was happening concurrently
there weren't delays,
so all of this actually was happening
on that September 3rd day.
And so this Recovery, we enter another delay.
And if we say, you know, seven days from our initial,
our previous tick was September 1st,
so seven days later would be September 8th.
So, this would be somewhere between one to five days
if we assume that we add three days on here,
was the randomly chosen delay.
Then we would end up at September 6th
and that's still before our next tick.
So we would stop there,
do our take and then rewind again
before going to September 8th.
So Recovery,
then on the 6th
will lead us to this End Appendectomy Encounter.
So, the Encounter End will be on September 6th,
and we see the Discharge Disposition
is another
attribute that can be set here
showing discharge to home care, self care.
So that is kind of the end
of anything to do with this Appendicitis Module,
and we then transition to Terminal.
So, that is all of the pieces that would be added
to the Model for this patient for the Appendicitis Module.