package com.jasamedika.medifirst2000.entities;

import java.io.Serializable;
import org.hibernate.envers.Audited;
import javax.persistence.*;

import org.hibernate.validator.constraints.NotEmpty;

import com.jasamedika.medifirst2000.base.BaseMaster;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.internal.util.logging.Messages;

import com.fasterxml.jackson.annotation.JsonManagedReference;
import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;
import org.hibernate.envers.Audited;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 * class PenyebabDiagnosa
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "PenyebabDiagnosa_M")
public class PenyebabDiagnosa extends BaseMaster {
	@ManyToOne
	@JoinColumn(name = "ObjectDiagnosaFk")
	@NotNull(message = "Kd Diagnosa tidak boleh kosong")

	@Caption(value = "Object Diagnosa")
	private Diagnosa diagnosa;

	public void setDiagnosa(Diagnosa diagnosa) {
		this.diagnosa = diagnosa;
	}

	public Diagnosa getDiagnosa() {
		return this.diagnosa;
	}

	@Column(name = "ObjectDiagnosaFk", insertable = false, updatable = false)
	private Integer diagnosaId;

	@ManyToOne
	@JoinColumn(name = "ObjectKelompokPDiagnosaFk")
	@NotNull(message = "Kd Kelompok P Diagnosa tidak boleh kosong")

	@Caption(value = "Object Kelompok P Diagnosa")
	private KelompokPenyebabDiagnosa kelompokPDiagnosa;

	public void setKelompokPDiagnosa(KelompokPenyebabDiagnosa kelompokPDiagnosa) {
		this.kelompokPDiagnosa = kelompokPDiagnosa;
	}

	public KelompokPenyebabDiagnosa getKelompokPDiagnosa() {
		return this.kelompokPDiagnosa;
	}

	@Column(name = "ObjectKelompokPDiagnosaFk", insertable = false, updatable = false, nullable = false)
	private Integer kelompokPDiagnosaId;

	@NotNull(message = "Kd Penyebab Diagnosa tidak boleh kosong")
	@Column(name = "KdPenyebabDiagnosa", nullable = false)
	@Caption(value = "Kode Penyebab Diagnosa")
	private short kdPenyebabDiagnosa;

	public void setKdPenyebabDiagnosa(short kdPenyebabDiagnosa) {
		this.kdPenyebabDiagnosa = kdPenyebabDiagnosa;
	}

	public short getKdPenyebabDiagnosa() {
		return this.kdPenyebabDiagnosa;
	}

	@NotNull(message = "Penyebab Diagnosa tidak boleh kosong")
	@Column(name = "PenyebabDiagnosa", nullable = false, length = 100)
	@Caption(value = "Penyebab Diagnosa")
	private String penyebabDiagnosa;

	public void setPenyebabDiagnosa(String penyebabDiagnosa) {
		this.penyebabDiagnosa = penyebabDiagnosa;
	}

	public String getPenyebabDiagnosa() {
		return this.penyebabDiagnosa;
	}

	@NotNull(message = "QPenyebab Diagnosa tidak boleh kosong")
	@Column(name = "QPenyebabDiagnosa", nullable = false)
	@Caption(value = "QPenyebab Diagnosa")
	private short qPenyebabDiagnosa;

	public void setqPenyebabDiagnosa(short qPenyebabDiagnosa) {
		this.qPenyebabDiagnosa = qPenyebabDiagnosa;
	}

	public short getqPenyebabDiagnosa() {
		return this.qPenyebabDiagnosa;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "public.penyebabdiagnosa_m_id_seq")
	@javax.persistence.SequenceGenerator(name = "public.penyebabdiagnosa_m_id_seq", sequenceName = "public.penyebabdiagnosa_m_id_seq", allocationSize = 1)
	@Column(name = "id")
	protected Integer id;

	public Integer getId() {

		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
}