public class Bundles extends Object
| Constructor and Description |
|---|
Bundles() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends org.hl7.fhir.instance.model.api.IBaseResource> |
extractEntry(org.apache.spark.sql.SparkSession spark,
org.apache.spark.api.java.JavaRDD<org.hl7.fhir.dstu3.model.Bundle> bundles,
Class<T> resourceClass)
Extracts the given resource type from the RDD of bundles and returns
it as a Dataset of that type.
|
static <T extends org.hl7.fhir.instance.model.api.IBaseResource> |
extractEntry(org.apache.spark.sql.SparkSession spark,
org.apache.spark.api.java.JavaRDD<org.hl7.fhir.dstu3.model.Bundle> bundles,
String resourceName)
Extracts the given resource type from the RDD of bundles and returns
it as a Dataset of that type.
|
static <T extends org.hl7.fhir.instance.model.api.IBaseResource> |
extractEntry(org.apache.spark.sql.SparkSession spark,
org.apache.spark.api.java.JavaRDD<org.hl7.fhir.dstu3.model.Bundle> bundles,
String resourceName,
FhirEncoders encoders)
Extracts the given resource type from the RDD of bundles and returns
it as a Dataset of that type.
|
static org.apache.spark.api.java.JavaRDD<org.hl7.fhir.dstu3.model.Bundle> |
loadFromDirectory(org.apache.spark.sql.SparkSession spark,
String path,
int minPartitions)
Returns an RDD of bundles loaded from the given path.
|
static void |
saveAsDatabase(org.apache.spark.sql.SparkSession spark,
org.apache.spark.api.java.JavaRDD<org.hl7.fhir.dstu3.model.Bundle> bundles,
String database,
String... resourceNames)
Saves an RDD of bundles as a database, where each table
has the resource name.
|
public static org.apache.spark.api.java.JavaRDD<org.hl7.fhir.dstu3.model.Bundle> loadFromDirectory(org.apache.spark.sql.SparkSession spark,
String path,
int minPartitions)
spark - the spark sessionpath - a path to a directory of FHIR BundlesminPartitions - a suggested value for the minimal number of partitionspublic static <T extends org.hl7.fhir.instance.model.api.IBaseResource> org.apache.spark.sql.Dataset<T> extractEntry(org.apache.spark.sql.SparkSession spark,
org.apache.spark.api.java.JavaRDD<org.hl7.fhir.dstu3.model.Bundle> bundles,
Class<T> resourceClass)
T - the type of the resource being extracted from the bundles.spark - the spark sessionbundles - an RDD of FHIR BundlesresourceClass - the type of resource to extract.public static <T extends org.hl7.fhir.instance.model.api.IBaseResource> org.apache.spark.sql.Dataset<T> extractEntry(org.apache.spark.sql.SparkSession spark,
org.apache.spark.api.java.JavaRDD<org.hl7.fhir.dstu3.model.Bundle> bundles,
String resourceName)
T - the type of the resource being extracted from the bundles.spark - the spark sessionbundles - an RDD of FHIR BundlesresourceName - the FHIR name of the resource type to extract
(e.g., condition, patient, etc).public static <T extends org.hl7.fhir.instance.model.api.IBaseResource> org.apache.spark.sql.Dataset<T> extractEntry(org.apache.spark.sql.SparkSession spark,
org.apache.spark.api.java.JavaRDD<org.hl7.fhir.dstu3.model.Bundle> bundles,
String resourceName,
FhirEncoders encoders)
T - the type of the resource being extracted from the bundles.spark - the spark sessionbundles - an RDD of FHIR BundlesresourceName - the FHIR name of the resource type to extract
(e.g., condition, patient. etc).encoders - the Encoders instance defining how the resources are encoded.public static void saveAsDatabase(org.apache.spark.sql.SparkSession spark,
org.apache.spark.api.java.JavaRDD<org.hl7.fhir.dstu3.model.Bundle> bundles,
String database,
String... resourceNames)
Note this will access the given RDD of bundles once per resource name,
so consumers with enough memory should consider calling
JavaRDD.cache() so that RDD is not recomputed for each.
spark - the spark sessionbundles - an RDD of FHIR Bundlesdatabase - the name of the database to write toresourceNames - names of resources to be extracted from the bundle and writtenCopyright © 2018. All rights reserved.