/** * Function used to present screen to user. * It will query records and populate screen. * <br>Call this function to refresh the screen. */ private void open() { // Clear screen clearScreen(); // Get the latest 'MDT Meeting - List and ' record for current Patient form.getLocalContext().setMDTListAndDates(domain.getLatestMDTListDetailsForPatient(form.getGlobalContext().Core.getPatientShort(), form.getGlobalContext().Core.getCurrentCareContext())); // Get admission summary - if any AdmisSummary admissionSummary; if (form.getGlobalContext().Core.getCurrentClinicalContact() != null) { admissionSummary = domain.getAdmissionSummaryByClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact()); } else { admissionSummary = domain.getAdmissionSummaryByCareContext(form.getGlobalContext().Core.getCurrentCareContext()); } // Populate header controls populateHeaderControls(form.getLocalContext().getMDTListAndDates(), admissionSummary); // Get the 'MDT Meeting' records for current Patient and for current CareContext MDTMeetingLiteVoCollection mdtMeetingRecords = domain.listMDTMeeting(form.getGlobalContext().Core.getPatientShort(), form.getGlobalContext().Core.getCurrentCareContext()); // Populate screen with data populateMDTMeetingGrid(mdtMeetingRecords); // Set form to VIEW mode form.setMode(FormMode.VIEW); }
/** * Function used to populate MDT Meeting records to MDT grid * @param mdtMeetingRecords - Records that will be populated to MDT grid */ private void populateMDTMeetingGrid(MDTMeetingLiteVoCollection mdtMeetingRecords) { // Clear grid & instance controls clearDataControls(); // Check 'MDT Meeting' records collection parameter if (mdtMeetingRecords == null) return; // Populate 'MDT Meeting' records to grid for (MDTMeetingLiteVo mdtMeeting : mdtMeetingRecords) { grdMDTRow mdtRow = form.grdMDT().getRows().newRow(); mdtRow.setColDate(mdtMeeting.getMDTMeetingDate().toString()); mdtRow.setValue(mdtMeeting); } form.grdMDT().setValue(form.getLocalContext().getCurrentMDTMeeting()); if (mdtMeetingRecords.size() > 0) { if (form.grdMDT().getValue() == null) { form.grdMDT().setValue(mdtMeetingRecords.get(0)); } form.getLocalContext().setLatestMDTMeeting(mdtMeetingRecords.get(0)); } updateSelection(form.grdMDT().getValue()); }
public MDTMeetingLiteVoCollection listMDTMeeting(PatientRefVo patient, CareContextRefVo careContext) { if (patient == null || careContext == null) throw new CodingRuntimeException("Patient or CareContext are mandatory"); StringBuilder query = new StringBuilder(); query.append("SELECT mdtMeeting FROM MDTMeeting AS mdtMeeting "); query.append("WHERE mdtMeeting.careContext.id = :CARE_CONTEXT "); query.append("ORDER BY mdtMeeting.mDTMeetingDate DESC, mdtMeeting.systemInformation.creationDateTime DESC "); return MDTMeetingLiteVoAssembler.createMDTMeetingLiteVoCollectionFromMDTMeeting(getDomainFactory().find(query.toString(), "CARE_CONTEXT", careContext.getID_CareContext())); }