update_table.sql 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302
  1. /*
  2. Navicat Premium Data Transfer
  3. Source Server : 172.16.32.179
  4. Source Server Type : SQL Server
  5. Source Server Version : 10506000
  6. Source Host : 172.16.32.179:1433
  7. Source Catalog : thxyhisdb
  8. Source Schema : dbo
  9. Target Server Type : SQL Server
  10. Target Server Version : 10506000
  11. File Encoding : 65001
  12. Date: 24/04/2025 15:54:05
  13. */
  14. -- ----------------------------
  15. -- Table structure for mz_dzfp_upload
  16. -- ----------------------------
  17. IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[mz_dzfp_upload]') AND type IN ('U'))
  18. DROP TABLE [dbo].[mz_dzfp_upload]
  19. GO
  20. CREATE TABLE [dbo].[mz_dzfp_upload] (
  21. [patient_id] varchar(100) COLLATE Chinese_PRC_BIN NULL,
  22. [times] int NULL,
  23. [receipt_no] int NULL,
  24. [type_flag] int NULL,
  25. [request_id] varchar(100) COLLATE Chinese_PRC_BIN NULL,
  26. [res_code] int NULL,
  27. [qrcode] text COLLATE Chinese_PRC_BIN NULL,
  28. [res_url] varchar(1000) COLLATE Chinese_PRC_BIN NULL,
  29. [fp_no] varchar(250) COLLATE Chinese_PRC_BIN NULL,
  30. [res_message] varchar(1000) COLLATE Chinese_PRC_BIN NULL,
  31. [del_flag] int DEFAULT ((0)) NULL,
  32. [blue_issue_date] varchar(250) COLLATE Chinese_PRC_BIN NULL,
  33. [op_id] varchar(50) COLLATE Chinese_PRC_BIN NULL,
  34. [pdf_file_str] text COLLATE Chinese_PRC_BIN NULL,
  35. [op_code] varchar(100) COLLATE Chinese_PRC_BIN NULL
  36. )
  37. GO
  38. ALTER TABLE [dbo].[mz_dzfp_upload] SET (LOCK_ESCALATION = TABLE)
  39. GO
  40. EXEC sp_addextendedproperty
  41. 'MS_Description', N'发票类型 1 门诊蓝字发票 2 门诊红字发票 3住院蓝字发票 4住院红字发票',
  42. 'SCHEMA', N'dbo',
  43. 'TABLE', N'mz_dzfp_upload',
  44. 'COLUMN', N'type_flag'
  45. GO
  46. EXEC sp_addextendedproperty
  47. 'MS_Description', N'上传发票唯一标识',
  48. 'SCHEMA', N'dbo',
  49. 'TABLE', N'mz_dzfp_upload',
  50. 'COLUMN', N'request_id'
  51. GO
  52. EXEC sp_addextendedproperty
  53. 'MS_Description', N'-1 失败 0 成功',
  54. 'SCHEMA', N'dbo',
  55. 'TABLE', N'mz_dzfp_upload',
  56. 'COLUMN', N'res_code'
  57. GO
  58. EXEC sp_addextendedproperty
  59. 'MS_Description', N'二维码 base64',
  60. 'SCHEMA', N'dbo',
  61. 'TABLE', N'mz_dzfp_upload',
  62. 'COLUMN', N'qrcode'
  63. GO
  64. EXEC sp_addextendedproperty
  65. 'MS_Description', N'内网下载链接',
  66. 'SCHEMA', N'dbo',
  67. 'TABLE', N'mz_dzfp_upload',
  68. 'COLUMN', N'res_url'
  69. GO
  70. EXEC sp_addextendedproperty
  71. 'MS_Description', N'发票号',
  72. 'SCHEMA', N'dbo',
  73. 'TABLE', N'mz_dzfp_upload',
  74. 'COLUMN', N'fp_no'
  75. GO
  76. EXEC sp_addextendedproperty
  77. 'MS_Description', N'0 有效 1作废',
  78. 'SCHEMA', N'dbo',
  79. 'TABLE', N'mz_dzfp_upload',
  80. 'COLUMN', N'del_flag'
  81. GO
  82. EXEC sp_addextendedproperty
  83. 'MS_Description', N'开具日期',
  84. 'SCHEMA', N'dbo',
  85. 'TABLE', N'mz_dzfp_upload',
  86. 'COLUMN', N'blue_issue_date'
  87. GO
  88. EXEC sp_addextendedproperty
  89. 'MS_Description', N'操作员',
  90. 'SCHEMA', N'dbo',
  91. 'TABLE', N'mz_dzfp_upload',
  92. 'COLUMN', N'op_id'
  93. GO
  94. EXEC sp_addextendedproperty
  95. 'MS_Description', N'pdf文档',
  96. 'SCHEMA', N'dbo',
  97. 'TABLE', N'mz_dzfp_upload',
  98. 'COLUMN', N'pdf_file_str'
  99. GO
  100. EXEC sp_addextendedproperty
  101. 'MS_Description', N'电子发票上传记录',
  102. 'SCHEMA', N'dbo',
  103. 'TABLE', N'mz_dzfp_upload'
  104. GO
  105. -- ----------------------------
  106. -- Indexes structure for table mz_dzfp_upload
  107. -- ----------------------------
  108. CREATE NONCLUSTERED INDEX [mz_dzfp_upload_index_1]
  109. ON [dbo].[mz_dzfp_upload] (
  110. [patient_id] ASC,
  111. [times] ASC,
  112. [receipt_no] ASC,
  113. [request_id] ASC
  114. )
  115. GO
  116. -- ----------------------------
  117. -- Uniques structure for table mz_dzfp_upload
  118. -- ----------------------------
  119. ALTER TABLE [dbo].[mz_dzfp_upload] ADD CONSTRAINT [mz_dzfp_upload_wy1] UNIQUE NONCLUSTERED ([patient_id] ASC, [times] ASC, [receipt_no] ASC, [type_flag] ASC, [del_flag] ASC)
  120. WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
  121. ON [PRIMARY]
  122. GO
  123. /*
  124. Navicat Premium Data Transfer
  125. Source Server : 172.16.32.179
  126. Source Server Type : SQL Server
  127. Source Server Version : 10506000
  128. Source Host : 172.16.32.179:1433
  129. Source Catalog : thxyhisdb
  130. Source Schema : dbo
  131. Target Server Type : SQL Server
  132. Target Server Version : 10506000
  133. File Encoding : 65001
  134. Date: 28/04/2025 10:06:24
  135. */
  136. -- ----------------------------
  137. -- Table structure for t_wxmall_package
  138. -- ----------------------------
  139. IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[t_wxmall_package]') AND type IN ('U'))
  140. DROP TABLE [dbo].[t_wxmall_package]
  141. GO
  142. CREATE TABLE [dbo].[t_wxmall_package] (
  143. [id] varchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  144. [name] nvarchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  145. [origin_price] money NOT NULL,
  146. [discount_price] money NOT NULL,
  147. [thumb_path] varchar(128) COLLATE Chinese_PRC_BIN DEFAULT ('https://staticweb.hnthyy.cn/images/wxmall-package/blank.png') NOT NULL,
  148. [create_time] datetime DEFAULT (getdate()) NOT NULL,
  149. [create_staff_code] varchar(6) COLLATE Chinese_PRC_BIN NOT NULL,
  150. [create_staff_name] nvarchar(16) COLLATE Chinese_PRC_BIN NOT NULL,
  151. [state] varchar(16) COLLATE Chinese_PRC_BIN DEFAULT ('ACTIVATED') NOT NULL,
  152. [description] nvarchar(256) COLLATE Chinese_PRC_BIN NULL
  153. )
  154. GO
  155. ALTER TABLE [dbo].[t_wxmall_package] SET (LOCK_ESCALATION = TABLE)
  156. GO
  157. -- ----------------------------
  158. -- Table structure for t_wxmall_package_item
  159. -- ----------------------------
  160. IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[t_wxmall_package_item]') AND type IN ('U'))
  161. DROP TABLE [dbo].[t_wxmall_package_item]
  162. GO
  163. CREATE TABLE [dbo].[t_wxmall_package_item] (
  164. [package_id] nvarchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  165. [his_code] varchar(12) COLLATE Chinese_PRC_BIN NOT NULL,
  166. [his_name] nvarchar(128) COLLATE Chinese_PRC_BIN NOT NULL,
  167. [type] varchar(2) COLLATE Chinese_PRC_BIN NULL,
  168. [origin_price] money NOT NULL,
  169. [discount_price] money NOT NULL,
  170. [quantity] smallint DEFAULT ((1)) NOT NULL,
  171. [cost_amt] money NULL,
  172. [gender_restriction] tinyint NULL,
  173. [min_age_restriction] smallint NULL,
  174. [max_age_restriction] smallint NULL
  175. )
  176. GO
  177. ALTER TABLE [dbo].[t_wxmall_package_item] SET (LOCK_ESCALATION = TABLE)
  178. GO
  179. EXEC sp_addextendedproperty
  180. 'MS_Description', N'所属套餐ID',
  181. 'SCHEMA', N'dbo',
  182. 'TABLE', N't_wxmall_package_item',
  183. 'COLUMN', N'package_id'
  184. GO
  185. EXEC sp_addextendedproperty
  186. 'MS_Description', N'HIS收费编码',
  187. 'SCHEMA', N'dbo',
  188. 'TABLE', N't_wxmall_package_item',
  189. 'COLUMN', N'his_code'
  190. GO
  191. EXEC sp_addextendedproperty
  192. 'MS_Description', N'HIS收费名称',
  193. 'SCHEMA', N'dbo',
  194. 'TABLE', N't_wxmall_package_item',
  195. 'COLUMN', N'his_name'
  196. GO
  197. EXEC sp_addextendedproperty
  198. 'MS_Description', N'项目类别',
  199. 'SCHEMA', N'dbo',
  200. 'TABLE', N't_wxmall_package_item',
  201. 'COLUMN', N'type'
  202. GO
  203. EXEC sp_addextendedproperty
  204. 'MS_Description', N'原价',
  205. 'SCHEMA', N'dbo',
  206. 'TABLE', N't_wxmall_package_item',
  207. 'COLUMN', N'origin_price'
  208. GO
  209. EXEC sp_addextendedproperty
  210. 'MS_Description', N'优惠价',
  211. 'SCHEMA', N'dbo',
  212. 'TABLE', N't_wxmall_package_item',
  213. 'COLUMN', N'discount_price'
  214. GO
  215. EXEC sp_addextendedproperty
  216. 'MS_Description', N'数量',
  217. 'SCHEMA', N'dbo',
  218. 'TABLE', N't_wxmall_package_item',
  219. 'COLUMN', N'quantity'
  220. GO
  221. EXEC sp_addextendedproperty
  222. 'MS_Description', N'总价',
  223. 'SCHEMA', N'dbo',
  224. 'TABLE', N't_wxmall_package_item',
  225. 'COLUMN', N'cost_amt'
  226. GO
  227. EXEC sp_addextendedproperty
  228. 'MS_Description', N'服务号套餐明细',
  229. 'SCHEMA', N'dbo',
  230. 'TABLE', N't_wxmall_package_item'
  231. GO
  232. -- ----------------------------
  233. -- Table structure for t_wxmall_package_purchased
  234. -- ----------------------------
  235. IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[t_wxmall_package_purchased]') AND type IN ('U'))
  236. DROP TABLE [dbo].[t_wxmall_package_purchased]
  237. GO
  238. CREATE TABLE [dbo].[t_wxmall_package_purchased] (
  239. [id] varchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  240. [pat_no] varchar(12) COLLATE Chinese_PRC_BIN NOT NULL,
  241. [wx_trade_no] varchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  242. [package_id] varchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  243. [package_name] nvarchar(64) COLLATE Chinese_PRC_BIN NOT NULL,
  244. [purchase_price] money NOT NULL,
  245. [purchase_time] datetime DEFAULT (getdate()) NOT NULL,
  246. [state] varchar(12) COLLATE Chinese_PRC_BIN DEFAULT ('NOT_USED') NOT NULL,
  247. [coupon_amt] money DEFAULT ((0)) NOT NULL,
  248. [cashpay_amt] money NOT NULL
  249. )
  250. GO
  251. ALTER TABLE [dbo].[t_wxmall_package_purchased] SET (LOCK_ESCALATION = TABLE)
  252. GO
  253. EXEC sp_addextendedproperty
  254. 'MS_Description', N'主键',
  255. 'SCHEMA', N'dbo',
  256. 'TABLE', N't_wxmall_package_purchased',
  257. 'COLUMN', N'id'
  258. GO
  259. EXEC sp_addextendedproperty
  260. 'MS_Description', N'门诊ID',
  261. 'SCHEMA', N'dbo',
  262. 'TABLE', N't_wxmall_package_purchased',
  263. 'COLUMN', N'pat_no'
  264. GO
  265. EXEC sp_addextendedproperty
  266. 'MS_Description', N'微信支付订单号',
  267. 'SCHEMA', N'dbo',
  268. 'TABLE', N't_wxmall_package_purchased',
  269. 'COLUMN', N'wx_trade_no'
  270. GO
  271. EXEC sp_addextendedproperty
  272. 'MS_Description', N'套餐ID',
  273. 'SCHEMA', N'dbo',
  274. 'TABLE', N't_wxmall_package_purchased',
  275. 'COLUMN', N'package_id'
  276. GO
  277. EXEC sp_addextendedproperty
  278. 'MS_Description', N'套餐名称',
  279. 'SCHEMA', N'dbo',
  280. 'TABLE', N't_wxmall_package_purchased',
  281. 'COLUMN', N'package_name'
  282. GO
  283. EXEC sp_addextendedproperty
  284. 'MS_Description', N'购买价格',
  285. 'SCHEMA', N'dbo',
  286. 'TABLE', N't_wxmall_package_purchased',
  287. 'COLUMN', N'purchase_price'
  288. GO
  289. EXEC sp_addextendedproperty
  290. 'MS_Description', N'购买时间',
  291. 'SCHEMA', N'dbo',
  292. 'TABLE', N't_wxmall_package_purchased',
  293. 'COLUMN', N'purchase_time'
  294. GO
  295. EXEC sp_addextendedproperty
  296. 'MS_Description', N'套餐使用状态:USABLE:可使用;RAN_OUT:已用完',
  297. 'SCHEMA', N'dbo',
  298. 'TABLE', N't_wxmall_package_purchased',
  299. 'COLUMN', N'state'
  300. GO
  301. EXEC sp_addextendedproperty
  302. 'MS_Description', N'患者已购服务号套餐目录',
  303. 'SCHEMA', N'dbo',
  304. 'TABLE', N't_wxmall_package_purchased'
  305. GO
  306. -- ----------------------------
  307. -- Table structure for t_wxmall_package_purchased_item
  308. -- ----------------------------
  309. IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[t_wxmall_package_purchased_item]') AND type IN ('U'))
  310. DROP TABLE [dbo].[t_wxmall_package_purchased_item]
  311. GO
  312. CREATE TABLE [dbo].[t_wxmall_package_purchased_item] (
  313. [id] varchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  314. [wx_trade_no] varchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  315. [pat_no] varchar(12) COLLATE Chinese_PRC_BIN NOT NULL,
  316. [package_id] varchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  317. [his_code] varchar(12) COLLATE Chinese_PRC_BIN NOT NULL,
  318. [his_name] nvarchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  319. [quantity] smallint DEFAULT ((1)) NOT NULL,
  320. [usable_quantity] smallint DEFAULT ((1)) NOT NULL,
  321. [last_use_time] datetime NULL,
  322. [price] money NULL,
  323. [cost_amt] money NULL,
  324. [gender_restriction] tinyint NULL,
  325. [min_age_restriction] smallint NULL,
  326. [max_age_restriction] smallint NULL
  327. )
  328. GO
  329. ALTER TABLE [dbo].[t_wxmall_package_purchased_item] SET (LOCK_ESCALATION = TABLE)
  330. GO
  331. -- ----------------------------
  332. -- Table structure for t_wxmall_package_use_history
  333. -- ----------------------------
  334. IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[t_wxmall_package_use_history]') AND type IN ('U'))
  335. DROP TABLE [dbo].[t_wxmall_package_use_history]
  336. GO
  337. CREATE TABLE [dbo].[t_wxmall_package_use_history] (
  338. [id] varchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  339. [pat_no] varchar(12) COLLATE Chinese_PRC_BIN NOT NULL,
  340. [times] smallint NOT NULL,
  341. [wx_trade_no] varchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  342. [package_id] varchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  343. [package_item_id] varchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  344. [use_quantity] smallint DEFAULT ((1)) NOT NULL,
  345. [use_time] datetime DEFAULT (getdate()) NOT NULL,
  346. [doctor_code] varchar(6) COLLATE Chinese_PRC_BIN NOT NULL
  347. )
  348. GO
  349. ALTER TABLE [dbo].[t_wxmall_package_use_history] SET (LOCK_ESCALATION = TABLE)
  350. GO
  351. -- ----------------------------
  352. -- Table structure for t_wxmall_package_used
  353. -- ----------------------------
  354. IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[t_wxmall_package_used]') AND type IN ('U'))
  355. DROP TABLE [dbo].[t_wxmall_package_used]
  356. GO
  357. CREATE TABLE [dbo].[t_wxmall_package_used] (
  358. [id] varchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  359. [pat_no] varchar(12) COLLATE Chinese_PRC_BIN NOT NULL,
  360. [times] smallint NOT NULL,
  361. [wx_trade_no] varchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  362. [package_id] varchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  363. [package_item_id] varchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  364. [use_quantity] smallint DEFAULT ((1)) NOT NULL,
  365. [use_time] datetime DEFAULT (getdate()) NOT NULL,
  366. [doctor_code] varchar(6) COLLATE Chinese_PRC_BIN NOT NULL
  367. )
  368. GO
  369. ALTER TABLE [dbo].[t_wxmall_package_used] SET (LOCK_ESCALATION = TABLE)
  370. GO
  371. EXEC sp_addextendedproperty
  372. 'MS_Description', N'主键',
  373. 'SCHEMA', N'dbo',
  374. 'TABLE', N't_wxmall_package_used',
  375. 'COLUMN', N'id'
  376. GO
  377. EXEC sp_addextendedproperty
  378. 'MS_Description', N'患者门诊ID',
  379. 'SCHEMA', N'dbo',
  380. 'TABLE', N't_wxmall_package_used',
  381. 'COLUMN', N'pat_no'
  382. GO
  383. EXEC sp_addextendedproperty
  384. 'MS_Description', N'就诊次数',
  385. 'SCHEMA', N'dbo',
  386. 'TABLE', N't_wxmall_package_used',
  387. 'COLUMN', N'times'
  388. GO
  389. EXEC sp_addextendedproperty
  390. 'MS_Description', N'微信支付订单号',
  391. 'SCHEMA', N'dbo',
  392. 'TABLE', N't_wxmall_package_used',
  393. 'COLUMN', N'wx_trade_no'
  394. GO
  395. EXEC sp_addextendedproperty
  396. 'MS_Description', N'套餐ID',
  397. 'SCHEMA', N'dbo',
  398. 'TABLE', N't_wxmall_package_used',
  399. 'COLUMN', N'package_id'
  400. GO
  401. EXEC sp_addextendedproperty
  402. 'MS_Description', N'套餐项目id',
  403. 'SCHEMA', N'dbo',
  404. 'TABLE', N't_wxmall_package_used',
  405. 'COLUMN', N'package_item_id'
  406. GO
  407. EXEC sp_addextendedproperty
  408. 'MS_Description', N'使用数量',
  409. 'SCHEMA', N'dbo',
  410. 'TABLE', N't_wxmall_package_used',
  411. 'COLUMN', N'use_quantity'
  412. GO
  413. EXEC sp_addextendedproperty
  414. 'MS_Description', N'使用时间',
  415. 'SCHEMA', N'dbo',
  416. 'TABLE', N't_wxmall_package_used',
  417. 'COLUMN', N'use_time'
  418. GO
  419. EXEC sp_addextendedproperty
  420. 'MS_Description', N'开单医生',
  421. 'SCHEMA', N'dbo',
  422. 'TABLE', N't_wxmall_package_used',
  423. 'COLUMN', N'doctor_code'
  424. GO
  425. EXEC sp_addextendedproperty
  426. 'MS_Description', N'套餐使用记录',
  427. 'SCHEMA', N'dbo',
  428. 'TABLE', N't_wxmall_package_used'
  429. GO
  430. -- ----------------------------
  431. -- Primary Key structure for table t_wxmall_package
  432. -- ----------------------------
  433. ALTER TABLE [dbo].[t_wxmall_package] ADD CONSTRAINT [t_wxmall_package_pk] PRIMARY KEY CLUSTERED ([id])
  434. WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
  435. ON [PRIMARY]
  436. GO
  437. -- ----------------------------
  438. -- Primary Key structure for table t_wxmall_package_item
  439. -- ----------------------------
  440. ALTER TABLE [dbo].[t_wxmall_package_item] ADD CONSTRAINT [t_wxmall_package_item_pk] PRIMARY KEY CLUSTERED ([package_id], [his_code])
  441. WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
  442. ON [PRIMARY]
  443. GO
  444. -- ----------------------------
  445. -- Indexes structure for table t_wxmall_package_purchased
  446. -- ----------------------------
  447. CREATE NONCLUSTERED INDEX [t_wxmall_package_purchased_pat_no_index]
  448. ON [dbo].[t_wxmall_package_purchased] (
  449. [pat_no] ASC
  450. )
  451. GO
  452. CREATE NONCLUSTERED INDEX [t_wxmall_package_purchased_wx_trade_no_index]
  453. ON [dbo].[t_wxmall_package_purchased] (
  454. [wx_trade_no] ASC
  455. )
  456. GO
  457. CREATE NONCLUSTERED INDEX [t_wxmall_package_purchased_package_id_index]
  458. ON [dbo].[t_wxmall_package_purchased] (
  459. [package_id] ASC
  460. )
  461. GO
  462. -- ----------------------------
  463. -- Primary Key structure for table t_wxmall_package_purchased
  464. -- ----------------------------
  465. ALTER TABLE [dbo].[t_wxmall_package_purchased] ADD CONSTRAINT [t_wxmall_package_purchased_pk] PRIMARY KEY CLUSTERED ([id])
  466. WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
  467. ON [PRIMARY]
  468. GO
  469. -- ----------------------------
  470. -- Indexes structure for table t_wxmall_package_purchased_item
  471. -- ----------------------------
  472. CREATE NONCLUSTERED INDEX [t_wxmall_package_purchased_item_pat_no_index]
  473. ON [dbo].[t_wxmall_package_purchased_item] (
  474. [pat_no] ASC
  475. )
  476. GO
  477. CREATE NONCLUSTERED INDEX [t_wxmall_package_purchased_item_wx_trade_no_index]
  478. ON [dbo].[t_wxmall_package_purchased_item] (
  479. [wx_trade_no] ASC
  480. )
  481. GO
  482. CREATE NONCLUSTERED INDEX [t_wxmall_package_purchased_item_package_id_index]
  483. ON [dbo].[t_wxmall_package_purchased_item] (
  484. [package_id] ASC
  485. )
  486. GO
  487. -- ----------------------------
  488. -- Primary Key structure for table t_wxmall_package_purchased_item
  489. -- ----------------------------
  490. ALTER TABLE [dbo].[t_wxmall_package_purchased_item] ADD CONSTRAINT [t_wxmall_package_purchased_item_pk] PRIMARY KEY CLUSTERED ([id])
  491. WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
  492. ON [PRIMARY]
  493. GO
  494. -- ----------------------------
  495. -- Indexes structure for table t_wxmall_package_use_history
  496. -- ----------------------------
  497. CREATE NONCLUSTERED INDEX [t_wxmall_package_use_history_pat_no_times_index]
  498. ON [dbo].[t_wxmall_package_use_history] (
  499. [pat_no] ASC,
  500. [times] ASC
  501. )
  502. GO
  503. CREATE NONCLUSTERED INDEX [t_wxmall_package_use_history_wx_trade_no_index]
  504. ON [dbo].[t_wxmall_package_use_history] (
  505. [wx_trade_no] ASC
  506. )
  507. GO
  508. CREATE NONCLUSTERED INDEX [t_wxmall_package_use_history_package_id_index]
  509. ON [dbo].[t_wxmall_package_use_history] (
  510. [package_id] ASC
  511. )
  512. GO
  513. -- ----------------------------
  514. -- Primary Key structure for table t_wxmall_package_use_history
  515. -- ----------------------------
  516. ALTER TABLE [dbo].[t_wxmall_package_use_history] ADD CONSTRAINT [t_wxmall_package_use_history_pk] PRIMARY KEY CLUSTERED ([id])
  517. WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
  518. ON [PRIMARY]
  519. GO
  520. -- ----------------------------
  521. -- Indexes structure for table t_wxmall_package_used
  522. -- ----------------------------
  523. CREATE NONCLUSTERED INDEX [t_wxmall_package_used_pat_no_times_index]
  524. ON [dbo].[t_wxmall_package_used] (
  525. [pat_no] ASC,
  526. [times] ASC
  527. )
  528. GO
  529. CREATE NONCLUSTERED INDEX [t_wxmall_package_used_wx_trade_no_index]
  530. ON [dbo].[t_wxmall_package_used] (
  531. [wx_trade_no] ASC
  532. )
  533. GO
  534. CREATE NONCLUSTERED INDEX [t_wxmall_package_used_package_id_index]
  535. ON [dbo].[t_wxmall_package_used] (
  536. [package_id] ASC
  537. )
  538. GO
  539. -- ----------------------------
  540. -- Primary Key structure for table t_wxmall_package_used
  541. -- ----------------------------
  542. ALTER TABLE [dbo].[t_wxmall_package_used] ADD CONSTRAINT [t_wxmall_package_used_pk] PRIMARY KEY CLUSTERED ([id])
  543. WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
  544. ON [PRIMARY]
  545. GO
  546. /*
  547. Navicat Premium Data Transfer
  548. Source Server : 172.16.32.179
  549. Source Server Type : SQL Server
  550. Source Server Version : 10506000
  551. Source Host : 172.16.32.179:1433
  552. Source Catalog : thxyhisdb
  553. Source Schema : dbo
  554. Target Server Type : SQL Server
  555. Target Server Version : 10506000
  556. File Encoding : 65001
  557. Date: 28/04/2025 10:26:15
  558. */
  559. -- ----------------------------
  560. -- Table structure for zd_rx_medicine
  561. -- ----------------------------
  562. IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[zd_rx_medicine]') AND type IN ('U'))
  563. DROP TABLE [dbo].[zd_rx_medicine]
  564. GO
  565. CREATE TABLE [dbo].[zd_rx_medicine] (
  566. [id] varchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  567. [med_list_codg] varchar(64) COLLATE Chinese_PRC_BIN NOT NULL,
  568. [nat_drug_no] varchar(64) COLLATE Chinese_PRC_BIN NULL,
  569. [genname] nvarchar(128) COLLATE Chinese_PRC_BIN NULL,
  570. [prodname] nvarchar(128) COLLATE Chinese_PRC_BIN NULL,
  571. [reg_name] nvarchar(128) COLLATE Chinese_PRC_BIN NOT NULL,
  572. [list_type] varchar(6) COLLATE Chinese_PRC_BIN NULL,
  573. [list_type_name] nvarchar(12) COLLATE Chinese_PRC_BIN NULL,
  574. [spec_name] varchar(256) COLLATE Chinese_PRC_BIN NULL,
  575. [prdr_name] nvarchar(128) COLLATE Chinese_PRC_BIN NULL,
  576. [aprvno] nvarchar(128) COLLATE Chinese_PRC_BIN NULL,
  577. [dosform_name] nvarchar(64) COLLATE Chinese_PRC_BIN NULL,
  578. [min_pacunt] nvarchar(32) COLLATE Chinese_PRC_BIN NULL,
  579. [poolarea_no] varchar(12) COLLATE Chinese_PRC_BIN NULL,
  580. [poolarea_name] nvarchar(32) COLLATE Chinese_PRC_BIN NULL,
  581. [dualchnl_flag] tinyint NULL,
  582. [min_prepunt] nvarchar(32) COLLATE Chinese_PRC_BIN NULL,
  583. [begntime] datetime NULL,
  584. [endtime] datetime NULL,
  585. [py_code] varchar(128) COLLATE Chinese_PRC_BIN NOT NULL,
  586. [page_no] int NOT NULL
  587. )
  588. GO
  589. ALTER TABLE [dbo].[zd_rx_medicine] SET (LOCK_ESCALATION = TABLE)
  590. GO
  591. -- ----------------------------
  592. -- Primary Key structure for table zd_rx_medicine
  593. -- ----------------------------
  594. ALTER TABLE [dbo].[zd_rx_medicine] ADD CONSTRAINT [zd_rx_medicine_pk] PRIMARY KEY CLUSTERED ([id])
  595. WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
  596. ON [PRIMARY]
  597. GO
  598. /*
  599. Navicat Premium Data Transfer
  600. Source Server : 172.16.32.179
  601. Source Server Type : SQL Server
  602. Source Server Version : 10506000
  603. Source Host : 172.16.32.179:1433
  604. Source Catalog : thxyhisdb
  605. Source Schema : dbo
  606. Target Server Type : SQL Server
  607. Target Server Version : 10506000
  608. File Encoding : 65001
  609. Date: 28/04/2025 10:26:55
  610. */
  611. -- ----------------------------
  612. -- Table structure for t_rx_druginfo
  613. -- ----------------------------
  614. IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[t_rx_druginfo]') AND type IN ('U'))
  615. DROP TABLE [dbo].[t_rx_druginfo]
  616. GO
  617. CREATE TABLE [dbo].[t_rx_druginfo] (
  618. [hosp_rxno] varchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  619. [med_list_codg] varchar(128) COLLATE Chinese_PRC_BIN NOT NULL,
  620. [fixmedins_hilist_id] varchar(128) COLLATE Chinese_PRC_BIN NULL,
  621. [hosp_prep_flag] int DEFAULT ((0)) NOT NULL,
  622. [rx_item_type_code] int NOT NULL,
  623. [rx_item_type_name] nvarchar(12) COLLATE Chinese_PRC_BIN NULL,
  624. [tcmdrug_type_code] int NULL,
  625. [tcmdrug_type_name] nvarchar(12) COLLATE Chinese_PRC_BIN NULL,
  626. [tcmherb_foote] nvarchar(32) COLLATE Chinese_PRC_BIN NULL,
  627. [medn_type_code] varchar(12) COLLATE Chinese_PRC_BIN NULL,
  628. [medn_type_name] nvarchar(32) COLLATE Chinese_PRC_BIN NULL,
  629. [main_medc_flag] int NULL,
  630. [urgt_flag] int NULL,
  631. [bas_medn_flag] int NULL,
  632. [imp_drug_flag] int NULL,
  633. [otc_flag] int NULL,
  634. [drug_genname] nvarchar(128) COLLATE Chinese_PRC_BIN NOT NULL,
  635. [drug_dosform] nvarchar(30) COLLATE Chinese_PRC_BIN NOT NULL,
  636. [drug_spec] nvarchar(40) COLLATE Chinese_PRC_BIN NOT NULL,
  637. [drug_prodname] nvarchar(128) COLLATE Chinese_PRC_BIN NULL,
  638. [prdr_name] nvarchar(128) COLLATE Chinese_PRC_BIN NULL,
  639. [medc_way_codg] int NULL,
  640. [medc_way_dscr] nvarchar(32) COLLATE Chinese_PRC_BIN NULL,
  641. [medc_begntime] datetime NOT NULL,
  642. [medc_endtime] datetime NOT NULL,
  643. [medc_days] int NOT NULL,
  644. [sin_dosunt] varchar(12) COLLATE Chinese_PRC_BIN NULL,
  645. [sin_doscnt] decimal(16,4) NULL,
  646. [used_frqu_codg] int NULL,
  647. [drug_dosunt] nvarchar(12) COLLATE Chinese_PRC_BIN NOT NULL,
  648. [drug_cnt] decimal(16,4) NOT NULL,
  649. [drug_pric] decimal(16,4) NULL,
  650. [drug_sumamt] decimal(16,2) NULL,
  651. [hosp_appr_flag] int NOT NULL,
  652. [self_pay_rea] int NULL,
  653. [real_dscr] nvarchar(512) COLLATE Chinese_PRC_BIN NULL,
  654. [used_frqu_name] varchar(250) COLLATE Chinese_PRC_BIN NULL
  655. )
  656. GO
  657. ALTER TABLE [dbo].[t_rx_druginfo] SET (LOCK_ESCALATION = TABLE)
  658. GO
  659. EXEC sp_addextendedproperty
  660. 'MS_Description', N'疗机构处方编号',
  661. 'SCHEMA', N'dbo',
  662. 'TABLE', N't_rx_druginfo',
  663. 'COLUMN', N'hosp_rxno'
  664. GO
  665. EXEC sp_addextendedproperty
  666. 'MS_Description', N'医保药品编码',
  667. 'SCHEMA', N'dbo',
  668. 'TABLE', N't_rx_druginfo',
  669. 'COLUMN', N'med_list_codg'
  670. GO
  671. EXEC sp_addextendedproperty
  672. 'MS_Description', N'院内药品编码',
  673. 'SCHEMA', N'dbo',
  674. 'TABLE', N't_rx_druginfo',
  675. 'COLUMN', N'fixmedins_hilist_id'
  676. GO
  677. EXEC sp_addextendedproperty
  678. 'MS_Description', N'医疗机构制剂标志(0-否、1-是,默 认否)',
  679. 'SCHEMA', N'dbo',
  680. 'TABLE', N't_rx_druginfo',
  681. 'COLUMN', N'hosp_prep_flag'
  682. GO
  683. EXEC sp_addextendedproperty
  684. 'MS_Description', N'处方项目分类代码(from zd_rx_all where label=''rx_item_type'')',
  685. 'SCHEMA', N'dbo',
  686. 'TABLE', N't_rx_druginfo',
  687. 'COLUMN', N'rx_item_type_code'
  688. GO
  689. EXEC sp_addextendedproperty
  690. 'MS_Description', N'处方项目分类名称',
  691. 'SCHEMA', N'dbo',
  692. 'TABLE', N't_rx_druginfo',
  693. 'COLUMN', N'rx_item_type_name'
  694. GO
  695. EXEC sp_addextendedproperty
  696. 'MS_Description', N'中药类别代码(中药处方必填,中药饮片固定传3)',
  697. 'SCHEMA', N'dbo',
  698. 'TABLE', N't_rx_druginfo',
  699. 'COLUMN', N'tcmdrug_type_code'
  700. GO
  701. EXEC sp_addextendedproperty
  702. 'MS_Description', N'中药类别名称',
  703. 'SCHEMA', N'dbo',
  704. 'TABLE', N't_rx_druginfo',
  705. 'COLUMN', N'tcmdrug_type_name'
  706. GO
  707. EXEC sp_addextendedproperty
  708. 'MS_Description', N'草药脚注',
  709. 'SCHEMA', N'dbo',
  710. 'TABLE', N't_rx_druginfo',
  711. 'COLUMN', N'tcmherb_foote'
  712. GO
  713. EXEC sp_addextendedproperty
  714. 'MS_Description', N'药物类型代码(label = rx_medn_type)',
  715. 'SCHEMA', N'dbo',
  716. 'TABLE', N't_rx_druginfo',
  717. 'COLUMN', N'medn_type_code'
  718. GO
  719. EXEC sp_addextendedproperty
  720. 'MS_Description', N'药物类型名称',
  721. 'SCHEMA', N'dbo',
  722. 'TABLE', N't_rx_druginfo',
  723. 'COLUMN', N'medn_type_name'
  724. GO
  725. EXEC sp_addextendedproperty
  726. 'MS_Description', N'主要用药标志(0-否、1-是)',
  727. 'SCHEMA', N'dbo',
  728. 'TABLE', N't_rx_druginfo',
  729. 'COLUMN', N'main_medc_flag'
  730. GO
  731. EXEC sp_addextendedproperty
  732. 'MS_Description', N'加急标志(0-否、1-是)',
  733. 'SCHEMA', N'dbo',
  734. 'TABLE', N't_rx_druginfo',
  735. 'COLUMN', N'urgt_flag'
  736. GO
  737. EXEC sp_addextendedproperty
  738. 'MS_Description', N'基本药物标志(0-否、1-是)',
  739. 'SCHEMA', N'dbo',
  740. 'TABLE', N't_rx_druginfo',
  741. 'COLUMN', N'bas_medn_flag'
  742. GO
  743. EXEC sp_addextendedproperty
  744. 'MS_Description', N'是否进口药品(0-否、1-是)',
  745. 'SCHEMA', N'dbo',
  746. 'TABLE', N't_rx_druginfo',
  747. 'COLUMN', N'imp_drug_flag'
  748. GO
  749. EXEC sp_addextendedproperty
  750. 'MS_Description', N'是否OTC药品(0-否、1-是)',
  751. 'SCHEMA', N'dbo',
  752. 'TABLE', N't_rx_druginfo',
  753. 'COLUMN', N'otc_flag'
  754. GO
  755. EXEC sp_addextendedproperty
  756. 'MS_Description', N'药品通用名',
  757. 'SCHEMA', N'dbo',
  758. 'TABLE', N't_rx_druginfo',
  759. 'COLUMN', N'drug_genname'
  760. GO
  761. EXEC sp_addextendedproperty
  762. 'MS_Description', N'药品剂型',
  763. 'SCHEMA', N'dbo',
  764. 'TABLE', N't_rx_druginfo',
  765. 'COLUMN', N'drug_dosform'
  766. GO
  767. EXEC sp_addextendedproperty
  768. 'MS_Description', N'药品规格',
  769. 'SCHEMA', N'dbo',
  770. 'TABLE', N't_rx_druginfo',
  771. 'COLUMN', N'drug_spec'
  772. GO
  773. EXEC sp_addextendedproperty
  774. 'MS_Description', N'药品商品名(非必填,可按通用名开方)',
  775. 'SCHEMA', N'dbo',
  776. 'TABLE', N't_rx_druginfo',
  777. 'COLUMN', N'drug_prodname'
  778. GO
  779. EXEC sp_addextendedproperty
  780. 'MS_Description', N'生产厂家',
  781. 'SCHEMA', N'dbo',
  782. 'TABLE', N't_rx_druginfo',
  783. 'COLUMN', N'prdr_name'
  784. GO
  785. EXEC sp_addextendedproperty
  786. 'MS_Description', N'用药途径代码(rx_item_type_code为西药、中成药时必填)(from zd_rx_all where label=''rx_used_way'')',
  787. 'SCHEMA', N'dbo',
  788. 'TABLE', N't_rx_druginfo',
  789. 'COLUMN', N'medc_way_codg'
  790. GO
  791. EXEC sp_addextendedproperty
  792. 'MS_Description', N'用药途径名称',
  793. 'SCHEMA', N'dbo',
  794. 'TABLE', N't_rx_druginfo',
  795. 'COLUMN', N'medc_way_dscr'
  796. GO
  797. EXEC sp_addextendedproperty
  798. 'MS_Description', N'用药开始时间',
  799. 'SCHEMA', N'dbo',
  800. 'TABLE', N't_rx_druginfo',
  801. 'COLUMN', N'medc_begntime'
  802. GO
  803. EXEC sp_addextendedproperty
  804. 'MS_Description', N'用药结束时间',
  805. 'SCHEMA', N'dbo',
  806. 'TABLE', N't_rx_druginfo',
  807. 'COLUMN', N'medc_endtime'
  808. GO
  809. EXEC sp_addextendedproperty
  810. 'MS_Description', N'用药天数',
  811. 'SCHEMA', N'dbo',
  812. 'TABLE', N't_rx_druginfo',
  813. 'COLUMN', N'medc_days'
  814. GO
  815. EXEC sp_addextendedproperty
  816. 'MS_Description', N'单次剂量单位(rx_item_type_code为西药、中成药时必填)',
  817. 'SCHEMA', N'dbo',
  818. 'TABLE', N't_rx_druginfo',
  819. 'COLUMN', N'sin_dosunt'
  820. GO
  821. EXEC sp_addextendedproperty
  822. 'MS_Description', N'单次用量(rx_item_type_code为西药、中成药时必填)',
  823. 'SCHEMA', N'dbo',
  824. 'TABLE', N't_rx_druginfo',
  825. 'COLUMN', N'sin_doscnt'
  826. GO
  827. EXEC sp_addextendedproperty
  828. 'MS_Description', N'使用频次编码(rx_item_type_code为西药、中成药时必填)(from zd_rx_all where label=''rx_used_frqu'')',
  829. 'SCHEMA', N'dbo',
  830. 'TABLE', N't_rx_druginfo',
  831. 'COLUMN', N'used_frqu_codg'
  832. GO
  833. EXEC sp_addextendedproperty
  834. 'MS_Description', N'药品总用药量单位(即发药计价单位,如”片“,”盒“)',
  835. 'SCHEMA', N'dbo',
  836. 'TABLE', N't_rx_druginfo',
  837. 'COLUMN', N'drug_dosunt'
  838. GO
  839. EXEC sp_addextendedproperty
  840. 'MS_Description', N'药品发药总量(根据单次剂量及单位、频次等和drugDosunt按院内“药品单位转换系数“换算)',
  841. 'SCHEMA', N'dbo',
  842. 'TABLE', N't_rx_druginfo',
  843. 'COLUMN', N'drug_cnt'
  844. GO
  845. EXEC sp_addextendedproperty
  846. 'MS_Description', N'药品单价',
  847. 'SCHEMA', N'dbo',
  848. 'TABLE', N't_rx_druginfo',
  849. 'COLUMN', N'drug_pric'
  850. GO
  851. EXEC sp_addextendedproperty
  852. 'MS_Description', N'药品总金额',
  853. 'SCHEMA', N'dbo',
  854. 'TABLE', N't_rx_druginfo',
  855. 'COLUMN', N'drug_sumamt'
  856. GO
  857. EXEC sp_addextendedproperty
  858. 'MS_Description', N'医院审批标志(1-报销,2-自费)',
  859. 'SCHEMA', N'dbo',
  860. 'TABLE', N't_rx_druginfo',
  861. 'COLUMN', N'hosp_appr_flag'
  862. GO
  863. EXEC sp_addextendedproperty
  864. 'MS_Description', N'自费原因类型(hospApprFlag=2时必填)(from zd_rx_all where label=''rx_self_pay_rea'')',
  865. 'SCHEMA', N'dbo',
  866. 'TABLE', N't_rx_druginfo',
  867. 'COLUMN', N'self_pay_rea'
  868. GO
  869. EXEC sp_addextendedproperty
  870. 'MS_Description', N'自费原因描述(自费原因类型为6时必填)',
  871. 'SCHEMA', N'dbo',
  872. 'TABLE', N't_rx_druginfo',
  873. 'COLUMN', N'real_dscr'
  874. GO
  875. EXEC sp_addextendedproperty
  876. 'MS_Description', N'使用频次名称 (rx_item_type_code为西药、中成药时必填)',
  877. 'SCHEMA', N'dbo',
  878. 'TABLE', N't_rx_druginfo',
  879. 'COLUMN', N'used_frqu_name'
  880. GO
  881. EXEC sp_addextendedproperty
  882. 'MS_Description', N'电子处方药品',
  883. 'SCHEMA', N'dbo',
  884. 'TABLE', N't_rx_druginfo'
  885. GO
  886. -- ----------------------------
  887. -- Primary Key structure for table t_rx_druginfo
  888. -- ----------------------------
  889. ALTER TABLE [dbo].[t_rx_druginfo] ADD CONSTRAINT [t_rx_druginfo_pk] PRIMARY KEY CLUSTERED ([hosp_rxno], [med_list_codg])
  890. WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
  891. ON [PRIMARY]
  892. GO
  893. /*
  894. Navicat Premium Data Transfer
  895. Source Server : 172.16.32.179
  896. Source Server Type : SQL Server
  897. Source Server Version : 10506000
  898. Source Host : 172.16.32.179:1433
  899. Source Catalog : thxyhisdb
  900. Source Schema : dbo
  901. Target Server Type : SQL Server
  902. Target Server Version : 10506000
  903. File Encoding : 65001
  904. Date: 28/04/2025 10:27:10
  905. */
  906. -- ----------------------------
  907. -- Table structure for t_rx_mdtrtinfo
  908. -- ----------------------------
  909. IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[t_rx_mdtrtinfo]') AND type IN ('U'))
  910. DROP TABLE [dbo].[t_rx_mdtrtinfo]
  911. GO
  912. CREATE TABLE [dbo].[t_rx_mdtrtinfo] (
  913. [hosp_rxno] varchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  914. [ipt_otp_no] varchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  915. [otp_ipt_flag] int DEFAULT ((1)) NOT NULL,
  916. [patn_name] nvarchar(32) COLLATE Chinese_PRC_BIN NULL,
  917. [psn_cert_type] varchar(6) COLLATE Chinese_PRC_BIN NULL,
  918. [certno] varchar(32) COLLATE Chinese_PRC_BIN NULL,
  919. [patn_age] decimal(4,1) NULL,
  920. [patn_hgt] decimal(6,2) NULL,
  921. [patn_wt] decimal(6,2) NULL,
  922. [gend] varchar(6) COLLATE Chinese_PRC_BIN NULL,
  923. [birctrl_type] varchar(6) COLLATE Chinese_PRC_BIN NULL,
  924. [birctrl_matn_date] datetime NULL,
  925. [matn_type] varchar(6) COLLATE Chinese_PRC_BIN NULL,
  926. [geso_val] int NULL,
  927. [nwb_flag] varchar(6) COLLATE Chinese_PRC_BIN NULL,
  928. [nwb_age] varchar(20) COLLATE Chinese_PRC_BIN NULL,
  929. [suck_prd_flag] varchar(6) COLLATE Chinese_PRC_BIN NULL,
  930. [algs_his] nvarchar(1000) COLLATE Chinese_PRC_BIN NULL,
  931. [prsc_dept_code] varchar(30) COLLATE Chinese_PRC_BIN NOT NULL,
  932. [prsc_dept_name] nvarchar(50) COLLATE Chinese_PRC_BIN NOT NULL,
  933. [dr_code] varchar(20) COLLATE Chinese_PRC_BIN NOT NULL,
  934. [prsc_dr_name] nvarchar(50) COLLATE Chinese_PRC_BIN NULL,
  935. [prsc_dr_cert_type] varchar(6) COLLATE Chinese_PRC_BIN NULL,
  936. [prsc_dr_certno] varchar(50) COLLATE Chinese_PRC_BIN NULL,
  937. [dr_profttl_codg] varchar(20) COLLATE Chinese_PRC_BIN NOT NULL,
  938. [dr_profttl_name] nvarchar(20) COLLATE Chinese_PRC_BIN NOT NULL,
  939. [dr_dept_code] varchar(30) COLLATE Chinese_PRC_BIN NOT NULL,
  940. [dr_dept_name] nvarchar(30) COLLATE Chinese_PRC_BIN NOT NULL,
  941. [caty] varchar(10) COLLATE Chinese_PRC_BIN NOT NULL,
  942. [mdtrt_time] datetime NOT NULL,
  943. [dise_codg] varchar(30) COLLATE Chinese_PRC_BIN NULL,
  944. [dise_name] nvarchar(60) COLLATE Chinese_PRC_BIN NULL,
  945. [sp_dise_flag] varchar(6) COLLATE Chinese_PRC_BIN DEFAULT ('0') NULL,
  946. [maindiag_code] varchar(30) COLLATE Chinese_PRC_BIN NOT NULL,
  947. [maindiag_name] nvarchar(60) COLLATE Chinese_PRC_BIN NOT NULL,
  948. [dise_cond_dscr] nvarchar(2000) COLLATE Chinese_PRC_BIN NULL,
  949. [hi_feesetl_type] varchar(6) COLLATE Chinese_PRC_BIN NULL,
  950. [hi_feesetl_name] nvarchar(20) COLLATE Chinese_PRC_BIN NULL,
  951. [rgst_fee] decimal(16,2) NULL,
  952. [medfee_sumamt] decimal(16,2) NULL,
  953. [fstdiag_flag] varchar(3) COLLATE Chinese_PRC_BIN NULL
  954. )
  955. GO
  956. ALTER TABLE [dbo].[t_rx_mdtrtinfo] SET (LOCK_ESCALATION = TABLE)
  957. GO
  958. EXEC sp_addextendedproperty
  959. 'MS_Description', N'医疗机构处方编号',
  960. 'SCHEMA', N'dbo',
  961. 'TABLE', N't_rx_mdtrtinfo',
  962. 'COLUMN', N'hosp_rxno'
  963. GO
  964. EXEC sp_addextendedproperty
  965. 'MS_Description', N'门诊/住院号 ',
  966. 'SCHEMA', N'dbo',
  967. 'TABLE', N't_rx_mdtrtinfo',
  968. 'COLUMN', N'ipt_otp_no'
  969. GO
  970. EXEC sp_addextendedproperty
  971. 'MS_Description', N'门诊住院标识(1-门诊、2-住院,默认为1)',
  972. 'SCHEMA', N'dbo',
  973. 'TABLE', N't_rx_mdtrtinfo',
  974. 'COLUMN', N'otp_ipt_flag'
  975. GO
  976. EXEC sp_addextendedproperty
  977. 'MS_Description', N'患者姓名',
  978. 'SCHEMA', N'dbo',
  979. 'TABLE', N't_rx_mdtrtinfo',
  980. 'COLUMN', N'patn_name'
  981. GO
  982. EXEC sp_addextendedproperty
  983. 'MS_Description', N'人员证件类型(from zd_rx_all where label=''rx_psn_cert_type'')',
  984. 'SCHEMA', N'dbo',
  985. 'TABLE', N't_rx_mdtrtinfo',
  986. 'COLUMN', N'psn_cert_type'
  987. GO
  988. EXEC sp_addextendedproperty
  989. 'MS_Description', N'证件号码',
  990. 'SCHEMA', N'dbo',
  991. 'TABLE', N't_rx_mdtrtinfo',
  992. 'COLUMN', N'certno'
  993. GO
  994. EXEC sp_addextendedproperty
  995. 'MS_Description', N'年龄',
  996. 'SCHEMA', N'dbo',
  997. 'TABLE', N't_rx_mdtrtinfo',
  998. 'COLUMN', N'patn_age'
  999. GO
  1000. EXEC sp_addextendedproperty
  1001. 'MS_Description', N'患者身高',
  1002. 'SCHEMA', N'dbo',
  1003. 'TABLE', N't_rx_mdtrtinfo',
  1004. 'COLUMN', N'patn_hgt'
  1005. GO
  1006. EXEC sp_addextendedproperty
  1007. 'MS_Description', N'患者体重',
  1008. 'SCHEMA', N'dbo',
  1009. 'TABLE', N't_rx_mdtrtinfo',
  1010. 'COLUMN', N'patn_wt'
  1011. GO
  1012. EXEC sp_addextendedproperty
  1013. 'MS_Description', N'性别',
  1014. 'SCHEMA', N'dbo',
  1015. 'TABLE', N't_rx_mdtrtinfo',
  1016. 'COLUMN', N'gend'
  1017. GO
  1018. EXEC sp_addextendedproperty
  1019. 'MS_Description', N'计划生育手术类别',
  1020. 'SCHEMA', N'dbo',
  1021. 'TABLE', N't_rx_mdtrtinfo',
  1022. 'COLUMN', N'birctrl_type'
  1023. GO
  1024. EXEC sp_addextendedproperty
  1025. 'MS_Description', N'计划生育手术或生育日期',
  1026. 'SCHEMA', N'dbo',
  1027. 'TABLE', N't_rx_mdtrtinfo',
  1028. 'COLUMN', N'birctrl_matn_date'
  1029. GO
  1030. EXEC sp_addextendedproperty
  1031. 'MS_Description', N'生育类别',
  1032. 'SCHEMA', N'dbo',
  1033. 'TABLE', N't_rx_mdtrtinfo',
  1034. 'COLUMN', N'matn_type'
  1035. GO
  1036. EXEC sp_addextendedproperty
  1037. 'MS_Description', N'妊娠(孕周',
  1038. 'SCHEMA', N'dbo',
  1039. 'TABLE', N't_rx_mdtrtinfo',
  1040. 'COLUMN', N'geso_val'
  1041. GO
  1042. EXEC sp_addextendedproperty
  1043. 'MS_Description', N'新生儿标志(0-否、1-是)',
  1044. 'SCHEMA', N'dbo',
  1045. 'TABLE', N't_rx_mdtrtinfo',
  1046. 'COLUMN', N'nwb_flag'
  1047. GO
  1048. EXEC sp_addextendedproperty
  1049. 'MS_Description', N'新生儿日、月龄',
  1050. 'SCHEMA', N'dbo',
  1051. 'TABLE', N't_rx_mdtrtinfo',
  1052. 'COLUMN', N'nwb_age'
  1053. GO
  1054. EXEC sp_addextendedproperty
  1055. 'MS_Description', N'哺乳期标志(0-否、1-是)',
  1056. 'SCHEMA', N'dbo',
  1057. 'TABLE', N't_rx_mdtrtinfo',
  1058. 'COLUMN', N'suck_prd_flag'
  1059. GO
  1060. EXEC sp_addextendedproperty
  1061. 'MS_Description', N'过敏史',
  1062. 'SCHEMA', N'dbo',
  1063. 'TABLE', N't_rx_mdtrtinfo',
  1064. 'COLUMN', N'algs_his'
  1065. GO
  1066. EXEC sp_addextendedproperty
  1067. 'MS_Description', N'开方科室编码',
  1068. 'SCHEMA', N'dbo',
  1069. 'TABLE', N't_rx_mdtrtinfo',
  1070. 'COLUMN', N'prsc_dept_code'
  1071. GO
  1072. EXEC sp_addextendedproperty
  1073. 'MS_Description', N'开方科室名称',
  1074. 'SCHEMA', N'dbo',
  1075. 'TABLE', N't_rx_mdtrtinfo',
  1076. 'COLUMN', N'prsc_dept_name'
  1077. GO
  1078. EXEC sp_addextendedproperty
  1079. 'MS_Description', N'开方医保医师代 码',
  1080. 'SCHEMA', N'dbo',
  1081. 'TABLE', N't_rx_mdtrtinfo',
  1082. 'COLUMN', N'dr_code'
  1083. GO
  1084. EXEC sp_addextendedproperty
  1085. 'MS_Description', N'开方医师姓名',
  1086. 'SCHEMA', N'dbo',
  1087. 'TABLE', N't_rx_mdtrtinfo',
  1088. 'COLUMN', N'prsc_dr_name'
  1089. GO
  1090. EXEC sp_addextendedproperty
  1091. 'MS_Description', N'开方医师证件类型(from zd_rx_all where label=''rx_psn_cert_type'')',
  1092. 'SCHEMA', N'dbo',
  1093. 'TABLE', N't_rx_mdtrtinfo',
  1094. 'COLUMN', N'prsc_dr_cert_type'
  1095. GO
  1096. EXEC sp_addextendedproperty
  1097. 'MS_Description', N'开方医师证件号码',
  1098. 'SCHEMA', N'dbo',
  1099. 'TABLE', N't_rx_mdtrtinfo',
  1100. 'COLUMN', N'prsc_dr_certno'
  1101. GO
  1102. EXEC sp_addextendedproperty
  1103. 'MS_Description', N'医生职称编码(from zd_rx_all where label=''rx_dr_profttl'')',
  1104. 'SCHEMA', N'dbo',
  1105. 'TABLE', N't_rx_mdtrtinfo',
  1106. 'COLUMN', N'dr_profttl_codg'
  1107. GO
  1108. EXEC sp_addextendedproperty
  1109. 'MS_Description', N'医生职称名称',
  1110. 'SCHEMA', N'dbo',
  1111. 'TABLE', N't_rx_mdtrtinfo',
  1112. 'COLUMN', N'dr_profttl_name'
  1113. GO
  1114. EXEC sp_addextendedproperty
  1115. 'MS_Description', N'医生科室编码',
  1116. 'SCHEMA', N'dbo',
  1117. 'TABLE', N't_rx_mdtrtinfo',
  1118. 'COLUMN', N'dr_dept_code'
  1119. GO
  1120. EXEC sp_addextendedproperty
  1121. 'MS_Description', N'医生科室名称',
  1122. 'SCHEMA', N'dbo',
  1123. 'TABLE', N't_rx_mdtrtinfo',
  1124. 'COLUMN', N'dr_dept_name'
  1125. GO
  1126. EXEC sp_addextendedproperty
  1127. 'MS_Description', N'科别',
  1128. 'SCHEMA', N'dbo',
  1129. 'TABLE', N't_rx_mdtrtinfo',
  1130. 'COLUMN', N'caty'
  1131. GO
  1132. EXEC sp_addextendedproperty
  1133. 'MS_Description', N'就诊时间',
  1134. 'SCHEMA', N'dbo',
  1135. 'TABLE', N't_rx_mdtrtinfo',
  1136. 'COLUMN', N'mdtrt_time'
  1137. GO
  1138. EXEC sp_addextendedproperty
  1139. 'MS_Description', N'病种编码(medType为门诊慢特病时必传)',
  1140. 'SCHEMA', N'dbo',
  1141. 'TABLE', N't_rx_mdtrtinfo',
  1142. 'COLUMN', N'dise_codg'
  1143. GO
  1144. EXEC sp_addextendedproperty
  1145. 'MS_Description', N'病种名称',
  1146. 'SCHEMA', N'dbo',
  1147. 'TABLE', N't_rx_mdtrtinfo',
  1148. 'COLUMN', N'dise_name'
  1149. GO
  1150. EXEC sp_addextendedproperty
  1151. 'MS_Description', N'特殊病种标志(0-否、1-是)',
  1152. 'SCHEMA', N'dbo',
  1153. 'TABLE', N't_rx_mdtrtinfo',
  1154. 'COLUMN', N'sp_dise_flag'
  1155. GO
  1156. EXEC sp_addextendedproperty
  1157. 'MS_Description', N'主诊断代码',
  1158. 'SCHEMA', N'dbo',
  1159. 'TABLE', N't_rx_mdtrtinfo',
  1160. 'COLUMN', N'maindiag_code'
  1161. GO
  1162. EXEC sp_addextendedproperty
  1163. 'MS_Description', N'主诊断名称',
  1164. 'SCHEMA', N'dbo',
  1165. 'TABLE', N't_rx_mdtrtinfo',
  1166. 'COLUMN', N'maindiag_name'
  1167. GO
  1168. EXEC sp_addextendedproperty
  1169. 'MS_Description', N'疾病病情描述',
  1170. 'SCHEMA', N'dbo',
  1171. 'TABLE', N't_rx_mdtrtinfo',
  1172. 'COLUMN', N'dise_cond_dscr'
  1173. GO
  1174. EXEC sp_addextendedproperty
  1175. 'MS_Description', N'医保费用结算类型(from zd_rx_all where label=''rx_setl_type'')',
  1176. 'SCHEMA', N'dbo',
  1177. 'TABLE', N't_rx_mdtrtinfo',
  1178. 'COLUMN', N'hi_feesetl_type'
  1179. GO
  1180. EXEC sp_addextendedproperty
  1181. 'MS_Description', N'医保费用类别名称',
  1182. 'SCHEMA', N'dbo',
  1183. 'TABLE', N't_rx_mdtrtinfo',
  1184. 'COLUMN', N'hi_feesetl_name'
  1185. GO
  1186. EXEC sp_addextendedproperty
  1187. 'MS_Description', N'挂号费',
  1188. 'SCHEMA', N'dbo',
  1189. 'TABLE', N't_rx_mdtrtinfo',
  1190. 'COLUMN', N'rgst_fee'
  1191. GO
  1192. EXEC sp_addextendedproperty
  1193. 'MS_Description', N'医疗费总额',
  1194. 'SCHEMA', N'dbo',
  1195. 'TABLE', N't_rx_mdtrtinfo',
  1196. 'COLUMN', N'medfee_sumamt'
  1197. GO
  1198. EXEC sp_addextendedproperty
  1199. 'MS_Description', N'是否初诊(0-否、1-是)',
  1200. 'SCHEMA', N'dbo',
  1201. 'TABLE', N't_rx_mdtrtinfo',
  1202. 'COLUMN', N'fstdiag_flag'
  1203. GO
  1204. EXEC sp_addextendedproperty
  1205. 'MS_Description', N'电子处方就诊信息',
  1206. 'SCHEMA', N'dbo',
  1207. 'TABLE', N't_rx_mdtrtinfo'
  1208. GO
  1209. -- ----------------------------
  1210. -- Primary Key structure for table t_rx_mdtrtinfo
  1211. -- ----------------------------
  1212. ALTER TABLE [dbo].[t_rx_mdtrtinfo] ADD CONSTRAINT [t_rx_mdtrtinfo_pk] PRIMARY KEY CLUSTERED ([hosp_rxno])
  1213. WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
  1214. ON [PRIMARY]
  1215. GO
  1216. /*
  1217. Navicat Premium Data Transfer
  1218. Source Server : 172.16.32.179
  1219. Source Server Type : SQL Server
  1220. Source Server Version : 10506000
  1221. Source Host : 172.16.32.179:1433
  1222. Source Catalog : thxyhisdb
  1223. Source Schema : dbo
  1224. Target Server Type : SQL Server
  1225. Target Server Version : 10506000
  1226. File Encoding : 65001
  1227. Date: 28/04/2025 10:27:22
  1228. */
  1229. -- ----------------------------
  1230. -- Table structure for t_rx_receiptinfo
  1231. -- ----------------------------
  1232. IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[t_rx_receiptinfo]') AND type IN ('U'))
  1233. DROP TABLE [dbo].[t_rx_receiptinfo]
  1234. GO
  1235. CREATE TABLE [dbo].[t_rx_receiptinfo] (
  1236. [hosp_rxno] varchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  1237. [pat_no] varchar(12) COLLATE Chinese_PRC_BIN NOT NULL,
  1238. [times] int NOT NULL,
  1239. [init_rxno] varchar(32) COLLATE Chinese_PRC_BIN NULL,
  1240. [rx_type_code] int NOT NULL,
  1241. [prsc_time] datetime NULL,
  1242. [rx_drug_cnt] int NULL,
  1243. [rx_used_way_codg] int NULL,
  1244. [rx_used_way_name] nvarchar(32) COLLATE Chinese_PRC_BIN NULL,
  1245. [rx_frqu_codg] int NULL,
  1246. [rx_frqu_name] nvarchar(32) COLLATE Chinese_PRC_BIN NULL,
  1247. [rx_dosunt] varchar(16) COLLATE Chinese_PRC_BIN NULL,
  1248. [rx_doscnt] decimal(16,2) NULL,
  1249. [rx_drord_dscr] nvarchar(128) COLLATE Chinese_PRC_BIN NULL,
  1250. [vali_days] int NULL,
  1251. [vali_end_time] datetime NULL,
  1252. [rept_flag] int NULL,
  1253. [max_rept_cnt] int NULL,
  1254. [reptd_cnt] int NULL,
  1255. [min_inrv_days] int NULL,
  1256. [rx_cotn_flag] tinyint DEFAULT ((0)) NOT NULL,
  1257. [long_rx_flag] tinyint DEFAULT ((0)) NOT NULL,
  1258. [zy_no] varchar(250) COLLATE Chinese_PRC_BIN NULL,
  1259. [zy_times] int NULL
  1260. )
  1261. GO
  1262. ALTER TABLE [dbo].[t_rx_receiptinfo] SET (LOCK_ESCALATION = TABLE)
  1263. GO
  1264. EXEC sp_addextendedproperty
  1265. 'MS_Description', N'处方编号',
  1266. 'SCHEMA', N'dbo',
  1267. 'TABLE', N't_rx_receiptinfo',
  1268. 'COLUMN', N'hosp_rxno'
  1269. GO
  1270. EXEC sp_addextendedproperty
  1271. 'MS_Description', N'门诊号/住院号',
  1272. 'SCHEMA', N'dbo',
  1273. 'TABLE', N't_rx_receiptinfo',
  1274. 'COLUMN', N'pat_no'
  1275. GO
  1276. EXEC sp_addextendedproperty
  1277. 'MS_Description', N'就诊次数',
  1278. 'SCHEMA', N'dbo',
  1279. 'TABLE', N't_rx_receiptinfo',
  1280. 'COLUMN', N'times'
  1281. GO
  1282. EXEC sp_addextendedproperty
  1283. 'MS_Description', N'续方的原处方编号',
  1284. 'SCHEMA', N'dbo',
  1285. 'TABLE', N't_rx_receiptinfo',
  1286. 'COLUMN', N'init_rxno'
  1287. GO
  1288. EXEC sp_addextendedproperty
  1289. 'MS_Description', N'处方类别代码(from zd_rx_all where label=''rx_type'')',
  1290. 'SCHEMA', N'dbo',
  1291. 'TABLE', N't_rx_receiptinfo',
  1292. 'COLUMN', N'rx_type_code'
  1293. GO
  1294. EXEC sp_addextendedproperty
  1295. 'MS_Description', N'开方时间',
  1296. 'SCHEMA', N'dbo',
  1297. 'TABLE', N't_rx_receiptinfo',
  1298. 'COLUMN', N'prsc_time'
  1299. GO
  1300. EXEC sp_addextendedproperty
  1301. 'MS_Description', N'非中药时为处方药品类目数量,中药时为药品总剂数',
  1302. 'SCHEMA', N'dbo',
  1303. 'TABLE', N't_rx_receiptinfo',
  1304. 'COLUMN', N'rx_drug_cnt'
  1305. GO
  1306. EXEC sp_addextendedproperty
  1307. 'MS_Description', N'中药汤剂处方整剂用法编号(from zd_rx_all where label=''rx_used_way'')',
  1308. 'SCHEMA', N'dbo',
  1309. 'TABLE', N't_rx_receiptinfo',
  1310. 'COLUMN', N'rx_used_way_codg'
  1311. GO
  1312. EXEC sp_addextendedproperty
  1313. 'MS_Description', N'中药汤剂处方整剂用法名称',
  1314. 'SCHEMA', N'dbo',
  1315. 'TABLE', N't_rx_receiptinfo',
  1316. 'COLUMN', N'rx_used_way_name'
  1317. GO
  1318. EXEC sp_addextendedproperty
  1319. 'MS_Description', N'中药汤剂处方整剂频次编号(from zd_rx_all where label=''rx_used_frqu'')',
  1320. 'SCHEMA', N'dbo',
  1321. 'TABLE', N't_rx_receiptinfo',
  1322. 'COLUMN', N'rx_frqu_codg'
  1323. GO
  1324. EXEC sp_addextendedproperty
  1325. 'MS_Description', N'中药汤剂处方整剂频次名称',
  1326. 'SCHEMA', N'dbo',
  1327. 'TABLE', N't_rx_receiptinfo',
  1328. 'COLUMN', N'rx_frqu_name'
  1329. GO
  1330. EXEC sp_addextendedproperty
  1331. 'MS_Description', N'中药汤剂处方整剂剂量单位',
  1332. 'SCHEMA', N'dbo',
  1333. 'TABLE', N't_rx_receiptinfo',
  1334. 'COLUMN', N'rx_dosunt'
  1335. GO
  1336. EXEC sp_addextendedproperty
  1337. 'MS_Description', N'中药汤剂处方整剂单次剂量数',
  1338. 'SCHEMA', N'dbo',
  1339. 'TABLE', N't_rx_receiptinfo',
  1340. 'COLUMN', N'rx_doscnt'
  1341. GO
  1342. EXEC sp_addextendedproperty
  1343. 'MS_Description', N'中药汤剂处方整剂医嘱说明',
  1344. 'SCHEMA', N'dbo',
  1345. 'TABLE', N't_rx_receiptinfo',
  1346. 'COLUMN', N'rx_drord_dscr'
  1347. GO
  1348. EXEC sp_addextendedproperty
  1349. 'MS_Description', N'处方有效天数',
  1350. 'SCHEMA', N'dbo',
  1351. 'TABLE', N't_rx_receiptinfo',
  1352. 'COLUMN', N'vali_days'
  1353. GO
  1354. EXEC sp_addextendedproperty
  1355. 'MS_Description', N'有效截止时间(开方时间+处方有效天数)',
  1356. 'SCHEMA', N'dbo',
  1357. 'TABLE', N't_rx_receiptinfo',
  1358. 'COLUMN', N'vali_end_time'
  1359. GO
  1360. EXEC sp_addextendedproperty
  1361. 'MS_Description', N'复用(多次)使用标志(0-否、1-是)',
  1362. 'SCHEMA', N'dbo',
  1363. 'TABLE', N't_rx_receiptinfo',
  1364. 'COLUMN', N'rept_flag'
  1365. GO
  1366. EXEC sp_addextendedproperty
  1367. 'MS_Description', N'最大使用次数',
  1368. 'SCHEMA', N'dbo',
  1369. 'TABLE', N't_rx_receiptinfo',
  1370. 'COLUMN', N'max_rept_cnt'
  1371. GO
  1372. EXEC sp_addextendedproperty
  1373. 'MS_Description', N'已使用次数',
  1374. 'SCHEMA', N'dbo',
  1375. 'TABLE', N't_rx_receiptinfo',
  1376. 'COLUMN', N'reptd_cnt'
  1377. GO
  1378. EXEC sp_addextendedproperty
  1379. 'MS_Description', N'使用最小间隔(天数)',
  1380. 'SCHEMA', N'dbo',
  1381. 'TABLE', N't_rx_receiptinfo',
  1382. 'COLUMN', N'min_inrv_days'
  1383. GO
  1384. EXEC sp_addextendedproperty
  1385. 'MS_Description', N'续方标志(0-否、1-是,默认为否)',
  1386. 'SCHEMA', N'dbo',
  1387. 'TABLE', N't_rx_receiptinfo',
  1388. 'COLUMN', N'rx_cotn_flag'
  1389. GO
  1390. EXEC sp_addextendedproperty
  1391. 'MS_Description', N'长期处方标志(0-否、1-是,默认为否)',
  1392. 'SCHEMA', N'dbo',
  1393. 'TABLE', N't_rx_receiptinfo',
  1394. 'COLUMN', N'long_rx_flag'
  1395. GO
  1396. EXEC sp_addextendedproperty
  1397. 'MS_Description', N'住院号',
  1398. 'SCHEMA', N'dbo',
  1399. 'TABLE', N't_rx_receiptinfo',
  1400. 'COLUMN', N'zy_no'
  1401. GO
  1402. EXEC sp_addextendedproperty
  1403. 'MS_Description', N'住院次数',
  1404. 'SCHEMA', N'dbo',
  1405. 'TABLE', N't_rx_receiptinfo',
  1406. 'COLUMN', N'zy_times'
  1407. GO
  1408. -- ----------------------------
  1409. -- Indexes structure for table t_rx_receiptinfo
  1410. -- ----------------------------
  1411. CREATE NONCLUSTERED INDEX [t_rx_receiptinfo_pat_no_times_index]
  1412. ON [dbo].[t_rx_receiptinfo] (
  1413. [pat_no] ASC,
  1414. [times] ASC
  1415. )
  1416. GO
  1417. CREATE NONCLUSTERED INDEX [t_rx_receiptinfo_zy_no_zy_times_index]
  1418. ON [dbo].[t_rx_receiptinfo] (
  1419. [zy_no] ASC,
  1420. [zy_times] ASC
  1421. )
  1422. GO
  1423. -- ----------------------------
  1424. -- Primary Key structure for table t_rx_receiptinfo
  1425. -- ----------------------------
  1426. ALTER TABLE [dbo].[t_rx_receiptinfo] ADD CONSTRAINT [t_rx_receiptinfo_pk] PRIMARY KEY CLUSTERED ([hosp_rxno])
  1427. WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
  1428. ON [PRIMARY]
  1429. GO
  1430. /*
  1431. Navicat Premium Data Transfer
  1432. Source Server : 172.16.32.179
  1433. Source Server Type : SQL Server
  1434. Source Server Version : 10506000
  1435. Source Host : 172.16.32.179:1433
  1436. Source Catalog : thxyhisdb
  1437. Source Schema : dbo
  1438. Target Server Type : SQL Server
  1439. Target Server Version : 10506000
  1440. File Encoding : 65001
  1441. Date: 28/04/2025 10:27:37
  1442. */
  1443. -- ----------------------------
  1444. -- Table structure for zd_rx_all
  1445. -- ----------------------------
  1446. IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[zd_rx_all]') AND type IN ('U'))
  1447. DROP TABLE [dbo].[zd_rx_all]
  1448. GO
  1449. CREATE TABLE [dbo].[zd_rx_all] (
  1450. [label] varchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  1451. [code] varchar(6) COLLATE Chinese_PRC_BIN NOT NULL,
  1452. [name] nvarchar(32) COLLATE Chinese_PRC_BIN NULL,
  1453. [times] int NULL,
  1454. [his_code] varchar(150) COLLATE Chinese_PRC_BIN NULL
  1455. )
  1456. GO
  1457. ALTER TABLE [dbo].[zd_rx_all] SET (LOCK_ESCALATION = TABLE)
  1458. GO
  1459. EXEC sp_addextendedproperty
  1460. 'MS_Description', N'字典标签',
  1461. 'SCHEMA', N'dbo',
  1462. 'TABLE', N'zd_rx_all',
  1463. 'COLUMN', N'label'
  1464. GO
  1465. EXEC sp_addextendedproperty
  1466. 'MS_Description', N'编码',
  1467. 'SCHEMA', N'dbo',
  1468. 'TABLE', N'zd_rx_all',
  1469. 'COLUMN', N'code'
  1470. GO
  1471. EXEC sp_addextendedproperty
  1472. 'MS_Description', N'名称',
  1473. 'SCHEMA', N'dbo',
  1474. 'TABLE', N'zd_rx_all',
  1475. 'COLUMN', N'name'
  1476. GO
  1477. EXEC sp_addextendedproperty
  1478. 'MS_Description', N'处方类别(电子处方流转)',
  1479. 'SCHEMA', N'dbo',
  1480. 'TABLE', N'zd_rx_all'
  1481. GO
  1482. /*
  1483. Navicat Premium Data Transfer
  1484. Source Server : 172.16.32.179
  1485. Source Server Type : SQL Server
  1486. Source Server Version : 10506000
  1487. Source Host : 172.16.32.179:1433
  1488. Source Catalog : thxyhisdb
  1489. Source Schema : dbo
  1490. Target Server Type : SQL Server
  1491. Target Server Version : 10506000
  1492. File Encoding : 65001
  1493. Date: 28/04/2025 10:27:53
  1494. */
  1495. -- ----------------------------
  1496. -- Table structure for t_rx_precheck
  1497. -- ----------------------------
  1498. IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[t_rx_precheck]') AND type IN ('U'))
  1499. DROP TABLE [dbo].[t_rx_precheck]
  1500. GO
  1501. CREATE TABLE [dbo].[t_rx_precheck] (
  1502. [hosp_rxno] varchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  1503. [hi_rxno] varchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  1504. [rx_trace_code] varchar(20) COLLATE Chinese_PRC_BIN NOT NULL,
  1505. [mdtrt_id] varchar(30) COLLATE Chinese_PRC_BIN NOT NULL,
  1506. [patn_name] nvarchar(40) COLLATE Chinese_PRC_BIN NOT NULL,
  1507. [psn_cert_type] varchar(6) COLLATE Chinese_PRC_BIN NOT NULL,
  1508. [certno] varchar(64) COLLATE Chinese_PRC_BIN NOT NULL,
  1509. [dr_code] varchar(20) COLLATE Chinese_PRC_BIN NOT NULL,
  1510. [prsc_dr_name] nvarchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  1511. [phar_dept_code] varchar(30) COLLATE Chinese_PRC_BIN NULL,
  1512. [phar_dept_name] nvarchar(64) COLLATE Chinese_PRC_BIN NULL,
  1513. [phar_profttl_codg] varchar(6) COLLATE Chinese_PRC_BIN NULL,
  1514. [phar_profttl_name] nvarchar(16) COLLATE Chinese_PRC_BIN NULL,
  1515. [phar_code] varchar(20) COLLATE Chinese_PRC_BIN NULL,
  1516. [phar_name] nvarchar(64) COLLATE Chinese_PRC_BIN NULL,
  1517. [phar_cert_type] varchar(6) COLLATE Chinese_PRC_BIN NULL,
  1518. [phar_certno] varchar(64) COLLATE Chinese_PRC_BIN NULL,
  1519. [phar_prac_cert_no] int NULL,
  1520. [phar_chk_time] datetime NULL,
  1521. [sign_digest] varchar(4000) COLLATE Chinese_PRC_BIN NULL,
  1522. [original_rx_file] text COLLATE Chinese_PRC_BIN NOT NULL,
  1523. [rx_state] varchar(12) COLLATE Chinese_PRC_BIN DEFAULT ('PRE_CHECKED') NOT NULL
  1524. )
  1525. GO
  1526. ALTER TABLE [dbo].[t_rx_precheck] SET (LOCK_ESCALATION = TABLE)
  1527. GO
  1528. EXEC sp_addextendedproperty
  1529. 'MS_Description', N'医疗机构处方编号',
  1530. 'SCHEMA', N'dbo',
  1531. 'TABLE', N't_rx_precheck',
  1532. 'COLUMN', N'hosp_rxno'
  1533. GO
  1534. EXEC sp_addextendedproperty
  1535. 'MS_Description', N'医保处方编号',
  1536. 'SCHEMA', N'dbo',
  1537. 'TABLE', N't_rx_precheck',
  1538. 'COLUMN', N'hi_rxno'
  1539. GO
  1540. EXEC sp_addextendedproperty
  1541. 'MS_Description', N'处方追溯码',
  1542. 'SCHEMA', N'dbo',
  1543. 'TABLE', N't_rx_precheck',
  1544. 'COLUMN', N'rx_trace_code'
  1545. GO
  1546. EXEC sp_addextendedproperty
  1547. 'MS_Description', N'医保就诊ID',
  1548. 'SCHEMA', N'dbo',
  1549. 'TABLE', N't_rx_precheck',
  1550. 'COLUMN', N'mdtrt_id'
  1551. GO
  1552. EXEC sp_addextendedproperty
  1553. 'MS_Description', N'患者姓名',
  1554. 'SCHEMA', N'dbo',
  1555. 'TABLE', N't_rx_precheck',
  1556. 'COLUMN', N'patn_name'
  1557. GO
  1558. EXEC sp_addextendedproperty
  1559. 'MS_Description', N'人员证件类型',
  1560. 'SCHEMA', N'dbo',
  1561. 'TABLE', N't_rx_precheck',
  1562. 'COLUMN', N'psn_cert_type'
  1563. GO
  1564. EXEC sp_addextendedproperty
  1565. 'MS_Description', N'证件号码',
  1566. 'SCHEMA', N'dbo',
  1567. 'TABLE', N't_rx_precheck',
  1568. 'COLUMN', N'certno'
  1569. GO
  1570. EXEC sp_addextendedproperty
  1571. 'MS_Description', N'开方医保医师代码',
  1572. 'SCHEMA', N'dbo',
  1573. 'TABLE', N't_rx_precheck',
  1574. 'COLUMN', N'dr_code'
  1575. GO
  1576. EXEC sp_addextendedproperty
  1577. 'MS_Description', N'开方医师姓名',
  1578. 'SCHEMA', N'dbo',
  1579. 'TABLE', N't_rx_precheck',
  1580. 'COLUMN', N'prsc_dr_name'
  1581. GO
  1582. EXEC sp_addextendedproperty
  1583. 'MS_Description', N'审方药师科室编号',
  1584. 'SCHEMA', N'dbo',
  1585. 'TABLE', N't_rx_precheck',
  1586. 'COLUMN', N'phar_dept_code'
  1587. GO
  1588. EXEC sp_addextendedproperty
  1589. 'MS_Description', N'审方药师科室名称',
  1590. 'SCHEMA', N'dbo',
  1591. 'TABLE', N't_rx_precheck',
  1592. 'COLUMN', N'phar_dept_name'
  1593. GO
  1594. EXEC sp_addextendedproperty
  1595. 'MS_Description', N'审方药师职称编码(from zd_rx_all where label=''rx_phar_pro_tech'')',
  1596. 'SCHEMA', N'dbo',
  1597. 'TABLE', N't_rx_precheck',
  1598. 'COLUMN', N'phar_profttl_codg'
  1599. GO
  1600. EXEC sp_addextendedproperty
  1601. 'MS_Description', N'审方药师职称名称',
  1602. 'SCHEMA', N'dbo',
  1603. 'TABLE', N't_rx_precheck',
  1604. 'COLUMN', N'phar_profttl_name'
  1605. GO
  1606. EXEC sp_addextendedproperty
  1607. 'MS_Description', N'审方医保药师代码',
  1608. 'SCHEMA', N'dbo',
  1609. 'TABLE', N't_rx_precheck',
  1610. 'COLUMN', N'phar_code'
  1611. GO
  1612. EXEC sp_addextendedproperty
  1613. 'MS_Description', N'审方药师姓名',
  1614. 'SCHEMA', N'dbo',
  1615. 'TABLE', N't_rx_precheck',
  1616. 'COLUMN', N'phar_name'
  1617. GO
  1618. EXEC sp_addextendedproperty
  1619. 'MS_Description', N'审方药师证件类型(from zd_rx_all where label=''rx_psn_cert_type'')',
  1620. 'SCHEMA', N'dbo',
  1621. 'TABLE', N't_rx_precheck',
  1622. 'COLUMN', N'phar_cert_type'
  1623. GO
  1624. EXEC sp_addextendedproperty
  1625. 'MS_Description', N'审方药师证件号码',
  1626. 'SCHEMA', N'dbo',
  1627. 'TABLE', N't_rx_precheck',
  1628. 'COLUMN', N'phar_certno'
  1629. GO
  1630. EXEC sp_addextendedproperty
  1631. 'MS_Description', N'审方药师执业资格证号',
  1632. 'SCHEMA', N'dbo',
  1633. 'TABLE', N't_rx_precheck',
  1634. 'COLUMN', N'phar_prac_cert_no'
  1635. GO
  1636. EXEC sp_addextendedproperty
  1637. 'MS_Description', N'医疗机构药师审方时间',
  1638. 'SCHEMA', N'dbo',
  1639. 'TABLE', N't_rx_precheck',
  1640. 'COLUMN', N'phar_chk_time'
  1641. GO
  1642. EXEC sp_addextendedproperty
  1643. 'MS_Description', N'处方信息签名值',
  1644. 'SCHEMA', N'dbo',
  1645. 'TABLE', N't_rx_precheck',
  1646. 'COLUMN', N'sign_digest'
  1647. GO
  1648. EXEC sp_addextendedproperty
  1649. 'MS_Description', N'处方原件',
  1650. 'SCHEMA', N'dbo',
  1651. 'TABLE', N't_rx_precheck',
  1652. 'COLUMN', N'original_rx_file'
  1653. GO
  1654. EXEC sp_addextendedproperty
  1655. 'MS_Description', N'处方状态',
  1656. 'SCHEMA', N'dbo',
  1657. 'TABLE', N't_rx_precheck',
  1658. 'COLUMN', N'rx_state'
  1659. GO
  1660. -- ----------------------------
  1661. -- Primary Key structure for table t_rx_precheck
  1662. -- ----------------------------
  1663. ALTER TABLE [dbo].[t_rx_precheck] ADD CONSTRAINT [t_rx_precheck_pk] PRIMARY KEY CLUSTERED ([hosp_rxno], [hi_rxno])
  1664. WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
  1665. ON [PRIMARY]
  1666. GO
  1667. /*
  1668. Navicat Premium Data Transfer
  1669. Source Server : 172.16.32.179
  1670. Source Server Type : SQL Server
  1671. Source Server Version : 10506000
  1672. Source Host : 172.16.32.179:1433
  1673. Source Catalog : thxyhisdb
  1674. Source Schema : dbo
  1675. Target Server Type : SQL Server
  1676. Target Server Version : 10506000
  1677. File Encoding : 65001
  1678. Date: 28/04/2025 10:26:43
  1679. */
  1680. -- ----------------------------
  1681. -- Table structure for t_rx_diseinfo
  1682. -- ----------------------------
  1683. IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[t_rx_diseinfo]') AND type IN ('U'))
  1684. DROP TABLE [dbo].[t_rx_diseinfo]
  1685. GO
  1686. CREATE TABLE [dbo].[t_rx_diseinfo] (
  1687. [hosp_rxno] varchar(32) COLLATE Chinese_PRC_BIN NOT NULL,
  1688. [diag_type] varchar(3) COLLATE Chinese_PRC_BIN NOT NULL,
  1689. [maindiag_flag] varchar(3) COLLATE Chinese_PRC_BIN NOT NULL,
  1690. [diag_srt_no] int NOT NULL,
  1691. [diag_code] varchar(30) COLLATE Chinese_PRC_BIN NOT NULL,
  1692. [diag_name] nvarchar(100) COLLATE Chinese_PRC_BIN NOT NULL,
  1693. [diag_dept] nvarchar(50) COLLATE Chinese_PRC_BIN NOT NULL,
  1694. [diag_dept_code] varchar(20) COLLATE Chinese_PRC_BIN NOT NULL,
  1695. [diag_dr_no] varchar(30) COLLATE Chinese_PRC_BIN NOT NULL,
  1696. [diag_dr_name] nvarchar(30) COLLATE Chinese_PRC_BIN NOT NULL,
  1697. [diag_time] datetime NOT NULL,
  1698. [tcm_dise_code] varchar(30) COLLATE Chinese_PRC_BIN NULL,
  1699. [tcm_dise_name] nvarchar(300) COLLATE Chinese_PRC_BIN NULL,
  1700. [tcmsymp_code] varchar(30) COLLATE Chinese_PRC_BIN NULL,
  1701. [tcmsymp] nvarchar(300) COLLATE Chinese_PRC_BIN NULL
  1702. )
  1703. GO
  1704. ALTER TABLE [dbo].[t_rx_diseinfo] SET (LOCK_ESCALATION = TABLE)
  1705. GO
  1706. EXEC sp_addextendedproperty
  1707. 'MS_Description', N'医疗机构处方编号',
  1708. 'SCHEMA', N'dbo',
  1709. 'TABLE', N't_rx_diseinfo',
  1710. 'COLUMN', N'hosp_rxno'
  1711. GO
  1712. EXEC sp_addextendedproperty
  1713. 'MS_Description', N'诊断类别(from zd_rx_all where label=''rx_diag_type'')',
  1714. 'SCHEMA', N'dbo',
  1715. 'TABLE', N't_rx_diseinfo',
  1716. 'COLUMN', N'diag_type'
  1717. GO
  1718. EXEC sp_addextendedproperty
  1719. 'MS_Description', N'主诊断标志(0-否、1-是)',
  1720. 'SCHEMA', N'dbo',
  1721. 'TABLE', N't_rx_diseinfo',
  1722. 'COLUMN', N'maindiag_flag'
  1723. GO
  1724. EXEC sp_addextendedproperty
  1725. 'MS_Description', N'诊断排序号',
  1726. 'SCHEMA', N'dbo',
  1727. 'TABLE', N't_rx_diseinfo',
  1728. 'COLUMN', N'diag_srt_no'
  1729. GO
  1730. EXEC sp_addextendedproperty
  1731. 'MS_Description', N'诊断代码',
  1732. 'SCHEMA', N'dbo',
  1733. 'TABLE', N't_rx_diseinfo',
  1734. 'COLUMN', N'diag_code'
  1735. GO
  1736. EXEC sp_addextendedproperty
  1737. 'MS_Description', N'诊断名称',
  1738. 'SCHEMA', N'dbo',
  1739. 'TABLE', N't_rx_diseinfo',
  1740. 'COLUMN', N'diag_name'
  1741. GO
  1742. EXEC sp_addextendedproperty
  1743. 'MS_Description', N'诊断科室名称',
  1744. 'SCHEMA', N'dbo',
  1745. 'TABLE', N't_rx_diseinfo',
  1746. 'COLUMN', N'diag_dept'
  1747. GO
  1748. EXEC sp_addextendedproperty
  1749. 'MS_Description', N'诊断科室代码',
  1750. 'SCHEMA', N'dbo',
  1751. 'TABLE', N't_rx_diseinfo',
  1752. 'COLUMN', N'diag_dept_code'
  1753. GO
  1754. EXEC sp_addextendedproperty
  1755. 'MS_Description', N'诊断医生医保编码',
  1756. 'SCHEMA', N'dbo',
  1757. 'TABLE', N't_rx_diseinfo',
  1758. 'COLUMN', N'diag_dr_no'
  1759. GO
  1760. EXEC sp_addextendedproperty
  1761. 'MS_Description', N'诊断医生姓名',
  1762. 'SCHEMA', N'dbo',
  1763. 'TABLE', N't_rx_diseinfo',
  1764. 'COLUMN', N'diag_dr_name'
  1765. GO
  1766. EXEC sp_addextendedproperty
  1767. 'MS_Description', N'诊断时间',
  1768. 'SCHEMA', N'dbo',
  1769. 'TABLE', N't_rx_diseinfo',
  1770. 'COLUMN', N'diag_time'
  1771. GO
  1772. EXEC sp_addextendedproperty
  1773. 'MS_Description', N'中医病名代码(diagType不为西医诊断时上传)',
  1774. 'SCHEMA', N'dbo',
  1775. 'TABLE', N't_rx_diseinfo',
  1776. 'COLUMN', N'tcm_dise_code'
  1777. GO
  1778. EXEC sp_addextendedproperty
  1779. 'MS_Description', N'中医病名(diagType不为西医诊断时上传)',
  1780. 'SCHEMA', N'dbo',
  1781. 'TABLE', N't_rx_diseinfo',
  1782. 'COLUMN', N'tcm_dise_name'
  1783. GO
  1784. EXEC sp_addextendedproperty
  1785. 'MS_Description', N'中医证候代码(diagType不为西医诊断时上传)',
  1786. 'SCHEMA', N'dbo',
  1787. 'TABLE', N't_rx_diseinfo',
  1788. 'COLUMN', N'tcmsymp_code'
  1789. GO
  1790. EXEC sp_addextendedproperty
  1791. 'MS_Description', N'中医证候(diagType不为西医诊断时上传)',
  1792. 'SCHEMA', N'dbo',
  1793. 'TABLE', N't_rx_diseinfo',
  1794. 'COLUMN', N'tcmsymp'
  1795. GO
  1796. -- ----------------------------
  1797. -- Primary Key structure for table t_rx_diseinfo
  1798. -- ----------------------------
  1799. ALTER TABLE [dbo].[t_rx_diseinfo] ADD CONSTRAINT [t_rx_diseinfo_pk] PRIMARY KEY CLUSTERED ([hosp_rxno], [diag_srt_no])
  1800. WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
  1801. ON [PRIMARY]
  1802. ;
  1803. alter table mzy_zd_charge_type
  1804. add charge_code varchar(10) ;
  1805. alter table t_workspace_config
  1806. add crb_history_flag int ;
  1807. alter table t_discount
  1808. add time_type varchar(255) default '0'
  1809. go
  1810. alter table t_discount
  1811. add week_day varchar(255)
  1812. go
  1813. alter table t_discount
  1814. add month_day varchar(100)
  1815. go
  1816. alter table t_discount
  1817. add always_day varchar(100)
  1818. go
  1819. alter table t_discount
  1820. add month_num varchar(100)
  1821. go
  1822. alter table t_discount
  1823. add start_time varchar(100)
  1824. go
  1825. alter table t_discount
  1826. add end_time varchar(100);
  1827. alter table zy_receipt
  1828. add dzfp_receipt_no varchar(32) ;
  1829. alter table yp_zd_dict add bar_code varchar(30);
  1830. alter table yp_zd_dict add buy_flag varchar(1);
  1831. alter table yp_zd_dict add health_flag varchar(1);
  1832. alter table yp_zd_dict add health_content varchar(1000);
  1833. alter table t_common_params alter column params_content varchar(800) null
  1834. go
  1835. --药房增加字段 2025-06-16
  1836. alter table yp_zd_group_name
  1837. add zy_flag varchar(5)
  1838. go
  1839. exec sp_addextendedproperty 'MS_Description', '住院药房标识 0 否 1 是', 'SCHEMA', 'dbo', 'TABLE', 'yp_zd_group_name', 'COLUMN', 'zy_flag'
  1840. go
  1841. alter table yp_zd_group_name
  1842. add xy_flag varchar(5)
  1843. go
  1844. exec sp_addextendedproperty 'MS_Description', '是否 西药药房 0 否 1是', 'SCHEMA', 'dbo', 'TABLE', 'yp_zd_group_name', 'COLUMN', 'xy_flag'
  1845. go
  1846. alter table yp_zd_group_name
  1847. add zcy_flag varchar(5)
  1848. go
  1849. exec sp_addextendedproperty 'MS_Description', '是否中草药药房 0 否 1是', 'SCHEMA', 'dbo', 'TABLE', 'yp_zd_group_name', 'COLUMN', 'zcy_flag'
  1850. go
  1851. alter table yp_zd_group_name
  1852. add del_flag varchar(1)
  1853. go
  1854. exec sp_addextendedproperty 'MS_Description', '删除标识 0有效 1删除 ', 'SCHEMA', 'dbo', 'TABLE', 'yp_zd_group_name', 'COLUMN', 'del_flag'
  1855. go
  1856. alter table yp_zd_group_name
  1857. add start_time varchar(150)
  1858. go
  1859. exec sp_addextendedproperty 'MS_Description', '有效开始时间', 'SCHEMA', 'dbo', 'TABLE', 'yp_zd_group_name', 'COLUMN', 'start_time'
  1860. go
  1861. alter table yp_zd_group_name
  1862. add end_time varchar(150)
  1863. go
  1864. exec sp_addextendedproperty 'MS_Description', '有效结束时间', 'SCHEMA', 'dbo', 'TABLE', 'yp_zd_group_name', 'COLUMN', 'end_time';
  1865. alter table yp_zd_group_name
  1866. add yc_flag varchar(5)
  1867. go
  1868. exec sp_addextendedproperty 'MS_Description', '医材药房 0 否 1是', 'SCHEMA', 'dbo', 'TABLE', 'yp_zd_group_name', 'COLUMN', 'yc_flag'
  1869. go
  1870. alter table yp_zd_group_name
  1871. add kl_flag varchar(5)
  1872. go
  1873. exec sp_addextendedproperty 'MS_Description', '颗粒药房 0 否 1 是', 'SCHEMA', 'dbo', 'TABLE', 'yp_zd_group_name', 'COLUMN', 'kl_flag';
  1874. --新增中医诊断字典表
  1875. create table zd_tcm_diag
  1876. (
  1877. code varchar(250),
  1878. name varchar(250),
  1879. py_code varchar(100),
  1880. wb_code varchar(100),
  1881. del_flag varchar(1) default '0'
  1882. )
  1883. go
  1884. exec sp_addextendedproperty 'MS_Description', '中医诊断字典', 'SCHEMA', 'dbo', 'TABLE', 'zd_tcm_diag'
  1885. go
  1886. exec sp_addextendedproperty 'MS_Description', '0 有效 1 删除', 'SCHEMA', 'dbo', 'TABLE', 'zd_tcm_diag', 'COLUMN', 'del_flag';
  1887. --住院证增加押金
  1888. alter table mz_zy_req
  1889. add deposit decimal(18,2)
  1890. go
  1891. exec sp_addextendedproperty 'MS_Description', '押金', 'SCHEMA', 'dbo', 'TABLE', 'mz_zy_req', 'COLUMN', 'deposit';
  1892. exec sp_addextendedproperty 'MS_Description', '押金', 'SCHEMA', 'dbo', 'TABLE', 'mz_zy_req', 'COLUMN', 'deposit';
  1893. --增加退费权限按钮 2025-06-20
  1894. insert into t_button (name,parent_id, button_code, sort_value, create_time, create_id)
  1895. values ( '门诊退费',3,'mz_refund',999,getdate(),1);
  1896. insert into t_button (name,parent_id, button_code, sort_value, create_time, create_id)
  1897. values ( '挂号退费',3,'gh_refund',998,getdate(),1);
  1898. --天资要求新增隐藏开外配药处方药隐藏 其他 可以不隐藏 20250620
  1899. insert into t_dict_data (dict_type, dict_value, dict_name, remark)
  1900. values ('wpy','1','wpy_hide','外配药和指引单提示隐藏 0 否 1 隐藏');
  1901. --新增中医诊断 20250624
  1902. alter table mz_visit_table
  1903. add tcm_icd_code varchar(2500)
  1904. go
  1905. exec sp_addextendedproperty 'MS_Description', '中医诊断编码', 'SCHEMA', 'dbo', 'TABLE', 'mz_visit_table', 'COLUMN', 'tcm_icd_code'
  1906. go
  1907. alter table mz_visit_table
  1908. add tcm_icd_text varchar(2500)
  1909. go
  1910. exec sp_addextendedproperty 'MS_Description', '中医诊断名称', 'SCHEMA', 'dbo', 'TABLE', 'mz_visit_table', 'COLUMN', 'tcm_icd_text'
  1911. go
  1912. --自动收取挂号费标识 20250630
  1913. alter table mz_order_detail
  1914. add gh_fee_flag varchar(5)
  1915. go
  1916. exec sp_addextendedproperty 'MS_Description', '0 开处方不自动收取挂号费 1 开处方自动收取挂号费', 'SCHEMA', 'dbo', 'TABLE', 'mz_order_detail', 'COLUMN', 'gh_fee_flag'
  1917. go
  1918. --新增处方类型 20250709
  1919. insert into mz_zd_order_type (code, name, py_code, d_code, del_flag) values ('6','医技录入处方','YJLRCF','YJLRCF','0')
  1920. --挂号记录 新增推荐人 20250718
  1921. alter table mzy_reqrec
  1922. add rec_staff varchar(100)
  1923. go
  1924. exec sp_addextendedproperty 'MS_Description', N'推荐人编码', 'SCHEMA', 'dbo', 'TABLE', 'mzy_reqrec', 'COLUMN',
  1925. 'rec_staff'
  1926. go