public SOAPVo getSOAPsVo(ClinicalNotesRefVo clinnoteRefVo) { if(clinnoteRefVo != null) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" from SoapNote soapnote where "); String andStr = " "; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Serializable> values = new ArrayList<Serializable>(); hql.append(andStr + " soapnote.clinicalNote.id = :clinicNoteId"); markers.add("clinicNoteId"); values.add(clinnoteRefVo.getID_ClinicalNotes()); andStr = " and "; List listSoap = factory.find(hql.toString(), markers,values); if(listSoap != null && listSoap.size() > 0) { SOAPVoCollection voColl = SOAPVoAssembler.createSOAPVoCollectionFromSoapNote(listSoap); if(voColl != null && voColl.size() > 0) return voColl.get(0); } } return null; }
public void saveSOAPsVo(SOAPVo voSOAP) throws DomainInterfaceException, StaleObjectException, UniqueKeyViolationException { // Ensure the value object has been validated if (!voSOAP.isValidated()) throw new DomainRuntimeException("SOAP has not been validated"); DomainFactory factory = getDomainFactory(); SoapNote doSOAP = SOAPVoAssembler.extractSoapNote(factory, voSOAP); CareContext doCareContext = getCurrentCareContext(voSOAP.getCareContext()); //WDEV-19027 doSOAP.setCareContext(doCareContext);//WDEV-19027 factory.save(doSOAP); }
private void populateScreenControls(ClinicalNotesVo voNote) { initialiseScreenControls(); if (voNote.getIsDerivedNoteIsNotNull() && voNote.getIsDerivedNote().equals(Boolean.TRUE) ) { //Its a SOAP Clinical Note form.getLocalContext().setclinicalNotesVo(voNote); AuthoringInformationVo voAuthor = new AuthoringInformationVo(); if (voNote.getAuthoringInfoIsNotNull()) { voAuthor.setAuthoringDateTime(voNote.getAuthoringInfo().getAuthoringDateTime()); voAuthor.setAuthoringHcp(voNote.getAuthoringInfo().getAuthoringHcp()); } form.customControlAuthoring().setValue(voAuthor); ClinicalNotesRefVo voClinNotesRef = new ClinicalNotesRefVo(); voClinNotesRef.setID_ClinicalNotes(voNote.getID_ClinicalNotes()); SOAPVo voSOAP = domain.getSOAPsVo(voClinNotesRef); if (voSOAP != null) { form.getLocalContext().setSOAPVo(voSOAP); form.txtSubjective().setValue(voSOAP.getSubjectiveNoteIsNotNull() ? voSOAP.getSubjectiveNote() : ""); form.txtObjective().setValue(voSOAP.getObjectiveNoteIsNotNull() ? voSOAP.getObjectiveNote() : ""); form.txtAnalysis().setValue(voSOAP.getAnalysisNoteIsNotNull() ? voSOAP.getAnalysisNote() : ""); form.txtPlan().setValue(voSOAP.getPlanNoteIsNotNull() ? voSOAP.getPlanNote() : ""); } fillIPStatusCombo(voNote); if (form.cmbStatus().getValues().size() == 0) form.cmbStatus().newRow(voNote.getCurrentStatus().getStatus(), voNote.getCurrentStatus().getStatus().getText()); form.cmbStatus().setValue(voNote.getCurrentStatusIsNotNull() ? voNote.getCurrentStatus().getStatus() : null); if (voNote.getForReviewIsNotNull() && voNote.getForReview().booleanValue()) { form.chkForReview().setValue(voNote.getForReview().booleanValue()); form.cmbDiscipline().setValue(voNote.getForReviewDiscipline()); form.chkForReview().setVisible(true); form.cmbDiscipline().setVisible(true); form.lblDiscipline().setVisible(true); form.setcustomControlReviewedVisible(false); form.chkMarkAsReviewed().setVisible(false); if (voNote.getReviewingHCPIsNotNull() || voNote.getReviewingDateTimeIsNotNull()) { AuthoringInformationVo voReview = new AuthoringInformationVo(); voReview.setAuthoringDateTime(voNote.getReviewingDateTime()); voReview.setAuthoringHcp(voNote.getReviewingHCP()); form.customControlReviewed().setValue(voReview); form.chkForReview().setVisible(false); form.cmbDiscipline().setVisible(false); form.lblDiscipline().setVisible(false); form.setcustomControlReviewedVisible(true); form.customControlReviewed().setLabels(AuthoringLabelType.REVIEWING); form.chkMarkAsReviewed().setVisible(true); form.chkMarkAsReviewed().setValue(true); } } } }