private void populateDocCatGrid(DocumentCategoryCollection docCats) { form.lyrMain().tabByCategory().grdDocCat().getRows().clear(); if (docCats == null) return; for (int i = 0; i < docCats.size(); i++) { DocumentCategory docCat = docCats.get(i); if (docCat == null) continue; if(DocumentCategory.HISTORICAL.equals(docCat) || DocumentCategory.ASSESSMENT.equals(docCat) || DocumentCategory.RACPCSUMMARY.equals(docCat))//WDEV-13606, WDEV-13634 continue; grdDocCatRow nRow = form.lyrMain().tabByCategory().grdDocCat().getRows().newRow(); nRow.setColDocCat(docCat.getText()); nRow.setValue(docCat); } }
private void listDocumentsAtReferralLevel(DocumentCategory category, DocumentViewLevel viewLevel) { if (form.getGlobalContext().Core.getPatientShortIsNotNull()) { CatsReferralRefVo referral = form.getGlobalContext().RefMan.getCatsReferral(); isGPLetterSelected = false; isGPLetterCategory = false; form.getLocalContext().setDocumentCategory(category); form.getLocalContext().setCatsReferralRef(referral); initializeDynamicGrid(); populateGrid(viewLevel); } else { throw new RuntimeException(); } }
private String getStatus(PatientDocumentSearchListVo patientDocument) { if(patientDocument == null) return null; if(DocumentCreationType.IMPORTED.equals(patientDocument.getCreationType()) || DocumentCreationType.SCANNED.equals(patientDocument.getCreationType())) return IMPORTED; if(DocumentCategory.HISTORICAL.equals(patientDocument.getCategory())) return HISTORICAL; if(patientDocument.getCurrentDocumentStatusIsNotNull()) { if(DocumentStatus.DRAFT.equals(patientDocument.getCurrentDocumentStatus().getCorrespondenceStatus()) || DocumentStatus.FOR_REVIEW.equals(patientDocument.getCurrentDocumentStatus().getCorrespondenceStatus()) ||DocumentStatus.FOR_UPDATE.equals(patientDocument.getCurrentDocumentStatus().getCorrespondenceStatus())) { return DRAFT; } } return COMPLETED; }
private PatientDocumentVo populatePatientDocumentVo(ServerDocumentVo serverDocumentVo, CatsReferralVo catReferral) { PatientDocumentVo vo = new PatientDocumentVo(); vo.setPatient(catReferral.getPatient()); vo.setEpisodeofCare(null); vo.setCareContext(null); vo.setClinicalContact(null); vo.setReferral(null); vo.setName("Letter to patient DNA"); vo.setServerDocument(serverDocumentVo); vo.setCreationType(DocumentCreationType.GENERATED); vo.setCategory(DocumentCategory.LETTER_TO_PATIENT_DNA); vo.setRecordingUser(null); vo.setRecordingDateTime(new DateTime()); vo.setStatus(PreActiveActiveInactiveStatus.ACTIVE); return vo; }
public void executeDSPrintReport(DischargeSummaryScheduleVo job) { EDischargeSTHKSummaryVoCollection summaries = getSTHKPatientDocuments(); if (summaries != null && summaries.size() > 0) { System.out.println( "executeDSPrintReport " + summaries.size()); try { saveReports(summaries, job, "Discharge Summary Report", DocumentCategory.DISCHARGE_SUMMARY); } catch (Exception e) { getDomainFactory().close(); } } }
private PatientDocumentVo populatePatientDocumentVo(PatientEdischargeBatchVo patVo, ServerDocumentVo serverDocumentVo, EDischargeSTHKSummaryVo summaryVo, String docName, DocumentCategory category) { if (summaryVo != null) { if (summaryVo.getCareContextIsNotNull()) { PatientDocumentVo vo = new PatientDocumentVo(); vo.setPatient(patVo); vo.setCareContext(summaryVo.getCareContext()); vo.setName(docName); vo.setServerDocument(serverDocumentVo); vo.setCreationType(DocumentCreationType.GENERATED); vo.setCategory(category); vo.setRecordingUser(getMosUser() != null ? (MemberOfStaffLiteVo) getMosUser() : null); vo.setRecordingDateTime(new DateTime()); vo.setStatus(PreActiveActiveInactiveStatus.ACTIVE); vo.setResponsibleHCP(getResponsibleHCPForCareContext(summaryVo.getCareContext())); return vo; } } return null; }
private boolean saveReport(String fileName, String documentName, DocumentCategory documentCategory) { PatientDocumentVo document = populatePatientDocument(populateServerDocument(fileName), documentName, documentCategory); String[] errors = document.validate(); if (errors != null && errors.length > 0) { engine.showErrors(errors); return false; } try { domain.saveDocument(document, form.getGlobalContext().RefMan.getCatsReferral(), form.getLocalContext().getDischargeSummaryPacuAndWard().getIsCurrent()); String url = "<IFRAME id=\"PostFrame\" name=\"PostFrame\" width=\"100%\" height=\"100%\" frameborder=0 src='" + ConfigFlag.GEN.FILE_SERVER_URL.getValue() + document.getServerDocument().getFileName() + "'></IFRAME>"; form.getLocalContext().setDocumentURL(url); } catch (StaleObjectException e) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); return false; } return true; }
private PatientDocumentVo populatePatientDocument(ServerDocumentVo serverDocument, String documentName, DocumentCategory documentCategory) { PatientDocumentVo document = new PatientDocumentVo(); document.setPatient(domain.getPatientRef(form.getGlobalContext().RefMan.getCatsReferral())); document.setCareContext(domain.getCareContextRef(form.getGlobalContext().RefMan.getCatsReferral())); document.setEpisodeofCare(domain.getEpisodeOfCareRef(form.getGlobalContext().RefMan.getCatsReferral())); document.setReferral(null); document.setName(documentName); document.setServerDocument(serverDocument); document.setCreationType(DocumentCreationType.GENERATED); document.setCategory(documentCategory); document.setRecordingUser((MemberOfStaffRefVo) domain.getMosUser(engine.getLoggedInUser().getUsername())); document.setRecordingDateTime(new DateTime()); document.setStatus(PreActiveActiveInactiveStatus.ACTIVE); return document; }
private PatientDocumentVo populatePatientDocumentVo(ServerDocumentVo serverDocumentVo, String patientDocumentName, DocumentCategory patientDocumentCategory) { PatientDocumentVo vo = new PatientDocumentVo(); vo.setPatient(form.getGlobalContext().Core.getPatientShort()); vo.setEpisodeofCare(form.getGlobalContext().Core.getEpisodeofCareShort()); vo.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); vo.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact()); vo.setReferral(null); vo.setName(patientDocumentName); vo.setServerDocument(serverDocumentVo); vo.setCreationType(DocumentCreationType.GENERATED); vo.setCategory(patientDocumentCategory); vo.setRecordingUser((MemberOfStaffRefVo)domain.getMosUser(engine.getLoggedInUser().getUsername())); vo.setRecordingDateTime(new DateTime()); vo.setStatus(PreActiveActiveInactiveStatus.ACTIVE); return vo; }
private boolean saveReport(String fileName, String documentName, DocumentCategory documentCategory) { PatientDocumentVo document = populatePatientDocument(populateServerDocument(fileName), documentName, documentCategory); String[] errors = document.validate(); if (errors != null && errors.length > 0) { engine.showErrors(errors); return false; } try { domain.saveReport(document, form.getGlobalContext().RefMan.getCatsReferral()); } catch (StaleObjectException e) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); return false; } return true; }
private PatientDocumentVo populatePatientDocumentVo(ServerDocumentVo serverDocumentVo, String patientDocumentName, DocumentCategory patientDocumentCategory) { PatientDocumentVo vo = new PatientDocumentVo(); vo.setPatient(form.getGlobalContext().Core.getPatientShort()); vo.setEpisodeofCare(form.getGlobalContext().Core.getEpisodeofCareShort()); vo.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); vo.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact()); vo.setReferral(null); vo.setName(patientDocumentName); vo.setServerDocument(serverDocumentVo); vo.setCreationType(DocumentCreationType.GENERATED); vo.setCategory(patientDocumentCategory); vo.setRecordingUser((MemberOfStaffRefVo) domain.getMosUser(engine.getLoggedInUser().getUsername())); vo.setRecordingDateTime(new DateTime()); vo.setStatus(PreActiveActiveInactiveStatus.ACTIVE); return vo; }
private PatientDocumentLiteVo getReferralLetter(CatsReferralListVo referral) { StringBuilder query = new StringBuilder(); query.append("SELECT doc FROM CatsReferral as referral left join referral.referralDocuments as doc left join doc.category as cat "); query.append(" WHERE referral.id = :REF_ID and cat.id = :CAT_ID "); ArrayList<String> paramNames = new ArrayList<String>(); ArrayList<Object> paramValues = new ArrayList<Object>(); paramNames.add("REF_ID"); paramValues.add(referral.getID_CatsReferral()); paramNames.add("CAT_ID"); paramValues.add(DocumentCategory.GPLETTER.getID()); return PatientDocumentLiteVoAssembler.create((PatientDocument) getDomainFactory().findFirst(query.toString(), paramNames, paramValues)); }
public void executeDSPrintReport(DischargeSummaryScheduleVo job) { DischargeReportDetailVoCollection dischargeReportsDetails = null; do { dischargeReportsDetails = getPatientDocuments(); if (dischargeReportsDetails != null && dischargeReportsDetails.size() > 0) { try { saveReports(dischargeReportsDetails, job, "Discharge Summary Report", DocumentCategory.DISCHARGE_SUMMARY); } catch (Exception e) { getDomainFactory().close(); break; } } } while (getMorePatientDocuments); }
public void initialize() { removeFromCategoryLookup();//WDEV-13606, WDEV-13634 form.lyrMain().tabByTemplate().ccSpecialty().initialize(Specialty.TYPE_ID);// ActivityType.TYPE_ID); initDynamicGrids(); populateDocCatGrid((DocumentCategoryCollection) domain.getLookupService().getLookupCollection(DocumentCategory.TYPE_ID, DocumentCategoryCollection.class, DocumentCategory.class, true, true)); }
private void removeFromCategoryLookup() { for(int i=form.lyrMain().tabByTemplate().cmbDocCat().getValues().size()-1; i>=0; i--)//WDEV-13634 { if(form.lyrMain().tabByTemplate().cmbDocCat().getValues().get(i) == null) continue; if(DocumentCategory.HISTORICAL.equals(form.lyrMain().tabByTemplate().cmbDocCat().getValues().get(i)) || DocumentCategory.ASSESSMENT.equals(form.lyrMain().tabByTemplate().cmbDocCat().getValues().get(i)) || DocumentCategory.RACPCSUMMARY.equals(form.lyrMain().tabByTemplate().cmbDocCat().getValues().get(i)))// WDEV-13634 { form.lyrMain().tabByTemplate().cmbDocCat().removeRow((DocumentCategory) form.lyrMain().tabByTemplate().cmbDocCat().getValues().get(i)); } } }
public DocumentCategoryConfigShortVoCollection listDocCateConfig(DocumentCategory docCat) { String hql = "from DocumentCategoryConfig as dcc where (dcc.category.id = :catId) order by upper(dcc.template.name) asc";// WDEV-13654 List<?> domObjs = getDomainFactory().find(hql, new String[] { "catId" }, new Object[] { docCat.getId() }); if (domObjs == null || domObjs.size() == 0) return null; return DocumentCategoryConfigShortVoAssembler.createDocumentCategoryConfigShortVoCollectionFromDocumentCategoryConfig(domObjs); }
public void initialize(DocumentCategory category, UploadDocumentStoreLevel documentStoreLevel,DocumentViewLevel documentViewLevel) { form.getLocalContext().setDocumentCategory(category); form.getLocalContext().setUploadDocumentStoreLevel(documentStoreLevel); form.getLocalContext().setDocumentViewLevel(documentViewLevel); open(); updateControlsStates(); }
private void listDocumentsAtPatientLevel(DocumentCategory category,DocumentViewLevel viewLevel) { if (form.getGlobalContext().Core.getPatientShortIsNotNull()) { form.getLocalContext().setDocumentCategory(category); initializeDynamicGrid(); populateGrid(viewLevel); } else { throw new RuntimeException("No Patient selected"); } }