Exemplo n.º 1
0
  public ims.core.vo.PatientNoAlertInfoForTriageVo getPatientNoAlertInfo(
      ims.core.patient.vo.PatientRefVo patient) {
    if (patient == null || !patient.getID_PatientIsNotNull())
      throw new CodingRuntimeException("Cannot get PatientNoAllergyInfo on null Patient Id.");

    DomainFactory factory = getDomainFactory();

    PatientNoAlertInfo patientNoAllergyInfo =
        PatientNoAlertInfo.getPatientNoAlertInfoFromPatient(factory, patient.getID_Patient());
    return PatientNoAlertInfoForTriageVoAssembler.create(patientNoAllergyInfo);
  }
Exemplo n.º 2
0
  public ims.core.vo.PatientNoAlertInfoForTriageVo savePatientNoAlertInfo(
      ims.core.vo.PatientNoAlertInfoForTriageVo patientNoAlertInfo)
      throws ims.domain.exceptions.StaleObjectException,
          ims.domain.exceptions.UniqueKeyViolationException {
    if (patientNoAlertInfo == null)
      throw new CodingRuntimeException("Cannot save a null PatientNoAlertInfo.");

    if (!patientNoAlertInfo.isValidated())
      throw new CodingRuntimeException("PatientNoAlertInfo is not validated");

    DomainFactory factory = getDomainFactory();

    PatientNoAlertInfo doPatientNoAlertInfo =
        PatientNoAlertInfoForTriageVoAssembler.extractPatientNoAlertInfo(
            factory, patientNoAlertInfo);

    try {
      factory.save(doPatientNoAlertInfo);
    } catch (UnqViolationUncheckedException e) {
      throw new UniqueKeyViolationException(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
    }

    return PatientNoAlertInfoForTriageVoAssembler.create(doPatientNoAlertInfo);
  }