observation_source_concept_id
SUS Outpatient Procedure Observation
Source column PrimaryProcedure. Resolve OPCS4 codes to OMOP concepts. If code cannot be mapped, map using the parent code.
PrimaryProcedureOPCS-4 Procedure code. PROCEDURE (OPCS)
with results as
(
select
distinct
op.GeneratedRecordIdentifier,
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')
)
select *
from results
order by
GeneratedRecordIdentifier,
NHSNumber,
AppointmentDate,
AppointmentTime,
PrimaryProcedure
Comment or raise an issue for this mapping.
Sus OP ICDDiagnosis table
Source column DiagnosisICD. Resolve ICD10 codes to standard or non standard OMOP concepts. If code cannot be mapped, map using the parent code.
DiagnosisICDICD10 diagnosis code PRIMARY DIAGNOSIS (ICD)
select
distinct
d.DiagnosisICD,
op.GeneratedRecordIdentifier,
op.NHSNumber,
op.CDSActivityDate
from omop_staging.sus_OP_ICDDiagnosis d
inner join omop_staging.sus_OP op
on d.MessageId = op.MessageId
where op.NHSNumber is not null
and AttendedorDidNotAttend in ('5','6')
Comment or raise an issue for this mapping.
Sus CCMDS High Cost Drugs
Source column ObservationSourceValue. Resolve OPCS4 codes to OMOP concepts. If code cannot be mapped, map using the parent code.
ObservationSourceValueHigh cost drugs. HIGH COST DRUGS (OPCS)
select distinct
apc.NHSNumber,
apc.HospitalProviderSpellNumber,
cc.CriticalCareStartDate as ObservationDate,
coalesce(cc.CriticalCareStartTime, '00:00:00') as ObservationDateTime,
d.CriticalCareHighCostDrugs as ObservationSourceValue
from omop_staging.sus_CCMDS_CriticalCareHighCostDrugs 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
Comment or raise an issue for this mapping.
SUS APC Procedure Occurrence
Source column PrimaryProcedure. Resolve OPCS4 codes to OMOP concepts. If code cannot be mapped, map using the parent code.
PrimaryProcedureOPCS-4 Procedure code. PROCEDURE (OPCS)
select
distinct
apc.GeneratedRecordIdentifier,
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
order by
apc.GeneratedRecordIdentifier,
apc.NHSNumber,
p.ProcedureDateOPCS,
p.ProcedureOPCS
Comment or raise an issue for this mapping.
Sus APC Diagnosis Table
Source column DiagnosisICD. Resolve ICD10 codes to standard or non standard OMOP concepts. If code cannot be mapped, map using the parent code.
DiagnosisICDICD10 diagnosis code PRIMARY DIAGNOSIS (ICD)
select
distinct
d.DiagnosisICD,
apc.GeneratedRecordIdentifier,
apc.NHSNumber,
apc.CDSActivityDate
from omop_staging.sus_ICDDiagnosis d
inner join omop_staging.sus_APC apc
on d.MessageId = apc.MessageId
where apc.NHSNumber is not null
order by
d.DiagnosisICD,
apc.GeneratedRecordIdentifier,
apc.NHSNumber,
apc.CDSActivityDate
Comment or raise an issue for this mapping.
SUS APC Anaesthetic Given Post Labour Delivery Observation
- Constant value set to
2000500002. ANAESTHETIC GIVEN POST LABOUR OR DELIVERY CODE
Comment or raise an issue for this mapping.
SUS APC Anaesthetic During Labour Delivery Observation
- Constant value set to
2000500001. ANAESTHETIC GIVEN DURING LABOUR OR DELIVERY CODE
Comment or raise an issue for this mapping.
SNOMED CT procedures mapped to Observation from databricks_procedures.parquet.
Source column concept_code. Resolve Snomed codes to OMOP concepts.
concept_codeTrimmed SNOMED CT code. Only resolved Observation-domain targets are retained.
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 Observation from databricks_procedures.parquet.
Source column concept_code. Resolve OPCS4 codes to OMOP concepts. If code cannot be mapped, map using the parent code.
concept_codeUppercase, trimmed OPCS4 code with dots removed. Only resolved Observation-domain targets are retained.
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.
SNOMED CT diagnoses, including UK ED Subset, mapped to Observation from databricks_diagnosis.parquet.
Source column concept_code. Resolve Snomed codes to OMOP concepts.
concept_codeTrimmed SNOMED CT code. Includes SNOMED CT and UK ED Subset source vocabularies. Only Observation-domain targets are retained.
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.
ICD-10 and ICD10 diagnoses mapped to Observation from databricks_diagnosis.parquet.
Source column concept_code. Resolve ICD10 codes to standard or non standard OMOP concepts. If code cannot be mapped, map using the parent code.
concept_codeUppercase, trimmed ICD10 code. Codes shorter than three characters are passed as null to the existing resolver. Only resolved Observation-domain targets are retained.
select
patient_identifier_value,
diagnosis_date,
diagnosis_datetime,
diagnosis_code,
case when length(trim(diagnosis_code)) >= 3 then upper(trim(diagnosis_code)) end as concept_code
from ##duckdb_source##
where upper(trim(diagnosis_code_system)) in ('ICD-10', 'ICD10')
order by diagnosis_id, warehouse_identifier
Comment or raise an issue for this mapping.
CosdV9FamilialCancerSyndromeSubsidiaryComment
- Constant value set to
2000500006. Familial Cancer (Comment)
Comment or raise an issue for this mapping.
CosdV9BreastFamilialCancerSyndromeSubsidiaryComment
- Constant value set to
2000500006. Familial Cancer (Comment)