Create GCP Healthcare HL7v2 Stores

The gcp:healthcare/hl7Store:Hl7Store resource, part of the Pulumi GCP provider, provisions an HL7v2 store within a Healthcare dataset for storing and processing clinical messages that conform to the HL7v2 standard. This guide focuses on three capabilities: Pub/Sub notification setup, message parser configuration, and schema validation.

HL7v2 stores belong to Healthcare datasets and may publish notifications to Pub/Sub topics. The examples are intentionally small. Combine them with your own datasets, IAM policies, and downstream processing infrastructure.

Create a store with Pub/Sub notifications

Healthcare systems often need to notify downstream applications when new HL7v2 messages arrive, enabling real-time processing pipelines.

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const topic = new gcp.pubsub.Topic("topic", {name: "hl7-v2-notifications"});
const dataset = new gcp.healthcare.Dataset("dataset", {
    name: "example-dataset",
    location: "us-central1",
});
const store = new gcp.healthcare.Hl7Store("store", {
    name: "example-hl7-v2-store",
    dataset: dataset.id,
    rejectDuplicateMessage: true,
    notificationConfigs: [{
        pubsubTopic: topic.id,
    }],
    labels: {
        label1: "labelvalue1",
    },
});
import pulumi
import pulumi_gcp as gcp

topic = gcp.pubsub.Topic("topic", name="hl7-v2-notifications")
dataset = gcp.healthcare.Dataset("dataset",
    name="example-dataset",
    location="us-central1")
