** SAS Code for Service Types, Physician Visits ; ** Definition attributed to Pat Nicol. ; servtype='00'; substr(servtype,2,1)=translate(put(tarpref,$1.),'8070969050','0123456789'); if patprac='21' then servtype='10'; else if '23'<=patprac<='25' | patprac='30' then servtype='11'; else if patprac='18' | patprac='29' then servtype='12'; else if tarpref='7' then do; if '8500'<=tariff<='8599' then do; servtype='01'; if bpblocs='053' | (substr(bpblocs,1,2)='05' & 3807<=md<=3906) then servtype='03'; else if '8505'<=tariff<='8506' then servtype='04'; else if '8550'<=tariff<='8559' then servtype='02'; *** see note below re consults end; end; Servtype -------- 00 01 Non-Consultative visits 02 Consultative visits (see update) 03 Optomitrist visits 04 Chiropractic visits 05 Pathology/Laboratory 06 X-ray/radiology 07 Surgery 08 Surgical Assistance 09 Anaesthetic, Anaesthesia assistance 10 Heart Tracing "ECG" 11 Allergy Care, Injection, Immunization, Lab smear 12 other tests and exams (including X-ray radium)