Преглед на файлове

MDT 相关BUG改造提交

huangwenjie преди 5 години
родител
ревизия
c253742b91
променени са 3 файла, в които са добавени 44 реда и са изтрити 21 реда
  1. 8 1
      readme.md
  2. 33 17
      src/server/endpoints/v2/session.endpoint.js
  3. 3 3
      src/server/handlers/socket.handler.js

+ 8 - 1
readme.md

@ -179,6 +179,12 @@ REST API遵循REST最佳实践,规范命名URL中的每个部分。注意POST
            17、续方咨询随访问卷消息
            18、个人名片
            19、消息转发
            content:{
                source:'zsyy',//来源为中山医院,保留后续扩展
                messageids:'sfdsfsdfsdf,3234234,232343',
                title:'会话标题',
                sessionType:'原会话的会话类型'
            }
            20、康复计划发送
            21、转诊待预约发送
            22、已知悉
@ -191,6 +197,7 @@ REST API遵循REST最佳实践,规范命名URL中的每个部分。注意POST
            29、视屏请求 content:{
                            answer_status:0 //0请求,1已接听
                        }
            30、互联网医院转发
            2101、上门服务-预约信息
            2102、上门服务-修改工单卡片信息
            2103、上门服务-变更工单医生信息
@ -246,7 +253,7 @@ REST API遵循REST最佳实践,规范命名URL中的每个部分。注意POST
            sessionId: 居民code+"_guidance_"+咨询类型
            
            n、type=15 家医咨询求助互联网医院专科医生:全科医生-专科医生-咨询聊天
            sessionId: 全科医生CODE+"_"+专科医生CODE+"_"+咨询类型
            sessionId: 居民code+"_"+全科医生CODE+"_"+"专科医生CODE+"_"+咨询类型
            
            h、type =16 医院在线复诊-视频
            sessionId: 居民code+"_"+咨询code+"_"+咨询类型

+ 33 - 17
src/server/endpoints/v2/session.endpoint.js

@ -85,18 +85,21 @@ router.post("/", function (req, res) {
                        if(payload.hasOwnProperty("mobile"))access_token = payload.access_token;
                        videoconferencing = true;
                        //发送广播,给相关的与会人员
                        for (let j in participants) {
                            let userId = "pcim_"+j;
                            let pc_doctorClient = clientCache.findById(userId);
                            if(pc_doctorClient){
                                log.info("videoconferencing send to "+userId);
                                pc_doctorClient.socket.emit("startVideoconference",{"sessionId":sessionId,"user_id":j});
                            }
                            else{
                                log.info("videoconferencing not find "+userId);
                            }
                        for (let k in participants) {
                            sessions.conversionAarticipant(k, (doctorid) => {
                                let userId = "pcim_"+doctorid;
                                let pc_doctorClient = clientCache.findById(userId);
                                if(pc_doctorClient){
                                    log.info("videoconferencing send to "+userId);
                                    pc_doctorClient.socket.emit("startVideoconference",{"sessionId":sessionId,"user_id":j});
                                }
                                else{
                                    log.info("videoconferencing not find "+userId);
                                }
                            })
                        }
                    }
                }
@ -156,6 +159,7 @@ router.get("/", function (req, res) {
    let userId = req.query.user_id;
    let businessType = req.query.business_type;
    let status = req.query.status;
    let videoconferencing = req.query.videoconferencing;
    if (!page) {
        throw {httpStatus: 406, message: 'Missing page.'};
    }
@ -168,13 +172,25 @@ router.get("/", function (req, res) {
    let sessions = new Sessions();
    ControllerUtil.regModelEventHandler(sessions, res);
    //传入参数齐全走过滤方法
    if(status&&businessType&&userId&&size&&page){
        sessions.getUserStatusSessions(userId,status,businessType,page,size);
    //判断是否是中山医院MDT的请求
    if(videoconferencing && videoconferencing == 1){
        sessions.conversionAarticipant(userId, (doctorid) => {
            //传入参数齐全走过滤方法
            if(status&&businessType&&doctorid&&size&&page){
                sessions.getUserStatusSessions(doctorid,status,businessType,page,size);
            }else{
                sessions.getUserSessions(doctorid, page, size, businessType);
            }
        })
    }else{
        sessions.getUserSessions(userId, page, size, businessType);
        //传入参数齐全走过滤方法
        if(status&&businessType&&userId&&size&&page){
            sessions.getUserStatusSessions(userId,status,businessType,page,size);
        }else{
            sessions.getUserSessions(userId, page, size, businessType);
        }
    }
});
/**

+ 3 - 3
src/server/handlers/socket.handler.js

@ -309,7 +309,7 @@ class SocketHandler {
                let client = clientCache.findBySocket(socket);
                if (client) {
                    //修改居民在线状态
                    users.changUserRedisLoginStatus(original_login_userid,client.clientType,0);
                    // users.changUserRedisLoginStatus(original_login_userid,client.clientType,0);
                }
                log.info(JSON.stringify(errMsg));
                socket.emit(errMsg);
@ -320,7 +320,7 @@ class SocketHandler {
                let client = clientCache.findBySocket(socket);
                if (client) {
                    //修改居民在线状态
                    users.changUserRedisLoginStatus(original_login_userid,client.clientType,0);
                    // users.changUserRedisLoginStatus(original_login_userid,client.clientType,0);
                    log.info('User logout: ' + client.userId);
                    clientCache.removeByUserId(client.userId);
                }
@ -331,7 +331,7 @@ class SocketHandler {
                let patientClient = clientCache.findBySocket(socket);
                if (patientClient) {
                    //修改居民在线状态
                    users.changUserRedisLoginStatus(original_login_userid,client.clientType,0);
                    // users.changUserRedisLoginStatus(original_login_userid,client.clientType,0);
                    log.info("User disconnect: ", patientClient.userId);
                    clientCache.removeByUserSocket(socket);
                }