pabloem commented on a change in pull request #13786: URL: https://github.com/apache/beam/pull/13786#discussion_r562948219
########## File path: sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/healthcare/FhirSearchParameter.java ########## @@ -0,0 +1,84 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.beam.sdk.io.gcp.healthcare; + +import java.util.Map; +import java.util.Objects; +import org.apache.beam.sdk.coders.DefaultCoder; +import org.checkerframework.checker.nullness.qual.Nullable; + +/** + * FhirSearchParameter represents the query parameters for a FHIR search request, used as a + * parameter for {@link FhirIO.Search}. + */ +@DefaultCoder(FhirSearchParameterCoder.class) +public class FhirSearchParameter<T> { + + private String resourceType; + // The key is used as optional to use as a key for the search query, if there is source + // information to propagate through the pipeline. + private String key; + private @Nullable Map<String, T> queries; + + public FhirSearchParameter(String resourceType, String key, @Nullable Map<String, T> queries) { Review comment: let's keep the constructors private, and have static functions to create it - this will allow us to change the constructor later if necessary. ########## File path: sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/healthcare/FhirSearchParameter.java ########## @@ -0,0 +1,84 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.beam.sdk.io.gcp.healthcare; + +import java.util.Map; +import java.util.Objects; +import org.apache.beam.sdk.coders.DefaultCoder; +import org.checkerframework.checker.nullness.qual.Nullable; + +/** + * FhirSearchParameter represents the query parameters for a FHIR search request, used as a + * parameter for {@link FhirIO.Search}. + */ +@DefaultCoder(FhirSearchParameterCoder.class) +public class FhirSearchParameter<T> { + + private String resourceType; + // The key is used as optional to use as a key for the search query, if there is source + // information to propagate through the pipeline. + private String key; + private @Nullable Map<String, T> queries; + + public FhirSearchParameter(String resourceType, String key, @Nullable Map<String, T> queries) { + this.resourceType = resourceType; + this.key = key; + this.queries = queries; + } + + public FhirSearchParameter(String resourceType, @Nullable Map<String, T> queries) { Review comment: ditto ########## File path: sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/healthcare/FhirSearchParameter.java ########## @@ -0,0 +1,84 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.beam.sdk.io.gcp.healthcare; + +import java.util.Map; +import java.util.Objects; +import org.apache.beam.sdk.coders.DefaultCoder; +import org.checkerframework.checker.nullness.qual.Nullable; + +/** + * FhirSearchParameter represents the query parameters for a FHIR search request, used as a + * parameter for {@link FhirIO.Search}. + */ +@DefaultCoder(FhirSearchParameterCoder.class) +public class FhirSearchParameter<T> { + + private String resourceType; + // The key is used as optional to use as a key for the search query, if there is source + // information to propagate through the pipeline. + private String key; + private @Nullable Map<String, T> queries; Review comment: I think these can all be `final` variables, right? ########## File path: sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/healthcare/FhirSearchParameter.java ########## @@ -0,0 +1,84 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.beam.sdk.io.gcp.healthcare; + +import java.util.Map; +import java.util.Objects; +import org.apache.beam.sdk.coders.DefaultCoder; +import org.checkerframework.checker.nullness.qual.Nullable; + +/** + * FhirSearchParameter represents the query parameters for a FHIR search request, used as a + * parameter for {@link FhirIO.Search}. + */ +@DefaultCoder(FhirSearchParameterCoder.class) +public class FhirSearchParameter<T> { Review comment: will the queries within the `Map` usually be of the same type for a single object and for a whole PCollection? I had understood that for any individual pcollection, these could be very different (Enums, Strings, Numbers?) ########## File path: sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/healthcare/FhirSearchParameter.java ########## @@ -0,0 +1,84 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.beam.sdk.io.gcp.healthcare; + +import java.util.Map; +import java.util.Objects; +import org.apache.beam.sdk.coders.DefaultCoder; +import org.checkerframework.checker.nullness.qual.Nullable; + +/** + * FhirSearchParameter represents the query parameters for a FHIR search request, used as a + * parameter for {@link FhirIO.Search}. Review comment: I wonder if it makes sense to add a few code examples on the Javadoc here ---------------------------------------------------------------- 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]
