BRCAChallenge / brca-exchange

Overall management and deployment of the BRCA Exchange web portal and pipeline scripts
http://brcaexchange.org
27 stars 32 forks source link

feat: URLs now default to stable CA_IDs instead of latest variant ID #1487

Closed e-t-k closed 9 months ago

e-t-k commented 9 months ago

Previously: variant URLs are variant/12345 an older-version URL would redirect to variant/12345?redirectedFrom=123 ClinGen Allele Registry IDs (CA_IDs) could be used in the URL, eg variant/CA98765 , but would redirect to variant/12345.

With this change: variant/CA98765 does not redirect. variant/12345 (latest id) redirects to variant/CA98765 variant/123 (older id) redirects to variant/CA98765?redirectedFrom=123

If a latest id doesn't have a CA_ID (eg, the variant was deleted), fallback to the original behavior instead.

The noRedirect=true param can still be added to prevent any of these redirects.

e-t-k commented 9 months ago

Currently in the database there are 1976 variants without a CA_ID ; all of them are deleted.

 select count(id) from currentvariant where "CA_ID" is NULL ;
 count 
-------
  1976

select distinct "CA_ID", "Change_Type_id" from currentvariant where "CA_ID" is NULL ;
 CA_ID | Change_Type_id 
-------+----------------
       |              2

select * from data_changetype;
...
  2 | deleted
melissacline commented 9 months ago

This software change looks straightforward, and this functionality will be great!