Update PasienService
Perbaikan simpan pasien baru bpjs dari mobile jkn, Pembuatan service get no cm
This commit is contained in:
parent
efe92e3a03
commit
a6194db854
@ -20,6 +20,7 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@ -665,15 +666,23 @@ public class BridgingDaftarOnlineController {
|
||||
public ResponseEntity<Object> saveNewPatient(@Valid @RequestBody PasienVO vo) {
|
||||
try {
|
||||
PasienVO result = pasienService.add(vo);
|
||||
if (null != result)
|
||||
return new ResponseEntity<>(true, HttpStatus.CREATED);
|
||||
if (result != null)
|
||||
return new ResponseEntity<>(result.getId(), HttpStatus.CREATED);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when add Pasien", e.getMessage());
|
||||
return new ResponseEntity<>(false, HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
return new ResponseEntity<>(null, HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when add Pasien", jse.getMessage());
|
||||
return new ResponseEntity<>(false, HttpStatus.CONFLICT);
|
||||
return new ResponseEntity<>(null, HttpStatus.CONFLICT);
|
||||
}
|
||||
return new ResponseEntity<>(false, HttpStatus.NOT_ACCEPTABLE);
|
||||
return new ResponseEntity<>(null, HttpStatus.NOT_ACCEPTABLE);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/bpjs/patient/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Object> getPatientMedicalRecordId(@PathVariable Integer id) {
|
||||
PasienVO result = pasienService.findById(id);
|
||||
if (result != null)
|
||||
return new ResponseEntity<>(result.getNoCm(), HttpStatus.OK);
|
||||
return new ResponseEntity<>(result, HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,6 +96,9 @@ public class PasienServiceImpl extends BaseVoServiceImpl implements PasienServic
|
||||
@Autowired
|
||||
private PasienDaoCustom pasienDaoCustom;
|
||||
|
||||
@Autowired
|
||||
private BaseConverterImpl<PasienVO, Pasien> converterPasien;
|
||||
|
||||
@Autowired
|
||||
private PasienConverter pasienConverter;
|
||||
|
||||
@ -177,28 +180,30 @@ public class PasienServiceImpl extends BaseVoServiceImpl implements PasienServic
|
||||
if (CommonUtil.isNotNullOrEmpty(vo.getStatusPerkawinan()))
|
||||
pasien.setStatusPerkawinan(
|
||||
statusPerkawinanConverter.transferVOToModel(vo.getStatusPerkawinan(), new StatusPerkawinan()));
|
||||
List<Alamat> listAlamat = new ArrayList<Alamat>();
|
||||
for (AlamatVO alamatVo : vo.getAlamats()) {
|
||||
Alamat alamat = new Alamat();
|
||||
alamat = alamatConverter.transferVOToModel(alamatVo, new Alamat());
|
||||
if (CommonUtil.isNotNullOrEmpty(alamatVo.getJenisAlamat()))
|
||||
alamat.setJenisAlamat(jenisAlamatConverter.transferVOToModel(alamatVo.getJenisAlamat(), new JenisAlamat()));
|
||||
if (CommonUtil.isNotNullOrEmpty(alamatVo.getPropinsi()))
|
||||
alamat.setPropinsi(propinsiConverter.transferVOToModel(alamatVo.getPropinsi(), new Propinsi()));
|
||||
if (CommonUtil.isNotNullOrEmpty(alamatVo.getNegara()))
|
||||
alamat.setNegara(negaraConverter.transferVOToModel(alamatVo.getNegara(), new Negara()));
|
||||
if (CommonUtil.isNotNullOrEmpty(alamatVo.getRekanan()))
|
||||
alamat.setRekanan(rekananConverter.transferVOToModel(alamatVo.getRekanan(), new Rekanan()));
|
||||
if (CommonUtil.isNotNullOrEmpty(alamatVo.getPegawai()))
|
||||
alamat.setPegawai(loginUserConverter.transferVOToModel(alamatVo.getPegawai(), new LoginUser()));
|
||||
alamat.setPasien(pasien);
|
||||
listAlamat.add(alamat);
|
||||
}
|
||||
if (listAlamat.size() > 0)
|
||||
pasien.getAlamats().addAll(listAlamat);
|
||||
Pasien resultModel = pasienDao.save(pasien);
|
||||
if (CommonUtil.isNotNullOrEmpty(resultModel.getId())) {
|
||||
List<Alamat> listAlamat = new ArrayList<Alamat>();
|
||||
for (AlamatVO alamatVo : vo.getAlamats()) {
|
||||
Alamat alamat = new Alamat();
|
||||
alamat = alamatConverter.transferVOToModel(alamatVo, new Alamat());
|
||||
if (CommonUtil.isNotNullOrEmpty(alamatVo.getJenisAlamat()))
|
||||
alamat.setJenisAlamat(
|
||||
jenisAlamatConverter.transferVOToModel(alamatVo.getJenisAlamat(), new JenisAlamat()));
|
||||
if (CommonUtil.isNotNullOrEmpty(alamatVo.getPropinsi()))
|
||||
alamat.setPropinsi(propinsiConverter.transferVOToModel(alamatVo.getPropinsi(), new Propinsi()));
|
||||
if (CommonUtil.isNotNullOrEmpty(alamatVo.getNegara()))
|
||||
alamat.setNegara(negaraConverter.transferVOToModel(alamatVo.getNegara(), new Negara()));
|
||||
if (CommonUtil.isNotNullOrEmpty(alamatVo.getRekanan()))
|
||||
alamat.setRekanan(rekananConverter.transferVOToModel(alamatVo.getRekanan(), new Rekanan()));
|
||||
if (CommonUtil.isNotNullOrEmpty(alamatVo.getPegawai()))
|
||||
alamat.setPegawai(loginUserConverter.transferVOToModel(alamatVo.getPegawai(), new LoginUser()));
|
||||
alamat.setPasien(resultModel);
|
||||
listAlamat.add(alamat);
|
||||
}
|
||||
alamatDao.save(listAlamat);
|
||||
}
|
||||
PasienVO resultVo = new PasienVO();
|
||||
pasienConverter.transferModelToVO(resultModel, resultVo);
|
||||
resultVo = converterPasien.transferModelToVO(resultModel, resultVo);
|
||||
return resultVo;
|
||||
}
|
||||
|
||||
@ -216,47 +221,18 @@ public class PasienServiceImpl extends BaseVoServiceImpl implements PasienServic
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public PasienVO findById(Integer key) throws JpaSystemException {
|
||||
Pasien pasien = pasienDao.findOne(key);
|
||||
if (pasien == null) {
|
||||
if (pasien == null)
|
||||
return null;
|
||||
}
|
||||
PasienVO pasienVO = new PasienVO();
|
||||
|
||||
pasienConverter.transferModelToVO(pasien, pasienVO);
|
||||
pasienVO = converterPasien.transferModelToVO(pasien, pasienVO);
|
||||
return pasienVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public List<PasienVO> findAll()
|
||||
throws JpaSystemException {/*
|
||||
*
|
||||
* List<Pasien> pasienList =
|
||||
* pasienDaoCustom.findAllPasien();
|
||||
*
|
||||
* List<PasienVO> pasienVOList = new
|
||||
* ArrayList<PasienVO>(); for (Pasien
|
||||
* pasien : pasienList) { PasienVO vo =
|
||||
* new PasienVO();
|
||||
* vo=pasienConverter.transferModelToVO(
|
||||
* pasien, vo); List<AlamatVO>
|
||||
* listvo=new ArrayList<AlamatVO>();
|
||||
* for(Alamat
|
||||
* alamat:pasien.getAlamats()){
|
||||
*
|
||||
* listvo.add(alamatConverter.
|
||||
* transferModelToVO(alamat, new
|
||||
* AlamatVO()));
|
||||
*
|
||||
* } vo.getAlamats().addAll(listvo);
|
||||
* pasienVOList.add(vo); }
|
||||
*
|
||||
* return pasienVOList;
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<PasienVO> findAll() throws JpaSystemException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -289,14 +265,7 @@ public class PasienServiceImpl extends BaseVoServiceImpl implements PasienServic
|
||||
public String generatePasienCM() {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<String> nocmList = IteratorUtils.toList(pasienDao.findAllNoCm().iterator());
|
||||
// String noCM =pasienDao.MaxNoCm(8);
|
||||
// generate cari no yang hilang
|
||||
String missNoCm = getCM(nocmList, 8);
|
||||
// if(missNoCm.equals(noCM))
|
||||
// {
|
||||
// Integer maxNoCm=Integer.parseInt(missNoCm)+1;
|
||||
// missNoCm = StringUtil.formatNumber(maxNoCm.toString(), 8);
|
||||
// }
|
||||
return missNoCm;
|
||||
}
|
||||
|
||||
@ -350,18 +319,13 @@ public class PasienServiceImpl extends BaseVoServiceImpl implements PasienServic
|
||||
|
||||
Date startDate = null;
|
||||
Date endDate = null;
|
||||
// Date birthDate = null;
|
||||
if (CommonUtil.isNotNullOrEmpty(dateStart)) {
|
||||
startDate = DateUtil.toDate(dateStart);
|
||||
}
|
||||
if (CommonUtil.isNotNullOrEmpty(dateEnd)) {
|
||||
endDate = DateUtil.toDate(dateEnd);
|
||||
}
|
||||
// if (CommonUtil.isNotNullOrEmpty(tanggalLahir)) {
|
||||
// birthDate = DateUtil.toDate(tanggalLahir);
|
||||
// }
|
||||
int totalRow = 0;// pasienDaoCustom.findAllPasienPagingCount(startDate,
|
||||
// endDate, noCm, namaIbu, birthDate);
|
||||
int totalRow = 0;
|
||||
int totalPages = 0;
|
||||
|
||||
int pageRequested = page;
|
||||
@ -423,83 +387,6 @@ public class PasienServiceImpl extends BaseVoServiceImpl implements PasienServic
|
||||
return constructMapReturn(gridPasienVoList, totalRow, totalPages);
|
||||
}
|
||||
|
||||
/*
|
||||
* @Override
|
||||
*
|
||||
* @Transactional(readOnly=true) public Map<String, Object>
|
||||
* findByNoCmAndTglLahir(Integer page, Integer limit, String sort, String
|
||||
* dir, String noCm,String dateStart, String dateEnd, String tanggalLahir,
|
||||
* String namaAyah) { Map<String, Object> result = new HashMap<>();
|
||||
*
|
||||
* Date startDate = null; Date endDate = null; Date birthDate = null; if
|
||||
* (CommonUtil.isNotNullOrEmpty(dateStart)) { startDate =
|
||||
* DateUtil.toDate(dateStart); } if (CommonUtil.isNotNullOrEmpty(dateEnd)) {
|
||||
* endDate = DateUtil.toDate(dateEnd); } if
|
||||
* (CommonUtil.isNotNullOrEmpty(tanggalLahir)) { birthDate =
|
||||
* DateUtil.toDate(tanggalLahir); } int totalRow = 0;//
|
||||
* pasienDaoCustom.findAllPasienPagingCount(startDate, // endDate, noCm,
|
||||
* namaIbu, birthDate); int totalPages = 0;
|
||||
*
|
||||
* int pageRequested = page;
|
||||
*
|
||||
* if (totalRow > 0) { totalPages = (int) Math.ceil((double) totalRow /
|
||||
* (double) limit); } else { totalPages = 0; }
|
||||
*
|
||||
* if (pageRequested > totalPages) pageRequested = totalPages; int rowStart
|
||||
* = pageRequested * limit - limit; if (rowStart < 0) { rowStart = 0; } int
|
||||
* rowEnd = limit; List<Pasien> pasienList =
|
||||
* pasienDaoCustom.findAllPasienPagingList(rowStart, rowEnd, startDate,
|
||||
* endDate, noCm, namaAyah, birthDate);
|
||||
*
|
||||
* List<GridPasienVO> gridPasienVoList = new ArrayList<GridPasienVO>(); for
|
||||
* (Pasien pasien : pasienList) { GridPasienVO gridPasienVO = new
|
||||
* GridPasienVO();
|
||||
*
|
||||
* if(CommonUtil.isNotNullOrEmpty(pasien.getJenisKelamin())) {
|
||||
* JenisKelaminVO jeniskelamin = new JenisKelaminVO();
|
||||
*
|
||||
* if(CommonUtil.isNotNullOrEmpty(pasien.getJenisKelamin().getId())) {
|
||||
* jeniskelamin.setId(pasien.getJenisKelamin().getId()); }
|
||||
* if(CommonUtil.isNotNullOrEmpty(pasien.getJenisKelamin().getJenisKelamin()
|
||||
* )) {
|
||||
* jeniskelamin.setJenisKelamin(pasien.getJenisKelamin().getJenisKelamin());
|
||||
* } if(CommonUtil.isNotNullOrEmpty(jeniskelamin)) {
|
||||
* gridPasienVO.setJenisKelamin(jeniskelamin); } }
|
||||
* if(CommonUtil.isNotNullOrEmpty(pasien.getNoCm())) {
|
||||
* gridPasienVO.setNoCm(pasien.getNoCm()); }
|
||||
* if(CommonUtil.isNotNullOrEmpty(pasien.getTglDaftar())) {
|
||||
* gridPasienVO.setTglDaftar(pasien.getTglDaftar()); }
|
||||
* if(CommonUtil.isNotNullOrEmpty(pasien.getTglLahir())) {
|
||||
* gridPasienVO.setTglLahir(pasien.getTglLahir()); }
|
||||
* if(CommonUtil.isNotNullOrEmpty(pasien.getNamaAyah())) {
|
||||
* gridPasienVO.setNamaAyah(pasien.getNamaAyah()); }
|
||||
* if(CommonUtil.isNotNullOrEmpty(pasien.getNamaPasien())) {
|
||||
* gridPasienVO.setNamaLengkap(pasien.getNamaPasien()); } if
|
||||
* (CommonUtil.isNotNullOrEmpty(pasien.getTglLahir())) { Age age =
|
||||
* AgeCalculator.calculateAge(pasien.getTglLahir()); if
|
||||
* (CommonUtil.isNotNullOrEmpty(age)) {
|
||||
* gridPasienVO.setUmur(age.toString()); } }
|
||||
* if(CommonUtil.isNotNullOrEmpty(gridPasienVO)) {
|
||||
* gridPasienVoList.add(gridPasienVO); }
|
||||
*
|
||||
* Set<AlamatVO>alamatsvo = new HashSet<>(); for(Alamat alamat :
|
||||
* alamatDao.findAlamatByIdPasien(pasien.getId())){ AlamatVO alamatVO = new
|
||||
* AlamatVO();
|
||||
*
|
||||
* if(CommonUtil.isNotNullOrEmpty(alamat.getId())) {
|
||||
* alamatVO.setId(alamat.getId()); }
|
||||
* if(CommonUtil.isNotNullOrEmpty(alamat.getAlamatLengkap())) {
|
||||
* alamatVO.setAlamatLengkap(alamat.getAlamatLengkap()); }
|
||||
* if(CommonUtil.isNotNullOrEmpty(alamatVO)) { alamatsvo.add(alamatVO); } }
|
||||
* if(CommonUtil.isNotNullOrEmpty(alamatsvo)) {
|
||||
* gridPasienVO.setAlamats(alamatsvo); } }
|
||||
*
|
||||
* if(CommonUtil.isNotNullOrEmpty(gridPasienVoList)) { result.put("data",
|
||||
* gridPasienVoList); }
|
||||
*
|
||||
* return result; }
|
||||
*/
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public PasienVO findByNoCm(String key) throws JpaSystemException {
|
||||
@ -516,11 +403,6 @@ public class PasienServiceImpl extends BaseVoServiceImpl implements PasienServic
|
||||
Set<AlamatVO> alamats = new HashSet<AlamatVO>();
|
||||
try {
|
||||
Alamat alamat = alamatDao.findAlamatByPasienId(pasien.getId());
|
||||
// baseAlamatController.setUseGson(true);
|
||||
// AlamatVO alamatVo =
|
||||
// baseAlamatController.transferModelToVO(alamat, new AlamatVO());
|
||||
// alamats.add(alamatVo);
|
||||
// pasienVO.setAlamats(alamats);
|
||||
|
||||
AlamatVO alamatVo = new AlamatVO();
|
||||
if (CommonUtil.isNotNullOrEmpty(alamat.getKodePos())) {
|
||||
@ -618,8 +500,6 @@ public class PasienServiceImpl extends BaseVoServiceImpl implements PasienServic
|
||||
String missNoCm = StringUtil.formatNumber(number.toString(), 8);
|
||||
// want to edit by askur 03012017
|
||||
pasien.setNoCm(missNoCm);
|
||||
// pasien.setNoCm(generateNumberService.generatePasienCM());
|
||||
//
|
||||
|
||||
pasien.setNoIdentitas(vo.getNoIdentitas());
|
||||
pasien = pasienDao.save(pasien);
|
||||
@ -637,14 +517,11 @@ public class PasienServiceImpl extends BaseVoServiceImpl implements PasienServic
|
||||
|
||||
@Override
|
||||
public Pasien findPasienById(Integer key) {
|
||||
// List modelResult = new ArrayList();
|
||||
|
||||
Pasien model = pasienDao.findOne(key);
|
||||
// String umur = "";
|
||||
if (CommonUtil.isNotNullOrEmpty(model.getTglLahir())) {
|
||||
Age age = AgeCalculator.calculateAge(model.getTglLahir());
|
||||
if (CommonUtil.isNotNullOrEmpty(age)) {
|
||||
// umur = age.toString();
|
||||
model.setUmur(new SimpleDateFormat("dd-MM-yyyy").format(model.getTglLahir()));
|
||||
}
|
||||
|
||||
@ -678,17 +555,6 @@ public class PasienServiceImpl extends BaseVoServiceImpl implements PasienServic
|
||||
PasienVO pasienVO = new PasienVO();
|
||||
|
||||
pasienVO = pasienConverter.transferModelToVO(pasien, pasienVO);
|
||||
// Set<AlamatVO> alamats = new HashSet<AlamatVO>();
|
||||
try {
|
||||
// Alamat alamat = alamatDao.findAlamatByPasienId(pasien.getId());
|
||||
// baseAlamatController.setUseGson(true);
|
||||
// AlamatVO alamatVo =
|
||||
// baseAlamatController.transferModelToVO(alamat, new AlamatVO());
|
||||
// alamats.add(alamatVo);
|
||||
// pasienVO.setAlamats(alamats);
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
|
||||
return pasienVO;
|
||||
}
|
||||
@ -714,11 +580,6 @@ public class PasienServiceImpl extends BaseVoServiceImpl implements PasienServic
|
||||
Set<AlamatVO> alamats = new HashSet<AlamatVO>();
|
||||
try {
|
||||
Alamat alamat = alamatDao.findAlamatByPasienId(pasien.getId());
|
||||
// baseAlamatController.setUseGson(true);
|
||||
// AlamatVO alamatVo =
|
||||
// baseAlamatController.transferModelToVO(alamat, new AlamatVO());
|
||||
// alamats.add(alamatVo);
|
||||
// pasienVO.setAlamats(alamats);
|
||||
|
||||
AlamatVO alamatVo = new AlamatVO();
|
||||
if (CommonUtil.isNotNullOrEmpty(alamat.getKodePos())) {
|
||||
|
||||
@ -3,217 +3,238 @@ 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.EntityListeners;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import org.hibernate.annotations.Generated;
|
||||
import org.hibernate.annotations.GenerationTime;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonBackReference;
|
||||
import com.fasterxml.jackson.annotation.JsonManagedReference;
|
||||
import com.jasamedika.medifirst2000.base.BaseMasterPasien;
|
||||
import com.jasamedika.medifirst2000.base.BaseMaster;
|
||||
import com.jasamedika.medifirst2000.helper.Caption;
|
||||
import com.jasamedika.medifirst2000.listener.MyEventListener;
|
||||
import com.jasamedika.medifirst2000.util.Age;
|
||||
import com.jasamedika.medifirst2000.util.AgeCalculator;
|
||||
|
||||
@Entity
|
||||
@EntityListeners(value = { MyEventListener.class } )
|
||||
@EntityListeners(value = { MyEventListener.class })
|
||||
@Table(name = "Pasien_M")
|
||||
public class Pasien extends BaseMasterPasien {
|
||||
|
||||
public class Pasien extends BaseMaster {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "public.pasien_m_id_seq")
|
||||
@SequenceGenerator(name = "public.pasien_m_id_seq", sequenceName = "public.pasien_m_id_seq", allocationSize = 1)
|
||||
@Column(name = "id")
|
||||
protected Integer id;
|
||||
|
||||
@Transient
|
||||
private String umur;
|
||||
|
||||
@Column(name = "TglMeninggal", nullable = true )
|
||||
@Caption(value="Tanggal Meninggal")
|
||||
@Column(name = "TglMeninggal", nullable = true)
|
||||
@Caption(value = "Tanggal Meninggal")
|
||||
private Date tanggalMeninggal;
|
||||
|
||||
@ManyToOne(fetch=FetchType.LAZY)
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "DokumenRekamMedis")
|
||||
@Caption(value="DokumenRekamMedis")
|
||||
@Caption(value = "DokumenRekamMedis")
|
||||
private Dokumen dokumenRekamMedis;
|
||||
|
||||
@Column(name = "DokumenRekamMedis", insertable=false,updatable=false,nullable=true)
|
||||
@Column(name = "DokumenRekamMedis", insertable = false, updatable = false, nullable = true)
|
||||
private Integer dokumenRekamMedisId;
|
||||
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "ObjectAgamaFk")
|
||||
@Caption(value="Object Agama")
|
||||
@Caption(value = "Object Agama")
|
||||
private Agama agama;
|
||||
|
||||
@Column(name = "ObjectAgamaFk", insertable=false,updatable=false)
|
||||
@Column(name = "ObjectAgamaFk", insertable = false, updatable = false)
|
||||
private Integer agamaId;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "ObjectGolonganDarahFk")
|
||||
@Caption(value="Object Golongan Darah")
|
||||
@Caption(value = "Object Golongan Darah")
|
||||
private GolonganDarah golonganDarah;
|
||||
|
||||
@Column(name = "ObjectGolonganDarahFk", insertable=false,updatable=false)
|
||||
@Column(name = "ObjectGolonganDarahFk", insertable = false, updatable = false)
|
||||
private Integer golonganDarahId;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "ObjectJenisKelaminFk")
|
||||
@Caption(value="Object Jenis Kelamin")
|
||||
@Caption(value = "Object Jenis Kelamin")
|
||||
private JenisKelamin jenisKelamin;
|
||||
|
||||
@Column(name = "ObjectJenisKelaminFk", insertable=false,updatable=false)
|
||||
|
||||
@Column(name = "ObjectJenisKelaminFk", insertable = false, updatable = false)
|
||||
private Integer jenisKelaminId;
|
||||
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "ObjectPekerjaanFk")
|
||||
@Caption(value="Object Pekerjaan")
|
||||
@Caption(value = "Object Pekerjaan")
|
||||
private Pekerjaan pekerjaan;
|
||||
|
||||
@Column(name = "ObjectPekerjaanFk", insertable=false,updatable=false)
|
||||
@Column(name = "ObjectPekerjaanFk", insertable = false, updatable = false)
|
||||
private Integer pekerjaanId;
|
||||
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "ObjectNegaraFk")
|
||||
@Caption(value="Object Negara")
|
||||
@Caption(value = "Object Negara")
|
||||
private Negara negara;
|
||||
|
||||
@Column(name = "ObjectNegaraFk", insertable=false,updatable=false,nullable=true)
|
||||
@Column(name = "ObjectNegaraFk", insertable = false, updatable = false, nullable = true)
|
||||
private Integer negaraId;
|
||||
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "ObjectKebangsaanFk")
|
||||
@Caption(value="Object kebangsaan")
|
||||
@Caption(value = "Object kebangsaan")
|
||||
private Kebangsaan kebangsaan;
|
||||
|
||||
@Column(name = "ObjectKebangsaanFk", insertable=false,updatable=false,nullable=true)
|
||||
@Column(name = "ObjectKebangsaanFk", insertable = false, updatable = false, nullable = true)
|
||||
private Integer kebangsaanId;
|
||||
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "ObjectPendidikanFk")
|
||||
@Caption(value="Object Pendidikan")
|
||||
@Caption(value = "Object Pendidikan")
|
||||
private Pendidikan pendidikan;
|
||||
|
||||
@Column(name = "ObjectPendidikanFk", insertable=false,updatable=false,nullable=false)
|
||||
@Column(name = "ObjectPendidikanFk", insertable = false, updatable = false, nullable = false)
|
||||
private Integer pendidikanId;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "ObjectStatusPerkawinanFk")
|
||||
@Caption(value="Object Status Perkawinan")
|
||||
@Caption(value = "Object Status Perkawinan")
|
||||
private StatusPerkawinan statusPerkawinan;
|
||||
|
||||
@Column(name = "ObjectStatusPerkawinanFk", insertable=false,updatable=false,nullable=false)
|
||||
@Column(name = "ObjectStatusPerkawinanFk", insertable = false, updatable = false, nullable = false)
|
||||
private Integer statusPerkawinanId;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "ObjectTitleFk")
|
||||
@Caption(value="Object Title")
|
||||
@Caption(value = "Object Title")
|
||||
private TitlePasien titlePasien;
|
||||
|
||||
@Column(name = "ObjectTitleFk", insertable=false,updatable=false)
|
||||
@Column(name = "ObjectTitleFk", insertable = false, updatable = false)
|
||||
private Integer titlePasienId;
|
||||
|
||||
@NotNull(message="Nama Pasien tidak boleh kosong")
|
||||
@Column(name = "NamaPasien", nullable = false , length = 40)
|
||||
@Caption(value="Nama Pasien")
|
||||
|
||||
@NotNull(message = "Nama Pasien tidak boleh kosong")
|
||||
@Column(name = "NamaPasien", nullable = false, length = 40)
|
||||
@Caption(value = "Nama Pasien")
|
||||
private String namaPasien;
|
||||
|
||||
@Column(name = "NamaIbu", nullable = true , length = 40)
|
||||
@Caption(value="Nama Ibu")
|
||||
|
||||
@Column(name = "NamaIbu", nullable = true, length = 40)
|
||||
@Caption(value = "Nama Ibu")
|
||||
private String namaIbu;
|
||||
|
||||
@Column(name = "NamaAyah", nullable = true , length = 40)
|
||||
@Caption(value="Nama Ayah")
|
||||
|
||||
@Column(name = "NamaAyah", nullable = true, length = 40)
|
||||
@Caption(value = "Nama Ayah")
|
||||
private String namaAyah;
|
||||
|
||||
@Column(name = "namaKeluarga", nullable = true , length = 40)
|
||||
@Caption(value="namaKeluarga")
|
||||
|
||||
@Column(name = "namaKeluarga", nullable = true, length = 40)
|
||||
@Caption(value = "namaKeluarga")
|
||||
private String namaKeluarga;
|
||||
|
||||
@Column(name = "NamaSuamiIstri", nullable = true , length = 40)
|
||||
@Caption(value="Nama Suami/Istri")
|
||||
|
||||
@Column(name = "NamaSuamiIstri", nullable = true, length = 40)
|
||||
@Caption(value = "Nama Suami/Istri")
|
||||
private String namaSuamiIstri;
|
||||
|
||||
@Column(name = "NoTelepon", nullable = true , length = 40)
|
||||
@Caption(value="No Telepon")
|
||||
|
||||
@Column(name = "NoTelepon", nullable = true, length = 40)
|
||||
@Caption(value = "No Telepon")
|
||||
private String noTelepon;
|
||||
|
||||
@Column(name = "noCm", nullable = true , length = 10,unique=true)
|
||||
@Caption(value="No C M")
|
||||
|
||||
@Generated(GenerationTime.INSERT)
|
||||
@Column(name = "noCm")
|
||||
@Caption(value = "No C M")
|
||||
private String noCm;
|
||||
|
||||
@Column(name = "QPasien", nullable = true )
|
||||
@Caption(value="QPasien")
|
||||
|
||||
@Column(name = "QPasien", nullable = true)
|
||||
@Caption(value = "QPasien")
|
||||
private Integer qPasien;
|
||||
|
||||
@NotNull(message="Tgl Daftar tidak boleh kosong")
|
||||
@Column(name = "TglDaftar", nullable = false )
|
||||
@Caption(value="Tanggal Daftar")
|
||||
@NotNull(message = "Tgl Daftar tidak boleh kosong")
|
||||
@Column(name = "TglDaftar", nullable = false)
|
||||
@Caption(value = "Tanggal Daftar")
|
||||
private Date tglDaftar;
|
||||
|
||||
@Column(name = "TglLahir", nullable = true )
|
||||
@Caption(value="Tanggal Lahir")
|
||||
@Column(name = "TglLahir", nullable = true)
|
||||
@Caption(value = "Tanggal Lahir")
|
||||
private Date tglLahir;
|
||||
|
||||
@JsonManagedReference
|
||||
@OneToMany(cascade=CascadeType.ALL,fetch = FetchType.LAZY, mappedBy = "pasien")
|
||||
|
||||
@OneToMany(fetch = FetchType.LAZY, mappedBy = "pasien")
|
||||
private Set<Alamat> alamats = new HashSet<Alamat>();
|
||||
|
||||
@JsonBackReference
|
||||
@OneToMany(cascade=CascadeType.ALL,fetch = FetchType.LAZY, mappedBy = "pasien")
|
||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "pasien")
|
||||
private Set<CatatanPasien> catatanPasien = new HashSet<CatatanPasien>();
|
||||
|
||||
@JsonBackReference
|
||||
@OneToMany(cascade=CascadeType.ALL,fetch = FetchType.LAZY, mappedBy = "pasien")
|
||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "pasien")
|
||||
private Set<AntrianPasienRegistrasi> antrianPasienRegistrasis = new HashSet<AntrianPasienRegistrasi>();
|
||||
|
||||
|
||||
@Column(name = "noIdentitas")
|
||||
@Caption(value="NoIdentitas")
|
||||
@Caption(value = "NoIdentitas")
|
||||
private String noIdentitas;
|
||||
|
||||
@Column(name = "Paspor", nullable = true )
|
||||
@Caption(value="Paspor")
|
||||
|
||||
@Column(name = "Paspor", nullable = true)
|
||||
@Caption(value = "Paspor")
|
||||
private String paspor;
|
||||
|
||||
@Column(name = "NoAditional", nullable = true )
|
||||
@Caption(value="noAditional")
|
||||
|
||||
@Column(name = "NoAditional", nullable = true)
|
||||
@Caption(value = "noAditional")
|
||||
private String noAditional;
|
||||
|
||||
@Column(name = "namaDepan", nullable = true )
|
||||
@Caption(value="namaDepan")
|
||||
@Column(name = "namaDepan", nullable = true)
|
||||
@Caption(value = "namaDepan")
|
||||
private String namaDepan;
|
||||
|
||||
@Column(name = "namaBelakang", nullable = true )
|
||||
@Caption(value="namaBelakang")
|
||||
@Column(name = "namaBelakang", nullable = true)
|
||||
@Caption(value = "namaBelakang")
|
||||
private String namaBelakang;
|
||||
|
||||
@Column(name = "TempatLahir", nullable = true )
|
||||
@Caption(value="Tempat Lahir")
|
||||
@Column(name = "TempatLahir", nullable = true)
|
||||
@Caption(value = "Tempat Lahir")
|
||||
private String tempatLahir;
|
||||
|
||||
@Column(name = "NoBpjs", nullable = true )
|
||||
@Caption(value="No Bpjs")
|
||||
|
||||
@Column(name = "NoBpjs", nullable = true)
|
||||
@Caption(value = "No Bpjs")
|
||||
private String noBpjs;
|
||||
|
||||
@Column(name = "NoAsuransiLain", nullable = true )
|
||||
@Caption(value="No AsuransiLain")
|
||||
|
||||
@Column(name = "NoAsuransiLain", nullable = true)
|
||||
@Caption(value = "No AsuransiLain")
|
||||
private String noAsuransiLain;
|
||||
|
||||
@Column(name = "NoHp", nullable = true )
|
||||
@Caption(value="No Hp")
|
||||
|
||||
@Column(name = "NoHp", nullable = true)
|
||||
@Caption(value = "No Hp")
|
||||
private String noHp;
|
||||
|
||||
@Column(name = "JamLahir", nullable = true )
|
||||
@Caption(value="JamLahir")
|
||||
|
||||
@Column(name = "JamLahir", nullable = true)
|
||||
@Caption(value = "JamLahir")
|
||||
private Date jamLahir;
|
||||
|
||||
public Date getTglLahir() {
|
||||
// Age age = AgeCalculator.calculateAge(tglLahir);
|
||||
// this.umur = age.toString();
|
||||
return tglLahir;
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Date getTglLahir() {
|
||||
// Age age = AgeCalculator.calculateAge(tglLahir);
|
||||
// this.umur = age.toString();
|
||||
return tglLahir;
|
||||
}
|
||||
|
||||
public void setTglLahir(Date tglLahir) {
|
||||
this.tglLahir = tglLahir;
|
||||
@ -221,442 +242,354 @@ public class Pasien extends BaseMasterPasien {
|
||||
this.umur = age.toString();
|
||||
}
|
||||
|
||||
|
||||
public String getUmur() {
|
||||
return umur;
|
||||
}
|
||||
|
||||
|
||||
public void setUmur(String umur) {
|
||||
this.umur = umur;
|
||||
}
|
||||
|
||||
|
||||
public Date getTanggalMeninggal() {
|
||||
return tanggalMeninggal;
|
||||
}
|
||||
|
||||
|
||||
public void setTanggalMeninggal(Date tanggalMeninggal) {
|
||||
this.tanggalMeninggal = tanggalMeninggal;
|
||||
}
|
||||
|
||||
|
||||
public Dokumen getDokumenRekamMedis() {
|
||||
return dokumenRekamMedis;
|
||||
}
|
||||
|
||||
|
||||
public void setDokumenRekamMedis(Dokumen dokumenRekamMedis) {
|
||||
this.dokumenRekamMedis = dokumenRekamMedis;
|
||||
}
|
||||
|
||||
|
||||
public Integer getDokumenRekamMedisId() {
|
||||
return dokumenRekamMedisId;
|
||||
}
|
||||
|
||||
|
||||
public void setDokumenRekamMedisId(Integer dokumenRekamMedisId) {
|
||||
this.dokumenRekamMedisId = dokumenRekamMedisId;
|
||||
}
|
||||
|
||||
|
||||
public Agama getAgama() {
|
||||
return agama;
|
||||
}
|
||||
|
||||
|
||||
public void setAgama(Agama agama) {
|
||||
this.agama = agama;
|
||||
}
|
||||
|
||||
|
||||
public Integer getAgamaId() {
|
||||
return agamaId;
|
||||
}
|
||||
|
||||
|
||||
public void setAgamaId(Integer agamaId) {
|
||||
this.agamaId = agamaId;
|
||||
}
|
||||
|
||||
|
||||
public GolonganDarah getGolonganDarah() {
|
||||
return golonganDarah;
|
||||
}
|
||||
|
||||
|
||||
public void setGolonganDarah(GolonganDarah golonganDarah) {
|
||||
this.golonganDarah = golonganDarah;
|
||||
}
|
||||
|
||||
|
||||
public Integer getGolonganDarahId() {
|
||||
return golonganDarahId;
|
||||
}
|
||||
|
||||
|
||||
public void setGolonganDarahId(Integer golonganDarahId) {
|
||||
this.golonganDarahId = golonganDarahId;
|
||||
}
|
||||
|
||||
|
||||
public JenisKelamin getJenisKelamin() {
|
||||
return jenisKelamin;
|
||||
}
|
||||
|
||||
|
||||
public void setJenisKelamin(JenisKelamin jenisKelamin) {
|
||||
this.jenisKelamin = jenisKelamin;
|
||||
}
|
||||
|
||||
|
||||
public Integer getJenisKelaminId() {
|
||||
return jenisKelaminId;
|
||||
}
|
||||
|
||||
|
||||
public void setJenisKelaminId(Integer jenisKelaminId) {
|
||||
this.jenisKelaminId = jenisKelaminId;
|
||||
}
|
||||
|
||||
|
||||
public Pekerjaan getPekerjaan() {
|
||||
return pekerjaan;
|
||||
}
|
||||
|
||||
|
||||
public void setPekerjaan(Pekerjaan pekerjaan) {
|
||||
this.pekerjaan = pekerjaan;
|
||||
}
|
||||
|
||||
|
||||
public Integer getPekerjaanId() {
|
||||
return pekerjaanId;
|
||||
}
|
||||
|
||||
|
||||
public void setPekerjaanId(Integer pekerjaanId) {
|
||||
this.pekerjaanId = pekerjaanId;
|
||||
}
|
||||
|
||||
|
||||
public Negara getNegara() {
|
||||
return negara;
|
||||
}
|
||||
|
||||
|
||||
public void setNegara(Negara negara) {
|
||||
this.negara = negara;
|
||||
}
|
||||
|
||||
|
||||
public Integer getNegaraId() {
|
||||
return negaraId;
|
||||
}
|
||||
|
||||
|
||||
public void setNegaraId(Integer negaraId) {
|
||||
this.negaraId = negaraId;
|
||||
}
|
||||
|
||||
|
||||
public Kebangsaan getKebangsaan() {
|
||||
return kebangsaan;
|
||||
}
|
||||
|
||||
|
||||
public void setKebangsaan(Kebangsaan kebangsaan) {
|
||||
this.kebangsaan = kebangsaan;
|
||||
}
|
||||
|
||||
|
||||
public Integer getKebangsaanId() {
|
||||
return kebangsaanId;
|
||||
}
|
||||
|
||||
|
||||
public void setKebangsaanId(Integer kebangsaanId) {
|
||||
this.kebangsaanId = kebangsaanId;
|
||||
}
|
||||
|
||||
|
||||
public Pendidikan getPendidikan() {
|
||||
return pendidikan;
|
||||
}
|
||||
|
||||
|
||||
public void setPendidikan(Pendidikan pendidikan) {
|
||||
this.pendidikan = pendidikan;
|
||||
}
|
||||
|
||||
|
||||
public Integer getPendidikanId() {
|
||||
return pendidikanId;
|
||||
}
|
||||
|
||||
|
||||
public void setPendidikanId(Integer pendidikanId) {
|
||||
this.pendidikanId = pendidikanId;
|
||||
}
|
||||
|
||||
|
||||
public StatusPerkawinan getStatusPerkawinan() {
|
||||
return statusPerkawinan;
|
||||
}
|
||||
|
||||
|
||||
public void setStatusPerkawinan(StatusPerkawinan statusPerkawinan) {
|
||||
this.statusPerkawinan = statusPerkawinan;
|
||||
}
|
||||
|
||||
|
||||
public Integer getStatusPerkawinanId() {
|
||||
return statusPerkawinanId;
|
||||
}
|
||||
|
||||
|
||||
public void setStatusPerkawinanId(Integer statusPerkawinanId) {
|
||||
this.statusPerkawinanId = statusPerkawinanId;
|
||||
}
|
||||
|
||||
|
||||
public TitlePasien getTitlePasien() {
|
||||
return titlePasien;
|
||||
}
|
||||
|
||||
|
||||
public void setTitlePasien(TitlePasien titlePasien) {
|
||||
this.titlePasien = titlePasien;
|
||||
}
|
||||
|
||||
|
||||
public Integer getTitlePasienId() {
|
||||
return titlePasienId;
|
||||
}
|
||||
|
||||
|
||||
public void setTitlePasienId(Integer titlePasienId) {
|
||||
this.titlePasienId = titlePasienId;
|
||||
}
|
||||
|
||||
|
||||
public String getNamaPasien() {
|
||||
return namaPasien;
|
||||
}
|
||||
|
||||
|
||||
public void setNamaPasien(String namaPasien) {
|
||||
this.namaPasien = namaPasien;
|
||||
}
|
||||
|
||||
|
||||
public String getNamaIbu() {
|
||||
return namaIbu;
|
||||
}
|
||||
|
||||
|
||||
public void setNamaIbu(String namaIbu) {
|
||||
this.namaIbu = namaIbu;
|
||||
}
|
||||
|
||||
|
||||
public String getNoTelepon() {
|
||||
return noTelepon;
|
||||
}
|
||||
|
||||
|
||||
public void setNoTelepon(String noTelepon) {
|
||||
this.noTelepon = noTelepon;
|
||||
}
|
||||
|
||||
|
||||
public String getNoCm() {
|
||||
return noCm;
|
||||
}
|
||||
|
||||
|
||||
public void setNoCm(String noCm) {
|
||||
this.noCm = noCm;
|
||||
}
|
||||
|
||||
|
||||
public Integer getqPasien() {
|
||||
return qPasien;
|
||||
}
|
||||
|
||||
|
||||
public void setqPasien(Integer qPasien) {
|
||||
this.qPasien = qPasien;
|
||||
}
|
||||
|
||||
|
||||
public Date getTglDaftar() {
|
||||
return tglDaftar;
|
||||
}
|
||||
|
||||
|
||||
public void setTglDaftar(Date tglDaftar) {
|
||||
this.tglDaftar = tglDaftar;
|
||||
}
|
||||
|
||||
|
||||
public Set<Alamat> getAlamats() {
|
||||
return alamats;
|
||||
}
|
||||
|
||||
|
||||
public void setAlamats(Set<Alamat> alamats) {
|
||||
this.alamats = alamats;
|
||||
}
|
||||
|
||||
|
||||
public Set<CatatanPasien> getCatatanPasien() {
|
||||
return catatanPasien;
|
||||
}
|
||||
|
||||
|
||||
public void setCatatanPasien(Set<CatatanPasien> catatanPasien) {
|
||||
this.catatanPasien = catatanPasien;
|
||||
}
|
||||
|
||||
|
||||
public Set<AntrianPasienRegistrasi> getAntrianPasienRegistrasis() {
|
||||
return antrianPasienRegistrasis;
|
||||
}
|
||||
|
||||
|
||||
public void setAntrianPasienRegistrasis(Set<AntrianPasienRegistrasi> antrianPasienRegistrasis) {
|
||||
this.antrianPasienRegistrasis = antrianPasienRegistrasis;
|
||||
}
|
||||
|
||||
|
||||
public String getNoIdentitas() {
|
||||
return noIdentitas;
|
||||
}
|
||||
|
||||
|
||||
public void setNoIdentitas(String noIdentitas) {
|
||||
this.noIdentitas = noIdentitas;
|
||||
}
|
||||
|
||||
|
||||
public String getPaspor() {
|
||||
return paspor;
|
||||
}
|
||||
|
||||
|
||||
public void setPaspor(String paspor) {
|
||||
this.paspor = paspor;
|
||||
}
|
||||
|
||||
|
||||
public String getNoAditional() {
|
||||
return noAditional;
|
||||
}
|
||||
|
||||
|
||||
public void setNoAditional(String noAditional) {
|
||||
this.noAditional = noAditional;
|
||||
}
|
||||
|
||||
|
||||
public String getNamaDepan() {
|
||||
return namaDepan;
|
||||
}
|
||||
|
||||
|
||||
public void setNamaDepan(String namaDepan) {
|
||||
this.namaDepan = namaDepan;
|
||||
}
|
||||
|
||||
|
||||
public String getNamaBelakang() {
|
||||
return namaBelakang;
|
||||
}
|
||||
|
||||
|
||||
public void setNamaBelakang(String namaBelakang) {
|
||||
this.namaBelakang = namaBelakang;
|
||||
}
|
||||
|
||||
|
||||
public String getTempatLahir() {
|
||||
return tempatLahir;
|
||||
}
|
||||
|
||||
|
||||
public void setTempatLahir(String tempatLahir) {
|
||||
this.tempatLahir = tempatLahir;
|
||||
}
|
||||
|
||||
|
||||
public String getNoBpjs() {
|
||||
return noBpjs;
|
||||
}
|
||||
|
||||
|
||||
public void setNoBpjs(String noBpjs) {
|
||||
this.noBpjs = noBpjs;
|
||||
}
|
||||
|
||||
|
||||
public String getNoAsuransiLain() {
|
||||
return noAsuransiLain;
|
||||
}
|
||||
|
||||
|
||||
public void setNoAsuransiLain(String noAsuransiLain) {
|
||||
this.noAsuransiLain = noAsuransiLain;
|
||||
}
|
||||
|
||||
|
||||
public String getNoHp() {
|
||||
return noHp;
|
||||
}
|
||||
|
||||
|
||||
public void setNoHp(String noHp) {
|
||||
this.noHp = noHp;
|
||||
}
|
||||
|
||||
|
||||
public String getNamaAyah() {
|
||||
return namaAyah;
|
||||
}
|
||||
|
||||
|
||||
public void setNamaAyah(String namaAyah) {
|
||||
this.namaAyah = namaAyah;
|
||||
}
|
||||
|
||||
|
||||
public String getNamaSuamiIstri() {
|
||||
return namaSuamiIstri;
|
||||
}
|
||||
|
||||
|
||||
public void setNamaSuamiIstri(String namaSuamiIstri) {
|
||||
this.namaSuamiIstri = namaSuamiIstri;
|
||||
}
|
||||
|
||||
|
||||
public Date getJamLahir() {
|
||||
return jamLahir;
|
||||
}
|
||||
|
||||
|
||||
public void setJamLahir(Date jamLahir) {
|
||||
this.jamLahir = jamLahir;
|
||||
}
|
||||
|
||||
|
||||
public String getNamaKeluarga() {
|
||||
return namaKeluarga;
|
||||
}
|
||||
|
||||
|
||||
public void setNamaKeluarga(String namaKeluarga) {
|
||||
this.namaKeluarga = namaKeluarga;
|
||||
}
|
||||
|
||||
@ -1,39 +1,28 @@
|
||||
package com.jasamedika.medifirst2000.listener;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import javax.persistence.PostLoad;
|
||||
import javax.persistence.PrePersist;
|
||||
import javax.persistence.PreUpdate;
|
||||
|
||||
import org.hibernate.envers.RevisionListener;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.jasamedika.medifirst2000.entities.AuditData;
|
||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
||||
import com.jasamedika.medifirst2000.util.Age;
|
||||
import com.jasamedika.medifirst2000.util.AgeCalculator;
|
||||
import com.jasamedika.medifirst2000.util.CommonUtil;
|
||||
import com.jasamedika.medifirst2000.util.PasswordUtil;
|
||||
|
||||
@Component
|
||||
public class MyEventListener
|
||||
{
|
||||
|
||||
public class MyEventListener {
|
||||
@PreUpdate
|
||||
@PostLoad
|
||||
@PrePersist
|
||||
public void set(Object o) {
|
||||
|
||||
Pasien pasien = (Pasien) o ;
|
||||
@PrePersist
|
||||
public void set(Object o) {
|
||||
Pasien pasien = (Pasien) o;
|
||||
Age age = AgeCalculator.calculateAge(pasien.getTglLahir());
|
||||
if(CommonUtil.isNotNullOrEmpty(age)) {
|
||||
if (CommonUtil.isNotNullOrEmpty(age)) {
|
||||
pasien.setUmur(age.toString());
|
||||
} else {
|
||||
pasien.setUmur("");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,159 +4,134 @@ import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Transient;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.jasamedika.medifirst2000.base.vo.BaseMasterVO;
|
||||
import com.jasamedika.medifirst2000.helper.Caption;
|
||||
|
||||
|
||||
public class PasienVO extends BaseMasterVO {
|
||||
|
||||
@Transient
|
||||
|
||||
private String umur;
|
||||
|
||||
@Caption(value="Tanggal Meninggal")
|
||||
@Caption(value = "Tanggal Meninggal")
|
||||
private Date tanggalMeninggal;
|
||||
|
||||
@ManyToOne(fetch=FetchType.LAZY)
|
||||
@Caption(value="DokumenRekamMedis")
|
||||
|
||||
@Caption(value = "DokumenRekamMedis")
|
||||
private DokumenVO dokumenRekamMedis;
|
||||
|
||||
@ManyToOne
|
||||
@Caption(value="Object Agama")
|
||||
@Caption(value = "Object Agama")
|
||||
private AgamaVO agama;
|
||||
|
||||
@ManyToOne
|
||||
@Caption(value="Object Golongan Darah")
|
||||
@Caption(value = "Object Golongan Darah")
|
||||
private GolonganDarahVO golonganDarah;
|
||||
|
||||
@ManyToOne
|
||||
@Caption(value="Object Jenis Kelamin")
|
||||
@Caption(value = "Object Jenis Kelamin")
|
||||
private JenisKelaminVO jenisKelamin;
|
||||
|
||||
@ManyToOne
|
||||
@Caption(value="Object Pekerjaan")
|
||||
|
||||
@Caption(value = "Object Pekerjaan")
|
||||
private PekerjaanVO pekerjaan;
|
||||
|
||||
@ManyToOne
|
||||
@Caption(value="Object Negara")
|
||||
@Caption(value = "Object Negara")
|
||||
private NegaraVO negara;
|
||||
|
||||
@ManyToOne
|
||||
@Caption(value="Object kebangsaan")
|
||||
@Caption(value = "Object kebangsaan")
|
||||
private KebangsaanVO kebangsaan;
|
||||
|
||||
@ManyToOne
|
||||
@Caption(value="Object Pendidikan")
|
||||
@Caption(value = "Object Pendidikan")
|
||||
private PendidikanVO pendidikan;
|
||||
|
||||
@ManyToOne
|
||||
@Caption(value="Object Status Perkawinan")
|
||||
@Caption(value = "Object Status Perkawinan")
|
||||
private StatusPerkawinanVO statusPerkawinan;
|
||||
|
||||
@ManyToOne
|
||||
@Caption(value="Object Title")
|
||||
|
||||
@Caption(value = "Object Title")
|
||||
private TitlePasienVO title;
|
||||
|
||||
@NotNull(message="Nama Pasien tidak boleh kosong")
|
||||
@Caption(value="Nama Pasien")
|
||||
@Caption(value = "Nama Pasien")
|
||||
private String namaPasien;
|
||||
|
||||
@Caption(value="Nama Ibu")
|
||||
|
||||
@Caption(value = "Nama Ibu")
|
||||
private String namaIbu;
|
||||
|
||||
@Caption(value="Nama Ayah")
|
||||
|
||||
@Caption(value = "Nama Ayah")
|
||||
private String namaAyah;
|
||||
|
||||
@Caption(value="Nama Suami/Istri")
|
||||
|
||||
@Caption(value = "Nama Suami/Istri")
|
||||
private String namaSuamiIstri;
|
||||
|
||||
@Caption(value="Nama keluarga")
|
||||
|
||||
@Caption(value = "Nama keluarga")
|
||||
private String namaKeluarga;
|
||||
|
||||
@Caption(value="No Telepon")
|
||||
|
||||
@Caption(value = "No Telepon")
|
||||
private String noTelepon;
|
||||
|
||||
@Caption(value="No C M")
|
||||
|
||||
@Caption(value = "No C M")
|
||||
private String noCm;
|
||||
|
||||
@Caption(value="QPasien")
|
||||
|
||||
@Caption(value = "QPasien")
|
||||
private Integer qPasien;
|
||||
|
||||
@NotNull(message="Tgl Daftar tidak boleh kosong")
|
||||
@Caption(value="Tanggal Daftar")
|
||||
@Caption(value = "Tanggal Daftar")
|
||||
private Date tglDaftar;
|
||||
|
||||
@Caption(value="Tanggal Lahir")
|
||||
@Caption(value = "Tanggal Lahir")
|
||||
private Date tglLahir;
|
||||
|
||||
@OneToMany(cascade=CascadeType.ALL,fetch = FetchType.LAZY, mappedBy = "pasien")
|
||||
|
||||
private Set<AlamatVO> alamats = new HashSet<AlamatVO>();
|
||||
|
||||
@OneToMany(cascade=CascadeType.ALL,fetch = FetchType.LAZY, mappedBy = "pasien")
|
||||
private Set<CatatanPasienVO> catatanPasien = new HashSet<CatatanPasienVO>();
|
||||
|
||||
@OneToMany(cascade=CascadeType.ALL,fetch = FetchType.LAZY, mappedBy = "pasien")
|
||||
private Set<AntrianPasienRegistrasiVO> antrianPasienRegistrasis = new HashSet<AntrianPasienRegistrasiVO>();
|
||||
|
||||
@Caption(value="NoIdentitas")
|
||||
|
||||
@Caption(value = "NoIdentitas")
|
||||
private String noIdentitas;
|
||||
|
||||
@Caption(value="Paspor")
|
||||
|
||||
@Caption(value = "Paspor")
|
||||
private String paspor;
|
||||
|
||||
@Caption(value="noAditional")
|
||||
|
||||
@Caption(value = "noAditional")
|
||||
private String noAditional;
|
||||
|
||||
@Caption(value="namaDepan")
|
||||
@Caption(value = "namaDepan")
|
||||
private String namaDepan;
|
||||
|
||||
@Caption(value="namaBelakang")
|
||||
@Caption(value = "namaBelakang")
|
||||
private String namaBelakang;
|
||||
|
||||
@Caption(value="Tempat Lahir")
|
||||
@Caption(value = "Tempat Lahir")
|
||||
private String tempatLahir;
|
||||
|
||||
@Caption(value="No Bpjs")
|
||||
|
||||
@Caption(value = "No Bpjs")
|
||||
private String noBpjs;
|
||||
|
||||
@Caption(value="No AsuransiLain")
|
||||
|
||||
@Caption(value = "No AsuransiLain")
|
||||
private String noAsuransiLain;
|
||||
|
||||
@Caption(value="No Hp")
|
||||
|
||||
@Caption(value = "No Hp")
|
||||
private String noHp;
|
||||
|
||||
@ManyToOne
|
||||
@Caption(value="PasienDaftar")
|
||||
|
||||
@Caption(value = "PasienDaftar")
|
||||
private PasienDaftarVO pasienDaftar;
|
||||
|
||||
@Caption(value="PasienIbu")
|
||||
|
||||
@Caption(value = "PasienIbu")
|
||||
private PasienVO pasienIbu;
|
||||
|
||||
@Caption(value="JamLahir")
|
||||
|
||||
@Caption(value = "JamLahir")
|
||||
private Date jamLahir;
|
||||
|
||||
@Caption(value="alamatLengkap")
|
||||
|
||||
@Caption(value = "alamatLengkap")
|
||||
private String alamatLengkap;
|
||||
|
||||
@Caption(value="kodePos")
|
||||
|
||||
@Caption(value = "kodePos")
|
||||
private String kodePos;
|
||||
|
||||
@Caption(value="DesaKelurahan")
|
||||
|
||||
@Caption(value = "DesaKelurahan")
|
||||
private DesaKelurahanVO desaKelurahan;
|
||||
|
||||
@Caption(value="kecamatan")
|
||||
|
||||
@Caption(value = "kecamatan")
|
||||
private KecamatanVO kecamatan;
|
||||
|
||||
@Caption(value="kotaKabupaten")
|
||||
|
||||
@Caption(value = "kotaKabupaten")
|
||||
private KotaKabupatenVO kotaKabupaten;
|
||||
|
||||
@Caption(value="propinsi")
|
||||
|
||||
@Caption(value = "propinsi")
|
||||
private PropinsiVO propinsi;
|
||||
|
||||
public String getUmur() {
|
||||
@ -502,6 +477,5 @@ public class PasienVO extends BaseMasterVO {
|
||||
public void setNamaKeluarga(String namaKeluarga) {
|
||||
this.namaKeluarga = namaKeluarga;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user