bzkf / onco-analytics-on-fhir

Onco Analytics on FHIR
GNU Affero General Public License v3.0
6 stars 3 forks source link

Observation Tod Ursache #187

Closed jasminziegler closed 2 months ago

jasminziegler commented 2 months ago

Why are we generating so many "empty" observations here - without Todesursache ICD10 or Tod Tumorbedingt or Datum Tod? (see a6_7.csv)

<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns="http://www.w3.org/TR/REC-html40">

OBSERVATIONS TOD URSACHE aus a6_7_cond_obs_v3_datashield.csv

ID | condition_id | date_diagnosis | icdo3_m_date | icd10_code | gender | birthdate | patid_pseudonym | icdo3_m | deceased_datetime | observation_id | patid_pseudonym | cause_death_icd10 | death_cause_tumor | date_death -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- 40311 | 000027c6bf0391ac237… | 05.07.1800 | 05.07.1800 | C56 | female | 0-01 | a | 8441/3 | 17.07.1800| 21a336a596dee6f75309… | a |   |   |   40312 | 000027c6bf0391ac237f… | 05.07.1800 | 05.07.1800 | C56 | female | 0-01 | a | 8441/3 | 17.07.1800| 91ed5564f78aed72c18e… | a |   |   |   40313 | 000027c6bf0391ac237f… | 05.07.1800 | 05.07.1800 | C56 | female | 0-01 | a | 8441/3 | 17.07.1800| B0dbde4b772c62649f1c… | a |   | U | 17.07.1800 40314 | 000027c6bf0391ac237f… | 05.07.1800 | 05.07.1800 | C56 | female | 0-01 | a | 8441/3 | 17.07.1800| D27942a3f1938542b92d… | a |   |   |   40315 | 000027c6bf0391ac237f… | 05.07.1800 | 05.07.1800 | C56 | female | 0-01 | a | 8441/3 | 17.07.1800| F4c73b43c3a96213b75d49… | a |   |   |   40316 | 000027c6bf0391ac237f… | 05.07.1800| 05.07.1800 | C56 | female | 0-01 | a | 8441/3 | 17.07.1800| E10c726585f3ac2bb0368… | a |   |   |  

chgl commented 2 months ago

might be related to joining/exploding. 21a336a596dee6f75309 is onco-core-Observation-TNMp so shouldn't have vitalstatus data.

0dbde4b772c62649f1c is onco-core-Observation-TodUrsache so that's correct.

jasminziegler commented 2 months ago

Why am I getting them in the first place?

a6_7_obs = data.extract("Observation", columns=[ exp("id", "observation_id"), exp("Observation.where(code.coding.system.first()='http://loinc.org' and code.coding.code.first()='68343-3').valueCodeableConcept.coding.where(system='http://fhir.de/CodeSystem/bfarm/icd-10-gm').code", "cause_death_icd10"), exp("Observation.where(code.coding.system.first()='http://loinc.org' and code.coding.code.first()='68343-3').valueCodeableConcept.coding.where(system='http://dktk.dkfz.de/fhir/onco/core/CodeSystem/JNUCS').code", "death_cause_tumor"), exp("Observation.where(code.coding.system.first()='http://loinc.org' and code.coding.code.first()='68343-3').effectiveDateTime", "date_death"), exp("Observation.subject.resolve().ofType(Patient).identifier.value", "patid_pseudonym"), ]
)

I only want those with loinc 68343-3 (see https://simplifier.net/oncology/todursache)

jasminziegler commented 2 months ago

oh the Observation.subject.resolve().ofType(Patient) is missing the loinc code, might be an issue

jasminziegler commented 2 months ago

only getting observation b0dbde4b772c62649f1c6a3968108e8f40e51b4ac9053e5fd0667febf8e58f8e with:

a6_7_obs = data.extract("Observation", columns=[ exp("Observation.where(code.coding.system.first()='http://loinc.org' and code.coding.code.first()='68343-3').id", "observation_id"), exp("Observation.where(code.coding.system.first()='http://loinc.org' and code.coding.code.first()='68343-3').valueCodeableConcept.coding.where(system='http://fhir.de/CodeSystem/bfarm/icd-10-gm').code", "cause_death_icd10"), exp("Observation.where(code.coding.system.first()='http://loinc.org' and code.coding.code.first()='68343-3').valueCodeableConcept.coding.where(system='http://dktk.dkfz.de/fhir/onco/core/CodeSystem/JNUCS').code", "death_cause_tumor"), exp("Observation.where(code.coding.system.first()='http://loinc.org' and code.coding.code.first()='68343-3').effectiveDateTime", "date_death"), exp("Observation.where(code.coding.system.first()='http://loinc.org' and code.coding.code.first()='68343-3').subject.resolve().ofType(Patient).identifier.value", "patid_pseudonym"), ]
)

thank you! closing.