[
https://issues.apache.org/jira/browse/BEAM-10601?focusedWorklogId=464846&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-464846
]
ASF GitHub Bot logged work on BEAM-10601:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 31/Jul/20 03:10
Start Date: 31/Jul/20 03:10
Worklog Time Spent: 10m
Work Description: George-Wu commented on a change in pull request #12331:
URL: https://github.com/apache/beam/pull/12331#discussion_r463382681
##########
File path: sdks/python/apache_beam/io/gcp/dicomio.py
##########
@@ -426,6 +485,44 @@ def process(self, element):
out = {}
out['status'] = status_code
- out['input'] = None if status_code == 200 else element
+ out['input'] = None if status_code == 200 else dicom_file
out['success'] = (status_code == 200)
- return [out]
+ return out
+
+ def read_dicom_file(self, buffer_element):
+ # Read the file based on different input. If the read fails ,return
+ # an error dict which records input and error messages.
+ try:
+ if self.input_type == 'fileio':
+ f = buffer_element.open()
+ return True, f.read()
+ else:
+ return True, buffer_element
+ except Exception as error_message:
+ error_out = {}
+ error_out['status'] = error_message
+ error_out['input'] = buffer_element
+ error_out['success'] = False
+ return False, error_out
+
+ def process_buffer_element(self, buffer_element):
+ # Thread job runner - each thread stores a DICOM file
+ success, read_result = self.read_dicom_file(buffer_element[0])
+ windows = [buffer_element[1]]
+ value = None
+ if success:
+ value = self.make_request(read_result)
+ else:
+ value = read_result
+ return beam.utils.windowed_value.WindowedValue(
+ value=value, timestamp=0, windows=windows)
Review comment:
Added timestamps
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 464846)
Time Spent: 1h 20m (was: 1h 10m)
> DICOM API Beam IO connector
> ---------------------------
>
> Key: BEAM-10601
> URL: https://issues.apache.org/jira/browse/BEAM-10601
> Project: Beam
> Issue Type: New Feature
> Components: io-py-gcp
> Reporter: Jiahao Wu
> Assignee: Jiahao Wu
> Priority: P2
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
> Create a new Apache Beam I/O connector that helps customers facilitate the
> reading and writing data to the DICOM Healthcare API, it has three components:
> # An Ptransform that takes QIDO request and output result metadata as
> pcollection.
> # An I/O sink that takes DICOM files and writes them to DICOM store via API.
> # An Ptransform that convert pubsub message to Qido search request.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)