Search in sources :

Example 1 with Immunization

use of org.mitre.synthea.world.concepts.HealthRecord.Immunization in project synthea by synthetichealth.

the class CDWExporter method export.

/**
 * Add a single Person's health record info to the CSV records.
 * @param person Person to write record data for
 * @param time Time the simulation ended
 * @throws IOException if any IO error occurs
 */
public void export(Person person, long time) throws IOException {
    // Ignore civilians, only consider the veteran population.
    if (!person.attributes.containsKey("veteran")) {
        return;
    }
    int primarySta3n = -1;
    Provider provider = person.getProvider(EncounterType.WELLNESS, time);
    if (provider != null) {
        String state = Location.getStateName(provider.state);
        String tz = Location.getTimezoneByState(state);
        primarySta3n = sta3n.addFact(provider.id, clean(provider.name) + "," + tz);
        location.addFact(provider.id, clean(provider.name));
    }
    int personID = patient(person, primarySta3n, time);
    for (Encounter encounter : person.record.encounters) {
        int encounterID = encounter(personID, person, encounter, primarySta3n);
        for (HealthRecord.Entry condition : encounter.conditions) {
            condition(personID, encounterID, encounter, condition, primarySta3n);
        }
        for (HealthRecord.Entry allergy : encounter.allergies) {
            allergy(personID, person, encounterID, encounter, allergy, primarySta3n);
        }
        for (HealthRecord.Report report : encounter.reports) {
            // Ignore death certificates
            if (!DeathModule.DEATH_CERTIFICATE.equals(report.codes.get(0))) {
                report(personID, encounterID, encounter, primarySta3n, report);
            }
        }
        for (Observation observation : encounter.observations) {
            observation(personID, encounterID, encounter, primarySta3n, observation);
        }
        for (Procedure procedure : encounter.procedures) {
            procedure(personID, encounterID, encounter, procedure, primarySta3n);
        }
        for (Medication medication : encounter.medications) {
            medication(personID, encounterID, encounter, medication, primarySta3n);
        }
        for (Immunization immunization : encounter.immunizations) {
            immunization(personID, person, encounterID, encounter, immunization, primarySta3n);
        }
    }
    // Patient Data
    lookuppatient.flush();
    spatient.flush();
    spatientaddress.flush();
    spatientphone.flush();
    patientrace.flush();
    patientethnicity.flush();
    // Encounter Data
    consult.flush();
    visit.flush();
    appointment.flush();
    inpatient.flush();
    // Immunization Data
    immunization.flush();
    // Allergy Data
    allergy.flush();
    allergicreaction.flush();
    allergycomment.flush();
    // Condition Data
    problemlist.flush();
    vdiagnosis.flush();
    // Medication Data
    rxoutpatient.flush();
    rxoutpatfill.flush();
    nonvamed.flush();
    cprsorder.flush();
    ordereditem.flush();
    // Diagnostic Report Data
    labchem.flush();
    labpanel.flush();
    patientlabchem.flush();
    vprocedure.flush();
    // Procedure Data
    surgeryProcedureDiagnosisCode.flush();
    surgeryPRE.flush();
    // Vital Sign Observation Data
    vitalSign.flush();
}
Also used : HealthRecord(org.mitre.synthea.world.concepts.HealthRecord) Immunization(org.mitre.synthea.world.concepts.HealthRecord.Immunization) Entry(org.mitre.synthea.world.concepts.HealthRecord.Entry) Observation(org.mitre.synthea.world.concepts.HealthRecord.Observation) Medication(org.mitre.synthea.world.concepts.HealthRecord.Medication) Encounter(org.mitre.synthea.world.concepts.HealthRecord.Encounter) Report(org.mitre.synthea.world.concepts.HealthRecord.Report) Procedure(org.mitre.synthea.world.concepts.HealthRecord.Procedure) Provider(org.mitre.synthea.world.agents.Provider)

Aggregations

Provider (org.mitre.synthea.world.agents.Provider)1 HealthRecord (org.mitre.synthea.world.concepts.HealthRecord)1 Encounter (org.mitre.synthea.world.concepts.HealthRecord.Encounter)1 Entry (org.mitre.synthea.world.concepts.HealthRecord.Entry)1 Immunization (org.mitre.synthea.world.concepts.HealthRecord.Immunization)1 Medication (org.mitre.synthea.world.concepts.HealthRecord.Medication)1 Observation (org.mitre.synthea.world.concepts.HealthRecord.Observation)1 Procedure (org.mitre.synthea.world.concepts.HealthRecord.Procedure)1 Report (org.mitre.synthea.world.concepts.HealthRecord.Report)1