TrigScenEnum.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System;
  2. using System.ComponentModel;
  3. public enum TrigScenEnum
  4. {
  5. /// <summary> 门诊挂号 </summary>
  6. [Description("门诊挂号")]
  7. OPRegistration = 1,
  8. /// <summary> 门诊收费登记 </summary>
  9. [Description("门诊收费登记")]
  10. OPChargeRegistration = 2,
  11. /// <summary> 住院登记 </summary>
  12. [Description("住院登记")]
  13. IPAdmission = 3,
  14. /// <summary> 住院收费登记 </summary>
  15. [Description("住院收费登记")]
  16. IPChargeRegistration = 4,
  17. /// <summary> 住院执行医嘱 </summary>
  18. [Description("住院执行医嘱")]
  19. IPExecuteOrder = 5,
  20. /// <summary> 门诊结算 </summary>
  21. [Description("门诊结算")]
  22. OPSettlement = 6,
  23. /// <summary> 门诊预结算 </summary>
  24. [Description("门诊预结算")]
  25. OPPreSettlement = 7,
  26. /// <summary> 住院结算 </summary>
  27. [Description("住院结算")]
  28. IPSettlement = 8,
  29. /// <summary> 住院预结算 </summary>
  30. [Description("住院预结算")]
  31. IPPreSettlement = 9,
  32. /// <summary> 购药划卡 </summary>
  33. [Description("购药划卡")]
  34. DrugPurchaseCardSwipe = 10
  35. }
  36. // 辅助扩展方法:获取 Description 特性值
  37. public static class EnumExtensions
  38. {
  39. // 根据 int code 获取枚举值
  40. public static TrigScenEnum FromCode(int code)
  41. {
  42. if (Enum.IsDefined(typeof(TrigScenEnum), code))
  43. {
  44. return (TrigScenEnum)code;
  45. }
  46. throw new ArgumentException($"Invalid TrigScenEnum code: {code}", nameof(code));
  47. }
  48. }