// 检查管理
import request from '@/utils/request'
import requestDownload from '@/utils/request-download'

// 检查->患者列表
export function getPatientList(data) {
    return request({
        url: '/Patient/getPatientList',
        method: 'post',
        data
    })
}

// 检查->患者可加入项目列表
export function getPatientJoinTrialInitList(data) {
    return request({
        url: '/Patient/getPatientJoinTrialInitList',
        method: 'post',
        data
    })
}

// 检查->患者可加入项目列表（下拉选框）
export function getPatientJoinTrialInitSelectList(data) {
    return request({
        url: '/Patient/getPatientJoinTrialInitSelectList',
        method: 'post',
        data
    })
}

// 检查->患者已加入项目列表
export function getPatientJoinedTrialList(data) {
    return request({
        url: '/Patient/getPatientJoinedTrialList',
        method: 'post',
        data
    })
}

// 检查->scp影像推送记录
export function getSCPImageUploadList(data) {
    return request({
        url: '/Patient/getSCPImageUploadList',
        method: 'post',
        data
    })
}

// 下载记录
export function getTrialSubjectVisitDownloadList(data) {
    return request({
        url: '/Patient/getTrialSubjectVisitDownloadList',
        method: 'post',
        data
    })
}

// 获取患者列表（下拉框）
export function getTrialSubejctSelectList(data) {
    return request({
        url: '/Patient/getTrialSubejctSelectList',
        method: 'post',
        data
    })
}

// 患者与受试者建立绑定关系
export function addSubjectPatientBinding(data) {
    return request({
        url: '/Patient/addSubjectPatientBinding',
        method: 'post',
        data
    })
}

// 患者与受试者移除绑定关系
export function deleteSubjectPatientBinding(params) {
    return request({
        url: '/Patient/deleteSubjectPatientBinding',
        method: 'delete',
        params
    })
}

// 获取患者检查列表
export function getPatientStudyList(data) {
    return request({
        url: '/Patient/getPatientStudyList',
        method: 'post',
        data
    })
}

// 绑定访视->获取患者检查列表
export function getVisitPatientStudyList(data) {
    return request({
        url: '/Patient/getVisitPatientStudyList',
        method: 'post',
        data
    })
}

// 绑定访视->获取已存在的访视
export function getSubjectVisitSelectList(data) {
    return request({
        url: '/Patient/getSubjectVisitSelectList',
        method: 'post',
        data
    })
}

// 绑定访视->添加或更新访视
export function addOrUpdateSubjectVisit(data) {
    return request({
        url: '/Patient/addOrUpdateSubjectVisit',
        method: 'post',
        data
    })
}

// 绑定访视->确认患者与访视关系
export function addSubjectPatientStudyBinding(data) {
    return request({
        url: '/Patient/addSubjectPatientStudyBinding',
        method: 'post',
        data
    })
}

// 绑定访视->提交患者与访视关系
export function submitVisitStudyBinding(data) {
    return request({
        url: '/Patient/submitVisitStudyBinding',
        method: 'post',
        data
    })
}

// 清除数据
export function deletePatientStudyAllData(params) {
    return request({
        url: '/Patient/deletePatientStudyAllData',
        method: 'delete',
        params
    })
}

// 删除检查
export function deletePatientStudy(params) {
    return request({
        url: '/Patient/deletePatientStudy',
        method: 'delete',
        params
    })
}

// 校验受试者是否存在
export function verifyTrialSubject(data) {
    return request({
        url: '/Patient/verifyTrialSubject',
        method: 'post',
        data
    })
}

// pacs可拉取列表
export function getCFindStudyList(data) {
    return request({
        url: '/Patient/getCFindStudyList',
        method: 'post',
        data
    })
}

// pacs拉取
export function cmoveStudyList(data) {
    return request({
        url: '/Patient/cmoveStudyList',
        method: 'post',
        data
    })
}

// pacs验证
export function cMoveVerify(data) {
    return request({
        url: '/Patient/cMoveVerify',
        method: 'post',
        data
    })
}
// 获取参加项目
export function getUserJoinedTrialPatientList() {
    return request({
        url: '/Patient/getUserJoinedTrialPatientList',
        method: 'get',
    })
}
// 获取影像下载数据
export function getDownloadPatientStudyInfo(data) {
    return request({
        url: '/Patient/getDownloadPatientStudyInfo',
        method: 'post',
        data
    })
}
// 获取影像下载数据(接口二)
export function PatientStudyBatchDownload(data) {
    return requestDownload({
        url: '/download/PatientStudyBatchDownload',
        method: 'post',
        responseType: 'blob',
        data
    })
}