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.helper.Caption;

@Entity
@Table(name = "PelayananPasien_T")
public class PelayananPasien extends MedicalRecordTransaction {

	@ManyToOne
	@JoinColumn(name = "Generik")
	@Caption(value = "Generik")
	private Generik generik;

	@Column(name = "Generik", insertable = false, updatable = false, nullable = true)
	private Integer generikId;

	@Caption(value = "statusOrder")
	@Column(name = "statusOrder", nullable = true)
	private Byte statusOrder;

	@Caption(value = "jasa")
	@Column(name = "jasa")
	private Double jasa;

	@ManyToOne
	@JoinColumn(name = "KelasFk")
	@Caption(value = "Produk")
	private Kelas kelas;

	@Column(name = "KelasFk", insertable = false, updatable = false, nullable = true)
	private Integer kelasId;

	@Caption(value = "Is Pasien")
	@Column(name = "isPasien", nullable = true)
	private Boolean isPasien;

	@Caption(value = "Is Pasien")
	@Column(name = "isObat", nullable = true)
	private Boolean isObat;

	@Caption(value = "Is Pasien")
	@Column(name = "isDosis", nullable = true)
	private Boolean isDosis;

	@Caption(value = "Is Pasien")
	@Column(name = "isRoute", nullable = true)
	private Boolean isRoute;

	@Caption(value = "Is Pasien")
	@Column(name = "isDokumentasi", nullable = true)
	private Boolean isDokumentasi;

	@Caption(value = "Is Pasien")
	@Column(name = "isWaktu", nullable = true)
	private Boolean isWaktu;

	@Caption(value = "Is Pasien")
	@Column(name = "isInformasi", nullable = true)
	private Boolean isInformasi;

