value_as_number
Sus CCMDS Measurement - Gestation Length at Delivery
Source column ValueAsNumber. Converts text to number.
ValueAsNumberValue of the Length of Gestation at Delivery GESTATION LENGTH (AT DELIVERY)
select distinct
apc.NHSNumber,
apc.GeneratedRecordIdentifier,
cc.CriticalCareStartDate as MeasurementDate,
coalesce(cc.CriticalCareStartTime, '00:00:00') as MeasurementDateTime,
cc.GestationLengthAtDelivery 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.GestationLengthAtDelivery is not null
Comment or raise an issue for this mapping.
Sus CCMDS Measurement - Person Weight
Source column ValueAsNumber. Converts text to number.
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.
SACT Measurement Weight at Start of Regimen
Source column Weight_At_Start_Of_Regimen. Converts text to number.
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
Source column Weight_At_Start_Of_Cycle. Converts text to number.
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
Source column Height_At_Start_Of_Regimen. Converts text to number.
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.
CosdV9MeasurementAdultComorbidityEvaluation
Source column AdultComorbidityEvaluation. Converts text to number.
AdultComorbidityEvaluationThe PERSON SCORE recorded during a Cancer Care Spell, where the ASSESSMENT TOOL is ‘Adult Comorbidity Evaluation - 27’. ADULT COMORBIDITY EVALUATION - 27 SCORE
with CO 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,
coalesce(Record ->> '$.Treatment[0].TreatmentStartDateCancer', Record ->> '$.Treatment.TreatmentStartDateCancer') as TreatmentStartDateCancer,
coalesce(Record ->> '$.Treatment[0].Surgery.ProcedureDate', Record ->> '$.Treatment.Surgery.ProcedureDate') as ProcedureDate,
Record ->> '$."CancerCarePlan"."AdultComorbidityEvaluation-27Score"."@code"' as AdultComorbidityEvaluation,
Record ->> '$.LinkagePatientId.NhsNumber.@extension' as NhsNumber
from omop_staging.cosd_staging_901
where type = 'CO'
)
select
distinct
AdultComorbidityEvaluation,
NhsNumber,
least(
cast(DateFirstSeen as date),
cast(DateFirstSeenCancerSpecialist as date),
cast(DateOfPrimaryDiagnosisClinicallyAgreed as date),
cast(StageDateFinalPretreatmentStage as date),
cast(StageDateIntegratedStage as date),
cast(TreatmentStartDateCancer as date),
cast(ProcedureDate as date)
) as MeasurementDate
from CO o
where o.AdultComorbidityEvaluation 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 Measurement Tumour Height Above Anal Verge
Source column TumourHeightAboveAnalVerge. Converts text to number.
TumourHeightAboveAnalVergeIs the approximate height of the lower limit of the Tumour above the anal verge (as measured by a rigid sigmoidoscopy) during a Colorectal Cancer Care Spell, where the UNIT OF MEASUREMENT is ‘Centimetres (cm)’ TUMOUR HEIGHT ABOVE ANAL VERGE
with co as (
select
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreLinkagePatientId.NHSNumber.@extension' as NhsNumber,
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreLinkageDiagnosticDetails.ClinicalDateCancerDiagnosis' as ClinicalDateCancerDiagnosis,
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreDiagnosis.ColorectalDiagnosis.TumourHeightAboveAnalVerge.@value' as TumourHeightAboveAnalVerge
from omop_staging.cosd_staging_81
where Type = 'CO'
)
select distinct
NhsNumber,
ClinicalDateCancerDiagnosis,
TumourHeightAboveAnalVerge
from co
where TumourHeightAboveAnalVerge is not null;
Comment or raise an issue for this mapping.
CosdV8MeasurementAdultComorbidityEvaluation
Source column AdultComorbidityEvaluation. Converts text to number.
AdultComorbidityEvaluationThe PERSON SCORE recorded during a Cancer Care Spell, where the ASSESSMENT TOOL is ‘Adult Comorbidity Evaluation - 27’. ADULT COMORBIDITY EVALUATION - 27 SCORE
with CO as (
select
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreReferralAndFirstStageOfPatientPathway.DateFirstSeen' as DateFirstSeen,
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreReferralAndFirstStageOfPatientPathway.SpecialistDateFirstSeen' as SpecialistDateFirstSeen,
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreLinkageDiagnosticDetails.ClinicalDateCancerDiagnosis' as ClinicalDateCancerDiagnosis,
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreStaging.IntegratedStageTNMStageGroupingDate' as IntegratedStageTNMStageGroupingDate,
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreStaging.FinalPreTreatmentTNMStageGroupingDate' as FinalPreTreatmentTNMStageGroupingDate,
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreTreatment.CancerTreatmentStartDate' as CancerTreatmentStartDate,
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreTreatment.ColorectalCoreSurgeryAndOtherProcedures.ProcedureDate' as ProcedureDate,
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreCancerCarePlan.AdultComorbidityEvaluation.@code' as AdultComorbidityEvaluation,
Record ->> '$.Colorectal.ColorectalCore.ColorectalCoreLinkagePatientId.NHSNumber.@extension' as NhsNumber
from omop_staging.cosd_staging_81
where Type = 'CO'
)
select
distinct
AdultComorbidityEvaluation,
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 MeasurementDate
from CO o
where o.AdultComorbidityEvaluation 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
)
Comment or raise an issue for this mapping.
CosdV9BreastMeasurementAdultComorbidityEvaluation
Source column AdultComorbidityEvaluation. Converts text to number.
AdultComorbidityEvaluationAdult Comorbidity Evaluation Score AdultComorbidityEvaluation-27Score
with BR 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,
coalesce(
Record ->> '$.Treatment[0].TreatmentStartDateCancer',
Record ->> '$.Treatment.TreatmentStartDateCancer'
) as TreatmentStartDateCancer,
coalesce(
Record ->> '$.Treatment[0].Surgery.ProcedureDate',
Record ->> '$.Treatment.Surgery.ProcedureDate'
) as ProcedureDate,
-- Quoting used to handle the hyphen in the field name safely
Record ->> '$."CancerCarePlan"."AdultComorbidityEvaluation-27Score"."@code"' as AdultComorbidityEvaluation,
Record ->> '$.LinkagePatientId.NhsNumber.@extension' as NhsNumber
from omop_staging.cosd_staging_901
where type = 'BR'
)
select
distinct
AdultComorbidityEvaluation,
NhsNumber,
least(
cast(DateFirstSeen as date),
cast(DateFirstSeenCancerSpecialist as date),
cast(DateOfPrimaryDiagnosisClinicallyAgreed as date),
cast(StageDateFinalPretreatmentStage as date),
cast(StageDateIntegratedStage as date),
cast(TreatmentStartDateCancer as date),
cast(ProcedureDate as date)
) as MeasurementDate
from BR o
where o.AdultComorbidityEvaluation 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.
CosdV8BreastMeasurementAdultComorbidityEvaluation
Source column AdultComorbidityEvaluation. Converts text to number.
AdultComorbidityEvaluationAdult Comorbidity Evaluation-27 score indicating the severity of comorbid conditions ADULT COMORBIDITY EVALUATION-27 SCORE
with BR as (
select
Record ->> '$.Breast.BreastCore.BreastCoreReferralAndFirstStageOfPatientPathway.DateFirstSeen' as DateFirstSeen,
Record ->> '$.Breast.BreastCore.BreastCoreReferralAndFirstStageOfPatientPathway.DateFirstSeenCancerSpecialist' as DateFirstSeenCancerSpecialist,
Record ->> '$.Breast.BreastCore.BreastCoreLinkageDiagnosticDetails.ClinicalDateCancerDiagnosis' as ClinicalDateCancerDiagnosis,
Record ->> '$.Breast.BreastCore.BreastCoreStaging.IntegratedStageTNMStageGroupingDate' as IntegratedStageTNMStageGroupingDate,
Record ->> '$.Breast.BreastCore.BreastCoreStaging.FinalPreTreatmentTNMStageGroupingDate' as FinalPreTreatmentTNMStageGroupingDate,
Record ->> '$.Breast.BreastCore.BreastCoreTreatment.CancerTreatmentStartDate' as CancerTreatmentStartDate,
Record ->> '$.Breast.BreastCore.BreastCoreTreatment.BreastCoreSurgeryAndOtherProcedures.ProcedureDate' as ProcedureDate,
Record ->> '$.Breast.BreastCore.BreastCoreCancerCarePlan.AdultComorbidityEvaluation.@code' as AdultComorbidityEvaluation,
Record ->> '$.Breast.BreastCore.BreastCoreLinkagePatientId.NHSNumber.@extension' as NhsNumber
from omop_staging.cosd_staging_81
where Type = 'BR'
)
select
distinct
AdultComorbidityEvaluation,
NhsNumber,
least(
cast (DateFirstSeen as date),
cast (DateFirstSeenCancerSpecialist as date),
cast (ClinicalDateCancerDiagnosis as date),
cast (IntegratedStageTNMStageGroupingDate as date),
cast (FinalPreTreatmentTNMStageGroupingDate as date),
cast (CancerTreatmentStartDate as date),
cast (ProcedureDate as date)
) as MeasurementDate
from BR o
where o.AdultComorbidityEvaluation is not null
and not (
DateFirstSeen is null and
DateFirstSeenCancerSpecialist is null and
ClinicalDateCancerDiagnosis is null and
IntegratedStageTNMStageGroupingDate is null and
FinalPreTreatmentTNMStageGroupingDate is null and
CancerTreatmentStartDate is null and
ProcedureDate is null
);