private void populateScreenFromData(PatientNoAllergyInfoVo voPatientNoAllergyInfo) { clearScreen(); if (form.getMode().equals(FormMode.EDIT)) this.form.ctnDetails().chkNoKnownAllergies().setVisible(true); this.form.ctnDetails().chkNoKnownAllergies().setValue(true); this.form.ctnDetails().cmbSource().setValue(voPatientNoAllergyInfo.getSourceofInformationIsNotNull() ? voPatientNoAllergyInfo.getSourceofInformation() : null); this.form.ctnDetails().pdtDateIdentified().setValue(voPatientNoAllergyInfo.getWhenIdentifiedIsNotNull() ? voPatientNoAllergyInfo.getWhenIdentified() : null); if(voPatientNoAllergyInfo.getAuthoringInformationIsNotNull()) form.ctnDetails().customControlAuthoringInfo().setValue(voPatientNoAllergyInfo.getAuthoringInformation()); if(voPatientNoAllergyInfo.getRecordingInformationIsNotNull()){ if(voPatientNoAllergyInfo.getRecordingInformation().getRecordingUserIsNotNull()) form.ctnDetails().txtRcordingHCP().setValue(voPatientNoAllergyInfo.getRecordingInformation().getRecordingUser().toString()); form.ctnDetails().dtimRecordingDateTime().setValue(voPatientNoAllergyInfo.getRecordingInformation().getRecordingDateTime()); } }
public PatientNoAllergyInfoVo savePatientNoAllergyInfo(PatientNoAllergyInfoVo patientNoAllergyInfo) throws StaleObjectException, UniqueKeyViolationException { if(!patientNoAllergyInfo.isValidated()) { throw new CodingRuntimeException("PatientNoAllergyInfoVo Value Object Alert has not been validated"); } DomainFactory factory = getDomainFactory(); PatientNoAllergyInfo doPatientNoAllergyInfo = PatientNoAllergyInfoVoAssembler.extractPatientNoAllergyInfo(factory, patientNoAllergyInfo); try { factory.save(doPatientNoAllergyInfo); } catch(UnqViolationUncheckedException e) { PatientNoAllergyInfo noAllergyInfo = PatientNoAllergyInfo.getPatientNoAllergyInfoFromPatient(factory, patientNoAllergyInfo.getPatient().getID_Patient()); if (noAllergyInfo != null && noAllergyInfo.getId() != null && !(noAllergyInfo.getId().equals(patientNoAllergyInfo.getID_PatientNoAllergyInfo()))) { throw new UniqueKeyViolationException("A No Known Allergy record already exists for this patient. Duplicates not allowed.", e); } throw (e); } return (PatientNoAllergyInfoVoAssembler.create(doPatientNoAllergyInfo)); }
private void initializeHasNoKnownAllergies() { PatientNoAllergyInfoVo voPatientNoAllergyInfo = domain.getPatientNoAllergyInfo(form.getGlobalContext().Core.getPatientShort()); if(voPatientNoAllergyInfo != null && voPatientNoAllergyInfo.getAllergyStatusIsNotNull() && voPatientNoAllergyInfo.getAllergyStatus().equals(PatientAllergyStatus.NOKNOWNALLERGIES)) form.chkNoAllergies().setValue(true); }
private void initializeHasNoKnownAllergies() { PatientNoAllergyInfoVo voPatientNoAllergyInfo = domain.getPatientNoAllergyInfo(form.getGlobalContext().Core.getPatientShort()); form.getLocalContext().setPatientNoAllergyInfo(voPatientNoAllergyInfo); checkNoAlergyStatus(voPatientNoAllergyInfo); }
private void checkNoAlergyStatus(PatientNoAllergyInfoVo voPatientNoAllergyInfo) { if(voPatientNoAllergyInfo != null && voPatientNoAllergyInfo.getAllergyStatusIsNotNull() && voPatientNoAllergyInfo.getAllergyStatus().equals(PatientAllergyStatus.NOKNOWNALLERGIES)) { form.lblHasNoKnownAllergies().setVisible(true); if(voPatientNoAllergyInfo.getAuthoringInformation() == null || (voPatientNoAllergyInfo.getAuthoringInformation().getAuthoringHcp() == null && voPatientNoAllergyInfo.getAuthoringInformation().getAuthoringDateTime() == null )) { String strTemp = voPatientNoAllergyInfo.createInfoTooltip().toString(); int n = strTemp.indexOf("Entered By : </b>"); n = n + new String("Entered By : </b>").length(); strTemp = strTemp.substring(0, n); form.lblHasNoKnownAllergies().setTooltip(strTemp); } else form.lblHasNoKnownAllergies().setTooltip(voPatientNoAllergyInfo.createInfoTooltip().toString()); if (form.getMode().equals(FormMode.VIEW)) { form.btnUpdate().setVisible(true); form.btnUpdate().setEnabled(true); form.getContextMenus().getGenericGridUpdateItem().setVisible(true); } populateScreenFromData(voPatientNoAllergyInfo); } else { form.lblHasNoKnownAllergies().setVisible(false); form.lblHasNoKnownAllergies().setTooltip(""); //form.btnUpdate().setVisible(false); //form.btnUpdate().setEnabled(false); } }
public PatientNoAllergyInfoVo getPatientNoAllergyInfo(PatientRefVo patientRefVo) { DomainFactory factory = getDomainFactory(); PatientNoAllergyInfo patientNoAllergyInfo = PatientNoAllergyInfo.getPatientNoAllergyInfoFromPatient(factory, patientRefVo.getID_Patient()); return PatientNoAllergyInfoVoAssembler.create(patientNoAllergyInfo); }
private void checkNoAlergyStatus(PatientNoAllergyInfoVo voPatientNoAllergyInfo) { if(voPatientNoAllergyInfo != null && voPatientNoAllergyInfo.getAllergyStatusIsNotNull() && voPatientNoAllergyInfo.getAllergyStatus().equals(PatientAllergyStatus.NOKNOWNALLERGIES)) { form.lblHasNoKnownAllergies().setVisible(true); if(voPatientNoAllergyInfo.getAuthoringInformation() == null || (voPatientNoAllergyInfo.getAuthoringInformation().getAuthoringHcp() == null && voPatientNoAllergyInfo.getAuthoringInformation().getAuthoringDateTime() == null )) { String strTemp = voPatientNoAllergyInfo.createInfoTooltip().toString(); int n = strTemp.indexOf("Entered By : </b>"); n = n + new String("Entered By : </b>").length(); strTemp = strTemp.substring(0, n); form.lblHasNoKnownAllergies().setTooltip(strTemp); } else form.lblHasNoKnownAllergies().setTooltip(voPatientNoAllergyInfo.createInfoTooltip().toString()); if (form.getMode().equals(FormMode.VIEW)) { form.btnUpdate().setVisible(true); form.btnUpdate().setEnabled(true); form.getContextMenus().getGenericGridUpdateItem().setVisible(true); } populateScreenFromData(voPatientNoAllergyInfo); } else { form.lblHasNoKnownAllergies().setVisible(false); form.lblHasNoKnownAllergies().setTooltip(""); form.btnUpdate().setVisible(false); //WDEV-18757 form.btnUpdate().setEnabled(false); //WDEV-18757 form.getContextMenus().getGenericGridUpdateItem().setVisible(false); //WDEV-18757 if (form.getMode().equals(FormMode.VIEW) && form.grdAllergies().getValue() == null) //WDEV-18829 clearDetailsPanel(); } }
public PatientNoAllergyInfoVo getPatientNoAllergyInfo(PatientRefVo patientRefVo) { Allergies allergies = (Allergies)getDomainImpl(AllergiesImpl.class); return allergies.getPatientNoAllergyInfo(patientRefVo); }
public PatientNoAllergyInfoVo savePatientNoAllergyInfo(PatientNoAllergyInfoVo patientNoAllergyInfo) throws StaleObjectException, UniqueKeyViolationException { Allergies allergies = (Allergies)getDomainImpl(AllergiesImpl.class); return allergies.savePatientNoAllergyInfo(patientNoAllergyInfo); }
public ims.core.vo.PatientAllergy savePatientAllergy(ims.core.vo.PatientAllergy voPatientAllergy, PatientNoAllergyInfoVo patientNoAllergyInfo) throws ims.domain.exceptions.StaleObjectException, UniqueKeyViolationException, DomainInterfaceException { if (!voPatientAllergy.isValidated()) throw new CodingRuntimeException("Patient Allergy has not been validated"); if (!patientNoAllergyInfo.isValidated()) throw new CodingRuntimeException("PatientNoAllergyInfoVo has not been validated"); if(voPatientAllergy == null) throw new CodingRuntimeException("Cannot save null PatientAllergyVo"); if (patientNoAllergyInfo == null) throw new CodingRuntimeException("Cannot save null PatientNoAllergyInfoVo"); DomainFactory factory = getDomainFactory(); //Check the allergy and save it if(voPatientAllergy.getAllergenIsNotNull() && voPatientAllergy.getAllergen().getID_Allergen() == null) { voPatientAllergy.setAllergen(saveAllergy(voPatientAllergy.getAllergen())); } PatientAllergy doPatientAllergy = PatientAllergyAssembler.extractPatientAllergy(factory, voPatientAllergy); if (!voPatientAllergy.getID_PatientAllergyIsNotNull()) { //Check the PatientNoAllergyInfo String hqlQuery = "select p1_1.allergyStatus from PatientNoAllergyInfo as p1_1 where (p1_1.patient.id = :Patient_id and p1_1.isRIE is null )"; List<?> list = factory.find(hqlQuery,"Patient_id",voPatientAllergy.getPatient().getID_Patient()); //If there is no PatientNoAllergiesInfo record, or the record exists and the status is NOKNOWNALLERGIES if ((list == null || list.size() == 0) || (getDomLookup(PatientAllergyStatus.NOKNOWNALLERGIES).equals(list.get(0)))) { savePatientNoAllergyInfo(patientNoAllergyInfo); } } factory.save(doPatientAllergy); //if the allergy has a PAS mapping of "ALLE" then insert an ALERT of this type. if (voPatientAllergy.getAllergenIsNotNull() && voPatientAllergy.getAllergen().getTaxonomyMapIsNotNull() && voPatientAllergy.getAllergen().getTaxonomyMap().size() > 0) { for ( int i = 0 ; i < voPatientAllergy.getAllergen().getTaxonomyMap().size() ; i++) { if (voPatientAllergy.getAllergen().getTaxonomyMap().get(i).getTaxonomyCodeIsNotNull() && voPatientAllergy.getAllergen().getTaxonomyMap().get(i).getTaxonomyCode().equals("ALLE") && voPatientAllergy.getAllergen().getTaxonomyMap().get(i).getTaxonomyNameIsNotNull() && voPatientAllergy.getAllergen().getTaxonomyMap().get(i).getTaxonomyName().getText().equals("PAS")) { Alerts impl = (Alerts) getDomainImpl(ims.core.domain.impl.AlertsImpl.class); impl.saveHeartsAlert(voPatientAllergy.getPatient(), "ALLE", voPatientAllergy.getIsCurrentlyActiveAllergy()); } } } return (PatientAllergyAssembler.create(doPatientAllergy)); }