using ASHermed.SinoInterface.Api.ContractModel;
using ASHermed.SinoInterface.Api.ContractModel.App;
using ASHermed.SinoInterface.Api.ContractModel.Coupon.Entity;
using ASHermed.SinoInterface.Api.ContractModel.Coupon.Model;
using ASHermed.SinoInterface.Api.IRepository;
using ASHermed.SinoInterface.Api.IRepository.App;
using ASHermed.SinoInterface.Api.IService;
using ASHermed.SinoInterface.Enum.App;
using ASHermed.SinoInterface.IFramework;
using ASHermed.SinoInterface.Tools;
using Microsoft.Extensions.Logging;
using PoJun.Util.Maps;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ASHermed.SinoInterface.Api.Service
{
    public class OutMapPatTagService : BaseService, IOutMapPatTagService
    {
        ILogger<OutMapPatTagService> _logger;
        IOutService _outService;
        IDicDoctorRepository _dicDoctorRepository;
        IPubMapPatuserDocuserRepository _pubMapPatuserDocuserRepository;
        IOutMapPatTagRepository _outMapPatTagRepository;
        public OutMapPatTagService(ILogger<OutMapPatTagService> logger, IOutService outService, IDicDoctorRepository dicDoctorRepository, IPubMapPatuserDocuserRepository pubMapPatuserDocuserRepository, IOutMapPatTagRepository outMapPatTagRepository)
        {
            _logger = logger;
            _outService = outService;
            _dicDoctorRepository = dicDoctorRepository;
            _pubMapPatuserDocuserRepository = pubMapPatuserDocuserRepository;
            _outMapPatTagRepository = outMapPatTagRepository;
        }

        public bool SetTag(int doctorId, int tagId, int patId)
        {
            Out_Map_Pat_Tag info = _outMapPatTagRepository.SelectMapByTagPat(tagId, doctorId, patId);
            if (info != null)
            {
                return false;
            }
            info = new Out_Map_Pat_Tag();
            info.Tag_Id = tagId;
            info.Doctor_Id = doctorId;
            info.Pat_Id = patId;
            info.Status = 1;
            info.Create_Time = DateTime.Now;
            _outMapPatTagRepository.InsertPatTag(info);
            return true;
        }




    }
}
