device_source_value

SUS AE Device Exposure

  • Value copied from AccidentAndEmergencyInvestigation

  • AccidentAndEmergencyInvestigation A broad coding of types of investigation which may be requested to assist with diagnosis as a result of Accident and Emergency Attendances. ACCIDENT AND EMERGENCY INVESTIGATION

	select
		ae.AEAttendanceNumber,
		ae.NHSNumber,
		coalesce(ae.ArrivalDate, ae.CDSActivityDate) as StartDate,
		coalesce(ae.ArrivalTime, '000000') as StartTime,
		coalesce(ae.AEDepartureDate, ae.AEAttendanceConclusionDate) as EndDate,
		coalesce(ae.AEDepartureTime, ae.AEAttendanceConclusionTime, '000000') as EndTime,
		i.AccidentAndEmergencyInvestigation
	from omop_staging.sus_AE_investigation i
		inner join omop_staging.sus_AE ae
			on i.MessageId = ae.MessageId
	where ae.NHSNumber is not null
	and i.AccidentAndEmergencyInvestigation in ('01', '02', '08', '09', '10', '11', '12', '19')
	

Comment or raise an issue for this mapping.