public AdmissionDetailsVo getNursingAdmission(CareContextLiteVo voCareContextLite) { if(voCareContextLite == null) throw new CodingRuntimeException("Contact not Provided"); DomainFactory factory = getDomainFactory(); //the following query retrievs the one and only contact of type spinalmedicaladmission if it has been instantiated List admisDetails = factory.find(" from AdmissionDetails ad where ad.careContext.id = :idCareContext )", new String[]{"idCareContext" }, new Object[]{ voCareContextLite.getID_CareContext()}); AdmissionDetailsVoCollection voAdmisDetails = AdmissionDetailsVoAssembler.createAdmissionDetailsVoCollectionFromAdmissionDetails(admisDetails); if(voAdmisDetails.size()>0) return voAdmisDetails.get(0); else return null; }
public AdmissionDetailsVo saveNursingAdmission(AdmissionDetailsVo voAdmissionDetails) throws StaleObjectException { if (!voAdmissionDetails.isValidated()) { throw new DomainRuntimeException("AdmissionDetails has not been validated"); } DomainFactory factory = getDomainFactory(); AdmissionDetails domAdmisDetails = AdmissionDetailsVoAssembler.extractAdmissionDetails(factory, voAdmissionDetails); factory.save(domAdmisDetails); AdmissionDetailsVo voAdmisDetails = AdmissionDetailsVoAssembler.create(domAdmisDetails); return voAdmisDetails; }
private void populateScreenFromData() { if(form.getLocalContext().getvoAdmissionDetailsIsNotNull()) { //populate questios grid - WDEV-7145 initializeDynamicGrdMotor(); // Populate Family support grid populateFamilySupportGrid(); // Populate Diagnosis/procedure grid populateDiagProcedureGrid(); } AdmissionDetailsVo voAdmissionDetails = form.getLocalContext().getvoAdmissionDetails(); if (voAdmissionDetails == null) return; form.customControlAuthoringInfo().setValue(voAdmissionDetails.getAuthoringInformation()); // Populate reason for admission data if (voAdmissionDetails.getPatientAdmReasonIsNotNull()) form.txtPatient().setValue(voAdmissionDetails.getPatientAdmReason()); if (voAdmissionDetails.getNursingAdmReasonIsNotNull()) form.txtNursing().setValue(voAdmissionDetails.getNursingAdmReason()); if (voAdmissionDetails.getResusStatusIsNotNull()) form.cmbResusStatus2().setValue(voAdmissionDetails.getResusStatus()); if (voAdmissionDetails.getIsDnrFormCompletedIsNotNull()) { if (voAdmissionDetails.getIsDnrFormCompleted().equals(Boolean.TRUE)) form.ansDNRComplete().setValue(YesNo.YES); else form.ansDNRComplete().setValue(YesNo.NO); } //communication form.txtCommunication().setValue(voAdmissionDetails.getCommunicationNeeds()); //preferred language form.cmbPreferredLang().setValue(voAdmissionDetails.getPreferredLang()); // Populate questions grid populateQuestionsGrid(voAdmissionDetails.getAdmQuestionsAns()); // Populate diag discussed answer box. if (voAdmissionDetails.getWasDiagnosisDiscussedIsNotNull()) { if (voAdmissionDetails.getWasDiagnosisDiscussed().equals(Boolean.TRUE)) form.ansDiagDiscussed().setValue(YesNo.YES); else form.ansDiagDiscussed().setValue(YesNo.NO); } }