import 'package:fis_jsonrpc/rpc.dart';
import 'package:flyinsono/lab/mock_data/mock_rpc.dart';

abstract class IProjectManager {
  /// 新增研究项目
  Future<String?> createResearchProjectAsync({
    required String projectName,
    required OrganizationPatientTypeEnum projectType,
    required String projectIntroduction,
  });

  /// 编辑研究项目
  Future<bool?> updateResearchProjectAsync({
    required String projectCode,
    required String projectName,
    OrganizationPatientTypeEnum? projectType,
    String? projectIntroduction,
  });

  /// 删除研究项目
  Future<bool?> deleteResearchProjectRequest({
    required String projectCode,
  });

  /// 获取研究项目
  Future<List<ResearchProjectBaseDTO>?> getResearchProjectListAsync({
    required String keyWord,
    required ResearchProjectSearchTypeEnum searchType,
  });

  /// 查询所有用户集合（分页）
  Future<PageCollection<UserBaseDTO>?> getUserBaseInfoPagesAsync({
    required String keyWord,
    required int pageIndex,
    required int pageSize,
  });

  /// 邀请成员
  Future<bool?> inviteResearchProjectMembersAsync({
    required String projectCode,
    required List<String> memberCodes,
  });

  /// 邀请成员
  Future<bool?> removeResearchProjectMembersAsync({
    required String projectCode,
    required List<String> memberCodes,
  });

  /// 项目详情
  Future<ResearchProjectDTO?> getResearchProjectDetail({
    required String projectCode,
  });

  ///删除样本
  Future<bool> deleteSample(
    String projectCode,
    String patientCode,
  );

  /// 查询项目数据
  Future<PageCollection<ResearchProjectDataDTO>?>
      getResearchProjectDataPagesAsync({
    required String keyWord,
    required int pageIndex,
    required int pageSize,
    required int sort,
    required String projectCode,
  });

  /// 查询样本数据
  Future<List<SampleDetail>?> getSampleDetailList({
    required String patientCode,
  });

  /// 删除检查
  Future<bool?> deleteRecordAsync({
    required String recordCode,
    required String projectCode,
  });

  /// 获取检查详情
  Future<BaseSampleDetail?> getSampleDetailAsync({
    required String recordCode,
  });

  /// 修改检查
  Future<bool?> modifySampleDetailAsync({
    required String recordCode,
    required List<PatientInfoExt>? patientInfoExtList,
    required List<DataItemDTO>? patientInfo,
  });

  /// 获取项目时间轴
  Future<List<TimeAxisDetail>?> getTimeAxisByProjectAsync({
    required String projectCode,
  });

  /// 获取样本图像
  Future<List<SampleRemedicalInfoDTO>?> getSampleImgList({
    required String patientCode,
  });

  Future<List<RecordModel>> getRecordDetail({
    required String patientCode,
    required PatientModel selectedPatient,
    required OrganizationPatientTypeEnum patientType,
  });

  Future<List<SampleRemedicalInfoDTO>?> getUrmRemedicalInfosAsync(
      String urmRemedicalCode);

  ///保存用户URM配置信息
  Future<bool> saveUserUrmConfigAsync(String code, String configName,
      int configType, List<UrmProcessConfigDTO>? configInfo);

  ///删除用户URM配置信息
  Future<bool> deletePatientUrmConfigAsync(String code);

  ///设置默认用户URM配置信息
  Future<bool> setDefaultPatientUrmConfigAsync(String code);

  ///查看用户URM配置集合
  Future<List<UserUrmConfigDTO>> getUserUrmConfigsAsync();

  ///验证是否有权限或者项目是否有效
  Future<bool?> validateResearchProjectAuthAsync({required String projectCode});
}
