Clinical-Genomics / cg

Glue between Clinical Genomics apps
8 stars 2 forks source link

Get delivery message for fluffy manual reruns retrieves wrong link to Statina #3115

Open beatrizsavinhas opened 7 months ago

beatrizsavinhas commented 7 months ago

Description

When a Statina batch needs to be re-analysed, the convention in production to name the new case is to add a "2" in the name to distinguish from the original case - see Create a new case for re-analysis. This results in the new case having a name with the format <ticket>-<batch_id>-2-NIPT. However, when uploading to Statina, the rerun batch will have the same name as the original case, as such, the Statina link for the rerun case is actually in the format https://statina.clinicalgenomics.se/batches/<batch_id>-NIPT. In this case, the Get delivery message retrieves a link based on the new case name, i.e. https://statina.clinicalgenomics.se/batches/<batch_id>-2-NIPT, which in actuality doesn't exist.

Suggested solution

When generating the link to a case in Statina, use instead the following logic:

  1. Split case_name by "-" and get the second part
  2. Split result from 1 by "-" and get the first part (corresponding to batch_id)
  3. Then add "-nipt" to the link to statina

This can be closed when

Get delivery message generates for fluffy manual reruns retrieves the correct link to Statina.

Blocked by

Nothing to my knowledge.

Clarification

The delivery message for fluffy-analyses is malformed if the case is a re-run with an existing reference (created by production).

Currently, the batch_id is a concatenation of the case name and the batch of the order for the fluffy/ NIPT analysis. When re-running an analysis the batch_id gets updated with the batch_id of the original run instead of the re-run.

beatrizsavinhas commented 2 months ago

@Clinical-Genomics/prodbioinfo Do we just care that the message includes the correct link? Or would we like the batch to be uploaded to Statina with a different name?

beatrizsavinhas commented 2 months ago

@karlnyr will ask if customer needs the batch_id to remain the same or if we can change it. Blocked until we have this information.

karlnyr commented 2 months ago

We have not received any response, thus I do not think that the customer cares at all. Thus I say that we can proceed with this change.

The proposed change I think would be the best is if the batch name in Statina reflects the one that we have in StatusDB. Meaning, that when we change a case in some way, and we follow our instructions in atlas we should reflect that name in the batch uploaded.

Today, a case name in Fluffy is named after the following logic: <ticket_id>-<batch>_NIPT.

This is bad, mainly because we do not allow other users to create case names with "_" in them. Further, the ticket_id in the name is redundant, since we already have a "tickets" attribute on case. So this should be changed.

This means the following:

HOWEVER, if we construct the links based on this logic it will break the links for all old cases in Statina. Because those cases have the ticket in their name but are named like <batch>_NIPT in statina. I thus suggest that we would change the names of old fluffy cases to remove the ticket_id, harmonizing the databases.

diitaz93 commented 1 month ago

@islean will look into this and present in refinement