| Date: | Thu, 18 Nov 2010 19:04:36 +0000 |
| Reply-To: | toby dunn <tobydunn@HOTMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | toby dunn <tobydunn@HOTMAIL.COM> |
| Subject: | Re: ICD9 CM Removing large blocks text |
|
| In-Reply-To: | <201011181849.oAIHJKUr007304@willow.cc.uga.edu> |
| Content-Type: | text/plain; charset="iso-8859-1" |
This is untested but should lay the ground work for an easy parse.
The reason I went with PRX functions is well one I working on a
BBU book over the subject, but more importantly it is the breaking
the string into two parts that I felt was easier and would be more
efficient with the PRXPosn and PRXMatch combo.
FileName FLN "C:\Zenworks\Dtab09_15nov10.txt" ;
Data ICD9_CODES ( Drop = Text Pattern ) ;
Infile FLN delimiter='09'x MISSOVER DSD Lrecl=32767 FirstObs=2 ;
Length DX_Code $8.
DX_Desc $125. ;
Input Text $Char1000. ;
Pattern = PRXParse( '/^([\d|.]+ (.*)$)/o' ) ;
If ( PrxMatch( Pattern , Strip( Text ) ) > 0 ) Then Do ;
DX_Code = PrxPosn( Pattern , 1 , Text ) ;
DX_Desc = PrxPosn( Pattern , 2 , Text ) ;
Output ;
End ;
Run ;
Toby Dunn
"I'm a hell bent 100% Texan til I die"
"Don't touch my Willie, I don't know you that well"
> Date: Thu, 18 Nov 2010 13:49:07 -0500
> From: kibrown@LADHS.ORG
> Subject: ICD9 CM Removing large blocks text
> To: SAS-L@LISTSERV.UGA.EDU
>
> Hi all,
> I have an official version of ICD9 CM CD. I exported the all ICD9 codes in
> a text file. The issue is the export from the CD creates
> a text file with ICD 9 codes, descriptions and all comments associated
> with every classification.
>
> I need only the ICD9 codes and descriptions.
>
> I have been manually deleting all commentary, which is very laborious. I'm
> working with version 9.1 in XP pro platform.
> Any help is appreciated. Thanks, Kim
>
> Sample of files:
> Crystalluria
> Elevated urine levels of:
> 17-ketosteroids
> catecholamines
> indolacetic acid
> vanillylmandelic acid [VMA]
> Melanuria
> 792 Nonspecific abnormal findings in other body substances
> Terms following the word "excludes" are to be coded elsewhere. The term
> excludes means "DO NOT CODE HERE".Excludes: that in chromosomal
> analysis (795.2)
> 792.0 Cerebrospinal fluid
> 792.1 Stool contents
> Abnormal stool color
> Fat in stool
> Mucus in stool
> Occult blood
> Pus in stool
> Terms following the word "excludes" are to be coded elsewhere. The term
> excludes means "DO NOT CODE HERE".Excludes: blood in stool [melena]
> (578.1)
> newborn (772.4, 777.3)
> 792.2 Semen
> Abnormal spermatozoa
> Terms following the word "excludes" are to be coded elsewhere. The term
> excludes means "DO NOT CODE HERE".Excludes: azoospermia (606.0)
> oligospermia (606.1)
> 792.3 Amniotic fluid
>
> I want this:
> 792 Nonspecific abnormal findings in other body substances
> 792.0 Cerebrospinal fluid
> 792.1 Stool contents
> 792.2 Semen
> 792.3 Amniotic fluid
>
>
> I used this statement to import into SAS:
> data WORK.ICD9_CODES ;
> %let _EFIERR_ = 0;
> infile 'C:\Zenworks\Dtab09_15nov10.txt' delimiter='09'x MISSOVER DSD
> lrecl=32767
> firstobs=2 ;
> informat dx_code $8. ;
> informat dx_desc $125. ;
> format dx_code $8. ;
> format dx_desc $125. ;
> input
> dx_code$
> dx_desc$ ;
> run;
>
> I was trying to use something like this
> data icd9_codes2;
> set icd9_codes;
> If (char (dx_code, 1)) not in ('1', '2', '3') then dx_code2=dx_code;
> run;
> I'm open to any suggestions.
|