monarch-initiative / oncoexporter

Cancer data to GA4GH phenopacket
https://monarch-initiative.github.io/oncoexporter
MIT License
6 stars 1 forks source link

Formula to calculate `survival_time_in_days` when patient is alive #87

Open sujaypatil96 opened 3 months ago

sujaypatil96 commented 3 months ago

Notes from discussion with @justaddcoffee on 4/16.

If person/patient is "Alive" then we need a way of populating survival time in days, and we can do that as follows:

when we last saw the patient (day of last encounter) - when the patient was diagnosed

In the GDC API, the field that corresponds to each of the above variables is:

justaddcoffee commented 2 months ago

@sujaypatil96 we hacked on this a bit today. We observed that in the current code, survival time for Alive patients was often negative.

We think that is because last_follow_up means days since diagnosis (not days since birth): Via: https://docs.gdc.cancer.gov/Data_Dictionary/viewer/#?view=table-definition-view&id=diagnosis&anchor=days_to_last_follow_up "days_to_last_follow_up: Time interval from the date of last follow up to the date of initial pathologic diagnosis, represented as a calculated number of days."

So, we've changed the code accordingly. Does this look correct to you?

sujaypatil96 commented 2 months ago

@justaddcoffee yup, the code makes sense to me. All that needs to be returned is the "days_to_last_follow_up".

Do we need to comment out the code that makes calls to _process_vital_status() here?

justaddcoffee commented 2 months ago

@sujaypatil96 is _process_vital_status() not being used? I just ran the code through a debugger and it seems this is still the way we are populating vital status for the phenopacket, right?