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.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonManagedReference;
import com.jasamedika.medifirst2000.base.BaseTransaction;
import com.jasamedika.medifirst2000.helper.Caption;
import org.hibernate.envers.Audited;

@Entity
@Table(name = "PapSkriningGizi_T")
public class PapSkriningGizi extends BaseTransaction {

	
	@ManyToOne
	@JoinColumn(name = "ObjectRegistrasiPelayananPasienFk")
	private RegistrasiPelayananPasien registrasiPelayananPasien;

	@Column(name = "ObjectRegistrasiPelayananPasienFk", columnDefinition = "CHAR(32)", insertable = false, updatable = false, nullable = true)
	private String registrasiPelayananPasienId;

	@ManyToOne
	@JoinColumn(name = "ObjectPapSkriningGiziFk")
	private PapSkriningGizi papSkriningGizi;

	@Column(name = "ObjectPapSkriningGiziFk", columnDefinition = "CHAR(32)", insertable = false, updatable = false, nullable = true)
	private String papSkriningGiziId;

	@ManyToOne
	@JoinColumn(name = "ObjectPasienFk")
	@NotNull(message = "Pasien tidak boleh kosong")
	private AntrianPasienDiPeriksa pasien;

	@Column(name = "ObjectPasienFk", columnDefinition = "CHAR(32)", insertable = false, updatable = false, nullable = false)
	private String pasienId;

	@Column(name = "tglInput", nullable = false)
	@Caption(value = "Tgl Input")
	private Date tglInput;

	@Column(name = "tinggiBadan")
	@Caption(value = "tinggiBadan")
	private Float tinggiBadan;

	@Column(name = "beratBadan")
	@Caption(value = "beratBadan")
	private Float beratBadan;

	@Column(name = "lingkarKepala")
	@Caption(value = "Lingkar Kepala")
	private Float lingkarKepala;

	@Column(name = "totalSkor")
	@Caption(value = "totalSkor")
	private Float totalSkor;

	@JsonManagedReference
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "papSkriningGizi")
	@Caption(value = "papSkriningGiziDetailSet")
	private Set<PapSkriningGiziDetail> papSkriningGiziDetailSet = new HashSet<PapSkriningGiziDetail>();

	@Column(name = "tglInputData")
	@Caption(value = "Tgl Input Data")
	private Date tglInputData;

	@Column(name = "assesmentUlang")
	@Caption(value = "assesmentUlang")
	private String asesmentUlang;
	
	@ManyToOne(fetch=FetchType.LAZY)
	@Caption(value = "pengkajianAwalBaru")
	@JoinColumn(name = "ObjectPengkajianAwalBaruFk")
	private PengkajianAwalBaru pengkajianAwalBaru;
	
	@Column(name = "ObjectPengkajianAwalBaruFk", columnDefinition = "CHAR(32)", insertable = false, updatable = false)
	private String pengkajianAwalBaruId;

	public Float getTinggiBadan() {
		return tinggiBadan;
	}

	public void setTinggiBadan(Float tinggiBadan) {
		this.tinggiBadan = tinggiBadan;
	}

	public Float getBeratBadan() {
		return beratBadan;
	}

	public void setBeratBadan(Float beratBadan) {
		this.beratBadan = beratBadan;
	}

	public Float getLingkarKepala() {
		return lingkarKepala;
	}

	public void setLingkarKepala(Float lingkarKepala) {
		this.lingkarKepala = lingkarKepala;
	}

	public AntrianPasienDiPeriksa getPasien() {
		return pasien;
	}

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

	public RegistrasiPelayananPasien getRegistrasiPelayananPasien() {
		return registrasiPelayananPasien;
	}

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

	public Date getTglInput() {
		return tglInput;
	}

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

	public Set<PapSkriningGiziDetail> getPapSkriningGiziDetailSet() {
		return papSkriningGiziDetailSet;
	}

	public void setPapSkriningGiziDetailSet(Set<PapSkriningGiziDetail> papSkriningGiziDetailSet) {
		this.papSkriningGiziDetailSet = papSkriningGiziDetailSet;
	}

	public Float getTotalSkor() {
		return totalSkor;
	}

	public void setTotalSkor(Float totalSkor) {
		this.totalSkor = totalSkor;
	}

	public Date getTglInputData() {
		return tglInputData;
	}

	public void setTglInputData(Date tglInputData) {
		this.tglInputData = tglInputData;
	}

	public String getAsesmentUlang() {
		return asesmentUlang;
	}

	public void setAsesmentUlang(String asesmentUlang) {
		this.asesmentUlang = asesmentUlang;
	}

	public PapSkriningGizi getPapSkriningGizi() {
		return papSkriningGizi;
	}

	public void setPapSkriningGizi(PapSkriningGizi papSkriningGizi) {
		this.papSkriningGizi = papSkriningGizi;
	}

	public PengkajianAwalBaru getPengkajianAwalBaru() {
		return pengkajianAwalBaru;
	}

	public void setPengkajianAwalBaru(PengkajianAwalBaru pengkajianAwalBaru) {
		this.pengkajianAwalBaru = pengkajianAwalBaru;
	}

	public String getPengkajianAwalBaruId() {
		return pengkajianAwalBaruId;
	}

	public void setPengkajianAwalBaruId(String pengkajianAwalBaruId) {
		this.pengkajianAwalBaruId = pengkajianAwalBaruId;
	}

}