store = gcp.healthcare.Hl7Store("store",
    name="example-hl7-v2-store",
    dataset=dataset.id,
    reject_duplicate_message=True,
    notification_configs=[{
        "pubsub_topic": topic.id,
    }],
    labels={
        "label1": "labelvalue1",
    })
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/healthcare"
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/pubsub"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		topic, err := pubsub.NewTopic(ctx, "topic", &pubsub.TopicArgs{
			Name: pulumi.String("hl7-v2-notifications"),
		})
		if err != nil {
			return err
		}
		dataset, err := healthcare.NewDataset(ctx, "dataset", &healthcare.DatasetArgs{
			Name:     pulumi.String("example-dataset"),
			Location: pulumi.String("us-central1"),
		})
		if err != nil {
			return err
		}
		_, err = healthcare.NewHl7Store(ctx, "store", &healthcare.Hl7StoreArgs{
			Name:                   pulumi.String("example-hl7-v2-store"),
			Dataset:                dataset.ID(),
			RejectDuplicateMessage: pulumi.Bool(true),
			NotificationConfigs: healthcare.Hl7StoreNotificationConfigsArray{
				&healthcare.Hl7StoreNotificationConfigsArgs{
					PubsubTopic: topic.ID(),
				},
			},
			Labels: pulumi.StringMap{
				"label1": pulumi.String("labelvalue1"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var topic = new Gcp.PubSub.Topic("topic", new()
    {
        Name = "hl7-v2-notifications",
    });

    var dataset = new Gcp.Healthcare.Dataset("dataset", new()
    {
        Name = "example-dataset",
        Location = "us-central1",
    });

    var store = new Gcp.Healthcare.Hl7Store("store", new()
    {
        Name = "example-hl7-v2-store",
        Dataset = dataset.Id,
        RejectDuplicateMessage = true,
        NotificationConfigs = new[]
        {
            new Gcp.Healthcare.Inputs.Hl7StoreNotificationConfigsArgs
            {
                PubsubTopic = topic.Id,
            },
        },
        Labels = 
        {
            { "label1", "labelvalue1" },
        },
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.pubsub.Topic;
import com.pulumi.gcp.pubsub.TopicArgs;
import com.pulumi.gcp.healthcare.Dataset;
import com.pulumi.gcp.healthcare.DatasetArgs;
import com.pulumi.gcp.healthcare.Hl7Store;
import com.pulumi.gcp.healthcare.Hl7StoreArgs;
import com.pulumi.gcp.healthcare.inputs.Hl7StoreNotificationConfigsArgs;
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) {
        var topic = new Topic("topic", TopicArgs.builder()
            .name("hl7-v2-notifications")
            .build());

        var dataset = new Dataset("dataset", DatasetArgs.builder()
            .name("example-dataset")
            .location("us-central1")
            .build());

        var store = new Hl7Store("store", Hl7StoreArgs.builder()
            .name("example-hl7-v2-store")
            .dataset(dataset.id())
            .rejectDuplicateMessage(true)
            .notificationConfigs(Hl7StoreNotificationConfigsArgs.builder()
                .pubsubTopic(topic.id())
                .build())
            .labels(Map.of("label1", "labelvalue1"))
            .build());

    }
}
resources:
  store:
    type: gcp:healthcare:Hl7Store
    properties:
      name: example-hl7-v2-store
      dataset: ${dataset.id}
      rejectDuplicateMessage: true
      notificationConfigs:
        - pubsubTopic: ${topic.id}
      labels:
        label1: labelvalue1
  topic:
    type: gcp:pubsub:Topic
    properties:
      name: hl7-v2-notifications
  dataset:
    type: gcp:healthcare:Dataset
    properties:
      name: example-dataset
      location: us-central1

When messages arrive, the store publishes notifications to the specified Pub/Sub topic. The notificationConfigs property defines where notifications go; only the message name is sent, not the full content. The rejectDuplicateMessage property controls whether the store accepts messages with duplicate IDs.

Configure basic message parsing without schema validation

Some workflows need to accept messages without enforcing strict schema validation, allowing flexibility for varied message structures.

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const dataset = new gcp.healthcare.Dataset("dataset", {
    name: "example-dataset",
    location: "us-central1",
});
const store = new gcp.healthcare.Hl7Store("store", {
    name: "example-hl7-v2-store",
    dataset: dataset.id,
    parserConfig: {
        allowNullHeader: false,
        segmentTerminator: "Jw==",
        version: "V2",
    },
});
import pulumi
import pulumi_gcp as gcp

dataset = gcp.healthcare.Dataset("dataset",
    name="example-dataset",
    location="us-central1")
store = gcp.healthcare.Hl7Store("store",
    name="example-hl7-v2-store",
    dataset=dataset.id,
    parser_config={
        "allow_null_header": False,
        "segment_terminator": "Jw==",
        "version": "V2",
    })
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/healthcare"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		dataset, err := healthcare.NewDataset(ctx, "dataset", &healthcare.DatasetArgs{
			Name:     pulumi.String("example-dataset"),
			Location: pulumi.String("us-central1"),
		})
		if err != nil {
			return err
		}
		_, err = healthcare.NewHl7Store(ctx, "store", &healthcare.Hl7StoreArgs{
			Name:    pulumi.String("example-hl7-v2-store"),
			Dataset: dataset.ID(),
			ParserConfig: &healthcare.Hl7StoreParserConfigArgs{
				AllowNullHeader:   pulumi.Bool(false),
				SegmentTerminator: pulumi.String("Jw=="),
				Version:           pulumi.String("V2"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var dataset = new Gcp.Healthcare.Dataset("dataset", new()
    {
        Name = "example-dataset",
        Location = "us-central1",
    });

    var store = new Gcp.Healthcare.Hl7Store("store", new()
    {
        Name = "example-hl7-v2-store",
        Dataset = dataset.Id,
        ParserConfig = new Gcp.Healthcare.Inputs.Hl7StoreParserConfigArgs
        {
            AllowNullHeader = false,
            SegmentTerminator = "Jw==",
            Version = "V2",
        },
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.healthcare.Dataset;
import com.pulumi.gcp.healthcare.DatasetArgs;
import com.pulumi.gcp.healthcare.Hl7Store;
import com.pulumi.gcp.healthcare.Hl7StoreArgs;
import com.pulumi.gcp.healthcare.inputs.Hl7StoreParserConfigArgs;
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) {
        var dataset = new Dataset("dataset", DatasetArgs.builder()
            .name("example-dataset")
            .location("us-central1")
            .build());

        var store = new Hl7Store("store", Hl7StoreArgs.builder()
            .name("example-hl7-v2-store")
            .dataset(dataset.id())
            .parserConfig(Hl7StoreParserConfigArgs.builder()
                .allowNullHeader(false)
                .segmentTerminator("Jw==")
                .version("V2")
                .build())
            .build());

    }
}
resources:
  store:
    type: gcp:healthcare:Hl7Store
    properties:
      name: example-hl7-v2-store
      dataset: ${dataset.id}
      parserConfig:
        allowNullHeader: false
        segmentTerminator: Jw==
        version: V2
  dataset:
    type: gcp:healthcare:Dataset
    properties:
      name: example-dataset
      location: us-central1

The parserConfig property controls how the store interprets incoming HL7v2 messages. Setting version to “V2” enables unschematized parsing, which accepts messages without validating against a predefined structure. The segmentTerminator property (base64-encoded) defines the character sequence that separates message segments.

Enforce message structure with custom schemas

Clinical systems that require strict validation can define custom schemas specifying required segments, field cardinality, and custom segment types.

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const dataset = new gcp.healthcare.Dataset("dataset", {
    name: "example-dataset",
    location: "us-central1",
});
const store = new gcp.healthcare.Hl7Store("store", {
    name: "example-hl7-v2-store",
    dataset: dataset.id,
    parserConfig: {
        allowNullHeader: false,
        segmentTerminator: "Jw==",
        schema: `{
  \\"schemas\\": [{
    \\"messageSchemaConfigs\\": {
      \\"ADT_A01\\": {
        \\"name\\": \\"ADT_A01\\",
        \\"minOccurs\\": 1,
        \\"maxOccurs\\": 1,
        \\"members\\": [{
            \\"segment\\": {
              \\"type\\": \\"MSH\\",
              \\"minOccurs\\": 1,
              \\"maxOccurs\\": 1
            }
          },
          {
            \\"segment\\": {
              \\"type\\": \\"EVN\\",
              \\"minOccurs\\": 1,
              \\"maxOccurs\\": 1
            }
          },
          {
            \\"segment\\": {
              \\"type\\": \\"PID\\",
              \\"minOccurs\\": 1,
              \\"maxOccurs\\": 1
            }
          },
          {
            \\"segment\\": {
              \\"type\\": \\"ZPD\\",
              \\"minOccurs\\": 1,
              \\"maxOccurs\\": 1
            }
          },
          {
            \\"segment\\": {
              \\"type\\": \\"OBX\\"
            }
          },
          {
            \\"group\\": {
              \\"name\\": \\"PROCEDURE\\",
              \\"members\\": [{
                  \\"segment\\": {
                    \\"type\\": \\"PR1\\",
                    \\"minOccurs\\": 1,
                    \\"maxOccurs\\": 1
                  }
                },
                {
                  \\"segment\\": {
                    \\"type\\": \\"ROL\\"
                  }
                }
              ]
            }
          },
          {
            \\"segment\\": {
              \\"type\\": \\"PDA\\",
              \\"maxOccurs\\": 1
            }
          }
        ]
      }
    }
  }],
  \\"types\\": [{
    \\"type\\": [{
        \\"name\\": \\"ZPD\\",
        \\"primitive\\": \\"VARIES\\"
      }

    ]
  }],
  \\"ignoreMinOccurs\\": true
}
`,
    },
});
import pulumi
import pulumi_gcp as gcp

dataset = gcp.healthcare.Dataset("dataset",
    name="example-dataset",
    location="us-central1")
store = gcp.healthcare.Hl7Store("store",
    name="example-hl7-v2-store",
    dataset=dataset.id,
    parser_config={
        "allow_null_header": False,
        "segment_terminator": "Jw==",
        "schema": """{
  \"schemas\": [{
    \"messageSchemaConfigs\": {
      \"ADT_A01\": {
        \"name\": \"ADT_A01\",
        \"minOccurs\": 1,
        \"maxOccurs\": 1,
        \"members\": [{
            \"segment\": {
              \"type\": \"MSH\",
              \"minOccurs\": 1,
              \"maxOccurs\": 1
            }
          },
          {
            \"segment\": {
              \"type\": \"EVN\",
              \"minOccurs\": 1,
              \"maxOccurs\": 1
            }
          },
          {
            \"segment\": {
              \"type\": \"PID\",
              \"minOccurs\": 1,
              \"maxOccurs\": 1
            }
          },
          {
            \"segment\": {
              \"type\": \"ZPD\",
              \"minOccurs\": 1,
              \"maxOccurs\": 1
            }
          },
          {
            \"segment\": {
              \"type\": \"OBX\"
            }
          },
          {
            \"group\": {
              \"name\": \"PROCEDURE\",
              \"members\": [{
                  \"segment\": {
                    \"type\": \"PR1\",
                    \"minOccurs\": 1,
                    \"maxOccurs\": 1
                  }
                },
                {
                  \"segment\": {
                    \"type\": \"ROL\"
                  }
                }
              ]
            }
          },
          {
            \"segment\": {
              \"type\": \"PDA\",
              \"maxOccurs\": 1
            }
          }
        ]
      }
    }
  }],
  \"types\": [{
    \"type\": [{
        \"name\": \"ZPD\",
        \"primitive\": \"VARIES\"
      }

    ]
  }],
  \"ignoreMinOccurs\": true
}
""",
    })
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/healthcare"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		dataset, err := healthcare.NewDataset(ctx, "dataset", &healthcare.DatasetArgs{
			Name:     pulumi.String("example-dataset"),
			Location: pulumi.String("us-central1"),
		})
		if err != nil {
			return err
		}
		_, err = healthcare.NewHl7Store(ctx, "store", &healthcare.Hl7StoreArgs{
			Name:    pulumi.String("example-hl7-v2-store"),
			Dataset: dataset.ID(),
			ParserConfig: &healthcare.Hl7StoreParserConfigArgs{
				AllowNullHeader:   pulumi.Bool(false),
				SegmentTerminator: pulumi.String("Jw=="),
				Schema: pulumi.String(`{
  \"schemas\": [{
    \"messageSchemaConfigs\": {
      \"ADT_A01\": {
        \"name\": \"ADT_A01\",
        \"minOccurs\": 1,
        \"maxOccurs\": 1,
        \"members\": [{
            \"segment\": {
              \"type\": \"MSH\",
              \"minOccurs\": 1,
              \"maxOccurs\": 1
            }
          },
          {
            \"segment\": {
              \"type\": \"EVN\",
              \"minOccurs\": 1,
              \"maxOccurs\": 1
            }
          },
          {
            \"segment\": {
              \"type\": \"PID\",
              \"minOccurs\": 1,
              \"maxOccurs\": 1
            }
          },
          {
            \"segment\": {
              \"type\": \"ZPD\",
              \"minOccurs\": 1,
              \"maxOccurs\": 1
            }
          },
          {
            \"segment\": {
              \"type\": \"OBX\"
            }
          },
          {
            \"group\": {
              \"name\": \"PROCEDURE\",
              \"members\": [{
                  \"segment\": {
                    \"type\": \"PR1\",
                    \"minOccurs\": 1,
                    \"maxOccurs\": 1
                  }
                },
                {
                  \"segment\": {
                    \"type\": \"ROL\"
                  }
                }
              ]
            }
          },
          {
            \"segment\": {
              \"type\": \"PDA\",
              \"maxOccurs\": 1
            }
          }
        ]
      }
    }
  }],
  \"types\": [{
    \"type\": [{
        \"name\": \"ZPD\",
        \"primitive\": \"VARIES\"
      }

    ]
  }],
  \"ignoreMinOccurs\": true
}
`),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var dataset = new Gcp.Healthcare.Dataset("dataset", new()
    {
        Name = "example-dataset",
        Location = "us-central1",
    });

    var store = new Gcp.Healthcare.Hl7Store("store", new()
    {
        Name = "example-hl7-v2-store",
        Dataset = dataset.Id,
        ParserConfig = new Gcp.Healthcare.Inputs.Hl7StoreParserConfigArgs
        {
            AllowNullHeader = false,
            SegmentTerminator = "Jw==",
            Schema = @"{
  \""schemas\"": [{
    \""messageSchemaConfigs\"": {
      \""ADT_A01\"": {
        \""name\"": \""ADT_A01\"",
        \""minOccurs\"": 1,
        \""maxOccurs\"": 1,
        \""members\"": [{
            \""segment\"": {
              \""type\"": \""MSH\"",
              \""minOccurs\"": 1,
              \""maxOccurs\"": 1
            }
          },
          {
            \""segment\"": {
              \""type\"": \""EVN\"",
              \""minOccurs\"": 1,
              \""maxOccurs\"": 1
            }
          },
          {
            \""segment\"": {
              \""type\"": \""PID\"",
              \""minOccurs\"": 1,
              \""maxOccurs\"": 1
            }
          },
          {
            \""segment\"": {
              \""type\"": \""ZPD\"",
              \""minOccurs\"": 1,
              \""maxOccurs\"": 1
            }
          },
          {
            \""segment\"": {
              \""type\"": \""OBX\""
            }
          },
          {
            \""group\"": {
              \""name\"": \""PROCEDURE\"",
              \""members\"": [{
                  \""segment\"": {
                    \""type\"": \""PR1\"",
                    \""minOccurs\"": 1,
                    \""maxOccurs\"": 1
                  }
                },
                {
                  \""segment\"": {
                    \""type\"": \""ROL\""
                  }
                }
              ]
            }
          },
          {
            \""segment\"": {
              \""type\"": \""PDA\"",
              \""maxOccurs\"": 1
            }
          }
        ]
      }
    }
  }],
  \""types\"": [{
    \""type\"": [{
        \""name\"": \""ZPD\"",
        \""primitive\"": \""VARIES\""
      }

    ]
  }],
  \""ignoreMinOccurs\"": true
}
",
        },
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.healthcare.Dataset;
import com.pulumi.gcp.healthcare.DatasetArgs;
import com.pulumi.gcp.healthcare.Hl7Store;
import com.pulumi.gcp.healthcare.Hl7StoreArgs;
import com.pulumi.gcp.healthcare.inputs.Hl7StoreParserConfigArgs;
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) {
        var dataset = new Dataset("dataset", DatasetArgs.builder()
            .name("example-dataset")
            .location("us-central1")
            .build());

        var store = new Hl7Store("store", Hl7StoreArgs.builder()
            .name("example-hl7-v2-store")
            .dataset(dataset.id())
            .parserConfig(Hl7StoreParserConfigArgs.builder()
                .allowNullHeader(false)
                .segmentTerminator("Jw==")
                .schema("""
{
  \"schemas\": [{
    \"messageSchemaConfigs\": {
      \"ADT_A01\": {
        \"name\": \"ADT_A01\",
        \"minOccurs\": 1,
        \"maxOccurs\": 1,
        \"members\": [{
            \"segment\": {
              \"type\": \"MSH\",
              \"minOccurs\": 1,
              \"maxOccurs\": 1
            }
          },
          {
            \"segment\": {
              \"type\": \"EVN\",
              \"minOccurs\": 1,
              \"maxOccurs\": 1
            }
          },
          {
            \"segment\": {
              \"type\": \"PID\",
              \"minOccurs\": 1,
              \"maxOccurs\": 1
            }
          },
          {
            \"segment\": {
              \"type\": \"ZPD\",
              \"minOccurs\": 1,
              \"maxOccurs\": 1
            }
          },
          {
            \"segment\": {
              \"type\": \"OBX\"
            }
          },
          {
            \"group\": {
              \"name\": \"PROCEDURE\",
              \"members\": [{
                  \"segment\": {
                    \"type\": \"PR1\",
                    \"minOccurs\": 1,
                    \"maxOccurs\": 1
                  }
                },
                {
                  \"segment\": {
                    \"type\": \"ROL\"
                  }
                }
              ]
            }
          },
          {
            \"segment\": {
              \"type\": \"PDA\",
              \"maxOccurs\": 1
            }
          }
        ]
      }
    }
  }],
  \"types\": [{
    \"type\": [{
        \"name\": \"ZPD\",
        \"primitive\": \"VARIES\"
      }

    ]
  }],
  \"ignoreMinOccurs\": true
}
                """)
                .build())
            .build());

    }
}
resources:
  store:
    type: gcp:healthcare:Hl7Store
    properties:
      name: example-hl7-v2-store
      dataset: ${dataset.id}
      parserConfig:
        allowNullHeader: false
        segmentTerminator: Jw==
        schema: |
          {
            \"schemas\": [{
              \"messageSchemaConfigs\": {
                \"ADT_A01\": {
                  \"name\": \"ADT_A01\",
                  \"minOccurs\": 1,
                  \"maxOccurs\": 1,
                  \"members\": [{
                      \"segment\": {
                        \"type\": \"MSH\",
                        \"minOccurs\": 1,
                        \"maxOccurs\": 1
                      }
                    },
                    {
                      \"segment\": {
                        \"type\": \"EVN\",
                        \"minOccurs\": 1,
                        \"maxOccurs\": 1
                      }
                    },
                    {
                      \"segment\": {
                        \"type\": \"PID\",
                        \"minOccurs\": 1,
                        \"maxOccurs\": 1
                      }
                    },
                    {
                      \"segment\": {
                        \"type\": \"ZPD\",
                        \"minOccurs\": 1,
                        \"maxOccurs\": 1
                      }
                    },
                    {
                      \"segment\": {
                        \"type\": \"OBX\"
                      }
                    },
                    {
                      \"group\": {
                        \"name\": \"PROCEDURE\",
                        \"members\": [{
                            \"segment\": {
                              \"type\": \"PR1\",
                              \"minOccurs\": 1,
                              \"maxOccurs\": 1
                            }
                          },
                          {
                            \"segment\": {
                              \"type\": \"ROL\"
                            }
                          }
                        ]
                      }
                    },
                    {
                      \"segment\": {
                        \"type\": \"PDA\",
                        \"maxOccurs\": 1
                      }
                    }
                  ]
                }
              }
            }],
            \"types\": [{
              \"type\": [{
                  \"name\": \"ZPD\",
                  \"primitive\": \"VARIES\"
                }

              ]
            }],
            \"ignoreMinOccurs\": true
          }          
  dataset:
    type: gcp:healthcare:Dataset
    properties:
      name: example-dataset
      location: us-central1

