final CdaSettings cdaSettings = new CdaSettings(cda, "cda1", null);
log.debug("Doing query on Cda - Initializing CdaEngine");
final CdaEngine engine = CdaEngine.getInstance();
final QueryOptions queryOptions = new QueryOptions();
queryOptions.setDataAccessId("1");
queryOptions.setOutputType("json");
log.info("Doing query");
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
PrintStream printstream = new PrintStream(outputStream);
engine.doQuery(printstream, cdaSettings, queryOptions);
byte[] doc = outputStream.toByteArray();