value_source_value
Sus OP Measurement
Source column DiagnosisICD. Resolve Measurement domain ICD10 codes to Maps To Value concepts.
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 Measurement - Person Weight
-
Value copied from
ValueAsNumber -
ValueAsNumberValue of the Person weight PERSON WEIGHT
select distinct
apc.NHSNumber,
apc.GeneratedRecordIdentifier,
cc.CriticalCareStartDate as MeasurementDate,
coalesce(cc.CriticalCareStartTime, '00:00:00') as MeasurementDateTime,
cc.PersonWeight as ValueAsNumber
from omop_staging.sus_CCMDS cc
inner join omop_staging.sus_APC apc on cc.GeneratedRecordID = apc.GeneratedRecordIdentifier
where apc.NHSNumber is not null
and cc.PersonWeight is not null
Comment or raise an issue for this mapping.
Sus APC Measurement
Source column DiagnosisICD. Resolve Measurement domain ICD10 codes to Maps To Value concepts.
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 Measurement Weight at Start of Regimen
-
Value copied from
Weight_At_Start_Of_Regimen -
Weight_At_Start_Of_RegimenWeight when the Regimen started WEIGHT AT START OF REGIMEN
select distinct
NHS_Number,
Weight_At_Start_Of_Regimen,
Start_Date_Of_Regimen
from omop_staging.sact_staging
Comment or raise an issue for this mapping.
SACT Measurement Weight at Start of Cycle
-
Value copied from
Weight_At_Start_Of_Cycle -
Weight_At_Start_Of_CycleWeight when the cycle started WEIGHT AT START OF CYCLE
select distinct
NHS_Number,
Weight_At_Start_Of_Cycle,
Start_Date_Of_Cycle
from omop_staging.sact_staging
Comment or raise an issue for this mapping.
SACT Measurement Height
-
Value copied from
Height_At_Start_Of_Regimen -
Height_At_Start_Of_RegimenHeight when the treatment started HEIGHT AT START OF TREATMENT
select distinct
NHS_Number,
Height_At_Start_Of_Regimen,
Start_Date_Of_Regimen
from omop_staging.sact_staging
Comment or raise an issue for this mapping.
COSD V9 Lung Measurement Surgical Access Type
-
Value copied from
SurgicalAccessType -
SurgicalAccessTypeA code representing the surgical access type used during a procedure. SURGICAL ACCESS TYPE
with LU as (
select
Record ->> '$.PrimaryPathway.ReferralAndFirstStageOfPatientPathway.DateFirstSeen' as DateFirstSeen,
Record ->> '$.PrimaryPathway.ReferralAndFirstStageOfPatientPathway.DateFirstSeenCancerSpecialist' as DateFirstSeenCancerSpecialist,
Record ->> '$.PrimaryPathway.LinkageDiagnosticDetails.DateOfPrimaryDiagnosisClinicallyAgreed' as DateOfPrimaryDiagnosisClinicallyAgreed,
Record ->> '$.PrimaryPathway.Staging.StageDateFinalPretreatmentStage' as StageDateFinalPretreatmentStage,
Record ->> '$.PrimaryPathway.Staging.StageDateIntegratedStage' as StageDateIntegratedStage,
Record ->> '$.Treatment.TreatmentStartDateCancer' as TreatmentStartDateCancer,
Record ->> '$.Treatment.Surgery.ProcedureDate' as ProcedureDate,
Record ->> '$.Treatment.Surgery.SurgicalAccessType.@code' as SurgicalAccessType,
Record ->> '$.LinkagePatientId.NhsNumber.@extension' as NhsNumber
from omop_staging.cosd_staging_901
where type = 'LU'
)
select
distinct
SurgicalAccessType,
NhsNumber,
least(
cast(DateFirstSeen as date),
cast(DateFirstSeenCancerSpecialist as date),
cast(DateOfPrimaryDiagnosisClinicallyAgreed as date),
cast(StageDateFinalPretreatmentStage as date),
cast(nullif(StageDateIntegratedStage, '') as date),
cast(TreatmentStartDateCancer as date),
cast(ProcedureDate as date)
) as Date
from LU o
where o.SurgicalAccessType is not null
and not (
DateFirstSeen is null and
DateFirstSeenCancerSpecialist is null and
DateOfPrimaryDiagnosisClinicallyAgreed is null and
StageDateFinalPretreatmentStage is null and
StageDateIntegratedStage is null and
TreatmentStartDateCancer is null and
ProcedureDate is null
)
Comment or raise an issue for this mapping.
COSD V8 Lung Measurement Surgical Access Type
-
Value copied from
SurgicalAccessType -
SurgicalAccessTypeA code representing the surgical access type used during a procedure. SURGICAL ACCESS TYPE
with LU as (
select
Record ->> '$.Lung.LungCore.LungCoreReferralAndFirstStageOfPatientPathway.DateFirstSeen' as DateFirstSeen,
Record ->> '$.Lung.LungCore.LungCoreReferralAndFirstStageOfPatientPathway.SpecialistDateFirstSeen' as SpecialistDateFirstSeen,
Record ->> '$.Lung.LungCore.LungCoreLinkageDiagnosticDetails.ClinicalDateCancerDiagnosis' as ClinicalDateCancerDiagnosis,
Record ->> '$.Lung.LungCore.LungCoreStaging.IntegratedStageTNMStageGroupingDate' as IntegratedStageTNMStageGroupingDate,
Record ->> '$.Lung.LungCore.LungCoreStaging.FinalPreTreatmentTNMStageGroupingDate' as FinalPreTreatmentTNMStageGroupingDate,
unnest ([[Record ->> '$.Lung.LungCore.LungCoreTreatment.CancerTreatmentStartDate'], Record ->> '$.Lung.LungCore.LungCoreTreatment[*].CancerTreatmentStartDate'], recursive := true) as CancerTreatmentStartDate,
Record ->> '$.Lung.LungCore.LungCoreTreatment.LungCoreSurgeryAndOtherProcedures.ProcedureDate' as ProcedureDate,
Record ->> '$.Lung.LungCore.LungCoreTreatment.LungCoreSurgeryAndOtherProcedures.SurgicalAccessType.@code' as SurgicalAccessType,
Record ->> '$.Lung.LungCore.LungCoreLinkagePatientId.NHSNumber.@extension' as NhsNumber
from omop_staging.cosd_staging_81
where Type = 'LU'
)
select
distinct
SurgicalAccessType,
NhsNumber,
least(
cast (DateFirstSeen as date),
cast (SpecialistDateFirstSeen as date),
cast (ClinicalDateCancerDiagnosis as date),
cast (IntegratedStageTNMStageGroupingDate as date),
cast (FinalPreTreatmentTNMStageGroupingDate as date),
cast (CancerTreatmentStartDate as date),
cast (ProcedureDate as date)
) as Date
from LU o
where o.SurgicalAccessType is not null
and not (
DateFirstSeen is null and
SpecialistDateFirstSeen is null and
ClinicalDateCancerDiagnosis is null and
IntegratedStageTNMStageGroupingDate is null and
FinalPreTreatmentTNMStageGroupingDate is null and
CancerTreatmentStartDate is null and
ProcedureDate is null
)