Search in sources :

Example 6 with CareTeam

use of org.hl7.fhir.r4.model.CareTeam in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeCareTeamCareTeamParticipantComponent.

protected void composeCareTeamCareTeamParticipantComponent(Complex parent, String parentType, String name, CareTeam.CareTeamParticipantComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "participant", name, element, index);
    for (int i = 0; i < element.getRole().size(); i++) composeCodeableConcept(t, "CareTeam", "role", element.getRole().get(i), i);
    if (element.hasMember())
        composeReference(t, "CareTeam", "member", element.getMember(), -1);
    if (element.hasOnBehalfOf())
        composeReference(t, "CareTeam", "onBehalfOf", element.getOnBehalfOf(), -1);
    if (element.hasPeriod())
        composePeriod(t, "CareTeam", "period", element.getPeriod(), -1);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 7 with CareTeam

use of org.hl7.fhir.r4.model.CareTeam in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeCareTeam.

protected void composeCareTeam(Complex parent, String parentType, String name, CareTeam element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "CareTeam", name, element, index);
    for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "CareTeam", "identifier", element.getIdentifier().get(i), i);
    if (element.hasStatusElement())
        composeEnum(t, "CareTeam", "status", element.getStatusElement(), -1);
    for (int i = 0; i < element.getCategory().size(); i++) composeCodeableConcept(t, "CareTeam", "category", element.getCategory().get(i), i);
    if (element.hasNameElement())
        composeString(t, "CareTeam", "name", element.getNameElement(), -1);
    if (element.hasSubject())
        composeReference(t, "CareTeam", "subject", element.getSubject(), -1);
    if (element.hasEncounter())
        composeReference(t, "CareTeam", "encounter", element.getEncounter(), -1);
    if (element.hasPeriod())
        composePeriod(t, "CareTeam", "period", element.getPeriod(), -1);
    for (int i = 0; i < element.getParticipant().size(); i++) composeCareTeamCareTeamParticipantComponent(t, "CareTeam", "participant", element.getParticipant().get(i), i);
    for (int i = 0; i < element.getReasonCode().size(); i++) composeCodeableConcept(t, "CareTeam", "reasonCode", element.getReasonCode().get(i), i);
    for (int i = 0; i < element.getReasonReference().size(); i++) composeReference(t, "CareTeam", "reasonReference", element.getReasonReference().get(i), i);
    for (int i = 0; i < element.getManagingOrganization().size(); i++) composeReference(t, "CareTeam", "managingOrganization", element.getManagingOrganization().get(i), i);
    for (int i = 0; i < element.getTelecom().size(); i++) composeContactPoint(t, "CareTeam", "telecom", element.getTelecom().get(i), i);
    for (int i = 0; i < element.getNote().size(); i++) composeAnnotation(t, "CareTeam", "note", element.getNote().get(i), i);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 8 with CareTeam

use of org.hl7.fhir.r4.model.CareTeam in project org.hl7.fhir.core by hapifhir.

the class R3R4ConversionTests method createResource.

@Override
public Base createResource(Object appInfo, Base res, boolean atRootofTransform) {
    if (res instanceof Resource && (res.fhirType().equals("CodeSystem") || res.fhirType().equals("CareTeam") || res.fhirType().equals("PractitionerRole"))) {
        Resource r = (Resource) res;
        extras.add(r);
        r.setId(workingid + "-" + extras.size());
    }
    return res;
}
Also used : Resource(org.hl7.fhir.r4.model.Resource) MetadataResource(org.hl7.fhir.r4.model.MetadataResource)

Example 9 with CareTeam

use of org.hl7.fhir.r4.model.CareTeam in project org.hl7.fhir.core by hapifhir.

the class TurtleTests method test_careteam_example.

@Test
public void test_careteam_example() throws FileNotFoundException, IOException, Exception {
    System.out.println("careteam-example.ttl");
    new Turtle().parse(TextFile.fileToString("C:\\work\\org.hl7.fhir\\build\\publish\\careteam-example.ttl"));
}
Also used : Turtle(org.hl7.fhir.dstu3.utils.formats.Turtle) Test(org.junit.jupiter.api.Test)

Example 10 with CareTeam

use of org.hl7.fhir.r4.model.CareTeam in project synthea by synthetichealth.

the class FhirR4 method convertToFHIR.

/**
 * Convert the given Person into a FHIR Bundle of the Patient and the
 * associated entries from their health record.
 *
 * @param person   Person to generate the FHIR JSON for
 * @param stopTime Time the simulation ended
 * @return FHIR Bundle containing the Person's health record
 */
