health_infos.dart 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053
  1. import 'package:flutter/material.dart';
  2. import 'package:get/get.dart';
  3. import 'package:intl/intl.dart';
  4. import 'package:vitalapp/components/cell.dart';
  5. import 'package:vitalapp/components/dialog_check.dart';
  6. import 'package:vitalapp/components/dialog_date.dart';
  7. import 'package:vitalapp/components/dialog_input.dart';
  8. import 'package:vitalapp/components/dialog_profile_time_input.dart';
  9. import 'package:vitalapp/components/dialog_select.dart';
  10. import 'package:fis_common/index.dart';
  11. import 'package:vitalapp/pages/patient_info/controller.dart';
  12. import 'package:vitalapp/pages/patient_info/entitys/patientInfo_record.dart';
  13. class HealthInfomations extends GetView<PatientInfomationController> {
  14. @override
  15. Widget build(BuildContext context) {
  16. return Obx(() {
  17. final data = controller.state.healthInfo;
  18. final state = controller.state;
  19. return VListFormCellGroup(
  20. formTitle: "健康信息",
  21. children: [
  22. Text(
  23. "过敏史",
  24. style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
  25. ),
  26. VListFormCell(
  27. label: "药物过敏史",
  28. content: data.historyDrugAllergies?.map(
  29. (index) {
  30. return PatientInfoRecord.historyDrugAllergiesList
  31. .firstWhere((element) => element.key == index)
  32. .value;
  33. },
  34. ).join(',') ??
  35. "",
  36. onTap: () async {
  37. final result =
  38. await VDialogCheck<MapEntry<String, String>, String>(
  39. title: "药物过敏史",
  40. source: PatientInfoRecord.historyDrugAllergiesList,
  41. initialValue: data.historyDrugAllergies ?? [],
  42. valueGetter: (data) => data.key,
  43. labelGetter: (data) => data.value,
  44. MutexValue: '1',
  45. ).show();
  46. if (result != null) {
  47. data.historyDrugAllergies = result;
  48. state.refreshHealthInfo();
  49. }
  50. },
  51. endIcon: _buildEndIcon(),
  52. ),
  53. if (data.historyDrugAllergies?.contains("5") ?? false)
  54. VListFormCell(
  55. label: "药物过敏史-其他",
  56. content: data.historyDrugAllergiesOther,
  57. onTap: () async {
  58. final result = await VDialogInput(
  59. title: "药物过敏史-其他",
  60. initialValue: data.historyDrugAllergiesOther,
  61. placeholder: '请输入')
  62. .show();
  63. if (result != null) {
  64. data.historyDrugAllergiesOther = result;
  65. state.refreshHealthInfo();
  66. }
  67. },
  68. endIcon: _buildEndIcon(),
  69. ),
  70. VListFormCell(
  71. label: "暴露史",
  72. content: data.historyExposure?.map((index) {
  73. return PatientInfoRecord.historyExposureList
  74. .firstWhere((element) => element.key == index)
  75. .value;
  76. }).join(',') ??
  77. '',
  78. onTap: () async {
  79. final result =
  80. await VDialogCheck<MapEntry<String, String>, String>(
  81. title: "暴露史",
  82. source: PatientInfoRecord.historyExposureList,
  83. initialValue: data.historyExposure ?? [],
  84. valueGetter: (data) => data.key,
  85. labelGetter: (data) => data.value,
  86. MutexValue: '1',
  87. ).show();
  88. if (result != null) {
  89. data.historyExposure = result;
  90. state.refreshHealthInfo();
  91. }
  92. },
  93. endIcon: _buildEndIcon(),
  94. ),
  95. Text(
  96. "既往史",
  97. style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
  98. ),
  99. Column(
  100. children: [
  101. VListFormCell(
  102. label: "疾病",
  103. content: data.historyPreviousDisease?.map((index) {
  104. return PatientInfoRecord.historyPreviousDiseaseList
  105. .firstWhere((element) => element.key == index)
  106. .value;
  107. }).join(','),
  108. onTap: () async {
  109. final result =
  110. await VDialogCheck<MapEntry<String, String>, String>(
  111. title: "疾病",
  112. source: PatientInfoRecord.historyPreviousDiseaseList,
  113. initialValue: data.historyPreviousDisease ?? [],
  114. valueGetter: (data) => data.key,
  115. labelGetter: (data) => data.value,
  116. MutexValue: '1',
  117. ).show();
  118. if (result != null) {
  119. data.historyPreviousDisease = result;
  120. state.refreshHealthInfo();
  121. }
  122. },
  123. endIcon: _buildEndIcon(),
  124. ),
  125. if (data.historyPreviousDisease?.contains("6") ?? false)
  126. VListFormCell(
  127. label: " 疾病-恶性肿瘤",
  128. content: data.historyPreviousDiseaseMalignancy,
  129. onTap: () async {
  130. final result = await VDialogInput(
  131. title: "疾病-恶性肿瘤",
  132. initialValue: data.historyPreviousDiseaseMalignancy,
  133. placeholder: '请输入恶性肿瘤详情')
  134. .show();
  135. if (result != null) {
  136. data.historyPreviousDiseaseMalignancy = result;
  137. state.refreshHealthInfo();
  138. }
  139. },
  140. endIcon: _buildEndIcon(),
  141. ),
  142. if (data.historyPreviousDisease?.contains("12") ?? false)
  143. VListFormCell(
  144. label: " 疾病-职业病",
  145. content: data.historyPreviousDiseaseOccupationalDisease,
  146. onTap: () async {
  147. final result = await VDialogInput(
  148. title: "疾病-职业病",
  149. initialValue:
  150. data.historyPreviousDiseaseOccupationalDisease,
  151. placeholder: '请输入职业病详情')
  152. .show();
  153. if (result != null) {
  154. data.historyPreviousDiseaseOccupationalDisease = result;
  155. state.refreshHealthInfo();
  156. }
  157. },
  158. endIcon: _buildEndIcon(),
  159. ),
  160. if (data.historyPreviousDisease?.contains("13") ?? false)
  161. VListFormCell(
  162. label: " 疾病-其他",
  163. content: data.historyPreviousDiseaseOther,
  164. onTap: () async {
  165. final result = await VDialogInput(
  166. title: "疾病-其他",
  167. initialValue: data.historyPreviousDiseaseOther,
  168. placeholder: '请输入其他疾病详情')
  169. .show();
  170. if (result != null) {
  171. data.historyPreviousDiseaseOther = result;
  172. state.refreshHealthInfo();
  173. }
  174. },
  175. endIcon: _buildEndIcon(),
  176. ),
  177. if ((data.historyPreviousDisease?.isNotEmpty ?? false) &&
  178. !(data.historyPreviousDisease?.contains("1") ?? false))
  179. ...data.historyPreviousDisease!
  180. .map(
  181. (e) => VListFormCell(
  182. label:
  183. ' ${PatientInfoRecord.historyPreviousDiseaseList.firstWhere((element) => element.key == e).value} 确诊时间',
  184. content: data.diseaseDiagnosisTime[e] != null
  185. ? DateFormat('yyyy-MM-dd')
  186. .format(data.diseaseDiagnosisTime[e]!)
  187. : '',
  188. onTap: () async {
  189. var result = await VDialogDate(
  190. maxValue: DateTime.now(),
  191. ).show();
  192. if (result != null) {
  193. data.diseaseDiagnosisTime[e] = result;
  194. state.refreshHealthInfo();
  195. }
  196. },
  197. endIcon: _buildEndIcon(),
  198. ),
  199. )
  200. .toList(),
  201. ],
  202. ),
  203. ///手术
  204. Column(
  205. children: [
  206. VListFormCell(
  207. label: "手术",
  208. content: data.operation.isNotNullOrEmpty
  209. ? PatientInfoRecord.historyPreviousOtherList
  210. .firstWhere((element) => element.key == data.operation)
  211. .value
  212. : '',
  213. onTap: () async {
  214. final result =
  215. await VDialogSelect<MapEntry<String, String>, String>(
  216. title: "既往史-手术",
  217. source: PatientInfoRecord.historyPreviousOtherList,
  218. initialValue: data.operation,
  219. valueGetter: (data) => data.key,
  220. labelGetter: (data) => data.value,
  221. ).show();
  222. if (result != null) {
  223. data.operation = result;
  224. state.refreshHealthInfo();
  225. }
  226. },
  227. endIcon: _buildEndIcon(),
  228. ),
  229. if (data.operation?.contains("2") ?? false)
  230. Row(
  231. children: [
  232. const SizedBox(
  233. width: 16,
  234. ),
  235. Expanded(
  236. child: InkWell(
  237. onTap: () async {
  238. final result = await VDialogProfileTimeInput(
  239. title: "手术1",
  240. initialValue: data.operationOne,
  241. ).show();
  242. if (result != null) {
  243. data.operationOne = result;
  244. state.refreshHealthInfo();
  245. }
  246. },
  247. child: Card(
  248. elevation: 0,
  249. child: Container(
  250. decoration: BoxDecoration(
  251. border: Border.all(
  252. color: Colors.grey.shade300,
  253. ),
  254. borderRadius: BorderRadius.circular(8)),
  255. padding: const EdgeInsets.all(16),
  256. child: Column(
  257. crossAxisAlignment: CrossAxisAlignment.start,
  258. children: [
  259. const Text(
  260. '手术1',
  261. style: TextStyle(
  262. fontSize: 24,
  263. ),
  264. ),
  265. Text(
  266. '名称:${data.operationOne?.name ?? ''}',
  267. style: const TextStyle(
  268. fontSize: 20,
  269. ),
  270. ),
  271. Text(
  272. '时间:${data.operationOne?.time != null ? DateFormat('yyyy-MM-dd').format(data.operationOne!.time!) : ''}',
  273. style: const TextStyle(
  274. fontSize: 20,
  275. ),
  276. ),
  277. const SizedBox(
  278. height: 4,
  279. )
  280. ],
  281. ),
  282. ),
  283. ),
  284. ),
  285. ),
  286. Expanded(
  287. child: InkWell(
  288. onTap: () async {
  289. final result = await VDialogProfileTimeInput(
  290. title: "手术2",
  291. initialValue: data.operationTwo,
  292. ).show();
  293. if (result != null) {
  294. data.operationTwo = result;
  295. state.refreshHealthInfo();
  296. }
  297. },
  298. child: Card(
  299. elevation: 0,
  300. child: Container(
  301. decoration: BoxDecoration(
  302. border: Border.all(
  303. color: Colors.grey.shade300,
  304. ),
  305. borderRadius: BorderRadius.circular(8)),
  306. padding: const EdgeInsets.all(16),
  307. child: Column(
  308. crossAxisAlignment: CrossAxisAlignment.start,
  309. children: [
  310. const Text(
  311. '手术2',
  312. style: TextStyle(
  313. fontSize: 24,
  314. ),
  315. ),
  316. Text(
  317. '名称:${data.operationTwo?.name ?? ''}',
  318. style: const TextStyle(
  319. fontSize: 20,
  320. ),
  321. ),
  322. Text(
  323. '时间:${data.operationTwo?.time != null ? DateFormat('yyyy-MM-dd').format(data.operationTwo!.time!) : ''}',
  324. style: const TextStyle(
  325. fontSize: 20,
  326. ),
  327. ),
  328. const SizedBox(
  329. height: 4,
  330. )
  331. ],
  332. ),
  333. ),
  334. ),
  335. ),
  336. ),
  337. const SizedBox(
  338. width: 16,
  339. ),
  340. ],
  341. ),
  342. ],
  343. ),
  344. ///外伤
  345. Column(
  346. children: [
  347. VListFormCell(
  348. label: "外伤",
  349. content: data.trauma.isNotNullOrEmpty
  350. ? PatientInfoRecord.historyPreviousOtherList
  351. .firstWhere((element) => element.key == data.trauma)
  352. .value
  353. : '',
  354. onTap: () async {
  355. final result =
  356. await VDialogSelect<MapEntry<String, String>, String>(
  357. title: "既往史-外伤",
  358. source: PatientInfoRecord.historyPreviousOtherList,
  359. initialValue: data.trauma,
  360. valueGetter: (data) => data.key,
  361. labelGetter: (data) => data.value,
  362. ).show();
  363. if (result != null) {
  364. data.trauma = result;
  365. state.refreshHealthInfo();
  366. }
  367. },
  368. endIcon: _buildEndIcon(),
  369. ),
  370. if (data.trauma?.contains('2') ?? false)
  371. Row(
  372. children: [
  373. const SizedBox(
  374. width: 16,
  375. ),
  376. Expanded(
  377. child: InkWell(
  378. onTap: () async {
  379. final result = await VDialogProfileTimeInput(
  380. title: "外伤1",
  381. initialValue: data.traumaOne,
  382. ).show();
  383. if (result != null) {
  384. data.traumaOne = result;
  385. state.refreshHealthInfo();
  386. }
  387. },
  388. child: Card(
  389. elevation: 0,
  390. child: Container(
  391. decoration: BoxDecoration(
  392. border: Border.all(
  393. color: Colors.grey.shade300,
  394. ),
  395. borderRadius: BorderRadius.circular(8)),
  396. padding: const EdgeInsets.all(16),
  397. child: Column(
  398. crossAxisAlignment: CrossAxisAlignment.start,
  399. children: [
  400. const Text(
  401. '外伤1',
  402. style: TextStyle(
  403. fontSize: 24,
  404. ),
  405. ),
  406. Text(
  407. '名称:${data.traumaOne?.name ?? ''}',
  408. style: const TextStyle(
  409. fontSize: 20,
  410. ),
  411. ),
  412. Text(
  413. '时间:${data.traumaOne?.time != null ? DateFormat('yyyy-MM-dd').format(data.traumaOne!.time!) : ''}',
  414. style: const TextStyle(
  415. fontSize: 20,
  416. ),
  417. ),
  418. const SizedBox(
  419. height: 4,
  420. )
  421. ],
  422. ),
  423. ),
  424. ),
  425. ),
  426. ),
  427. Expanded(
  428. child: InkWell(
  429. onTap: () async {
  430. final result = await VDialogProfileTimeInput(
  431. title: "外伤2",
  432. initialValue: data.traumaTwo,
  433. ).show();
  434. if (result != null) {
  435. data.traumaTwo = result;
  436. state.refreshHealthInfo();
  437. }
  438. },
  439. child: Card(
  440. elevation: 0,
  441. child: Container(
  442. decoration: BoxDecoration(
  443. border: Border.all(
  444. color: Colors.grey.shade300,
  445. ),
  446. borderRadius: BorderRadius.circular(8)),
  447. padding: const EdgeInsets.all(16),
  448. child: Column(
  449. crossAxisAlignment: CrossAxisAlignment.start,
  450. children: [
  451. const Text(
  452. '外伤2',
  453. style: TextStyle(
  454. fontSize: 24,
  455. ),
  456. ),
  457. Text(
  458. '名称:${data.traumaTwo?.name ?? ''}',
  459. style: const TextStyle(
  460. fontSize: 20,
  461. ),
  462. ),
  463. Text(
  464. '时间:${data.traumaTwo?.time != null ? DateFormat('yyyy-MM-dd').format(data.traumaTwo!.time!) : ''}',
  465. style: const TextStyle(
  466. fontSize: 20,
  467. ),
  468. ),
  469. const SizedBox(
  470. height: 4,
  471. )
  472. ],
  473. ),
  474. ),
  475. ),
  476. ),
  477. ),
  478. const SizedBox(
  479. width: 16,
  480. ),
  481. ],
  482. ),
  483. ],
  484. ),
  485. ///输血项目
  486. Column(
  487. children: [
  488. VListFormCell(
  489. label: "输血",
  490. content: data.transfusion.isNotNullOrEmpty
  491. ? PatientInfoRecord.historyPreviousOtherList
  492. .firstWhere(
  493. (element) => element.key == data.transfusion)
  494. .value
  495. : '',
  496. onTap: () async {
  497. final result =
  498. await VDialogSelect<MapEntry<String, String>, String>(
  499. title: "既往史-输血",
  500. source: PatientInfoRecord.historyPreviousOtherList,
  501. initialValue: data.transfusion,
  502. valueGetter: (data) => data.key,
  503. labelGetter: (data) => data.value,
  504. ).show();
  505. if (result != null) {
  506. data.transfusion = result;
  507. state.refreshHealthInfo();
  508. }
  509. },
  510. endIcon: _buildEndIcon(),
  511. ),
  512. if (data.transfusion?.contains('2') ?? false)
  513. Row(
  514. children: [
  515. const SizedBox(
  516. width: 16,
  517. ),
  518. Expanded(
  519. child: InkWell(
  520. onTap: () async {
  521. final result = await VDialogProfileTimeInput(
  522. title: "输血1",
  523. initialValue: data.transfusionOne,
  524. ).show();
  525. if (result != null) {
  526. data.transfusionOne = result;
  527. state.refreshHealthInfo();
  528. }
  529. },
  530. child: Card(
  531. elevation: 0,
  532. child: Container(
  533. decoration: BoxDecoration(
  534. border: Border.all(
  535. color: Colors.grey.shade300,
  536. ),
  537. borderRadius: BorderRadius.circular(8)),
  538. padding: const EdgeInsets.all(16),
  539. child: Column(
  540. crossAxisAlignment: CrossAxisAlignment.start,
  541. children: [
  542. const Text(
  543. '输血1',
  544. style: TextStyle(
  545. fontSize: 24,
  546. ),
  547. ),
  548. Text(
  549. '名称:${data.transfusionOne?.name ?? ''}',
  550. style: const TextStyle(
  551. fontSize: 20,
  552. ),
  553. ),
  554. Text(
  555. '时间:${data.transfusionOne?.time != null ? DateFormat('yyyy-MM-dd').format(data.transfusionOne!.time!) : ''}',
  556. style: const TextStyle(
  557. fontSize: 20,
  558. ),
  559. ),
  560. const SizedBox(
  561. height: 4,
  562. )
  563. ],
  564. ),
  565. ),
  566. ),
  567. ),
  568. ),
  569. Expanded(
  570. child: InkWell(
  571. onTap: () async {
  572. final result = await VDialogProfileTimeInput(
  573. title: "输血2",
  574. initialValue: data.transfusionTwo,
  575. ).show();
  576. if (result != null) {
  577. data.transfusionTwo = result;
  578. state.refreshHealthInfo();
  579. }
  580. },
  581. child: Card(
  582. elevation: 0,
  583. child: Container(
  584. decoration: BoxDecoration(
  585. border: Border.all(
  586. color: Colors.grey.shade300,
  587. ),
  588. borderRadius: BorderRadius.circular(8)),
  589. padding: const EdgeInsets.all(16),
  590. child: Column(
  591. crossAxisAlignment: CrossAxisAlignment.start,
  592. children: [
  593. const Text(
  594. '输血2',
  595. style: TextStyle(
  596. fontSize: 24,
  597. ),
  598. ),
  599. Text(
  600. '名称:${data.transfusionTwo?.name ?? ''}',
  601. style: const TextStyle(
  602. fontSize: 20,
  603. ),
  604. ),
  605. Text(
  606. '时间:${data.transfusionTwo?.time != null ? DateFormat('yyyy-MM-dd').format(data.transfusionTwo!.time!) : ''}',
  607. style: const TextStyle(
  608. fontSize: 20,
  609. ),
  610. ),
  611. const SizedBox(
  612. height: 4,
  613. )
  614. ],
  615. ),
  616. ),
  617. ),
  618. ),
  619. ),
  620. const SizedBox(
  621. width: 16,
  622. ),
  623. ],
  624. ),
  625. ],
  626. ),
  627. Text(
  628. "家族病史",
  629. style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
  630. ),
  631. VListFormCell(
  632. label: "父亲",
  633. content: data.father?.map((index) {
  634. return PatientInfoRecord.historyFamilyList
  635. .firstWhere((element) => element.key == index)
  636. .value;
  637. }).join(','),
  638. onTap: () async {
  639. final result =
  640. await VDialogCheck<MapEntry<String, String>, String>(
  641. title: "父亲",
  642. source: PatientInfoRecord.historyFamilyList,
  643. initialValue: data.father ?? [],
  644. valueGetter: (data) => data.key,
  645. labelGetter: (data) => data.value,
  646. MutexValue: '1',
  647. ).show();
  648. if (result != null) {
  649. data.father = result;
  650. state.refreshHealthInfo();
  651. }
  652. },
  653. endIcon: _buildEndIcon(),
  654. ),
  655. if (data.father?.contains("12") ?? false)
  656. VListFormCell(
  657. label: "父亲-其他",
  658. content: data.fatherOther,
  659. onTap: () async {
  660. final result = await VDialogInput(
  661. title: "父亲-其他",
  662. initialValue: data.fatherOther,
  663. placeholder: '请输入')
  664. .show();
  665. if (result != null) {
  666. data.fatherOther = result;
  667. state.refreshHealthInfo();
  668. }
  669. },
  670. endIcon: _buildEndIcon(),
  671. ),
  672. VListFormCell(
  673. label: "母亲",
  674. content: data.mother?.map((index) {
  675. return PatientInfoRecord.historyFamilyList
  676. .firstWhere((element) => element.key == index)
  677. .value;
  678. }).join(','),
  679. onTap: () async {
  680. final result =
  681. await VDialogCheck<MapEntry<String, String>, String>(
  682. title: "母亲",
  683. source: PatientInfoRecord.historyFamilyList,
  684. initialValue: data.mother ?? [],
  685. valueGetter: (data) => data.key,
  686. labelGetter: (data) => data.value,
  687. MutexValue: '1',
  688. ).show();
  689. if (result != null) {
  690. data.mother = result;
  691. state.refreshHealthInfo();
  692. }
  693. },
  694. endIcon: _buildEndIcon(),
  695. ),
  696. if (data.mother?.contains("12") ?? false)
  697. VListFormCell(
  698. label: "母亲-其他",
  699. content: data.motherOther,
  700. onTap: () async {
  701. final result = await VDialogInput(
  702. title: "母亲-其他",
  703. initialValue: data.motherOther,
  704. placeholder: '请输入')
  705. .show();
  706. if (result != null) {
  707. data.motherOther = result;
  708. state.refreshHealthInfo();
  709. }
  710. },
  711. endIcon: _buildEndIcon(),
  712. ),
  713. VListFormCell(
  714. label: "兄弟姐妹",
  715. content: data.sibling?.map((index) {
  716. return PatientInfoRecord.historyFamilyList
  717. .firstWhere((element) => element.key == index)
  718. .value;
  719. }).join(','),
  720. onTap: () async {
  721. final result =
  722. await VDialogCheck<MapEntry<String, String>, String>(
  723. title: "兄弟姐妹",
  724. source: PatientInfoRecord.historyFamilyList,
  725. initialValue: data.sibling ?? [],
  726. valueGetter: (data) => data.key,
  727. labelGetter: (data) => data.value,
  728. MutexValue: '1',
  729. ).show();
  730. if (result != null) {
  731. data.sibling = result;
  732. state.refreshHealthInfo();
  733. }
  734. },
  735. endIcon: _buildEndIcon(),
  736. ),
  737. if (data.sibling?.contains("12") ?? false)
  738. VListFormCell(
  739. label: "兄弟姐妹-其他",
  740. content: data.siblingOther,
  741. onTap: () async {
  742. final result = await VDialogInput(
  743. title: "兄弟姐妹-其他",
  744. initialValue: data.siblingOther,
  745. placeholder: '请输入')
  746. .show();
  747. if (result != null) {
  748. data.siblingOther = result;
  749. state.refreshHealthInfo();
  750. }
  751. },
  752. endIcon: _buildEndIcon(),
  753. ),
  754. VListFormCell(
  755. label: "子女",
  756. content: data.children?.map((index) {
  757. return PatientInfoRecord.historyFamilyList
  758. .firstWhere((element) => element.key == index)
  759. .value;
  760. }).join(','),
  761. onTap: () async {
  762. final result =
  763. await VDialogCheck<MapEntry<String, String>, String>(
  764. title: "子女",
  765. source: PatientInfoRecord.historyFamilyList,
  766. initialValue: data.children ?? [],
  767. valueGetter: (data) => data.key,
  768. labelGetter: (data) => data.value,
  769. MutexValue: '1',
  770. ).show();
  771. if (result != null) {
  772. data.children = result;
  773. state.refreshHealthInfo();
  774. }
  775. },
  776. endIcon: _buildEndIcon(),
  777. ),
  778. if (data.children?.contains("12") ?? false)
  779. VListFormCell(
  780. label: "子女-其他",
  781. content: data.childrenOther,
  782. onTap: () async {
  783. final result = await VDialogInput(
  784. title: "子女-其他",
  785. initialValue: data.childrenOther,
  786. placeholder: '请输入')
  787. .show();
  788. if (result != null) {
  789. data.childrenOther = result;
  790. state.refreshHealthInfo();
  791. }
  792. },
  793. endIcon: _buildEndIcon(),
  794. ),
  795. Text(
  796. "遗传病史",
  797. style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
  798. ),
  799. VListFormCell(
  800. label: "遗传病史",
  801. content: data.historyGenetic.isNotNullOrEmpty
  802. ? PatientInfoRecord.historyPreviousOtherList
  803. .firstWhere((element) => element.key == data.historyGenetic)
  804. .value
  805. : '',
  806. onTap: () async {
  807. final result =
  808. await VDialogSelect<MapEntry<String, String>, String>(
  809. title: "遗传病史",
  810. source: PatientInfoRecord.historyPreviousOtherList,
  811. initialValue: data.historyGenetic,
  812. valueGetter: (data) => data.key,
  813. labelGetter: (data) => data.value,
  814. ).show();
  815. if (result != null) {
  816. data.historyGenetic = result;
  817. state.refreshHealthInfo();
  818. }
  819. },
  820. endIcon: _buildEndIcon(),
  821. ),
  822. if (data.historyGenetic?.contains("2") ?? false)
  823. VListFormCell(
  824. label: "疾病名称",
  825. content: data.historyGeneticName,
  826. onTap: () async {
  827. final result = await VDialogInput(
  828. title: "疾病名称",
  829. initialValue: data.historyGeneticName,
  830. placeholder: '请输入')
  831. .show();
  832. if (result != null) {
  833. data.historyGeneticName = result;
  834. state.refreshHealthInfo();
  835. }
  836. },
  837. endIcon: _buildEndIcon(),
  838. ),
  839. Column(
  840. children: [
  841. VListFormCell(
  842. label: "残疾情况",
  843. content: data.disabilitySituation?.map((index) {
  844. return PatientInfoRecord.disabilitySituationList
  845. .firstWhere((element) => element.key == index)
  846. .value;
  847. }).join(','),
  848. onTap: () async {
  849. final result =
  850. await VDialogCheck<MapEntry<String, String>, String>(
  851. title: "残疾情况",
  852. source: PatientInfoRecord.disabilitySituationList,
  853. initialValue: data.disabilitySituation ?? [],
  854. valueGetter: (data) => data.key,
  855. labelGetter: (data) => data.value,
  856. MutexValue: '1',
  857. ).show();
  858. if (result != null) {
  859. data.disabilitySituation = result;
  860. state.refreshHealthInfo();
  861. }
  862. },
  863. endIcon: _buildEndIcon(),
  864. ),
  865. if (data.disabilitySituation?.contains("8") ?? false)
  866. VListFormCell(
  867. label: "其他残疾-疾病名称",
  868. content: data.disabilitySituationOther,
  869. onTap: () async {
  870. final result = await VDialogInput(
  871. title: "其他残疾-疾病名称",
  872. initialValue: data.disabilitySituationOther,
  873. placeholder: '请输入')
  874. .show();
  875. if (result != null) {
  876. data.disabilitySituationOther = result;
  877. state.refreshHealthInfo();
  878. }
  879. },
  880. endIcon: _buildEndIcon(),
  881. ),
  882. ],
  883. ),
  884. Text(
  885. "生活环境",
  886. style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
  887. ),
  888. VListFormCell(
  889. label: "厨房排风设施",
  890. content: data.kitchenExhaustFacilities.isNotNullOrEmpty
  891. ? PatientInfoRecord.kitchenExhaustFacilitiesList
  892. .firstWhere((element) =>
  893. element.key == data.kitchenExhaustFacilities)
  894. .value
  895. : '',
  896. onTap: () async {
  897. final result =
  898. await VDialogSelect<MapEntry<String, String>, String>(
  899. title: "厨房排风设施",
  900. source: PatientInfoRecord.kitchenExhaustFacilitiesList,
  901. initialValue: data.kitchenExhaustFacilities,
  902. valueGetter: (data) => data.key,
  903. labelGetter: (data) => data.value,
  904. ).show();
  905. if (result != null) {
  906. data.kitchenExhaustFacilities = result;
  907. state.refreshHealthInfo();
  908. }
  909. },
  910. endIcon: _buildEndIcon(),
  911. ),
  912. VListFormCell(
  913. label: "燃气类型",
  914. content: data.fuel.isNotNullOrEmpty
  915. ? PatientInfoRecord.fuelList
  916. .firstWhere((element) => element.key == data.fuel)
  917. .value
  918. : '',
  919. onTap: () async {
  920. final result =
  921. await VDialogSelect<MapEntry<String, String>, String>(
  922. title: "燃气类型",
  923. source: PatientInfoRecord.fuelList,
  924. initialValue: data.fuel,
  925. valueGetter: (data) => data.key,
  926. labelGetter: (data) => data.value,
  927. ).show();
  928. if (result != null) {
  929. data.fuel = result;
  930. state.refreshHealthInfo();
  931. }
  932. },
  933. endIcon: _buildEndIcon(),
  934. ),
  935. if (data.fuel?.contains("6") ?? false)
  936. VListFormCell(
  937. label: "燃气类型-其他",
  938. content: data.fuelOther,
  939. onTap: () async {
  940. final result = await VDialogInput(
  941. title: "燃气类型-其他",
  942. initialValue: data.fuelOther,
  943. placeholder: '请输入')
  944. .show();
  945. if (result != null) {
  946. data.fuelOther = result;
  947. state.refreshHealthInfo();
  948. }
  949. },
  950. endIcon: _buildEndIcon(),
  951. ),
  952. VListFormCell(
  953. label: "饮水",
  954. content: data.drinkingWater.isNotNullOrEmpty
  955. ? PatientInfoRecord.drinkingWaterList
  956. .firstWhere((element) => element.key == data.drinkingWater)
  957. .value
  958. : '',
  959. onTap: () async {
  960. final result =
  961. await VDialogSelect<MapEntry<String, String>, String>(
  962. title: "饮水",
  963. source: PatientInfoRecord.drinkingWaterList,
  964. initialValue: data.drinkingWater,
  965. valueGetter: (data) => data.key,
  966. labelGetter: (data) => data.value,
  967. ).show();
  968. if (result != null) {
  969. data.drinkingWater = result;
  970. state.refreshHealthInfo();
  971. }
  972. },
  973. endIcon: _buildEndIcon(),
  974. ),
  975. if (data.drinkingWater?.contains("6") ?? false)
  976. VListFormCell(
  977. label: "饮水-其他",
  978. content: data.drinkingWaterOther,
  979. onTap: () async {
  980. final result = await VDialogInput(
  981. title: "饮水-其他",
  982. initialValue: data.drinkingWaterOther,
  983. placeholder: '请输入')
  984. .show();
  985. if (result != null) {
  986. data.drinkingWaterOther = result;
  987. state.refreshHealthInfo();
  988. }
  989. },
  990. endIcon: _buildEndIcon(),
  991. ),
  992. VListFormCell(
  993. label: "厕所",
  994. content: data.toilet.isNotNullOrEmpty
  995. ? PatientInfoRecord.toiletList
  996. .firstWhere((element) => element.key == data.toilet)
  997. .value
  998. : '',
  999. onTap: () async {
  1000. final result =
  1001. await VDialogSelect<MapEntry<String, String>, String>(
  1002. title: "厕所",
  1003. source: PatientInfoRecord.toiletList,
  1004. initialValue: data.toilet,
  1005. valueGetter: (data) => data.key,
  1006. labelGetter: (data) => data.value,
  1007. ).show();
  1008. if (result != null) {
  1009. data.toilet = result;
  1010. state.refreshHealthInfo();
  1011. }
  1012. },
  1013. endIcon: _buildEndIcon(),
  1014. ),
  1015. VListFormCell(
  1016. label: "禽兽栏",
  1017. content: data.animalPen.isNotNullOrEmpty
  1018. ? PatientInfoRecord.animalPenList
  1019. .firstWhere((element) => element.key == data.animalPen)
  1020. .value
  1021. : '',
  1022. onTap: () async {
  1023. final result =
  1024. await VDialogSelect<MapEntry<String, String>, String>(
  1025. title: "禽兽栏",
  1026. source: PatientInfoRecord.animalPenList,
  1027. initialValue: data.animalPen,
  1028. valueGetter: (data) => data.key,
  1029. labelGetter: (data) => data.value,
  1030. ).show();
  1031. if (result != null) {
  1032. data.animalPen = result;
  1033. state.refreshHealthInfo();
  1034. }
  1035. },
  1036. endIcon: _buildEndIcon(),
  1037. ),
  1038. ],
  1039. );
  1040. });
  1041. }
  1042. Widget _buildEndIcon({bool isEdit = true}) {
  1043. return Container(
  1044. margin: EdgeInsets.only(left: isEdit ? 15 : 35),
  1045. child: isEdit ? Icon(Icons.edit_outlined) : SizedBox(),
  1046. );
  1047. }
  1048. }