﻿using System;
using System.Collections.Generic;
using System.Text;
using IndianHealthService.BMXNet.Model;
using System.Globalization;

namespace IndianHealthService.BMXNet.WinForm
{
    internal class DesktopVisit : DesktopObject, Visit
    {

        public static DesktopVisit FindCurrent(DesktopSession aSession)
        {
            DesktopVisit answer = new DesktopVisit();

            
                return answer;
            
        }

      private DateTime _dateTime;

        public DateTime DateTime
        {
            get { return _dateTime; }
            set { _dateTime = value; }
        }

 
        private String _locationName;

        public String LocationName
        {
            get { return _locationName; }
            set { _locationName = value; }
        }
        private String _locationAbbr;

        public String LocationAbbr
        {
            get { return _locationAbbr; }
            set { _locationAbbr = value; }
        }
        private String _providerName;

        public String ProviderName
        {
            get { return _providerName; }
            set { _providerName = value; }
        }

        public override string ToString()
        {
            return this.Label;
        }

        public String Label
        {

            get { return this.DateTime.ToShortDateString() + " " + this.LocationName; }
        }

        private String _serviceCategory = null;

        public String ServiceCategory
        {
            get { return _serviceCategory; }
            set { _serviceCategory = value; }
        }


        public void FillFromRow(System.Data.DataRow aRow)
        {

            //PATIENT
            this.Ien = aRow["BMXIEN"].ToString();
            this.DateTime = DateTime.ParseExact(aRow["VISIT TIMESTAMP"].ToString(), "MMM dd, yyyy@HH:mm", CultureInfo.InvariantCulture);
            this.LocationName = aRow["LOCATION"].ToString();
            this.ServiceCategory = aRow["SERVICE CATEGORY"].ToString();
            this.LocationName = aRow["CLINIC"].ToString();
            this.ProviderName = aRow["PROVIDER"].ToString();
        }

    }
}
