Open pnrobinson opened 10 months ago
It turns out pandas does this conversion, so we don't really need a special method for it: https://pandas.pydata.org/docs/reference/api/pandas.Timedelta.isoformat.html
Is onset the same as age_at_diagnosis? What if a patient has had symptoms for two years but just got diagnosed?
phenopackets does not model explicitly the age of diagnosis, but instead would model the age when the disease first manifested. For the purposes of this mapping excercise, probably we need to consider them equivalent though
See the schema here - https://phenopacket-schema.readthedocs.io/en/latest/disease.html
Add a function to cda_disease_factory.py
age at diagnosis is represented as the number of days, e.g. 16606.0
There is a class in the cda_individual_factory that transforms number of days to ISO8601 (e.g. P42Y3M"). Probably we can put this method into the common superclass CdaFactory and use it for both.