package cn.hnthyy.thmz.service.his.mz;

import cn.hnthyy.thmz.entity.MzException;
import cn.hnthyy.thmz.entity.his.mz.MzChargeDetail;
import cn.hnthyy.thmz.entity.thmz.RadSendRecord;
import cn.hnthyy.thmz.entity.thmz.User;
import cn.hnthyy.thmz.vo.*;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface MzPharmacyService {

    /**
     * 获取收费处方信息
     *
     * @param chargeDetailPharmacyVo
     * @return
     */
    List<MzChargeDetail> getMzChargeOrder(ChargeDetailPharmacyVo chargeDetailPharmacyVo);

    /**
     * 查询发药统计(退药)
     *
     * @return
     */
    List<YpMzFytjVo> getYpMzRefundFytjPage(ChargeFeeParamsVo chargeFeeParamsVo);

    /**
     * 查询发药统计条数(退药)
     *
     * @return
     */
    int getYpMzRefundFytjCount(ChargeFeeParamsVo chargeFeeParamsVo);

    /**
     * 查询发药统计(退药成功)
     *
     * @return
     */
    List<YpMzFytjVo> getYpMzRefundSucceedFytjPage(ChargeFeeParamsVo chargeFeeParamsVo);

    /**
     * 查询发药统计条数(退药成功)
     *
     * @return
     */
    int getYpMzRefundSucceedFytjCount(ChargeFeeParamsVo chargeFeeParamsVo);

    /**
     * 查询处方药品明细
     * @param chargeFeeParamsVo
     * @return
     */
    List<Map<String,Object>> getPrescriptionYpMx(ChargeFeeParamsVo chargeFeeParamsVo);

    /**
     * 退药处理
     * @param mzRefundMedicineVos
     * @param userIdCode
     * @return
     */
    Map<String, Object> refundMedicineProcessing(List<MzRefundMedicineVo> mzRefundMedicineVos,String userIdCode);

    /**
     * 发药处理查询未发药处方
     * @param chargeFeeParamsVo
     * @return
     */
    List<ChargeDetailInfoVo> getFyclWfyPrescriptionPage(ChargeFeeParamsVo chargeFeeParamsVo);

    /**
     * 发药处理查询未发药处方条数
     * @param chargeFeeParamsVo
     * @return
     */
    int getFyclWfyPrescriptionCount(ChargeFeeParamsVo chargeFeeParamsVo);

    /**
     * 查询门诊发票记录
     * @param chargeDetailInfoVo
     * @return
     */
    int selectMzReceiptSerialCount(ChargeDetailInfoVo chargeDetailInfoVo);

    /**
     * 发药处理查询已发药处方
     * @param chargeFeeParamsVo
     * @return
     */
    List<ChargeDetailInfoVo> getFyclYfyPrescriptionPage(ChargeFeeParamsVo chargeFeeParamsVo);

    /**
     * 发药处理查询已发药处方条数
     * @param chargeFeeParamsVo
     * @return
     */
    int getFyclYfyPrescriptionCount(ChargeFeeParamsVo chargeFeeParamsVo);
    /**
     * 发药处理查询处方明细
     *
     * @param mzChargeDetail
     * @return
     */
    List<MzSendMedicineVo> getFyclPrescriptionDetail(MzChargeDetail mzChargeDetail);

    /**
     * 查询药品单位名称
     *
     * @param code
     * @return
     */
    String getYpUnitName(String code);

    /**
     * 发药处理
     * @param mzChargeDetail
     * @param user
     * @return
     */
    Map<String,Object> sendMedicineProcessing(MzChargeDetail mzChargeDetail, User user) throws MzException;

    /**
     * 配药处理
     * @param mzChargeDetail
     * @return
     */
    int dispensingMedicineProcessing(MzChargeDetail mzChargeDetail);

    /**
     * 查询放射科发药记录历史时间
     * @param radSendRecord
     * @return
     */
    List<RadSendRecord> getRadSendRecordPage(RadSendRecord radSendRecord);

    /**
     * 查询放射科发药记录总条数
     * @param radSendRecord
     * @return
     */
    Integer getRadSendRecordCount(RadSendRecord radSendRecord);

    /**
     * 查询放射科当前时间的上一次发药时间
     * @param date
     * @return
     */
    Date getLastRadSendDate(Date date);

    /**
     * 查询放射科发药统计
     * @param confirmTime
     * @return
     */
    List<Map<String, Object>> getRadSendStat(String confirmTime);

    /**
     * 放射科发药处理
     * @param user
     * @return
     */
    int sendMedicineProcessingRad(User user);

    /**
     * 是否为放射科发药
     * @param code
     * @return
     */
    int isRadSend(String code);
}
