Skip to content

Commit d0ea4fc

Browse files
authored
Table Consult's schema changed.
1 parent 10a7a0b commit d0ea4fc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Fobt.sql

+4-2
Original file line numberDiff line numberDiff line change
@@ -3055,8 +3055,8 @@ if (OBJECT_ID('tempdb.dbo.#FOBT_Sta3n528_5_Exc_NonDx_9_VisitTIUConsult_joinByCon
30553055

30563056
select v.*
30573057
,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,
30603060
c.requestType, -- weather the request is a consult or procedure
30613061
c.[InpatOutpat], -- the ordering person to indicate if the service is to be rendered on an outpatient or Inpatients basis.
30623062
c.[RemoteService],
@@ -3066,6 +3066,8 @@ if (OBJECT_ID('tempdb.dbo.#FOBT_Sta3n528_5_Exc_NonDx_9_VisitTIUConsult_joinByCon
30663066
left join [CDWWork].[Con].[Consult] as C --altered (ORD_...Src)
30673067
on C.ConsultSID=V.ConsultSID --and CohortName='Cohort20180712'
30683068
and C.Sta3n=V.Sta3n
3069+
left join cdwwork.dim.RequestService as rs
3070+
on c.ToRequestServiceSID=rs.RequestServiceSID and c.Sta3n=rs.sta3n
30693071
--more filter
30703072
--and C.[requestDateTime] between dateAdd(yy,-1,(select sp_start from #FOBT_Sta3n528_0_1_inputP)) --altered (ORD_...Dflt) --altered (temp table)
30713073
-- and DateAdd(dd,(select fu_period from #FOBT_Sta3n528_0_1_inputP) --altered (ORD_...Dflt) --altered (temp table)

0 commit comments

Comments
 (0)