You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/08/13 20:29:00 UTC

[jira] [Work logged] (BEAM-10512) Add parsedData to Hl7v2Message to allows users not using schematized parsing to utilized HL7v2IO

     [ https://issues.apache.org/jira/browse/BEAM-10512?focusedWorklogId=470405&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-470405 ]

ASF GitHub Bot logged work on BEAM-10512:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/Aug/20 20:28
            Start Date: 13/Aug/20 20:28
    Worklog Time Spent: 10m 
      Work Description: lastomato commented on a change in pull request #12320:
URL: https://github.com/apache/beam/pull/12320#discussion_r470226727



##########
File path: sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/healthcare/HL7v2Message.java
##########
@@ -52,16 +55,19 @@ public String toString() {
    * @return the hl7v2 message
    */
   public static HL7v2Message fromModel(Message msg) {
-    SchematizedData schematizedData = msg.getSchematizedData();
-    return new HL7v2Message(
-        msg.getName(),
-        msg.getMessageType(),
-        msg.getSendTime(),
-        msg.getCreateTime(),
-        msg.getData(),
-        msg.getSendFacility(),
-        schematizedData != null ? schematizedData.getData() : null,
-        msg.getLabels());
+    HL7v2MessageBuilder mb =
+        new HL7v2MessageBuilder(
+            msg.getName(),
+            msg.getMessageType(),
+            msg.getSendTime(),
+            msg.getCreateTime(),
+            msg.getData(),
+            msg.getSendFacility());
+    mb.parsedData = msg.getParsedData();

Review comment:
       nit: please use the setters

##########
File path: sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/healthcare/HL7v2Message.java
##########
@@ -77,28 +83,66 @@ public Message toModel() {
     out.setCreateTime(this.getCreateTime());
     out.setData(this.getData());
     out.setSendFacility(this.getSendFacility());
-    out.setSchematizedData(new SchematizedData().setData(this.schematizedData));
-    out.setLabels(this.labels);
+    if (this.getParsedData() != null) {
+      out.setParsedData(this.getParsedData());
+    }
+    if (this.getSchematizedData() != null) {
+      out.setSchematizedData(new SchematizedData().setData(this.schematizedData));
+    }
+    if (this.getLabels() != null) {
+      out.setLabels(this.labels);

Review comment:
       nit: the null checks here are redundant since the setters take nullable inputs.




----------------------------------------------------------------
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:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 470405)
    Remaining Estimate: 47h  (was: 47h 10m)
            Time Spent: 1h  (was: 50m)

> Add parsedData to Hl7v2Message to allows users not using schematized parsing to utilized HL7v2IO
> ------------------------------------------------------------------------------------------------
>
>                 Key: BEAM-10512
>                 URL: https://issues.apache.org/jira/browse/BEAM-10512
>             Project: Beam
>          Issue Type: Improvement
>          Components: io-java-gcp
>    Affects Versions: 2.22.0
>            Reporter: David Anderson
>            Assignee: David Anderson
>            Priority: P2
>              Labels: GCP, beginner
>   Original Estimate: 48h
>          Time Spent: 1h
>  Remaining Estimate: 47h
>
> Hl7v2Message class is used as model for data returned from healthcare API HL7v2 message methods. Currently it only supports the ability to utilize the schematizedData field from the response object. Adding support for the parsedData field will open use of the HL7v2IO Connector to a larger customer base of the Healthcare API



--
This message was sent by Atlassian Jira
(v8.3.4#803005)