protected function sendBundle(services\FhirBundle $bundle)
{
$data = $bundle->toFhir();
if ($this->output_format == 'xml') {
header('Content-type: ' . self::ATOM_MIMETYPE);
$this->sendResponse(200, Yii::app()->fhirMarshal->renderXml($data));
} else {
header('Content-type: ' . self::JSON_MIMETYPE);
$this->sendResponse(200, Yii::app()->fhirMarshal->renderJson($data));
}
}