using ASHermed.SinoInterface.Api.ContractModel;
using ASHermed.SinoInterface.Api.ContractModel.App;
using ASHermed.SinoInterface.Api.ContractModel.App.Model;
using ASHermed.SinoInterface.Api.ContractModel.App.RequestForm;
using ASHermed.SinoInterface.Api.ContractModel.Framework.Login;
using ASHermed.SinoInterface.ContractModel;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;

namespace ASHermed.SinoInterface.Api.IService
{
    /// <summary>
	///
	/// </summary>
	public interface IAptService
    {
        MemoryStream Test(int type);
        Out_Apt_Info Commit(Out_Apt_Info outAptInfo, string patId);
        int QuickCommit(Out_Apt_Info outAptInfo, string lastName, string firstName, int gender, string birthday, string patName, string phone, string email, int language);

        SchedulingSlotList QuerySchedulingSlotListByLanguage(int hosId, int deptId, string fromDate, string toDate, int servId, int language, int aptType);
        Scheduling QuerySchedulingByApplet();
        Scheduling QuerySchedulingByApp(int hosId, int deptId, int doctorId, int servId, string fromDate, string toDate, int status);
        Dictionary<string, List<SlotDateModel>> QueryOnlineSchedulingByApp(int doctorId, string fromDate, string toDate);
        List<SchedulingParamByLanguage> FindSchedulingParamByLanguage(int hosId, int deptId, int doctorId, int language);
        List<AptDataResb> FindAptDetailList(int language, int userId, int aptStatus, int year, int aptType);
        bool GetAppointmentsForPatient(string mrn);
        int InsertPubPatInfo(PatMapInsuranceDetail request);
        PatMapInsurance GetPatUserInfoFornewPortal();
        PatMapInsurance GetPatUserInfo(int userId);
        PAPerson GetTcUser(string mrn, int language);
        List<MyAppointment> GetMyAppointment(int type, int pat, int year);
        List<MyAppointment> GetOutAptForNewPortal(int type, int language, int pat = 0);
        /// <summary>
        /// 保险获取预约单
        /// </summary>
        /// <param name="type">1全部，2即将就诊(医助待确认,已确认) 3待确认(保险待审核,保险预约审核)，4已完成(就诊中,就诊结束)</param>
        /// <param name="pat"></param>
        /// <param name="year"></param>
        /// <returns></returns>
        List<MyAppointment> GetCignaAppointment(int type, int pat, int year);

        MyAppointmentDetail GetMyAppointmentDetail(int Id, int myAppointmentType, int language, DateTime apttime, int patid);
        MyPrescription GetMyPrescription(int status, int patId, string useragent = "sino");

        MyPrescriptionDetail GetMyPrescriptionDetail(string orderNo, int language);
        CignaPrescriptionDetail GetCignaPrescriptionDetail(string orderNo, int language);
        int UpdatePrescriptionStatus(string orderNo, int status);
        List<AptInfos> FindLastAptByPat(string patId);
        bool OutAptUpdateStatus();

        OnlineSearchResult OnlineSearch(string keyWords, int language);
        BaseResponse<bool> AddVaccineAppt(VaccineApptRequest request, int language = 1);

        bool CancelVaccineAppt(int flowid);

        bool QueueNumber();
        int AgainRequeue(int id);
        VaccineApptForUser GetOutVaccineApptForId(int id, int language);
        List<VaccineApptForUser> GetOutVaccineApptList(int status, int language);
        int CreateTCOrder(TCCreateOrderRequest request);

        Dictionary<string, List<VaccSlotDateModel>> GetVaccineScheduling(VaccineSchedulingReq requst);
        VaccineAptInfo GetVaccineAptInfo(int id, int language);
        Dictionary<int, string> VaccineAptCommit(VaccineApt apt, ref bool isTcInterfaceError);
        int SendCheckedSms();

        BaseResponse<VaccGroupCount> VaccinePhoneConfirm(string phone, string code, int language);
        BaseResponse<VaccGroupCount> VaccineUserPhoneConfirm(int language);
        BaseResponse<VaccGroupInfo> GetCompanyVaccineAptInfo(int patId, int language);
        void PushApt();
        void SendSurvey();
        List<SurveyModel> GetSurveySendMsgCount(string startDate, string endDate);
        List<Pub_Sms_Survey> GetSurveyReplyMsgCount(string startDate, string endDate);
        List<DataApts> GetAptListFromMonth(string startDate, string endDate);
        List<DataPatAptMore> GetDeptAptMore(string startDate, string endDate);

        BaseResponse<int> LockAptUsrn(AptCommitModel model);
        
        BaseResponse<int> AptCommit(AptCommitModel model);
        void UpdateLockNoUseUsrnStatus();
        bool ReservationByUser(OutVaccineApptReq outVaccineAppt);
    }
}
