File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -3055,8 +3055,8 @@ if (OBJECT_ID('tempdb.dbo.#FOBT_Sta3n528_5_Exc_NonDx_9_VisitTIUConsult_joinByCon
3055
3055
3056
3056
select v.*
3057
3057
,c .requestDateTime as ReferralRequestDateTime,c .OrderStatusSID as ConsultOrderStatusSID,
3058
- c .ToRequestserviceSID as ConsultToRequestserviceSID,c . ToRequestserviceName as ConsultToRequestserviceName,
3059
- c .placeofconsultation ,
3058
+ c .ToRequestserviceSID as ConsultToRequestserviceSID,rs . ServiceName as ConsultToRequestserviceName,
3059
+ -- c.placeofconsultation,
3060
3060
c .requestType , -- weather the request is a consult or procedure
3061
3061
c.[InpatOutpat], -- the ordering person to indicate if the service is to be rendered on an outpatient or Inpatients basis.
3062
3062
c.[RemoteService],
@@ -3066,6 +3066,8 @@ if (OBJECT_ID('tempdb.dbo.#FOBT_Sta3n528_5_Exc_NonDx_9_VisitTIUConsult_joinByCon
3066
3066
left join [CDWWork].[Con].[Consult] as C -- altered (ORD_...Src)
3067
3067
on C .ConsultSID = V .ConsultSID -- and CohortName='Cohort20180712'
3068
3068
and C .Sta3n = V .Sta3n
3069
+ left join cdwwork .dim .RequestService as rs
3070
+ on c .ToRequestServiceSID = rs .RequestServiceSID and c .Sta3n = rs .sta3n
3069
3071
-- more filter
3070
3072
-- and C.[requestDateTime] between dateAdd(yy,-1,(select sp_start from #FOBT_Sta3n528_0_1_inputP)) --altered (ORD_...Dflt) --altered (temp table)
3071
3073
-- and DateAdd(dd,(select fu_period from #FOBT_Sta3n528_0_1_inputP) --altered (ORD_...Dflt) --altered (temp table)
You can’t perform that action at this time.
0 commit comments