|
@@ -1,10 +1,14 @@
|
|
|
import 'dart:typed_data';
|
|
|
|
|
|
import 'package:fis_common/event/event_type.dart';
|
|
|
+import 'package:fis_i18n/i18n.dart';
|
|
|
import 'package:fis_jsonrpc/rpc.dart';
|
|
|
import 'package:fis_measure/interfaces/process/items/item_metas.dart';
|
|
|
+import 'package:fis_measure/interfaces/process/workspace/application.dart';
|
|
|
import 'package:fis_measure/process/workspace/measure_handler.dart';
|
|
|
+import 'package:fis_measure/utils/prompt_box.dart';
|
|
|
import 'package:fis_measure/view/measure/measure_config/measure_configuation_page.dart';
|
|
|
+import 'package:get/get.dart';
|
|
|
import 'package:vid/us/vid_us_mode.dart';
|
|
|
|
|
|
class MeasureImageData {
|
|
@@ -73,10 +77,18 @@ abstract class IMeasureDataController {
|
|
|
List<ItemMeta> get curItemMetaList;
|
|
|
set curItemMetaList(List<ItemMeta> value);
|
|
|
|
|
|
- /// 注释工具list
|
|
|
+ /// 当前所有的注释项
|
|
|
List<String> get annotationList;
|
|
|
set annotationList(List<String> value);
|
|
|
|
|
|
+ /// 所有的预置的注释项
|
|
|
+ PresetCommentItemResultDTO get allPresetAnnotationList;
|
|
|
+ set allPresetAnnotationList(PresetCommentItemResultDTO value);
|
|
|
+
|
|
|
+ /// 当前模式下预置的注释项
|
|
|
+ List<String> get currPresetAnnotationList;
|
|
|
+ set currPresetAnnotationList(List<String> value);
|
|
|
+
|
|
|
/// 注释List
|
|
|
List<CommentItemDTO> get measureCommentItemResult;
|
|
|
set measureCommentItemResult(List<CommentItemDTO> value);
|
|
@@ -120,7 +132,10 @@ class MeasureDataController implements IMeasureDataController {
|
|
|
List<VidUsMode> _applicationModes = [];
|
|
|
List<MeasureModeDTO> _availableModes = [];
|
|
|
List<ItemMeta> _curItemMetaList = [];
|
|
|
- List<String> _getAnnotationList = [];
|
|
|
+ List<String> _annotationList = [];
|
|
|
+ List<String> _presetAnnotationList = [];
|
|
|
+ PresetCommentItemResultDTO _allPresetAnnotationList =
|
|
|
+ PresetCommentItemResultDTO();
|
|
|
List<CommentItemDTO> _measureCommentItemResult = [];
|
|
|
List<ItemMetaGroup> _itemMetaListGroup = [];
|
|
|
@override
|
|
@@ -174,15 +189,34 @@ class MeasureDataController implements IMeasureDataController {
|
|
|
}
|
|
|
|
|
|
@override
|
|
|
- List<String> get annotationList => _getAnnotationList;
|
|
|
+ List<String> get annotationList => _annotationList;
|
|
|
@override
|
|
|
set annotationList(List<String> value) {
|
|
|
- if (value != _getAnnotationList) {
|
|
|
- _getAnnotationList = value;
|
|
|
+ if (value != _annotationList) {
|
|
|
+ _annotationList = value;
|
|
|
_onGetCommentsListChanged();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @override
|
|
|
+ List<String> get currPresetAnnotationList => _presetAnnotationList;
|
|
|
+ @override
|
|
|
+ set currPresetAnnotationList(List<String> value) {
|
|
|
+ if (value != _presetAnnotationList) {
|
|
|
+ _presetAnnotationList = value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @override
|
|
|
+ PresetCommentItemResultDTO get allPresetAnnotationList =>
|
|
|
+ _allPresetAnnotationList;
|
|
|
+ @override
|
|
|
+ set allPresetAnnotationList(PresetCommentItemResultDTO value) {
|
|
|
+ if (value != _allPresetAnnotationList) {
|
|
|
+ _allPresetAnnotationList = value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@override
|
|
|
List<CommentItemDTO> get measureCommentItemResult =>
|
|
|
_measureCommentItemResult;
|
|
@@ -332,17 +366,50 @@ class MeasureDataController implements IMeasureDataController {
|
|
|
}
|
|
|
|
|
|
MeasureDataController(
|
|
|
- this.getRemedicalList,
|
|
|
- this.getImageInfo,
|
|
|
- this.getMeasureApplication,
|
|
|
- this.saveUserDefinedMeasureApplicationAsync,
|
|
|
- this.saveImage,
|
|
|
- this.saveMeasureSystemSettingAsync,
|
|
|
- this.getMeasureSystemSettingAsync,
|
|
|
- this.shareImage,
|
|
|
- this.getCommentsByApplicationAsync,
|
|
|
- this.saveUserDefinedCommentsAsync,
|
|
|
- );
|
|
|
+ this.getRemedicalList,
|
|
|
+ this.getImageInfo,
|
|
|
+ this.getMeasureApplication,
|
|
|
+ this.saveUserDefinedMeasureApplicationAsync,
|
|
|
+ this.saveImage,
|
|
|
+ this.saveMeasureSystemSettingAsync,
|
|
|
+ this.getMeasureSystemSettingAsync,
|
|
|
+ this.shareImage,
|
|
|
+ this.getCommentsByApplicationAsync,
|
|
|
+ this.saveUserDefinedCommentsAsync,
|
|
|
+ this.getPresetCommentsAsync,
|
|
|
+ {this.needInitAnnotation = false}) {
|
|
|
+ _init();
|
|
|
+ }
|
|
|
+ _init() async {
|
|
|
+ if (needInitAnnotation) {
|
|
|
+ // TODO:[Gavin] 初始化时获取所有注释
|
|
|
+ // _initPresetAnnotation();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 初始化预设注释
|
|
|
+ void _initPresetAnnotation() async {
|
|
|
+ var result = await getPresetCommentsAsync();
|
|
|
+ if (result != null) {
|
|
|
+ _allPresetAnnotationList = result;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ void _getPresetAnnotationByCategoryName(String categoryName) {
|
|
|
+ // TODO:[Gavin] 根据分类名称、应用名 获取预设注释【大概率不走这套方案、暂时留着】
|
|
|
+ _presetAnnotationList = [];
|
|
|
+ _allPresetAnnotationList.presetCommentItems?.forEach((element) {
|
|
|
+ element.categoryList?.forEach((category) {
|
|
|
+ if (category == categoryName) {
|
|
|
+ if (element.text is String) {
|
|
|
+ _presetAnnotationList.add(element.text!);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ bool needInitAnnotation;
|
|
|
|
|
|
///参数1:patientCode,参数2:recordCode,参数3:token
|
|
|
Future<List<RemedicalItemList>> Function(String, String, String)
|
|
@@ -375,8 +442,55 @@ class MeasureDataController implements IMeasureDataController {
|
|
|
Future<CommentItemResultDTO?> Function(String, String)
|
|
|
getCommentsByApplicationAsync;
|
|
|
|
|
|
- Future<bool?> Function(String, String, List<CommentItemDTO>)
|
|
|
- saveUserDefinedCommentsAsync;
|
|
|
+ /// 获取预置的注释项
|
|
|
+ Future<PresetCommentItemResultDTO?> Function() getPresetCommentsAsync;
|
|
|
+
|
|
|
+ Future<bool?> Function(
|
|
|
+ String,
|
|
|
+ String,
|
|
|
+ List<CommentItemDTO>?,
|
|
|
+ List<CommentItemDTO>?,
|
|
|
+ List<UpdateCommentItemDTO>?) saveUserDefinedCommentsAsync;
|
|
|
+
|
|
|
+ /// 添加注释项
|
|
|
+ Future<bool?> addAnnotation(
|
|
|
+ IApplication application, String annotationName) async {
|
|
|
+ final result = await saveUserDefinedCommentsAsync(
|
|
|
+ application.applicationName,
|
|
|
+ application.categoryName,
|
|
|
+ [CommentItemDTO(text: annotationName)],
|
|
|
+ null,
|
|
|
+ null);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// 删除注释项
|
|
|
+ Future<bool?> deleteAnnotation(
|
|
|
+ IApplication application, String annotationName) async {
|
|
|
+ final result = await saveUserDefinedCommentsAsync(
|
|
|
+ application.applicationName,
|
|
|
+ application.categoryName,
|
|
|
+ null,
|
|
|
+ [CommentItemDTO(text: annotationName)],
|
|
|
+ null);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// 更新注释项
|
|
|
+ Future<bool?> updateAnnotation(IApplication application,
|
|
|
+ String oldAnnotationName, String newAnnotationName) async {
|
|
|
+ final result = await saveUserDefinedCommentsAsync(
|
|
|
+ application.applicationName,
|
|
|
+ application.categoryName,
|
|
|
+ null,
|
|
|
+ null,
|
|
|
+ [
|
|
|
+ UpdateCommentItemDTO(
|
|
|
+ oldText: oldAnnotationName, newText: newAnnotationName)
|
|
|
+ ],
|
|
|
+ );
|
|
|
+ return result;
|
|
|
+ }
|
|
|
|
|
|
void _onRemedicalListChanged() {
|
|
|
remedicalListResultChanged.emit(this, remedicalList);
|