-
Notifications
You must be signed in to change notification settings - Fork 49
issue-77: add Bundles extractEntry Java api with contained resources #72
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for these additions. A few minor comments.
|
||
FhirContext context = FhirContexts.contextFor(fhirVersion); | ||
|
||
this.converter = SparkRowConverter.forResource(context, resourceTypeUrl); | ||
if (this.containedResourceTypeUrls == null || this.containedResourceTypeUrls.size() == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can we use this.containedResourceTypeUrls.isEmpty()
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed f0d5fdc
public Dataset<Row> extractEntry(SparkSession spark, | ||
JavaRDD<BundleContainer> bundles, | ||
Class resourceClass, | ||
Class... containedClasses) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll need to make this parameter an explicit list. In practice, Java will have difficulty dispatching between this new method and extractEntry
that has the single Class parameter since it can't tell if the call to extractEntry
without a final argument is a call without contained classes, or just with empty contained classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed f0d5fdc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, thanks!
Merged to 0.5.0-dev branch. Thanks for review ! |
Added new Java api for
Bundles extractEntry
api to accept contained resources. Closes #71