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);
}
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);
}
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;
}
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"));
}
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;
}
Aggregations