functions_panel.dart 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. import 'package:fis_jsonrpc/rpc.dart';
  2. import 'package:flutter/foundation.dart';
  3. import 'package:flutter/material.dart';
  4. import 'package:get/get.dart';
  5. import 'package:vitalapp/architecture/values/features.dart';
  6. import 'package:vitalapp/consts/styles.dart';
  7. import 'package:vitalapp/pages/check/prescription/blood_sugar_disorder.dart';
  8. import 'package:vitalapp/pages/check/prescription/hypertension_prescription.dart';
  9. import 'package:vitalapp/pages/check/prescription/psychiatric_prescription.dart';
  10. import 'package:vitalapp/pages/check/prescription/tuberculosis_prescription.dart';
  11. import 'package:vitalapp/pages/widgets/function_button.dart';
  12. import 'package:vitalapp/store/store.dart';
  13. import '../controller.dart';
  14. /// 功能入口面板
  15. class FunctionsPanel extends GetView<PatientDetailController> {
  16. const FunctionsPanel({super.key});
  17. @override
  18. Widget build(BuildContext context) {
  19. return Container(
  20. alignment: Alignment.topLeft,
  21. margin: const EdgeInsets.all(8).copyWith(left: 0, right: 12),
  22. decoration: BoxDecoration(
  23. color: Colors.white,
  24. borderRadius: GlobalStyles.borderRadius,
  25. ),
  26. padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 10)
  27. .copyWith(right: 0),
  28. child: GridView(
  29. padding: const EdgeInsets.symmetric(horizontal: 32).copyWith(top: 12),
  30. // shrinkWrap: true,
  31. // controller: scrollController,
  32. gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
  33. crossAxisCount: 3,
  34. mainAxisSpacing: 24,
  35. crossAxisSpacing: 24,
  36. childAspectRatio: 15 / 14,
  37. ),
  38. children: [
  39. if (kDebugMode) ...[
  40. FunctionButton(
  41. label: "糖尿病处方",
  42. icon: _buildImgIcon("档案.png"),
  43. onTap: () {
  44. Get.to(BloodSugarDisorder());
  45. },
  46. ),
  47. FunctionButton(
  48. label: "高血压处方",
  49. icon: _buildImgIcon("档案.png"),
  50. onTap: () {
  51. Get.to(HypertensionPrescription());
  52. },
  53. ),
  54. FunctionButton(
  55. label: "精神障碍处方",
  56. icon: _buildImgIcon("档案.png"),
  57. onTap: () {
  58. Get.to(PsychiatricPrescription());
  59. },
  60. ),
  61. FunctionButton(
  62. label: "肺结核处方",
  63. icon: _buildImgIcon("档案.png"),
  64. onTap: () {
  65. Get.to(TuberculosisPrescription());
  66. },
  67. ),
  68. ],
  69. if (Store.user.hasFeature(FeatureKeys.HealthRecordHandling))
  70. FunctionButton(
  71. label: "个人基本信息",
  72. icon: _buildImgIcon("档案.png"),
  73. onTap: controller.gotoInfo,
  74. ),
  75. if (kDebugMode)
  76. FunctionButton(
  77. label: "精神障碍补充表",
  78. icon: _buildImgIcon("严重精神障碍补充表.png"),
  79. onTap: controller.gotoMentalDisorderInfo,
  80. ),
  81. if (Store.user.hasFeature(FeatureKeys.HealthCheckRecord))
  82. FunctionButton(
  83. label: "体检记录",
  84. icon: _buildImgIcon("体检记录.png"),
  85. onTap: controller.gotoHealthCheckRecord,
  86. ),
  87. // if (Store.user.hasFeature(FeatureKeys.FollowUpRecord))
  88. // FunctionButton(
  89. // label: "随访记录",
  90. // icon: _buildImgIcon("随访报告.png"),
  91. // onTap: controller.gotoFollowUpRecord,
  92. // ),
  93. // FunctionButton(
  94. // label: "双向转诊",
  95. // icon: _buildImgIcon("转诊.png"),
  96. // onTap: controller.gotoReferral,
  97. // ),
  98. if (Store.user.hasFeature(FeatureKeys.SigningRecord))
  99. FunctionButton(
  100. label: "签约记录",
  101. icon: _buildImgIcon("签约记录.png"),
  102. onTap: controller.gotoContractRecords,
  103. ),
  104. if (Store.user.hasFeature(FeatureKeys.HealthCheckupRecords))
  105. FunctionButton(
  106. label: "健康检测记录",
  107. icon: _buildImgIcon("诊疗.png"),
  108. onTap: controller.gotoExamRecord,
  109. ),
  110. if (Store.user
  111. .hasFeature(FeatureKeys.TraditionalChineseMedicineConstitution))
  112. FunctionButton(
  113. label: "中医体质记录",
  114. icon: _buildImgIcon("中医体质.png"),
  115. onTap: controller.gotoTraditionalChineseMedicineConsitutionRecord,
  116. ),
  117. if (Store.user.hasFeature(FeatureKeys.HypertensionOperation))
  118. FunctionButton(
  119. label: "高血压随访",
  120. icon: _buildImgIcon("高血压随访.png"),
  121. onTap: controller.gotoHypertensionRecord,
  122. ),
  123. if (Store.user.hasFeature(FeatureKeys.DoctorContract))
  124. FunctionButton(
  125. label: "医生签约",
  126. icon: _buildImgIcon("签约.png"),
  127. onTap: controller.gotoContractRecords,
  128. ),
  129. if (Store.user.hasFeature(FeatureKeys.DiabeticOperational))
  130. FunctionButton(
  131. label: "2型糖尿病随访",
  132. icon: _buildImgIcon("2型糖尿病随访.png"),
  133. onTap: controller.gotoDiabetesRecord,
  134. ),
  135. if (Store.user.hasFeature(FeatureKeys.SelfCareAssessmentRecord))
  136. FunctionButton(
  137. label: "老年人自理评估",
  138. icon: _buildImgIcon("自理能力评估.png"),
  139. onTap: controller.gotoSelfCareAbilityAssessment,
  140. ),
  141. if (Store.user.hasFeature(FeatureKeys.MaternalHealthManagement) &&
  142. Store.user.currentSelectPatientInfo?.patientGender !=
  143. GenderEnum.Male)
  144. FunctionButton(
  145. label: "孕产妇健康管理",
  146. icon: _buildImgIcon("孕产妇健康管理.png"),
  147. onTap: controller.gotoMaternalHealthManagement,
  148. ),
  149. if (Store.user.hasFeature(FeatureKeys.MentalDisorderInfo))
  150. FunctionButton(
  151. label: "精神障碍随访",
  152. icon: _buildImgIcon("严重精神障碍随访.png"),
  153. onTap: controller.gotoMentalDisorderRecord,
  154. ),
  155. if ((Store.user.currentSelectPatientInfo?.crowdLabels
  156. ?.contains("RQFL_ET") ??
  157. false) &&
  158. Store.user.hasFeature(FeatureKeys.ChildrenHealthManagement))
  159. FunctionButton(
  160. label: "儿童健康管理",
  161. icon: _buildImgIcon("儿童健康管理.png"),
  162. onTap: controller.gotoChildHealth,
  163. ),
  164. ],
  165. ),
  166. );
  167. }
  168. Widget _buildImgIcon(String assetName) {
  169. return Image.asset(
  170. "assets/images/patient/$assetName",
  171. width: 120,
  172. height: 120,
  173. fit: BoxFit.contain,
  174. );
  175. }
  176. }