<?php

class GetStatusAntrian extends CI_Controller {

	public function __construct()
	{
		parent::__construct();

		$this->load->model('api_bpjs_model');
		$this->load->model('data_pasien_model');
		$this->load->model('mjkn_model');
	}

	public function index()
	{		
		$header = apache_request_headers();

		$cek_token = $this->mjkn_model->cek_token($header);

		$context  = array(
			'kode_poli' => $this->uri->segment(3),
			'tanggalperiksa' => $this->uri->segment(4)
		);

		if(isset($cek_token['metadata']))
		{
			$data['response'] = $cek_token;
		}
		else $data['response'] = $this->mjkn_model->status_antrian($context);

		$this->load->view('mjkn/page', $data);
	}
}

?>