Create tables in DB to represent the various formularies #1

Open
opened 3 years ago by youainti · 3 comments
Owner

I want to create a table for each formulary, which contains the list of trials and matched details.

I want to create a table for each formulary, which contains the list of trials and matched details.
Poster
Owner

USP DC

proposed table

usp_dc_matching
    nct_id
    ,cateogory
    ,class
    ,status (approved, rejected, difficult, null)
    ,timestamp

Drafted insert and select

INSERT INTO uspdc_matching 
VALUES
(
    %(nct_id)s
    ,%(category)s
    ,%(class)s
    ,%(status)s
    ,NOW()
)
;



WITH most_recent_status as (
    SELECT 
        *,
        ROW_NUMBER() OVER(PARTITION BY nct_id order by timestamp desc) as rn
    FROM usp_dc_matching
) -- maybe as view
select nct_id
from most_recent_status
where 
    rn = 1
    AND
    status = %(status)s
;
# USP DC proposed table ```sql usp_dc_matching nct_id ,cateogory ,class ,status (approved, rejected, difficult, null) ,timestamp ``` Drafted insert and select ```sql INSERT INTO uspdc_matching VALUES ( %(nct_id)s ,%(category)s ,%(class)s ,%(status)s ,NOW() ) ; WITH most_recent_status as ( SELECT *, ROW_NUMBER() OVER(PARTITION BY nct_id order by timestamp desc) as rn FROM usp_dc_matching ) -- maybe as view select nct_id from most_recent_status where rn = 1 AND status = %(status)s ; ```
Poster
Owner

Completed for USP DC and USP MMG. I don't think I have time for the VA formulary yet.

Completed for USP DC and USP MMG. I don't think I have time for the VA formulary yet.
Poster
Owner

One improvement I would make would be to add tiers to which something can be matched along with a specific plan of how to match.

A couple of issues I ran across while working on this.

  • Some drugs are being tested for off label use
  • Some drugs do not have records in USP DC or MMG datasets.

An improved approach to matching would be nice.

One improvement I would make would be to add tiers to which something can be matched along with a specific plan of how to match. A couple of issues I ran across while working on this. - Some drugs are being tested for off label use - Some drugs do not have records in USP DC or MMG datasets. An improved approach to matching would be nice.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Research/ClinicalTrials_DataLinkers#1
Loading…
There is no content yet.