sql 坏NDC和CPT4对。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql 坏NDC和CPT4对。相关的知识,希望对你有一定的参考价值。

--This script will help you back up, and remove invalid NDC / CPT4 code pairings.  
--For example NDC 1234, should not be attached to office visit code 99213  you would put those values below, then back them up and delete them from the table.
--so long as that set appears in ndc_mstr then when that cpt is used the software will try to attach that NDC.
select * from ndc_mstr
where ndc_id = '' --NDC code here
and cpt4_code_id = '' -- CPT4 its pairing up with here

select * into ndc_mstr_bkup_datehere from ndc_mstr
--back up the table


--delete the invalid data
delete from ndc_mstr
where ndc_id = '' --NDC code here
and cpt4_code_id = '' -- CPT4 its pairing up with here

--finally we must also check if the bad pair exists in the patient_procedures that are in the holding tank currently, if they try to import in with that pair
--the pair will be repopulated back into the NDC_mstr we just fixed.
select * from patient_procedure 
where uniq_id in (select uniq_id from pending_charge)--this procedure is in the holding tank
and national_drug_code = ''--NDC code here
and cpt4_code_id = '' --cpt4 code here

select * into patient_procedure_bkup_datehere from patient_procedure
--back up the table

--set the NDC to null so we don't repopulate the pairing in the NDC mstr.
update patient_procedure
set national_drug_code = null
where uniq_id in (select uniq_id from pending_charge)--this procedure is in the holding tank
and national_drug_code = ''--NDC code here
and cpt4_code_id = '' --cpt4 code here

以上是关于sql 坏NDC和CPT4对。的主要内容,如果未能解决你的问题,请参考以下文章

使用 HP UFT 工具测试 ISO8583 和 NDC 协议

log4j中MDC和NDC作用以及用途

在循环中插入sql查询是好习惯还是坏习惯?

log4j MDC NDC详解

Java日志Log4j或者Logback的NDC和MDC功能

问题剖析:Oracle数据库坏块--物理坏块