const medicalTermDefaultMap = {
    "disease": "高血压3级",
    "symptom": "背痛",
    "operation": "动脉缝合术",
    "drug": "地辛高",
    "lis": "白细胞计数",
    "pacs": "肝彩超",
}

function saveSessionVar(name, value) {
    sessionStorage.setItem(name, JSON.stringify(value));
}

function getSessionVar(name) {
    return sessionStorage.getItem(name) && JSON.parse(sessionStorage.getItem(name));
}

function deleteSessionVar(name) {
    return sessionStorage.removeItem(name);
}

function clearSessionVar() {
    sessionStorage.clear();
}

function saveLocalVar(name, value) {
    localStorage.setItem(name, JSON.stringify(value));
}

function getLocalVar(name) {
    return localStorage.getItem(name) && JSON.parse(localStorage.getItem(name));
}


function deleteLocalVar(name) {
    return localStorage.removeItem(name);
}

function clearLocalVar() {
    localStorage.clear();
}

module.exports = {
    saveSessionVar,
    getSessionVar,
    deleteSessionVar,
    clearSessionVar,
    saveLocalVar,
    getLocalVar,
    deleteLocalVar,
    clearLocalVar,
    medicalTermDefaultMap
}