import request from '../../utils/request'

let url = '/EmrDataMaintenance/'


export function fetchCountryDictionary(currentPage, pageSize, total) {
    return request({
        url: url + 'getElectronicMedicalRecordDataElementSql',
        method: 'get',
        params: {currentPage, pageSize, total}
    })
}

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

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

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

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


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

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

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

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

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


