-------------------------------------------------------
一个病人cypb是99,护士看不到,大夫能看到,把ys_zy_jzjl里面的cybz改了就好了
也就是说大夫那边显示是过滤的这个表
--------------------------------------------------------------------------------------
病人医保退费的问题,涉及到的表
ms_szmx
ms_mzxx
yb_mz_jsxx
yb_bank_jyxx_mz
-----------------------------------------------------------------------------------------------
用between and截取日期段
select kfrq from ms_cf01 where kfrq between to_date('2017-11-1 00:00:00','yyyy-mm-dd hh24:mi:ss') and to_date('2017-11-06 23:59:59','yyyy-mm-dd hh24:mi:ss')
to_char(ghrq,'yyyy-mm-dd')='2016-03-28'
CASE WHEN b.brxb = 1 THEN '男' WHEN b.brxb = 2 THEN '女' end AS 性别,
round((SYSDATE - b.csny)/365) AS 年龄,
select sum(zjje) from v_zy_fymx where fyrq
>=to_date('2017-01-01 00:00:00','yyyy-mm-dd hh24:mi:ss')
and fyrq <to_date('2018-01-01 00:00:00','yyyy-mm-dd hh24:mi:ss') and YPLX=1 or YPLX=2
----------------------------------------------------------------==
1.定义用date
2.传date参数
3.比较的话带“=”
与
1.
与
====================================
(select twnr from cp_byyy ,cp_bymx where cp_bymx.byyy=cp_byyy.twbh
and cp_bymx.byyy in (719,720,721)and cp_bymx.byxh=cp_brlj.byxh) as a
上面最关键的是cp_bymx.byxh=cp_brlj.byxh,这样的话前面这两个表就与cp_brlj联系起来了
===================================
select * from L_WARNTESTBLOG
lis危急值的存的表
======================================
在qlsql里面查询没问题,在某一个版本的pb里面查询视图报上面的错误,然后对视图弄了个下面的操作就好了
----------------------------------------------------------------
关于二级库对照错误以后,报错盐酸利多wzxh=10004 and kfxh=53 库存不足
但是在计费的界面没有这个耗材,其实是对照错误的原因,现在需要找到是把什么对照成了【盐酸利多卡因】
select * from gy_fywz where wzxh=10004
select * from gy_ylsf where fyxh=45824
select * from gy_ylsf where fymc like '%盐酸利多%'
select * from wl_wzzd where wzxh=10004
select * from wl_wzzd where wzmc like '%盐酸%'
-------------------------------------------------------------------
当挂号太多的时候
----------------------------------------------------------------
oracle批量修改时间
update ms_szmx set jzrq =to_date('2018-04-24 18:00:00','yyyy-mm-dd hh24:mi:ss') where czgh=8800
---------------------------------------------
在gy_ylsf里面关联的不是fyxh而是wpbh
自己测试申领了一个,在slxx里面有这一条数据,申领状态-1表示新增,
---------------------------------------
select d.brxm,
round((SYSDATE - csny)/365) AS 年龄,
CASE WHEN brxb = 1 THEN '男' WHEN brxb = 2 THEN '女' end AS 性别 ,zdmc,
(select ksmc from gy_ksdm where gy_ksdm.ksdm=b.ksdm )as ksdm,
(select ygxm from gy_ygdm where ygdm=b.ysdm ) as ysdm,kssj,ypsl from ys_mz_jzls a,ms_cf01 b ,ms_cf02 c ,ms_brda d where zdmc like '%梅毒%' and b.brid=d.brid and d.brid=a.brbh and a.jzxh=b.jzxh and b.cfsb=c.cfsb and c.ypxh=12816
order by brxm,kssj
---
select brxm, CASE WHEN brxb = 1 THEN '男' WHEN brxb = 2 THEN '女' end AS 性别 ,zyhm, round((SYSDATE - csny)/365) AS 年龄, (select ksmc from gy_ksdm where gy_ksdm.ksdm=a.brks )as brks , (select ksmc from gy_ksdm where gy_ksdm.ksdm=a.brbq )as brbq,ryrq, fysl,mszd from zy_brry a,v_zy_fymx b,ys_zy_jbzd c where c.mszd like '%梅毒%' and a.zyh=b.zyh and a.zyhm=c.brbh and b.fyxh=12816
--------------------------------------------------
想通过这个了解三个表的关系
-----------------------------------------------
select * from ms_yj01 a, ms_yj02 b ,gy_ylsf c where b.ylxh=c.fyxh and a.yjxh=b.yjxh
-------------------------------------------
select sfxm,sfmc ,sum(je)from(
from ms_yj01 a, ms_yj02 b ,gy_ylsf c ,gy_sfxm d,ms_mzxx e
where a.yjxh=b.yjxh
and b.ylxh=c.fyxh and a.mzxh=e.mzxh
and c.fygb=d.sfxm
and e.sfrq>=:adt_qsrq
and e.sfrq<=:adt_zzrq
group by d.sfxm,d.sfmc
union all
select d.sfxm,d.sfmc,sum(0-b.hjje) as je
from ms_yj01 a, ms_yj02 b ,gy_ylsf c ,gy_sfxm d,ms_zffp e
where a.yjxh=b.yjxh
and b.ylxh=c.fyxh and a.mzxh=e.mzxh
and c.fygb=d.sfxm
and e.zfrq>=:adt_qsrq
and e.zfrq<=:adt_zzrq
group by d.sfxm,d.sfmc
)
group by sfxm,sfmc
-----------------------------------
病区出院提示的地方显示医技。。。。
在yj_zy01与yj_zy02操作
----
------------------
SELECT SUM(V_ZY_FYMX.ZJJE) AS ZJJE
FROM V_ZY_FYMX
WHERE ((V_ZY_FYMX.YPLX = 2 ) OR (V_ZY_FYMX.YPLX = 1))
AND ( V_ZY_FYMX.JFRQ >= to_timestamp('2017-01-01 00:00:00.000','yyyy-mm-dd hh24:mi:ssxff') )
AND ( V_ZY_FYMX.JFRQ < to_timestamp('2018-01-01 00:00:00.000','yyyy-mm-dd hh24:mi:ssxff') )
--35915357.01 --系统值
这个两个语句的区别在哪?
查询中的数据是不同的
---------------------------------------
和药品信息相关的表
YK_CDDZ,
YK_TYPK,
YK_YPCD,
-----------------------------------
wl_ghdw 物流_供货单位
----------------------------------------------------------------------
V_AMQC_KJYW 抗菌药物
------------------------------------------------------------------------
select * from wl_zcmx 账册明细
select * from WL_BBXM 报表项目
select * from Wl_Wzkc 库存
-----------------------------------------------------------------------
select ksmc ,sum(wzsl),sum(wzje),sum(wzsl1),sum(wzje1) from
(
select b.ksmc ,(0 - sum(a.wzsl)) as wzsl , (0 - sum(a.wzje))as wzje ,0 as wzsl1 , 0 as wzje1
from wl_zcmx a,gY_ksdm b
where a.ksdm=b.ksdm and a.djlx='CK' and a.ywlb=1 and a.kfxh=61 and a.glfs in (1,3)
and to_char(fsrq,'yyyy-mm-dd')>'2017-03-28'
and to_char(fsrq,'yyyy-mm-dd')<'2017-12-28'
group by b.ksmc
union all
select b.ksmc ,0 as wzsl ,0 as wzje ,sum(a.wzsl)as wzsl , sum(a.wzje) as wzje1
from wl_zcmx a,gY_ksdm b
where a.ksdm=b.ksdm and a.djlx='CK' and a.ywlb=-1 and a.kfxh=61 and a.glfs in (1,3)
and to_char(fsrq,'yyyy-mm-dd')>'2017-03-28'
and to_char(fsrq,'yyyy-mm-dd')<'2017-12-28'
group by b.ksmc)
group by ksmc
在这里单查
然后是
上面很显然是两个sql,非得写一块是因为他就是两种数据一起显示,共同点是科室代码相同,
即显示统一科室的两种业务类别的数据。
--------------------
自动对照的界面
2.select max(jlxh) From gy_fywz
3.select* From gy_fywz where dzsj >to_date('2017-12-26 00:00:00','yyyy-mm-dd hh24:mi;ss')
如果1和2不等,那么更改1
3.里面的数据可以更改
---------------------------------------------------------------------
ZY_YPYF 住院_药品用法
gytj给药途径,改药品用法的时候会用到
-------------------------------------------------------------------------
工人医院是诊间挂号,jzxh是逐渐累加的,大于一定的量就挂不上号了,
select * from ms_ghks where jzxh>5000 门诊_挂号科室
小辉哥的意思是把jzxh设置为0,这个就诊序号不会对别的有影响吗?
---------------------------------------------------------------------------
在科室里面加了【回访办】
但是出库的地方调不出来
在gy_ksdm 里面找到该科室,然后kszfpb给他加个初值
--------------------------------------------------------------------
关于工人医院扶贫的表
gryy_fpry 工人医院_扶贫人员
----------------------------------------------------------
下面是二级库耗材的几个表
select fyxh from gy_ylsf where wpbh = 7749 and zfpb = 0 )
select * from wl_wzcj where wzxh = 7749
select * from wl_wzkc where wzxh = 9863
--update gy_fybm set pydm = 'YCXYD',fymc='一次性牙垫' where fyxh in (
select fyxh from gy_ylsf where wpbh = 8692 and zfpb = 0 )
Select * from gy_ylsf where fymc like '%一次性牙%' and zfpb=0
-------------------------------------------------------------------------------
zy_bqyz 里面的 lsyz=0 代表长期的
lsyz=1 历史医嘱为1 代表临时的
--------------------------------------------------------
gy_ylsf 查询fygb(费用归并) 医疗收费
gy_sfxm 查询fymc(费用名称) 收费项目
------------------------------------------------------
* from zy_brry where cyrq is not null
----------------------------------------------------------------------------
这里面的可以全部删除,
这里面有打印状态
---------------------------------------------------------------------
select * from ys_zy_hzsq 医生_住院_会诊申请 jzhm=zyh
select * from ys_zy_hzyj 医生_住院_会诊意见
select * from ys_zy_hzyq 医生_住院_会诊邀请
--------------------------------------------------------------------
ys_zy_hzsq 医生_住院_会诊申请
可以看到有“会诊目的”和“会诊目的2”两个字段,就是在会诊目的的字数特别多的时候就可以写到下个字段里面
---------------------------------
select * from ms_szmx where szlb in (1,2,-2) and zhye = jfje*2 and zhye > 0 order by czgh,brid ms_szmx
门诊_账户收支明细 收支类别 账户余额、借方金额 操作工号 日期
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
一条sql语句,中有一部分不想用了可以部分注销吗,
选中想注销的某一部分sql语句,点击左右的按钮,如果解除注销。点击右侧的
select * from ms_szmx where szlb=-2,-2代表退款
select * from ms_szmx where szlb=2 ,2代表现金追缴
select * from ms_szmx where szlb=1 ,1代表开户金额
下面这两条语句配合使用,zhye = jfje*2,就是借鉴上一次短款的经历而来的,就是比如卡里剩下155.58然后病人想退款,而操作员点击了充值155.58,这样他还把钱找给别人了,所以短款的数量就是退款金额的两倍。
select * from ms_szmx where /*brid= 150741 and*/ szlb in (1,2,-2) and zhye = jfje*2 and zhye > 0 order by czgh,brid
select * from ms_szmx where brid= 152464 and szlb in (1,2,-2) order by rq asc
------------
这个是宁哥给你查看表结构的软件,
双击直接打开无需安装,
点击‘新建文档’
命名后
点击'导入数据字典',然后是点击“导入pdm”选中海哥给的表结构
每个pdm文件下面可以包含一张或者多张表,如上图又所示,
点开每一张表可以看到表的中文名字,以及对应的字段的描述(长度与中文名字等)
这么做是因为在数据库中看不到某表的的文字的comments,比如ZYHM你猜不到是“住院号码”,所以我下面的工作是给数据库中的某些表加上文字的comments
点击“建表sql”,数据库类型选择ORACLE然后点击最下面的生成建表脚本,
生成如下的sql语句
然后在plsql里面把下面的comments执行一下,别忘了改表名的commments