public String viewCda(
@RequestParam String cdaID,
@ModelAttribute("cdaList") Map<String, CdaRecord> cdaList,
ModelMap model) throws SiteException {
// Check the session for the requested cda
CdaRecord record = null;
if (cdaList != null && cdaList.containsKey(cdaID)) {
record = cdaList.get(cdaID);
} else {
// Need to round trip to query for requested cda
PatientIdentification pid = new PatientIdentification();
pid.setCdaID(cdaID);
Map<String, CdaRecord> resultList = executeQuery(pid);
record = resultList.get(cdaID);
if (record == null) {
// No match found, redirect to search w/ error
String[] errors = new String[1];
errors[0] = "No Match Found";
model.addAttribute("errors", errors);
return "sendSuccess";
}
}
String cda = this.addStyleSheet(new StringBuffer(record.getCDA()));
String[] params = new String[1];
params[0] = cda;
model.addAttribute(
"params", params);