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

/**
 * class DokumenRekamMedis
 * 
 * @author Generator
 */
@Entity
@Table(name = "DokumenRekamMedis_T")
public class DokumenRekamMedis extends BaseTransaction {
	@ManyToOne
	@JoinColumn(name = "NoCMFk")
	@NotNull(message = "No C M Harus Diisi")
	@Caption(value = "No C M")
	private Pasien noCM;

	public Pasien getNoCM() {
		return noCM;
	}

	public void setNoCM(Pasien noCM) {
		this.noCM = noCM;
	}

	@Column(name = "NoCMFk", insertable = false, updatable = false)
	private Integer noCMId;

	@ManyToOne
	@JoinColumn(name = "NoKirimFk")
	@Caption(value = "No Kirim")
	private StrukKirim noKirim;

	public StrukKirim getNoKirim() {
		return noKirim;
	}

	public void setNoKirim(StrukKirim noKirim) {
		this.noKirim = noKirim;
	}

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

	@ManyToOne
	@JoinColumn(name = "NoTerimaFk")
	@Caption(value = "No Terima")
	private StrukPelayanan noTerima;

	public StrukPelayanan getNoTerima() {
		return noTerima;
	}

	public void setNoTerima(StrukPelayanan noTerima) {
		this.noTerima = noTerima;
	}

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

	@ManyToOne
	@JoinColumn(name = "NoDokumenFk")
	@NotNull(message = "No Dokumen Harus Diisi")
	@Caption(value = "No Dokumen")
	private Dokumen noDokumen;

	public Dokumen getNoDokumen() {
		return noDokumen;
	}

	public void setNoDokumen(Dokumen noDokumen) {
		this.noDokumen = noDokumen;
	}

	@Column(name = "NoDokumenFk", insertable = false, updatable = false)
	private Integer noDokumenId;

	@ManyToOne
	@JoinColumn(name = "RuanganTujuanFk")
	@NotNull(message = "Ruangan Tujuan Harus Diisi")
	@Caption(value = "Ruangan Tujuan")
	private Ruangan ruanganTujuan;

	public Ruangan getRuanganTujuan() {
		return ruanganTujuan;
	}

	public void setRuanganTujuan(Ruangan ruanganTujuan) {
		this.ruanganTujuan = ruanganTujuan;
	}

	@Column(name = "RuanganTujuanFk", insertable = false, updatable = false)
	private Integer ruanganTujuanId;

	@ManyToOne
	@JoinColumn(name = "RuanganAsalFk")
	@NotNull(message = "Ruangan Asal Harus Diisi")
	@Caption(value = "Ruangan Asal")
	private Ruangan ruanganAsal;

	public Ruangan getRuanganAsal() {
		return ruanganAsal;
	}

	public void setRuanganAsal(Ruangan ruanganAsal) {
		this.ruanganAsal = ruanganAsal;
	}

	@Column(name = "RuanganAsalFk", insertable = false, updatable = false)
	private Integer ruanganAsalId;

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

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

	public String getStatus() {
		return this.status;
	}

	// add by Arya 2017-02-09
	@JsonManagedReference
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "dokumenRekamMedis")
	private Set<MappingKirimDokumenPasien> mapKirimDokumenPasien = new HashSet<MappingKirimDokumenPasien>();
	// end add by Arya 2017-02-09

	public Set<MappingKirimDokumenPasien> getMapKirimDokumenPasien() {
		return mapKirimDokumenPasien;
	}

	public void setMapKirimDokumenPasien(Set<MappingKirimDokumenPasien> mapKirimDokumenPasien) {
		this.mapKirimDokumenPasien = mapKirimDokumenPasien;
	}

	// add by Arya 2017-02-16
	@ManyToOne
	@JoinColumn(name = "NoKirimReturnFk")
	@Caption(value = "No Kirim Return")
	private StrukKirim noKirim_Return;

	@Column(name = "NoKirimReturnFk", columnDefinition = "CHAR(32)", insertable = false, updatable = false, nullable=true)
	private String noKirim_ReturnId;
	// end add by Arya 2017-02-16

	public StrukKirim getNoKirim_Return() {
		return noKirim_Return;
	}

	public void setNoKirim_Return(StrukKirim noKirim_Return) {
		this.noKirim_Return = noKirim_Return;
	}

}