class NwhinDataRetriever extends AbstractC32DaoAware implements MessageListener {

	@Override
	public void onMessage(Message msg) {
		TextMessage tMsg = (TextMessage)msg;
		AsyncRetrieveMessage aMsg = null;
		
		try {
			aMsg = (AsyncRetrieveMessage)getAsyncMessageFormat().parse(tMsg.getText());
		}
		catch (Exception ex) {
			logger.error("message parsing error for " + msg + ": USER CANNOT BE NOTIFIED (users info is not known)", ex);
			return;
		}
		
		C32DocumentEntity doc = getC32Document(aMsg);

		try {
			if (logger.isDebugEnabled()) {
				logger.debug("Attempting to Persist Domain XML for: " + aMsg.getPatientId());
			}
			updateDocumentWithNewDocument(aMsg.getPatientId(), doc);
		}
		catch (Exception ex) {
			logger.error("error saving c32 document: USER NOT NOTIFIED:" + msg, ex);
		}
	}

}