public PatientSECSVo savePatientSECS(PatientSECSVo patientSecs) throws StaleObjectException { if(!patientSecs.isValidated()) throw new DomainRuntimeException("This MUST has not been validated"); DomainFactory factory = getDomainFactory(); PatientSECS doPatientSECS = PatientSECSVoAssembler.extractPatientSECS(factory, patientSecs); factory.save(doPatientSECS); //WDEV-22205 code temporarily removed /**if (patientSecs.getOBSProtocolTypeIsNotNull()) { InpatientEpisode curentInpatEpDO = getCurrentInpatientEpisode(factory, doPatientSECS.getCareContext()); if (curentInpatEpDO != null) { curentInpatEpDO.setLatestSECSScore(doPatientSECS); factory.save(curentInpatEpDO); } }*/ return PatientSECSVoAssembler.create(doPatientSECS); }
public PatientSECSVo savePatientSECS(PatientSECSVo patientSecs) throws StaleObjectException { if(!patientSecs.isValidated()) throw new DomainRuntimeException("This MUST has not been validated"); DomainFactory factory = getDomainFactory(); PatientSECS doPatientSECS = PatientSECSVoAssembler.extractPatientSECS(factory, patientSecs); factory.save(doPatientSECS); return PatientSECSVoAssembler.create(doPatientSECS); }
protected void onBtnSaveClick() throws PresentationLogicException { PatientSECSVo patientSecs = new PatientSECSVo(); patientSecs.setAuthoringInformation(form.customControlAuthoringInfo().getValue()); if(patientSecs.getRecordingInformation()==null){ RecordingUserInformationVo voRecordingUserInformation = new RecordingUserInformationVo(); voRecordingUserInformation.setRecordingUser(form.cmbRecordingHCP().getValue()); voRecordingUserInformation.setRecordingDateTime(new DateTime()); patientSecs.setRecordingInformation(voRecordingUserInformation); } patientSecs.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); patientSecs.setVitalSign(form.getGlobalContext().Core.getVitalSign()); if(form.GroupEscalated().getValue().equals(GenForm.GroupEscalatedEnumeration.rdoEscYes)) patientSecs.setEscalated(Boolean.TRUE); else if(form.GroupEscalated().getValue().equals(GenForm.GroupEscalatedEnumeration.rdoEscNo)) patientSecs.setEscalated(Boolean.FALSE); if(form.txtScore().getValue()!=null) patientSecs.setSECSScore(Integer.valueOf(form.txtScore().getValue())); patientSecs.setScoreDetails(form.lblOriginOfScore().getValue()); patientSecs.setActionTaken(form.txtActionTaken().getValue()); String[] arrErrors = patientSecs.validate(); if(arrErrors == null) { try { domain.savePatientSECS(patientSecs); } catch (StaleObjectException e) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); return; } } else { engine.showErrors("Validation Errors", arrErrors); return; } engine.close(DialogResult.OK); }
protected void onBtnSaveClick() throws PresentationLogicException { PatientSECSVo patientSecs = new PatientSECSVo(); patientSecs.setAuthoringInformation(form.customControlAuthoringInfo().getValue()); if(patientSecs.getRecordingInformation()==null){ RecordingUserInformationVo voRecordingUserInformation = new RecordingUserInformationVo(); voRecordingUserInformation.setRecordingUser(form.cmbRecordingHCP().getValue()); voRecordingUserInformation.setRecordingDateTime(new DateTime()); patientSecs.setRecordingInformation(voRecordingUserInformation); } patientSecs.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); patientSecs.setVitalSign(form.getGlobalContext().Core.getVitalSign()); if(form.GroupEscalated().getValue().equals(GenForm.GroupEscalatedEnumeration.rdoEscYes)) patientSecs.setEscalated(Boolean.TRUE); else if(form.GroupEscalated().getValue().equals(GenForm.GroupEscalatedEnumeration.rdoEscNo)) patientSecs.setEscalated(Boolean.FALSE); if(form.txtScore().getValue()!=null) patientSecs.setSECSScore(Integer.valueOf(form.txtScore().getValue())); patientSecs.setScoreDetails(form.getGlobalContext().Core.getVitalSignsEscalationText()); patientSecs.setActionTaken(form.txtActionTaken().getValue()); //WDEV-20311 patientSecs.setOBSProtocolType(form.getLocalContext().getSECSVo()!=null ? form.getLocalContext().getSECSVo().getOBSProtocolType() : null); String[] arrErrors = patientSecs.validate(); if(arrErrors == null) { try { domain.savePatientSECS(patientSecs); } catch (StaleObjectException e) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); return; } } else { engine.showErrors("Validation Errors", arrErrors); return; } engine.close(DialogResult.OK); }