12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208 |
- import 'package:flutter/foundation.dart';
- import 'package:flutter/material.dart';
- import 'package:get/get.dart';
- import 'package:intl/intl.dart';
- import 'package:vitalapp/architecture/app_parameters.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: [
- Row(
- children: [
- Text(
- "过敏史",
- style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
- ),
- Expanded(child: SizedBox()),
- Text(
- "全选",
- style: TextStyle(
- fontSize: 20,
- fontWeight: FontWeight.w700,
- ),
- ),
- Switch(
- value: controller.state.selectedAllergyHistory,
- onChanged: (v) {
- controller.state.selectedAllergyHistory = v;
- if (v) {
- data.historyDrugAllergies = ["1"];
- data.historyExposure = ["1"];
- } else {
- data.historyDrugAllergies = [];
- data.historyExposure = [];
- }
- },
- ),
- ],
- ),
- 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(),
- ),
- Row(
- children: [
- Text(
- "既往史",
- style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
- ),
- Expanded(child: SizedBox()),
- Text(
- "全选",
- style: TextStyle(
- fontSize: 20,
- fontWeight: FontWeight.w700,
- ),
- ),
- Switch(
- value: controller.state.selectedAllMedicalHistory,
- onChanged: (v) {
- controller.state.selectedAllMedicalHistory = v;
- if (v) {
- data.operation = "1";
- data.trauma = "1";
- data.transfusion = "1";
- data.historyPreviousDisease = ["1"];
- } else {
- data.operation = null;
- data.trauma = null;
- data.transfusion = null;
- data.historyPreviousDisease = null;
- }
- },
- ),
- ],
- ),
- 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 {
- bool _isLocalStation =
- AppParameters.data.isLocalStation;
- DateTime? result;
- if (kIsWeb || _isLocalStation) {
- result = await showDatePicker(
- context: Get.context!,
- initialDate:
- controller.state.birthday ?? DateTime.now(),
- firstDate: DateTime(1900),
- lastDate: DateTime(2100),
- );
- } else {
- 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,
- ),
- ],
- ),
- ],
- ),
- Row(
- children: [
- Text(
- "家族病史",
- style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
- ),
- Expanded(child: SizedBox()),
- Text(
- "全选",
- style: TextStyle(
- fontSize: 20,
- fontWeight: FontWeight.w700,
- ),
- ),
- Switch(
- value: controller.state.selectedAllFamilyMedicalHistory,
- onChanged: (v) {
- controller.state.selectedAllFamilyMedicalHistory = v;
- if (v) {
- data.father = ["1"];
- data.mother = ["1"];
- data.sibling = ["1"];
- data.children = ["1"];
- } else {
- data.father = [];
- data.mother = [];
- data.sibling = [];
- data.children = [];
- }
- },
- ),
- ],
- ),
- 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(),
- ),
- Row(
- children: [
- Text(
- "遗传病史",
- style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
- ),
- Expanded(child: SizedBox()),
- Text(
- "全选",
- style: TextStyle(
- fontSize: 20,
- fontWeight: FontWeight.w700,
- ),
- ),
- Switch(
- value: controller.state.selectAllGeneticHistory,
- onChanged: (v) {
- controller.state.selectAllGeneticHistory = v;
- if (v) {
- data.historyGenetic = "1";
- data.disabilitySituation = ["1"];
- } else {
- data.historyGenetic = null;
- data.disabilitySituation = [];
- }
- },
- ),
- ],
- ),
- 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(),
- ),
- ],
- ),
- Row(
- children: [
- Text(
- "生活环境",
- style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
- ),
- Expanded(child: SizedBox()),
- Text(
- "全选",
- style: TextStyle(
- fontSize: 20,
- fontWeight: FontWeight.w700,
- ),
- ),
- Switch(
- value: controller.state.livingEnvironment,
- onChanged: (v) {
- controller.state.livingEnvironment = v;
- if (v) {
- data.fuel = "1";
- data.drinkingWater = "1";
- data.toilet = "1";
- data.animalPen = "1";
- data.kitchenExhaustFacilities = "1";
- } else {
- data.fuel = null;
- data.toilet = null;
- data.animalPen = null;
- data.kitchenExhaustFacilities = null;
- data.drinkingWater = null;
- }
- },
- ),
- ],
- ),
- 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(),
- );
- }
- }
|