package com.jasamedika.medifirst2000.entities;

import java.sql.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.jasamedika.medifirst2000.base.BaseTransaction;
import com.jasamedika.medifirst2000.helper.Caption;import org.hibernate.envers.Audited;

@Entity //@Audited
@Table(name = "PernahDirawatDetail_T")
public class PernahDirawatDetail extends BaseTransaction {
	/**
	 * @author Shakato
	 */
	
	@ManyToOne
	@JoinColumn(name = "ObjectRiwayatKesehatanFk")
	@Caption(value = "ID RiwayatKesehatan")
	//@NotNull(message = "ID HasilTriase tidak boleh kosong")
	private RiwayatKesehatan riwayatKesehatan;
	
	@Column(name = "ObjectRiwayatKesehatanFk", columnDefinition = "CHAR(32)", insertable = false, updatable = false, nullable = true)
	private String riwayatKesehatanId;
	
	@ManyToOne
	@JoinColumn(name = "ObjectDiagnosaFk")
	@Caption(value = "ID Diagnosa")
	@NotNull(message = "ID Diagnosa tidak boleh kosong")
	private Diagnosa diagnosa;
	
	@Column(name = "ObjectDiagnosaFk", insertable = false, updatable = false, nullable = false)
	private Integer diagnosaId;

	@Column(name = "tanggal", nullable = true)
	@Caption(value = "tanggal")
	private Date tanggal;

	public RiwayatKesehatan getRiwayatKesehatan() {
		return riwayatKesehatan;
	}

	public void setRiwayatKesehatan(RiwayatKesehatan riwayatKesehatan) {
		this.riwayatKesehatan = riwayatKesehatan;
	}

	public String getRiwayatKesehatanId() {
		return riwayatKesehatanId;
	}

	public void setRiwayatKesehatanId(String riwayatKesehatanId) {
		this.riwayatKesehatanId = riwayatKesehatanId;
	}

	public Diagnosa getDiagnosa() {
		return diagnosa;
	}

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

	public Integer getDiagnosaId() {
		return diagnosaId;
	}

	public void setDiagnosaId(Integer diagnosaId) {
		this.diagnosaId = diagnosaId;
	}

	public Date getTanggal() {
		return tanggal;
	}

	public void setTanggal(Date tanggal) {
		this.tanggal = tanggal;
	}
	
}