package com.fs.his.service;

import java.util.List;

import com.fs.common.core.domain.R;
import com.fs.his.domain.FsPackageOrder;
import com.fs.his.domain.FsPrescribe;
import com.fs.his.domain.FsPrescribeDrug;
import com.fs.his.dto.PrescribeRejectDTO;
import com.fs.his.param.*;
import com.fs.his.vo.*;
import com.github.pagehelper.PageInfo;

/**
 * 处方Service接口
 *
 * @author fs
 * @date 2023-06-13
 */
public interface IFsPrescribeService
{
    /**
     * 查询处方
     *
     * @param prescribeId 处方主键
     * @return 处方
     */
    public FsPrescribe selectFsPrescribeByPrescribeId(Long prescribeId);

    /**
     * 查询处方列表
     *
     * @param fsPrescribe 处方
     * @return 处方集合
     */
    public List<FsPrescribe> selectFsPrescribeList(FsPrescribe fsPrescribe);

    /**
     * 新增处方
     *
     * @param fsPrescribe 处方
     * @return 结果
     */
    public int insertFsPrescribe(FsPrescribe fsPrescribe);

    /**
     * 修改处方
     *
     * @param fsPrescribe 处方
     * @return 结果
     */
    public int updateFsPrescribe(FsPrescribe fsPrescribe);

    /**
     * 批量删除处方
     *
     * @param prescribeIds 需要删除的处方主键集合
     * @return 结果
     */
    public int deleteFsPrescribeByPrescribeIds(Long[] prescribeIds);

    /**
     * 删除处方信息
     *
     * @param prescribeId 处方主键
     * @return 结果
     */
    public int deleteFsPrescribeByPrescribeId(Long prescribeId);

    List<FsPrescribeListVO> selectFsPrescribeListVO(FsPrescribeParam fsPrescribe);

    List<FsPrescribeListVO> selectFsPrescribeListVOWithConfirm(FsPrescribeParam fsPrescribe);

    List<FsPrescribeListDVO> selectFsPrescribeListDVO(FsPrescribeListDParam param);

    String getFsPrescribeZyImg(PrescribeZyImgParam prescribeZyImgParam);

    String getFsPrescribeXyImg(PrescribeXyImgParam prescribeXyImgParam);

    List<FsPrescribeListUVO> selectFsPrescribeListUVO(FsPrescribeListUParam param);

    FsPrescribeVO selectFsPrescribeByPrescribeIdVO(Long prescribeId);

    List<FsPrescribeDrug> selectFsPrescribeDrugByPrescribeIdVO(Long prescribeId);

    void auditPrescribe();

    R audit(FsPrescribeAuditParam param);

    /**
     * 药师审核-(后付款版本)
     * */
    R auditAfterPayment(FsPrescribeAuditParam param);

     String PrescribeImg(Long prescribeId);
     String PrescribeImgYsy(Long prescribeId);

    String prescribeImgYsyTask(Long prescribeId,Integer signFlag);

    Long insertFsPrescribeByPackageOrder(FsPackageOrder packageOrder);

    List<FsPrescribeExcelListVO> selectFsPrescribeExcelListVO(FsPrescribeParam fsPrescribe);

    List<FsMessageFeedbackExportListVO> selectFsMessageFeedbackExportListVO(FsPrescribeParam fsPrescribe);

    String getPrescribeCodeUrl(Long prescribeId);

    Boolean isEntityNull(FsPrescribeParam fsPrescribe);

    Long selectFsPrescribeExcelListVOCount(FsPrescribeParam fsPrescribe);

    void exportData(FsPrescribeParam fsPrescribe);

    void exportMessageFeedback(FsPrescribeParam fsPrescribe);

    List<Long> selectFsPrescribeByPrescribeIdByOrderType();

    void PrescribeStoreImg(Long id);

    List<FsPrescribeListDVO> selectFsPrescribeListDVOByCompanyUser(FsPrescribeListDCompanyParam param);

    void confirmPrescribe(FsPrescribeParam param);

    //手动生成带医生签名的处方图片
    public void createDoctorSignImg(FsPrescribe fsPrescribe);

    void collectionPrescribe(Long prescribeId);

    void delUrl(Long prescribeId);

    //获取医生平均操作时间
    Long selectDoctorAvgOperateTime(Long doctorId);

    /**
     * 获取医生开方操作时长列表
     * */
    PageInfo<DoctorOperateStatVO> getDurationList(PrescribeStatParam  param);

    void handleReject(PrescribeRejectDTO rejectDTO);

    /**
     * 根据用户id获取用户处方列表(审核通过的处方)
     * */
    List<FsPrescribe> getPrescribeListByUserId(FsPrescribe queryCondition);

    /**
     * 根据用户id列表获取用户处方列表(审核通过的处方)
     * */
    List<FsPrescribe> selectFsPrescribeListByUserIds(List<Long> userIds);

    /**
     * 获取等待审核的处方列表--后付款版
     * */
    List<FsPrescribeListVO> selectWaitPrescribeList(WaitPrescribeParam waitPrescribeParam);

    /**
     * 确认处方--后付款版
     * */
    void confirmPrescribeAfterPayment(FsPrescribeParam param);

    /**
     * 根据用户id查询最新审核通过的处方信息
     * */
    FsPrescribe selectNewestAuditedPrescribeByUserId(Long userId);

    /**
     * 根据信息采集id查询最新审核通过的处方信息
     * */
    FsPrescribe selectNewestAuditedPrescribeByCollectionId(Long collectionId);

    /**
     * 根据加密后的电话号码查询处方列表
     * */
    List<FsPrescribe> selectPrescribeListByEncryptPhone(String phone);
}
