Hi, yes, I’m sorry for the confusion between the ‘Derived Tables’ under the CDM repo and the dedicated ‘Era Builder’ repo.
The good news: both algorithms were derived from the same code that I wrote to construct drug eras. In addition, the code in the Era-Constructor repo has been extended to account for gap days in a stockpile and non-stockpile mode. However, the 2 problems I saw with the Era-Constructor repo is that 1) the code is written in a native PostgreSQL dialect, and 2) the code in the v5 no-stockpile code is referencing vocaubulary IDs by number and not name (which is v4 vs. v5). So, that code needs to be updated.
On the CDM ‘Derived Table’ side, there are a couple problems there: 1) it’s not handling gap days at all. 2) there’s some wierd linebreaks in the code. 3) The authorship lines include @Vojtech_Huser, but I can’t see any difference in the logic from what the origional algorithm was: @Vojtech_Huser: did you make any logical changes to the Era Builder logic in the CDM Derived Table location that would constitute co-authorship?
I think having 2 places where this logic lives is problematic, and @Christian_Reich and @Patrick_Ryan should direct us where that code should live. Wherever the final decision is, we can move that code to a single location, make sure it’s updated to work in V5 and account for proper gap_day calculation, and ensure all authorship is properly annotated. Then we should remove the duplicate code from the other repositories (either remove repo Era-Constructor or remove the code from ‘Derived Tables’)…unless someone objects to a single-source of the code…I can understand some confusion if you are looking in the derived tables section of the CDM and you can’t find the era builidng logic. Maybe a README.MD file in derived tables can direct users to the Era Building code. In any case, someone should decide.