-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add(bam delivery message) (#3876) (patch)
# Description add bam delivery message
- Loading branch information
1 parent
b938852
commit 1e08f4a
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from cg.services.delivery_message.messages.delivery_message import DeliveryMessage | ||
from cg.services.delivery_message.messages.utils import get_caesar_delivery_path | ||
from cg.store.models import Case | ||
|
||
|
||
class BamMessage(DeliveryMessage): | ||
|
||
def create_message(self, cases: list[Case]) -> str: | ||
delivery_path: str = get_caesar_delivery_path(cases[0]) | ||
return ( | ||
f"Hello,\n\n" | ||
f"The following samples in this order have been sequenced:\n\n" | ||
f"{self.generate_sample_name_list(cases)}\n\n" | ||
f"The bam files have been uploaded to your inbox on Caesar at:\n\n" | ||
f"{delivery_path}" | ||
) | ||
|
||
@staticmethod | ||
def generate_sample_name_list(cases: list[Case]) -> str: | ||
return "\n".join([sample.name for case in cases for sample in case.samples]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters