private void getSelectedInstance() { clearInstance(); if (form.recbrPMH().getValue() == null) return; PatientRelevantPMHVo voPatientProblemPMH = domain.getRelevantPMH(form.recbrPMH().getValue());//WDEV-17602 form.getLocalContext().setSelectedRelevantPMH(voPatientProblemPMH); if (voPatientProblemPMH == null) { return; } populateInstanceControls(voPatientProblemPMH); }
public PatientRelevantPMHVo getRelevantPMH(CareContextRefVo careContextRefVo) { DomainFactory factory = getDomainFactory(); if (careContextRefVo == null || careContextRefVo.getID_CareContext() == null) { throw new CodingRuntimeException("Cannot get careContextRefVo on null Id "); } StringBuffer hql = new StringBuffer(); hql.append(" select PMH from PatientRelevantPMH as PMH left join PMH.attendance as contextID where contextID.id = :contextID"); List<?> list = factory.find(hql.toString(), new String[] {"contextID"}, new Object[] {careContextRefVo.getID_CareContext()}); if (list!=null && list.size()>0) return PatientRelevantPMHVoAssembler.createPatientRelevantPMHVoCollectionFromPatientRelevantPMH(list).get(0); return null; }
public PatientRelevantPMHVo savePatientPMH(PatientRelevantPMHVo patientPMHToSave) throws StaleObjectException, UniqueKeyViolationException { if (patientPMHToSave == null) throw new CodingRuntimeException("Cannot save null PatientPMH"); if (!patientPMHToSave.isValidated()) throw new DomainRuntimeException("PatientPMHVo Not Validated."); DomainFactory factory = getDomainFactory(); PatientRelevantPMH domainPatientPMH = PatientRelevantPMHVoAssembler.extractPatientRelevantPMH(factory, patientPMHToSave); factory.save(domainPatientPMH); return PatientRelevantPMHVoAssembler.create(domainPatientPMH); }
private void PopulateRecordBrowser()//WDEV-17602 { PatientRelevantPMHVoCollection allRelevantPHM = domain.getAllRelevantPMH(form.getLocalContext().getSelectedPatientRef()); form.recbrPMH().clear(); for (int i = 0; i < allRelevantPHM.size(); i++) { PatientRelevantPMHVo PatientRelevantPMH = allRelevantPHM.get(i); if (PatientRelevantPMH == null) return; StringBuffer text = new StringBuffer(); CareContextRefVo voCareContexPMH = PatientRelevantPMH.getAttendance(); TriageForRelvantPMHVo triage = domain.getTriageByCareContext(PatientRelevantPMH.getAttendance()); PatientProblemForRelevantPMHVo voPatientProblem = (triage!=null ? triage.getMainPresentingProblem() : null); text.append(getTextToDisplayFromEmergencyAttendance(PatientRelevantPMH.getAttendance())); //WDEV-17127 PatientRelevantPMHVo voPatientProblemPMH = domain.getRelevantPMH(voCareContexPMH); if (voPatientProblemPMH!=null && voPatientProblemPMH.getAuthoringInformationIsNotNull()) { if (voPatientProblemPMH.getAuthoringInformation().getAuthoringDateTimeIsNotNull()) { text.append(voPatientProblemPMH.getAuthoringInformation().getAuthoringDateTime()); text.append(" - "); } if (voPatientProblemPMH.getAuthoringInformation().getAuthoringHcpIsNotNull()) { text.append(voPatientProblemPMH.getAuthoringInformation().getAuthoringHcp().getName()); text.append(" - "); } } if (voPatientProblem != null) { if (voPatientProblem.getPatientProblemIsNotNull()) { text.append(" - "); text.append(voPatientProblem.getPatientProblem()); } } if (voCareContexPMH.equals(form.getLocalContext().getCurrentCareContextRef())) { form.recbrPMH().newRow(i,PatientRelevantPMH.getAttendance(), text.toString(),Color.Green); continue; } form.recbrPMH().newRow(i, PatientRelevantPMH.getAttendance(), text.toString()); } //WDEV-17602 ArrayList collRecBrowser = form.recbrPMH().getValues(); if (!collRecBrowser.contains(form.getLocalContext().getCurrentCareContextRef())) { form.recbrPMH().newRow(form.getLocalContext().getCurrentCareContextRef(), getTextToDisplayFromEmergencyAttendance(form.getLocalContext().getCurrentCareContextRef()).toString(), Color.Green); } form.recbrPMH().setValue(form.getLocalContext().getCurrentCareContextRef()); }
private void populateInstanceControls(PatientRelevantPMHVo voPatientProblemPMH) { form.richText().setValue(voPatientProblemPMH.getRelevantPMH()); }
private void PopulateRecordBrowser()//WDEV-17602 { PatientRelevantPMHVoCollection allRelevantPHM = domain.getAllRelevantPMH(form.getLocalContext().getSelectedPatientRef()); form.recbrPMH().clear(); for (int i = 0; i < allRelevantPHM.size(); i++) { PatientRelevantPMHVo PatientRelevantPMH = allRelevantPHM.get(i); if (PatientRelevantPMH == null) return; StringBuffer text = new StringBuffer(); CareContextRefVo voCareContexPMH = PatientRelevantPMH.getAttendance(); TriageForRelvantPMHVo triage = domain.getTriageByCareContext(PatientRelevantPMH.getAttendance()); PatientProblemForRelevantPMHVo voPatientProblem = (triage!=null ? triage.getMainPresentingProblem() : null); text.append(getTextToDisplayFromEmergencyAttendance(PatientRelevantPMH.getAttendance())); //WDEV-17127 PatientRelevantPMHVo voPatientProblemPMH = domain.getRelevantPMH(voCareContexPMH); if (voPatientProblemPMH!=null && voPatientProblemPMH.getAuthoringInformationIsNotNull()) { text.append(" - "); //WDEV-19534 if (voPatientProblemPMH.getAuthoringInformation().getAuthoringDateTimeIsNotNull()) { text.append(voPatientProblemPMH.getAuthoringInformation().getAuthoringDateTime()); text.append(" - "); } if (voPatientProblemPMH.getAuthoringInformation().getAuthoringHcpIsNotNull()) { text.append(voPatientProblemPMH.getAuthoringInformation().getAuthoringHcp().getName()); //text.append(" - "); //WDEV-19534 } } if (voPatientProblem != null) { if (voPatientProblem.getPatientProblemIsNotNull()) { text.append(" - "); text.append(voPatientProblem.getPatientProblem()); } } if (voCareContexPMH.equals(form.getLocalContext().getCurrentCareContextRef())) { form.recbrPMH().newRow(i,PatientRelevantPMH.getAttendance(), text.toString(),Color.Green); continue; } form.recbrPMH().newRow(i, PatientRelevantPMH.getAttendance(), text.toString()); } //WDEV-17602 ArrayList collRecBrowser = form.recbrPMH().getValues(); if (!collRecBrowser.contains(form.getLocalContext().getCurrentCareContextRef())) { form.recbrPMH().newRow(form.getLocalContext().getCurrentCareContextRef(), getTextToDisplayFromEmergencyAttendance(form.getLocalContext().getCurrentCareContextRef()).toString(), Color.Green); } form.recbrPMH().setValue(form.getLocalContext().getCurrentCareContextRef()); }