*******************************************************************************; * Code chief complaints into syndromes (run after ErrorCheckDedupeAppend.sas) *; *******************************************************************************; libname data "c:\SyndromicWorkshop\sas\data"; * Create macro indicating where the data for this workshop are kept; %LET FOLDER=c:\SyndromicWorkshop\sas\data; * Include SAS program that contains macros for syndrome coding; filename syndCode "c:\syndromicworkshop\sas\NYCSyndromicMacros.sas"; %include syndcode; options mprint; * Categorize CC into syndromes; DATA CodedArchive; SET data.NYCfakearchive; *where date>date()-31; *Limit to past 30 days; cc=upcase(cc); %CCMiss; if ccmiss in (1,2) then delete; *Delete if blank or uninterpretable chief complaint; %age; %syndrome; *Misc. syndromes; %BloodyDiar; %Heat; %FevChest; *Anthracis; %RashFev; *Smallpox; %RespBlood; *Plague; %PoisonIvy; *Poison Ivy-used to eliminate words for poisoning syndrome; %ODMisc; *ODMisc-Used to eliminate misc words for poisoning syndrome; %Poisoning; *Poisoning; %NYCzips; if nyczip ne 1 then zip=edcode; RUN; options nomprint; * Check syndrome coding of todays chief complaints; proc format; value syndfmt 0='0-None' 1='1-Sepsis' 2='2-Respiratory' 3='3-Rash' /* Note: these codes are for dataset FUZZY, different from Ad_sum codes*/ 4='4-Fever' 5='5-Cold' 6='6-Diarrhea' 7='7-Asthma' 8='8-Vomit'; * Define linelist categories; data testcoding;set codedarchive; if date=mdy(7,24,03); *date()-1; if anthracis=1 then linelist='Anthrax (fev/cp)'; if rashfev=1 then linelist='Smallpox (fev/rash)'; if plague=1 then linelist='Plague (cough/blood)'; if poisoning=1 then linelist='Poisoning';run; * Print chief complaint frequencies by syndrome for manual verification of coding; proc sort data=testcoding; by syndrome; proc freq data=testcoding order=freq; tables cc; by syndrome; format syndrome syndfmt.; title1 'Chief complaint frequencies, by syndrome, for data added today'; title2; run; proc freq data=testcoding; tables syndrome; title 'syndromes'; title1 'Syndrome frequencies for data being added today'; title2; format syndrome syndfmt.; run; * Line-lists of patients with Anthrax, Plague or Smallpox prodromes; options number nodate pageno=1 linesize=120 ps=34 orientation=landscape missing=' ' formdlim=""; proc printto print="&FOLDER\LineLists.txt"; proc sort data=testcoding; by linelist edcode age; proc print data=TESTCODING; by linelist; var date edcode cc age sex zip; where linelist ne ' '; format edcode $3.; title 'Line-list of patients with anthrax, plague, smallpox or poisoning prodromes'; run; proc printto; proc print data=TESTCODING; by linelist; var date edcode cc age sex zip; where linelist ne ' '; format edcode $3.; title 'Line-list of patients with anthrax, plague, smallpox or poisoning prodromes'; run; * Save linelists to permanent files; options noxwait; x "cd &FOLDER\"; x "copy LineLists.txt c:\temp\LineLists20Oct03.txt";