form.dart 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. class FormObject {
  2. String? label;
  3. dynamic defaultValue;
  4. int? span;
  5. String? key;
  6. String? type;
  7. bool? border;
  8. dynamic disabledValue;
  9. List<Option>? options;
  10. List<FormObject>? children;
  11. String? append;
  12. String? placeholder;
  13. bool? required;
  14. bool? showLimit;
  15. String? parentKey;
  16. String? buttonName;
  17. List? childrenKey;
  18. List? groupKeys;
  19. FormObject({
  20. this.label,
  21. this.defaultValue,
  22. this.span,
  23. this.key,
  24. this.type,
  25. this.border,
  26. this.disabledValue,
  27. this.options,
  28. this.children,
  29. this.append,
  30. this.placeholder,
  31. this.required,
  32. this.showLimit,
  33. this.parentKey,
  34. this.buttonName,
  35. this.childrenKey,
  36. this.groupKeys,
  37. });
  38. factory FormObject.fromJson(Map<String, dynamic> json) {
  39. var optionsList = json['options'] == null ? null : json['options'] as List;
  40. List<Option>? options =
  41. optionsList?.map((item) => Option.fromJson(item)).toList();
  42. return FormObject(
  43. label: json['label'],
  44. defaultValue: json['defaultValue'],
  45. span: json['span'],
  46. key: json['key'],
  47. type: json['type'],
  48. border: json['border'],
  49. disabledValue: json['disabledValue'],
  50. options: options,
  51. children: json['children'] != null
  52. ? List<FormObject>.from(json['children'])
  53. : null,
  54. append: json['append'],
  55. placeholder: json['placeholder'],
  56. required: json['required'],
  57. showLimit: json['show-limit'],
  58. parentKey: json['parentKey'],
  59. buttonName: json['buttonName'],
  60. childrenKey:
  61. json['childrenKey'] == null ? null : json['childrenKey'] as List,
  62. groupKeys: json['groupKeys'] == null ? null : json['groupKeys'] as List,
  63. );
  64. }
  65. Map<String, dynamic> toJson() {
  66. List<Map<String, dynamic>> optionsList =
  67. options != null ? options!.map((item) => item.toJson()).toList() : [];
  68. return {
  69. 'label': label,
  70. 'defaultValue': defaultValue,
  71. 'span': span,
  72. 'key': key,
  73. 'type': type,
  74. 'border': border,
  75. 'disabledValue': disabledValue,
  76. 'options': optionsList,
  77. 'children': children,
  78. 'append': append,
  79. 'placeholder': placeholder,
  80. 'required': required,
  81. 'show-limit': showLimit,
  82. 'parentKey': parentKey,
  83. 'buttonName': buttonName,
  84. 'childrenKey': childrenKey,
  85. 'groupKeys': groupKeys,
  86. };
  87. }
  88. }
  89. class Option {
  90. String? label;
  91. String? value;
  92. Option({this.label, this.value});
  93. factory Option.fromJson(Map<String, dynamic> json) {
  94. return Option(
  95. label: json['label'],
  96. value: json['value'],
  97. );
  98. }
  99. Map<String, dynamic> toJson() {
  100. return {
  101. 'label': label,
  102. 'value': value,
  103. };
  104. }
  105. }
  106. class ToxicSubstance {
  107. String? label;
  108. Map? value;
  109. ToxicSubstance({this.label, this.value});
  110. factory ToxicSubstance.fromJson(Map<String, dynamic> json) {
  111. return ToxicSubstance(
  112. label: json['label'],
  113. value: json['value'],
  114. );
  115. }
  116. Map<String, dynamic> toJson() {
  117. return {
  118. 'label': label,
  119. 'value': value,
  120. };
  121. }
  122. }
  123. class MenuItem {
  124. // 显示的文本
  125. String label;
  126. // 选中的值
  127. dynamic value;
  128. // 是否选中
  129. bool checked;
  130. MenuItem({this.label = '', this.value, this.checked = false});
  131. }
  132. /// 住院史表单数据类型
  133. class Admission {
  134. String? id;
  135. String? admissionDate;
  136. String? dischargeDate;
  137. String? reason;
  138. String? nameOfMedicalInstitution;
  139. String? patientNumber;
  140. Admission({
  141. this.id,
  142. this.admissionDate,
  143. this.dischargeDate,
  144. this.reason,
  145. this.nameOfMedicalInstitution,
  146. this.patientNumber,
  147. });
  148. factory Admission.fromJson(Map<String, dynamic> json) {
  149. return Admission(
  150. id: json['id'],
  151. admissionDate: json['Admission_Date'],
  152. dischargeDate: json['Discharge_Date'],
  153. reason: json['Reason'],
  154. nameOfMedicalInstitution: json['Name_Of_Medical_Institution'],
  155. patientNumber: json['Patient_Number'],
  156. );
  157. }
  158. Map<String, dynamic> toJson() {
  159. return {
  160. 'id': id ?? '',
  161. 'Admission_Date': admissionDate ?? '',
  162. 'Discharge_Date': dischargeDate ?? '',
  163. 'Reason': reason ?? '',
  164. 'Name_Of_Medical_Institution': nameOfMedicalInstitution ?? '',
  165. 'Patient_Number': patientNumber ?? '',
  166. };
  167. }
  168. }
  169. /// 家庭病床史
  170. class BedConstruction {
  171. String? id;
  172. String? bedConstructionDate;
  173. String? dischargeDate;
  174. String? reason;
  175. String? nameOfMedicalInstitution;
  176. String? patientNumber;
  177. BedConstruction({
  178. this.id,
  179. this.bedConstructionDate,
  180. this.dischargeDate,
  181. this.reason,
  182. this.nameOfMedicalInstitution,
  183. this.patientNumber,
  184. });
  185. factory BedConstruction.fromJson(Map<String, dynamic> json) {
  186. return BedConstruction(
  187. id: json['id'],
  188. bedConstructionDate: json['Bed_Construction_Date'],
  189. dischargeDate: json['Discharge_Date'],
  190. reason: json['Reason'],
  191. nameOfMedicalInstitution: json['Name_Of_Medical_Institution'],
  192. patientNumber: json['Patient_Number'],
  193. );
  194. }
  195. Map<String, dynamic> toJson() {
  196. return {
  197. 'id': id ?? '',
  198. 'Bed_Construction_Date': bedConstructionDate ?? '',
  199. 'Discharge_Date': dischargeDate ?? '',
  200. 'Reason': reason ?? '',
  201. 'Name_Of_Medical_Institution': nameOfMedicalInstitution ?? '',
  202. 'Patient_Number': patientNumber ?? '',
  203. };
  204. }
  205. }
  206. /// 主要用药情况
  207. class MainMedication {
  208. String? id;
  209. String? medicineName;
  210. String? medicineUsage;
  211. String? medicineDosage;
  212. String? medicineTime;
  213. String? medicineCompliance;
  214. MainMedication({
  215. this.id,
  216. this.medicineName,
  217. this.medicineUsage,
  218. this.medicineDosage,
  219. this.medicineTime,
  220. this.medicineCompliance,
  221. });
  222. factory MainMedication.fromJson(Map<String, dynamic> json) {
  223. return MainMedication(
  224. id: json['id'],
  225. medicineName: json['Medicine_Name'],
  226. medicineUsage: json['Medicine_Usage'],
  227. medicineDosage: json['Medicine_Dosage'],
  228. medicineTime: json['Medicine_Time'],
  229. medicineCompliance: json['Medicine_Compliance'],
  230. );
  231. }
  232. Map<String, dynamic> toJson() {
  233. return {
  234. 'id': id ?? '',
  235. 'Medicine_Name': medicineName ?? '',
  236. 'Medicine_Usage': medicineUsage ?? '',
  237. 'Medicine_Dosage': medicineDosage ?? '',
  238. 'Medicine_Time': medicineTime ?? '',
  239. 'Medicine_Compliance': medicineCompliance ?? '',
  240. };
  241. }
  242. }
  243. /// 预防接种史
  244. class VaccinationHistory {
  245. String? id;
  246. String? vaccinationDate;
  247. String? vaccinationFacility;
  248. String? vaccineName;
  249. VaccinationHistory({
  250. this.id,
  251. this.vaccinationDate,
  252. this.vaccinationFacility,
  253. this.vaccineName,
  254. });
  255. factory VaccinationHistory.fromJson(Map<String, dynamic> json) {
  256. return VaccinationHistory(
  257. id: json['id'],
  258. vaccinationDate: json['Vaccination_Date'],
  259. vaccinationFacility: json['Vaccination_Facility'],
  260. vaccineName: json['Vaccine_Name'],
  261. );
  262. }
  263. Map<String, dynamic> toJson() {
  264. return {
  265. 'id': id ?? '',
  266. 'Vaccination_Date': vaccinationDate ?? '',
  267. 'Vaccination_Facility': vaccinationFacility ?? '',
  268. 'Vaccine_Name': vaccineName ?? '',
  269. };
  270. }
  271. }
  272. class EditTableValue {
  273. int? id;
  274. Map<String, dynamic>? value;
  275. EditTableValue({
  276. this.id,
  277. this.value,
  278. });
  279. }