private void open() { clearScreen(); if(form.getGlobalContext().Core.getCurrentCareContextIsNotNull()) { RACPPastMedicalHistoryVo voRACPPastMedicalHistory = domain.getRACPPastMedicalHistoryForrefCareContext(form.getGlobalContext().Core.getCurrentCareContext()); form.getLocalContext().setRACPPastMedicalHistoryVo(voRACPPastMedicalHistory); if(voRACPPastMedicalHistory!=null) { populateScreen(voRACPPastMedicalHistory); removeUnselectedAuscultations(null); } } form.setMode(FormMode.VIEW);// WDEV-13437 }
private void populateScreen(RACPPastMedicalHistoryVo voRACPPastMedicalHistory) { form.chkNone().setValue(voRACPPastMedicalHistory.getPMHFlag()); form.txtOtherNotes().setValue(voRACPPastMedicalHistory.getPMHNotes()); if (voRACPPastMedicalHistory.getVSBPIsNotNull()) { // Siting if (voRACPPastMedicalHistory.getVSBP().getBPSittingSysIsNotNull()) { form.intBPDia().setValue(new Integer(voRACPPastMedicalHistory.getVSBP().getBPSittingDias().intValue())); form.intBPSys().setValue(new Integer(voRACPPastMedicalHistory.getVSBP().getBPSittingSys().intValue())); } } if (voRACPPastMedicalHistory.getVSPulseIsNotNull()) { if (voRACPPastMedicalHistory.getVSPulse().getPulseRateRadial() != null) form.intHeartRate().setValue(voRACPPastMedicalHistory.getVSPulse().getPulseRateRadial()); } if (voRACPPastMedicalHistory.getHeightWeightIsNotNull()) { form.decHeight().setValue(voRACPPastMedicalHistory.getHeightWeight().getHeightValue()); form.decWeight().setValue(voRACPPastMedicalHistory.getHeightWeight().getWeightValue()); } form.txtExaminationNotes().setValue(voRACPPastMedicalHistory.getExamNotes()); form.txtRestingECGNotes().setValue(voRACPPastMedicalHistory.getECGNotes()); loadRelevantDiagnosisGrid(true); if(voRACPPastMedicalHistory.getExamFindingsIsNotNull()) populateAuscultationsGrid(voRACPPastMedicalHistory.getExamFindings()); loadRestingECGGrid(true); }
private boolean populateVitalSignsVo(VitalSignsVo voVitalSign, RACPPastMedicalHistoryVo voRACPPastMedicalHistory) { boolean bUpdateVitalSigns = false; if(voVitalSign.getAuthoringInformation()==null) voVitalSign.setAuthoringInformation(getAuthoringInfo()); if(voVitalSign.getVitalsTakenDateTime()==null) voVitalSign.setVitalsTakenDateTime(new DateTime()); if(voVitalSign.getCareContext()==null) voVitalSign.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); if(voVitalSign.getBloodPressure()==null || (voVitalSign.getBloodPressureIsNotNull() && voVitalSign.getBloodPressure().getBPSittingDias()==null) ){ voVitalSign.setBloodPressure(voRACPPastMedicalHistory.getVSBP()); bUpdateVitalSigns = true; } if(voVitalSign.getMetrics()==null || (voVitalSign.getMetricsIsNotNull() && voVitalSign.getMetrics().getHeightValue()==null) ){ voVitalSign.setMetrics(voRACPPastMedicalHistory.getHeightWeight()); bUpdateVitalSigns = true; } if(voVitalSign.getPulse()==null || (voVitalSign.getPulseIsNotNull() && voVitalSign.getPulse().getPulseRateRadial()==null) ){ voVitalSign.setPulse(voRACPPastMedicalHistory.getVSPulse()); bUpdateVitalSigns = true; } return bUpdateVitalSigns; }
private void populateECGFromGrid(RACPPastMedicalHistoryVo pastMedicalHistoryVo) { ECGFindingsCollection collECGFindings = new ECGFindingsCollection(); for (int i = 0; i < form.grdRestingECG().getRows().size(); i++) { grdRestingECGRow row = form.grdRestingECG().getRows().get(i); if(row.getcolSelect()) collECGFindings.add(row.getValue()); } if(collECGFindings.size()>0) pastMedicalHistoryVo.setECGFindings(collECGFindings); else pastMedicalHistoryVo.setECGFindings(null); }
private void populatePMHFromGrid(RACPPastMedicalHistoryVo pastMedicalHistoryVo) { RACPRelevantDiagnosisListCollection collRACPRelevantDiagnosisList = new RACPRelevantDiagnosisListCollection(); for (int i = 0; i < form.grdPMH().getRows().size(); i++) { grdPMHRow row = form.grdPMH().getRows().get(i); if(row.getcolSelect()) collRACPRelevantDiagnosisList.add(row.getValue()); } if(collRACPRelevantDiagnosisList.size()>0) pastMedicalHistoryVo.setRelevantDiagnosis(collRACPRelevantDiagnosisList); else pastMedicalHistoryVo.setRelevantDiagnosis(null); }
private boolean save() { if(isRACPCComplete())// WDEV-13662 return false; RACPPastMedicalHistoryVo voRACPPastMedicalHistory = populateDataFromScreen(form.getLocalContext().getRACPPastMedicalHistoryVo()); ArrayList<String> screenErrors = new ArrayList<String>(); if ((form.intBPDia().getValue() != null && form.intBPSys().getValue() == null) || (form.intBPDia().getValue() == null && form.intBPSys().getValue() != null)) screenErrors.add("Please enter both Blood Pressure values."); if (form.decHeight().getValue() != null && form.decWeight().getValue() == null) screenErrors.add("If Height is being entered Weight is also being required for BMI."); if(form.decHeight().getValue() == null && form.decWeight().getValue() != null) screenErrors.add("If Weight is being entered Height is also being required for BMI."); VitalSignsVo voVitalSign = domain.getVitalSignsForCareContext(form.getGlobalContext().Core.getCurrentCareContext()); if(voVitalSign==null) voVitalSign = new VitalSignsVo(); boolean bUpdateVitalSigns = populateVitalSignsVo(voVitalSign, voRACPPastMedicalHistory); String[] arrScreenAndVoErrors = null; String[] arrErrors = voRACPPastMedicalHistory.validate(); String[] arrVitalSignErrors = voVitalSign.validate(); if(arrErrors!=null) arrScreenAndVoErrors = addScreenErrorsToVOErrors(screenErrors, arrErrors); else arrScreenAndVoErrors = addScreenErrorsToVOErrors(screenErrors, arrVitalSignErrors); if (arrScreenAndVoErrors.length == 0) { try { voRACPPastMedicalHistory = domain.saveRACPPastMedicalHistoryVo(voRACPPastMedicalHistory, voVitalSign, bUpdateVitalSigns); } catch (StaleObjectException e) { engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); open(); return false; } }else { engine.showErrors(arrScreenAndVoErrors); return false; } form.getLocalContext().setRACPPastMedicalHistoryVo(voRACPPastMedicalHistory); return true; }