use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.PROCEDURE in project fhir-bridge by ehrbase.
the class ProvideProcedureTransactionIT method provideProcedureConditionalUpdate.
@Test
void provideProcedureConditionalUpdate() throws IOException {
MethodOutcome outcome;
outcome = create("Procedure/transactions/provide-procedure-create.json");
IIdType id = outcome.getId();
outcome = update("Procedure/transactions/provide-procedure-update.json", "Procedure?_id=" + id.getIdPart() + "&subject.identifier=" + PATIENT_ID);
Assertions.assertEquals(id.getIdPart(), outcome.getId().getIdPart());
Assertions.assertEquals(id.getVersionIdPartAsLong() + 1, outcome.getId().getVersionIdPartAsLong());
Procedure procedure = (Procedure) outcome.getResource();
Assertions.assertEquals(PATIENT_ID, procedure.getSubject().getIdentifier().getValue());
Assertions.assertEquals(Procedure.ProcedureStatus.ONHOLD, procedure.getStatus());
}
use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.PROCEDURE in project odm2fhir by num-codex.
the class ImagingProcedures method map.
protected Stream<DomainResource> map(FormData formData) {
var techniqueGroup = formData.getItemGroupData("bildgebung.bildgebende_verfahren_ct");
var befundGroup = formData.getItemGroupData("bildgebung.befund_bildgebender_verfahren_ct");
var generalCoding = formData.getItemData("bildgebende_verfahren");
if (!"1".equals(generalCoding.getValue())) {
return Stream.empty();
}
var itemDatas = Stream.of(techniqueGroup.getItemData(), befundGroup.getItemData()).flatMap(List::stream).collect(toMap(ItemData::getItemOID, identity()));
return Stream.of("ct", "roentgen", "us").filter(type -> contains(itemDatas.get("bildgebende_verfahren_" + type).getValue(), "410605003")).filter(type -> !(itemDatas.get("befund_bildgebender_verfahren_" + type).isEmpty())).flatMap(type -> {
var diagnosticReport = createDiagnosticReport(itemDatas.get("befund_bildgebender_verfahren_" + type));
var procedure = createProcedure(itemDatas.get("bildgebende_verfahren_" + type)).addReport(new Reference(format("%s/%s", DIAGNOSTICREPORT.toCode(), diagnosticReport.getId())));
return Stream.of(diagnosticReport, procedure);
});
}
use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.PROCEDURE in project odm2fhir by num-codex.
the class ECMO method createProcedure.
private Procedure createProcedure(ItemData generalCoding, ItemData answerCoding) {
var procedure = (Procedure) new Procedure().addIdentifier(createIdentifier(PROCEDURE, generalCoding)).setPerformed(// TODO Set actual DateTime value
UNKNOWN_DATE_TIME).setCategory(createCodeableConcept(createCoding(SNOMED_CT, "277132007", "Therapeutic procedure (procedure)"))).setCode(createCodeableConcept(generalCoding).setText("ECMO")).setMeta(createMeta(EXTRACORPOREAL_MEMBRANE_OXYGENATION));
createCodings(answerCoding).forEach(coding -> {
if (ProcedureStatus.UNKNOWN.getSystem().equals(coding.getSystem())) {
procedure.setStatus(ProcedureStatus.fromCode(coding.getCode()));
} else {
procedure.setPerformed((DateTimeType) new DateTimeType().addExtension(createExtension(coding)));
}
});
return procedure;
}
use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.PROCEDURE in project odm2fhir by num-codex.
the class VentilationType method createProcedure.
private Procedure createProcedure(ItemData answerCoding) {
var procedure = (Procedure) new Procedure().addIdentifier(createIdentifier(PROCEDURE, answerCoding)).setPerformed(// TODO Set actual DateTime value
UNKNOWN_DATE_TIME).setStatus(INPROGRESS).setCategory(createCodeableConcept(createCoding(SNOMED_CT, "277132007", "Therapeutic procedure (procedure)"))).setMeta(createMeta(RESPIRATORY_THERAPIES));
var codeableConcept = new CodeableConcept();
for (var coding : createCodings(answerCoding)) {
var material = ArrayUtils.get(coding.getCode().split("="), 1);
if (material != null && !material.isEmpty()) {
procedure.addUsedCode(createCodeableConcept(createCoding(coding.getSystem(), material, null)));
}
// case "Unknown" or "No"
if (DATA_ABSENT_REASON.getUrl().equals(coding.getSystem())) {
codeableConcept.addCoding(createCoding(SNOMED_CT, "40617009", "Artificial respiration (procedure)"));
} else if (ProcedureStatus.UNKNOWN.getSystem().equals(coding.getSystem())) {
procedure.setStatus(ProcedureStatus.fromCode(coding.getCode()));
} else {
// case "Yes"
codeableConcept.addCoding(coding);
}
}
return codeableConcept.isEmpty() ? new Procedure() : procedure.setCode(codeableConcept);
}
use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.PROCEDURE 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