drug_schema.json 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. {
  2. "$schema": "https://json-schema.org/draft/2020-12/schema",
  3. "title": "Drug Entry",
  4. "description": "结构化药品条目 schema,用于药典 PDF 解析输出",
  5. "type": "object",
  6. "properties": {
  7. "drug_id": {
  8. "type": "string",
  9. "description": "唯一标识符,如 H20000001"
  10. },
  11. "name": {
  12. "type": "string",
  13. "description": "药品通用名"
  14. },
  15. "name_en": {
  16. "type": "string",
  17. "description": "英文名"
  18. },
  19. "name_pinyin": {
  20. "type": "string",
  21. "description": "汉语拼音"
  22. },
  23. "category": {
  24. "type": "string",
  25. "enum": ["化学药", "中药", "生物制品", "辅料"],
  26. "description": "药品分类"
  27. },
  28. "subcategory": {
  29. "type": "string",
  30. "description": "子分类"
  31. },
  32. "sections": {
  33. "type": "object",
  34. "properties": {
  35. "性状": {"type": "string"},
  36. "鉴别": {"type": "string"},
  37. "检查": {"type": "string"},
  38. "含量测定": {"type": "string"},
  39. "类别": {"type": "string"},
  40. "贮藏": {"type": "string"},
  41. "制剂": {"type": "string"},
  42. "用法与用量": {"type": "string"},
  43. "禁忌": {"type": "string"},
  44. "不良反应": {"type": "string"},
  45. "注意事项": {"type": "string"}
  46. }
  47. },
  48. "source": {
  49. "type": "object",
  50. "properties": {
  51. "version": {"type": "string", "description": "药典版本,如 2020年版"},
  52. "volume": {"type": "string", "description": "部,如 二部"},
  53. "page": {"type": "string", "description": "页码"},
  54. "entry_id": {"type": "string", "description": "条目ID"}
  55. },
  56. "required": ["version", "volume", "page"]
  57. }
  58. },
  59. "required": ["drug_id", "name", "category", "sections", "source"]
  60. }