use of org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent in project synthea by synthetichealth.
the class FhirR4 method supplyDelivery.
/**
* Map the JsonObject for a Supply into a FHIR SupplyDelivery and add it to the Bundle.
*
* @param rand Source of randomness to use when generating ids etc
* @param personEntry The Person entry.
* @param bundle Bundle to add to.
* @param supply The supplied object to add.
* @param encounter The encounter during which the supplies were delivered
* @return The added Entry.
*/
private static BundleEntryComponent supplyDelivery(RandomNumberGenerator rand, BundleEntryComponent personEntry, Bundle bundle, HealthRecord.Supply supply, Encounter encounter) {
SupplyDelivery supplyResource = new SupplyDelivery();
supplyResource.setStatus(SupplyDeliveryStatus.COMPLETED);
supplyResource.setPatient(new Reference(personEntry.getFullUrl()));
CodeableConcept type = new CodeableConcept();
type.addCoding().setCode("device").setDisplay("Device").setSystem("http://terminology.hl7.org/CodeSystem/supply-item-type");
supplyResource.setType(type);
SupplyDeliverySuppliedItemComponent suppliedItem = new SupplyDeliverySuppliedItemComponent();
suppliedItem.setItem(mapCodeToCodeableConcept(supply.codes.get(0), SNOMED_URI));
suppliedItem.setQuantity(new Quantity(supply.quantity));
supplyResource.setSuppliedItem(suppliedItem);
supplyResource.setOccurrence(convertFhirDateTime(supply.start, true));
return newEntry(rand, bundle, supplyResource);
}
use of org.hl7.fhir.dstu3.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent in project synthea by synthetichealth.
the class FhirStu3 method supplyDelivery.
/**
* Map the JsonObject for a Supply into a FHIR SupplyDelivery and add it to the Bundle.
*
* @param rand Source of randomness to use when generating ids etc
* @param personEntry The Person entry.
* @param bundle Bundle to add to.
* @param supply The supplied object to add.
* @param encounter The encounter during which the supplies were delivered
* @return The added Entry.
*/
private static BundleEntryComponent supplyDelivery(RandomNumberGenerator rand, BundleEntryComponent personEntry, Bundle bundle, HealthRecord.Supply supply, Encounter encounter) {
SupplyDelivery supplyResource = new SupplyDelivery();
supplyResource.setStatus(SupplyDeliveryStatus.COMPLETED);
supplyResource.setPatient(new Reference(personEntry.getFullUrl()));
CodeableConcept type = new CodeableConcept();
type.addCoding().setCode("device").setDisplay("Device").setSystem("http://hl7.org/fhir/supply-item-type");
supplyResource.setType(type);
SupplyDeliverySuppliedItemComponent suppliedItem = new SupplyDeliverySuppliedItemComponent();
suppliedItem.setItem(mapCodeToCodeableConcept(supply.codes.get(0), SNOMED_URI));
SimpleQuantity quantity = new SimpleQuantity();
quantity.setValue(supply.quantity);
suppliedItem.setQuantity(quantity);
supplyResource.setSuppliedItem(suppliedItem);
supplyResource.setOccurrence(convertFhirDateTime(supply.start, true));
return newEntry(rand, bundle, supplyResource);
}
Aggregations