hsdp.CdrSubscription
Explore with Pulumi AI
Provides a resource for managing FHIR Subscriptions in a CDR.
The only supported channel type is rest-webhook
therefore the endpoint
and headers
are top-level arguments.
Example Usage
The following example creates a subscription that calls a REST endpoint whenever a Patient resources is changed in the CDR FHIR store
import * as pulumi from "@pulumi/pulumi";
import * as hsdp from "@pulumi/hsdp";
const sandbox = hsdp.getCdrFhirStore({
baseUrl: "https://cdr-stu3-sandbox.hsdp.io",
fhirOrgId: _var.org_id,
});
const test = new hsdp.CdrOrg("test", {
fhirStore: sandbox.then(sandbox => sandbox.endpoint),
version: "r4",
orgId: hsdp_iam_org.test.id,
});
const patientChanges = new hsdp.CdrSubscription("patientChanges", {
fhirStore: test.fhirStore,
version: "r4",
criteria: "Patient",
reason: "Notification for patient changes",
endpoint: "https://webhook.myapp.io/patient",
deleteEndpoint: "https://webhook.myapp.io/patient_deleted",
headers: ["Authorization: Basic cm9uOnN3YW5zb24="],
end: "2030-12-31T23:59:59Z",
});
import pulumi
import pulumi_hsdp as hsdp
sandbox = hsdp.get_cdr_fhir_store(base_url="https://cdr-stu3-sandbox.hsdp.io",
fhir_org_id=var["org_id"])
test = hsdp.CdrOrg("test",
fhir_store=sandbox.endpoint,
version="r4",
org_id=hsdp_iam_org["test"]["id"])
patient_changes = hsdp.CdrSubscription("patientChanges",
fhir_store=test.fhir_store,
version="r4",
criteria="Patient",
reason="Notification for patient changes",
endpoint="https://webhook.myapp.io/patient",
delete_endpoint="https://webhook.myapp.io/patient_deleted",
headers=["Authorization: Basic cm9uOnN3YW5zb24="],
end="2030-12-31T23:59:59Z")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/hsdp/hsdp"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
sandbox, err := hsdp.GetCdrFhirStore(ctx, &hsdp.GetCdrFhirStoreArgs{
BaseUrl: "https://cdr-stu3-sandbox.hsdp.io",
FhirOrgId: _var.Org_id,
}, nil)
if err != nil {
return err
}
test, err := hsdp.NewCdrOrg(ctx, "test", &hsdp.CdrOrgArgs{
FhirStore: pulumi.String(sandbox.Endpoint),
Version: pulumi.String("r4"),
OrgId: pulumi.Any(hsdp_iam_org.Test.Id),
})
if err != nil {
return err
}
_, err = hsdp.NewCdrSubscription(ctx, "patientChanges", &hsdp.CdrSubscriptionArgs{
FhirStore: test.FhirStore,
Version: pulumi.String("r4"),
Criteria: pulumi.String("Patient"),
Reason: pulumi.String("Notification for patient changes"),
Endpoint: pulumi.String("https://webhook.myapp.io/patient"),
DeleteEndpoint: pulumi.String("https://webhook.myapp.io/patient_deleted"),
Headers: pulumi.StringArray{
pulumi.String("Authorization: Basic cm9uOnN3YW5zb24="),
},
End: pulumi.String("2030-12-31T23:59:59Z"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Hsdp = Pulumi.Hsdp;
return await Deployment.RunAsync(() =>
{
var sandbox = Hsdp.GetCdrFhirStore.Invoke(new()
{
BaseUrl = "https://cdr-stu3-sandbox.hsdp.io",
FhirOrgId = @var.Org_id,
});
var test = new Hsdp.CdrOrg("test", new()
{
FhirStore = sandbox.Apply(getCdrFhirStoreResult => getCdrFhirStoreResult.Endpoint),
Version = "r4",
OrgId = hsdp_iam_org.Test.Id,
});
var patientChanges = new Hsdp.CdrSubscription("patientChanges", new()
{
FhirStore = test.FhirStore,
Version = "r4",
Criteria = "Patient",
Reason = "Notification for patient changes",
Endpoint = "https://webhook.myapp.io/patient",
DeleteEndpoint = "https://webhook.myapp.io/patient_deleted",
Headers = new[]
{
"Authorization: Basic cm9uOnN3YW5zb24=",
},
End = "2030-12-31T23:59:59Z",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.hsdp.HsdpFunctions;
import com.pulumi.hsdp.inputs.GetCdrFhirStoreArgs;
import com.pulumi.hsdp.CdrOrg;
import com.pulumi.hsdp.CdrOrgArgs;
import com.pulumi.hsdp.CdrSubscription;
import com.pulumi.hsdp.CdrSubscriptionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var sandbox = HsdpFunctions.getCdrFhirStore(GetCdrFhirStoreArgs.builder()
.baseUrl("https://cdr-stu3-sandbox.hsdp.io")
.fhirOrgId(var_.org_id())
.build());
var test = new CdrOrg("test", CdrOrgArgs.builder()
.fhirStore(sandbox.applyValue(getCdrFhirStoreResult -> getCdrFhirStoreResult.endpoint()))
.version("r4")
.orgId(hsdp_iam_org.test().id())
.build());
var patientChanges = new CdrSubscription("patientChanges", CdrSubscriptionArgs.builder()
.fhirStore(test.fhirStore())
.version("r4")
.criteria("Patient")
.reason("Notification for patient changes")
.endpoint("https://webhook.myapp.io/patient")
.deleteEndpoint("https://webhook.myapp.io/patient_deleted")
.headers("Authorization: Basic cm9uOnN3YW5zb24=")
.end("2030-12-31T23:59:59Z")
.build());
}
}
resources:
test:
type: hsdp:CdrOrg
properties:
fhirStore: ${sandbox.endpoint}
version: r4
orgId: ${hsdp_iam_org.test.id}
patientChanges:
type: hsdp:CdrSubscription
properties:
# Refer to the fhir_store through the CDR Organization
fhirStore: ${test.fhirStore}
version: r4
criteria: Patient
reason: Notification for patient changes
endpoint: https://webhook.myapp.io/patient
deleteEndpoint: https://webhook.myapp.io/patient_deleted
headers:
- 'Authorization: Basic cm9uOnN3YW5zb24='
end: 2030-12-31T23:59:59Z
variables:
sandbox:
fn::invoke:
function: hsdp:getCdrFhirStore
arguments:
baseUrl: https://cdr-stu3-sandbox.hsdp.io
fhirOrgId: ${var.org_id}
CDR will send a POST
request to the endpoint with a JSON body containing:
{
"logicalId": "df08e38a-4ac7-4434-bca9-479aaab32585",
"versionId": "df08e38a-4ac7-4434-bca9-479aaab32585",
"resourceType": "Patient"
}
Create CdrSubscription Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CdrSubscription(name: string, args: CdrSubscriptionArgs, opts?: CustomResourceOptions);
@overload
def CdrSubscription(resource_name: str,
args: CdrSubscriptionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CdrSubscription(resource_name: str,
opts: Optional[ResourceOptions] = None,
criteria: Optional[str] = None,
end: Optional[str] = None,
fhir_store: Optional[str] = None,
reason: Optional[str] = None,
cdr_subscription_id: Optional[str] = None,
delete_endpoint: Optional[str] = None,
endpoint: Optional[str] = None,
headers: Optional[Sequence[str]] = None,
version: Optional[str] = None)
func NewCdrSubscription(ctx *Context, name string, args CdrSubscriptionArgs, opts ...ResourceOption) (*CdrSubscription, error)
public CdrSubscription(string name, CdrSubscriptionArgs args, CustomResourceOptions? opts = null)
public CdrSubscription(String name, CdrSubscriptionArgs args)
public CdrSubscription(String name, CdrSubscriptionArgs args, CustomResourceOptions options)
type: hsdp:CdrSubscription
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args CdrSubscriptionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args CdrSubscriptionArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args CdrSubscriptionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CdrSubscriptionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CdrSubscriptionArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var cdrSubscriptionResource = new Hsdp.CdrSubscription("cdrSubscriptionResource", new()
{
Criteria = "string",
End = "string",
FhirStore = "string",
Reason = "string",
CdrSubscriptionId = "string",
DeleteEndpoint = "string",
Endpoint = "string",
Headers = new[]
{
"string",
},
Version = "string",
});
example, err := hsdp.NewCdrSubscription(ctx, "cdrSubscriptionResource", &hsdp.CdrSubscriptionArgs{
Criteria: pulumi.String("string"),
End: pulumi.String("string"),
FhirStore: pulumi.String("string"),
Reason: pulumi.String("string"),
CdrSubscriptionId: pulumi.String("string"),
DeleteEndpoint: pulumi.String("string"),
Endpoint: pulumi.String("string"),
Headers: pulumi.StringArray{
pulumi.String("string"),
},
Version: pulumi.String("string"),
})
var cdrSubscriptionResource = new CdrSubscription("cdrSubscriptionResource", CdrSubscriptionArgs.builder()
.criteria("string")
.end("string")
.fhirStore("string")
.reason("string")
.cdrSubscriptionId("string")
.deleteEndpoint("string")
.endpoint("string")
.headers("string")
.version("string")
.build());
cdr_subscription_resource = hsdp.CdrSubscription("cdrSubscriptionResource",
criteria="string",
end="string",
fhir_store="string",
reason="string",
cdr_subscription_id="string",
delete_endpoint="string",
endpoint="string",
headers=["string"],
version="string")
const cdrSubscriptionResource = new hsdp.CdrSubscription("cdrSubscriptionResource", {
criteria: "string",
end: "string",
fhirStore: "string",
reason: "string",
cdrSubscriptionId: "string",
deleteEndpoint: "string",
endpoint: "string",
headers: ["string"],
version: "string",
});
type: hsdp:CdrSubscription
properties:
cdrSubscriptionId: string
criteria: string
deleteEndpoint: string
end: string
endpoint: string
fhirStore: string
headers:
- string
reason: string
version: string
CdrSubscription Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The CdrSubscription resource accepts the following input properties:
- Criteria string
- On which resource to notify
- End string
- RFC3339 formatted timestamp when to end notifications
- Fhir
Store string - Reason string
- Reason for creating the subscription
- Cdr
Subscription stringId - The ID of the CDR subscription
- Delete
Endpoint string - The REST endpoint to call for DELETE operations. Must use
https://
schema - Endpoint string
- The REST endpoint to call. Must use
https://
schema - Headers List<string>
- List of headers to add to the REST call
- Version string
- The FHIR version to use. Options [
stu3
|r4
]. Default isstu3
- Criteria string
- On which resource to notify
- End string
- RFC3339 formatted timestamp when to end notifications
- Fhir
Store string - Reason string
- Reason for creating the subscription
- Cdr
Subscription stringId - The ID of the CDR subscription
- Delete
Endpoint string - The REST endpoint to call for DELETE operations. Must use
https://
schema - Endpoint string
- The REST endpoint to call. Must use
https://
schema - Headers []string
- List of headers to add to the REST call
- Version string
- The FHIR version to use. Options [
stu3
|r4
]. Default isstu3
- criteria String
- On which resource to notify
- end String
- RFC3339 formatted timestamp when to end notifications
- fhir
Store String - reason String
- Reason for creating the subscription
- cdr
Subscription StringId - The ID of the CDR subscription
- delete
Endpoint String - The REST endpoint to call for DELETE operations. Must use
https://
schema - endpoint String
- The REST endpoint to call. Must use
https://
schema - headers List<String>
- List of headers to add to the REST call
- version String
- The FHIR version to use. Options [
stu3
|r4
]. Default isstu3
- criteria string
- On which resource to notify
- end string
- RFC3339 formatted timestamp when to end notifications
- fhir
Store string - reason string
- Reason for creating the subscription
- cdr
Subscription stringId - The ID of the CDR subscription
- delete
Endpoint string - The REST endpoint to call for DELETE operations. Must use
https://
schema - endpoint string
- The REST endpoint to call. Must use
https://
schema - headers string[]
- List of headers to add to the REST call
- version string
- The FHIR version to use. Options [
stu3
|r4
]. Default isstu3
- criteria str
- On which resource to notify
- end str
- RFC3339 formatted timestamp when to end notifications
- fhir_
store str - reason str
- Reason for creating the subscription
- cdr_
subscription_ strid - The ID of the CDR subscription
- delete_
endpoint str - The REST endpoint to call for DELETE operations. Must use
https://
schema - endpoint str
- The REST endpoint to call. Must use
https://
schema - headers Sequence[str]
- List of headers to add to the REST call
- version str
- The FHIR version to use. Options [
stu3
|r4
]. Default isstu3
- criteria String
- On which resource to notify
- end String
- RFC3339 formatted timestamp when to end notifications
- fhir
Store String - reason String
- Reason for creating the subscription
- cdr
Subscription StringId - The ID of the CDR subscription
- delete
Endpoint String - The REST endpoint to call for DELETE operations. Must use
https://
schema - endpoint String
- The REST endpoint to call. Must use
https://
schema - headers List<String>
- List of headers to add to the REST call
- version String
- The FHIR version to use. Options [
stu3
|r4
]. Default isstu3
Outputs
All input properties are implicitly available as output properties. Additionally, the CdrSubscription resource produces the following output properties:
Look up Existing CdrSubscription Resource
Get an existing CdrSubscription resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: CdrSubscriptionState, opts?: CustomResourceOptions): CdrSubscription
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cdr_subscription_id: Optional[str] = None,
criteria: Optional[str] = None,
delete_endpoint: Optional[str] = None,
end: Optional[str] = None,
endpoint: Optional[str] = None,
fhir_store: Optional[str] = None,
headers: Optional[Sequence[str]] = None,
reason: Optional[str] = None,
status: Optional[str] = None,
version: Optional[str] = None) -> CdrSubscription
func GetCdrSubscription(ctx *Context, name string, id IDInput, state *CdrSubscriptionState, opts ...ResourceOption) (*CdrSubscription, error)
public static CdrSubscription Get(string name, Input<string> id, CdrSubscriptionState? state, CustomResourceOptions? opts = null)
public static CdrSubscription get(String name, Output<String> id, CdrSubscriptionState state, CustomResourceOptions options)
resources: _: type: hsdp:CdrSubscription get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Cdr
Subscription stringId - The ID of the CDR subscription
- Criteria string
- On which resource to notify
- Delete
Endpoint string - The REST endpoint to call for DELETE operations. Must use
https://
schema - End string
- RFC3339 formatted timestamp when to end notifications
- Endpoint string
- The REST endpoint to call. Must use
https://
schema - Fhir
Store string - Headers List<string>
- List of headers to add to the REST call
- Reason string
- Reason for creating the subscription
- Status string
- The status of the subscription (requested | active | error | off)
- Version string
- The FHIR version to use. Options [
stu3
|r4
]. Default isstu3
- Cdr
Subscription stringId - The ID of the CDR subscription
- Criteria string
- On which resource to notify
- Delete
Endpoint string - The REST endpoint to call for DELETE operations. Must use
https://
schema - End string
- RFC3339 formatted timestamp when to end notifications
- Endpoint string
- The REST endpoint to call. Must use
https://
schema - Fhir
Store string - Headers []string
- List of headers to add to the REST call
- Reason string
- Reason for creating the subscription
- Status string
- The status of the subscription (requested | active | error | off)
- Version string
- The FHIR version to use. Options [
stu3
|r4
]. Default isstu3
- cdr
Subscription StringId - The ID of the CDR subscription
- criteria String
- On which resource to notify
- delete
Endpoint String - The REST endpoint to call for DELETE operations. Must use
https://
schema - end String
- RFC3339 formatted timestamp when to end notifications
- endpoint String
- The REST endpoint to call. Must use
https://
schema - fhir
Store String - headers List<String>
- List of headers to add to the REST call
- reason String
- Reason for creating the subscription
- status String
- The status of the subscription (requested | active | error | off)
- version String
- The FHIR version to use. Options [
stu3
|r4
]. Default isstu3
- cdr
Subscription stringId - The ID of the CDR subscription
- criteria string
- On which resource to notify
- delete
Endpoint string - The REST endpoint to call for DELETE operations. Must use
https://
schema - end string
- RFC3339 formatted timestamp when to end notifications
- endpoint string
- The REST endpoint to call. Must use
https://
schema - fhir
Store string - headers string[]
- List of headers to add to the REST call
- reason string
- Reason for creating the subscription
- status string
- The status of the subscription (requested | active | error | off)
- version string
- The FHIR version to use. Options [
stu3
|r4
]. Default isstu3
- cdr_
subscription_ strid - The ID of the CDR subscription
- criteria str
- On which resource to notify
- delete_
endpoint str - The REST endpoint to call for DELETE operations. Must use
https://
schema - end str
- RFC3339 formatted timestamp when to end notifications
- endpoint str
- The REST endpoint to call. Must use
https://
schema - fhir_
store str - headers Sequence[str]
- List of headers to add to the REST call
- reason str
- Reason for creating the subscription
- status str
- The status of the subscription (requested | active | error | off)
- version str
- The FHIR version to use. Options [
stu3
|r4
]. Default isstu3
- cdr
Subscription StringId - The ID of the CDR subscription
- criteria String
- On which resource to notify
- delete
Endpoint String - The REST endpoint to call for DELETE operations. Must use
https://
schema - end String
- RFC3339 formatted timestamp when to end notifications
- endpoint String
- The REST endpoint to call. Must use
https://
schema - fhir
Store String - headers List<String>
- List of headers to add to the REST call
- reason String
- Reason for creating the subscription
- status String
- The status of the subscription (requested | active | error | off)
- version String
- The FHIR version to use. Options [
stu3
|r4
]. Default isstu3
Import
$ pulumi import hsdp:index/cdrSubscription:CdrSubscription An existing Subscription can be imported using `hsdp_cdr_subscription`, e.g.
bash
$ pulumi import hsdp:index/cdrSubscription:CdrSubscription myorg a-guid
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- hsdp philips-software/terraform-provider-hsdp
- License
- Notes
- This Pulumi package is based on the
hsdp
Terraform Provider.