public PatientNoAllergyInfoForTriageVo savePatientNoAllergyInfo(PatientNoAllergyInfoForTriageVo noAllergy) throws StaleObjectException, UniqueKeyViolationException { if(noAllergy == null) throw new CodingRuntimeException("Cannot save a null PatientNoAllergyInfo."); if(!noAllergy.isValidated()) throw new CodingRuntimeException("PatientNoAllergyInfo is not validated"); DomainFactory factory = getDomainFactory(); PatientNoAllergyInfo doPatientNoAllergyInfo = PatientNoAllergyInfoForTriageVoAssembler.extractPatientNoAllergyInfo(factory, noAllergy); try { factory.save(doPatientNoAllergyInfo); } catch(UnqViolationUncheckedException e) { throw new UniqueKeyViolationException(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); } return PatientNoAllergyInfoForTriageVoAssembler.create(doPatientNoAllergyInfo); }
public PatientNoAllergyInfoForTriageVo getPatientNoAllergyInfo(PatientRefVo patient) { if(patient == null || !patient.getID_PatientIsNotNull()) throw new CodingRuntimeException("Cannot get PatientNoAllergyInfo on null Patient Id."); DomainFactory factory = getDomainFactory(); PatientNoAllergyInfo patientNoAllergyInfo = PatientNoAllergyInfo.getPatientNoAllergyInfoFromPatient(factory, patient.getID_Patient()); return PatientNoAllergyInfoForTriageVoAssembler.create(patientNoAllergyInfo); }