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;

@Entity //@Audited
@Table(name = "PraAnestesiPasienHeader_T")
public class PraAnestesiPasienHeader 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;
	
	@Column(name = "TglAnestasi")
	private Date tglAnestasi;
	
	@JsonBackReference
	@OneToMany(cascade=CascadeType.ALL,fetch = FetchType.LAZY, mappedBy = "praAnestesiPasienHeader")
	private Set<PraAnestesiPasienBedah> praAnestesiPasienBedah = new HashSet<PraAnestesiPasienBedah>();

	public AntrianPasienDiPeriksa getPasienDaftar() {
		return pasienDaftar;
	}

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

	public Set<PraAnestesiPasienBedah> getPraAnestesiPasienBedah() {
		return praAnestesiPasienBedah;
	}

	public void setPraAnestesiPasienBedah(Set<PraAnestesiPasienBedah> praAnestesiPasienBedah) {
		this.praAnestesiPasienBedah = praAnestesiPasienBedah;
	}

	public Date getTglAnestasi() {
		return tglAnestasi;
	}

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