123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- import 'package:flyinsono/lab/components/classify_data_selector/classify_data_model.dart';
- import 'package:flyinsono/lab/mock_data/mock_data.dart';
- import 'package:fis_measure/interfaces/process/items/item_metas.dart';
- import 'package:fis_measure/configs/patient.dart';
- import 'package:fis_jsonrpc/rpc.dart';
- import 'package:fis_measure/interfaces/process/items/types.dart';
- class MockRPC {
- /// 设置网络情况
- static const int rpcDelayMilliseconds = excellent;
- /// 网络延迟预设
- static const int excellent = 50;
- static const int fast = 300;
- static const int slow = 2000;
- static const int bad = 10000;
- /// 获取检查图片列表
- static Future<List<ImageModel>> getImageListByRecordId(
- String recordId) async {
- await Future.delayed(Duration(milliseconds: rpcDelayMilliseconds));
- // TODO mock
- GlobalPatientConfig.height = 80;
- GlobalPatientConfig.weight = 36;
- GlobalPatientConfig.updateBSAbyWH();
- return MockData.demoVidList
- .map((e) => ImageModel(
- id: e.id,
- fileTypeName: e.sampleRemedicalFileDataTypeEnum ==
- SampleRemedicalFileDataTypeEnum.AnalysisImage
- ? "URMVRD"
- : "VRD",
- createTime: DateTime.now(),
- description: (e.id +
- " " +
- (e.sampleRemedicalFileDataTypeEnum ==
- SampleRemedicalFileDataTypeEnum.AnalysisImage
- ? "URMVRD"
- : "VRD") +
- " " +
- DateTime.now().toString().substring(0, 16)),
- vidDataInfo: e,
- fileDataType: e.sampleRemedicalFileDataTypeEnum,
- ))
- .toList();
- }
- }
- class ProjectModel extends ClassifyDataBaseModel {
- final String id;
- final ProjectType type;
- final String projectIntroduction;
- final OrganizationPatientTypeEnum organizationPatientType;
- ProjectModel({
- required this.id,
- required this.type,
- required String name,
- required this.projectIntroduction,
- required this.organizationPatientType,
- }) : super(name);
- }
- enum ProjectType {
- created,
- joined,
- }
- class PatientModel extends ClassifyDataBaseModel {
- final String id;
- final String fileSize;
- final String code;
- final bool isExistUrmData;
- PatientModel({
- required this.id,
- required this.fileSize,
- required this.code,
- required String name,
- required this.isExistUrmData,
- }) : super(name);
- }
- class RecordModel {
- final String id;
- final String description;
- final int imageCount;
- final DateTime createTime;
- final List<ImageModel> images;
- final List<DataItemDTO> patientInfo;
- final PatientModel patient;
- final OrganizationPatientTypeEnum organizationPatientTypeEnum;
- RecordModel({
- required this.id,
- required this.description,
- required this.imageCount,
- required this.createTime,
- required this.images,
- required this.patient,
- required this.patientInfo,
- required this.organizationPatientTypeEnum,
- });
- }
- class ImageModel {
- final String id;
- final String fileTypeName;
- final DateTime createTime;
- final String description;
- final VidDataInfo vidDataInfo;
- final String? urmOriginalCode;
- ///文件类型,单帧或多帧vid、图像、视频
- final SampleRemedicalFileDataTypeEnum fileDataType;
- ImageModel({
- required this.id,
- required this.fileTypeName,
- required this.createTime,
- required this.description,
- required this.vidDataInfo,
- required this.fileDataType,
- this.urmOriginalCode,
- });
- }
- class VidDataInfo {
- VidDataInfo({
- required this.id,
- required this.vidUrl,
- required this.coverUrl,
- required this.imageType,
- required this.sampleRemedicalFileDataTypeEnum,
- this.extendVidUrls = const [],
- });
- final String id;
- final String vidUrl;
- final String coverUrl;
- final ImageType imageType;
- final SampleRemedicalFileDataTypeEnum sampleRemedicalFileDataTypeEnum;
- final List<String> extendVidUrls;
- }
- enum ImageType {
- Measure_Result,
- Video,
- URM,
- URM_Result,
- Vid,
- }
- class MeasureItemInfo {
- ItemMeta itemMeta;
- String description;
- MeasureItemInfo({
- required this.itemMeta,
- required this.description,
- });
- factory MeasureItemInfo.empty() {
- final emptyItem = ItemMeta(
- "EmptyItem",
- measureType: MeasureTypes.Empty,
- description: "",
- outputs: [],
- );
- return MeasureItemInfo(
- itemMeta: emptyItem,
- description: "emptyItem",
- );
- }
- }
|