The schema property within parserConfig defines message structure rules in JSON format. The messageSchemaConfigs section specifies which message types (like ADT_A01) are accepted and which segments (MSH, EVN, PID) must appear. Custom segment types (like ZPD) can be defined in the types section, extending the standard HL7v2 vocabulary.

Beyond these examples

These snippets focus on specific HL7v2 store features: Pub/Sub notification integration and message parsing and schema validation. They’re intentionally minimal rather than full healthcare data pipelines.

The examples reference pre-existing infrastructure such as Healthcare datasets and Pub/Sub topics for notification examples. They focus on configuring the store rather than provisioning the surrounding healthcare infrastructure.

To keep things focused, common HL7v2 store patterns are omitted, including:

  • Message filtering in notification configs
  • IAM permissions for store access
  • Message retention and lifecycle policies
  • Integration with FHIR stores or BigQuery exports

These omissions are intentional: the goal is to illustrate how each store feature is wired, not provide drop-in healthcare data modules. See the HL7v2 Store resource reference for all available configuration options.

Let's create GCP Healthcare HL7v2 Stores

Get started with Pulumi Cloud, then follow our quick setup guide to deploy this infrastructure.

Try Pulumi Cloud for FREE

Frequently Asked Questions

Data Management & Safety
Why does changing the name of my HL7v2 store delete all data?
The name property is immutable. Changing it may recreate the HL7v2 store, removing all existing data. Plan your store name carefully during initial creation.
Can I prevent duplicate messages in my HL7v2 store?
Yes, set rejectDuplicateMessage to true to prevent duplicate messages from being stored.
Configuration & Setup
What format is required for the dataset property?
The dataset property must be in the format projects/{project}/locations/{location}/datasets/{dataset}.
How do I set up Pub/Sub notifications for my HL7v2 store?
Configure notificationConfigs with a pubsubTopic pointing to your Pub/Sub topic. Each configuration can use filters to determine when to publish messages (both Ingest and Create events).
What parser configurations are available?
You can configure allowNullHeader, segmentTerminator, and either a custom schema (for structured parsing) or version set to V2 (for unschematized parsing).
Immutability & Updates
What properties can't be changed after creating an HL7v2 store?
Both dataset and name are immutable. You cannot change them after the store is created.
Should I use notificationConfig or notificationConfigs?
Use notificationConfigs (plural). The notificationConfig property is deprecated and will be removed in a future release.
Labels & Metadata
How do labels work in HL7v2 stores?
The labels field is non-authoritative, meaning it only manages labels defined in your Pulumi configuration. To see all labels on the resource (including those set by other clients), use the effectiveLabels output property. Label keys must match the regex [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}, values must match [\p{Ll}\p{Lo}\p{N}_-]{0,63}, and you can have a maximum of 64 labels.

Using a different cloud?

Explore database guides for other cloud providers: