123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053 |
- import 'package:flutter/material.dart';
- import 'package:get/get.dart';
- import 'package:intl/intl.dart';
- import 'package:vitalapp/components/cell.dart';
- import 'package:vitalapp/components/dialog_check.dart';
- import 'package:vitalapp/components/dialog_date.dart';
- import 'package:vitalapp/components/dialog_input.dart';
- import 'package:vitalapp/components/dialog_profile_time_input.dart';
- import 'package:vitalapp/components/dialog_select.dart';
- import 'package:fis_common/index.dart';
- import 'package:vitalapp/pages/patient_info/controller.dart';
- import 'package:vitalapp/pages/patient_info/entitys/patientInfo_record.dart';
- class HealthInfomations extends GetView<PatientInfomationController> {
- @override
- Widget build(BuildContext context) {
- return Obx(() {
- final data = controller.state.healthInfo;
- final state = controller.state;
- return VListFormCellGroup(
- formTitle: "健康信息",
- children: [
- Text(
- "过敏史",
- style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
- ),
- VListFormCell(
- label: "药物过敏史",
- content: data.historyDrugAllergies?.map(
- (index) {
- return PatientInfoRecord.historyDrugAllergiesList
- .firstWhere((element) => element.key == index)
- .value;
- },
- ).join(',') ??
- "",
- onTap: () async {
- final result =
- await VDialogCheck<MapEntry<String, String>, String>(
- title: "药物过敏史",
- source: PatientInfoRecord.historyDrugAllergiesList,
- initialValue: data.historyDrugAllergies ?? [],
- valueGetter: (data) => data.key,
- labelGetter: (data) => data.value,
- MutexValue: '1',
- ).show();
- if (result != null) {
- data.historyDrugAllergies = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- if (data.historyDrugAllergies?.contains("5") ?? false)
- VListFormCell(
- label: "药物过敏史-其他",
- content: data.historyDrugAllergiesOther,
- onTap: () async {
- final result = await VDialogInput(
- title: "药物过敏史-其他",
- initialValue: data.historyDrugAllergiesOther,
- placeholder: '请输入')
- .show();
- if (result != null) {
- data.historyDrugAllergiesOther = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- VListFormCell(
- label: "暴露史",
- content: data.historyExposure?.map((index) {
- return PatientInfoRecord.historyExposureList
- .firstWhere((element) => element.key == index)
- .value;
- }).join(',') ??
- '',
- onTap: () async {
- final result =
- await VDialogCheck<MapEntry<String, String>, String>(
- title: "暴露史",
- source: PatientInfoRecord.historyExposureList,
- initialValue: data.historyExposure ?? [],
- valueGetter: (data) => data.key,
- labelGetter: (data) => data.value,
- MutexValue: '1',
- ).show();
- if (result != null) {
- data.historyExposure = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- Text(
- "既往史",
- style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
- ),
- Column(
- children: [
- VListFormCell(
- label: "疾病",
- content: data.historyPreviousDisease?.map((index) {
- return PatientInfoRecord.historyPreviousDiseaseList
- .firstWhere((element) => element.key == index)
- .value;
- }).join(','),
- onTap: () async {
- final result =
- await VDialogCheck<MapEntry<String, String>, String>(
- title: "疾病",
- source: PatientInfoRecord.historyPreviousDiseaseList,
- initialValue: data.historyPreviousDisease ?? [],
- valueGetter: (data) => data.key,
- labelGetter: (data) => data.value,
- MutexValue: '1',
- ).show();
- if (result != null) {
- data.historyPreviousDisease = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- if (data.historyPreviousDisease?.contains("6") ?? false)
- VListFormCell(
- label: " 疾病-恶性肿瘤",
- content: data.historyPreviousDiseaseMalignancy,
- onTap: () async {
- final result = await VDialogInput(
- title: "疾病-恶性肿瘤",
- initialValue: data.historyPreviousDiseaseMalignancy,
- placeholder: '请输入恶性肿瘤详情')
- .show();
- if (result != null) {
- data.historyPreviousDiseaseMalignancy = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- if (data.historyPreviousDisease?.contains("12") ?? false)
- VListFormCell(
- label: " 疾病-职业病",
- content: data.historyPreviousDiseaseOccupationalDisease,
- onTap: () async {
- final result = await VDialogInput(
- title: "疾病-职业病",
- initialValue:
- data.historyPreviousDiseaseOccupationalDisease,
- placeholder: '请输入职业病详情')
- .show();
- if (result != null) {
- data.historyPreviousDiseaseOccupationalDisease = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- if (data.historyPreviousDisease?.contains("13") ?? false)
- VListFormCell(
- label: " 疾病-其他",
- content: data.historyPreviousDiseaseOther,
- onTap: () async {
- final result = await VDialogInput(
- title: "疾病-其他",
- initialValue: data.historyPreviousDiseaseOther,
- placeholder: '请输入其他疾病详情')
- .show();
- if (result != null) {
- data.historyPreviousDiseaseOther = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- if ((data.historyPreviousDisease?.isNotEmpty ?? false) &&
- !(data.historyPreviousDisease?.contains("1") ?? false))
- ...data.historyPreviousDisease!
- .map(
- (e) => VListFormCell(
- label:
- ' ${PatientInfoRecord.historyPreviousDiseaseList.firstWhere((element) => element.key == e).value} 确诊时间',
- content: data.diseaseDiagnosisTime[e] != null
- ? DateFormat('yyyy-MM-dd')
- .format(data.diseaseDiagnosisTime[e]!)
- : '',
- onTap: () async {
- var result = await VDialogDate(
- maxValue: DateTime.now(),
- ).show();
- if (result != null) {
- data.diseaseDiagnosisTime[e] = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- )
- .toList(),
- ],
- ),
- ///手术
- Column(
- children: [
- VListFormCell(
- label: "手术",
- content: data.operation.isNotNullOrEmpty
- ? PatientInfoRecord.historyPreviousOtherList
- .firstWhere((element) => element.key == data.operation)
- .value
- : '',
- onTap: () async {
- final result =
- await VDialogSelect<MapEntry<String, String>, String>(
- title: "既往史-手术",
- source: PatientInfoRecord.historyPreviousOtherList,
- initialValue: data.operation,
- valueGetter: (data) => data.key,
- labelGetter: (data) => data.value,
- ).show();
- if (result != null) {
- data.operation = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- if (data.operation?.contains("2") ?? false)
- Row(
- children: [
- const SizedBox(
- width: 16,
- ),
- Expanded(
- child: InkWell(
- onTap: () async {
- final result = await VDialogProfileTimeInput(
- title: "手术1",
- initialValue: data.operationOne,
- ).show();
- if (result != null) {
- data.operationOne = result;
- state.refreshHealthInfo();
- }
- },
- child: Card(
- elevation: 0,
- child: Container(
- decoration: BoxDecoration(
- border: Border.all(
- color: Colors.grey.shade300,
- ),
- borderRadius: BorderRadius.circular(8)),
- padding: const EdgeInsets.all(16),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- const Text(
- '手术1',
- style: TextStyle(
- fontSize: 24,
- ),
- ),
- Text(
- '名称:${data.operationOne?.name ?? ''}',
- style: const TextStyle(
- fontSize: 20,
- ),
- ),
- Text(
- '时间:${data.operationOne?.time != null ? DateFormat('yyyy-MM-dd').format(data.operationOne!.time!) : ''}',
- style: const TextStyle(
- fontSize: 20,
- ),
- ),
- const SizedBox(
- height: 4,
- )
- ],
- ),
- ),
- ),
- ),
- ),
- Expanded(
- child: InkWell(
- onTap: () async {
- final result = await VDialogProfileTimeInput(
- title: "手术2",
- initialValue: data.operationTwo,
- ).show();
- if (result != null) {
- data.operationTwo = result;
- state.refreshHealthInfo();
- }
- },
- child: Card(
- elevation: 0,
- child: Container(
- decoration: BoxDecoration(
- border: Border.all(
- color: Colors.grey.shade300,
- ),
- borderRadius: BorderRadius.circular(8)),
- padding: const EdgeInsets.all(16),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- const Text(
- '手术2',
- style: TextStyle(
- fontSize: 24,
- ),
- ),
- Text(
- '名称:${data.operationTwo?.name ?? ''}',
- style: const TextStyle(
- fontSize: 20,
- ),
- ),
- Text(
- '时间:${data.operationTwo?.time != null ? DateFormat('yyyy-MM-dd').format(data.operationTwo!.time!) : ''}',
- style: const TextStyle(
- fontSize: 20,
- ),
- ),
- const SizedBox(
- height: 4,
- )
- ],
- ),
- ),
- ),
- ),
- ),
- const SizedBox(
- width: 16,
- ),
- ],
- ),
- ],
- ),
- ///外伤
- Column(
- children: [
- VListFormCell(
- label: "外伤",
- content: data.trauma.isNotNullOrEmpty
- ? PatientInfoRecord.historyPreviousOtherList
- .firstWhere((element) => element.key == data.trauma)
- .value
- : '',
- onTap: () async {
- final result =
- await VDialogSelect<MapEntry<String, String>, String>(
- title: "既往史-外伤",
- source: PatientInfoRecord.historyPreviousOtherList,
- initialValue: data.trauma,
- valueGetter: (data) => data.key,
- labelGetter: (data) => data.value,
- ).show();
- if (result != null) {
- data.trauma = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- if (data.trauma?.contains('2') ?? false)
- Row(
- children: [
- const SizedBox(
- width: 16,
- ),
- Expanded(
- child: InkWell(
- onTap: () async {
- final result = await VDialogProfileTimeInput(
- title: "外伤1",
- initialValue: data.traumaOne,
- ).show();
- if (result != null) {
- data.traumaOne = result;
- state.refreshHealthInfo();
- }
- },
- child: Card(
- elevation: 0,
- child: Container(
- decoration: BoxDecoration(
- border: Border.all(
- color: Colors.grey.shade300,
- ),
- borderRadius: BorderRadius.circular(8)),
- padding: const EdgeInsets.all(16),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- const Text(
- '外伤1',
- style: TextStyle(
- fontSize: 24,
- ),
- ),
- Text(
- '名称:${data.traumaOne?.name ?? ''}',
- style: const TextStyle(
- fontSize: 20,
- ),
- ),
- Text(
- '时间:${data.traumaOne?.time != null ? DateFormat('yyyy-MM-dd').format(data.traumaOne!.time!) : ''}',
- style: const TextStyle(
- fontSize: 20,
- ),
- ),
- const SizedBox(
- height: 4,
- )
- ],
- ),
- ),
- ),
- ),
- ),
- Expanded(
- child: InkWell(
- onTap: () async {
- final result = await VDialogProfileTimeInput(
- title: "外伤2",
- initialValue: data.traumaTwo,
- ).show();
- if (result != null) {
- data.traumaTwo = result;
- state.refreshHealthInfo();
- }
- },
- child: Card(
- elevation: 0,
- child: Container(
- decoration: BoxDecoration(
- border: Border.all(
- color: Colors.grey.shade300,
- ),
- borderRadius: BorderRadius.circular(8)),
- padding: const EdgeInsets.all(16),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- const Text(
- '外伤2',
- style: TextStyle(
- fontSize: 24,
- ),
- ),
- Text(
- '名称:${data.traumaTwo?.name ?? ''}',
- style: const TextStyle(
- fontSize: 20,
- ),
- ),
- Text(
- '时间:${data.traumaTwo?.time != null ? DateFormat('yyyy-MM-dd').format(data.traumaTwo!.time!) : ''}',
- style: const TextStyle(
- fontSize: 20,
- ),
- ),
- const SizedBox(
- height: 4,
- )
- ],
- ),
- ),
- ),
- ),
- ),
- const SizedBox(
- width: 16,
- ),
- ],
- ),
- ],
- ),
- ///输血项目
- Column(
- children: [
- VListFormCell(
- label: "输血",
- content: data.transfusion.isNotNullOrEmpty
- ? PatientInfoRecord.historyPreviousOtherList
- .firstWhere(
- (element) => element.key == data.transfusion)
- .value
- : '',
- onTap: () async {
- final result =
- await VDialogSelect<MapEntry<String, String>, String>(
- title: "既往史-输血",
- source: PatientInfoRecord.historyPreviousOtherList,
- initialValue: data.transfusion,
- valueGetter: (data) => data.key,
- labelGetter: (data) => data.value,
- ).show();
- if (result != null) {
- data.transfusion = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- if (data.transfusion?.contains('2') ?? false)
- Row(
- children: [
- const SizedBox(
- width: 16,
- ),
- Expanded(
- child: InkWell(
- onTap: () async {
- final result = await VDialogProfileTimeInput(
- title: "输血1",
- initialValue: data.transfusionOne,
- ).show();
- if (result != null) {
- data.transfusionOne = result;
- state.refreshHealthInfo();
- }
- },
- child: Card(
- elevation: 0,
- child: Container(
- decoration: BoxDecoration(
- border: Border.all(
- color: Colors.grey.shade300,
- ),
- borderRadius: BorderRadius.circular(8)),
- padding: const EdgeInsets.all(16),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- const Text(
- '输血1',
- style: TextStyle(
- fontSize: 24,
- ),
- ),
- Text(
- '名称:${data.transfusionOne?.name ?? ''}',
- style: const TextStyle(
- fontSize: 20,
- ),
- ),
- Text(
- '时间:${data.transfusionOne?.time != null ? DateFormat('yyyy-MM-dd').format(data.transfusionOne!.time!) : ''}',
- style: const TextStyle(
- fontSize: 20,
- ),
- ),
- const SizedBox(
- height: 4,
- )
- ],
- ),
- ),
- ),
- ),
- ),
- Expanded(
- child: InkWell(
- onTap: () async {
- final result = await VDialogProfileTimeInput(
- title: "输血2",
- initialValue: data.transfusionTwo,
- ).show();
- if (result != null) {
- data.transfusionTwo = result;
- state.refreshHealthInfo();
- }
- },
- child: Card(
- elevation: 0,
- child: Container(
- decoration: BoxDecoration(
- border: Border.all(
- color: Colors.grey.shade300,
- ),
- borderRadius: BorderRadius.circular(8)),
- padding: const EdgeInsets.all(16),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- const Text(
- '输血2',
- style: TextStyle(
- fontSize: 24,
- ),
- ),
- Text(
- '名称:${data.transfusionTwo?.name ?? ''}',
- style: const TextStyle(
- fontSize: 20,
- ),
- ),
- Text(
- '时间:${data.transfusionTwo?.time != null ? DateFormat('yyyy-MM-dd').format(data.transfusionTwo!.time!) : ''}',
- style: const TextStyle(
- fontSize: 20,
- ),
- ),
- const SizedBox(
- height: 4,
- )
- ],
- ),
- ),
- ),
- ),
- ),
- const SizedBox(
- width: 16,
- ),
- ],
- ),
- ],
- ),
- Text(
- "家族病史",
- style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
- ),
- VListFormCell(
- label: "父亲",
- content: data.father?.map((index) {
- return PatientInfoRecord.historyFamilyList
- .firstWhere((element) => element.key == index)
- .value;
- }).join(','),
- onTap: () async {
- final result =
- await VDialogCheck<MapEntry<String, String>, String>(
- title: "父亲",
- source: PatientInfoRecord.historyFamilyList,
- initialValue: data.father ?? [],
- valueGetter: (data) => data.key,
- labelGetter: (data) => data.value,
- MutexValue: '1',
- ).show();
- if (result != null) {
- data.father = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- if (data.father?.contains("12") ?? false)
- VListFormCell(
- label: "父亲-其他",
- content: data.fatherOther,
- onTap: () async {
- final result = await VDialogInput(
- title: "父亲-其他",
- initialValue: data.fatherOther,
- placeholder: '请输入')
- .show();
- if (result != null) {
- data.fatherOther = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- VListFormCell(
- label: "母亲",
- content: data.mother?.map((index) {
- return PatientInfoRecord.historyFamilyList
- .firstWhere((element) => element.key == index)
- .value;
- }).join(','),
- onTap: () async {
- final result =
- await VDialogCheck<MapEntry<String, String>, String>(
- title: "母亲",
- source: PatientInfoRecord.historyFamilyList,
- initialValue: data.mother ?? [],
- valueGetter: (data) => data.key,
- labelGetter: (data) => data.value,
- MutexValue: '1',
- ).show();
- if (result != null) {
- data.mother = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- if (data.mother?.contains("12") ?? false)
- VListFormCell(
- label: "母亲-其他",
- content: data.motherOther,
- onTap: () async {
- final result = await VDialogInput(
- title: "母亲-其他",
- initialValue: data.motherOther,
- placeholder: '请输入')
- .show();
- if (result != null) {
- data.motherOther = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- VListFormCell(
- label: "兄弟姐妹",
- content: data.sibling?.map((index) {
- return PatientInfoRecord.historyFamilyList
- .firstWhere((element) => element.key == index)
- .value;
- }).join(','),
- onTap: () async {
- final result =
- await VDialogCheck<MapEntry<String, String>, String>(
- title: "兄弟姐妹",
- source: PatientInfoRecord.historyFamilyList,
- initialValue: data.sibling ?? [],
- valueGetter: (data) => data.key,
- labelGetter: (data) => data.value,
- MutexValue: '1',
- ).show();
- if (result != null) {
- data.sibling = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- if (data.sibling?.contains("12") ?? false)
- VListFormCell(
- label: "兄弟姐妹-其他",
- content: data.siblingOther,
- onTap: () async {
- final result = await VDialogInput(
- title: "兄弟姐妹-其他",
- initialValue: data.siblingOther,
- placeholder: '请输入')
- .show();
- if (result != null) {
- data.siblingOther = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- VListFormCell(
- label: "子女",
- content: data.children?.map((index) {
- return PatientInfoRecord.historyFamilyList
- .firstWhere((element) => element.key == index)
- .value;
- }).join(','),
- onTap: () async {
- final result =
- await VDialogCheck<MapEntry<String, String>, String>(
- title: "子女",
- source: PatientInfoRecord.historyFamilyList,
- initialValue: data.children ?? [],
- valueGetter: (data) => data.key,
- labelGetter: (data) => data.value,
- MutexValue: '1',
- ).show();
- if (result != null) {
- data.children = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- if (data.children?.contains("12") ?? false)
- VListFormCell(
- label: "子女-其他",
- content: data.childrenOther,
- onTap: () async {
- final result = await VDialogInput(
- title: "子女-其他",
- initialValue: data.childrenOther,
- placeholder: '请输入')
- .show();
- if (result != null) {
- data.childrenOther = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- Text(
- "遗传病史",
- style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
- ),
- VListFormCell(
- label: "遗传病史",
- content: data.historyGenetic.isNotNullOrEmpty
- ? PatientInfoRecord.historyPreviousOtherList
- .firstWhere((element) => element.key == data.historyGenetic)
- .value
- : '',
- onTap: () async {
- final result =
- await VDialogSelect<MapEntry<String, String>, String>(
- title: "遗传病史",
- source: PatientInfoRecord.historyPreviousOtherList,
- initialValue: data.historyGenetic,
- valueGetter: (data) => data.key,
- labelGetter: (data) => data.value,
- ).show();
- if (result != null) {
- data.historyGenetic = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- if (data.historyGenetic?.contains("2") ?? false)
- VListFormCell(
- label: "疾病名称",
- content: data.historyGeneticName,
- onTap: () async {
- final result = await VDialogInput(
- title: "疾病名称",
- initialValue: data.historyGeneticName,
- placeholder: '请输入')
- .show();
- if (result != null) {
- data.historyGeneticName = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- Column(
- children: [
- VListFormCell(
- label: "残疾情况",
- content: data.disabilitySituation?.map((index) {
- return PatientInfoRecord.disabilitySituationList
- .firstWhere((element) => element.key == index)
- .value;
- }).join(','),
- onTap: () async {
- final result =
- await VDialogCheck<MapEntry<String, String>, String>(
- title: "残疾情况",
- source: PatientInfoRecord.disabilitySituationList,
- initialValue: data.disabilitySituation ?? [],
- valueGetter: (data) => data.key,
- labelGetter: (data) => data.value,
- MutexValue: '1',
- ).show();
- if (result != null) {
- data.disabilitySituation = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- if (data.disabilitySituation?.contains("8") ?? false)
- VListFormCell(
- label: "其他残疾-疾病名称",
- content: data.disabilitySituationOther,
- onTap: () async {
- final result = await VDialogInput(
- title: "其他残疾-疾病名称",
- initialValue: data.disabilitySituationOther,
- placeholder: '请输入')
- .show();
- if (result != null) {
- data.disabilitySituationOther = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- ],
- ),
- Text(
- "生活环境",
- style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
- ),
- VListFormCell(
- label: "厨房排风设施",
- content: data.kitchenExhaustFacilities.isNotNullOrEmpty
- ? PatientInfoRecord.kitchenExhaustFacilitiesList
- .firstWhere((element) =>
- element.key == data.kitchenExhaustFacilities)
- .value
- : '',
- onTap: () async {
- final result =
- await VDialogSelect<MapEntry<String, String>, String>(
- title: "厨房排风设施",
- source: PatientInfoRecord.kitchenExhaustFacilitiesList,
- initialValue: data.kitchenExhaustFacilities,
- valueGetter: (data) => data.key,
- labelGetter: (data) => data.value,
- ).show();
- if (result != null) {
- data.kitchenExhaustFacilities = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- VListFormCell(
- label: "燃气类型",
- content: data.fuel.isNotNullOrEmpty
- ? PatientInfoRecord.fuelList
- .firstWhere((element) => element.key == data.fuel)
- .value
- : '',
- onTap: () async {
- final result =
- await VDialogSelect<MapEntry<String, String>, String>(
- title: "燃气类型",
- source: PatientInfoRecord.fuelList,
- initialValue: data.fuel,
- valueGetter: (data) => data.key,
- labelGetter: (data) => data.value,
- ).show();
- if (result != null) {
- data.fuel = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- if (data.fuel?.contains("6") ?? false)
- VListFormCell(
- label: "燃气类型-其他",
- content: data.fuelOther,
- onTap: () async {
- final result = await VDialogInput(
- title: "燃气类型-其他",
- initialValue: data.fuelOther,
- placeholder: '请输入')
- .show();
- if (result != null) {
- data.fuelOther = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- VListFormCell(
- label: "饮水",
- content: data.drinkingWater.isNotNullOrEmpty
- ? PatientInfoRecord.drinkingWaterList
- .firstWhere((element) => element.key == data.drinkingWater)
- .value
- : '',
- onTap: () async {
- final result =
- await VDialogSelect<MapEntry<String, String>, String>(
- title: "饮水",
- source: PatientInfoRecord.drinkingWaterList,
- initialValue: data.drinkingWater,
- valueGetter: (data) => data.key,
- labelGetter: (data) => data.value,
- ).show();
- if (result != null) {
- data.drinkingWater = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- if (data.drinkingWater?.contains("6") ?? false)
- VListFormCell(
- label: "饮水-其他",
- content: data.drinkingWaterOther,
- onTap: () async {
- final result = await VDialogInput(
- title: "饮水-其他",
- initialValue: data.drinkingWaterOther,
- placeholder: '请输入')
- .show();
- if (result != null) {
- data.drinkingWaterOther = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- VListFormCell(
- label: "厕所",
- content: data.toilet.isNotNullOrEmpty
- ? PatientInfoRecord.toiletList
- .firstWhere((element) => element.key == data.toilet)
- .value
- : '',
- onTap: () async {
- final result =
- await VDialogSelect<MapEntry<String, String>, String>(
- title: "厕所",
- source: PatientInfoRecord.toiletList,
- initialValue: data.toilet,
- valueGetter: (data) => data.key,
- labelGetter: (data) => data.value,
- ).show();
- if (result != null) {
- data.toilet = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- VListFormCell(
- label: "禽兽栏",
- content: data.animalPen.isNotNullOrEmpty
- ? PatientInfoRecord.animalPenList
- .firstWhere((element) => element.key == data.animalPen)
- .value
- : '',
- onTap: () async {
- final result =
- await VDialogSelect<MapEntry<String, String>, String>(
- title: "禽兽栏",
- source: PatientInfoRecord.animalPenList,
- initialValue: data.animalPen,
- valueGetter: (data) => data.key,
- labelGetter: (data) => data.value,
- ).show();
- if (result != null) {
- data.animalPen = result;
- state.refreshHealthInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- ],
- );
- });
- }
- Widget _buildEndIcon({bool isEdit = true}) {
- return Container(
- margin: EdgeInsets.only(left: isEdit ? 15 : 35),
- child: isEdit ? Icon(Icons.edit_outlined) : SizedBox(),
- );
- }
- }
|