	@Caption(value = "Is Benar")
	@Column(name = "isBenar", nullable = true)
	private Boolean isBenar;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "StrukFk")
	private StrukPelayanan strukPelayanan;

	@Column(name = "StrukFk", nullable = false, insertable = false, updatable = false)
	private String strukFk;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "StrukTerimaFk")
	private StrukPelayanan strukTerima;

	@Column(name = "StrukTerimaFk", nullable = true, insertable = false, updatable = false)
	private String strukTerimaId;

	@Caption(value = "nilaiKonversi")
	@Column(name = "nilaiKonversi", nullable = true)
	private Float nilaiKonversi;

	@Caption(value = "Status")
	@Column(name = "status", nullable = true)
	private String status;

	@Caption(value = "Tanggal Pelayanan")
	@Column(name = "TglPelayanan", nullable = true)
	private Date tglPelayanan;

	@Caption(value = "Harga Satuan")
	@Column(name = "hargaSatuan", nullable = true)
	private Double hargaSatuan;

	@Caption(value = "Harga Jual")
	@Column(name = "HargaJual", nullable = true)
	private Double hargaJual;

	@Caption(value = "Nilai Normal")
	@Column(name = "NilaiNormal", nullable = true)
	private Byte nilaiNormal;

	@Caption(value = "Piutang Penjamin")
	@Column(name = "piutangPenjamin", nullable = true)
	private Double piutangPenjamin;

	@Caption(value = "Piutang Rumah Sakit")
	@Column(name = "piutangRumahSakit", nullable = true)
	private Double piutangRumahSakit;

	@ManyToOne
	@JoinColumn(name = "NoBatch")
	@Caption(value = "Struk Order")
	private StrukPelayananDNoBatch noBatch;

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

	@ManyToOne
	@JoinColumn(name = "satuanViewFK")
	@Caption(value = "satuanView")
	private SatuanStandar satuanView;

	@Column(name = "satuanViewFK", insertable = false, updatable = false, nullable = true)
	private Integer satuanViewId;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "StrukOrderFk")
	@Caption(value = "Struk Order")
	private StrukOrder strukOrder;

	@Column(name = "StrukOrderFk", columnDefinition = "CHAR(32)", insertable = false, updatable = false)
	private String strukOrderId;

	@ManyToOne
	@JoinColumn(name = "JenisObatFk")
	@Caption(value = "Jenis Obat")
	private JenisObat jenisObat;

	@Column(name = "JenisObatFk", insertable = false, updatable = false)
	private Integer jenisObatId;

	@ManyToOne
	@JoinColumn(name = "ProdukFk")
	@NotNull(message = "Produk Harus Diisi")
	@Caption(value = "Produk")
	private Produk produk;

	@Column(name = "ProdukFk", insertable = false, updatable = false)
	private Integer produkId;

	@Column(name = "Stock", nullable = false, length = 100)
	@Caption(value = "Stock")
	private Double stock;

	@Column(name = "Jumlah", nullable = false, length = 100)
	@Caption(value = "Jumlah")
	private Double jumlah;

	@Column(name = "AturanPakai", nullable = true, length = 100)
	@Caption(value = "AturanPakai")
	private String aturanPakai;

	@ManyToOne
	@JoinColumn(name = "RouteFk")
	@Caption(value = "Route")
	private RouteFarmasi route;

	@Column(name = "RouteFk", insertable = false, updatable = false)
	private Integer routeId;

	@ManyToOne
	@JoinColumn(name = "KeteranganPakaiFk")
	@Caption(value = "Keterangan Pakai")
	private Stigma keteranganPakai;

	@Column(name = "KeteranganPakaiFk", insertable = false, updatable = false)
	private Integer keteranganPakaiId;

	@Column(name = "KeteranganPakai2", nullable = true, length = 100)
	@Caption(value = "KeteranganPakai2")
	private String keteranganPakai2;

	@ManyToOne
	@Caption(value = "Kelompok Transaksi")
	@JoinColumn(name = "KdKelompokTransaksi")
	private KelompokTransaksi kelompokTransaksi;

	@Column(name = "KdKelompokTransaksi", insertable = false, updatable = false, nullable = true)
	private Integer kelompokTransaksiId;

	@Column(name = "KeteranganLain", nullable = true, length = 100)
	@Caption(value = "KeteranganLain")
	private String keteranganLain;

	@Caption(value = "Harga Discount")
	@Column(name = "hargaDiscount")
	private Double hargaDiscount;

	@Caption(value = "hargaNetto")
	@Column(name = "hargaNetto")
	private Double hargaNetto;

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

	@Caption(value = "NoRecTriger")
	@Column(name = "noRecTriger", nullable = true)
	private String noRecTriger;

	@ManyToOne
	@JoinColumn(name = "StrukResepFk")
	@Caption(value = "StrukResep")
	private StrukResep strukResep;

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

	@ManyToOne
	@Caption(value = "JenisKemasan")
	@JoinColumn(name = "JenisKemasanFK")
	private JenisKemasan jenisKemasan;

	@Column(name = "JenisKemasanFK", insertable = false, updatable = false, nullable = true)
	private Integer jenisKemasanId;

	@Column(name = "rKe", nullable = true)
	@Caption(value = "rKe")
	private String rKe;

	@JsonBackReference
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "pelayananPasien")
	private Set<PelayananPasienPetugas> pelayananPasienPetugasSet = new HashSet<>();

	@JsonBackReference
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "pelayananPasien")
	private Set<RacikanDetail> racikan = new HashSet<>();

	@JsonBackReference
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "pelayananPasien")
	private Set<PelayananPasienDetail> pelayananPasienDetailSet = new HashSet<>();

	public Generik getGenerik() {
		return generik;
	}

	public void setGenerik(Generik generik) {
		this.generik = generik;
	}

	public Integer getGenerikId() {
		return generikId;
	}

	public void setGenerikId(Integer generikId) {
		this.generikId = generikId;
	}

	public Byte getStatusOrder() {
		return statusOrder;
	}

	public void setStatusOrder(Byte statusOrder) {
		this.statusOrder = statusOrder;
	}

	public Double getJasa() {
		return jasa;
	}

	public void setJasa(Double jasa) {
		this.jasa = jasa;
	}

	public Kelas getKelas() {
		return kelas;
	}

	public void setKelas(Kelas kelas) {
		this.kelas = kelas;
	}

	public Integer getKelasId() {
		return kelasId;
	}

	public void setKelasId(Integer kelasId) {
		this.kelasId = kelasId;
	}

	public Boolean getIsPasien() {
		return isPasien;
	}

	public void setIsPasien(Boolean isPasien) {
		this.isPasien = isPasien;
	}

	public Boolean getIsObat() {
		return isObat;
	}

	public void setIsObat(Boolean isObat) {
		this.isObat = isObat;
	}

	public Boolean getIsDosis() {
		return isDosis;
	}

	public void setIsDosis(Boolean isDosis) {
		this.isDosis = isDosis;
	}

	public Boolean getIsRoute() {
		return isRoute;
	}

	public void setIsRoute(Boolean isRoute) {
		this.isRoute = isRoute;
	}

	public Boolean getIsDokumentasi() {
		return isDokumentasi;
	}

	public void setIsDokumentasi(Boolean isDokumentasi) {
		this.isDokumentasi = isDokumentasi;
	}

	public Boolean getIsWaktu() {
		return isWaktu;
	}

	public void setIsWaktu(Boolean isWaktu) {
		this.isWaktu = isWaktu;
	}

	public Boolean getIsInformasi() {
		return isInformasi;
	}

	public void setIsInformasi(Boolean isInformasi) {
		this.isInformasi = isInformasi;
	}

	public Boolean getIsBenar() {
		return isBenar;
	}

	public void setIsBenar(Boolean isBenar) {
		this.isBenar = isBenar;
	}

	public StrukPelayanan getStrukPelayanan() {
		return strukPelayanan;
	}

	public void setStrukPelayanan(StrukPelayanan strukPelayanan) {
		this.strukPelayanan = strukPelayanan;
	}

	public String getStrukFk() {
		return strukFk;
	}

	public void setStrukFk(String strukFk) {
		this.strukFk = strukFk;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Date getTglPelayanan() {
		return tglPelayanan;
	}

	public void setTglPelayanan(Date tglPelayanan) {
		this.tglPelayanan = tglPelayanan;
	}

	public Double getHargaSatuan() {
		return hargaSatuan;
	}

	public void setHargaSatuan(Double hargaSatuan) {
		this.hargaSatuan = hargaSatuan;
	}

	public Double getHargaJual() {
		return hargaJual;
	}

	public void setHargaJual(Double hargaJual) {
		this.hargaJual = hargaJual;
	}

	public Byte getNilaiNormal() {
		return nilaiNormal;
	}

	public void setNilaiNormal(Byte nilaiNormal) {
		this.nilaiNormal = nilaiNormal;
	}

	public Double getPiutangPenjamin() {
		return piutangPenjamin;
	}

	public void setPiutangPenjamin(Double piutangPenjamin) {
		this.piutangPenjamin = piutangPenjamin;
	}

	public Double getPiutangRumahSakit() {
		return piutangRumahSakit;
	}

	public void setPiutangRumahSakit(Double piutangRumahSakit) {
		this.piutangRumahSakit = piutangRumahSakit;
	}

	public StrukPelayananDNoBatch getNoBatch() {
		return noBatch;
	}

	public void setNoBatch(StrukPelayananDNoBatch noBatch) {
		this.noBatch = noBatch;
	}

	public String getNoBatchId() {
		return noBatchId;
	}

	public void setNoBatchId(String noBatchId) {
		this.noBatchId = noBatchId;
	}

	public StrukOrder getStrukOrder() {
		return strukOrder;
	}

	public void setStrukOrder(StrukOrder strukOrder) {
		this.strukOrder = strukOrder;
	}

	public String getStrukOrderId() {
		return strukOrderId;
	}

	public void setStrukOrderId(String strukOrderId) {
		this.strukOrderId = strukOrderId;
	}

	public JenisObat getJenisObat() {
		return jenisObat;
	}

	public void setJenisObat(JenisObat jenisObat) {
		this.jenisObat = jenisObat;
	}

	public Integer getJenisObatId() {
		return jenisObatId;
	}

	public void setJenisObatId(Integer jenisObatId) {
		this.jenisObatId = jenisObatId;
	}

	public Produk getProduk() {
		return produk;
	}

	public void setProduk(Produk produk) {
		this.produk = produk;
	}

	public Integer getProdukId() {
		return produkId;
	}

	public void setProdukId(Integer produkId) {
		this.produkId = produkId;
	}

	public Double getStock() {
		return stock;
	}

	public void setStock(Double stock) {
		this.stock = stock;
	}

	public Double getJumlah() {
		return jumlah;
	}

	public void setJumlah(Double jumlah) {
		this.jumlah = jumlah;
	}

	public String getAturanPakai() {
		return aturanPakai;
	}

	public void setAturanPakai(String aturanPakai) {
		this.aturanPakai = aturanPakai;
	}

	public RouteFarmasi getRoute() {
		return route;
	}

	public void setRoute(RouteFarmasi route) {
		this.route = route;
	}

	public Integer getRouteId() {
		return routeId;
	}

	public void setRouteId(Integer routeId) {
		this.routeId = routeId;
	}

	public Stigma getKeteranganPakai() {
		return keteranganPakai;
	}

	public void setKeteranganPakai(Stigma keteranganPakai) {
		this.keteranganPakai = keteranganPakai;
	}

	public Integer getKeteranganPakaiId() {
		return keteranganPakaiId;
	}

	public void setKeteranganPakaiId(Integer keteranganPakaiId) {
		this.keteranganPakaiId = keteranganPakaiId;
	}

	public String getKeteranganPakai2() {
		return keteranganPakai2;
	}

	public void setKeteranganPakai2(String keteranganPakai2) {
		this.keteranganPakai2 = keteranganPakai2;
	}

	public KelompokTransaksi getKelompokTransaksi() {
		return kelompokTransaksi;
	}

	public void setKelompokTransaksi(KelompokTransaksi kelompokTransaksi) {
		this.kelompokTransaksi = kelompokTransaksi;
	}

	public Integer getKelompokTransaksiId() {
		return kelompokTransaksiId;
	}

	public void setKelompokTransaksiId(Integer kelompokTransaksiId) {
		this.kelompokTransaksiId = kelompokTransaksiId;
	}

	public String getKeteranganLain() {
		return keteranganLain;
	}

	public void setKeteranganLain(String keteranganLain) {
		this.keteranganLain = keteranganLain;
	}

	public Double getHargaDiscount() {
		return hargaDiscount;
	}

	public void setHargaDiscount(Double hargaDiscount) {
		this.hargaDiscount = hargaDiscount;
	}

	public Double getHargaNetto() {
		return hargaNetto;
	}

	public void setHargaNetto(Double hargaNetto) {
		this.hargaNetto = hargaNetto;
	}

	public String getNoRecTriger() {
		return noRecTriger;
	}

	public void setNoRecTriger(String noRecTriger) {
		this.noRecTriger = noRecTriger;
	}

	public Set<PelayananPasienPetugas> getPelayananPasienPetugasSet() {
		return pelayananPasienPetugasSet;
	}

	public void setPelayananPasienPetugasSet(Set<PelayananPasienPetugas> pelayananPasienPetugasSet) {
		this.pelayananPasienPetugasSet = pelayananPasienPetugasSet;
	}

	public Set<RacikanDetail> getRacikan() {
		return racikan;
	}

	public void setRacikan(Set<RacikanDetail> racikan) {
		this.racikan = racikan;
	}

	public Set<PelayananPasienDetail> getPelayananPasienDetailSet() {
		return pelayananPasienDetailSet;
	}

	public void setPelayananPasienDetailSet(Set<PelayananPasienDetail> pelayananPasienDetailSet) {
		this.pelayananPasienDetailSet = pelayananPasienDetailSet;
	}

	public SatuanStandar getSatuanView() {
		return satuanView;
	}

	public void setSatuanView(SatuanStandar satuanView) {
		this.satuanView = satuanView;
	}

	public Integer getSatuanViewId() {
		return satuanViewId;
	}

	public void setSatuanViewId(Integer satuanViewId) {
		this.satuanViewId = satuanViewId;
	}

	public StrukResep getStrukResep() {
		return strukResep;
	}

	public void setStrukResep(StrukResep strukResep) {
		this.strukResep = strukResep;
	}

	public String getStrukResepId() {
		return strukResepId;
	}

	public void setStrukResepId(String strukResepId) {
		this.strukResepId = strukResepId;
	}

	public JenisKemasan getJenisKemasan() {
		return jenisKemasan;
	}

	public void setJenisKemasan(JenisKemasan jenisKemasan) {
		this.jenisKemasan = jenisKemasan;
	}

	public Integer getJenisKemasanId() {
		return jenisKemasanId;
	}

	public void setJenisKemasanId(Integer jenisKemasanId) {
		this.jenisKemasanId = jenisKemasanId;
	}

	public String getrKe() {
		return rKe;
	}

	public void setrKe(String rKe) {
		this.rKe = rKe;
	}

	public StrukPelayanan getStrukTerima() {
		return strukTerima;
	}

	public void setStrukTerima(StrukPelayanan strukTerima) {
		this.strukTerima = strukTerima;
	}

	public String getStrukTerimaId() {
		return strukTerimaId;
	}

	public void setStrukTerimaId(String strukTerimaId) {
		this.strukTerimaId = strukTerimaId;
	}

	public Float getNilaiKonversi() {
		return nilaiKonversi;
	}

	public void setNilaiKonversi(Float nilaiKonversi) {
		this.nilaiKonversi = nilaiKonversi;
	}

	public Float getDosis() {
		return dosis;
	}

	public void setDosis(Float dosis) {
		this.dosis = dosis;
	}
}