public SentToXrayVoCollection getAllSentToXRay(CareContextRefVo careContextRef) { if (careContextRef == null || careContextRef.getID_CareContext() == null) { throw new CodingRuntimeException("Cannot get SentToXrayVoCollection on null Id for CareContext "); } DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); hql.append("select allSentToXRay from SentToXray as allSentToXRay where allSentToXRay.attendance.id = :attID order by allSentToXRay.sentDateTime desc "); List<?> list = factory.find(hql.toString(), new String[] {"attID"}, new Object[] {careContextRef.getID_CareContext()}); return SentToXrayVoAssembler.createSentToXrayVoCollectionFromSentToXray(list); }
private void populateSentToXrayGrid() { form.ctnTimes().grdSentToXray().getRows().clear(); if(form.recbrEmergencyAttendance().getValue() == null) return; SentToXrayVoCollection sentToXrayTimes = domain.listSentToXray(form.recbrEmergencyAttendance().getValue().getCareContext()); for (int i = 0; i < sentToXrayTimes.size(); i++) { addSentToXrayTimeRowToGrid(sentToXrayTimes.get(i)); } }
public SentToXrayVoCollection listSentToXray(CareContextRefVo careContextRef) { if(careContextRef == null || careContextRef.getID_CareContext() == null) return null; String query = "select sx from SentToXray as sx left join sx.attendance as cc where cc.id = :CareContextId order by sx.systemInformation.creationDateTime desc"; List<?> list = getDomainFactory().find(query, new String[] {"CareContextId"}, new Object[] {careContextRef.getID_CareContext()}); return SentToXrayVoAssembler.createSentToXrayVoCollectionFromSentToXray(list); }
private void populateRecordBrowser() { form.recbrSentToXRay().clear(); SentToXrayVoCollection collSentToXRay = domain.getAllSentToXRay(form.getGlobalContext().Core.getCurrentCareContext()); if (collSentToXRay == null) { return; } for (int i = 0; i < collSentToXRay.size(); i++) { SentToXrayVo sentToXRay = collSentToXRay.get(i); StringBuffer string = new StringBuffer(); if (sentToXRay.getSentDateTimeIsNotNull()) { string.append("Sent on: "+sentToXRay.getSentDateTime()); } if (sentToXRay.getSentByIsNotNull()) { string.append(" - "+sentToXRay.getSentBy().getName()); } if (sentToXRay.getReturnedDateTimeIsNotNull()) { string.append(" - Returned on: "+sentToXRay.getReturnedDateTime()); } form.recbrSentToXRay().newRow(sentToXRay, string.toString()); } if (collSentToXRay.size() > 0 && form.getLocalContext().getselectedSendToXRay() == null) { form.getLocalContext().setselectedSendToXRay(collSentToXRay.get(0)); } form.recbrSentToXRay().setValue(form.getLocalContext().getselectedSendToXRay()); populateInstanceControls(form.getLocalContext().getselectedSendToXRay()); }