123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246 |
- import 'dart:convert';
- import 'package:fis_common/helpers/http.dart';
- import 'package:fis_jsonrpc/services/remedical.m.dart';
- import 'package:fis_measure/interfaces/process/items/terms.dart';
- import 'package:fis_measure/interfaces/process/items/types.dart';
- import 'package:fis_measure/process/items/item_meta_convert.dart';
- class ItemCreateTest {
- // ignore: constant_identifier_names
- static const C_JSON_PATH =
- 'http://git.ius.plus:88/fis_front/front_assets_storage/raw/master/measure/items.json';
- // ignore: non_constant_identifier_names
- static List<String> C_Working_Items = [
- // "Distance",
- // "Depth",
- // "Perimeter",
- // "Area",
- "Volume",
- // "Angle",
- // "%Stenosis",
- // "A/B Ratio",
- // "AP",
- // "Thyroid Vol.(L)",
- // "Thyroid Vol.(R)",
- // "Renal Vol.(L)",
- ];
- // ignore: non_constant_identifier_names
- static List<String> C_Working_Types = [
- MeasureTypes.Distance,
- // MeasureTypes.Depth,
- // MeasureTypes.Perimeter,
- // MeasureTypes.Area,
- // MeasureTypes.Angle,
- // MeasureTypes.VolumeThreeDistance,
- // MeasureTypes.AreaPerimeterEllipse,
- // MeasureTypes.AreaPerimeterPolyline,
- // MeasureTypes.Volume,
- ];
- void run() async {
- final txt = await FHttpHelper.downloadString(C_JSON_PATH);
- if (txt == null) {
- print('json not fount');
- return;
- }
- final mapList = jsonDecode(txt) as List<dynamic>;
- final singleList = <String, List<dynamic>>{};
- for (var map in mapList) {
- bool hasChild = false;
- bool hasMulti = false;
- if (map['MethodChildItems'] != null) {
- var list = map['MethodChildItems'] as List;
- if (list.isNotEmpty) {
- hasChild = true;
- }
- }
- if (map['MultiMethodItems'] != null) {
- var list = map['MultiMethodItems'] as List;
- if (list.isNotEmpty) {
- hasMulti = true;
- }
- }
- if (!hasChild && !hasMulti) {
- final typeKey = map['MeasureTypeName']! as String;
- if (!singleList.containsKey(typeKey)) {
- singleList[typeKey] = <dynamic>[];
- }
- final set = singleList[typeKey]!;
- set.add(map);
- }
- }
- final out = jsonEncode(singleList);
- print(out);
- return;
- final workingMaps =
- mapList.where((e) => C_Working_Items.contains(e['Name']));
- // mapList.where((e) => C_Working_Items.contains(e['MeasureTypeName']));
- for (var map in workingMaps) {
- final dto = ItemMetaDTO.fromJson(map);
- // final hasMulti =
- // dto.multiMethodItems != null && dto.multiMethodItems!.isNotEmpty;
- // final hasChild =
- // dto.methodChildItems != null && dto.methodChildItems!.isNotEmpty;
- // if (!hasMulti && !hasChild) {
- // final meta = ItemMetaConverter(dto).output();
- // print(meta.name);
- // }
- final meta = ItemMetaConverter(dto).output();
- print(meta.name);
- }
- }
- }
- class TestItems {
- TestItems._();
- static final C_TEST_ITEMS = [
- "HIP(α) L",
- "HIP(αβ) L",
- "MV Ann Diam",
- "Distance",
- "Cardiac Axis",
- MeasureTerms.Volume,
- MeasureTerms.Stenosis,
- MeasureTerms.AbRatio,
- MeasureTerms.Angle,
- MeasureTerms.Depth,
- MeasureTerms.Perimeter,
- MeasureTerms.Time,
- MeasureTerms.Velocity,
- MeasureTerms.RUV,
- "TJS",
- MeasureTerms.BNS,
- MeasureTerms.CTDR,
- MeasureTerms.CervixL,
- MeasureTerms.CervixW,
- MeasureTerms.CervixH,
- "IVSs",
- "IVPWd",
- "AFI",
- "Tumor Cervix",
- "AxT",
- "FTA",
- ];
- static final C_DISTANCE_ITEMS = [
- "MV Ann Diam",
- "Distance",
- "Aorta Diameter",
- "Renal Len.(L)",
- "Renal Len.(R)",
- "YS",
- "CRL",
- "En.",
- "Nasal Bone",
- "Lat Ventricle",
- "Internal os",
- "CD",
- "TCD",
- "CM",
- "BD",
- "OOD",
- "IOD",
- "APAD",
- "TAD",
- "APTD",
- "TTD",
- "THD",
- "SL",
- "ULNA",
- "RAD",
- "TIB",
- "FIB",
- "Ft",
- "PT",
- "AFI-Q1",
- "AFI-Q2",
- "AFI-Q3",
- "AFI-Q4",
- "IVSd",
- "LVIDd",
- "LVPWd",
- "IVSs",
- "LVIDs",
- "LVPWs",
- "LVd Major",
- "LVd Minor",
- "LVs Major",
- "LVs Minor",
- "LVOT Diam",
- "EPSS",
- "MR Radius",
- "Ao Diam",
- "Ao Arch Diam",
- "Ao Asc Diam",
- "Ao Desc Diam",
- "Ao lsthmus",
- "Ao ST Junct",
- "Ao Sinusus",
- "Ao Annulus",
- "AV_Diam",
- "AV_Cusp",
- "AR Radius",
- "LA Diam",
- "LAd Major",
- "LAd Minor",
- "LAs Major",
- "LAs Minor",
- "RVAWd",
- "RVIDd",
- "RVAWs",
- "RVIDs",
- "RVd Major",
- "RVd Minor",
- "RVs Major",
- "RVs Minor",
- "RVOT Diam",
- "LPA Diam",
- "RPA Diam",
- "MPA Diam",
- "Basal RVD",
- "Mid RVD",
- "Base-Apex L",
- "TV Ann Diam",
- "TR Radius",
- "Pulmonic Diam",
- "Systemic Diam",
- "PV Ann Diam",
- "PR Radius",
- "RAd Major",
- "RAd Minor",
- "RAs Major",
- "RAs Minor",
- "IVC Diam",
- "Systemic Vein Diam",
- "PDA Diam",
- "PFO Diam",
- "VSD Diam",
- "ASD Diam",
- "PEd",
- "Levator Hiatus LR",
- "Levator Hiatus AP",
- "Left LUG",
- "Right LUG",
- "ACT L",
- "ACT R",
- "NF",
- "AP",
- "LVLd",
- "LVLs",
- "A2C LVLd",
- "A2C LVLs",
- "A4C LVLd",
- "A4C LVLs",
- "MR VC Width",
- "PR VC Width",
- "TR VC Width",
- "HW",
- "BS",
- "BSOB",
- "Duct Art Diam",
- "RV Inlet",
- "LV Inlet",
- "SV Diam",
- ];
- }
|