import request from "@/utils/request";

let url = 'Emr/'

/**
 * 获取患者病历树状图
 * @param patNo 住院号
 * @param times 住院次数
 * @returns {*} 返回数
 */
export function getPatientDataTree(patNo, times) {
    return request({
        url: url + 'getPatientDataTree',
        method: 'get',
        params: {patNo, times}
    })
}

/**
 * 获取电子病历的树状图
 * @returns {*}
 */
export function getEmrTree() {
    return request({
        url: url + 'getEmrTree',
        method: 'get',
    })
}

/**
 * 获取病程片段
 * @returns {*}
 */
export function getSnippetTree() {
    return request({
        url: url + 'getSnippetTree',
        method: 'get',
    })
}

export function insertEmrData(data) {
    return request({
        url: url + 'insertEmrData',
        method: 'post',
        data
    })
}

export function deletePatientEmrByDocumentId(documentId) {
    return request({
        url: url + 'deletePatientEmrByDocumentId',
        method: 'get',
        params: {documentId}
    })
}

export function existCourseRecord(patNo, times) {
    return request({
        url: url + 'existCourseRecord',
        method: 'get',
        params: {patNo, times}
    })
}

export function queryWhetherThePatientHasASpecifiedMedicalRecord(data) {
    return request({
        url: url + 'queryWhetherThePatientHasASpecifiedMedicalRecord',
        method: 'post',
        data
    })
}

export function submitMedicalRecord(documentId) {
    return request({
        url: url + 'submitMedicalRecord',
        method: 'get',
        params: {documentId}
    })
}


export function getDrgIntelligentGrouping(patNo, times) {
    return request({
        url: url + 'getDrgIntelligentGrouping',
        method: 'get',
        params: {patNo, times}
    })
}

export function getDischargeTimes(patNo) {
    return request({
        url: url + 'getDischargeTimes',
        method: 'get',
        params: {patNo}
    })
}

export function getExtractDataElement(patNo, times) {
    return request({
        url: url + 'getExtractDataElement',
        method: 'get',
        params: {patNo, times}
    })
}

export function getEmrAllWardsApi() {
    return request({
        url: url + 'getAllWards',
        method: 'get',
    })
}
