OHDSI / CommonDataModel

Definition and DDLs for the OMOP Common Data Model (CDM)
https://ohdsi.github.io/CommonDataModel
889 stars 451 forks source link

Revisit the *_ERA queries #451

Open clairblacketer opened 3 years ago

clairblacketer commented 3 years ago

Right now the ERA queries use all data to create eras, even data outside of observation periods. We should make a decision on how the eras should be built and revise the queries accordingly.

cgreich commented 3 years ago

Yikes. Let's bring it on. Obviously, the closed system with the two axioms (everything that happened has a record, if there is no record it didn't happen) is only defined to be true within the observation period.

clairblacketer commented 3 years ago

@cgreich I am going to add it to our list of conventions to discuss in the coming year.

ablack3 commented 2 years ago

Is the "DOSE_ERA" SQL available on the CDM website? I don't see it here https://ohdsi.github.io/CommonDataModel/sqlScripts.html.

ablack3 commented 2 years ago

the two axioms (everything that happened has a record, if there is no record it didn't happen)

I think the second axiom is equivalent to the first. In logic (A implies B) is equivalent to (not B implies not A) where the latter is called the contrapositive of the former.

So let A = "it happened" B = "there is a record"

(If it happened then there is a record) is logically equivalent to (if there is no record then it did not happen)

I don't mean to be pedantic. Just pointing out we only need one axiom and get the second statement for free as an implication. This is the first time I've heard these axioms.

What about this for axiom 2? "If it didn't happen then there is no record" Then observation periods give us: "There a record if and only if it happened."

ablack3 commented 1 year ago

Linking related issue to add era scripts to the DDL https://github.com/OHDSI/CommonDataModel/issues/551

clairblacketer commented 1 day ago

related to #464