package com.jasamedika.medifirst2000.entities;

import java.util.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.JsonManagedReference;
import com.jasamedika.medifirst2000.base.BaseTransaction;
import com.jasamedika.medifirst2000.helper.Caption;import org.hibernate.envers.Audited;

@Entity //@Audited
@Table(name="PapAnamesis_T")
public class PapAnamesis extends BaseTransaction{

	@ManyToOne
	@JoinColumn(name = "ObjectRegistrasiPelayananPasienFk")
	//@NotNull(message = "RegistrasiPelayananPasien tidak boleh kosong")
	private RegistrasiPelayananPasien registrasiPelayananPasien;	
	
	@Column(name = "ObjectRegistrasiPelayananPasienFk", columnDefinition = "CHAR(32)", insertable = false, updatable = false, nullable = true)
	private String registrasiPelayananPasienId;

	@ManyToOne
	@JoinColumn(name = "ObjectPasienFk")
	@NotNull(message = "Pasien tidak boleh kosong")
	private Pasien pasien;	
	
	@Column(name = "ObjectPasienFk", insertable = false, updatable = false, nullable = false)
	private Integer pasienId;
	
	@NotNull(message = "Tgl Input tidak boleh kosong")
	@Column(name = "tglInput", nullable = false)
	@Caption(value = "Tgl Input")
	private Date tglInput;

	@Column(name = "keluhan")
	@Caption(value = "keluhan")
	private String keluhan;

	@JsonManagedReference
	@OneToMany(cascade=CascadeType.ALL,fetch = FetchType.LAZY, mappedBy = "papAnamesis")
	@Caption(value = "papRiwayatPenyakitPengobatanSet")
	Set<PapRiwayatPenyakitPengobatan> papRiwayatPenyakitPengobatanSet=new HashSet<PapRiwayatPenyakitPengobatan>();
	
	public String getKeluhan() {
		return keluhan;
	}

	public void setKeluhan(String keluhan) {
		this.keluhan = keluhan;
	}
	
	public RegistrasiPelayananPasien getRegistrasiPelayananPasien() {
		return registrasiPelayananPasien;
	}

	public void setRegistrasiPelayananPasien(RegistrasiPelayananPasien registrasiPelayananPasien) {
		this.registrasiPelayananPasien = registrasiPelayananPasien;
	}

	public Pasien getPasien() {
		return pasien;
	}

	public void setPasien(Pasien pasien) {
		this.pasien = pasien;
	}

	public Date getTglInput() {
		return tglInput;
	}

	public void setTglInput(Date tglInput) {
		this.tglInput = tglInput;
	}

	public Set<PapRiwayatPenyakitPengobatan> getPapRiwayatPenyakitPengobatanSet() {
		return papRiwayatPenyakitPengobatanSet;
	}

	public void setPapRiwayatPenyakitPengobatanSet(Set<PapRiwayatPenyakitPengobatan> papRiwayatPenyakitPengobatanSet) {
		this.papRiwayatPenyakitPengobatanSet = papRiwayatPenyakitPengobatanSet;
	}

	
}
