@Override public Object evaluate(Exchange exchange) { if (returnError) throw new InternalErrorException("Something went wrong"); Bundle requestBundle = exchange.getIn().getBody(Bundle.class); Bundle responseBundle = new Bundle() .setType(Bundle.BundleType.TRANSACTIONRESPONSE) .setTotal(requestBundle.getTotal()); for (Bundle.BundleEntryComponent requestEntry : requestBundle.getEntry()) { Bundle.BundleEntryResponseComponent response = new Bundle.BundleEntryResponseComponent() .setStatus("201 Created") .setLastModified(new Date()) .setLocation(requestEntry.getResource().getClass().getSimpleName() + "/" + 4711); responseBundle.addEntry() .setResponse(response) .setResource(responseResource(requestEntry.getResource())); } return responseBundle; }
public static org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent convertBundleEntryResponseComponent(org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryResponseComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent(); copyElement(src, tgt); tgt.setStatus(src.getStatus()); if (src.hasLocation()) tgt.setLocation(src.getLocation()); if (src.hasEtag()) tgt.setEtag(src.getEtag()); if (src.hasLastModified()) tgt.setLastModified(src.getLastModified()); return tgt; }
@Override public void setResponseLastModified(Bundle.BundleEntryComponent theBundleEntry, Date theLastModified) { theBundleEntry.getResponse().setLastModified(theLastModified); }
public org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent convertBundleEntryResponseComponent(org.hl7.fhir.instance.model.Bundle.BundleEntryResponseComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent(); copyElement(src, tgt); tgt.setStatus(src.getStatus()); tgt.setLocation(src.getLocation()); tgt.setEtag(src.getEtag()); tgt.setLastModified(src.getLastModified()); return tgt; }
public static org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent convertBundleEntryResponseComponent(org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryResponseComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent(); copyElement(src, tgt); tgt.setStatus(src.getStatus()); if (src.hasLocation()) tgt.setLocation(src.getLocation()); if (src.hasEtag()) tgt.setEtag(src.getEtag()); if (src.hasLastModified()) tgt.setLastModified(src.getLastModified()); return tgt; }
@Override public void setResponseLastModified(Bundle.BundleEntryComponent theBundleEntry, Date theLastModified) { theBundleEntry.getResponse().setLastModified(theLastModified); }
public org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent convertBundleEntryResponseComponent(org.hl7.fhir.instance.model.Bundle.BundleEntryResponseComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent(); copyElement(src, tgt); tgt.setStatus(src.getStatus()); tgt.setLocation(src.getLocation()); tgt.setEtag(src.getEtag()); tgt.setLastModified(src.getLastModified()); return tgt; }