postpartum_form.dart 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import 'base_form_value.dart';
  2. import 'form_info.dart';
  3. class PostpartumForm extends BaseFormValueChange {
  4. static PostpartumForm? _postpartumForm;
  5. PostpartumForm._internal();
  6. ///第 1 次产前检查服务记录表的值
  7. static PostpartumForm get instance {
  8. _postpartumForm ??= PostpartumForm._internal();
  9. return _postpartumForm!;
  10. }
  11. void initListener() {
  12. FormInfo.instance.onValueChange.addListener(_onValueChange);
  13. }
  14. void dispose() {
  15. FormInfo.instance.onValueChange.removeListener(_onValueChange);
  16. }
  17. void _onValueChange(Object sender, UpdateFormArgs e) {
  18. String sourceKey = e.sourceKey;
  19. switch (sourceKey) {
  20. case "Breasts":
  21. onValueChange(e, "Breasts_1", "Breasts_2");
  22. break;
  23. case "Lochia":
  24. onValueChange(e, "Lochia_1", "Lochia_2");
  25. break;
  26. case "Uterus":
  27. onValueChange(e, "Uterus_1", "Uterus_2");
  28. break;
  29. case "Wound":
  30. onValueChange(e, "Wound_1", "Wound_2");
  31. break;
  32. case "Classification":
  33. onValueChange(e, "Classification_1", "Classification_2");
  34. break;
  35. case "Referral":
  36. onReferralChange(e);
  37. break;
  38. case "Processing":
  39. onValueChange(e, "Processing_1", "Reason_For_Referral");
  40. onValueChange(e, "Processing_1", "Institution_And_Department");
  41. break;
  42. }
  43. }
  44. }