File tree Expand file tree Collapse file tree 1 file changed +16
-18
lines changed
OmopTransformer/RTDS/VisitOccurrence Expand file tree Collapse file tree 1 file changed +16
-18
lines changed Original file line number Diff line number Diff line change 11<Query >
22 <Sql >
3-
4- with results as (
5- select
6- distinct
7- (select top 1 PatientId from omop_staging.rtds_1_demographics b where b.PatientSer = a.PatientSer) as PatientId,
8- a.start_date as event_start_date,
9- a.end_date as event_end_date
10- from omop_staging.rtds_2b_plan a
11- )
12- select
13- PatientId,
14- event_start_date,
15- event_end_date
16- from results
17- where
18- PatientId is not null
19- and regexp_matches(PatientId, '\d{10}');
20-
3+ with results as (
4+ select
5+ distinct
6+ (select PatientId from omop_staging.rtds_1_demographics d where d.PatientSer = a.PatientSer limit 1) as NhsNumber,
7+ a.start_date as event_start_date,
8+ a.end_date as event_end_date
9+ from omop_staging.rtds_2b_plan a
10+ )
11+ select
12+ NhsNumber,
13+ event_start_date,
14+ event_end_date
15+ from results
16+ where
17+ NhsNumber is not null
18+ and regexp_matches(NhsNumber, '\d{10}');
2119 </Sql >
2220 <Explanations >
2321 <Explanation columnName =" PatientId" >
You can’t perform that action at this time.
0 commit comments