Hi,
I am having a hard time to extract text.
Here is the sample create & insert statements.
Create table x (a varchar2(4000));
Insert into x values ('CT head neg (-) Pt reportedly has 20-39% stenosis of carotid arteries. EKG NSR@70bpm, Trop (-) x2 Unlikely to be cardiac in etiology. Likely ');
Insert into x values ('Midbrain lacunar CVA+L 40-59% carotid stenosis+TIA 6/2010 (finished Stein sr center outpt PT+pt reports improving word finding. Did reschedule fu outpt PT');
Insert into x values ('Repeat Carotid Dopplers 12/12: <20% stenosis b/l at the bifurcation TTE 10/2014: EF 49% TEE: 12/15 EF 35% and fibroelastic lesion of the aortic valve EEG');
CREATE /*+ parallel(x 32) */ index x_idx on x (a) indextype
is ctxsys.context parameters ('stoplist ctxsys.empty_stoplist')
parallel 32
The o/p needed
So, effectively, the output should search for term " "stenosis" and ( "carotid" or "%") within 5 words & pick up the range mentioned before or after term stenosis which will be followed or preceeded within 2/3 words mostly.
The code which I started is :
Select --+ parallel(t 32)
a
from x
where contains(a, 'near((stenosis,carotid={%}), 5)') > 0