I am having trouble understanding PRx.
I have data where most of the information is written in the "notes section" in files in different ways.
I am locating, when patients were tested with for Hep B, and the result of the test,
the text string can be something like this:
"Chronic viral hepatitis B, asymptomatic. Positive HBS-Ag test is detected for are first time."
"hep B infection, check for symptoms, hep B positive check if symtomatic"
"HBS-Ag was negative (6/6/2020)"
"HEPATITIS B AG (11/14/08) NON REACTIVE"
"HBsAg analysis done on 30-JUN-11:N"
I have only located where Hep B is mentioned with this type of SAS code:
data program.new;
set sheet.new;
if index(upcase(CongestiveHeartFailure), 'HEP C') then hepcheck = 0;
Else if index(upcase(CongestiveHeartFailure), 'HEPATITIS C') then hepcheck = 0;
else if index(upcase(CongestiveHeartFailure), 'HEP') then Hepcheck = 1 ;
else if index(upcase(CongestiveHeartFailure), 'HBSAG') then HEpCheck = 1;
else if index(upcase(CongestiveHeartFailure), 'HBV') then HEpCheck = 1;
Else if index(upcase(MedicalHistoryRemarks), 'HEP C') then hepcheck =0;
Else if index(upcase(MedicalHistoryRemarks), 'HEPATITIS c') then hepcheck =1;
else if index(upcase(MedicalHistoryRemarks), 'HEP') then Hepcheck = 1;
else if index(upcase(MedicalHistoryRemarks), 'HBSAG') then HepCheck = 1;
else if index(upcase(MedicalHistoryRemarks), 'HBV') then HEpCheck = 1;
else Hepcheck = 0;
if hepcheck = 0 then delete;
keep hepcheck MedicalHistoryRemarks CongestiveHeartFailure ;
run;
but I am trying to extract and quantify the information that I mentioned above into "checked for Hep B" "test result" "date" "follow up" and to coincide with the patient ID number.
I am having trouble with Prx and I was hoping someone could help.
thank you!