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.JsonBackReference;
import com.jasamedika.medifirst2000.base.BaseTransaction;
import com.jasamedika.medifirst2000.helper.Caption;

@Entity //@Audited
@Table(name = "PraAnestesiDokterBedahHeader_T")
public class PraAnestesiDokterBedahHeader extends BaseTransaction {
	@ManyToOne
	@JoinColumn(name = "ObjectPasienFk")
	@NotNull(message = "Pasien tidak boleh kosong")
	private AntrianPasienDiPeriksa pasienDaftar;
	
	@Column(name = "ObjectPasienFk", columnDefinition = "CHAR(32)", insertable = false, updatable = false, nullable = false)
	private String pasienId;
	
	@ManyToOne
	@Caption("DokterFk")
	@JoinColumn(name="DokterFk")
	@NotNull(message="Dokter harus diisi")
	private Pegawai dokterFk;
	
	@Column(name = "DokterFk", insertable = false, updatable = false, nullable = false)
	private Integer dokterId;
	
	@Column(name = "TglAnestasi")
	private Date tglAnestasi;
	
	@JsonBackReference
	@OneToMany(cascade=CascadeType.ALL,fetch = FetchType.LAZY, mappedBy = "praAnestesiDokterBedahHeader")
	private Set<PraAnestesiDokterBedah> praAnestesiDokterBedah = new HashSet<PraAnestesiDokterBedah>();

	public AntrianPasienDiPeriksa getPasienDaftar() {
		return pasienDaftar;
	}

	public void setPasienDaftar(AntrianPasienDiPeriksa pasienDaftar) {
		this.pasienDaftar = pasienDaftar;
	}

	public Pegawai getDokterFk() {
		return dokterFk;
	}

	public void setDokterFk(Pegawai dokterFk) {
		this.dokterFk = dokterFk;
	}

	public Date getTglAnestasi() {
		return tglAnestasi;
	}

	public void setTglAnestasi(Date tglAnestasi) {
		this.tglAnestasi = tglAnestasi;
	}

	public Set<PraAnestesiDokterBedah> getPraAnestesiDokterBedah() {
		return praAnestesiDokterBedah;
	}

	public void setPraAnestesiDokterBedah(Set<PraAnestesiDokterBedah> praAnestesiDokterBedah) {
		this.praAnestesiDokterBedah = praAnestesiDokterBedah;
	}
	
	

}
