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; }
public PatientEdischargeBatchVo getPatientEdischargeBatchViaCareContext(CareContextRefVo careContext) { DomainFactory factory = getDomainFactory(); List lst = factory.find("select p from CareContext as cc left join cc.episodeOfCare as eoc left join eoc.careSpell as cs left join cs.patient as p where (cc.id = :idCareContext)", new String[]{"idCareContext"}, new Object[]{careContext.getID_CareContext()}); if (lst != null && lst.size() > 0) return PatientEdischargeBatchVoAssembler.create((ims.core.patient.domain.objects.Patient) lst.get(0)); return null; }