condition_source_value
SUS Outpatient Condition Occurrence
-
Value copied from
DiagnosisICD -
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')
order by
d.DiagnosisICD,
op.GeneratedRecordIdentifier,
op.NHSNumber,
op.CDSActivityDate
Comment or raise an issue for this mapping.
SUS Inpatient Condition Occurrence
-
Value copied from
DiagnosisICD -
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.
SACT Condition Occurrence
-
Value copied from
Primary_Diagnosis -
Primary_DiagnosisPRIMARY DIAGNOSIS (ICD AT START SYSTEMIC ANTI-CANCER THERAPY) is the PRIMARY DIAGNOSIS (ICD) at the start of the Systemic Anti-Cancer Therapy. PRIMARY DIAGNOSIS (ICD AT START SYSTEMIC ANTI-CANCER THERAPY)
select
Primary_Diagnosis,
replace(NHS_Number, ' ', '') as NHS_Number,
min(Administration_Date) as Administration_Date
from omop_staging.sact_staging
group by
Primary_Diagnosis,
NHS_Number
order by
NHS_Number,
Primary_Diagnosis,
min(Administration_Date)
Comment or raise an issue for this mapping.
Rtds Condition Occurrence
with results as (
select
distinct
(select PatientId from omop_staging.rtds_1_demographics d where d.PatientSer = dc.PatientSer limit 1) as PatientId,
dc.DiagnosisCode,
dc.DateStamp as event_start_date,
dc.DateStamp as event_end_date
from omop_staging.RTDS_5_Diagnosis_Course dc
where dc.DiagnosisTableName = 'ICD-10'
)
select
PatientId,
DiagnosisCode,
event_start_date,
event_end_date
from results
where
PatientId is not null
and regexp_matches(patientid, '\d{10}');
Comment or raise an issue for this mapping.
COSD V9 UR Condition Occurrence Secondary Diagnosis ICD
-
Value copied from
SecondaryDiagnosisIcd -
SecondaryDiagnosisIcdICD code used to identify the secondary patient diagnosis. Same as the CLINICAL CLASSIFICATION CODE attribute. For Healthcare Operational Data Flows (Acute), this is the next most relevant patient diagnosis. SECONDARY DIAGNOSIS (ICD)
with ur as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed'
as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.Diagnosis.DiagnosisAdditionalItems.SecondaryDiagnosisIcd.@code'
as SecondaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'UR'
)
select distinct
NhsNumber,
DateOfPrimaryDiagnosisClinicallyAgreed,
SecondaryDiagnosisIcd
from ur
where NhsNumber is not null
and SecondaryDiagnosisIcd is not null
and DateOfPrimaryDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 UR Condition Occurrence Primary Diagnosis ICD
-
Value copied from
PrimaryDiagnosisIcd -
PrimaryDiagnosisIcdICD code used to identify the primary patient diagnosis. Same as the CLINICAL CLASSIFICATION CODE attribute. For Healthcare Operational Data Flows (Acute), this is the main patient diagnosis. PRIMARY DIAGNOSIS (ICD)
with ur as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed'
as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.PrimaryDiagnosisIcd.@code'
as PrimaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'UR'
)
select distinct
NhsNumber,
DateOfPrimaryDiagnosisClinicallyAgreed,
PrimaryDiagnosisIcd
from ur
where NhsNumber is not null
and PrimaryDiagnosisIcd is not null
and DateOfPrimaryDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 UR Condition Occurrence Original Primary Diagnosis ICD
-
Value copied from
OriginalPrimaryDiagnosisIcd -
OriginalPrimaryDiagnosisIcdICD code used to identify the original primary diagnosis. For COSDS Core, used for cancer recurrence and agreed at the multidisciplinary team meeting by the care professional team. PRIMARY DIAGNOSIS (ICD ORIGINAL)
with ur as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.NonPrimaryPathway.Recurrence.OriginalPrimaryDiagnosisIcd.@code'
as OriginalPrimaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'UR'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
OriginalPrimaryDiagnosisIcd
from ur
where NhsNumber is not null
and OriginalPrimaryDiagnosisIcd is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 UR Condition Occurrence Cancer Progression ICD
-
Value copied from
ProgressionIcd -
ProgressionIcdThe International Classification of Diseases (ICD) code of the cancer progression during a Cancer Care Spell. For COSD - Core, this is the ICD code of the original patient diagnosis of the cancer progression, agreed at the multidisciplinary team meeting by the care professional team. CANCER PROGRESSION (ICD ORIGINAL)
with ur as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.NonPrimaryPathway.Progression.ProgressionIcd.@code'
as ProgressionIcd
from omop_staging.cosd_staging_901
where type = 'UR'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
ProgressionIcd
from ur
where NhsNumber is not null
and ProgressionIcd is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V8 UR Condition Occurrence Primary Diagnosis ICD
-
Value copied from
PrimaryDiagnosis -
PrimaryDiagnosisICD code used to identify the primary patient diagnosis. Same as the CLINICAL CLASSIFICATION CODE attribute. For Healthcare Operational Data Flows (Acute), this is the main patient diagnosis. PRIMARY DIAGNOSIS (ICD)
with ur as (
select distinct
Record ->> '$.Urological.UrologicalCore.UrologicalCoreLinkagePatientId.NHSNumber.@extension'
as NhsNumber,
Record ->> '$.Urological.UrologicalCore.UrologicalCoreLinkageDiagnosticDetails.ClinicalDateCancerDiagnosis'
as ClinicalDateCancerDiagnosis,
Record ->> '$.Urological.UrologicalCore.UrologicalCoreLinkageDiagnosticDetails.PrimaryDiagnosis.@code'
as PrimaryDiagnosis
from omop_staging.cosd_staging_81
where type = 'UR'
)
select distinct
NhsNumber,
ClinicalDateCancerDiagnosis,
PrimaryDiagnosis
from ur
where NhsNumber is not null
and PrimaryDiagnosis is not null
and ClinicalDateCancerDiagnosis is not null;
Comment or raise an issue for this mapping.
COSD V8 UR Condition Occurrence Cancer Progression ICD
-
Value copied from
CancerProgressionICD -
CancerProgressionICDThe International Classification of Diseases (ICD) code of the cancer progression during a Cancer Care Spell. For COSD - Core, this is the ICD code of the original patient diagnosis of the cancer progression, agreed at the multidisciplinary team meeting by the care professional team. CANCER PROGRESSION (ICD ORIGINAL)
with ur as (
select distinct
Record ->> '$.Urological.UrologicalCore.UrologicalCoreLinkagePatientId.NHSNumber.@extension'
as NhsNumber,
Record ->> '$.Urological.UrologicalCore.UrologicalCoreLinkageDiagnosticDetails.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.Urological.UrologicalCore.UrologicalCoreNonPrimaryCancerPathwayRoute.CancerProgressionICD.@code'
as CancerProgressionICD
from omop_staging.cosd_staging_81
where type = 'UR'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
CancerProgressionICD
from ur
where NhsNumber is not null
and CancerProgressionICD is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 UG Condition Occurrence Secondary Diagnosis ICD
-
Value copied from
SecondaryDiagnosisIcd -
SecondaryDiagnosisIcdICD code used to identify the secondary patient diagnosis. Same as the CLINICAL CLASSIFICATION CODE attribute. For Healthcare Operational Data Flows (Acute), this is the next most relevant patient diagnosis. SECONDARY DIAGNOSIS (ICD)
with ug as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed'
as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.Diagnosis.DiagnosisAdditionalItems.SecondaryDiagnosisIcd.@code'
as SecondaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'UG'
)
select distinct
NhsNumber,
DateOfPrimaryDiagnosisClinicallyAgreed,
SecondaryDiagnosisIcd
from ug
where NhsNumber is not null
and SecondaryDiagnosisIcd is not null
and DateOfPrimaryDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 UG Condition Occurrence Primary Diagnosis ICD
-
Value copied from
PrimaryDiagnosisIcd -
PrimaryDiagnosisIcdICD code used to identify the primary patient diagnosis. Same as the CLINICAL CLASSIFICATION CODE attribute. For Healthcare Operational Data Flows (Acute), this is the main patient diagnosis. PRIMARY DIAGNOSIS (ICD)
with ug as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed'
as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.PrimaryDiagnosisIcd.@code'
as PrimaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'UG'
)
select distinct
NhsNumber,
DateOfPrimaryDiagnosisClinicallyAgreed,
PrimaryDiagnosisIcd
from ug
where NhsNumber is not null
and PrimaryDiagnosisIcd is not null
and DateOfPrimaryDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 UG Condition Occurrence Original Primary Diagnosis ICD
-
Value copied from
OriginalPrimaryDiagnosisIcd -
OriginalPrimaryDiagnosisIcdICD code used to identify the original primary diagnosis. For COSDS Core, used for cancer recurrence and agreed at the multidisciplinary team meeting by the care professional team. PRIMARY DIAGNOSIS (ICD ORIGINAL)
with ug as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.NonPrimaryPathway.Recurrence.OriginalPrimaryDiagnosisIcd.@code'
as OriginalPrimaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'UG'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
OriginalPrimaryDiagnosisIcd
from ug
where NhsNumber is not null
and OriginalPrimaryDiagnosisIcd is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 UG Condition Occurrence Cancer Progression ICD
-
Value copied from
ProgressionIcd -
ProgressionIcdThe International Classification of Diseases (ICD) code of the cancer progression during a Cancer Care Spell. For COSD - Core, this is the ICD code of the original patient diagnosis of the cancer progression, agreed at the multidisciplinary team meeting by the care professional team. CANCER PROGRESSION (ICD ORIGINAL)
with ug as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.NonPrimaryPathway.Progression.ProgressionIcd.@code'
as ProgressionIcd
from omop_staging.cosd_staging_901
where type = 'UG'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
ProgressionIcd
from ug
where NhsNumber is not null
and ProgressionIcd is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V8 UG Condition Occurrence Primary Diagnosis ICD
-
Value copied from
PrimaryDiagnosis -
PrimaryDiagnosisICD code used to identify the primary patient diagnosis. Same as the CLINICAL CLASSIFICATION CODE attribute. For Healthcare Operational Data Flows (Acute), this is the main patient diagnosis. PRIMARY DIAGNOSIS (ICD)
with ug as (
select distinct
Record ->> '$.UpperGI.UpperGICore.UpperGICoreLinkagePatientId.NHSNumber.@extension'
as NhsNumber,
Record ->> '$.UpperGI.UpperGICore.UpperGICoreLinkageDiagnosticDetails.ClinicalDateCancerDiagnosis'
as ClinicalDateCancerDiagnosis,
Record ->> '$.UpperGI.UpperGICore.UpperGICoreLinkageDiagnosticDetails.PrimaryDiagnosis.@code'
as PrimaryDiagnosis
from omop_staging.cosd_staging_81
where type = 'UG'
)
select distinct
NhsNumber,
ClinicalDateCancerDiagnosis,
PrimaryDiagnosis
from ug
where NhsNumber is not null
and PrimaryDiagnosis is not null
and ClinicalDateCancerDiagnosis is not null;
Comment or raise an issue for this mapping.
COSD V8 UG Condition Occurrence Cancer Progression ICD
-
Value copied from
CancerProgressionICD -
CancerProgressionICDThe International Classification of Diseases (ICD) code of the cancer progression during a Cancer Care Spell. For COSD - Core, this is the ICD code of the original patient diagnosis of the cancer progression, agreed at the multidisciplinary team meeting by the care professional team. CANCER PROGRESSION (ICD ORIGINAL)
with ug as (
select distinct
Record ->> '$.UpperGI.UpperGICore.UpperGICoreLinkagePatientId.NHSNumber.@extension'
as NhsNumber,
Record ->> '$.UpperGI.UpperGICore.UpperGICoreLinkageDiagnosticDetails.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.UpperGI.UpperGICore.UpperGICoreNonPrimaryCancerPathwayRoute.CancerProgressionICD.@code'
as CancerProgressionICD
from omop_staging.cosd_staging_81
where type = 'UG'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
CancerProgressionICD
from ug
where NhsNumber is not null
and CancerProgressionICD is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 SK Condition Occurrence Secondary Diagnosis ICD
-
Value copied from
SecondaryDiagnosisIcd -
SecondaryDiagnosisIcdICD code used to identify the secondary patient diagnosis. Same as the CLINICAL CLASSIFICATION CODE attribute. For Healthcare Operational Data Flows (Acute), this is the next most relevant patient diagnosis. SECONDARY DIAGNOSIS (ICD)
with sk as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed'
as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.Diagnosis.DiagnosisAdditionalItems.SecondaryDiagnosisIcd.@code'
as SecondaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'SK'
)
select distinct
NhsNumber,
DateOfPrimaryDiagnosisClinicallyAgreed,
SecondaryDiagnosisIcd
from sk
where NhsNumber is not null
and SecondaryDiagnosisIcd is not null
and DateOfPrimaryDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 SK Condition Occurrence Primary Diagnosis ICD
-
Value copied from
PrimaryDiagnosisIcd -
PrimaryDiagnosisIcdICD code used to identify the primary patient diagnosis. Same as the CLINICAL CLASSIFICATION CODE attribute. For Healthcare Operational Data Flows (Acute), this is the main patient diagnosis. PRIMARY DIAGNOSIS (ICD)
with sk as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed'
as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.PrimaryDiagnosisIcd.@code'
as PrimaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'SK'
)
select distinct
NhsNumber,
DateOfPrimaryDiagnosisClinicallyAgreed,
PrimaryDiagnosisIcd
from sk
where NhsNumber is not null
and PrimaryDiagnosisIcd is not null
and DateOfPrimaryDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 SK Condition Occurrence Original Primary Diagnosis ICD
-
Value copied from
OriginalPrimaryDiagnosisIcd -
OriginalPrimaryDiagnosisIcdICD code used to identify the original primary diagnosis. For COSDS Core, used for cancer recurrence and agreed at the multidisciplinary team meeting by the care professional team. PRIMARY DIAGNOSIS (ICD ORIGINAL)
with sk as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.NonPrimaryPathway.Recurrence.OriginalPrimaryDiagnosisIcd.@code'
as OriginalPrimaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'SK'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
OriginalPrimaryDiagnosisIcd
from sk
where NhsNumber is not null
and OriginalPrimaryDiagnosisIcd is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 SK Condition Occurrence Cancer Progression ICD
-
Value copied from
ProgressionIcd -
ProgressionIcdThe International Classification of Diseases (ICD) code of the cancer progression during a Cancer Care Spell. For COSD - Core, this is the ICD code of the original patient diagnosis of the cancer progression, agreed at the multidisciplinary team meeting by the care professional team. CANCER PROGRESSION (ICD ORIGINAL)
with sk as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.NonPrimaryPathway.Progression.ProgressionIcd.@code'
as ProgressionIcd
from omop_staging.cosd_staging_901
where type = 'SK'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
ProgressionIcd
from sk
where NhsNumber is not null
and ProgressionIcd is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V8 SK Condition Occurrence Secondary Diagnosis ICD
-
Value copied from
SecondaryDiagnosisICD -
SecondaryDiagnosisICDICD code used to identify the secondary patient diagnosis. Same as the CLINICAL CLASSIFICATION CODE attribute. For Healthcare Operational Data Flows (Acute), this is the next most relevant patient diagnosis. SECONDARY DIAGNOSIS (ICD)
with sk as (
select distinct
Record ->> '$.Skin.SkinCore.SkinCoreLinkagePatientId.NHSNumber.@extension'
as NhsNumber,
Record ->> '$.Skin.SkinCore.SkinCoreLinkageDiagnosticDetails.ClinicalDateCancerDiagnosis'
as ClinicalDateCancerDiagnosis,
Record ->> '$.Skin.SkinCore.SkinCoreDiagnosis.SkinCoreDiagnosisAdditionalItems.SecondaryDiagnosisICD.@code'
as SecondaryDiagnosisICD
from omop_staging.cosd_staging_81
where type = 'SK'
)
select distinct
NhsNumber,
ClinicalDateCancerDiagnosis,
SecondaryDiagnosisICD
from sk
where NhsNumber is not null
and SecondaryDiagnosisICD is not null
and ClinicalDateCancerDiagnosis is not null;
Comment or raise an issue for this mapping.
COSD V8 SK Condition Occurrence Primary Diagnosis ICD
-
Value copied from
PrimaryDiagnosis -
PrimaryDiagnosisICD code used to identify the primary patient diagnosis. Same as the CLINICAL CLASSIFICATION CODE attribute. For Healthcare Operational Data Flows (Acute), this is the main patient diagnosis. PRIMARY DIAGNOSIS (ICD)
with sk as (
select distinct
Record ->> '$.Skin.SkinCore.SkinCoreLinkagePatientId.NHSNumber.@extension'
as NhsNumber,
Record ->> '$.Skin.SkinCore.SkinCoreLinkageDiagnosticDetails.ClinicalDateCancerDiagnosis'
as ClinicalDateCancerDiagnosis,
Record ->> '$.Skin.SkinCore.SkinCoreLinkageDiagnosticDetails.PrimaryDiagnosis.@code'
as PrimaryDiagnosis
from omop_staging.cosd_staging_81
where type = 'SK'
)
select distinct
NhsNumber,
ClinicalDateCancerDiagnosis,
PrimaryDiagnosis
from sk
where NhsNumber is not null
and PrimaryDiagnosis is not null
and ClinicalDateCancerDiagnosis is not null;
Comment or raise an issue for this mapping.
COSD V8 SK Condition Occurrence Cancer Progression ICD
-
Value copied from
CancerProgressionICD -
CancerProgressionICDThe International Classification of Diseases (ICD) code of the cancer progression during a Cancer Care Spell. For COSD - Core, this is the ICD code of the original patient diagnosis of the cancer progression, agreed at the multidisciplinary team meeting by the care professional team. CANCER PROGRESSION (ICD ORIGINAL)
with sk as (
select distinct
Record ->> '$.Skin.SkinCore.SkinCoreLinkagePatientId.NHSNumber.@extension'
as NhsNumber,
Record ->> '$.Skin.SkinCore.SkinCoreLinkageDiagnosticDetails.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.Skin.SkinCore.SkinCoreNonPrimaryCancerPathwayRoute.CancerProgressionICD.@code'
as CancerProgressionICD
from omop_staging.cosd_staging_81
where type = 'SK'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
CancerProgressionICD
from sk
where NhsNumber is not null
and CancerProgressionICD is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 SA Condition Occurrence Secondary Diagnosis ICD
-
Value copied from
SecondaryDiagnosisIcd -
SecondaryDiagnosisIcdICD code used to identify the secondary patient diagnosis. Same as the CLINICAL CLASSIFICATION CODE attribute. For Healthcare Operational Data Flows (Acute), this is the next most relevant patient diagnosis. SECONDARY DIAGNOSIS (ICD)
with sa as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed'
as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.Diagnosis.DiagnosisAdditionalItems.SecondaryDiagnosisIcd.@code'
as SecondaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'SA'
)
select distinct
NhsNumber,
DateOfPrimaryDiagnosisClinicallyAgreed,
SecondaryDiagnosisIcd
from sa
where NhsNumber is not null
and SecondaryDiagnosisIcd is not null
and DateOfPrimaryDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 SA Condition Occurrence Primary Diagnosis ICD
-
Value copied from
PrimaryDiagnosisIcd -
PrimaryDiagnosisIcdICD code used to identify the primary patient diagnosis. Same as the CLINICAL CLASSIFICATION CODE attribute. For Healthcare Operational Data Flows (Acute), this is the main patient diagnosis. PRIMARY DIAGNOSIS (ICD)
with sa as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed'
as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.PrimaryDiagnosisIcd.@code'
as PrimaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'SA'
)
select distinct
NhsNumber,
DateOfPrimaryDiagnosisClinicallyAgreed,
PrimaryDiagnosisIcd
from sa
where NhsNumber is not null
and PrimaryDiagnosisIcd is not null
and DateOfPrimaryDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 SA Condition Occurrence Original Primary Diagnosis ICD
-
Value copied from
OriginalPrimaryDiagnosisIcd -
OriginalPrimaryDiagnosisIcdICD code used to identify the original primary diagnosis. For COSDS Core, used for cancer recurrence and agreed at the multidisciplinary team meeting by the care professional team. PRIMARY DIAGNOSIS (ICD ORIGINAL)
with sa as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.NonPrimaryPathway.Recurrence.OriginalPrimaryDiagnosisIcd.@code'
as OriginalPrimaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'SA'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
OriginalPrimaryDiagnosisIcd
from sa
where NhsNumber is not null
and OriginalPrimaryDiagnosisIcd is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 SA Condition Occurrence Cancer Progression ICD
-
Value copied from
ProgressionIcd -
ProgressionIcdThe International Classification of Diseases (ICD) code of the cancer progression during a Cancer Care Spell. For COSD - Core, this is the ICD code of the original patient diagnosis of the cancer progression, agreed at the multidisciplinary team meeting by the care professional team. CANCER PROGRESSION (ICD ORIGINAL)
with sa as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.NonPrimaryPathway.Progression.ProgressionIcd.@code'
as ProgressionIcd
from omop_staging.cosd_staging_901
where type = 'SA'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
ProgressionIcd
from sa
where NhsNumber is not null
and ProgressionIcd is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V8 SA Condition Occurrence Primary Diagnosis ICD
-
Value copied from
PrimaryDiagnosis -
PrimaryDiagnosisICD code used to identify the primary patient diagnosis. Same as the CLINICAL CLASSIFICATION CODE attribute. For Healthcare Operational Data Flows (Acute), this is the main patient diagnosis. PRIMARY DIAGNOSIS (ICD)
with sa as (
select distinct
Record ->> '$.Sarcoma.SarcomaCore.SarcomaCoreLinkagePatientId.NHSNumber.@extension'
as NhsNumber,
Record ->> '$.Sarcoma.SarcomaCore.SarcomaCoreLinkageDiagnosticDetails.ClinicalDateCancerDiagnosis'
as ClinicalDateCancerDiagnosis,
Record ->> '$.Sarcoma.SarcomaCore.SarcomaCoreLinkageDiagnosticDetails.PrimaryDiagnosis.@code'
as PrimaryDiagnosis
from omop_staging.cosd_staging_81
where type = 'SA'
)
select distinct
NhsNumber,
ClinicalDateCancerDiagnosis,
PrimaryDiagnosis
from sa
where NhsNumber is not null
and PrimaryDiagnosis is not null
and ClinicalDateCancerDiagnosis is not null;
Comment or raise an issue for this mapping.
COSD V8 SA Condition Occurrence Cancer Progression ICD
-
Value copied from
CancerProgressionICD -
CancerProgressionICDThe International Classification of Diseases (ICD) code of the cancer progression during a Cancer Care Spell. For COSD - Core, this is the ICD code of the original patient diagnosis of the cancer progression, agreed at the multidisciplinary team meeting by the care professional team. CANCER PROGRESSION (ICD ORIGINAL)
with sa as (
select distinct
Record ->> '$.Sarcoma.SarcomaCore.SarcomaCoreLinkagePatientId.NHSNumber.@extension'
as NhsNumber,
Record ->> '$.Sarcoma.SarcomaCore.SarcomaCoreLinkageDiagnosticDetails.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.Sarcoma.SarcomaCore.SarcomaCoreNonPrimaryCancerPathwayRoute.CancerProgressionICD.@code'
as CancerProgressionICD
from omop_staging.cosd_staging_81
where type = 'SA'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
CancerProgressionICD
from sa
where NhsNumber is not null
and CancerProgressionICD is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 LV Condition Occurrence Secondary Diagnosis ICD
-
Value copied from
SecondaryDiagnosisIcd -
SecondaryDiagnosisIcdICD code used to identify the secondary patient diagnosis. Same as the CLINICAL CLASSIFICATION CODE attribute. For Healthcare Operational Data Flows (Acute), this is the next most relevant patient diagnosis. SECONDARY DIAGNOSIS (ICD)
with lv as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed'
as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.Diagnosis.DiagnosisAdditionalItems.SecondaryDiagnosisIcd.@code'
as SecondaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'LV'
)
select distinct
NhsNumber,
DateOfPrimaryDiagnosisClinicallyAgreed,
SecondaryDiagnosisIcd
from lv
where NhsNumber is not null
and SecondaryDiagnosisIcd is not null
and DateOfPrimaryDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 LV Condition Occurrence Primary Diagnosis ICD
-
Value copied from
PrimaryDiagnosisIcd -
PrimaryDiagnosisIcdICD code used to identify the primary patient diagnosis. Same as the CLINICAL CLASSIFICATION CODE attribute. For Healthcare Operational Data Flows (Acute), this is the main patient diagnosis. PRIMARY DIAGNOSIS (ICD)
with lv as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed'
as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.PrimaryDiagnosisIcd.@code'
as PrimaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'LV'
)
select distinct
NhsNumber,
DateOfPrimaryDiagnosisClinicallyAgreed,
PrimaryDiagnosisIcd
from lv
where NhsNumber is not null
and PrimaryDiagnosisIcd is not null
and DateOfPrimaryDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 LV Condition Occurrence Original Primary Diagnosis ICD
-
Value copied from
OriginalPrimaryDiagnosisIcd -
OriginalPrimaryDiagnosisIcdICD code used to identify the original primary diagnosis. For COSDS Core, used for cancer recurrence and agreed at the multidisciplinary team meeting by the care professional team. PRIMARY DIAGNOSIS (ICD ORIGINAL)
with lv as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.NonPrimaryPathway.Recurrence.OriginalPrimaryDiagnosisIcd.@code'
as OriginalPrimaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'LV'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
OriginalPrimaryDiagnosisIcd
from lv
where NhsNumber is not null
and OriginalPrimaryDiagnosisIcd is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 LV Condition Occurrence Cancer Progression ICD
-
Value copied from
ProgressionIcd -
ProgressionIcdThe International Classification of Diseases (ICD) code of the cancer progression during a Cancer Care Spell. For COSD - Core, this is the ICD code of the original patient diagnosis of the cancer progression, agreed at the multidisciplinary team meeting by the care professional team. CANCER PROGRESSION (ICD ORIGINAL)
with lv as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.NonPrimaryPathway.Progression.ProgressionIcd.@code'
as ProgressionIcd
from omop_staging.cosd_staging_901
where type = 'LV'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
ProgressionIcd
from lv
where NhsNumber is not null
and ProgressionIcd is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V8 LV Condition Occurrence Primary Diagnosis ICD
-
Value copied from
PrimaryDiagnosis -
PrimaryDiagnosisICD code used to identify the primary patient diagnosis. Same as the CLINICAL CLASSIFICATION CODE attribute. For Healthcare Operational Data Flows (Acute), this is the main patient diagnosis. PRIMARY DIAGNOSIS (ICD)
with lv as (
select distinct
Record ->> '$.Liver.LiverCore.LiverCoreLinkagePatientId.NHSNumber.@extension'
as NhsNumber,
Record ->> '$.Liver.LiverCore.LiverCoreLinkageDiagnosticDetails.ClinicalDateCancerDiagnosis'
as ClinicalDateCancerDiagnosis,
Record ->> '$.Liver.LiverCore.LiverCoreLinkageDiagnosticDetails.PrimaryDiagnosis.@code'
as PrimaryDiagnosis
from omop_staging.cosd_staging_81
where type = 'LV'
)
select distinct
NhsNumber,
ClinicalDateCancerDiagnosis,
PrimaryDiagnosis
from lv
where NhsNumber is not null
and PrimaryDiagnosis is not null
and ClinicalDateCancerDiagnosis is not null;
Comment or raise an issue for this mapping.
COSD V8 LV Condition Occurrence Cancer Progression ICD
-
Value copied from
CancerProgressionICD -
CancerProgressionICDThe International Classification of Diseases (ICD) code of the cancer progression during a Cancer Care Spell. For COSD - Core, this is the ICD code of the original patient diagnosis of the cancer progression, agreed at the multidisciplinary team meeting by the care professional team. CANCER PROGRESSION (ICD ORIGINAL)
with lv as (
select distinct
Record ->> '$.Liver.LiverCore.LiverCoreLinkagePatientId.NHSNumber.@extension'
as NhsNumber,
Record ->> '$.Liver.LiverCore.LiverCoreLinkageDiagnosticDetails.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.Liver.LiverCore.LiverCoreNonPrimaryCancerPathwayRoute.CancerProgressionICD.@code'
as CancerProgressionICD
from omop_staging.cosd_staging_81
where type = 'LV'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
CancerProgressionICD
from lv
where NhsNumber is not null
and CancerProgressionICD is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 Lung Condition Occurrence Recurrence
-
Value copied from
NonPrimaryRecurrenceOriginalDiagnosis -
NonPrimaryRecurrenceOriginalDiagnosisORIGINAL PRIMARY DIAGNOSIS (ICD) is the International Classification of Diseases (ICD) code of the original PATIENT DIAGNOSIS relating to the cancer recurrence. ORIGINAL PRIMARY DIAGNOSIS (ICD)
select
distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension' as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed' as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.NonPrimaryPathway.Recurrence.OriginalPrimaryDiagnosisIcd.@code' as NonPrimaryRecurrenceOriginalDiagnosis
from omop_staging.cosd_staging_901
where type = 'LU'
and NonPrimaryRecurrenceOriginalDiagnosis is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null
and NhsNumber is not null;
Comment or raise an issue for this mapping.
COSD V9 Lung Condition Occurrence Progression
-
Value copied from
NonPrimaryProgressionOriginalDiagnosis -
NonPrimaryProgressionOriginalDiagnosisCANCER PROGRESSION (ICD ORIGINAL) is the International Classification of Diseases (ICD) code of the original PATIENT DIAGNOSIS of the Cancer Progression. CANCER PROGRESSION (ICD ORIGINAL)
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension' as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed' as NonPrimaryDiagnosisDate,
Record ->> '$.NonPrimaryPathway.Progression.ProgressionIcd.@code' as NonPrimaryProgressionOriginalDiagnosis
from omop_staging.cosd_staging_901
where type = 'LU'
and NonPrimaryProgressionOriginalDiagnosis is not null
and NonPrimaryDiagnosisDate is not null
and NhsNumber is not null;
Comment or raise an issue for this mapping.
COSD V8 Lung Condition Occurrence Progression
-
Value copied from
NonPrimaryProgressionOriginalDiagnosis -
NonPrimaryProgressionOriginalDiagnosisCANCER PROGRESSION (ICD ORIGINAL) is the International Classification of Diseases (ICD) code of the original PATIENT DIAGNOSIS of the Cancer Progression. CANCER PROGRESSION (ICD ORIGINAL)
select distinct
Record ->> '$.Lung.LungCore.LungCoreLinkagePatientId.NHSNumber.@extension' as NHSNumber,
Record ->> '$.Lung.LungCore.LungCoreLinkageDiagnosticDetails.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed' as NonPrimaryDiagnosisDate,
Record ->> '$.Lung.LungCore.LungCoreNonPrimaryCancerPathwayRoute.CancerProgressionICD.@code' as NonPrimaryProgressionOriginalDiagnosis
from omop_staging.cosd_staging_81
where type = 'LU'
and NonPrimaryProgressionOriginalDiagnosis is not null
and NonPrimaryDiagnosisDate is not null
and NhsNumber is not null;
Comment or raise an issue for this mapping.
COSD V8 Lung Condition Occurrence Primary Diagnosis
-
Value copied from
CancerDiagnosis -
CancerDiagnosisThe primary diagnosis code for the cancer. PRIMARY DIAGNOSIS
with lung as (
select
Record ->> '$.Lung.LungCore.LungCoreLinkagePatientId.NHSNumber.@extension' as NHSNumber,
Record ->> '$.Lung.LungCore.LungCoreLinkageDiagnosticDetails.ClinicalDateCancerDiagnosis' as DiagnosisDate,
Record ->> '$.Lung.LungCore.LungCoreLinkageDiagnosticDetails.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed' as NonPrimaryDiagnosisDate,
Record ->> '$.Lung.LungCore.LungCoreDiagnosis.MorphologyICDODiagnosis.@code' as CancerHistology,
Record ->> '$.Lung.LungCore.LungCoreDiagnosis.TopographyICDO.@code' as CancerTopography,
Record ->> '$.Lung.LungCore.LungCoreLinkageDiagnosticDetails.PrimaryDiagnosis.@code'as CancerDiagnosis
from omop_staging.cosd_staging_81 lu
where lu.Type = 'LU'
)
select
distinct
NHSNumber,
coalesce(DiagnosisDate, NonPrimaryDiagnosisDate) as DiagnosisDate,
CancerHistology,
CancerTopography,
CancerDiagnosis
from lung
where NHSNumber is not null;
Comment or raise an issue for this mapping.
COSD V8 Lung Condition Occurrence Primary Diagnosis Histology Topography
Source columns CancerHistology, CancerTopography. Separates text with newlines. Trim whitespace.
-
CancerHistologyMORPHOLOGY (ICD-O CANCER TRANSFORMATION) is the morphology code of the Cancer Transformation using the ICD-O CODE. MORPHOLOGY (ICD-O CANCER TRANSFORMATION) -
CancerTopographyTOPOGRAPHY (ICD-O) is the topographical site of the Tumour using the ICD-O CODE. TOPOGRAPHY (ICD-O)
with lung as (
select
Record ->> '$.Lung.LungCore.LungCoreLinkagePatientId.NHSNumber.@extension' as NHSNumber,
Record ->> '$.Lung.LungCore.LungCoreLinkageDiagnosticDetails.ClinicalDateCancerDiagnosis' as DiagnosisDate,
Record ->> '$.Lung.LungCore.LungCoreLinkageDiagnosticDetails.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed' as NonPrimaryDiagnosisDate,
Record ->> '$.Lung.LungCore.LungCoreDiagnosis.MorphologyICDODiagnosis.@code' as CancerHistology,
Record ->> '$.Lung.LungCore.LungCoreDiagnosis.TopographyICDO.@code' as CancerTopography,
Record ->> '$.Lung.LungCore.LungCoreLinkageDiagnosticDetails.PrimaryDiagnosis.@code'as CancerDiagnosis
from omop_staging.cosd_staging_81 lu
where lu.Type = 'LU'
)
select
distinct
NHSNumber,
coalesce(DiagnosisDate, NonPrimaryDiagnosisDate) as DiagnosisDate,
CancerHistology,
CancerTopography,
CancerDiagnosis
from lung
where NHSNumber is not null
and CancerHistology is not null
and CancerTopography is not null;
Comment or raise an issue for this mapping.
COSD V9 HN Condition Occurrence Secondary Diagnosis ICD
-
Value copied from
SecondaryDiagnosisIcd -
SecondaryDiagnosisIcdICD code used to identify the secondary patient diagnosis. Same as the CLINICAL CLASSIFICATION CODE attribute. For Healthcare Operational Data Flows (Acute), this is the next most relevant patient diagnosis. SECONDARY DIAGNOSIS (ICD)
with hn as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed'
as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.Diagnosis.DiagnosisAdditionalItems.SecondaryDiagnosisIcd.@code'
as SecondaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'HN'
)
select distinct
NhsNumber,
DateOfPrimaryDiagnosisClinicallyAgreed,
SecondaryDiagnosisIcd
from hn
where NhsNumber is not null
and SecondaryDiagnosisIcd is not null
and DateOfPrimaryDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 HN Condition Occurrence Primary Diagnosis ICD
-
Value copied from
PrimaryDiagnosisIcd -
PrimaryDiagnosisIcdICD code used to identify the primary patient diagnosis. Same as the CLINICAL CLASSIFICATION CODE attribute. For Healthcare Operational Data Flows (Acute), this is the main patient diagnosis. PRIMARY DIAGNOSIS (ICD)
with hn as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed'
as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.PrimaryDiagnosisIcd.@code'
as PrimaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'HN'
)
select distinct
NhsNumber,
DateOfPrimaryDiagnosisClinicallyAgreed,
PrimaryDiagnosisIcd
from hn
where NhsNumber is not null
and PrimaryDiagnosisIcd is not null
and DateOfPrimaryDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 HN Condition Occurrence Original Primary Diagnosis ICD
-
Value copied from
OriginalPrimaryDiagnosisIcd -
OriginalPrimaryDiagnosisIcdICD code used to identify the original primary diagnosis. For COSDS Core, used for cancer recurrence and agreed at the multidisciplinary team meeting by the care professional team. PRIMARY DIAGNOSIS (ICD ORIGINAL)
with hn as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.NonPrimaryPathway.Recurrence.OriginalPrimaryDiagnosisIcd.@code'
as OriginalPrimaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'HN'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
OriginalPrimaryDiagnosisIcd
from hn
where NhsNumber is not null
and OriginalPrimaryDiagnosisIcd is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 HN Condition Occurrence Cancer Progression ICD
-
Value copied from
ProgressionIcd -
ProgressionIcdThe International Classification of Diseases (ICD) code of the cancer progression during a Cancer Care Spell. For COSD - Core, this is the ICD code of the original patient diagnosis of the cancer progression, agreed at the multidisciplinary team meeting by the care professional team. CANCER PROGRESSION (ICD ORIGINAL)
with hn as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.NonPrimaryPathway.Progression.ProgressionIcd.@code'
as ProgressionIcd
from omop_staging.cosd_staging_901
where type = 'HN'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
ProgressionIcd
from hn
where NhsNumber is not null
and ProgressionIcd is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V8 HN Condition Occurrence Primary Diagnosis ICD
-
Value copied from
PrimaryDiagnosis -
PrimaryDiagnosisICD code used to identify the primary patient diagnosis. Same as the CLINICAL CLASSIFICATION CODE attribute. For Healthcare Operational Data Flows (Acute), this is the main patient diagnosis. PRIMARY DIAGNOSIS (ICD)
with hn as (
select distinct
Record ->> '$.HeadNeck.HeadNeckCore.HeadNeckCoreLinkagePatientId.NHSNumber.@extension'
as NhsNumber,
Record ->> '$.HeadNeck.HeadNeckCore.HeadNeckCoreLinkageDiagnosticDetails.ClinicalDateCancerDiagnosis'
as ClinicalDateCancerDiagnosis,
Record ->> '$.HeadNeck.HeadNeckCore.HeadNeckCoreLinkageDiagnosticDetails.PrimaryDiagnosis.@code'
as PrimaryDiagnosis
from omop_staging.cosd_staging_81
where type = 'HN'
)
select distinct
NhsNumber,
ClinicalDateCancerDiagnosis,
PrimaryDiagnosis
from hn
where NhsNumber is not null
and PrimaryDiagnosis is not null
and ClinicalDateCancerDiagnosis is not null;
Comment or raise an issue for this mapping.
COSD V8 HN Condition Occurrence Cancer Progression ICD
-
Value copied from
CancerProgressionICD -
CancerProgressionICDThe International Classification of Diseases (ICD) code of the cancer progression during a Cancer Care Spell. For COSD - Core, this is the ICD code of the original patient diagnosis of the cancer progression, agreed at the multidisciplinary team meeting by the care professional team. CANCER PROGRESSION (ICD ORIGINAL)
with hn as (
select distinct
Record ->> '$.HeadNeck.HeadNeckCore.HeadNeckCoreLinkagePatientId.NHSNumber.@extension'
as NhsNumber,
Record ->> '$.HeadNeck.HeadNeckCore.HeadNeckCoreLinkageDiagnosticDetails.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.HeadNeck.HeadNeckCore.HeadNeckCoreNonPrimaryCancerPathwayRoute.CancerProgressionICD.@code'
as CancerProgressionICD
from omop_staging.cosd_staging_81
where type = 'HN'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
CancerProgressionICD
from hn
where NhsNumber is not null
and CancerProgressionICD is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 GY Condition Occurrence Secondary Diagnosis ICD
-
Value copied from
SecondaryDiagnosisIcd -
SecondaryDiagnosisIcdICD code used to identify the secondary patient diagnosis. Same as the CLINICAL CLASSIFICATION CODE attribute. For Healthcare Operational Data Flows (Acute), this is the next most relevant patient diagnosis. SECONDARY DIAGNOSIS (ICD)
with gy as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed'
as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.Diagnosis.DiagnosisAdditionalItems.SecondaryDiagnosisIcd.@code'
as SecondaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'GY'
)
select distinct
NhsNumber,
DateOfPrimaryDiagnosisClinicallyAgreed,
SecondaryDiagnosisIcd
from gy
where NhsNumber is not null
and SecondaryDiagnosisIcd is not null
and DateOfPrimaryDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 GY Condition Occurrence Primary Diagnosis ICD
-
Value copied from
PrimaryDiagnosisIcd -
PrimaryDiagnosisIcdICD code used to identify the primary diagnosis. PRIMARY DIAGNOSIS (ICD)
with gy as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed'
as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.PrimaryDiagnosisIcd.@code'
as PrimaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'GY'
)
select distinct
NhsNumber,
DateOfPrimaryDiagnosisClinicallyAgreed,
PrimaryDiagnosisIcd
from gy
where NhsNumber is not null
and PrimaryDiagnosisIcd is not null
and DateOfPrimaryDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 GY Condition Occurrence Original Primary Diagnosis ICD
-
Value copied from
OriginalPrimaryDiagnosisIcd -
OriginalPrimaryDiagnosisIcdICD code used to identify the original primary diagnosis. For COSDS Core, used for cancer recurrence and agreed at the multidisciplinary team meeting by the care professional team. PRIMARY DIAGNOSIS (ICD ORIGINAL)
with gy as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.NonPrimaryPathway.Recurrence.OriginalPrimaryDiagnosisIcd.@code'
as OriginalPrimaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'GY'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
OriginalPrimaryDiagnosisIcd
from gy
where NhsNumber is not null
and OriginalPrimaryDiagnosisIcd is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 GY Condition Occurrence Cancer Progression ICD
-
Value copied from
ProgressionIcd -
ProgressionIcdThe International Classification of Diseases (ICD) code of the cancer progression during a Cancer Care Spell. For COSD - Core, this is the ICD code of the original patient diagnosis of the cancer progression, agreed at the multidisciplinary team meeting by the care professional team. CANCER PROGRESSION (ICD ORIGINAL)
with gy as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.NonPrimaryPathway.Progression.ProgressionIcd.@code'
as ProgressionIcd
from omop_staging.cosd_staging_901
where type = 'GY'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
ProgressionIcd
from gy
where NhsNumber is not null
and ProgressionIcd is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V8 GY Condition Occurrence Secondary Diagnosis ICD
-
Value copied from
SecondaryDiagnosisICD -
SecondaryDiagnosisICDICD code used to identify the secondary patient diagnosis. Same as the CLINICAL CLASSIFICATION CODE attribute. For Healthcare Operational Data Flows (Acute), this is the next most relevant patient diagnosis. SECONDARY DIAGNOSIS (ICD)
with gy as (
select distinct
Record ->> '$.Gynaecological.GynaecologicalCore.GynaecologicalCoreLinkagePatientId.NHSNumber.@extension'
as NHSNumber,
Record ->> '$.Gynaecological.GynaecologicalCore.GynaecologicalCoreLinkageDiagnosticDetails.ClinicalDateCancerDiagnosis'
as ClinicalDateCancerDiagnosis,
Record ->> '$.Gynaecological.GynaecologicalCore.GynaecologicalCoreDiagnosis.GynaecologicalCoreDiagnosisAdditionalItems.SecondaryDiagnosisICD.@code'
as SecondaryDiagnosisICD
from omop_staging.cosd_staging_81
where type = 'GY'
)
select distinct
NHSNumber,
ClinicalDateCancerDiagnosis,
SecondaryDiagnosisICD
from gy
where NHSNumber is not null
and SecondaryDiagnosisICD is not null
and ClinicalDateCancerDiagnosis is not null;
Comment or raise an issue for this mapping.
COSD V8 GY Condition Occurrence Primary Diagnosis ICD
-
Value copied from
PrimaryDiagnosisICD -
PrimaryDiagnosisICDICD code used to identify the primary diagnosis. PRIMARY DIAGNOSIS (ICD)
with gy as (
select distinct
Record ->> '$.Gynaecological.GynaecologicalCore.GynaecologicalCoreLinkagePatientId.NHSNumber.@extension'
as NHSNumber,
Record ->> '$.Gynaecological.GynaecologicalCore.GynaecologicalCoreLinkageDiagnosticDetails.ClinicalDateCancerDiagnosis'
as ClinicalDateCancerDiagnosis,
Record ->> '$.Gynaecological.GynaecologicalCore.GynaecologicalCoreLinkageDiagnosticDetails.PrimaryDiagnosis.@code'
as PrimaryDiagnosisICD
from omop_staging.cosd_staging_81
where type = 'GY'
)
select distinct
NHSNumber,
ClinicalDateCancerDiagnosis,
PrimaryDiagnosisICD
from gy
where NHSNumber is not null
and PrimaryDiagnosisICD is not null
and ClinicalDateCancerDiagnosis is not null;
Comment or raise an issue for this mapping.
COSD V8 GY Condition Occurrence Cancer Progression ICD
-
Value copied from
CancerProgressionICD -
CancerProgressionICDThe International Classification of Diseases (ICD) code of the cancer progression during a Cancer Care Spell. For COSD - Core, this is the ICD code of the original patient diagnosis of the cancer progression, agreed at the multidisciplinary team meeting by the care professional team. CANCER PROGRESSION (ICD ORIGINAL)
with gy as (
select distinct
Record ->> '$.Gynaecological.GynaecologicalCore.GynaecologicalCoreLinkagePatientId.NHSNumber.@extension'
as NHSNumber,
Record ->> '$.Gynaecological.GynaecologicalCore.GynaecologicalCoreLinkageDiagnosticDetails.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.Gynaecological.GynaecologicalCore.GynaecologicalCoreNonPrimaryCancerPathwayRoute.CancerProgressionICD.@code'
as CancerProgressionICD
from omop_staging.cosd_staging_81
where type = 'GY'
)
select distinct
NHSNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
CancerProgressionICD
from gy
where NHSNumber is not null
and CancerProgressionICD is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 CT Condition Occurrence Secondary Diagnosis ICD
-
Value copied from
SecondaryDiagnosisIcd -
SecondaryDiagnosisIcdICD code used to identify the secondary patient diagnosis. Same as the CLINICAL CLASSIFICATION CODE attribute. For Healthcare Operational Data Flows (Acute), this is the next most relevant patient diagnosis. SECONDARY DIAGNOSIS (ICD)
with ct as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed'
as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.Diagnosis.DiagnosisAdditionalItems.SecondaryDiagnosisIcd.@code'
as SecondaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'CT'
)
select distinct
NhsNumber,
DateOfPrimaryDiagnosisClinicallyAgreed,
SecondaryDiagnosisIcd
from ct
where NhsNumber is not null
and SecondaryDiagnosisIcd is not null
and DateOfPrimaryDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 CT Condition Occurrence Primary Diagnosis ICD
-
Value copied from
PrimaryDiagnosisIcd -
PrimaryDiagnosisIcdICD code used to identify the primary diagnosis. PRIMARY DIAGNOSIS (ICD)
with ct as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed'
as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.PrimaryDiagnosisIcd.@code'
as PrimaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'CT'
)
select distinct
NhsNumber,
DateOfPrimaryDiagnosisClinicallyAgreed,
PrimaryDiagnosisIcd
from ct
where NhsNumber is not null
and PrimaryDiagnosisIcd is not null
and DateOfPrimaryDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 CT Condition Occurrence Original Primary Diagnosis ICD
-
Value copied from
OriginalPrimaryDiagnosisIcd -
OriginalPrimaryDiagnosisIcdICD code used to identify the original primary diagnosis. For COSDS Core, used for cancer recurrence and agreed at the multidisciplinary team meeting by the care professional team. PRIMARY DIAGNOSIS (ICD ORIGINAL)
with ct as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.NonPrimaryPathway.Recurrence.OriginalPrimaryDiagnosisIcd.@code'
as OriginalPrimaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'CT'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
OriginalPrimaryDiagnosisIcd
from ct
where NhsNumber is not null
and OriginalPrimaryDiagnosisIcd is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 CT Condition Occurrence Cancer Progression ICD
-
Value copied from
ProgressionIcd -
ProgressionIcdThe International Classification of Diseases (ICD) code of the cancer progression during a Cancer Care Spell. For COSD - Core, this is the ICD code of the original patient diagnosis of the cancer progression, agreed at the multidisciplinary team meeting by the care professional team. CANCER PROGRESSION (ICD ORIGINAL)
with ct as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.NonPrimaryPathway.Progression.ProgressionIcd.@code'
as ProgressionIcd
from omop_staging.cosd_staging_901
where type = 'CT'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
ProgressionIcd
from ct
where NhsNumber is not null
and ProgressionIcd is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V8 CT Condition Occurrence Primary Diagnosis ICD
-
Value copied from
PrimaryDiagnosisICD -
PrimaryDiagnosisICDICD code used to identify the primary diagnosis. PRIMARY DIAGNOSIS (ICD)
with ct as (
select distinct
Record ->> '$.CTYA.CTYACore.CTYACoreLinkagePatientId.NHSNumber.@extension'
as NHSNumber,
Record ->> '$.CTYA.CTYACore.CTYACoreLinkageDiagnosticDetails.ClinicalDateCancerDiagnosis'
as ClinicalDateCancerDiagnosis,
Record ->> '$.CTYA.CTYACore.CTYACoreLinkageDiagnosticDetails.PrimaryDiagnosis.@code'
as PrimaryDiagnosisICD
from omop_staging.cosd_staging_81
where type = 'CT'
)
select distinct
NHSNumber,
ClinicalDateCancerDiagnosis,
PrimaryDiagnosisICD
from ct
where NHSNumber is not null
and PrimaryDiagnosisICD is not null
and ClinicalDateCancerDiagnosis is not null;
Comment or raise an issue for this mapping.
COSD V8 CT Condition Occurrence Cancer Progression ICD
-
Value copied from
CancerProgressionICD -
CancerProgressionICDThe International Classification of Diseases (ICD) code of the cancer progression during a Cancer Care Spell. For COSD - Core, this is the ICD code of the original patient diagnosis of the cancer progression, agreed at the multidisciplinary team meeting by the care professional team. CANCER PROGRESSION (ICD ORIGINAL)
with ct as (
select distinct
Record ->> '$.CTYA.CTYACore.CTYACoreLinkagePatientId.NHSNumber.@extension'
as NHSNumber,
Record ->> '$.CTYA.CTYACore.CTYACoreLinkageDiagnosticDetails.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.CTYA.CTYACore.CTYACoreNonPrimaryCancerPathwayRoute.CancerProgressionICD.@code'
as CancerProgressionICD
from omop_staging.cosd_staging_81
where type = 'CT'
)
select distinct
NHSNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
CancerProgressionICD
from ct
where NHSNumber is not null
and CancerProgressionICD is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 CR Condition Occurrence Secondary Diagnosis ICD
-
Value copied from
SecondaryDiagnosisIcd -
SecondaryDiagnosisIcdICD code used to identify the secondary patient diagnosis. Same as the CLINICAL CLASSIFICATION CODE attribute. For Healthcare Operational Data Flows (Acute), this is the next most relevant patient diagnosis. SECONDARY DIAGNOSIS (ICD)
with cr as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed'
as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.Diagnosis.DiagnosisAdditionalItems.SecondaryDiagnosisIcd.@code'
as SecondaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'CR'
)
select distinct
NhsNumber,
DateOfPrimaryDiagnosisClinicallyAgreed,
SecondaryDiagnosisIcd
from cr
where NhsNumber is not null
and SecondaryDiagnosisIcd is not null
and DateOfPrimaryDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 CR Condition Occurrence Primary Diagnosis ICD
-
Value copied from
PrimaryDiagnosisIcd -
PrimaryDiagnosisIcdICD code used to identify the primary diagnosis. PRIMARY DIAGNOSIS (ICD)
with cr as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed'
as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.PrimaryDiagnosisIcd.@code'
as PrimaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'CR'
)
select distinct
NhsNumber,
DateOfPrimaryDiagnosisClinicallyAgreed,
PrimaryDiagnosisIcd
from cr
where NhsNumber is not null
and PrimaryDiagnosisIcd is not null
and DateOfPrimaryDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 CR Condition Occurrence Original Primary Diagnosis ICD
-
Value copied from
OriginalPrimaryDiagnosisIcd -
OriginalPrimaryDiagnosisIcdICD code used to identify the original primary diagnosis. For COSDS Core, used for cancer recurrence and agreed at the multidisciplinary team meeting by the care professional team. PRIMARY DIAGNOSIS (ICD ORIGINAL)
with cr as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.NonPrimaryPathway.Recurrence.OriginalPrimaryDiagnosisIcd.@code'
as OriginalPrimaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'CR'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
OriginalPrimaryDiagnosisIcd
from cr
where NhsNumber is not null
and OriginalPrimaryDiagnosisIcd is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 CR Condition Occurrence Cancer Progression ICD
-
Value copied from
ProgressionIcd -
ProgressionIcdThe International Classification of Diseases (ICD) code of the cancer progression during a Cancer Care Spell. For COSD - Core, this is the ICD code of the original patient diagnosis of the cancer progression, agreed at the multidisciplinary team meeting by the care professional team. CANCER PROGRESSION (ICD ORIGINAL)
with cr as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.NonPrimaryPathway.Progression.ProgressionIcd.@code'
as ProgressionIcd
from omop_staging.cosd_staging_901
where type = 'CR'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
ProgressionIcd
from cr
where NhsNumber is not null
and ProgressionIcd is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V8 CR Condition Occurrence Primary Diagnosis ICD
-
Value copied from
PrimaryDiagnosisICD -
PrimaryDiagnosisICDICD code used to identify the primary diagnosis. PRIMARY DIAGNOSIS (ICD)
with cr as (
select distinct
Record ->> '$.Core.CoreCore.CoreLinkagePatientId.NHSNumber.@extension'
as NHSNumber,
Record ->> '$.Core.CoreCore.CoreLinkageDiagnosticDetails.ClinicalDateCancerDiagnosis'
as ClinicalDateCancerDiagnosis,
Record ->> '$.Core.CoreCore.CoreLinkageDiagnosticDetails.PrimaryDiagnosis.@code'
as PrimaryDiagnosisICD
from omop_staging.cosd_staging_81
where type = 'CR'
)
select distinct
NHSNumber,
ClinicalDateCancerDiagnosis,
PrimaryDiagnosisICD
from cr
where NHSNumber is not null
and PrimaryDiagnosisICD is not null
and ClinicalDateCancerDiagnosis is not null;
Comment or raise an issue for this mapping.
COSD V8 CR Condition Occurrence Cancer Progression ICD
-
Value copied from
CancerProgressionICD -
CancerProgressionICDThe International Classification of Diseases (ICD) code of the cancer progression during a Cancer Care Spell. For COSD - Core, this is the ICD code of the original patient diagnosis of the cancer progression, agreed at the multidisciplinary team meeting by the care professional team. CANCER PROGRESSION (ICD ORIGINAL)
with cr as (
select distinct
Record ->> '$.Core.CoreCore.CoreLinkagePatientId.NHSNumber.@extension'
as NHSNumber,
Record ->> '$.Core.CoreCore.CoreLinkageDiagnosticDetails.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.Core.CoreCore.CoreNonPrimaryCancerPathwayRoute.CancerProgressionICD.@code'
as CancerProgressionICD
from omop_staging.cosd_staging_81
where type = 'CR'
)
select distinct
NHSNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
CancerProgressionICD
from cr
where NHSNumber is not null
and CancerProgressionICD is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
Cosd V8 Condition Occurrence Primary Diagnosis
-
Value copied from
CancerDiagnosis -
CancerDiagnosisPRIMARY DIAGNOSIS (ICD) is the International Classification of Diseases (ICD) code used to identify the PRIMARY DIAGNOSIS. PRIMARY DIAGNOSIS (ICD)
with co as (
select
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreLinkagePatientId.NHSNumber.@extension' as NhsNumber,
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreLinkageDiagnosticDetails.ClinicalDateCancerDiagnosis' as DiagnosisDate,
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreLinkageDiagnosticDetails.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed' as NonPrimaryDiagnosisDate,
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreDiagnosis.MorphologyICDODiagnosis.@code' as CancerHistology,
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreDiagnosis.TopographyICDO.@code' as CancerTopography,
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreDiagnosis.BasisOfCancerDiagnosis.@code' as BasisOfDiagnosisCancer,
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreLinkageDiagnosticDetails.PrimaryDiagnosis.@code' as CancerDiagnosis
from omop_staging.cosd_staging_81 co
where co.Type = 'CO'
)
select
distinct
NhsNumber,
coalesce (DiagnosisDate, NonPrimaryDiagnosisDate) as DiagnosisDate,
BasisOfDiagnosisCancer,
CancerDiagnosis
from CO
where NhsNumber is not null and
(
DiagnosisDate is not null or
NonPrimaryDiagnosisDate is not null
);
Comment or raise an issue for this mapping.
Cosd V8 Condition Occurrence Primary Diagnosis Histology Topography
Source columns CancerHistology, CancerTopography. Separates text with newlines. Trim whitespace.
-
CancerHistologyMORPHOLOGY (ICD-O CANCER TRANSFORMATION) is the morphology code of the Cancer Transformation using the ICD-O CODE. MORPHOLOGY (ICD-O CANCER TRANSFORMATION) -
CancerTopographyTOPOGRAPHY (ICD-O) is the topographical site of the Tumour using the ICD-O CODE. TOPOGRAPHY (ICD-O)
with co as (
select
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreLinkagePatientId.NHSNumber.@extension' as NhsNumber,
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreLinkageDiagnosticDetails.ClinicalDateCancerDiagnosis' as DiagnosisDate,
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreLinkageDiagnosticDetails.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed' as NonPrimaryDiagnosisDate,
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreDiagnosis.MorphologyICDODiagnosis.@code' as CancerHistology,
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreDiagnosis.TopographyICDO.@code' as CancerTopography,
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreDiagnosis.BasisOfCancerDiagnosis.@code' as BasisOfDiagnosisCancer,
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreLinkageDiagnosticDetails.PrimaryDiagnosis.@code' as CancerDiagnosis
from omop_staging.cosd_staging_81 co
where co.Type = 'CO'
)
select
distinct
NhsNumber,
coalesce (DiagnosisDate, NonPrimaryDiagnosisDate) as DiagnosisDate,
BasisOfDiagnosisCancer,
CancerHistology,
CancerTopography
from CO
where NhsNumber is not null and
(
DiagnosisDate is not null or
NonPrimaryDiagnosisDate is not null
)
and (CancerHistology is not null and CancerTopography is not null)
Comment or raise an issue for this mapping.
COSD V9 Condition Occurrence Recurrence
-
Value copied from
SecondaryDiagnosis -
SecondaryDiagnosisSECONDARY DIAGNOSIS (ICD) is the International Classification of Diseases (ICD) code used to identify the secondary PATIENT DIAGNOSIS. SECONDARY DIAGNOSIS (ICD)
with CO as (
select
Record ->> '$.LinkagePatientId.NhsNumber.@extension' as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed' as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.Diagnosis.DiagnosisAdditionalItems.SecondaryDiagnosisIcd.@code' as SecondaryDiagnosis
from omop_staging.cosd_staging_901
where type = 'CO'
)
select
NhsNumber,
DateOfPrimaryDiagnosisClinicallyAgreed,
max(SecondaryDiagnosis) as SecondaryDiagnosis
from CO
where DateOfPrimaryDiagnosisClinicallyAgreed is not null
and SecondaryDiagnosis is not null
group by NhsNumber, DateOfPrimaryDiagnosisClinicallyAgreed;
Comment or raise an issue for this mapping.
COSD V9 Condition Occurrence Recurrence
-
Value copied from
NonPrimaryRecurrenceOriginalDiagnosis -
NonPrimaryRecurrenceOriginalDiagnosisPRIMARY DIAGNOSIS (ICD ORIGINAL) is the International Classification of Diseases (ICD) code used to identify the original PRIMARY DIAGNOSIS. PRIMARY DIAGNOSIS (ICD ORIGINAL)
select
distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension' as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed' as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.NonPrimaryPathway.Recurrence.OriginalPrimaryDiagnosisIcd.@code' as NonPrimaryRecurrenceOriginalDiagnosis
from omop_staging.cosd_staging_901
where type = 'CO'
and NonPrimaryRecurrenceOriginalDiagnosis is not null;
Comment or raise an issue for this mapping.
COSD V9 Condition Occurrence Progression
-
Value copied from
NonPrimaryProgressionOriginalDiagnosis -
NonPrimaryProgressionOriginalDiagnosisCANCER PROGRESSION (ICD ORIGINAL) is the International Classification of Diseases (ICD) code of the original PATIENT DIAGNOSIS of the Cancer Progression. CANCER PROGRESSION (ICD ORIGINAL)
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension' as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed' as NonPrimaryDiagnosisDate,
Record ->> '$.NonPrimaryPathway.Progression.ProgressionIcd.@code' as NonPrimaryProgressionOriginalDiagnosis
from omop_staging.cosd_staging_901
where type = 'CO'
and NonPrimaryProgressionOriginalDiagnosis is not null;
Comment or raise an issue for this mapping.
COSD V9 Condition Occurrence Primary Diagnosis
-
Value copied from
CancerDiagnosis -
CancerDiagnosisThe basis of how a PATIENT DIAGNOSIS relating to cancer was identified. BASIS OF DIAGNOSIS (CANCER)
with co as (
select
Record ->> '$.LinkagePatientId.NhsNumber.@extension' as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed' as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.Diagnosis."MorphologyIcd-o-3"."@code"' as CancerHistology,
Record ->> '$.PrimaryPathway.Diagnosis."TopographyIcd-o-3"."@code"' as CancerTopography,
Record ->> '$.PrimaryPathway.Diagnosis.BasisOfDiagnosisCancer.@code' as BasisOfDiagnosisCancer,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.PrimaryDiagnosisIcd.@code' as CancerDiagnosis
from omop_staging.cosd_staging_901
where type = 'CO'
)
select
NhsNumber,
DateOfPrimaryDiagnosisClinicallyAgreed,
max(BasisOfDiagnosisCancer) as BasisOfDiagnosisCancer,
CancerDiagnosis
from co
where DateOfPrimaryDiagnosisClinicallyAgreed is not null
group by NhsNumber, DateOfPrimaryDiagnosisClinicallyAgreed, CancerDiagnosis;
Comment or raise an issue for this mapping.
COSD V9 Condition Occurrence Primary Diagnosis Histology Topography
Source columns CancerHistology, CancerTopography. Separates text with newlines. Trim whitespace.
-
CancerHistologyMORPHOLOGY (ICD-O CANCER TRANSFORMATION) is the morphology code of the Cancer Transformation using the ICD-O CODE. MORPHOLOGY (ICD-O CANCER TRANSFORMATION) -
CancerTopographyTOPOGRAPHY (ICD-O) is the topographical site of the Tumour using the ICD-O CODE. TOPOGRAPHY (ICD-O)
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension' as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed' as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.Diagnosis.BasisOfDiagnosisCancer.@code' as BasisOfDiagnosisCancer,
Record ->> '$.PrimaryPathway.Diagnosis."MorphologyIcd-o-3"."@code"' as CancerHistology,
Record ->> '$.PrimaryPathway.Diagnosis."TopographyIcd-o-3"."@code"' as CancerTopography
from omop_staging.cosd_staging_901
where type = 'CO'
and DateOfPrimaryDiagnosisClinicallyAgreed is not null
and CancerHistology is not null
and CancerTopography not null;
Comment or raise an issue for this mapping.
COSD V9 Breast Condition Occurrence Secondary Diagnosis
-
Value copied from
SecondaryDiagnosis -
SecondaryDiagnosisSECONDARY DIAGNOSIS (ICD) is a classification denoting a disease or condition which co-exists at the time of Consultation with the Primary Diagnosis. SECONDARY DIAGNOSIS (ICD)
with BR as (
select
Record ->> '$.LinkagePatientId.NhsNumber.@extension' as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed' as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.Diagnosis.DiagnosisAdditionalItems.SecondaryDiagnosisIcd.@code' as SecondaryDiagnosis
from omop_staging.cosd_staging_901
where type = 'BR'
)
select
NhsNumber,
DateOfPrimaryDiagnosisClinicallyAgreed,
max(SecondaryDiagnosis) as SecondaryDiagnosis
from BR
where DateOfPrimaryDiagnosisClinicallyAgreed is not null
and SecondaryDiagnosis is not null
group by NhsNumber, DateOfPrimaryDiagnosisClinicallyAgreed;
Comment or raise an issue for this mapping.
COSD V9 Breast Condition Occurrence Recurrence
-
Value copied from
NonPrimaryRecurrenceOriginalDiagnosis -
NonPrimaryRecurrenceOriginalDiagnosisORIGINAL PRIMARY DIAGNOSIS (ICD RECURRENCE) is the International Classification of Diseases (ICD) code of the original Primary Diagnosis of a Recurrence. ORIGINAL PRIMARY DIAGNOSIS (ICD RECURRENCE)
with BR as (
select
Record ->> '$.LinkagePatientId.NhsNumber.@extension' as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed' as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.NonPrimaryPathway.Recurrence.OriginalPrimaryDiagnosisIcd.@code' as NonPrimaryRecurrenceOriginalDiagnosis
from omop_staging.cosd_staging_901
where type = 'BR'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
NonPrimaryRecurrenceOriginalDiagnosis
from BR
where NonPrimaryRecurrenceOriginalDiagnosis is not null;
Comment or raise an issue for this mapping.
COSD V9 Breast Condition Occurrence Progression
-
Value copied from
NonPrimaryProgressionOriginalDiagnosis -
NonPrimaryProgressionOriginalDiagnosisCANCER PROGRESSION (ICD ORIGINAL) is the International Classification of Diseases (ICD) code of the original PATIENT DIAGNOSIS of the Cancer Progression. CANCER PROGRESSION (ICD ORIGINAL)
with BR as (
select
Record ->> '$.LinkagePatientId.NhsNumber.@extension' as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed' as NonPrimaryDiagnosisDate,
Record ->> '$.NonPrimaryPathway.Progression.ProgressionIcd.@code' as NonPrimaryProgressionOriginalDiagnosis
from omop_staging.cosd_staging_901
where type = 'BR'
)
select distinct
NhsNumber,
NonPrimaryDiagnosisDate,
NonPrimaryProgressionOriginalDiagnosis
from BR
where NonPrimaryProgressionOriginalDiagnosis is not null;
Comment or raise an issue for this mapping.
COSD V9 Breast Condition Occurrence Primary Diagnosis
-
Value copied from
CancerDiagnosis -
CancerDiagnosisPRIMARY DIAGNOSIS (ICD) is the International Classification of Diseases (ICD) code used to identify the PRIMARY DIAGNOSIS. PRIMARY DIAGNOSIS (ICD)
with br as (
select
Record ->> '$.LinkagePatientId.NhsNumber.@extension' as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed' as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.Diagnosis."MorphologyIcd-o-3"."@code"' as CancerHistology,
Record ->> '$.PrimaryPathway.Diagnosis."TopographyIcd-o-3"."@code"' as CancerTopography,
Record ->> '$.PrimaryPathway.Diagnosis.BasisOfDiagnosisCancer.@code' as BasisOfDiagnosisCancer,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.PrimaryDiagnosisIcd.@code' as CancerDiagnosis
from omop_staging.cosd_staging_901
where type = 'BR'
)
select
NhsNumber,
DateOfPrimaryDiagnosisClinicallyAgreed,
max(BasisOfDiagnosisCancer) as BasisOfDiagnosisCancer,
CancerDiagnosis
from br
where DateOfPrimaryDiagnosisClinicallyAgreed is not null
group by NhsNumber, DateOfPrimaryDiagnosisClinicallyAgreed, CancerDiagnosis;
Comment or raise an issue for this mapping.
COSD V9 Breast Condition Occurrence Primary Diagnosis Histology Topography
Source columns CancerHistology, CancerTopography. Separates text with newlines. Trim whitespace.
-
CancerHistologyMORPHOLOGY (ICD-O CANCER TRANSFORMATION) is the morphology code of the Cancer Transformation using the ICD-O CODE. MORPHOLOGY (ICD-O CANCER TRANSFORMATION) -
CancerTopographyTOPOGRAPHY (ICD-O) is the topographical site of the Tumour using the ICD-O CODE. TOPOGRAPHY (ICD-O)
with BR as (
select
Record ->> '$.LinkagePatientId.NhsNumber.@extension' as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed' as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.Diagnosis.BasisOfDiagnosisCancer.@code' as BasisOfDiagnosisCancer,
Record ->> '$.PrimaryPathway.Diagnosis."MorphologyIcd-o-3"."@code"' as CancerHistology,
Record ->> '$.PrimaryPathway.Diagnosis."TopographyIcd-o-3"."@code"' as CancerTopography
from omop_staging.cosd_staging_901
where type = 'BR'
)
select distinct
NhsNumber,
DateOfPrimaryDiagnosisClinicallyAgreed,
BasisOfDiagnosisCancer,
CancerHistology,
CancerTopography
from BR
where DateOfPrimaryDiagnosisClinicallyAgreed is not null
and CancerHistology is not null
and CancerTopography is not null;
Comment or raise an issue for this mapping.
COSD V8 Breast Condition Occurrence Progression
-
Value copied from
NonPrimaryProgressionOriginalDiagnosis -
NonPrimaryProgressionOriginalDiagnosisCANCER PROGRESSION (ICD ORIGINAL) is the International Classification of Diseases (ICD) code of the original PATIENT DIAGNOSIS of the Cancer Progression. CANCER PROGRESSION (ICD ORIGINAL)
with BR as (
select
Record ->> '$.Breast.BreastCore.BreastCoreLinkagePatientId.NHSNumber.@extension' as NhsNumber,
Record ->> '$.Breast.BreastCore.BreastCoreLinkageDiagnosticDetails.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed' as NonPrimaryDiagnosisDate,
Record ->> '$.Breast.BreastCore.BreastCoreNonPrimaryCancerPathwayRoute.CancerProgressionICD.@code' as NonPrimaryProgressionOriginalDiagnosis
from omop_staging.cosd_staging_81
where type = 'BR'
)
select distinct
NhsNumber,
NonPrimaryDiagnosisDate,
NonPrimaryProgressionOriginalDiagnosis
from BR
where NonPrimaryProgressionOriginalDiagnosis is not null
and NonPrimaryDiagnosisDate is not null
and NhsNumber is not null;
Comment or raise an issue for this mapping.
Cosd V8 Breast Condition Occurrence Primary Diagnosis
-
Value copied from
CancerDiagnosis -
CancerDiagnosisPRIMARY DIAGNOSIS (ICD) is the International Classification of Diseases (ICD) code used to identify the PRIMARY DIAGNOSIS. PRIMARY DIAGNOSIS (ICD)
with BR as (
select
Record ->> '$.Breast.BreastCore.BreastCoreLinkagePatientId.NHSNumber.@extension' as NhsNumber,
Record ->> '$.Breast.BreastCore.BreastCoreLinkageDiagnosticDetails.ClinicalDateCancerDiagnosis' as DiagnosisDate,
Record ->> '$.Breast.BreastCore.BreastCoreLinkageDiagnosticDetails.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed' as NonPrimaryDiagnosisDate,
Record ->> '$.Breast.BreastCore.BreastCoreDiagnosis.MorphologyICDODiagnosis.@code' as CancerHistology,
Record ->> '$.Breast.BreastCore.BreastCoreDiagnosis.TopographyICDO.@code' as CancerTopography,
Record ->> '$.Breast.BreastCore.BreastCoreDiagnosis.BasisOfCancerDiagnosis.@code' as BasisOfDiagnosisCancer,
Record ->> '$.Breast.BreastCore.BreastCoreLinkageDiagnosticDetails.PrimaryDiagnosis.@code' as CancerDiagnosis
from omop_staging.cosd_staging_81
where Type = 'BR'
)
select
distinct
NhsNumber,
coalesce (DiagnosisDate, NonPrimaryDiagnosisDate) as DiagnosisDate,
BasisOfDiagnosisCancer,
CancerDiagnosis
from BR
where NhsNumber is not null and
(
DiagnosisDate is not null or
NonPrimaryDiagnosisDate is not null
);
Comment or raise an issue for this mapping.
Cosd V8 Breast Condition Occurrence Primary Diagnosis Histology Topography
Source columns CancerHistology, CancerTopography. Separates text with newlines. Trim whitespace.
-
CancerHistologyMORPHOLOGY (ICD-O CANCER TRANSFORMATION) is the morphology code of the Cancer Transformation using the ICD-O CODE. MORPHOLOGY (ICD-O CANCER TRANSFORMATION) -
CancerTopographyTOPOGRAPHY (ICD-O) is the topographical site of the Tumour using the ICD-O CODE. TOPOGRAPHY (ICD-O)
with BR as (
select
Record ->> '$.Breast.BreastCore.BreastCoreLinkagePatientId.NHSNumber.@extension' as NhsNumber,
Record ->> '$.Breast.BreastCore.BreastCoreLinkageDiagnosticDetails.ClinicalDateCancerDiagnosis' as DiagnosisDate,
Record ->> '$.Breast.BreastCore.BreastCoreLinkageDiagnosticDetails.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed' as NonPrimaryDiagnosisDate,
Record ->> '$.Breast.BreastCore.BreastCoreDiagnosis.MorphologyICDODiagnosis.@code' as CancerHistology,
Record ->> '$.Breast.BreastCore.BreastCoreDiagnosis.TopographyICDO.@code' as CancerTopography,
Record ->> '$.Breast.BreastCore.BreastCoreDiagnosis.BasisOfCancerDiagnosis.@code' as BasisOfDiagnosisCancer,
Record ->> '$.Breast.BreastCore.BreastCoreLinkageDiagnosticDetails.PrimaryDiagnosis.@code' as CancerDiagnosis
from omop_staging.cosd_staging_81
where Type = 'BR'
)
select
distinct
NhsNumber,
coalesce (DiagnosisDate, NonPrimaryDiagnosisDate) as DiagnosisDate,
BasisOfDiagnosisCancer,
CancerHistology,
CancerTopography
from BR
where NhsNumber is not null and
(
DiagnosisDate is not null or
NonPrimaryDiagnosisDate is not null
)
and (CancerHistology is not null and CancerTopography is not null)
Comment or raise an issue for this mapping.
COSD V9 BA Condition Occurrence Secondary Diagnosis ICD
-
Value copied from
SecondaryDiagnosisIcd -
SecondaryDiagnosisIcdICD code used to identify the secondary patient diagnosis. Same as the CLINICAL CLASSIFICATION CODE attribute. For Healthcare Operational Data Flows (Acute), this is the next most relevant patient diagnosis. SECONDARY DIAGNOSIS (ICD)
with ba as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed'
as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.Diagnosis.DiagnosisAdditionalItems.SecondaryDiagnosisIcd.@code'
as SecondaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'BA'
)
select distinct
NhsNumber,
DateOfPrimaryDiagnosisClinicallyAgreed,
SecondaryDiagnosisIcd
from ba
where NhsNumber is not null
and SecondaryDiagnosisIcd is not null
and DateOfPrimaryDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 BA Condition Occurrence Primary Diagnosis ICD
-
Value copied from
PrimaryDiagnosisIcd -
PrimaryDiagnosisIcdICD code used to identify the primary diagnosis. PRIMARY DIAGNOSIS (ICD)
with ba as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed'
as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.PrimaryDiagnosisIcd.@code'
as PrimaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'BA'
)
select distinct
NhsNumber,
DateOfPrimaryDiagnosisClinicallyAgreed,
PrimaryDiagnosisIcd
from ba
where NhsNumber is not null
and PrimaryDiagnosisIcd is not null
and DateOfPrimaryDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 BA Condition Occurrence Original Primary Diagnosis ICD
-
Value copied from
OriginalPrimaryDiagnosisIcd -
OriginalPrimaryDiagnosisIcdICD code used to identify the original primary diagnosis. For COSDS Core, used for cancer recurrence and agreed at the multidisciplinary team meeting by the care professional team. PRIMARY DIAGNOSIS (ICD ORIGINAL)
with ba as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.NonPrimaryPathway.Recurrence.OriginalPrimaryDiagnosisIcd.@code'
as OriginalPrimaryDiagnosisIcd
from omop_staging.cosd_staging_901
where type = 'BA'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
OriginalPrimaryDiagnosisIcd
from ba
where NhsNumber is not null
and OriginalPrimaryDiagnosisIcd is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V9 BA Condition Occurrence Cancer Progression ICD
-
Value copied from
ProgressionIcd -
ProgressionIcdThe International Classification of Diseases (ICD) code of the cancer progression during a Cancer Care Spell. For COSD - Core, this is the ICD code of the original patient diagnosis of the cancer progression, agreed at the multidisciplinary team meeting by the care professional team. CANCER PROGRESSION (ICD ORIGINAL)
with ba as (
select distinct
Record ->> '$.LinkagePatientId.NhsNumber.@extension'
as NhsNumber,
Record ->> '$.NonPrimaryPathway.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.NonPrimaryPathway.Progression.ProgressionIcd.@code'
as ProgressionIcd
from omop_staging.cosd_staging_901
where type = 'BA'
)
select distinct
NhsNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
ProgressionIcd
from ba
where NhsNumber is not null
and ProgressionIcd is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;
Comment or raise an issue for this mapping.
COSD V8 BA Condition Occurrence Provisional Diagnosis ICD
-
Value copied from
ProvisionalDiagnosisICD -
ProvisionalDiagnosisICDICD code used to identify the provisional diagnosis. For COSDS, this is the working patient diagnosis defined at the multidisciplinary team meeting where first definitive treatment is agreed, informed by biopsy, radiology, and other investigations. PROVISIONAL DIAGNOSIS (ICD)
with ba as (
select distinct
Record ->> '$.CNS.CNSCore.CNSCoreLinkagePatientId.NHSNumber.@extension'
as NHSNumber,
Record ->> '$.CNS.CNSCore.CNSCoreCancerCarePlan.CancerMultiTeamDiscussionDate'
as CancerMultiTeamDiscussionDate,
Record ->> '$.CNS.CNSCore.CNSCoreLinkageDiagnosticDetails.ClinicalDateCancerDiagnosis'
as ClinicalDateCancerDiagnosis,
Record ->> '$.CNS.CNSCore.CNSCoreCancerCarePlan.CNSCancerCarePlan.ICDProvisionalDiagnosis.@code'
as ProvisionalDiagnosisICD
from omop_staging.cosd_staging_81
where type = 'BA'
)
select distinct
NHSNumber,
CancerMultiTeamDiscussionDate,
ClinicalDateCancerDiagnosis,
ProvisionalDiagnosisICD
from ba
where NHSNumber is not null
and ProvisionalDiagnosisICD is not null;
Comment or raise an issue for this mapping.
COSD V8 BA Condition Occurrence Primary Diagnosis ICD
-
Value copied from
PrimaryDiagnosisICD -
PrimaryDiagnosisICDICD code used to identify the primary diagnosis. PRIMARY DIAGNOSIS (ICD)
with ba as (
select distinct
Record ->> '$.CNS.CNSCore.CNSCoreLinkagePatientId.NHSNumber.@extension'
as NHSNumber,
Record ->> '$.CNS.CNSCore.CNSCoreLinkageDiagnosticDetails.ClinicalDateCancerDiagnosis'
as ClinicalDateCancerDiagnosis,
Record ->> '$.CNS.CNSCore.CNSCoreLinkageDiagnosticDetails.PrimaryDiagnosis.@code'
as PrimaryDiagnosisICD
from omop_staging.cosd_staging_81
where type = 'BA'
)
select distinct
NHSNumber,
ClinicalDateCancerDiagnosis,
PrimaryDiagnosisICD
from ba
where NHSNumber is not null
and PrimaryDiagnosisICD is not null
and ClinicalDateCancerDiagnosis is not null;
Comment or raise an issue for this mapping.
COSD V8 BA Condition Occurrence Cancer Progression ICD
-
Value copied from
CancerProgressionICD -
CancerProgressionICDThe International Classification of Diseases (ICD) code of the cancer progression during a Cancer Care Spell. For COSD - Core, this is the ICD code of the original patient diagnosis of the cancer progression, agreed at the multidisciplinary team meeting by the care professional team. CANCER PROGRESSION (ICD ORIGINAL)
with ba as (
select distinct
Record ->> '$.CNS.CNSCore.CNSCoreLinkagePatientId.NHSNumber.@extension'
as NHSNumber,
Record ->> '$.CNS.CNSCore.CNSCoreLinkageDiagnosticDetails.DateOfNonPrimaryCancerDiagnosisClinicallyAgreed'
as DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
Record ->> '$.CNS.CNSCore.CNSCoreNonPrimaryCancerPathwayRoute.CancerProgressionICD.@code'
as CancerProgressionICD
from omop_staging.cosd_staging_81
where type = 'BA'
)
select distinct
NHSNumber,
DateOfNonPrimaryCancerDiagnosisClinicallyAgreed,
CancerProgressionICD
from ba
where NHSNumber is not null
and CancerProgressionICD is not null
and DateOfNonPrimaryCancerDiagnosisClinicallyAgreed is not null;