syntax = "proto3";

package com.ywt.gapi.operation_schedule;

option java_multiple_files = true;
option java_package = "com.ywt.gapi.operation_schedule";
option java_outer_classname = "OperationScheduleProto";

message QueryScheduleListRequest {
    int32 userId = 1;
    string hisPatientId = 2;
    int32 pageIndex = 3;
    int32 pageSize = 4;
    int32 status = 5; // 状态：0-进行中，1-已结束
    int32 hospitalId = 6;
}

message QueryScheduleListResponse {
    int32 code = 1;
    string info = 2;
    repeated ScheduleInfo scheduleInfo = 3;
    int32 count = 4; //总条数
    int32 totalPages = 5; //总页数
}

// 手术进度信息
message ScheduleInfo {
    string patientName = 1; // 患者姓名
    int32 age = 2; // 年龄
    int32 gender = 3; // 性别：1-男；2-女
    string hisPatientId = 4; // HIS 患者 id
    string admTime = 5; // 入院时间
    string operTime = 6; // 手术时间
    repeated ScheduleEvent scheduleEvent = 7;
}

// 手术进度事件
message ScheduleEvent {
    string startTime = 1; // 事件开始事件，yyyy-MM-dd hh:mm:ss
    string endTime = 2; // 事件结束事件，yyyy-MM-dd hh:mm:ss
    string eventName = 3; // 事件名称
}


//手术进度消息推送参数
message OperationMessageRequest {
    string hisPatientId = 1;
    int32 hospitalId = 2;
    string eventName = 3;
    string operRoomNo = 4; // 手术间
}


//手术进度消息推送返回结果
message OperationMessageResponse {
    int32 code = 1;
    string info = 2;
}


// 手术进度服务，实现在 rpc 服务
service OperationScheduleService {
    // 查询手术进度列表
    rpc queryScheduleList (QueryScheduleListRequest) returns (QueryScheduleListResponse);
    // 发送手术进度提醒消息
    rpc sendOperationSchedule (OperationMessageRequest) returns (OperationMessageResponse);
}