问题是:
病案首页的手术编码有7个。一台手术的手术码可能由几个手术(ssjczbm1 ,ssjczbm2,ssjczbm3,ssjczbm4,ssjczbm5,ssjczbm6,ssjczbm7)编码组成。
我怎么能用更快的方式,用循环等等书写 7个手术码?
变量的意义:
① JBDN(主要诊断的ICD-10 编码);
② ssjczbm1 ,ssjczbm2,ssjczbm3,ssjczbm4,ssjczbm5,ssjczbm6,ssjczbm7 ( 手术编码)
例如:
急性心肌梗死的提取条件是:主要诊断为I21、I22编码为急性心肌梗死,排除编码为心脏手术的患者。
(substr(JBDM,1,3)= "I21" OR substr(JBDM,3)= "I22") AND (substr手术码,1,2)^="35" OR substr(手术码,1,2)^="36" OR substr (手术码,1,2)^="37" )
怎么能快速的从这样的书写
/*binghzong=1 急性心肌梗死 */
data b1;
set shuju;
if
( substr(JBDM,1,3)='I21' OR substr(JBDM,1,3)='I22' )
AND
( substr(ssjczbm1,1,2)^="35" OR substr(ssjczbm1,1,2)^="36" OR substr(ssjczbm1,1,2)^="37" )
AND cykb="04"
then bingzhong=1;
run;
转变成有7个手术码
/*依次给予病种赋值*/
/*binghzong=1 急性心肌梗死 */
data b1;
set shuju;
if
(substr(JBDM,1,3)='I21' OR substr(JBDM,1,3)='I22' )
AND
(
substr(ssjczbm1,1,2)^="35" OR substr(ssjczbm1,1,2)^="36" OR substr(ssjczbm1,1,2)^="37" OR
substr(ssjczbm2,1,2)^="35" OR substr(ssjczbm2,1,2)^="36" OR substr(ssjczbm2,1,2)^="37" OR
substr(ssjczbm3,1,2)^="35" OR substr(ssjczbm3,1,2)^="36" OR substr(ssjczbm3,1,2)^="37" OR
substr(ssjczbm4,1,2)^="35" OR substr(ssjczbm4,1,2)^="36" OR substr(ssjczbm4,1,2)^="37" OR
substr(ssjczbm5,1,2)^="35" OR substr(ssjczbm5,1,2)^="36" OR substr(ssjczbm5,1,2)^="37" OR
substr(ssjczbm6,1,2)^="35" OR substr(ssjczbm6,1,2)^="36" OR substr(ssjczbm6,1,2)^="37" OR
substr(ssjczbm7,1,2)^="35" OR substr(ssjczbm7,1,2)^="36" OR substr(ssjczbm7,1,2)^="37"
)
AND cykb="04"
then bingzhong=1;
run;
因为我有很多病种,
下面的胰腺切除术提取的条件是
(SUBSTR(手术码,1,5)>="42.40" AND SUBSTR(手术码,1,5)<="42.42")
OR (SUBSTR(手术码,1,5)>="42.51" AND SUBSTR(手术码,1,5)<="42.56")
OR (SUBSTR(手术码,1,5)>="42.58" AND SUBSTR(手术码,1,5)<="42.59")
OR (SUBSTR(手术码,1,5)>="42.61" AND SUBSTR(手术码,1,5)<="42.69")
/*binghzong=25 胰腺切除术*/
data b25;
set shuju;
if
(
( substr(ssjczbm1,1,5)>="42.40" AND substr(ssjczbm1,1,5)<="42.42" )
OR ( substr(ssjczbm1,1,5)>="42.51" AND substr(ssjczbm1,1,5)<="42.56" )
OR ( substr(ssjczbm1,1,5)>="42.58" AND substr(ssjczbm1,1,5)<="42.59" )
OR ( substr(ssjczbm1,1,5)>="42.61" AND substr(ssjczbm1,1,5)<="42.69" )
)
AND cykb="04"
then bingzhong=25;
run;
我怎么能快速的写上ssjczbm1 ,ssjczbm2,ssjczbm3,ssjczbm4,ssjczbm5,ssjczbm6,ssjczbm7 这7个手术码?
有些手术的条件很多的,写上一个手术码已经很长了,囊括7个手术码实在很让人抓狂。
|