package com.jasamedika.medifirst2000.service.impl;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.jpa.JpaSystemException;
import org.springframework.stereotype.Service;

import com.jasamedika.medifirst2000.converter.BaseConverterImpl;
import com.jasamedika.medifirst2000.converter.DetailHasilTriaseConverter;
import com.jasamedika.medifirst2000.converter.DetailTriaseConverter;
import com.jasamedika.medifirst2000.converter.HasilTriaseConverter;
import com.jasamedika.medifirst2000.converter.PemeriksaanTriageConverter;
import com.jasamedika.medifirst2000.dao.HasilTriaseDao;
import com.jasamedika.medifirst2000.dao.StrukPelayananDNoBatchDao;
import com.jasamedika.medifirst2000.dao.custom.HasilTriaseDaoCustom;
import com.jasamedika.medifirst2000.entities.AntrianPasienDiPeriksa;
import com.jasamedika.medifirst2000.entities.DetailHasilTriase;
import com.jasamedika.medifirst2000.entities.DetailTriase;
import com.jasamedika.medifirst2000.entities.HasilTriase;
import com.jasamedika.medifirst2000.entities.Pasien;
import com.jasamedika.medifirst2000.entities.PasienDaftar;
import com.jasamedika.medifirst2000.entities.PemeriksaanTriage;
import com.jasamedika.medifirst2000.entities.StokProdukGlobal;
import com.jasamedika.medifirst2000.entities.StrukPelayanan;
import com.jasamedika.medifirst2000.entities.StrukPelayananDNoBatch;
import com.jasamedika.medifirst2000.entities.StrukPelayananDetail;
import com.jasamedika.medifirst2000.exception.ServiceVOException;
import com.jasamedika.medifirst2000.service.HasilTriaseService;
import com.jasamedika.medifirst2000.service.StrukPelayananDNoBatchService;
import com.jasamedika.medifirst2000.util.Age;
import com.jasamedika.medifirst2000.util.AgeCalculator;
import com.jasamedika.medifirst2000.util.CommonUtil;
import com.jasamedika.medifirst2000.util.DateUtil;
import com.jasamedika.medifirst2000.vo.DetailHasilTriaseVO;
import com.jasamedika.medifirst2000.vo.DetailTriaseVO;
import com.jasamedika.medifirst2000.vo.GridPasienVO;
import com.jasamedika.medifirst2000.vo.HasilTriaseVO;
import com.jasamedika.medifirst2000.vo.JenisKelaminVO;
import com.jasamedika.medifirst2000.vo.StrukPelayananDNoBatchVO;
import com.jasamedika.medifirst2000.vo.StrukPelayananDetailVO;


/**
 * 
 * @author Shakato
 */
@Service("StrukPelayananDNoBatchService")
public class StrukPelayananDNoBatchServiceImpl implements StrukPelayananDNoBatchService{

	@Autowired
	private BaseConverterImpl<StrukPelayananDNoBatchVO, StrukPelayananDNoBatch> strukPelayananDNoBatchConverter;
	
	private StrukPelayananDNoBatchDao strukPelayananDNoBatchDao;
	
	@Override
	public StrukPelayananDNoBatchVO add(StrukPelayananDNoBatchVO vo) throws JpaSystemException, ServiceVOException {
		return null;
	}

	@Override
	public StrukPelayananDNoBatchVO update(StrukPelayananDNoBatchVO vo) throws JpaSystemException, ServiceVOException {
		return null;
	}

	@Override
	public Boolean delete(Integer key) throws JpaSystemException {
		return null;
	}

	@Override
	public StrukPelayananDNoBatchVO findById(Integer key) throws JpaSystemException {
		return null;
	}

	@Override
	public List<StrukPelayananDNoBatchVO> findAll() throws JpaSystemException {
		return null;
	}

	@Override
	public Map<String, Object> findAllWithPageAndLimitAndSortByAndDirectionParameter(Integer page, Integer limit,
			String sort, String dir) {
		return null;
	}

	@Override
	public Map<String, Object> saveStrukPelayananDNoBatch(StrukPelayananDNoBatchVO vo) {
		StrukPelayananDNoBatch strukPelayananDNoBatch = new StrukPelayananDNoBatch();
		strukPelayananDNoBatch = strukPelayananDNoBatchConverter.transferVOToModel(vo, new StrukPelayananDNoBatch());
		
		StrukPelayananDNoBatch model = strukPelayananDNoBatchDao.save(strukPelayananDNoBatch);
		Map<String, Object> result = new HashMap<String, Object>();
		if (CommonUtil.isNotNullOrEmpty(model)) {
			result.put("noRec", model.getNoRec());
		}
		return result;
	}
	
	
	
}
