private Object getPASDetails() { if(form.getGlobalContext().Core.getCurrentCareContext().getPasEvent() == null) return null; AdmissionDetailForClinicalAdmissionVo admission = domain.getPASAdmissionDetails(form.getGlobalContext().Core.getCurrentCareContext().getPasEvent()); if(admission != null) return admission; PasEventForClinicalAdmissionVo pasEvent = domain.getPASEvent(form.getGlobalContext().Core.getCurrentCareContext().getPasEvent()); return pasEvent; }
private void populatePASEventDetails(Object pasAdmissionDetails) { if(pasAdmissionDetails instanceof AdmissionDetailForClinicalAdmissionVo) { AdmissionDetailForClinicalAdmissionVo admission = (AdmissionDetailForClinicalAdmissionVo) pasAdmissionDetails; populatePASEvent(admission.getPasEvent()); form.txtSource().setValue(admission.getSourceOfAdmissionIsNotNull() ? admission.getSourceOfAdmission().getIItemText() : null); } else if (pasAdmissionDetails instanceof PasEventForClinicalAdmissionVo) { populatePASEvent((PasEventForClinicalAdmissionVo) pasAdmissionDetails); } }
public AdmissionDetailForClinicalAdmissionVo getPASAdmissionDetails(PASEventRefVo pasEvent) { if(pasEvent == null || pasEvent.getID_PASEvent() == null) throw new CodingRuntimeException("Can not get AdmissionDetail on null PASEvent Id."); DomainFactory factory = getDomainFactory(); String query = "from AdmissionDetail as ad where ad.pasEvent.id = :PASEvent"; List<?> list = factory.find(query, new String[] {"PASEvent"}, new Object[] {pasEvent.getID_PASEvent()}); if(list != null && list.size() > 0) return AdmissionDetailForClinicalAdmissionVoAssembler.create((AdmissionDetail) list.get(0)); return null; }