package com.jasamedika.medifirst2000.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;

@Entity
@Table(name = "Diagnosa_M")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class Diagnosa extends BaseMaster {
	private static final long serialVersionUID = 1960221286223158801L;

	@NotNull(message = "Kd Diagnosa tidak boleh kosong")
	@Column(name = "KdDiagnosa", nullable = false, length = 10)
	@Caption(value = "Kode Diagnosa")
	private String kdDiagnosa;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectJenisKelaminFk")
	@Caption(value = "Object Jenis Kelamin")
	private JenisKelamin jenisKelamin;

	@Column(name = "ObjectJenisKelaminFk", insertable = false, updatable = false)
	private Integer jenisKelaminId;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectKategoryDiagnosaFk")
	@Caption(value = "Object Kategory Diagnosa")
	private KategoryDiagnosa kategoryDiagnosa;

	@Column(name = "ObjectKategoryDiagnosaFk", insertable = false, updatable = false)
	private Integer kategoryDiagnosaId;

	@NotNull(message = "Nama Diagnosa tidak boleh kosong")
	@Column(name = "NamaDiagnosa", nullable = false, length = 150)
	@Caption(value = "Nama Diagnosa")
	private String namaDiagnosa;

	@NotNull(message = "QDiagnosa tidak boleh kosong")
	@Column(name = "QDiagnosa", nullable = false)
	@Caption(value = "QDiagnosa")
	private Integer qDiagnosa;

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

	public String getKdDiagnosa() {
		return kdDiagnosa;
	}

	public void setKdDiagnosa(String kdDiagnosa) {
		this.kdDiagnosa = kdDiagnosa;
	}

	public JenisKelamin getJenisKelamin() {
		return jenisKelamin;
	}

	public void setJenisKelamin(JenisKelamin jenisKelamin) {
		this.jenisKelamin = jenisKelamin;
	}

	public Integer getJenisKelaminId() {
		return jenisKelaminId;
	}

	public void setJenisKelaminId(Integer jenisKelaminId) {
		this.jenisKelaminId = jenisKelaminId;
	}

	public KategoryDiagnosa getKategoryDiagnosa() {
		return kategoryDiagnosa;
	}

	public void setKategoryDiagnosa(KategoryDiagnosa kategoryDiagnosa) {
		this.kategoryDiagnosa = kategoryDiagnosa;
	}

	public Integer getKategoryDiagnosaId() {
		return kategoryDiagnosaId;
	}

	public void setKategoryDiagnosaId(Integer kategoryDiagnosaId) {
		this.kategoryDiagnosaId = kategoryDiagnosaId;
	}

	public String getNamaDiagnosa() {
		return namaDiagnosa;
	}

	public void setNamaDiagnosa(String namaDiagnosa) {
		this.namaDiagnosa = namaDiagnosa;
	}

	public Integer getqDiagnosa() {
		return qDiagnosa;
	}

	public void setqDiagnosa(Integer qDiagnosa) {
		this.qDiagnosa = qDiagnosa;
	}

	public Integer getId() {
		return id;
	}

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

}