private void search() { if (form.cmbMDTList().getValue() == null) { engine.showMessage("Valid search criteria must be specified - Please select a List"); return; } form.getGlobalContext().Core.setCurrentMDTListShown(form.cmbMDTList().getValue()); MDTListAndDatesVo voMdtListFilter = new MDTListAndDatesVo(); MDTListAndDatesVoCollection mdtColl = null; voMdtListFilter.setCareContext(new CareContextVo()); voMdtListFilter.getCareContext().setContext(ContextType.INPATIENT); voMdtListFilter.setListPatientisOn(form.cmbMDTList().getValue()); if ((form.cmbMDTList().getValue() != null) && (form.cmbMDTList().getValue().equals(MDTListAorB.NOTONANYLISTYET))) mdtColl = domain.listCareContextsWithNoMDTList(voMdtListFilter); else if (form.cmbMDTList().getValue() != null) mdtColl = domain.listMDT(voMdtListFilter); populateListControl(mdtColl); }
/** * Function used to set values to labels in the header of the form */ private void populateHeaderControls(MDTListAndDatesVo mdtDetails, AdmisSummary admissionSummary) { // Clear header details clearHeaderControls(); // Check parameter if (mdtDetails == null) return; // Fill in 'MDT List' name form.lblMDTList().setValue(mdtDetails.getListPatientisOn().getText()); KeyDatesVoCollection keyDates = mdtDetails.getKeyDates(); // Fill in 'Next Goal Plan' date and 'Proposed Discharge Date' for (KeyDatesVo keyDate : keyDates) { if (KeyDateType.NEXTGOALPLANDATE.equals(keyDate.getDateType())) form.lblNextGoalPlanDate().setValue(keyDate.getDate().toString(DateFormat.STANDARD)); if (KeyDateType.PROPOSEDDISCHARGEDATE.equals(keyDate.getDateType())) form.lblProposedDischageDate().setValue(keyDate.getDate().toString(DateFormat.STANDARD)); } form.lblClassification().setValue(getClassification(admissionSummary)); form.lblPrimaryPathology().setValue(getPrimaryPathology(admissionSummary)); }
public MDTListAndDatesVo getLatestMDTListDetailsForPatient(PatientRefVo patient, CareContextRefVo careContext) { if (patient == null || patient.getID_Patient() == null) return null; if (careContext == null || careContext.getID_CareContext() == null) return null; String query = "SELECT mdtList FROM MDTListandDates AS mdtList WHERE mdtList.careContext.id = :CARE_CONTEXT "; return MDTListAndDatesVoAssembler.create((MDTListandDates) getDomainFactory().findFirst(query.toString(), "CARE_CONTEXT", careContext.getID_CareContext())); }
/** * A list of MDT appointments */ public ims.clinical.vo.MDTListAndDatesVoCollection listMDT(ims.clinical.vo.MDTListAndDatesVo voMDTList) { DomainFactory factory = getDomainFactory(); List MDTList = factory.find(" from MDTListandDates mdtlist where mdtlist.careContext.endDateTime is null " + "and mdtlist.careContext.context = :context " + "and mdtlist.listPatientisOn = :listPatient", new String[]{"context", "listPatient"}, new Object[]{getDomLookup(voMDTList.getCareContext().getContext()), getDomLookup(voMDTList.getListPatientisOn())}); MDTListAndDatesVoCollection voMDTNoContactColl = new MDTListAndDatesVoCollection(); for (int x = 0; x < MDTList.size(); x++) { MDTListandDates domMDTListAndDates = (MDTListandDates) MDTList.get(x); MDTListAndDatesVo voMDTListAndDates = MDTListAndDatesVoAssembler.create(domMDTListAndDates); voMDTListAndDates.setPatient(PatientShortAssembler.create(domMDTListAndDates.getPatient())); Demographics impl = (Demographics) getDomainImpl(DemographicsImpl.class); voMDTListAndDates.getPatient().setHasAlerts(impl.hasAlerts(domMDTListAndDates.getPatient().getId())); voMDTListAndDates.getPatient().setHasAllergies(impl.hasAllergy(domMDTListAndDates.getPatient().getId())); voMDTNoContactColl.add(voMDTListAndDates); } return voMDTNoContactColl.sort(); }
/** * List of Clinical Contacts with no MDT list type */ public ims.clinical.vo.MDTListAndDatesVoCollection listCareContextsWithNoMDTList(ims.clinical.vo.MDTListAndDatesVo voMDTList) { DomainFactory factory = getDomainFactory(); List contextList = factory.find(" from CareContext r where r.endDateTime is null and r.context = :context and r.id not in " + "( select careContext.id from MDTListandDates)", new String[]{"context"}, new Object[]{getDomLookup(ContextType.INPATIENT)}); MDTListAndDatesVoCollection voMDTNoContactColl = new MDTListAndDatesVoCollection(); for (int x = 0; x < contextList.size(); x++) { CareContext domCareContext = (CareContext) contextList.get(x); CareContextShortVo voCareContext = CareContextShortVoAssembler.create(domCareContext); Demographics impl = (Demographics) getDomainImpl(DemographicsImpl.class); MDTListAndDatesVo mdt = new MDTListAndDatesVo(); mdt.setPatient(PatientShortAssembler.create(domCareContext.getEpisodeOfCare().getCareSpell().getPatient())); mdt.getPatient().setHasAlerts(impl.hasAlerts(mdt.getPatient().getID_Patient())); mdt.getPatient().setHasAllergies(impl.hasAllergy(mdt.getPatient().getID_Patient())); mdt.setCareContext(voCareContext); voMDTNoContactColl.add(mdt); } return voMDTNoContactColl.sort(); }
/** * Function used to prepare the screen for recording a new 'MDT Meeting' */ private void newInstance() { // Clear instance controls clearInstanceControls(); form.grdMDT().setValue(null); // Clear local contexts holding current records form.getLocalContext().setCurrentMDTMeeting(null); form.getLocalContext().setCurrentMDTNote(null); // Set default values MDTListAndDatesVo latestListMDT = form.getLocalContext().getMDTListAndDates(); if (latestListMDT != null) { form.cmbListMDT().setValue(latestListMDT.getListPatientisOn()); for (KeyDatesVo keyDate : latestListMDT.getKeyDates()) { if (KeyDateType.NEXTGOALPLANDATE.equals(keyDate.getDateType())) form.pdtNextGoalPlanDate().setValue(keyDate.getDate()); if (KeyDateType.PROPOSEDDISCHARGEDATE.equals(keyDate.getDateType())) form.pdtProposedDischargedDate().setValue(keyDate.getDate()); } } form.dteMDTMeetingDate().setValue(new Date()); // Default in authoring info for MDT Notes form.ctnDetails().qmbRecHCP().clear(); Hcp hcp = (Hcp) domain.getHcpUser(); if(hcp != null) { form.ctnDetails().qmbRecHCP().newRow(hcp, hcp.toString()); form.ctnDetails().qmbRecHCP().setValue(hcp); } form.ctnDetails().dtimRecDateTime().setValue(new DateTime()); // Set form to EDIT mode form.setMode(FormMode.EDIT); }
private void populateListControl(MDTListAndDatesVoCollection mdtColl) { form.grdPatients().getRows().clear(); if (mdtColl != null) { GenForm.grdPatientsRow row = null; MDTListAndDatesVo mdt = null; for (int i = 0; i < mdtColl.size(); i++) { mdt = mdtColl.get(i); row = form.grdPatients().getRows().newRow(); if (mdt.getPatientIsNotNull()) { if (mdt.getPatient().getNameIsNotNull()) { row.setcolForename(mdt.getPatient().getName().getForename()); row.setcolSurname(mdt.getPatient().getName().getSurname()); } PatientId voPatId = mdt.getPatient().getDisplayId(); if (voPatId != null) row.setcolHospnum(voPatId.getValue()); row.setcolDob(mdt.getPatient().getDobIsNotNull() ? mdt.getPatient().getDob().toString() : null); row.setColAge(mdt.getPatient().getDobIsNotNull() ? mdt.getPatient().calculateAge().toString() : null); if (mdt.getPatient().getSex() != null) row.setcolSex(mdt.getPatient().getSex().getText()); if (mdt.getPatient().getIsDead() != null && mdt.getPatient().getIsDead().booleanValue()) row.setBackColor(ConfigFlag.UI.RIP_COLOUR.getValue()); } row.setValue(mdt); } form.lblTotal().setValue("Total : " + new Integer(mdtColl.size()).toString()); if (mdtColl.size() == 0) engine.showMessage("No matching patients found."); } }
public MDTMeetingVo save(MDTMeetingVo mdtMeeting, MDTListAndDatesVo mdtList) throws StaleObjectException { if (!mdtMeeting.isValidated()) throw new DomainRuntimeException("MDT Meeting has not beed validated."); if (!mdtList.isValidated()) throw new DomainRuntimeException("MDT List has not been validate."); DomainFactory factory = getDomainFactory(); MDTMeeting domMDTMeeting = MDTMeetingVoAssembler.extractMDTMeeting(factory, mdtMeeting); // Check mdtMeeting to be the latest (if it was already saved) if (mdtMeeting.getID_MDTMeeting() != null) { MDTMeetingVo latest = getLatest(mdtMeeting); if (latest != null) { mdtList.setListPatientisOn(latest.getListPatientisOn()); mdtList.setKeyDates(new KeyDatesVoCollection()); for (KeyDatesVo keyDate : latest.getKeyDates()) { KeyDatesVo date = new KeyDatesVo(); date.setDate(keyDate.getDate()); date.setDateType(keyDate.getDateType()); mdtList.getKeyDates().add(date); } } } MDTListandDates domMDTList = MDTListAndDatesVoAssembler.extractMDTListandDates(factory, mdtList); factory.save(domMDTMeeting); factory.save(domMDTList); return MDTMeetingVoAssembler.create(domMDTMeeting); }