package com.jasamedika.medifirst2000.entities;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.jasamedika.medifirst2000.base.BaseTransaction;
import com.jasamedika.medifirst2000.helper.Caption;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;

import static javax.persistence.CascadeType.ALL;
import static javax.persistence.FetchType.LAZY;

@Getter
@Setter
@Entity
@Table(name = "GawatDarurat_T")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class GawatDarurat extends BaseTransaction {

	@ManyToOne(fetch = LAZY)
	@Caption(value = "Object AntrianPasien Di Periksa")
	@JoinColumn(name = "ObjectAntrianPasienDiPeriksaFk")
	private AntrianPasienDiPeriksa antrianPasienDiPeriksa;

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

	@ManyToOne(fetch = LAZY)
	@Caption(value = "skalaNyeri")
	@JoinColumn(name = "ObjectSkalaNyeriFk")
	private SkalaNyeri skalaNyeri;

	@Column(name = "ObjectSkalaNyeriFk", insertable = false, updatable = false)
	private Integer skalaNyeriId;

	@Column(name = "skorNyeri")
	@Caption(value = "skorNyeri")
	private Integer skorNyeri;

	@ManyToOne(fetch = LAZY)
	@Caption(value = "Jenis Nyeri")
	@JoinColumn(name = "ObjectJenisNyeriFk")
	private JenisNyeri jenisNyeri;

	@Column(name = "ObjectJenisNyeriFk", insertable = false, updatable = false)
	private Integer jenisNyeriId;

	@Caption(value = "lokasi")
	@Column(name = "lokasi")
	private String lokasi;

	@Caption(value = "durasi")
	@Column(name = "durasi")
	private String durasi;

	@Caption(value = "pencetus")
	@Column(name = "pencetus")
	private String pencetus;

	@ManyToOne(fetch = LAZY)
	@Caption(value = "Object Status Pasien")
	@JoinColumn(name = "ObjectStatusPasienFk")
	private DeathOnArrival statusPasien;

	@Column(name = "ObjectStatusPasienFk", insertable = false, updatable = false)
	private Integer statusPasienId;

	@ManyToOne(fetch = LAZY)
	@Caption(value = "Object Tanda Kehidupan")
	@JoinColumn(name = "ObjectTandaKehidupanFk")
	private TandaKehidupan tandaKehidupan;

	@Column(name = "ObjectTandaKehidupanFk", insertable = false, updatable = false)
	private Integer tandaKehidupanId;

	@Caption(value = "jam Penentuan Kematian")
	@Column(name = "jamPenentuanKematian")
	private String jamPenentuanKematian;

	@ManyToOne(fetch = LAZY)
	@Caption(value = "Object Psikologis")
	@JoinColumn(name = "ObjectPsikologisFk")
	private Psikologis psikologis;

	@Column(name = "ObjectPsikologisFk", insertable = false, updatable = false)
	private Integer psikologisId;

	@ManyToOne(fetch = LAZY)
	@Caption(value = "Object Resiko Jatuh")
	@JoinColumn(name = "ObjectResikoJatuhFk")
	private ResikoJatuh resikoJatuh;

	@Column(name = "ObjectResikoJatuhFk", insertable = false, updatable = false)
	private Integer resikoJatuhId;

	@Column(name = "skorResikoJatuh")
	@Caption(value = "skorResikoJatuh")
	private Integer skorResikoJatuh;

	@OneToMany(cascade = ALL, fetch = LAZY, mappedBy = "gawatDarurat")
	private Set<MapStatusImageToGawatDarurat> statusGambar = new HashSet<>();

	@OneToMany(cascade = ALL, fetch = LAZY, mappedBy = "gawatDarurat")
	private Set<MapStatusKeputusanToGawatDarurat> diputuskan = new HashSet<>();

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectDiagnosaKeperawatanFk")
	private DiagnosisKeperawatan diagnosaKeperawatan;

	@Column(name = "ObjectDiagnosaKeperawatanFk", insertable = false, updatable = false)
	private Integer diagnosaKeperawatanId;

	@Column(name = "isapLendir")
	@Caption(value = "isapLendir")
	private String isapLendir;

	@Column(name = "pasangOroPharsingAirway")
	@Caption(value = "pasangOroPharsingAirway")
	private String pasangOroPharsingAirway;

	@Column(name = "aturPosisi1")
	@Caption(value = "aturPosisi1")
	private String aturPosisi1;

	@Column(name = "aturPosisi2")
	@Caption(value = "aturPosisi2")
	private String aturPosisi2;

	@Column(name = "monitorIntakeOutput")
	@Caption(value = "monitorIntakeOutput")
	private String monitorIntakeOutput;

	@Column(name = "monitorTtvdanSp021")
	@Caption(value = "monitorTtvdanSp021")
	private String monitorTtvdanSp021;

	@Column(name = "monitorTtvdanSp022")
	@Caption(value = "monitorTtvdanSp022")
	private String monitorTtvdanSp022;

	@Column(name = "berikanOksigen1")
	@Caption(value = "berikanOksigen1")
	private String berikanOksigen1;

	@Column(name = "berikanOksigen2")
	@Caption(value = "berikanOksigen2")
	private String berikanOksigen2;

	@Column(name = "pasangInfus1")
	@Caption(value = "pasangInfus1")
	private String pasangInfus1;

	@Column(name = "pasangInfus2")
	@Caption(value = "pasangInfus2")
	private String pasangInfus2;

	@Column(name = "pasangEtt1")
	@Caption(value = "pasangEtt1")
	private String pasangEtt1;

	@Column(name = "pasangEtt2")
	@Caption(value = "pasangEtt2")
	private String pasangEtt2;

	@Column(name = "defibrasi1")
	@Caption(value = "defibrasi1")
	private String defibrasi1;

	@Column(name = "defibrasi2")
	@Caption(value = "defibrasi2")
	private String defibrasi2;

	@Column(name = "pemeriksaanLaboratorium")
	@Caption(value = "pemeriksaanLaboratorium")
	private String pemeriksaanLaboratorium;

	@Column(name = "pemberiObat")
	@Caption(value = "pemberiObat")
	private String pemberiObat;

	@Column(name = "lainnya")
	@Caption(value = "lainnya")
	private String lainnya;

	@Column(name = "skor")
	@Caption(value = "skor")
	private String skor;

	@ManyToOne(fetch = LAZY)
	@Caption(value = "Ruangan Perawat")
	@JoinColumn(name = "ObjectRuanganPerawatFk")
	private RuangPerawatanIGD ruanganPerawat;

	@Column(name = "ObjectRuanganPerawatFk", insertable = false, updatable = false)
	private Integer ruanganPerawatId;

}
