<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class GetJson extends CI_Controller {

	public function __construct()
	{
		parent::__construct();		
		
		// Load Model		
		$this->load->model('duite/duite_model');
		$this->load->model('perujuk/perujuk_model');
		$this->load->model('laborat/laborat_panel_model');
		
	}

	public function index()
	{
		
			
		//$kdbrg='AK100610';		
		//$tgl=$this->input->post('tgl',TRUE);		
				
		$rinci = $this->admision_model->getPropinsi();
		$this->output
			->set_content_type('application/json')
			->set_output(json_encode($rinci));
	}
	
	public function setKab()
	{	
			
		//$kdbrg='AK100610';		
		$key=$this->input->post('idkec',TRUE);		
				
		$rinci = $this->perujuk_model->getKabProp($key);
		$this->output
			->set_content_type('application/json')
			->set_output(json_encode($rinci));
	}
	
	public function setKokab()
	{		
		//$kdbrg='AK100610';		
		$key=$this->input->post('idpro',TRUE);		
				
		$rinci = $this->perujuk_model->getKokab($key);
		$this->output
			->set_content_type('application/json')
			->set_output(json_encode($rinci));
	}
	
	public function setKecama()
	{		
		//$kdbrg='AK100610';		
		$key=$this->input->post('idkokab',TRUE);		
				
		$rinci = $this->perujuk_model->getKecamat($key);
		$this->output
			->set_content_type('application/json')
			->set_output(json_encode($rinci));
	}
	
	public function getDokter()
	{
		$key=$this->input->post('idpoli',TRUE);		
				
		$rinci = $this->perujuk_model->getDokterPoli($key);
		$this->output
			->set_content_type('application/json')
			->set_output(json_encode($rinci));
	}
	
	public function getJadwalDokter()
	{
		$dok=$this->input->post('iddokter',TRUE);		
		$poli=$this->input->post('idpoli',TRUE);		
				
		$rinci = $this->perujuk_model->getJadwalDokterPoli($dok,$poli);
		$this->output
			->set_content_type('application/json')
			->set_output(json_encode($rinci));
	}
	
	public function getDataReg()
	{
		$key=$this->input->post('noreg',TRUE);		
				
		$rinci = $this->perujuk_model->getDataRegJs($key);
		$this->output
			->set_content_type('application/json')
			->set_output(json_encode($rinci));
	}
	
	public function getRewardTindakan()
	{
		$key=$this->input->post('idtindakan',TRUE);		
				
		$rinci = $this->perujuk_model->getDataTindakan($key);
		$this->output
			->set_content_type('application/json')
			->set_output(json_encode($rinci));
	}
	
	//laborat
	public function getDataLab()
	{
		$key=$this->input->post('idreglb',TRUE);		
		$keyx=$this->input->post('idlab',TRUE);		
				
		$rinci = $this->laborat_panel_model->getPasienLaboratByIDReg($key,$keyx);
		$this->output
			->set_content_type('application/json')
			->set_output(json_encode($rinci));
	}
	
	public function getDataLabAntigen()
	{
		$key=$this->input->post('idreglb',TRUE);		
		$keyx=$this->input->post('idlab',TRUE);		
		$tgl=$this->input->post('tgl',TRUE);		
				
		$rinci = $this->laborat_panel_model->getPasienLaboratAntigenByIDReg($key,$keyx,$tgl);
		$this->output
			->set_content_type('application/json')
			->set_output(json_encode($rinci));
	}
	
	
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */