public Integer getLevel(Diagnosis diagnosis) {
    if (level == null || level <= 0) {
      return severity.getDefaultLevel(diagnosis);
    }

    return level;
  }
  @Access(AccessType.PROPERTY)
  @Column(name = "severity_id", nullable = false)
  public long getSeverityId() {
    if (severity != null) {
      return severity.getId();
    }

    return -1;
  }
 public void setSeverityId(Long id) {
   this.severity = Severity.getSeverity(id);
 }