Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FHIR source kamelet #91

Merged
merged 5 commits into from
Mar 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/modules/ROOT/assets/images/kamelets/fhir-source.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* xref:ROOT:dropbox-sink.adoc[image:kamelets/dropbox-sink.svg[] Dropbox Sink]
* xref:ROOT:dropbox-source.adoc[image:kamelets/dropbox-source.svg[] Dropbox Source]
* xref:ROOT:earthquake-source.adoc[image:kamelets/earthquake-source.svg[] Earthquake Source]
* xref:ROOT:fhir-source.adoc[image:kamelets/fhir-source.svg[] Fhir Source]
* xref:ROOT:file-watch-source.adoc[image:kamelets/file-watch-source.svg[] File Watch Source]
* xref:ROOT:ftp-source.adoc[image:kamelets/ftp-source.svg[] FTP Source]
* xref:ROOT:ftps-source.adoc[image:kamelets/ftps-source.svg[] FTPS Source]
Expand Down
7 changes: 4 additions & 3 deletions docs/modules/ROOT/pages/aws-ddb-streams-source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ The following table summarizes the configuration options available for the `aws-
| *accessKey {empty}* *| Access Key| The access key obtained from AWS| string| |
| *region {empty}* *| AWS Region| The AWS region to connect to| string| | `"eu-west-1"`
| *secretKey {empty}* *| Secret Key| The secret key obtained from AWS| string| |
| bucketNameOrArn| Table| Name of the DynamoDB table to look at| string| |
| iteratorType| Iterator Type| Defines where in the DynaboDB stream to start getting records. Note that using TRIM_HORIZON can cause a significant delay before the stream has caught up to real-time. if {AT,AFTER}_SEQUENCE_NUMBER are used, then a sequenceNumberProvider MUST be supplied. There are 4 enums and the value can be one of TRIM_HORIZON, LATEST, AT_SEQUENCE_NUMBER, AFTER_SEQUENCE_NUMBER| String| `"LATEST"`|
| sequenceNumberProvider| Sequence Number Provider| Provider for the sequence number when using one of the two ShardIteratorType AT_SEQUENCE_NUMBER or AFTER_SEQUENCE_NUMBER iterator types. Can be a registry reference or a literal sequence number.| string| | `"900000000005745712447"`
| *table {empty}* *| Table| Name of the DynamoDB table to look at| string| |
| iteratorType| Iterator Type| Defines where in the DynaboDB stream to start getting records. Note that using TRIM_HORIZON can cause a significant delay before the stream has caught up to real-time. if {AT,AFTER}_SEQUENCE_NUMBER are used, then a sequenceNumberProvider MUST be supplied. There are 4 enums and the value can be one of TRIM_HORIZON, LATEST, AT_SEQUENCE_NUMBER, AFTER_SEQUENCE_NUMBER| string| `"LATEST"`|
| sequenceNumberProvider| Sequence Number Provider| Provider for the sequence number when using one of the two ShardIteratorType AT_SEQUENCE_NUMBER or AFTER_SEQUENCE_NUMBER iterator types. Can be a registry reference or a literal sequence number.| string| `"000000000000000000000"`| `"900000000005745712447"`
|===

NOTE: Fields marked with ({empty}*) are mandatory.
Expand Down Expand Up @@ -46,6 +46,7 @@ spec:
accessKey: "The Access Key"
region: "eu-west-1"
secretKey: "The Secret Key"
table: "The Table"
sink:
ref:
kind: InMemoryChannel
Expand Down
68 changes: 68 additions & 0 deletions docs/modules/ROOT/pages/fhir-source.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
= image:kamelets/fhir-source.svg[] Fhir Source

*Provided by: "Apache Software Foundation"*

Receive data from Fhir server.

== Configuration Options

The following table summarizes the configuration options available for the `fhir-source` Kamelet:
[width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
|===
| Property| Name| Description| Type| Default| Example
| *password {empty}* *| Password| The password to access the Fhir server| string| |
| *serverUrl {empty}* *| Server URL| The Fhir server url| string| |
| *username {empty}* *| Username| The username to access the Fhir server| string| |
| encoding| encoding| Encoding to use for all request. Possible values are JSON and XML| string| `"JSON"`|
| fhirVersion| Fhir version| The FHIR Version to use. There are 6 enums and the value can be one of DSTU2, DSTU2_HL7ORG, DSTU2_1, DSTU3, R4, R5| string| `"R4"`|
| prettyPrint| Json Pretty Print| Define if the Json must be pretty print or not| boolean| `true`|
| url| URL| The Fhir resource type url| string| `"/Patient"`|
|===

NOTE: Fields marked with ({empty}*) are mandatory.

== Usage

This section summarizes how the `fhir-source` can be used in various contexts.

=== Knative Source

The `fhir-source` Kamelet can be used as Knative source by binding it to a Knative object.

.fhir-source-binding.yaml
[source,yaml]
----
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: fhir-source-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: fhir-source
properties:
password: "The Password"
serverUrl: "The Server URL"
username: "The Username"
sink:
ref:
kind: InMemoryChannel
apiVersion: messaging.knative.dev/v1
name: mychannel

----

Make sure you have xref:latest@camel-k::installation/installation.adoc[Camel K installed] into the Kubernetes cluster you're connected to.

Save the `fhir-source-binding.yaml` file into your hard drive, then configure it according to your needs.

You can run the source using the following command:

[source,shell]
----
kubectl apply -f fhir-source-binding.yaml
----
// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
77 changes: 77 additions & 0 deletions fhir-source.kamelet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
metadata:
name: fhir-source
annotations:
camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOTUuMiAzMDAiPjxzdHlsZT48L3N0eWxlPjxnIGlkPSJMYXllcl8yIj48bGluZWFyR3JhZGllb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bml0cz0idXNlclNwYWNlT25Vc2UiIHgxPSI5My42OTMiIHkxPSIyNjkuMjI5IiB4Mj0iOTMuNjkzIiB5Mj0iMi45NDgiPjxzdG9wIG9mZnNldD0iLjA3MyIgc3RvcC1jb2xvcj0iI2ZmZjhkYSIvPjxzdG9wIG9mZnNldD0iLjI0OCIgc3RvcC1jb2xvcj0iI2ZmZjNhMCIvPjxzdG9wIG9mZnNldD0iLjQ0IiBzdG9wLWNvbG9yPSIjZmZlZDY3Ii8+PHN0b3Agb2Zmc2V0PSIuNjE5IiBzdG9wLWNvbG9yPSIjZmZlOTNiIi8+PHN0b3Agb2Zmc2V0PSIuNzc3IiBzdG9wLWNvbG9yPSIjZmZlNjFiIi8+PHN0b3Agb2Zmc2V0PSIuOTA5IiBzdG9wLWNvbG9yPSIjZmZlNTA3Ii8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZmZlNDAwIi8+PC9saW5lYXJHcmFkaWVudD48cGF0aCBkPSJNMTM3LjcgMi45czEzLjggMzguMi0yMS44IDkzLjEtODQgOTItNDguMSAxNzMuMmMwIDAtMzUuNC00NS41LTEzLjktOTcuNSAyNi43LTY0LjEgOTYuMi05Ny41IDgzLjgtMTY4Ljh6IiBmaWxsPSJ1cmwoI1NWR0lEXzZfKSIvPjwvZz48L3N2Zz4="
camel.apache.org/provider: "Apache Software Foundation"
labels:
camel.apache.org/kamelet.type: "source"
spec:
definition:
title: "Fhir Source"
description: |-
Receive data from Fhir server.
required:
- serverUrl
- username
- password
properties:
serverUrl:
title: Server URL
description: The Fhir server url
type: string
url:
title: URL
description: The Fhir resource type url
type: string
default: "/Patient"
encoding:
title: encoding
description: Encoding to use for all request. Possible values are JSON and XML
type: string
default: "JSON"
fhirVersion:
title: Fhir version
description: The FHIR Version to use. There are 6 enums and the value can be one of DSTU2, DSTU2_HL7ORG, DSTU2_1, DSTU3, R4, R5
type: string
default: "R4"
username:
title: Username
description: The username to access the Fhir server
type: string
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
password:
title: Password
description: The password to access the Fhir server
type: string
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
prettyPrint:
title: Json Pretty Print
description: Define if the Json must be pretty print or not
type: boolean
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:checkbox'
default: true
types:
out:
mediaType: application/json
flow:
from:
uri: "fhir://search/searchByUrl"
parameters:
serverUrl: "{{serverUrl}}"
url: "{{url}}"
encoding: "{{encoding}}"
fhirVersion: "{{fhirVersion}}"
prettyPrint: "{{prettyPrint}}"
username: "{{username}}"
password: "{{password}}"
steps:
- marshal:
fhirJson:
fhir-version: "{{fhirVersion}}"
pretty-print: "{{prettyPrint}}"
- to: "kamelet:sink"