public static Bundle convertToFHIR(Person person, long stopTime) {
    Bundle bundle = new Bundle();
    if (TRANSACTION_BUNDLE) {
        bundle.setType(BundleType.TRANSACTION);
    } else {
        bundle.setType(BundleType.COLLECTION);
    }
    BundleEntryComponent personEntry = basicInfo(person, bundle, stopTime);
    for (Encounter encounter : person.record.encounters) {
        BundleEntryComponent encounterEntry = encounter(person, personEntry, bundle, encounter);
        for (HealthRecord.Entry condition : encounter.conditions) {
            condition(person, personEntry, bundle, encounterEntry, condition);
        }
        for (HealthRecord.Allergy allergy : encounter.allergies) {
            allergy(person, personEntry, bundle, encounterEntry, allergy);
        }
        for (Observation observation : encounter.observations) {
            // Observation resources in v4 don't support Attachments
            if (observation.value instanceof Attachment) {
                media(person, personEntry, bundle, encounterEntry, observation);
            } else {
                observation(person, personEntry, bundle, encounterEntry, observation);
            }
        }
        for (Procedure procedure : encounter.procedures) {
            procedure(person, personEntry, bundle, encounterEntry, procedure);
        }
        for (HealthRecord.Device device : encounter.devices) {
            device(person, personEntry, bundle, device);
        }
        for (HealthRecord.Supply supply : encounter.supplies) {
            supplyDelivery(person, personEntry, bundle, supply, encounter);
        }
        for (Medication medication : encounter.medications) {
            medicationRequest(person, personEntry, bundle, encounterEntry, medication);
        }
        for (HealthRecord.Entry immunization : encounter.immunizations) {
            immunization(person, personEntry, bundle, encounterEntry, immunization);
        }
        for (Report report : encounter.reports) {
            report(person, personEntry, bundle, encounterEntry, report);
        }
        for (CarePlan careplan : encounter.careplans) {
            BundleEntryComponent careTeamEntry = careTeam(person, personEntry, bundle, encounterEntry, careplan);
            carePlan(person, personEntry, bundle, encounterEntry, encounter.provider, careTeamEntry, careplan);
        }
        for (ImagingStudy imagingStudy : encounter.imagingStudies) {
            imagingStudy(person, personEntry, bundle, encounterEntry, imagingStudy);
        }
        if (USE_US_CORE_IG) {
            String clinicalNoteText = ClinicalNoteExporter.export(person, encounter);
            boolean lastNote = (encounter == person.record.encounters.get(person.record.encounters.size() - 1));
            clinicalNote(person, personEntry, bundle, encounterEntry, clinicalNoteText, lastNote);
        }
        // one claim per encounter
        BundleEntryComponent encounterClaim = encounterClaim(person, personEntry, bundle, encounterEntry, encounter.claim);
        explanationOfBenefit(personEntry, bundle, encounterEntry, person, encounterClaim, encounter);
    }
    if (USE_US_CORE_IG) {
        // Add Provenance to the Bundle
        provenance(bundle, person, stopTime);
    }
    return bundle;
}
Also used : DiagnosticReport(org.hl7.fhir.r4.model.DiagnosticReport) Report(org.mitre.synthea.world.concepts.HealthRecord.Report) Bundle(org.hl7.fhir.r4.model.Bundle) ImagingStudy(org.mitre.synthea.world.concepts.HealthRecord.ImagingStudy) Attachment(org.mitre.synthea.engine.Components.Attachment) HealthRecord(org.mitre.synthea.world.concepts.HealthRecord) CarePlan(org.mitre.synthea.world.concepts.HealthRecord.CarePlan) BundleEntryComponent(org.hl7.fhir.r4.model.Bundle.BundleEntryComponent) Observation(org.mitre.synthea.world.concepts.HealthRecord.Observation) Medication(org.mitre.synthea.world.concepts.HealthRecord.Medication) Encounter(org.mitre.synthea.world.concepts.HealthRecord.Encounter) Procedure(org.mitre.synthea.world.concepts.HealthRecord.Procedure)

Aggregations

Complex (org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)7 Complex (org.hl7.fhir.r4.utils.formats.Turtle.Complex)7 Complex (org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)2 Encounter (org.mitre.synthea.world.concepts.HealthRecord.Encounter)2 Date (java.util.Date)1 Turtle (org.hl7.fhir.dstu3.utils.formats.Turtle)1 Bundle (org.hl7.fhir.r4.model.Bundle)1 BundleEntryComponent (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent)1 CareTeam (org.hl7.fhir.r4.model.CareTeam)1 CareTeamParticipantComponent (org.hl7.fhir.r4.model.CareTeam.CareTeamParticipantComponent)1 DiagnosticReport (org.hl7.fhir.r4.model.DiagnosticReport)1 DocumentReference (org.hl7.fhir.r4.model.DocumentReference)1 Meta (org.hl7.fhir.r4.model.Meta)1 MetadataResource (org.hl7.fhir.r4.model.MetadataResource)1 Patient (org.hl7.fhir.r4.model.Patient)1 Period (org.hl7.fhir.r4.model.Period)1 Reference (org.hl7.fhir.r4.model.Reference)1 Resource (org.hl7.fhir.r4.model.Resource)1 Test (org.junit.jupiter.api.Test)1 Attachment (org.mitre.synthea.engine.Components.Attachment)1