private void prepopulateAssessmentTypeForNewRecord() { ContextType contextType = getContextType(); if (isNewRecord() && isFirstRecord()) { if (contextType != null) { DPPType value = null; if (contextType.equals(ContextType.INPATIENT)) value = DPPType.ADMISSION; else if (contextType.equals(ContextType.OUTPATIENT)) value = DPPType.PREADMISSION; if (value != null) { addAssessmentToCombo(value); form.lyrTabs().tabCurrent().cmbAssessment().setValue(value); } } } }
private boolean careSpellContainsInpatient(CareSpellVo careSpellVo) { int count = 0; for (int i = 0; i < careSpellVo.getEpisodes().size(); i++) { for (int j = 0; j < careSpellVo.getEpisodes().get(i).getCareContexts().size(); j++) { if(careSpellVo.getEpisodes().get(i).getCareContexts().get(j).getContext().equals(ContextType.INPATIENT)) count++; } } if (count > 0) return true; return false; }
@SuppressWarnings("unchecked") private CareContextRefVo getInpatientCareContext(Integer patientId) { if(patientId == null) throw new CodingRuntimeException("Invalid patient Id."); DomainFactory factory = getDomainFactory(); String query = "select inpCareContext from CareSpell as cs left join cs.episodes as ep left join ep.careContexts as inpCareContext left join cs.patient as p where p.id = :patId and inpCareContext.endDateTime is null and inpCareContext.context.id = :inpatient order by inpCareContext.startDateTime desc"; List listInpatientCareContext = factory.find(query, new String[] {"patId", "inpatient"}, new Object[] {patientId, ContextType.INPATIENT.getID()}); if(listInpatientCareContext != null) { for(int i=0; i<listInpatientCareContext.size(); i++) { if(listInpatientCareContext.get(i) != null) { CareContext obj = (CareContext)listInpatientCareContext.get(i); return new CareContextRefVo(obj.getId(), obj.getVersion()); } } } return null; }
protected void onFormOpen() throws ims.framework.exceptions.FormOpenException { CareContextShortVo careContext = form.getGlobalContext().Core.getCurrentCareContext(); if(ContextType.OUTPATIENT.equals(careContext.getContext())) { form.lyrDetails().tabCommentsOPD().setHeaderVisible(true); form.lyrDetails().tabSummaryIP().setHeaderVisible(false); } else { form.lyrDetails().tabCommentsOPD().setHeaderVisible(false); form.lyrDetails().tabSummaryIP().setHeaderVisible(true); } form.getLocalContext().setReportChanged(Boolean.FALSE); form.getLocalContext().setOutpatientSummaryChanged(Boolean.FALSE); initialiseClinicalData(); initialiseOutpatientSummaryGrid(); showRecordingControls(false); open(); }
public boolean isAccessible() { if (form.getGlobalContext().Core.getPatientShortIsNotNull() && form.getGlobalContext().Core.getCurrentCareContextIsNotNull()) { if(form.getGlobalContext().Core.getCurrentCareContext().getContextIsNotNull() && form.getGlobalContext().Core.getCurrentCareContext().getContext().equals(ContextType.INPATIENT )) return true; if(form.getGlobalContext().Core.getCurrentCareContext().getContextIsNotNull() && form.getGlobalContext().Core.getCurrentCareContext().getContext().equals(ContextType.OUTPATIENT )) { if (form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull()) return true; } } return false; }
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); }
private CareContext getOpenInPatientCareContext(PatientRefVo patientVo) { if(patientVo == null) throw new DomainRuntimeException("Invalid Argument: null Patient provided"); DomainFactory factory = getDomainFactory(); List<?> domCareContexts = factory.find("select cc from CareContext cc left join cc.episodeOfCare " + " as e1_1 left join e1_1.careSpell as c2_1 left join c2_1.patient as p1_1" + " where p1_1.id = :PAT and cc.endDateTime is null and cc.context=:ContextType" , new String[] {"PAT","ContextType"}, new Object[] { patientVo.getID_Patient(),getDomLookup(ContextType.INPATIENT)}); if (domCareContexts!=null&&domCareContexts.size()!=0) { CareContext domCareContext = (CareContext)domCareContexts.get(0); return domCareContext; } else return null; }
private CareContextRepatriationVo createCareContext(PatientRefVo patient, EpisodeOfCareRefVo episodeOfCare, PasEventRepatriationVo pasEvent, DateTime startDateTime, HcpLiteVo hcp, LocationRefVo location, ServiceLiteVo service, SourceOfReferral sourceOfReferral) { CareContextRepatriationVo careContext = new CareContextRepatriationVo(); careContext.setPasEvent(pasEvent); careContext.setContext(ContextType.REFERRAL); careContext.setEpisodeOfCare(episodeOfCare); careContext.setStartDateTime(startDateTime); careContext.setEndDateTime(null); careContext.setResponsibleHCP(hcp); CareContextStatusHistoryVo firstStatus = new CareContextStatusHistoryVo(); firstStatus.setStatus(CareContextStatus.OPEN); firstStatus.setStatusDateTime(startDateTime); careContext.setCurrentStatus(firstStatus); careContext.setStatusHistory(new CareContextStatusHistoryVoCollection()); careContext.getStatusHistory().add(firstStatus); return careContext; }
private CareContextShortVo getCareContext(List<?> ccList, ContextType context) { if (ccList == null || ccList.isEmpty() || context == null) return null; for (int i=0;i<ccList.size();i++) { if (!(ccList.get(i) instanceof CareContext)) continue; if (context.getId() == ((CareContext)ccList.get(i)).getContext().getId()) { return CareContextShortVoAssembler.create((CareContext) ccList.get(i)); } } return null; }
public Boolean checkIsAlreadyAdmitted(Integer patientId) { if (patientId == null) { throw new CodingRuntimeException("Cannot check if Patient is admitted on null PatientID "); } DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); hql.append(" select count (c1_1.id) from EmergencyAttendance as e1_1 right join e1_1.careContext as c1_1 left join c1_1.episodeOfCare as e2_1 left join e2_1.careSpell as c2_1 left join c2_1.patient as p1_1 where (p1_1.id = :patId and e1_1.isRIE is null and c1_1.endDateTime is null and c1_1.context.id <> :contextTypeID ) "); //wdev-17569 //WDEV-20992 Object[] count = factory.find(hql.toString(), new String[] { "patId","contextTypeID" }, new Object[] {patientId, ContextType.REFERRAL.getID()}).toArray(); //WDEV-20992 if(count != null && count.length > 0) if (((Long) count[0]).intValue() > 0) return true; return false; }
private CareContextForRequestServiceShortVo createCareContext(EpisodeOfCareForRequestServiceShortVo episodeOfCare, ContextType contextType, DateTime startDateTime, HcpRefVo responsibleHCP) { CareContextForRequestServiceShortVo careContext = new CareContextForRequestServiceShortVo(); careContext.setContext(contextType); careContext.setStartDateTime(startDateTime); careContext.setEndDateTime(null); careContext.setEpisodeOfCare(episodeOfCare); CareContextStatusHistoryVo firstStatus = new CareContextStatusHistoryVo(); firstStatus.setStatus(CareContextStatus.OPEN); firstStatus.setStatusDateTime(startDateTime); // careContext.setCurrentStatus(firstStatus); // careContext.setStatusHistory(new CareContextStatusHistoryVoCollection()); // careContext.getStatusHistory().add(firstStatus); if (episodeOfCare.getCareContexts() == null) episodeOfCare.setCareContexts(new CareContextForRequestServiceShortVoCollection()); episodeOfCare.getCareContexts().add(careContext); return careContext; }
public boolean isAccessible() { if(!super.isAccessible()) return false; if(form.getGlobalContext().Core.getCurrentCareContextIsNotNull() && form.getGlobalContext().Core.getCurrentCareContext().getContextIsNotNull() && ! form.getGlobalContext().Core.getCurrentCareContext().getContext().equals(ContextType.INPATIENT)) return false; // TODO: Add your conditions here. return true; }
public boolean isAccessible() { if(form.getGlobalContext().Core.getPatientShortIsNotNull() && form.getGlobalContext().Core.getCurrentCareContextIsNotNull() && form.getGlobalContext().Core.getCurrentCareContext().getContext().equals(ContextType.OUTPATIENT)) return true; return false; }
public boolean isAccessible() { if(!super.isAccessible()) return false; if(form.getGlobalContext().Core.getCurrentCareContextIsNotNull() && form.getGlobalContext().Core.getCurrentCareContext().getContextIsNotNull() && ! form.getGlobalContext().Core.getCurrentCareContext().getContext().equals(ContextType.INPATIENT)) return false; return true; }
private boolean hasUIErrors() { ArrayList errors = new ArrayList(); AuthoringInformationVo authoringInfo = form.lyrTabs().tabCurrent().customControlAuthoring().getValue(); if (authoringInfo == null) { errors.add("Authoring Information is mandatory"); } else { if (authoringInfo.getAuthoringDateTime() == null) errors.add("Authoring Date/Time is mandatory"); if (authoringInfo.getAuthoringHcp() == null) errors.add("Authoring HCP is mandatory"); } if (form.lyrTabs().tabCurrent().cmbAssessment().getValue() == null) { ContextType contextType = getContextType(); boolean isInpatientOrOutpatient = contextType != null && (contextType.equals(ContextType.INPATIENT) || contextType.equals(ContextType.OUTPATIENT)); if(isInpatientOrOutpatient) errors.add("Assessment is mandatory"); } if (form.lyrTabs().tabCurrent().cmbStatus().getValue() == null) errors.add("Status is mandatory"); if (errors.size() > 0) { String[] uiErrors = new String[errors.size()]; errors.toArray(uiErrors); engine.showErrors(uiErrors); return true; } return false; }
private void initialize() { prepopulateStatusCombo(); prePopulateAssessmentTypeCombo(); form.lyrTabs().tabCurrent().customControlAuthoring().setIsRequiredPropertyToControls(Boolean.TRUE); form.lyrTabs().tabCurrent().setHeaderEnabled(true); //wdev-10720 ContextType contextType = getContextType(); if(contextType != null && (contextType.equals(ContextType.INPATIENT) || contextType.equals(ContextType.OUTPATIENT))) form.lyrTabs().tabCurrent().cmbAssessment().setRequired(true); //---------- }
private CareSpellVoCollection patientIsCurrentInpatient() { CareSpellVoCollection inpatientCare = new CareSpellVoCollection(); CareSpellVoCollection inpatientCareList = new CareSpellVoCollection(); // CareSpellVo inpatCare = new CareSpellVo(); CareSpellVoCollection careList = domain.listCareSpellsByPatient(form.getGlobalContext().Core.getPatientShort(), null); if (careList != null) { for (int index = 0; index < careList.size(); index++) { EpisodeofCareVoCollection episodeList = careList.get(index).getEpisodes(); for (int i = 0; i < episodeList.size(); i++) { CareContextVoCollection careContextList = episodeList.get(i).getCareContexts(); for (int j = 0; j < careContextList.size(); j++) { if (careContextList.get(j).getContext().equals(ContextType.INPATIENT) == true /*&& careContextList.get(j).getEndDateTime() == null*/) { inpatientCareList.add(careList.get(index)); } } } } } if (inpatientCareList.size() > 0) { inpatientCare.add(inpatientCareList.get(0)); return inpatientCare; } return inpatientCareList; }
private boolean episodeContainsInpatient(EpisodeofCareVo episodeofCareVo) { int count = 0; for (int j = 0; j < episodeofCareVo.getCareContexts().size(); j++) { if(episodeofCareVo.getCareContexts().get(j).getContext().equals(ContextType.INPATIENT)) count++; } if (count > 0) return true; return false; }
private void selectCareContext() { bindCmbClinicalContact(); if(ConfigFlag.UI.DEFAULT_DOCUMENT_TO_CONTEXT_DATE.getValue())// WDEV-13413 { if(form.cmbCContext().getValue() instanceof CareContextForPatientDocumentVo) { form.dteDocumentDate().setValue(form.cmbCContext().getValue().getStartDateTime().getDate()); } else { selectEpisodeOfCare(); } } else if(form.cmbCContext().getValue() instanceof CareContextForPatientDocumentVo && ContextType.INPATIENT.equals(form.cmbCContext().getValue().getContext()) && form.cmbCContext().getValue().getStartDateTimeIsNotNull())// WDEV-13413 { form.dteDocumentDate().setValue(form.cmbCContext().getValue().getStartDateTime().getDate()); } else { form.dteDocumentDate().setValue(new Date()); } form.ccResponsibleHcp().setValue((form.cmbCContext().getValue() instanceof CareContextForPatientDocumentVo && form.cmbCContext().getValue().getResponsibleHCP() != null) ? form.cmbCContext().getValue().getResponsibleHCP() : (form.cmbEpisode().getValue() instanceof EpisodeofCareShortVo ? form.cmbEpisode().getValue().getResponsibleHCP() : null)); updateControlsState(); }
private boolean isRemoveSpinalMedicalAdmissionContatType() { CareContextVo voCareContext = form.getLocalContext().getCareContext(); boolean bRemoveSpinalMedAdmissionContactType = false; if(voCareContext != null) { if(voCareContext.getContextIsNotNull() && voCareContext.getContext().equals(ContextType.INPATIENT)) { if(voCareContext.getClinicalContactsIsNotNull()) { for(int i=0;i<voCareContext.getClinicalContacts().size();i++) { if(voCareContext.getClinicalContacts().get(i).getContactTypeIsNotNull() && voCareContext.getClinicalContacts().get(i).getContactType().equals(ContactType.SPINALMEDICALADMISSION)) { return true; } } } } else bRemoveSpinalMedAdmissionContactType = true; } if(form.cmbCtxContextType().getValue() == null) bRemoveSpinalMedAdmissionContactType = true; else if(!form.cmbCtxContextType().getValue().equals(ContextType.INPATIENT)) bRemoveSpinalMedAdmissionContactType = true; else bRemoveSpinalMedAdmissionContactType = false; return bRemoveSpinalMedAdmissionContactType; }