synthetichealth / synthea Goto Github PK
View Code? Open in Web Editor NEWSynthetic Patient Population Simulator
Home Page: https://synthetichealth.github.io/synthea
License: Apache License 2.0
Synthetic Patient Population Simulator
Home Page: https://synthetichealth.github.io/synthea
License: Apache License 2.0
Occasionally living patients are exported with their death date set (for sometime in the future). This is typically for patients with lung cancer that haven't died yet, but will shortly. Synthea should only export death dates for patients that are actually deceased.
Also the deceasedBoolean
in the FHIR record should be set alongside the deceasedDateTime
to make it easier to query deceased/living patients.
When a patient gets a Knee_Injury, the following sequence of states can be observed:
Knee_Injury [Simple]
ED_Visit_For_Knee_Injury [Encounter]
Torn_ACL [ConditionOnset]
Wait_For_Knee_Surgery [Delay]
Knee_Surgery_Encounter [Encounter]
Knee_Surgery_Procedure [Procedure]
Knee_Injury_Prescribe_Pain_Medication [Simple]
Knee_Injury_Prescribe_Non_Opioid [MedicationOrder]
Knee_Injury_CarePlan [CarePlanStart]
The problem I see is that the Knee_Injury_CarePlan state is referencing the ED_Visit_For_Knee_Injury state. Because the Wait_For_Knee_Surgery delay advances the clock by one week, the referenced ED visit violates the CarePlanStart requirement: "The CarePlanStart state must come after a target_encounter Encounter state in the module, but must have the same start time as that Encounter; otherwise it will not be recorded in the patient's record."
In my implementation, the problem manifests itself because the subsequent End_Injury_CarePlan state cannot find the CarePlan and throws an exception.
Here's the full state trace:
Knee_Injury [Simple]
ED_Visit_For_Knee_Injury [Encounter]
Torn_ACL [ConditionOnset]
Wait_For_Knee_Surgery [Delay]
Knee_Surgery_Encounter [Encounter]
Knee_Surgery_Procedure [Procedure]
Knee_Injury_Prescribe_Pain_Medication [Simple]
Knee_Injury_Prescribe_Non_Opioid [MedicationOrder]
Knee_Injury_CarePlan [CarePlanStart]
Knee_Injury_Recovery_Period [Delay]
End_Knee_Injury [ConditionEnd]
Conclude_Injury [Simple]
End_Injury_CarePlan [CarePlanEnd]
I tried, instead, to make the Knee_Injury_CarePlan reference the Knee_Surgery_Encounter. This worked for the Torn_ACL but results in another error in the Torn_Meniscus case where there is no Delay.
Knee_Injury [Simple]
ED_Visit_For_Knee_Injury [Encounter]
Torn_Meniscus [ConditionOnset]
Knee_Injury_CarePlan [CarePlanStart]
Knee_Injury_Recovery_Period [Delay]
End_Knee_Injury [ConditionEnd]
Conclude_Injury [Simple]
End_Injury_CarePlan [CarePlanEnd]
So its tricky I guess...
Currently all patients are born in Massachusetts, yet only 80% speak English (as their primary native language). Immigration likely accounts for non-English speakers, so those people ought to have a foreign place of birth.
The following states still have target_encounter references in the modules but not in the wiki:
MedicationOrder
Procedure
CarePlanStart
Observation
From the Encounter Documentation:
"During a single time step, if an Encounter state is processed it becomes the current_encounter. This encounter will be used as the encounter for all subsequent clinical states, for example a Procedure or MedicationOrder. When an EncounterEnd state is reached, the current_encounter ends and remains nil until another Encounter is processed. If Synthea cannot identify a current_encounter for a clinical state an error is raised."
I removed the target_encounter fields from the above states in order to implement the new encounter policy but I'm getting a lot of errors due (I believe) to forward encounter references still in the modules.
I notice that there are no instances of the VitalSign state in the current module set. I need to implement a full set of vital signs in order to provide realistic values for the Observations that query them.
Is there a plan to create a module that would set and update the vital signs using this state?
Jay wrote on another thread:
"We started transitioning to a scheme where the current encounter was always in context, which eliminated the need for target_encounter in most cases. You can still set these attributes, but their use is deprecated, which is why references have been removed from the wiki."
I tried removing the target_encounters from Observation, Procedure, MedicationOrder and CarePlanStart states. A quick run yielded immediate failures. Surveying the existing modules indicates they are still in wide use.
As long as their use is still widespread and is still required, it seems premature to remove them from the documentation.
Jeff
Wellness Encounters.Record_Height [Observation] -> Wellness_Encounter
Wellness Encounters.Record_Weight [Observation] -> Wellness_Encounter
Wellness Encounters.Record_BMI [Observation] -> Wellness_Encounter
Wellness Encounters.Record_Systolic_BP [Observation] -> Wellness_Encounter
Wellness Encounters.Record_Diastolic_BP [Observation] -> Wellness_Encounter
Wellness Encounters.Record_HA1C [Observation] -> Wellness_Encounter
Wellness Encounters.Record_Glucose [Observation] -> Wellness_Encounter
Wellness Encounters.Record_UreaNitrogen [Observation] -> Wellness_Encounter
Wellness Encounters.Record_Creatinine [Observation] -> Wellness_Encounter
Wellness Encounters.Record_Calcium [Observation] -> Wellness_Encounter
Wellness Encounters.Record_Sodium [Observation] -> Wellness_Encounter
Wellness Encounters.Record_Potassium [Observation] -> Wellness_Encounter
Wellness Encounters.Record_Chloride [Observation] -> Wellness_Encounter
Wellness Encounters.Record_CO2 [Observation] -> Wellness_Encounter
Wellness Encounters.Record_Cholesterol [Observation] -> Wellness_Encounter
Wellness Encounters.Record_Triglycerides [Observation] -> Wellness_Encounter
Wellness Encounters.Record_LDL [Observation] -> Wellness_Encounter
Wellness Encounters.Record_HDL [Observation] -> Wellness_Encounter
Wellness Encounters.Record_ACR [Observation] -> Wellness_Encounter
Wellness Encounters.Record_EGFR [Observation] -> Wellness_Encounter
Allergy Immunotherapy.Immunotherapy_Procedure [Procedure] -> Immunotherapy_Treatment
Appendicitis.Appendectomy [Procedure] -> Appendectomy_Encounter
Asthma.Asthma_Screening [Procedure] -> Asthma_Diagnosis
Attention Deficit Disorder.Behavior_Treatment_Procedure [Procedure] -> Behavior_Treatment_Encounter
Colorectal Cancer.Routine_Colonoscopy_Procedure [Procedure] -> Routine_Colonoscopy_Encounter
Colorectal Cancer.Fecal_Test [Procedure] -> Routine_Colonoscopy_Encounter
Colorectal Cancer.Adenoma_Removal [Procedure] -> Routine_Colonoscopy_Encounter
Colorectal Cancer.Adenoma_Biopsy [Procedure] -> Routine_Colonoscopy_Encounter
Colorectal Cancer.Followup_Colonoscopy_Procedure [Procedure] -> Followup_Colonoscopy_Encounter
Colorectal Cancer.Recurrent_Adenoma_Removal [Procedure] -> Followup_Colonoscopy_Encounter
Colorectal Cancer.Diagnostic_Colonoscopy_Procedure [Procedure] -> Diagnostic_Colonoscopy_Encounter
Colorectal Cancer.Partial_Colectomy_Procedure [Procedure] -> Partial_Colectomy_Encounter
Colorectal Cancer.Diverting_Colostomy_Procedure [Procedure] -> Diverting_Colostomy_Encounter
Colorectal Cancer.Chemotherapy_Procedure [Procedure] -> Chemotherapy_Encounter
COPD.Initial_FEV_Test [Procedure] -> DiagnosisEncounter
COPD.Followup_FEV_Test [Procedure] -> COPD_Followup_Encounter
COPD.Lung_Transplant [Procedure] -> Surgery_Encounter
COPD.Lung_Volume_Reduction [Procedure] -> Surgery_Encounter
COPD.Pulmonary_Rehab [Procedure] -> COPD_Followup_Encounter
Lung Cancer.Chest X-Ray [Procedure] -> Diagnosis Encounter I
Lung Cancer.Chest CT Scan [Procedure] -> Diagnosis Encounter II
Lung Cancer.Sputum Cytology (Phelgm) [Procedure] -> Diagnosis Encounter III
Lung Cancer.Thoracentesis (Fluid) [Procedure] -> Diagnosis Encounter III
Lung Cancer.Needle Biopsy (Cells) [Procedure] -> Diagnosis Encounter III
Lung Cancer.Bronchoscopy (Tube) [Procedure] -> Diagnosis Encounter III
Lung Cancer.MRI Brain [Procedure] -> Diagnosis Encounter IV
Lung Cancer.SCLC Radiation [Procedure] -> SCLC Treatment Encounter
Lung Cancer.NSCLC Radiation [Procedure] -> NSCLC Treatment Encounter
Medication Reconciliation.Med_Rec [Procedure] -> Wellness_Encounter
Opioid Addiction.Enter_Directed_Use_Procedure1 [Procedure] -> Enter_Directed_Use_Encounter1
Pregnancy.Pregnancy_Test [Procedure] -> Prenatal_Initial_Visit
Pregnancy.Induction [Procedure] -> Hospital_Admission_For_Birth
Pregnancy.Epidural [Procedure] -> Hospital_Admission_For_Birth
Pregnancy.Augmentation [Procedure] -> Hospital_Admission_For_Birth
Pregnancy.Episiotomy [Procedure] -> Hospital_Admission_For_Birth
Pregnancy.Assisted_Delivery [Procedure] -> Hospital_Admission_For_Birth
Pregnancy.Spontaneous_Breech [Procedure] -> Hospital_Admission_For_Birth
Pregnancy.Normal_Birth_Procedure [Procedure] -> Hospital_Admission_For_Birth
Pregnancy.Premature_Birth_Procedure [Procedure] -> Hospital_Admission_For_Birth
Pregnancy.Induced_Birth_Procedure [Procedure] -> Hospital_Admission_For_Birth
Pregnancy.Ectopic_Pregnancy_Surgery_Procedure [Procedure] -> Ectopic_Pregnancy_Surgery_Encounter
Pregnancy.Induced_Abortion_Procedure [Procedure] -> Induced_Abortion_Encounter
Self Harm.Psychiatric_Evaluation [Procedure] -> ED_Visit_For_Attempted_Suicide
Self Harm.Short_Hospital_Stay [Procedure] -> ED_Visit_For_Attempted_Suicide
Self Harm.Followup_Psychiatric_Evaluation [Procedure] -> Attempted_Suicide_Followup
Self Harm.Autopsy_Examination [Procedure] -> Autopsy_Encounter
Sinusitis.Sinus_Surgery [Procedure] -> Chronic_Sinusitis_Followup
Sore Throat.Throat_Culture [Procedure] -> Doctor_Visit
Total Joint Replacement.Knee_Replacement_Procedure [Procedure] -> Joint_Replacement_Encounter
Total Joint Replacement.Hip_Replacement_Procedure [Procedure] -> Joint_Replacement_Encounter
Asthma.Prescribe_Maintenance_Inhaler [MedicationOrder] -> Asthma_Diagnosis
Asthma.Prescribe_Emergency_Inhaler [MedicationOrder] -> Asthma_Diagnosis
Attention Deficit Disorder.Ritalin [MedicationOrder] -> ADHD_Diagnosis
Attention Deficit Disorder.Strattera [MedicationOrder] -> ADHD_Diagnosis
Colorectal Cancer.Chemotherapy_Drugs_I [MedicationOrder] -> Chemotherapy_Encounter
Colorectal Cancer.Chemotherapy_Drugs_II [MedicationOrder] -> Chemotherapy_Encounter
COPD.Prescribe_Medication [MedicationOrder] -> COPD_Followup_Encounter
Dementia.FirstPrescription1 [MedicationOrder] -> DiagnosisEncounter
Dementia.FirstPrescription2 [MedicationOrder] -> DiagnosisEncounter
Dementia.FirstPrescription3 [MedicationOrder] -> DiagnosisEncounter
Dementia.SecondPrescription1 [MedicationOrder] -> ModeratelySevere_Encounter
Dementia.SecondPrescription2 [MedicationOrder] -> ModeratelySevere_Encounter
Dementia.SecondPrescription3 [MedicationOrder] -> ModeratelySevere_Encounter
Fibromyalgia.Strong_NSAID [MedicationOrder] -> Fibromyalgia_Diagnosis
Fibromyalgia.Prescribe_Lyrica [MedicationOrder] -> Fibromyalgia_Episode
Fibromyalgia.Prescribe_Cymbalta [MedicationOrder] -> Fibromyalgia_Episode
Fibromyalgia.Prescribe_Savella [MedicationOrder] -> Fibromyalgia_Episode
Fibromyalgia.Prescribe_Opioid [MedicationOrder] -> Fibromyalgia_Episode
Gout.Strong_NSAID [MedicationOrder] -> Gout_Diagnosis
Gout.Colchicine [MedicationOrder] -> Gout_Diagnosis
Gout.Uric_Acid_Reducer [MedicationOrder] -> Gout_Diagnosis
Lung Cancer.SCLC Chemotheraphy I [MedicationOrder] -> SCLC Treatment Encounter
Lung Cancer.SCLC Chemotheraphy II [MedicationOrder] -> SCLC Treatment Encounter
Lung Cancer.NSCLC Chemotheraphy I [MedicationOrder] -> NSCLC Treatment Encounter
Lung Cancer.NSCLC Chemotheraphy II [MedicationOrder] -> NSCLC Treatment Encounter
Lupus.Lupus_Nonopioid_Pain_Medication [MedicationOrder] -> Lupus_Diagnosis
Lupus.Corticosteroid [MedicationOrder] -> Lupus_Diagnosis
Lupus.Immune_Suppressant [MedicationOrder] -> Lupus_Flareup
Lupus.Flareup_Corticosteroid [MedicationOrder] -> Lupus_Flareup
Opioid Addiction.Directed_Use_Prescription1 [MedicationOrder] -> Enter_Directed_Use_Encounter1
Opioid Addiction.Directed_Use_Prescription2 [MedicationOrder] -> Enter_Directed_Use_Encounter2
Opioid Addiction.Directed_Use_Prescription3 [MedicationOrder] -> Enter_Directed_Use_Encounter3
Osteoarthritis.OA_Pain_Medication [MedicationOrder] -> OA_Diagnosis
Rheumatoid Arthritis.RA_Nonopioid_Pain_Medication [MedicationOrder] -> RA_Diagnosis
Rheumatoid Arthritis.DMARD [MedicationOrder] -> RA_Diagnosis
Rheumatoid Arthritis.Corticosteroid [MedicationOrder] -> RA_Diagnosis
Sinusitis.Prescribe_Antibiotic [MedicationOrder] -> Doctor_Visit
Sore Throat.Prescribe_Antibiotics_Child [MedicationOrder] -> Doctor_Visit
Sore Throat.Prescribe_Antibiotics_Adult [MedicationOrder] -> Doctor_Visit
Urinary Tract Infections.Prescribe_UTI_Antibiotic [MedicationOrder] -> UTI_Diagnosis
Urinary Tract Infections.Prescribe_OTC_Painkiller_For_UTIs [MedicationOrder] -> UTI_Diagnosis
Urinary Tract Infections.Prescribe_Second_Round_Of_Antibiotics [MedicationOrder] -> Followup_Encounter
Allergy Immunotherapy.Immunotherapy_CarePlan [CarePlanStart] -> Immunotherapy_Consultation
Asthma.Smoker_CarePlan [CarePlanStart] -> Asthma_Diagnosis
Asthma.Nonsmoker_CarePlan [CarePlanStart] -> Asthma_Diagnosis
Attention Deficit Disorder.ADHD_CarePlan [CarePlanStart] -> ADHD_Diagnosis
Colorectal Cancer.Colorectal_Cancer_CarePlan [CarePlanStart] -> Oncologist_Encounter
Colorectal Cancer.Partial_Colectomy_CarePlan [CarePlanStart] -> Partial_Colectomy_Encounter
Colorectal Cancer.Diverting_Colostomy_CarePlan [CarePlanStart] -> Diverting_Colostomy_Encounter
COPD.Nonsmoker_CarePlan [CarePlanStart] -> DiagnosisEncounter
COPD.Smoker_CarePlan [CarePlanStart] -> DiagnosisEncounter
Dementia.Dementia_CarePlan [CarePlanStart] -> DiagnosisEncounter
Fibromyalgia.Fibromyalgia_CarePlan [CarePlanStart] -> Fibromyalgia_Diagnosis
Gout.Gout_CarePlan [CarePlanStart] -> Gout_Diagnosis
Lung Cancer.Lung_Cancer_CarePlan [CarePlanStart] -> Diagnosis Encounter IV
Lupus.Lupus_CarePlan [CarePlanStart] -> Lupus_Diagnosis
Opioid Addiction.Opioid_Addiction_CarePlan [CarePlanStart] -> Addiction_Overdose_Encounter
Osteoarthritis.OA_CarePlan [CarePlanStart] -> OA_Diagnosis
Pregnancy.Pregnancy_CarePlan [CarePlanStart] -> Prenatal_Initial_Visit
Rheumatoid Arthritis.RA_CarePlan [CarePlanStart] -> RA_Diagnosis
Self Harm.Suicide_CarePlan [CarePlanStart] -> Attempted_Suicide_Followup
Total Joint Replacement.Post_Op_CarePlan [CarePlanStart] -> Joint_Replacement_Encounter
Urinary Tract Infections.UTI_CarePlan [CarePlanStart] -> UTI_Diagnosis
Typically we use SNOMED-CT 185347001 "Encounter for problem" for a lot of our Encounter states. I think we should do our best to find more specific codes that describe either the nature of the visit or what kind of physician was seen. I think the following subset of SNOMED codes makes more sense in most cases:
Inspired primarily by https://www.cdc.gov/nchs/data/ahcd/combined_tables/AMC_2009-2010_combined_web_table01.pdf
A few other high-frequency conditions to consider:
The Wiki requires the reason of a Procedure to be: "the name of the ConditionOnset state which represents the reason for procedure. This ConditionOnset must come before the Procedure in the module".
In this module, there are two reason references to "reason": "has_allergic_rhinitis". While there is a state "Has_Allergic_Rhinitis" it is not a ConditionOnset.
Those on cholesterol medication should have additional AST/ALT hepatic panels. At least once every other year, especially since many heart disease medications can affect the liver.
Need a better model of "dual antiplatelet therapy" for heart disease patients. This depends on the type of stent in place and the mood of his/her cardiologist, see this article.
More patients should die of heart attacks in the mid-1900s. The standards of care were much different.
Patients with heart disease are usually taking aspirin too (81mg).
Hemoglobin A1c should be reported to only 1 decimal place.
Also our lowest possible value for A1c is too low - "incompatible with life", in fact.
GFR observations over 60 should be reported as ">60", since the specific number is not accurate or clinically useful if >60.
Should be "reams and reams" of lab tests for patients starting dialysis. Patients starting dialysis usually go 3 times per week, with labs drawn before and after a session.
End-stage renal failure has inaccurate electrolyte observations; they're way too normal.
There are many lab tests done during pregnancy as part of routine care. Apparently there are hundreds, and we're missing all of them.
Ran across this issue exporting a FHIR record...
[2017-02-01 15:25:48] 2276: Romaguera268, Izabella217. Hispanic Puerto rican. 44 y/o F 223 lbs. -- Diabetic
undefined method `[]' for nil:NilClass
/Users/jwalonoski/git/synthea/lib/records/fhir.rb:255:in `observation'
/Users/jwalonoski/git/synthea/lib/records/fhir.rb:21:in `block (2 levels) in convert_to_fhir'
/Users/jwalonoski/git/synthea/lib/records/fhir.rb:16:in `each'
/Users/jwalonoski/git/synthea/lib/records/fhir.rb:16:in `block in convert_to_fhir'
/Users/jwalonoski/git/synthea/lib/records/fhir.rb:12:in `each'
/Users/jwalonoski/git/synthea/lib/records/fhir.rb:12:in `convert_to_fhir'
/Users/jwalonoski/git/synthea/lib/records/exporter.rb:26:in `export'
/Users/jwalonoski/git/synthea/lib/world/sequential.rb:93:in `block in run_random'
/Users/jwalonoski/git/synthea/lib/world/sequential.rb:237:in `run_task'
/Users/jwalonoski/git/synthea/lib/world/sequential.rb:90:in `run_random'
/Users/jwalonoski/git/synthea/lib/world/sequential.rb:61:in `run'
lib/tasks/tasks.rake:57:in `block (2 levels) in <top (required)>'
Relates to this bit of code trying to reference a condition that doesn't exist:
if obs_data[:value_type] == 'condition'
condition_data = COND_LOOKUP[observation['value']]
entry.resource.valueCodeableConcept = FHIR::CodeableConcept.new('coding' => [{
'code' => condition_data[:codes]['SNOMED-CT'][0],
'display' => condition_data[:description],
'system' => 'http://snomed.info/sct'
}])
This module has two encounters that occur in the same iteration in this sequence:
In my implementation I close the first one when the second occurs. This seems reasonable but wouldn't a better solution be to explicitly close it prior to the condition?
Does Synthea do the same thing?
Is Allergic Rhinitis a Condition or an AllergyIntolerance?
See the FHIR diabetes care plans at https://github.com/clinical-cloud/sample-careplans
Encountered the following runtime error during the latests sequential run. Stack trace:
method 'old_init' not defined in SortedSet
org/jruby/RubyModule.java:2840:in `remove_method'
/Users/cduffett/.rvm/rubies/jruby-9.1.2.0/lib/ruby/stdlib/set.rb:686:in `block in setup'
org/jruby/RubyModule.java:2790:in `module_eval'
/Users/cduffett/.rvm/rubies/jruby-9.1.2.0/lib/ruby/stdlib/set.rb:684:in `setup'
/Users/cduffett/.rvm/rubies/jruby-9.1.2.0/lib/ruby/stdlib/set.rb:694:in `initialize'
/Users/cduffett/.rvm/gems/jruby-9.1.2.0/gems/chunky_png-1.3.8/lib/chunky_png/palette.rb:22:in `initialize'
/Users/cduffett/.rvm/gems/jruby-9.1.2.0/gems/chunky_png-1.3.8/lib/chunky_png/palette.rb:67:in `from_canvas'
/Users/cduffett/.rvm/gems/jruby-9.1.2.0/gems/chunky_png-1.3.8/lib/chunky_png/canvas.rb:269:in `palette'
/Users/cduffett/.rvm/gems/jruby-9.1.2.0/gems/chunky_png-1.3.8/lib/chunky_png/canvas/png_encoding.rb:124:in `determine_png_encoding'
/Users/cduffett/.rvm/gems/jruby-9.1.2.0/gems/chunky_png-1.3.8/lib/chunky_png/canvas/png_encoding.rb:75:in `to_datastream'
/Users/cduffett/.rvm/gems/jruby-9.1.2.0/gems/chunky_png-1.3.8/lib/chunky_png/image.rb:62:in `to_datastream'
/Users/cduffett/.rvm/gems/jruby-9.1.2.0/gems/chunky_png-1.3.8/lib/chunky_png/canvas/png_encoding.rb:50:in `to_blob'
/Users/cduffett/github/synthea/lib/records/fhir.rb:142:in `basic_info'
/Users/cduffett/github/synthea/lib/records/fhir.rb:11:in `convert_to_fhir'
/Users/cduffett/github/synthea/lib/records/exporter.rb:26:in `export'
/Users/cduffett/github/synthea/lib/world/sequential.rb:215:in `block in process_person'
/Users/cduffett/github/synthea/lib/world/sequential.rb:327:in `block in run_task'
/Users/cduffett/.rvm/gems/jruby-9.1.2.0/gems/concurrent-ruby-1.0.4-java/lib/concurrent/executor/java_executor_service.rb:94:in `run'
Looks to be an issue with the png gem we're using for the fingerprints, but it's not happening for every patient.
The following error appeared during one of my FHIR validation tests:
RuntimeError: Target encounter Gout_Diagnosis was not processed before state Gout_CarePlan
Since we added the check for concurrent_with_target_encounter
it seems we've uncovered a small issue with the Gout
module. Should be a quick fix.
"The MedicationOrder state type indicates a point in the module where a medication should be prescribed. The MedicationOrder state must come after an Encounter state in the module, but must have the same start time as that Encounter; otherwise it will not be recorded in the patient's record. See the Encounter section above for more details."
However, in allergies/severe_allergic_reaction.json there is a 2-6 hr Observation_Period separating the Mild_Steroid medication order from its ED_Visit_For_Allergic_Reaction. This causes an exception every time it occurs, since the order state does not have the same start time as the encounter.
This can be resolved by moving the order to precede the delay.
Encountered this error during a multithreaded sequential run seeded with towns.json
.
Error trace:
undefined local variable or method `dead' for #<Synthea::World::Sequential:0x902a7b6>
/Users/cduffett/github/synthea/lib/world/sequential.rb:225:in `block in process_person'
org/jruby/RubyKernel.java:1290:in `loop'
/Users/cduffett/github/synthea/lib/world/sequential.rb:207:in `process_person'
/Users/cduffett/github/synthea/lib/world/sequential.rb:194:in `block in process_city'
/Users/cduffett/github/synthea/lib/world/sequential.rb:325:in `block in run_task'
/Users/cduffett/.rvm/gems/jruby-9.1.2.0/gems/concurrent-ruby-1.0.2-java/lib/concurrent/executor/java_executor_service.rb:94:in `run'
/Users/cduffett/.rvm/gems/jruby-9.1.2.0/gems/concurrent-ruby-1.0.2-java/lib/concurrent/executor/java_executor_service.rb:29:in `post'
/Users/cduffett/github/synthea/lib/world/sequential.rb:323:in `run_task'
/Users/cduffett/github/synthea/lib/world/sequential.rb:191:in `block in process_city'
org/jruby/RubyFixnum.java:297:in `times'
/Users/cduffett/github/synthea/lib/world/sequential.rb:190:in `process_city'
/Users/cduffett/github/synthea/lib/world/sequential.rb:79:in `block in run'
/Users/cduffett/github/synthea/lib/world/sequential.rb:325:in `block in run_task'
/Users/cduffett/.rvm/gems/jruby-9.1.2.0/gems/concurrent-ruby-1.0.2-java/lib/concurrent/executor/java_executor_service.rb:94:in `run'
If you start a multithreaded run without passing the towns.json
config file the sequential generation fails, producing the following error:
NoMethodError: undefined method 'count' for nil:NilClass
/Users/cduffett/github/synthea/lib/world/sequential.rb:67:in 'run'
lib/tasks/tasks.rake:53:in 'block in (root)'
/Users/cduffett/.rvm/gems/jruby-9.1.2.0/gems/rake-11.3.0/exe/rake:27:in '<top>'
/Users/cduffett/.rvm/gems/jruby-9.1.2.0/bin/jruby_executable_hooks:15:in '<top>'
Tasks: TOP => synthea:sequential
If a multithreaded run cannot be done without towns.json
we should log an explicit warning and terminate. If it can, we should support it.
See this U.S. Preventative Services Task Force Report. This is a top 50 list of recommendations dated 2004 - 2016. Too extensive to make a checklist here.
At the bottom of the wiki home page there is a broken link back to the synthea repository. In the "Guide to Synthea Projects" section the link is currently:
https://github.com/synthethichealth/synthea
Note the typo: "synthethichealth".
Most asthma medications should be of the inhalant type, not oral.
Children with asthma would likely have exzema or allergic rhinitis too. It's called the "atopic triad".
Need additional asthma medications for patients with severe asthma. Most of our asthma patients are "atypical", with too many asthma attacks.
It's the only module/state with this problem. From the documentation, it looks to be required
Vaccines need to be more accurate for the years they were prescribed. Some patients are missing vaccines.
Don't administer flu vaccines in the summer months, between June and August, inclusive.
In STU3 1.8, HumanName.family has a cardinality of 0..1 and should be exported as a string instead of an array. This is causing synthea output to fail validation on upload to a stu3 server.
2 Statin medications are exported in concepts.csv
:
RxNorm, 312961, Simvastatin 20 MG Oral Tablet
RxNorm, 259255, Atorvastatin 80 MG Oral Tablet
But are never prescribed in any of the modules. I'm guessing these were forgotten when diabetes was ported to GMF. Nonetheless, I'm surprised that these medications aren't prescribed anywhere for high cholesterol.
http://www.healthdata.org/united-states
This file defines a bunch of module level constants. However, lib/generic/states.rb provides a method to modify these constants. These lookup tables should be refactored to not use constants if the intention is to modify them.
Outputting Metabolic Syndrome Results to output/prevalences.csv
rake aborted!
Errno::ENOENT: No such file or directory - output/prevalences.csv
/Users/aquina/data/workspaces/shr/synthea/lib/world/sequential.rb:108:in run' lib/tasks/tasks.rake:58:in
block in (root)'
/Users/aquina/.rvm/gems/jruby-9.1.2.0/gems/rake-12.0.0/exe/rake:27:in <top>' /Users/aquina/.rvm/gems/jruby-9.1.2.0/gems/bundler-1.13.1/lib/bundler/cli/exec.rb:1:in
(root)'
/Users/aquina/.rvm/gems/jruby-9.1.2.0/gems/bundler-1.13.1/lib/bundler/cli/exec.rb:74:in kernel_load' /Users/aquina/.rvm/gems/jruby-9.1.2.0/gems/bundler-1.13.1/lib/bundler/cli/exec.rb:27:in
run'
/Users/aquina/.rvm/gems/jruby-9.1.2.0/gems/bundler-1.13.1/lib/bundler/cli.rb:332:in exec' /Users/aquina/.rvm/gems/jruby-9.1.2.0/gems/bundler-1.13.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in
run'
/Users/aquina/.rvm/gems/jruby-9.1.2.0/gems/bundler-1.13.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in invoke_command' /Users/aquina/.rvm/gems/jruby-9.1.2.0/gems/bundler-1.13.1/lib/bundler/vendor/thor/lib/thor.rb:359:in
dispatch'
/Users/aquina/.rvm/gems/jruby-9.1.2.0/gems/bundler-1.13.1/lib/bundler/cli.rb:20:in dispatch' /Users/aquina/.rvm/gems/jruby-9.1.2.0/gems/bundler-1.13.1/lib/bundler/vendor/thor/lib/thor/base.rb:440:in
block in start'
/Users/aquina/.rvm/gems/jruby-9.1.2.0/gems/bundler-1.13.1/lib/bundler/cli.rb:11:in start' /Users/aquina/.rvm/gems/jruby-9.1.2.0/gems/bundler-1.13.1/exe/bundle:34:in
'
/Users/aquina/.rvm/gems/jruby-9.1.2.0/bin/bundle:22:in `'
Although target_encounter has been removed from many of the states, some of their examples still show the field:
If you wanted to configure Synthea to run for an area in the Netherlands or England, what would you need to do?
Don't prescribe injectable nitroglycerine - use sublingual instead.
Amlodipine and Simvastatin have a dangerous drug-drug interaction. Rookie mistake.
Clopidogrel was not FDA approved until 1997, Simvastatin in 1991, and Amlodipine in 1994.
Many young adult females (16+) could be on some form of contraceptive.
Patient's with poorly controlled blood pressure should be taking additional medications and at higher doses.
Presently the AllergyIntolerance category
is hard-coded to 'food'
. However, other types of allergies will soon be modeled in Synthea (pending the Atopic Triad PR). FHIR also allows the following categories:
[food
, medication
, biologic
, environment
]
I propose we add a category
, or alternatively allergy_type
property to the AllergyOnset
state to make this configurable.
Looks to me like these ought to be VitalSign states and not Observations. According to the Wiki, only vital signs have the vital_sign field.
Most production implementations to be used within the United States that will be certified for use in MU 2015 are going to use DSTU2.
They are still referenced by the modules but gone from the wiki.
MedicationOrder is not used in DSTU3 anymore, but synthea:fhirupload still uploads that resource to STU3 FHIR server.
The project mixes tabs and spaces throughout the source code. I suggest eliminating all tabs from the project. Also, please remove all trailing whitespace.
NoMethodError: undefined method `to_sym' for nil:NilClass
Did you mean? to_s
/Users/jwalonoski/git/synthea/lib/generic/states.rb:458:in `end_prescription'
/Users/jwalonoski/git/synthea/lib/generic/states.rb:452:in `process'
/Users/jwalonoski/git/synthea/lib/generic/states.rb:36:in `run'
/Users/jwalonoski/git/synthea/lib/generic/context.rb:31:in `run'
/Users/jwalonoski/git/synthea/lib/generic/context.rb:50:in `run'
/Users/jwalonoski/git/synthea/lib/modules/generic.rb:54:in `block (2 levels) in <class:Generic>'
/Users/jwalonoski/git/synthea/lib/modules/generic.rb:49:in `each'
/Users/jwalonoski/git/synthea/lib/modules/generic.rb:49:in `block in <class:Generic>'
/Users/jwalonoski/git/synthea/lib/modules/module.rb:10:in `call'
/Users/jwalonoski/git/synthea/lib/modules/module.rb:10:in `block in run'
/Users/jwalonoski/git/synthea/lib/modules/module.rb:10:in `each'
/Users/jwalonoski/git/synthea/lib/modules/module.rb:10:in `run'
/Users/jwalonoski/git/synthea/lib/modules/module.rb:18:in `block in apply'
/Users/jwalonoski/git/synthea/lib/modules/module.rb:18:in `each'
/Users/jwalonoski/git/synthea/lib/modules/module.rb:18:in `apply'
/Users/jwalonoski/git/synthea/lib/world/sequential.rb:274:in `build_person'
/Users/jwalonoski/git/synthea/lib/world/sequential.rb:169:in `run_random'
/Users/jwalonoski/git/synthea/lib/world/sequential.rb:83:in `run'
Opioid addicts often report allergies to non-narcotic pain medications (e.g. acetaminophen, ibuprofen, naproxen, tramadol).
Polysubstance abuse - opioid addicts are likely to also abuse alcohol, cocaine, marijuana, etc.
Likely comorbid mental health diagnoses with drug addition, e.g. bipolar, depression, anxiety.
Patient's with full blown opioid addiction should have many more pain diagnoses and opioid prescriptions listed, as they solicit them from various doctors.
Now that I'm throwing exceptions when target_encounter timing conditions aren't met, I'm seeing a persistent problem in the Lupus Module. Here's a trace:
State Trace:
2017/01/06 08:16 Initial [Initial]
2041/12/31 08:16 Delay_Until_Lupus [Delay]
2017/01/13 08:16 Delay_Until_Lupus [Guard]
2041/12/27 08:16 Lupus [ConditionOnset]
2041/12/27 09:16 Lupus_Diagnosis [Encounter]
2042/01/03 08:16 Lupus_CarePlan [CarePlanStart]
2042/01/03 08:16 Lupus_Nonopioid_Pain_Medication [MedicationOrder]
2042/01/03 08:16 Corticosteroid [MedicationOrder]
2042/01/17 08:16 Corticosteroid_Treatment [Delay]
2042/01/17 08:16 End_Corticosteroid [MedicationEnd]
2043/01/17 08:16 Wait_For_Lupus_Flareup [Delay]
2043/01/17 09:16 Lupus_Flareup [Encounter]
2043/01/17 09:16 Immune_Suppressant [MedicationOrder]
2043/01/17 09:16 Corticosteroid [MedicationOrder]
The issue is that the Corticosteroid MedicationOrder refers to the Lupus_Diagnosis Encounter and that encounter has long passed. I added a new Flareup_Corticosteroid state and that fixed the problem. Here's my fix:
"Immune_Suppressant": {
"type": "MedicationOrder",
"target_encounter": "Lupus_Flareup",
"reason": "Lupus",
"remarks": [
"More aggressive immune suppressants are used for subsequent flares."
],
"codes": [
{
"system": "RxNorm",
"code": "835900",
"display": "cycloSPORINE, modified 100 MG [Neoral]"
}
],
"direct_transition": "Flareup_Corticosteroid"
},
"Flareup_Corticosteroid": {
"type": "MedicationOrder",
"target_encounter": "Lupus_Flareup",
"reason": "Lupus",
"remarks": [
"When introduced in higher levels than those produced by the body, corticosteroids ",
"inhibit inflammation. However, doctors prefer to use these for as short a time period ",
"as possible to avoid dangerous side effects."
],
"codes": [
{
"system": "RxNorm",
"code": "567645",
"display": "predniSONE 2.5 MG [Deltasone]"
}
],
"direct_transition": "Corticosteroid_Treatment"
},
The following warning now appears when running the unit tests:
Use assert_nil if expecting nil from /home/travis/build/synthetichealth/synthea/test/unit/generic_states_test.rb:878:in `test_setAttribute_without_value'. This will fail in MT6.
It's not failing yet, but it will if we update Minitest.
The module has 4 instances of:
"codes": [
{
"system": "SNOMED-CT",
"code": "Encounter for 'check-up'",
"display": "185349003"
}
],
Seems like the code and display fields are reversed
The synthea:generate
command is confusing some users. Since we almost exclusively use synthea:sequential
to generate patients, @jawalonoski has asked to deprecate generate
for now.
Researchers have requested CSV or Excel output in a table form.
Don't prescribe injectable nitroglycerine - use sublingual instead.
Amlodipine and Simvastatin have a dangerous drug-drug interaction. Rookie mistake.
Clopidogrel was not FDA approved until 1997, Simvastatin in 1991, and Amlodipine in 1994.
Many young adult females (16+) could be on some form of contraceptive.
Patient's with poorly controlled blood pressure should be taking additional medications and at higher doses.
Only prescribe oxycontin for chronic pain (e.g. cancer), or from the occasional "pill mill" or ER. Not for a sprained ankle.
Urethritis, cystitis and pyelonephritis are all being treated with nitrofurantoin. Nitrofurantoin does not work for pyelonephritis - this needs to be changed.
Looking at the wiki, it appears that the attribute Observation.target_encounter has been removed. I have found two issues with this change:
The module Wellness Encounters still has many Observations with this value set to "Wellness_Encounter"
The module "Metabolic Syndrome Standards of Care" has one Observation "Record_HA1C" for which my implementation cannot determine the appropriate target encounter.
The prior state trace is rather long but it does support the correctness of the above exception (see bold states below). The exception occurs about 19 years into a 50yr simulation of 5k patients, so it may be difficult to reproduce. It may also highlight a defect in my implementation.
[2017/03/22 11:07 Initial [Initial], 2017/03/22 11:22 Wellness_Encounter [Encounter], 2017/04/19 11:07 Check_Hypertension [Simple], 2017/04/19 11:07 Check_Diabetes [Simple], 2017/04/19 11:22 Wellness_Encounter [Encounter], 2017/05/17 11:07 Check_Hypertension [Simple], 2017/05/17 11:07 Check_Diabetes [Simple], 2017/05/17 11:22 Wellness_Encounter [Encounter], 2017/07/19 11:07 Check_Hypertension [Simple], 2017/07/19 11:07 Check_Diabetes [Simple], 2017/07/19 11:22 Wellness_Encounter [Encounter], 2017/09/20 11:07 Check_Hypertension [Simple], 2017/09/20 11:07 Check_Diabetes [Simple], 2017/09/20 11:22 Wellness_Encounter [Encounter], 2017/12/20 11:07 Check_Hypertension [Simple], 2017/12/20 11:07 Check_Diabetes [Simple], 2017/12/20 11:22 Wellness_Encounter [Encounter], 2018/03/21 11:07 Check_Hypertension [Simple], 2018/03/21 11:07 Check_Diabetes [Simple], 2018/03/21 11:22 Wellness_Encounter [Encounter], 2018/06/20 11:07 Check_Hypertension [Simple], 2018/06/20 11:07 Check_Diabetes [Simple], 2018/06/20 11:22 Wellness_Encounter [Encounter], 2018/09/19 11:07 Check_Hypertension [Simple], 2018/09/19 11:07 Check_Diabetes [Simple], 2018/09/19 11:22 Wellness_Encounter [Encounter], 2019/03/20 11:07 Check_Hypertension [Simple], 2019/03/20 11:07 Check_Diabetes [Simple], 2019/03/20 11:22 Wellness_Encounter [Encounter], 2019/09/18 11:07 Check_Hypertension [Simple], 2019/09/18 11:07 Check_Diabetes [Simple], 2019/09/18 11:22 Wellness_Encounter [Encounter], 2020/03/18 11:07 Check_Hypertension [Simple], 2020/03/18 11:07 Check_Diabetes [Simple], 2020/03/18 11:22 Wellness_Encounter [Encounter], 2020/09/16 11:07 Check_Hypertension [Simple], 2020/09/16 11:07 Check_Diabetes [Simple], 2020/09/16 11:22 Wellness_Encounter [Encounter], 2021/03/17 11:07 Check_Hypertension [Simple], 2021/03/17 11:07 Check_Diabetes [Simple], 2021/03/17 11:22 Wellness_Encounter [Encounter], 2022/03/16 11:07 Check_Hypertension [Simple], 2022/03/16 11:07 Check_Diabetes [Simple], 2022/03/16 11:22 Wellness_Encounter [Encounter], 2023/03/15 11:07 Check_Hypertension [Simple], 2023/03/15 11:07 Check_Diabetes [Simple], 2023/03/15 11:22 Wellness_Encounter [Encounter], 2024/03/13 11:07 Check_Hypertension [Simple], 2024/03/13 11:07 Check_Diabetes [Simple], 2024/03/13 11:22 Wellness_Encounter [Encounter], 2024/03/20 11:07 Check_Hypertension [Simple], 2024/03/20 11:07 Check_Diabetes [Simple], 2024/03/20 11:22 Wellness_Encounter [Encounter], 2025/03/19 11:07 Check_Hypertension [Simple], 2025/03/19 11:07 Check_Diabetes [Simple], 2025/03/19 11:22 Wellness_Encounter [Encounter], 2026/03/18 11:07 Check_Hypertension [Simple], 2026/03/18 11:07 Check_Diabetes [Simple], 2026/03/18 11:22 Wellness_Encounter [Encounter], 2027/03/17 11:07 Check_Hypertension [Simple], 2027/03/17 11:07 Check_Diabetes [Simple], 2027/03/17 11:22 Wellness_Encounter [Encounter], 2028/03/15 11:07 Check_Hypertension [Simple], 2028/03/15 11:07 Check_Diabetes [Simple], 2028/03/15 11:22 Wellness_Encounter [Encounter], 2029/03/14 11:07 Check_Hypertension [Simple], 2029/03/14 11:07 Check_Diabetes [Simple], 2029/03/14 11:22 Wellness_Encounter [Encounter], 2030/03/13 11:07 Check_Hypertension [Simple], 2030/03/13 11:07 Check_Diabetes [Simple], 2030/03/13 11:22 Wellness_Encounter [Encounter], 2031/03/12 11:07 Check_Hypertension [Simple], 2031/03/12 11:07 Check_Diabetes [Simple], 2031/03/12 11:22 Wellness_Encounter [Encounter], 2031/03/19 11:07 Check_Hypertension [Simple], 2031/03/19 11:07 Check_Diabetes [Simple], 2031/03/19 11:22 Wellness_Encounter [Encounter], 2032/03/17 11:07 Check_Hypertension [Simple], 2032/03/17 11:07 Check_Diabetes [Simple], 2032/03/17 11:22 Wellness_Encounter [Encounter], 2033/03/16 11:07 Check_Hypertension [Simple], 2033/03/16 11:07 Check_Diabetes [Simple], 2033/03/16 11:22 Wellness_Encounter [Encounter], 2034/03/15 11:07 Check_Hypertension [Simple], 2034/03/15 11:07 Check_Diabetes [Simple], 2034/03/15 11:22 Wellness_Encounter [Encounter], 2035/03/14 11:07 Check_Hypertension [Simple], 2035/03/14 11:07 Check_Diabetes [Simple], 2035/03/14 11:22 Wellness_Encounter [Encounter], 2036/03/12 11:07 Check_Hypertension [Simple], 2036/03/12 11:07 Check_Diabetes [Simple], 2036/03/12 11:07 Record_HA1C [Observation]]
Right now Encounters can happen on any day of the week. For emergencies this makes sense. Realistically however, many Encounters would never be scheduled on a weekend. For example, visits to a specialist or routine (non-emergency) surgery.
Perhaps we should add a weekday
option to the Encounter
state that forces it to be scheduled on the next available weekday?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.