package com.jasamedika.medifirst2000.entities;

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 = "TimeOutControl_T")
public class TimeOutControl extends BaseTransaction {

	private static final long serialVersionUID = 6694087323989936958L;
	
	@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;
	

	@NotNull(message = "Hal Khusus tidak boleh kosong")
	@Column(name = "HalKhusus", nullable = false)
	@Caption(value = "Hal Khusus")
	private String halKhusus;

	@NotNull(message = "Nama Antibiotik tidak boleh kosong")
	@Column(name = "NamaAntibiotik", nullable = false)
	@Caption(value = "Nama Antibiotik")
	private String namaAntibiotik;

	@NotNull(message = "Dosis Antibiotik tidak boleh kosong")
	@Column(name = "DosisAntibiotik", nullable = false)
	@Caption(value = "Dosis Antibiotik")
	private String dosisAntibiotik;

	@ManyToOne
	@JoinColumn(name = "ObjectFotoRadiologiFk")
	@NotNull(message = "Foto Radiologi tidak boleh kosong")
	private StatusYaTidak fotoRadiologi; // Ya atau tidak

	@Column(name = "ObjectFotoRadiologiFk", insertable = false, updatable = false, nullable = false)
	private Integer fotoRadiologiId;

	@ManyToOne
	@JoinColumn(name = "ObjectStatusAntibiotikProfilaksisFk")
	@NotNull(message = "Status Antibiotik Profilaksis tidak boleh kosong")
	private StatusYaTidak statusAntibiotikProfilaksis; // Ya atau tidak

	@Column(name = "ObjectStatusAntibiotikProfilaksisFk", insertable = false, updatable = false, nullable = false)
	private Integer statusAntibiotikProfilaksisId;

	@JsonBackReference
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "timeOutControl")
	private Set<Pelaksana> pelaksana = new HashSet<Pelaksana>();

	public Set<Pelaksana> getPelaksana() {
		return pelaksana;
	}

	public void setPelaksana(Set<Pelaksana> pelaksana) {
		this.pelaksana = pelaksana;
	}

	public String getHalKhusus() {
		return halKhusus;
	}

	public void setHalKhusus(String halKhusus) {
		this.halKhusus = halKhusus;
	}

	public String getNamaAntibiotik() {
		return namaAntibiotik;
	}

	public void setNamaAntibiotik(String namaAntibiotik) {
		this.namaAntibiotik = namaAntibiotik;
	}

	public String getDosisAntibiotik() {
		return dosisAntibiotik;
	}

	public void setDosisAntibiotik(String dosisAntibiotik) {
		this.dosisAntibiotik = dosisAntibiotik;
	}

	public StatusYaTidak getFotoRadiologi() {
		return fotoRadiologi;
	}

	public void setFotoRadiologi(StatusYaTidak fotoRadiologi) {
		this.fotoRadiologi = fotoRadiologi;
	}

	public Integer getFotoRadiologiId() {
		return fotoRadiologiId;
	}

	public void setFotoRadiologiId(Integer fotoRadiologiId) {
		this.fotoRadiologiId = fotoRadiologiId;
	}

	public StatusYaTidak getStatusAntibiotikProfilaksis() {
		return statusAntibiotikProfilaksis;
	}

	public void setStatusAntibiotikProfilaksis(StatusYaTidak statusAntibiotikProfilaksis) {
		this.statusAntibiotikProfilaksis = statusAntibiotikProfilaksis;
	}

	public Integer getStatusAntibiotikProfilaksisId() {
		return statusAntibiotikProfilaksisId;
	}

	public void setStatusAntibiotikProfilaksisId(Integer statusAntibiotikProfilaksisId) {
		this.statusAntibiotikProfilaksisId = statusAntibiotikProfilaksisId;
	}

	public AntrianPasienDiPeriksa getPasienDaftar() {
		return pasienDaftar;
	}

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

	public String getPasienId() {
		return pasienId;
	}

	public void setPasienId(String pasienId) {
		this.pasienId = pasienId;
	}
	
	
}
