MeiZhongYiHeService.proto 4.81 KB
syntax = "proto3";

option java_multiple_files = true;
option java_package = "com.infoloop.rpc.meizhongyiheservice";
option java_outer_classname = "MeiZhongYiHeServiceProto";
option objc_class_prefix = "OP";

package com.infoloop.rpc.meizhongyiheservice;

service MeiZhongYiHeServiceRpc {
  rpc GetAllHospitals (GetAllHospitalsRpcRequest) returns (GetAllHospitalsRpcResponse) {}
  rpc GetHospitalDepartmentsByHospitalCode (GetHospitalDepartmentsByHospitalCodeRpcRequest) returns (GetHospitalDepartmentsByHospitalCodeRpcResponse) {}
  rpc GetCustomersByCondition (GetCustomersByConditionRpcRequest) returns (GetCustomersByConditionRpcResponse) {}
  rpc GetCustomerDetailById (GetCustomerDetailByIdRpcRequest) returns (GetCustomerDetailByIdRpcResponse) {}
  rpc GetCustomerAllergiesByCustomerIds (GetCustomerAllergiesByCustomerIdsRpcRequest) returns (GetCustomerAllergiesByCustomerIdsRpcResponse) {}
  rpc GetCustomerMedicalAdvicesByHospitalRecordIds (GetCustomerMedicalAdvicesByHospitalRecordIdsRpcRequest) returns (GetCustomerMedicalAdvicesByHospitalRecordIdsRpcResponse) {}
  rpc GetAllHospitalAllergies (GetAllHospitalAllergiesRpcRequest) returns (GetAllHospitalAllergiesRpcResponse) {}
  rpc GetHospitalMedicalAdvicesByType (GetHospitalMedicalAdvicesByTypeRpcRequest) returns (GetHospitalMedicalAdvicesByTypeRpcResponse) {}
}

message GetAllHospitalsRpcRequest {

}

message GetAllHospitalsRpcResponse {
  repeated Hospital hospitals = 1;
}

message Hospital {
  string hospitalId = 1;
  string hospitalCode = 2;
  string hospitalName = 3;
  string hospitalAddress = 4;
}

message GetHospitalDepartmentsByHospitalCodeRpcRequest {
  string hospitalCode = 1;
}

message GetHospitalDepartmentsByHospitalCodeRpcResponse {
  repeated HospitalDepartment departments = 1;
}

message HospitalDepartment {
  string departmentId = 1;
  string departmentCode = 2;
  string departmentName = 3;
  string departmentContent = 4;
  string departmentAddress = 5;
  string hospitalId = 6;
  string hospitalCode = 7;
}

message GetCustomersByConditionRpcRequest {
  repeated string deptCode = 1;
}

enum HospitalStatus {
  PRE_ADMISSION = 0;
  CURRENT = 1;
  CANCEL = 2;
  DISCHARGED = 3;
}

enum CustomerSex {
  UNKNOWN_SEX = 0;
  MALE = 1;
  FEMALE = 2;
}

message Customer {
  string customerId = 1;
  string customerName = 2;
  CustomerSex customerSex = 3;
  string identityCardNo = 4;
  int32 age = 5;
  string height = 6;
  string weight = 7;
  string mobile = 8;
  int64 birthday = 9;
  CustomerHospitalRecord customerHospitalRecord = 10;
}

message GetCustomersByConditionRpcResponse {
  repeated Customer customers = 1;
}

message CustomerHospitalRecord {
  string hospitalRecordId = 1;
  string departmentCode = 2;
  string departmentName = 3;
  string roomNo = 4;
  int64 hospitalTime = 5;
  int64 expectDischargeTime = 6;
  int64 actualDischargeTime = 7;
  int64 dueDate = 8;
  int64 birthDate = 9;
  string hospitalCode = 10;
  HospitalStatus hospitalStatus = 11;
}

message GetCustomerDetailByIdRpcRequest {
  string customerId = 1;
  string hospitalRecordId = 2;
}

message GetCustomerDetailByIdRpcResponse {
  Customer customer = 1;
}

message GetCustomerAllergiesByCustomerIdsRpcRequest {
  repeated string customerIds = 1;
}

message CustomerAllergy {
  string customerId = 1;
  repeated Allergy allergies = 2;
}

message Allergy {
  string allergyId = 1;
  string allergyCode = 2;
  string allergyDescription = 3;
  int64 createdAt = 4;
}

message GetCustomerAllergiesByCustomerIdsRpcResponse {
  repeated CustomerAllergy customerAllergies = 1;
}

message GetCustomerMedicalAdvicesByHospitalRecordIdsRpcRequest {
  repeated string hospitalRecordIds = 1;
}

message CustomerMedicalAdvice {
  string customerId = 1;
  string hospitalRecordId = 2;
  repeated MedicalAdvice medicalAdvices = 3;
}

message MedicalAdvice {
  string medicalAdviceId = 1;
  string medicalAdviceCode = 2;
  string medicalAdvice = 3;
  string connotation = 4;
  int64 medicalTime = 5;
  int64 effectDate = 6;
  MedicalAdviceTypeEnum medicalAdviceType = 7;
}

message GetCustomerMedicalAdvicesByHospitalRecordIdsRpcResponse {
  repeated CustomerMedicalAdvice customerMedicalAdvices = 1;
}

message GetAllHospitalAllergiesRpcRequest {
}

message GetAllHospitalAllergiesRpcResponse {
  repeated HospitalAllergy hospitalAllergies = 1;
}

message HospitalAllergy {
  string allergyId = 1;
  string allergyCode = 2;
  string allergyDescription = 3;
}

enum MedicalAdviceTypeEnum {
  UNKNOWN_MEDICAL_ADVICE_TYPE = 0;
  DIET = 1; //饮食医嘱
  CLINICAL = 2; //临床文字医嘱
}

message GetHospitalMedicalAdvicesByTypeRpcRequest {
  MedicalAdviceTypeEnum type = 1;
}

message GetHospitalMedicalAdvicesByTypeRpcResponse {
  repeated HospitalMedicalAdvice hospitalMedicalAdvices = 1;
}

message HospitalMedicalAdvice {
  string medicalAdviceId = 1;
  string medicalAdviceCode = 2;
  string medicalAdvice = 3;
  string connotation = 4;
  string unit = 5;
}