consultations_record_data.dart 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. import 'package:fis_jsonrpc/rpc.dart';
  2. /// 检查数据结构
  3. class ConsultationsRecordData {
  4. String? recordCode;
  5. RecordStatusEnum recordStatus;
  6. ReferralTypeEnum referralType;
  7. String? patientCode;
  8. String? patientName;
  9. String? age;
  10. String? sex;
  11. String? devicePatientID;
  12. String? deviceCode;
  13. String? deviceName;
  14. String? rootOrganizationCode;
  15. String? rootOrganizationName;
  16. String? languge;
  17. DateTime? createTime;
  18. bool isCanCreateReport;
  19. bool canCollcetImg;
  20. bool isCollecting;
  21. bool canScreenshot;
  22. List<DiagnosisInfoDTO> diagnosisInfos;
  23. double? score;
  24. ConsultationsRecordData({
  25. this.recordCode,
  26. this.recordStatus = RecordStatusEnum.NotScanned,
  27. this.referralType = ReferralTypeEnum.Normal,
  28. this.patientCode,
  29. this.patientName,
  30. this.age,
  31. this.sex,
  32. this.devicePatientID,
  33. this.deviceCode,
  34. this.deviceName,
  35. this.rootOrganizationCode,
  36. this.rootOrganizationName,
  37. this.languge,
  38. this.createTime,
  39. this.isCanCreateReport = false,
  40. this.canCollcetImg = false,
  41. this.isCollecting = false,
  42. this.canScreenshot = false,
  43. this.diagnosisInfos = const [],
  44. this.score,
  45. });
  46. factory ConsultationsRecordData.fromJson(Map<String, dynamic> map) {
  47. return ConsultationsRecordData(
  48. recordCode: map['RecordCode'],
  49. recordStatus: RecordStatusEnum.values
  50. .firstWhere((e) => e.index == map['RecordStatus']),
  51. referralType: ReferralTypeEnum.values
  52. .firstWhere((e) => e.index == map['ReferralType']),
  53. patientCode: map['PatientCode'],
  54. patientName: map['PatientName'],
  55. age: map['Age'],
  56. sex: map['Sex'],
  57. devicePatientID: map['DevicePatientID'],
  58. deviceCode: map['DeviceCode'],
  59. deviceName: map['DeviceName'],
  60. rootOrganizationCode: map['RootOrganizationCode'],
  61. rootOrganizationName: map['RootOrganizationName'],
  62. languge: map['Languge'],
  63. isCanCreateReport: map['CanCreateReport'] ?? false,
  64. canCollcetImg: map['CanCollcetImg'] ?? false,
  65. isCollecting: map['IsCollecting'] ?? false,
  66. canScreenshot: map['CanScreenshot'] ?? false,
  67. createTime:
  68. map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  69. score: map['Score'],
  70. );
  71. }
  72. Map<String, dynamic> toJson() {
  73. final map = Map<String, dynamic>();
  74. if (recordCode != null) map['RecordCode'] = recordCode;
  75. map['RecordStatus'] = recordStatus.index;
  76. map['ReferralType'] = referralType.index;
  77. map['CanCreateReport'] = isCanCreateReport;
  78. if (patientCode != null) map['PatientCode'] = patientCode;
  79. if (patientName != null) map['PatientName'] = patientName;
  80. if (age != null) map['Age'] = age;
  81. if (sex != null) map['Sex'] = sex;
  82. if (devicePatientID != null) map['DevicePatientID'] = devicePatientID;
  83. if (deviceCode != null) map['DeviceCode'] = deviceCode;
  84. if (deviceName != null) map['DeviceName'] = deviceName;
  85. map['IsCollecting'] = isCollecting;
  86. map['CanCollcetImg'] = canCollcetImg;
  87. if (rootOrganizationCode != null)
  88. map['RootOrganizationCode'] = rootOrganizationCode;
  89. if (rootOrganizationName != null)
  90. map['RootOrganizationName'] = rootOrganizationName;
  91. if (languge != null) map['Languge'] = languge;
  92. return map;
  93. }
  94. }
  95. class UserDoctorModel {
  96. UserDoctorModel({
  97. required this.name,
  98. required this.code,
  99. this.roleCodes,
  100. this.fieldList,
  101. this.headImageUrl,
  102. this.roleName,
  103. });
  104. final String name;
  105. final String code;
  106. final List<String>? roleCodes;
  107. final List<String>? fieldList;
  108. final String? roleName;
  109. // final List<String>? fieldList;
  110. final String? headImageUrl;
  111. }
  112. class ReferralHistoryDetailData {
  113. String? referralOutOrganizationName;
  114. String? referralOutUserName;
  115. String? referralInOrganizationName;
  116. String? referralInUserName;
  117. String? code;
  118. String? recordCode;
  119. String? referralOutUserCode;
  120. String? referralOutOrganizationCode;
  121. String? referralInUserCode;
  122. String? referralInOrganizationCode;
  123. RecordReferralStatusEnum? referralStatus =
  124. RecordReferralStatusEnum.ReferralIn;
  125. DateTime? referralTime;
  126. String? subjectMatter;
  127. DateTime? createTime;
  128. DateTime? updateTime;
  129. String? patientName;
  130. ReferralHistoryDetailData({
  131. this.referralOutOrganizationName,
  132. this.referralOutUserName,
  133. this.referralInOrganizationName,
  134. this.referralInUserName,
  135. this.code,
  136. this.recordCode,
  137. this.referralOutUserCode,
  138. this.referralOutOrganizationCode,
  139. this.referralInUserCode,
  140. this.referralInOrganizationCode,
  141. this.referralStatus,
  142. this.referralTime,
  143. this.subjectMatter,
  144. this.createTime,
  145. this.updateTime,
  146. this.patientName,
  147. }) : super();
  148. factory ReferralHistoryDetailData.fromJson(Map<String, dynamic> map) {
  149. return ReferralHistoryDetailData(
  150. referralOutOrganizationName: map['ReferralOutOrganizationName'],
  151. referralOutUserName: map['ReferralOutUserName'],
  152. referralInOrganizationName: map['ReferralInOrganizationName'],
  153. referralInUserName: map['ReferralInUserName'],
  154. code: map['Code'],
  155. recordCode: map['RecordCode'],
  156. referralOutUserCode: map['ReferralOutUserCode'],
  157. referralOutOrganizationCode: map['ReferralOutOrganizationCode'],
  158. referralInUserCode: map['ReferralInUserCode'],
  159. referralInOrganizationCode: map['ReferralInOrganizationCode'],
  160. referralStatus: RecordReferralStatusEnum.values
  161. .firstWhere((e) => e.index == map['ReferralStatus']),
  162. referralTime: map['ReferralTime'] != null
  163. ? DateTime.parse(map['ReferralTime'])
  164. : null,
  165. subjectMatter: map['SubjectMatter'],
  166. createTime:
  167. map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  168. updateTime:
  169. map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  170. patientName: map['PatientName'],
  171. );
  172. }
  173. }