Icon

KNIME_​PSA_​Closest_​Not_​Later_​Than 3

Original Result- final test and value at diagnosis date Last 3 tests (up to 3!)and value at diagnosisdate by patient PSA Doubling Time by patient(where it has doubled) Patient Diagnosis DatePatient Test Dates(Updated sample data since first workdlow)Patients with Diag Date andTest Date.Done it as an outer join in case there are patients forwhom there is noTest Date showingGet Difference in daysbetween test date anddiagnosis dateBase column: test dateCompare diff to: diag dateI've done the test this way round soPOSITIVE difference means test was BEFORE diagnosisFilter out any negativeday differencesFor each patient,get row with MAXIMUMtest date, and also the "rank" numberfor this test.Patients with ID,Diagnosis DateLast Test ON OR BEFOREDiagnosis DateOuter join to ensure allpatients appear even ifno test date is shownJoin back to test resultsfor the patient on the giventest date, to pick up the test valuesget test_numfor eachpatientThis is now a list of allof each patients' tests prior to(or on) diagnosis date, with a ranking number(ordinal number) for eachSorted by Patient, Test DateGet antipenultimatetest(as we to keepinfo on finalthree testsat Diagnosis)Original List(Test and PSA Valueat or prior to diagnosis)Join back to test resultsfor the patient id, so we now have the max and min ranking columnagainst each patientrename groupedrank as test_numKeep only past three testsPatients with ID,Diagnosis DateLast Test ON OR BEFOREDiagnosis DateOuter join to ensure allpatients appear even ifno test date is shownOriginal List(Test and PSA Valueat or prior to diagnosis)Patient Test NumSort into patient, date orderJoin every test for each patientto every other test for each patient,and not the PSA valuesdeterminewhich havedoubledRetain Onlythose thathave doubledGet Difference in daysbetween test datesFilter out any negativeday differencesThis would indicate the valuehas halved rather thandoubled(which may only be because of mymade up data)Get FIRST row for each patient? Table Creator Table Creator Joiner Date&TimeDifference Row Filter GroupBy Joiner Joiner Rank Sorter Math Formula Column Filter Joiner Column Rename Rule-basedRow Filter Joiner Column Filter Column Rename Sorter Joiner Column Expressions Row Filter Date&TimeDifference Row Filter DuplicateRow Filter Original Result- final test and value at diagnosis date Last 3 tests (up to 3!)and value at diagnosisdate by patient PSA Doubling Time by patient(where it has doubled) Patient Diagnosis DatePatient Test Dates(Updated sample data since first workdlow)Patients with Diag Date andTest Date.Done it as an outer join in case there are patients forwhom there is noTest Date showingGet Difference in daysbetween test date anddiagnosis dateBase column: test dateCompare diff to: diag dateI've done the test this way round soPOSITIVE difference means test was BEFORE diagnosisFilter out any negativeday differencesFor each patient,get row with MAXIMUMtest date, and also the "rank" numberfor this test.Patients with ID,Diagnosis DateLast Test ON OR BEFOREDiagnosis DateOuter join to ensure allpatients appear even ifno test date is shownJoin back to test resultsfor the patient on the giventest date, to pick up the test valuesget test_numfor eachpatientThis is now a list of allof each patients' tests prior to(or on) diagnosis date, with a ranking number(ordinal number) for eachSorted by Patient, Test DateGet antipenultimatetest(as we to keepinfo on finalthree testsat Diagnosis)Original List(Test and PSA Valueat or prior to diagnosis)Join back to test resultsfor the patient id, so we now have the max and min ranking columnagainst each patientrename groupedrank as test_numKeep only past three testsPatients with ID,Diagnosis DateLast Test ON OR BEFOREDiagnosis DateOuter join to ensure allpatients appear even ifno test date is shownOriginal List(Test and PSA Valueat or prior to diagnosis)Patient Test NumSort into patient, date orderJoin every test for each patientto every other test for each patient,and not the PSA valuesdeterminewhich havedoubledRetain Onlythose thathave doubledGet Difference in daysbetween test datesFilter out any negativeday differencesThis would indicate the valuehas halved rather thandoubled(which may only be because of mymade up data)Get FIRST row for each patient? Table Creator Table Creator Joiner Date&TimeDifference Row Filter GroupBy Joiner Joiner Rank Sorter Math Formula Column Filter Joiner Column Rename Rule-basedRow Filter Joiner Column Filter Column Rename Sorter Joiner Column Expressions Row Filter Date&TimeDifference Row Filter DuplicateRow Filter

Nodes

Extensions

Links