nhs_number

SUS OP Device Exposure

  • Value copied from NHSNumber

  • NHSNumber Patient NHS Number NHS NUMBER

	select
		distinct
		op.SUSgeneratedspellID,
		op.NHSNumber,
		op.AppointmentDate,
		op.AppointmentTime,
		p.ProcedureOPCS as PrimaryProcedure
	from omop_staging.sus_OP op
		inner join omop_staging.sus_OP_OPCSProcedure p
		on op.MessageId = p.MessageId
	where NHSNumber is not null
		and AttendedorDidNotAttend in ('5','6')
	

Comment or raise an issue for this mapping.

SUS CCMDS Device Exposure

  • Value copied from NHSNumber

  • NHSNumber Patient NHS Number NHS NUMBER

		select distinct
				apc.NHSNumber,
				apc.HospitalProviderSpellNumber,
				cc.CriticalCareStartDate as DeviceExposureStartDate,
				coalesce(cc.CriticalCareStartTime, '00:00:00') as DeviceExposureStartTime,
				coalesce(cc.CriticalCarePeriodDischargeDate, cc.EventDate) as DeviceExposureEndDate,
				coalesce(cc.CriticalCarePeriodDischargeTime, '00:00:00') as DeviceExposureEndTime,
				d.CriticalCareActivityCode as CriticalCareActivityCode
		from omop_staging.sus_CCMDS_CriticalCareActivityCode d
		inner join omop_staging.sus_CCMDS cc on d.MessageId = cc.MessageId
		inner join omop_staging.sus_APC apc on cc.GeneratedRecordID = apc.GeneratedRecordIdentifier
		where apc.NHSNumber is not null
		and d.CriticalCareActivityCode not in('3','4','6','8','10','12','15','21','22','23','24','25','27','28','29','50','57','58','64','65','66','67','68','69','70','71','72','74','82','83','87','99')

	

Comment or raise an issue for this mapping.

SUS APC Procedure Occurrence

  • Value copied from NHSNumber

  • NHSNumber Patient NHS Number NHS NUMBER

select
	distinct
		apc.HospitalProviderSpellNumber,
		apc.NHSNumber,
		p.ProcedureDateOPCS as PrimaryProcedureDate,
		p.ProcedureOPCS as PrimaryProcedure
from omop_staging.sus_APC apc
	inner join omop_staging.sus_OPCSProcedure p
		on apc.MessageId = p.MessageId
where NHSNumber is not null
	

Comment or raise an issue for this mapping.

SUS AE Procedure Device Exposure

  • Value copied from NHSNumber

  • NHSNumber Patient NHS Number NHS NUMBER

	select
		distinct
			ae.AEAttendanceNumber,
			ae.NHSNumber,
			ae.CDSActivityDate as PrimaryProcedureDate,
			p.AccidentAndEmergencyTreatment as PrimaryProcedure
	from omop_staging.sus_AE ae
		inner join omop_staging.sus_AE_treatment p
			on AE.MessageId = p.MessageId
	where NHSNumber is not null
	

Comment or raise an issue for this mapping.

SUS AE Investigation Device Exposure

  • Value copied from NHSNumber

  • NHSNumber Patient NHS Number NHS NUMBER

	select
		distinct
		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.

SNOMED CT procedures mapped to Device Exposure from databricks_procedures.parquet.

  • Value copied from patient_identifier_value

  • patient_identifier_value Patient NHS number, used to join existing OMOP Person records.

select
    patient_identifier_value,
    clinical_date,
    clinical_datetime,
    clinical_code,
    trim(clinical_code) as concept_code
from ##duckdb_source##
where upper(trim(clinical_code_system)) = 'SNOMED CT'
order by all

Comment or raise an issue for this mapping.

OPCS4 procedures mapped to Device Exposure from databricks_procedures.parquet.

  • Value copied from patient_identifier_value

  • patient_identifier_value Patient NHS number, used to join existing OMOP Person records.

select
    patient_identifier_value,
    clinical_date,
    clinical_datetime,
    clinical_code,
    replace(upper(trim(clinical_code)), '.', '') as concept_code
from ##duckdb_source##
where upper(trim(clinical_code_system)) = 'OPCS4'
order by all

Comment or raise an issue for this mapping.

Oxford Device Exposure

  • Value copied from NHSNumber

  • NHSNumber Patient NHS Number NHS NUMBER

select
	distinct
		d.NHSNumber,
		e.EventDate,
		e.SuppliedCode
from omop_staging.oxford_gp_event e
	inner join omop_staging.oxford_gp_demographic d
		on e.PatientIdentifier = d.PatientIdentifier
order by
	d.NHSNumber,
	e.EventDate,
	e.SuppliedCode
	

Comment or raise an issue for this mapping.

SNOMED CT diagnoses, including UK ED Subset, mapped to Device Exposure from databricks_diagnosis.parquet.

  • Value copied from patient_identifier_value

  • patient_identifier_value Patient NHS number, used to join existing OMOP Person records.

select
    patient_identifier_value,
    diagnosis_date,
    diagnosis_datetime,
    diagnosis_code,
    trim(diagnosis_code) as concept_code
from ##duckdb_source##
where upper(trim(diagnosis_code_system)) = 'SNOMED CT'
order by diagnosis_id, warehouse_identifier

Comment or raise an issue for this mapping.