using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
using System.Configuration;
using CLIP.eForm.Consent.Common;
using System.IO;

namespace CLIP.eForm.Consent.Dfh.UI
{
    public partial class ConsentStartForm : Form
    {
        public ConsentStartForm()
        {
            InitializeComponent();
        }

        private void ConsentStartForm_Load(object sender, EventArgs e)
        {
            string callParam = "{\"METHOD_NAME\":\"EXEC_CONSENT\", \"CALL_PARAMS\":{\"EXEC_OPT\":{\"USE_LIST_VIEW\":\"Y\",\"PTNT_LIST_VIEW\":\"Y\",\"PTNT_ACT\":\"N\", \"START_FORM_CD\":\"1300009935\"}, \"USER_INFO\":{\"USER_ID\":\"103043\"}, \"PATIENT_INFO\":{\"PTNT_NO\":\"0586244\", \"VISIT_TYPE\":\"I\", \"CLN_DATE\":\"20150615\", \"CRETNO\":\"1\", \"CLN_DEPT\":\"508000000\"}}}";
            
            consentMainControl = new ConsentMainControl(callParam);

            consentMainControl._callParm = ParseJsonCall(callParam);

            consentMainControl.Dock = DockStyle.Fill;
            this.Controls.Add(consentMainControl);
        }

        private static Dictionary<string, object> ParseJsonCall(string callParam)
        {
            Dictionary<string, object> jsonRoot = null;
            jsonRoot = fastJSON.JSON.Parse(callParam) as Dictionary<string, object>;

            return jsonRoot;
        }
    }
}
