public void initialize(PatientShort patient, EpisodeofCareShortVo episodeOfCare, CareContextShortVo careContext, AdmissionDetailVo admissionDetail) { form.getLocalContext().setPatient(patient); if (careContext != null) form.getLocalContext().setCareContext(domain.getCareContext(careContext)); form.getLocalContext().setCurrentAdmissionDetail(admissionDetail); form.ccAdmittingConsultant().initialize(null, MedicGrade.CONS); form.ccAdmittingConsultant().isRequired(true); removeItemsFromReferredAdmittedComboBoxes(); populateWardsCombo(); open(); updateControlsState(); }
private void populateAdmittedFromDetailsFromData(AdmissionDetailVo admissionDetail) { if (admissionDetail.getExtendedDetails() == null) return; form.cmbAdmittedFrom().setValue(admissionDetail.getExtendedDetails().getAdmittedFromType()); if (admissionDetail.getExtendedDetails().getAdmittedFromIsNotNull()) { ExternalResourceVo admFromDet = admissionDetail.getExtendedDetails().getAdmittedFrom(); form.txtAdmittedFromName().setValue(admFromDet.getResourcename()); if (admFromDet.getResourceAddressIsNotNull()) { form.txtAdrAdmittedFromLine1().setValue(admFromDet.getResourceAddress().getLine1()); form.txtAdrAdmittedFromLine2().setValue(admFromDet.getResourceAddress().getLine2()); form.txtAdrAdmittedFromLine3().setValue(admFromDet.getResourceAddress().getLine3()); form.cmbAdmittedCounty().setValue(admFromDet.getResourceAddress().getCounty()); form.txtTelephoneNr().setValue(admFromDet.getResourceAddress().getPhone()); } form.getLocalContext().setSelectedExternalResourceForAdmittedFrom(admFromDet); } }
private void populateReferrerDetailsFromData(AdmissionDetailVo admissionDetail) { if (admissionDetail.getExtendedDetails() == null) return; form.cmbReferredFrom().setValue(admissionDetail.getExtendedDetails().getReferredFromType()); if (admissionDetail.getExtendedDetails().getReferrerDetailsIsNotNull()) { ExternalResourceVo referrerDet = admissionDetail.getExtendedDetails().getReferrerDetails(); form.txtReferrerNameOrganisation().setValue(referrerDet.getResourcename()); if (referrerDet.getResourceAddressIsNotNull()) { form.txtReferrerAdr1().setValue(referrerDet.getResourceAddress().getLine1()); form.txtReferrerAdr2().setValue(referrerDet.getResourceAddress().getLine2()); form.txtReferrerAdr3().setValue(referrerDet.getResourceAddress().getLine3()); form.cmbReferrerCounty().setValue(referrerDet.getResourceAddress().getCounty()); form.txtReferrerContactNr().setValue(referrerDet.getResourceAddress().getPhone()); } form.getLocalContext().setSelectedExternalResourceForReferredFrom(referrerDet); } }
private void populateScreenFromData( DischargedEpisodeVo adtDiscEp, ims.core.vo.AdmissionDetailVo admission) { if( adtDiscEp != null ) { form.dtimDischargeDateTime().setValue(adtDiscEp.getDischargeDateTime()); form.cmbDischargeReason().setValue(adtDiscEp.getExtendedDetailsIsNotNull() ? adtDiscEp.getExtendedDetails().getDischargeReason():null); form.txtCauseOfDeath().setValue(adtDiscEp.getExtendedDetailsIsNotNull() ? adtDiscEp.getExtendedDetails().getCauseOfDeath():""); } if( admission != null && admission.getTransferHistoryIsNotNull() && admission.getTransferHistory().size() > 0) { for( int i = 0; i < admission.getTransferHistory().size(); i++ ) { TransferHistoryVo tempVo = admission.getTransferHistory().get(i); grdWardTransferHistoryRow rowW = form.grdWardTransferHistory().getRows().newRow(); rowW.setColumnWard(tempVo.getTransferringFromWardIsNotNull() ? tempVo.getTransferringFromWard().getName():""); rowW.setColumnDateOfTransfer(tempVo.getAcceptTransferDateTimeIsNotNull() ? tempVo.getAcceptTransferDateTime().toString():""); rowW.setValue(tempVo); } } }
@Override protected void onGrdHomeLeaveSelectionChanged() throws PresentationLogicException { form.getLocalContext().setAdmissionDetail(null); clearScreen(); if(form.lyrAdmission().tabHomeLeave().grdHomeLeave().getValue() == null) return; form.dteHLDateReturn().setEnabled(true); form.timHLTimeOfReturn().setEnabled(true); form.dteHLDateReturn().setValue(new Date()); form.getLocalContext().setRecordSelected(true); InpatientEpisodeLiteVo voInWaiting = form.lyrAdmission().tabHomeLeave().grdHomeLeave().getValue(); AdmissionDetailVo voAdmission = domain.getAdmissionDetailByPasEvent(voInWaiting.getPasEvent()); if(voAdmission == null) return; form.getLocalContext().setAdmissionDetail(voAdmission); form.fireCustomControlValueChanged(); }
public AdmissionDetailVo getLastAdmissionForPatient(PatientRefVo parRef) { if( parRef == null ) throw new CodingRuntimeException("PatientRefVo is null"); DomainFactory factory = getDomainFactory(); String hql = " select a1_1 from AdmissionDetail as a1_1 left join a1_1.pasEvent as p1_1 left join p1_1.patient as p2_1 where (p2_1.id = :patientId) order by a1_1.admissionDateTime desc"; List<?> lst = factory.find(hql,new String[]{"patientId"},new Object[]{parRef.getID_Patient()}); if (lst != null && lst.size() > 0) { AdmissionDetailVoCollection tempColl = AdmissionDetailVoAssembler.createAdmissionDetailVoCollectionFromAdmissionDetail(lst) ; if(tempColl != null && tempColl.size() > 0) { return tempColl.get(0); } } return null; }
public AdmissionDetailVo getAdmissionForSelectedCareContext(CareContextInterfaceVo careContext) { if( careContext == null || careContext.getPasEvent() == null ) throw new CodingRuntimeException("CareContextInterfaceVo is null"); DomainFactory factory = getDomainFactory(); String hql = " select a1_1 from AdmissionDetail as a1_1 left join a1_1.pasEvent as p1_1 where (p1_1.id = :pasEventId) order by a1_1.admissionDateTime desc"; List<?> lst = factory.find(hql,new String[]{"pasEventId"},new Object[]{careContext.getPasEvent().getID_PASEvent()}); if (lst != null && lst.size() > 0) { AdmissionDetailVoCollection tempColl = AdmissionDetailVoAssembler.createAdmissionDetailVoCollectionFromAdmissionDetail(lst) ; if(tempColl != null && tempColl.size() > 0) { return tempColl.get(0); } } return null; }
public AdmissionDetailVo getAdmissionDetailByCareContext(CareContextRefVo voCC) { if (voCC == null || voCC.getID_CareContext() == null) throw new CodingRuntimeException("careContext is null or id not provided in method getAdmissionDetailByCareContext"); List items = getDomainFactory().find(" select cc.pasEvent.id from CareContext as cc where cc.id = " + voCC.getID_CareContext()); if(items != null && items.size() > 0) { Integer eventId = (Integer) items.get(0); if(eventId!= null && eventId > 0) { List ieItems = getDomainFactory().find(" from AdmissionDetail ad where ad.pasEvent.id = " + eventId); if(ieItems != null && ieItems.size() > 0) return AdmissionDetailVoAssembler.create((AdmissionDetail) ieItems.get(0)); } } return null; }
private void updateAdmissionRecordWithHealthyLodgerDetails(AdmissionDetailVo admissionDetails, HealthyLodgerVo healthyLodgerDetails) { if (admissionDetails == null) return; admissionDetails.setHealthyLodgerDetails(healthyLodgerDetails); String[] errors = admissionDetails.validate(); if (errors != null) { engine.showErrors(errors); return; } try { form.getLocalContext().setAdmissionDetails(domain.updateAdmissionDetailWithHealthyLodgerInfo(admissionDetails, healthyLodgerDetails)); } catch (StaleObjectException e) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); engine.close(DialogResult.OK); return; } }
private AdmissionDetailVo updateAdmissionRecordWithHealthyLodgerDetails(AdmissionDetailVo admissionDetails, HealthyLodgerVo healthyLodgerDetails) { if (admissionDetails == null) return null; AdmissionDetailVo admission = null; admissionDetails.setHealthyLodgerDetails(healthyLodgerDetails); String[] errors = admissionDetails.validate(); if (errors != null) { engine.showErrors(errors); return null; } try { admission = domain.updateAdmissionDetailWithHealthyLodgerInfo(admissionDetails, healthyLodgerDetails); } catch (StaleObjectException e) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); return null; } return admission; }
private WardMixedSexBreachVo populateWardMixedSexBreach(AdmissionDetailVo admission, BedSpaceStateLiteVo bedSpaceStateLiteVo, AdmissionReasonVo admissionReasonVo, Integer maleCount, Integer femaleCount) { WardMixedSexBreachVo vo = new WardMixedSexBreachVo(); vo.setWard(bedSpaceStateLiteVo.getWard()); vo.setBay(bedSpaceStateLiteVo.getBay()); vo.setFemalePatients(femaleCount); vo.setMalePatients(maleCount); vo.setAdmissionDateTime(admission.getAdmissionDateTime()); Object mosUser = domain.getMosUser(); if (mosUser != null) vo.setMemberOfStaff((MemberOfStaffLiteVo) mosUser); vo.setReasonForGenderBreach(admissionReasonVo.getReasonForMixingBayGender()); vo.setReasonForGenderBreachComment(admissionReasonVo.getReasonForMixingBayGenderComment()); return vo; }
private BayTimesAdmissionBreachedVo populateBayTimesBreachedRecord(AdmissionDetailVo admissionDetail, BedSpaceStateLiteVo voBedSpaceStateLite, AdmissionReasonVo admissionReasonVo) { BayTimesAdmissionBreachedVo voBreach = new BayTimesAdmissionBreachedVo(); voBreach.setAdmissionDateTime(admissionDetail.getAdmissionDateTime()); voBreach.setWard(admissionDetail.getWard()); if (voBedSpaceStateLite != null) voBreach.setBay(voBedSpaceStateLite.getBay()); //WDEV-22353 Object mosUser = getMosUser(); if (mosUser != null) voBreach.setMemberOfStaff((MemberOfStaffLiteVo) mosUser); voBreach.setReasonForAdmissionOutOfOpeningHours(admissionReasonVo.getReasonForAdmissionOutOfOpeningHours()); voBreach.setReasonForAdmissionOutOfOpeningHoursComment(admissionReasonVo.getReasonForAdmissionOohComment()); return voBreach; }
public AdmissionDetailVo getAdmissionDetail(Integer pasEventId) { if(pasEventId == null) return null; if(pasEventId != null) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" select a1_1 from AdmissionDetail as a1_1 left join a1_1.pasEvent as p1_1 where "); String andStr = " "; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Serializable> values = new ArrayList<Serializable>(); hql.append(andStr + " p1_1.id = :pasEventId"); markers.add("pasEventId"); values.add(pasEventId); andStr = " and "; List list = factory.find(hql.toString(), markers,values); if(list != null && list.size() > 0) { AdmissionDetailVoCollection voColl = AdmissionDetailVoAssembler.createAdmissionDetailVoCollectionFromAdmissionDetail(list); if(voColl != null && voColl.size() > 0) return voColl.get(0); } } return null; }
private void populateScreenFromData(AdmissionDetailVo admissionDetail) { clearInstanceControls(); if (admissionDetail == null) return; form.dtimAdmissionDateTime().setValue(admissionDetail.getAdmissionDateTime()); if (form.getLocalContext().getCurrentAdmissionDetailIsNotNull() && form.getLocalContext().getCurrentAdmissionDetail().getPasEventIsNotNull()) { form.cmbAdmissionWard().setValue(domain.getAdmissionWard(form.getLocalContext().getCurrentAdmissionDetail().getPasEvent())); if (!domain.isPatientDischarged(form.getLocalContext().getCurrentAdmissionDetail())) form.cmbAdmissionType().setValue(domain.getAdmissionTypeFromInpatientEpisode(form.getLocalContext().getCurrentAdmissionDetail().getPasEvent())); else form.cmbAdmissionType().setValue(domain.getAdmissionTypeFromDischargedEpisode(form.getLocalContext().getCurrentAdmissionDetail().getPasEvent())); } form.ccAdmittingConsultant().setValue(admissionDetail.getConsultant()); form.cmbSpecialty().setValue(admissionDetail.getSpecialty()); form.intBedNumber().setValue(admissionDetail.getExtendedDetails() != null ? admissionDetail.getExtendedDetails().getBedNumber() : null); populateReferrerDetailsFromData(admissionDetail); if (admissionDetail.getExtendedDetails()!=null && ExternalResourceType.ERT_HOMEADDRESS.equals(admissionDetail.getExtendedDetails().getAdmittedFromType())) { form.cmbAdmittedFrom().setValue(admissionDetail.getExtendedDetails().getAdmittedFromType()); populateAdmittedDetailsWithPatientAddress(form.getGlobalContext().Core.getPatientShort().getAddress()); } else { populateAdmittedFromDetailsFromData(admissionDetail); } }
public void initialize(ims.core.vo.PatientShort patient, ims.core.vo.EpisodeofCareShortVo episodeofcare, ims.core.vo.CareContextShortVo careContext, ims.core.vo.AdmissionDetailVo admission, Boolean isOpenedFromInpatientListForm) { form.getLocalContext().setConfimUndoDischargeMsgBoxId(null); form.getLocalContext().setIsOpenedFromInpatientListForm(isOpenedFromInpatientListForm); form.getLocalContext().setAdmissionDetail(admission); form.getLocalContext().setCareContextShortVo(careContext); if( careContext != null) { form.getLocalContext().setCareContext(domain.getCareContextById(careContext)); } form.getLocalContext().setPatientShort(patient); if( form.getLocalContext().getCareContextIsNotNull() && form.getLocalContext().getCareContext().getPasEventIsNotNull() ) { AdmissionDetailVo lastAdmission = domain.getLastAdmissionForPatient(patient); AdmissionDetailVo careContextAdmission = domain.getAdmissionForSelectedCareContext(form.getLocalContext().getCareContext()); if( lastAdmission != null && careContextAdmission != null && lastAdmission.getID_AdmissionDetail().equals(careContextAdmission.getID_AdmissionDetail())) form.getLocalContext().setShowUndoDischargeButton(true); else form.getLocalContext().setShowUndoDischargeButton(false); } else form.getLocalContext().setShowUndoDischargeButton(false); open(); updateControlsState(); }
private DateTime getTheLastWardTransferDateTime(ims.core.vo.AdmissionDetailVo admission) { if( admission != null && admission.getTransferHistoryIsNotNull() && admission.getTransferHistory().size() > 0) { admission.getTransferHistory().sort(new DateTimeWardComparator(SortOrder.DESCENDING)); return admission.getTransferHistory().get(0).getAcceptTransferDateTime(); } return null; }
private void open() { PatientShort patient = domain.getPatient(form.getGlobalContext().Core.getPatientShort()); form.getGlobalContext().Core.setPatientShort(patient); AdmissionDetailVo currentAdmissionDet =null; CareContextVo tempCareContext = (form.getGlobalContext().Core.getCurrentCareContextIsNotNull() ? domain.getCareContextByCareContextRef(form.getGlobalContext().Core.getCurrentCareContext()) :null ); if (tempCareContext!=null && tempCareContext.getPasEventIsNotNull() && tempCareContext.getCurrentStatusIsNotNull() && CareContextStatus.OPEN.equals(tempCareContext.getCurrentStatus().getStatus()) ) { currentAdmissionDet=domain.getAdmissionDetailByPasEvent(form.getGlobalContext().Core.getCurrentCareContext().getPasEvent()); } else if (patient.getWardIsNotNull()) { currentAdmissionDet = domain.getAdmissionDetail(patient); if (currentAdmissionDet!=null && currentAdmissionDet.getPasEventIsNotNull()) { form.getGlobalContext().Core.setCurrentCareContext(domain.getCareContext(currentAdmissionDet.getPasEvent())); } } EpisodeofCareShortVo episodeOfCare = form.getGlobalContext().Core.getEpisodeofCareShort(); CareContextShortVo careContext = form.getGlobalContext().Core.getCurrentCareContext(); form.lyrADT().tabAdmissionDetails().ccAdmissionDetails().initialize(patient, episodeOfCare, careContext, currentAdmissionDet); form.lyrADT().tabDischargeDetails().ccDischargeDetails().initialize(patient, episodeOfCare, careContext, currentAdmissionDet,form.getLocalContext().getIsOpenedFromInpatientListForm()); //wdev-16427 if( form.getLocalContext().getIsOpenedFromInpatientListFormIsNotNull() && Boolean.TRUE.equals(form.getLocalContext().getIsOpenedFromInpatientListForm())) //wdev-16427 { form.lyrADT().tabDischargeDetails().ccDischargeDetails().setMode(FormMode.EDIT); form.lyrADT().showtabDischargeDetails(); form.setMode(FormMode.EDIT); } else form.setMode(FormMode.VIEW); }
private CatsReferralEmergencyAdmissionVo createNewCatsReferralForAdmission(PatientShort patientShort, PatientWithGPForCCGVo patient, CareSpellVo careSpell, AdmissionDetailVo admission, ContractConfigShortVo contract) { CatsReferralEmergencyAdmissionVo referral = new CatsReferralEmergencyAdmissionVo(); referral.setPatient(patientShort); referral.setCareContext(careSpell.getEpisodes().get(0).getCareContexts().get(0)); CatsReferralStatusVo referralStatus = new CatsReferralStatusVo(); referralStatus.setReferralStatus(ReferralApptStatus.REFERRAL_ACCEPTED); referralStatus.setStatusDateTime(new DateTime()); referralStatus.setAuthoringUser((MemberOfStaffRefVo) domain.getMosUser()); referral.setCurrentStatus(referralStatus); referral.setStatusHistory(new CATSReferralStatusRefVoCollection()); referral.getStatusHistory().add(referralStatus); String codeCCG = getCCGCode(patient); referral.setContract(contract); referral.setHasAppointments(false); referral.setAdmissions(new AdmissionDetailVoCollection()); referral.getAdmissions().add(admission); ReferralDetailsEmergencyAdmissionVo referralDetails = new ReferralDetailsEmergencyAdmissionVo(); referralDetails.setService(form.cmbService().getValue()); referralDetails.setConsultant(domain.getHcpFromIMos(form.ccConsultant().getValue())); referralDetails.setAuthoringUser((MemberOfStaffRefVo) domain.getMosUser()); referralDetails.setAuthoringDateTime(new DateTime()); referralDetails.setDateReferralReceived(new Date()); referralDetails.setDateOfReferral(new Date()); referralDetails.setEnd18WW(calculateEnd18WW(contract)); referralDetails.setPCT(codeCCG); referralDetails.setGPName(patient.getGp()); referralDetails.setPractice(getPatientGpDefaultPractice(patient)); referral.setReferralDetails(referralDetails); return referral; }
public AdmissionDetailVo getAdmissionDetailByPasEvent(PASEventRefVo pasEvent) { if (pasEvent == null || pasEvent.getID_PASEvent() == null) throw new CodingRuntimeException("pasEvent is null or id not provided in method getAdmissionDetailByPasEvent"); BedAdmissionComponent impl = (BedAdmissionComponent) getDomainImpl(BedAdmissionComponentImpl.class); return impl.getAdmissionDetailByPasEvent(pasEvent); }