Skip to content

Commit

Permalink
PRMP-1122 add url to attachment
Browse files Browse the repository at this point in the history
  • Loading branch information
NogaNHS committed Dec 6, 2024
1 parent d530219 commit c9b9776
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 0 additions & 2 deletions lambdas/models/nhs_document_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def __init__(
sub_folder: str = "",
doc_type: str = "",
uploading: bool = False,
size: int = None,
) -> None:
date_now = datetime.now(timezone.utc)

Expand All @@ -48,7 +47,6 @@ def __init__(
self.file_location = self.set_file_location()
self.uploading = uploading
self.last_updated = int(date_now.timestamp())
self.size = size

def set_file_location(self):
file_location = f"s3://{self.s3_bucket_name}"
Expand Down
7 changes: 6 additions & 1 deletion lambdas/services/bulk_upload_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,13 @@ def handle_sqs_message(self, message: dict):
file_size = self.s3_repository.file_size_on_lg_bycket(
last_document_processed.s3_file_key()
)
document_api_endpoint = (
os.environ.get("APIM_API_URL", "")
+ "/DocumentReference/"
+ last_document_processed.id
)
doc_details = NrlAttachment(
url=last_document_processed.id,
url=document_api_endpoint,
size=file_size,
title=last_document_processed.file_name,
creation=last_document_processed.created,
Expand Down

0 comments on commit c9b9776

Please sign in to comment.