item_create_test.dart 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. import 'dart:convert';
  2. import 'package:fis_common/helpers/http.dart';
  3. import 'package:fis_jsonrpc/services/remedical.m.dart';
  4. import 'package:fis_measure/interfaces/process/items/terms.dart';
  5. import 'package:fis_measure/interfaces/process/items/types.dart';
  6. import 'package:fis_measure/process/items/item_meta_convert.dart';
  7. class ItemCreateTest {
  8. // ignore: constant_identifier_names
  9. static const C_JSON_PATH =
  10. 'http://git.ius.plus:88/fis_front/front_assets_storage/raw/master/measure/items.json';
  11. // ignore: non_constant_identifier_names
  12. static List<String> C_Working_Items = [
  13. // "Distance",
  14. // "Depth",
  15. // "Perimeter",
  16. // "Area",
  17. "Volume",
  18. // "Angle",
  19. // "%Stenosis",
  20. // "A/B Ratio",
  21. // "AP",
  22. // "Thyroid Vol.(L)",
  23. // "Thyroid Vol.(R)",
  24. // "Renal Vol.(L)",
  25. ];
  26. // ignore: non_constant_identifier_names
  27. static List<String> C_Working_Types = [
  28. MeasureTypes.Distance,
  29. // MeasureTypes.Depth,
  30. // MeasureTypes.Perimeter,
  31. // MeasureTypes.Area,
  32. // MeasureTypes.Angle,
  33. // MeasureTypes.VolumeThreeDistance,
  34. // MeasureTypes.AreaPerimeterEllipse,
  35. // MeasureTypes.AreaPerimeterPolyline,
  36. // MeasureTypes.Volume,
  37. ];
  38. void run() async {
  39. final txt = await FHttpHelper.downloadString(C_JSON_PATH);
  40. if (txt == null) {
  41. print('json not fount');
  42. return;
  43. }
  44. final mapList = jsonDecode(txt) as List<dynamic>;
  45. final singleList = <String, List<dynamic>>{};
  46. for (var map in mapList) {
  47. bool hasChild = false;
  48. bool hasMulti = false;
  49. if (map['MethodChildItems'] != null) {
  50. var list = map['MethodChildItems'] as List;
  51. if (list.isNotEmpty) {
  52. hasChild = true;
  53. }
  54. }
  55. if (map['MultiMethodItems'] != null) {
  56. var list = map['MultiMethodItems'] as List;
  57. if (list.isNotEmpty) {
  58. hasMulti = true;
  59. }
  60. }
  61. if (!hasChild && !hasMulti) {
  62. final typeKey = map['MeasureTypeName']! as String;
  63. if (!singleList.containsKey(typeKey)) {
  64. singleList[typeKey] = <dynamic>[];
  65. }
  66. final set = singleList[typeKey]!;
  67. set.add(map);
  68. }
  69. }
  70. final out = jsonEncode(singleList);
  71. print(out);
  72. return;
  73. final workingMaps =
  74. mapList.where((e) => C_Working_Items.contains(e['Name']));
  75. // mapList.where((e) => C_Working_Items.contains(e['MeasureTypeName']));
  76. for (var map in workingMaps) {
  77. final dto = ItemMetaDTO.fromJson(map);
  78. // final hasMulti =
  79. // dto.multiMethodItems != null && dto.multiMethodItems!.isNotEmpty;
  80. // final hasChild =
  81. // dto.methodChildItems != null && dto.methodChildItems!.isNotEmpty;
  82. // if (!hasMulti && !hasChild) {
  83. // final meta = ItemMetaConverter(dto).output();
  84. // print(meta.name);
  85. // }
  86. final meta = ItemMetaConverter(dto).output();
  87. print(meta.name);
  88. }
  89. }
  90. }
  91. class TestItems {
  92. TestItems._();
  93. static final C_TEST_ITEMS = [
  94. "HIP(α) L",
  95. "HIP(αβ) L",
  96. "MV Ann Diam",
  97. "Distance",
  98. "Cardiac Axis",
  99. MeasureTerms.Volume,
  100. MeasureTerms.Stenosis,
  101. MeasureTerms.AbRatio,
  102. MeasureTerms.Angle,
  103. MeasureTerms.Depth,
  104. MeasureTerms.Perimeter,
  105. MeasureTerms.Time,
  106. MeasureTerms.Velocity,
  107. MeasureTerms.RUV,
  108. "TJS",
  109. MeasureTerms.BNS,
  110. MeasureTerms.CTDR,
  111. MeasureTerms.CervixL,
  112. MeasureTerms.CervixW,
  113. MeasureTerms.CervixH,
  114. "IVSs",
  115. "IVPWd",
  116. "AFI",
  117. "Tumor Cervix",
  118. "AxT",
  119. "FTA",
  120. ];
  121. static final C_DISTANCE_ITEMS = [
  122. "MV Ann Diam",
  123. "Distance",
  124. "Aorta Diameter",
  125. "Renal Len.(L)",
  126. "Renal Len.(R)",
  127. "YS",
  128. "CRL",
  129. "En.",
  130. "Nasal Bone",
  131. "Lat Ventricle",
  132. "Internal os",
  133. "CD",
  134. "TCD",
  135. "CM",
  136. "BD",
  137. "OOD",
  138. "IOD",
  139. "APAD",
  140. "TAD",
  141. "APTD",
  142. "TTD",
  143. "THD",
  144. "SL",
  145. "ULNA",
  146. "RAD",
  147. "TIB",
  148. "FIB",
  149. "Ft",
  150. "PT",
  151. "AFI-Q1",
  152. "AFI-Q2",
  153. "AFI-Q3",
  154. "AFI-Q4",
  155. "IVSd",
  156. "LVIDd",
  157. "LVPWd",
  158. "IVSs",
  159. "LVIDs",
  160. "LVPWs",
  161. "LVd Major",
  162. "LVd Minor",
  163. "LVs Major",
  164. "LVs Minor",
  165. "LVOT Diam",
  166. "EPSS",
  167. "MR Radius",
  168. "Ao Diam",
  169. "Ao Arch Diam",
  170. "Ao Asc Diam",
  171. "Ao Desc Diam",
  172. "Ao lsthmus",
  173. "Ao ST Junct",
  174. "Ao Sinusus",
  175. "Ao Annulus",
  176. "AV_Diam",
  177. "AV_Cusp",
  178. "AR Radius",
  179. "LA Diam",
  180. "LAd Major",
  181. "LAd Minor",
  182. "LAs Major",
  183. "LAs Minor",
  184. "RVAWd",
  185. "RVIDd",
  186. "RVAWs",
  187. "RVIDs",
  188. "RVd Major",
  189. "RVd Minor",
  190. "RVs Major",
  191. "RVs Minor",
  192. "RVOT Diam",
  193. "LPA Diam",
  194. "RPA Diam",
  195. "MPA Diam",
  196. "Basal RVD",
  197. "Mid RVD",
  198. "Base-Apex L",
  199. "TV Ann Diam",
  200. "TR Radius",
  201. "Pulmonic Diam",
  202. "Systemic Diam",
  203. "PV Ann Diam",
  204. "PR Radius",
  205. "RAd Major",
  206. "RAd Minor",
  207. "RAs Major",
  208. "RAs Minor",
  209. "IVC Diam",
  210. "Systemic Vein Diam",
  211. "PDA Diam",
  212. "PFO Diam",
  213. "VSD Diam",
  214. "ASD Diam",
  215. "PEd",
  216. "Levator Hiatus LR",
  217. "Levator Hiatus AP",
  218. "Left LUG",
  219. "Right LUG",
  220. "ACT L",
  221. "ACT R",
  222. "NF",
  223. "AP",
  224. "LVLd",
  225. "LVLs",
  226. "A2C LVLd",
  227. "A2C LVLs",
  228. "A4C LVLd",
  229. "A4C LVLs",
  230. "MR VC Width",
  231. "PR VC Width",
  232. "TR VC Width",
  233. "HW",
  234. "BS",
  235. "BSOB",
  236. "Duct Art Diam",
  237. "RV Inlet",
  238. "LV Inlet",
  239. "SV Diam",
  240. ];
  241. }