/
message.go
250 lines (212 loc) · 11.8 KB
/
message.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package v1
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Parses and stores an HL7v2 message. This method triggers an asynchronous notification to any Pub/Sub topic configured in Hl7V2Store.Hl7V2NotificationConfig, if the filtering matches the message. If an MLLP adapter is configured to listen to a Pub/Sub topic, the adapter transmits the message when a notification is received.
type Message struct {
pulumi.CustomResourceState
// The datetime when the message was created. Set by the server.
CreateTime pulumi.StringOutput `pulumi:"createTime"`
// Raw message bytes.
Data pulumi.StringOutput `pulumi:"data"`
DatasetId pulumi.StringOutput `pulumi:"datasetId"`
Hl7V2StoreId pulumi.StringOutput `pulumi:"hl7V2StoreId"`
// User-supplied key-value pairs used to organize HL7v2 stores. Label keys must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: \p{Ll}\p{Lo}{0,62} Label values are optional, must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63} No more than 64 labels can be associated with a given store.
Labels pulumi.StringMapOutput `pulumi:"labels"`
Location pulumi.StringOutput `pulumi:"location"`
// The message type for this message. MSH-9.1.
MessageType pulumi.StringOutput `pulumi:"messageType"`
// Resource name of the Message, of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/hl7V2Stores/{hl7_v2_store_id}/messages/{message_id}`. Assigned by the server.
Name pulumi.StringOutput `pulumi:"name"`
// The parsed version of the raw message data.
ParsedData ParsedDataResponseOutput `pulumi:"parsedData"`
// All patient IDs listed in the PID-2, PID-3, and PID-4 segments of this message.
PatientIds PatientIdResponseArrayOutput `pulumi:"patientIds"`
Project pulumi.StringOutput `pulumi:"project"`
// The parsed version of the raw message data schematized according to this store's schemas and type definitions.
SchematizedData SchematizedDataResponseOutput `pulumi:"schematizedData"`
// The hospital that this message came from. MSH-4.
SendFacility pulumi.StringOutput `pulumi:"sendFacility"`
// The datetime the sending application sent this message. MSH-7.
SendTime pulumi.StringOutput `pulumi:"sendTime"`
}
// NewMessage registers a new resource with the given unique name, arguments, and options.
func NewMessage(ctx *pulumi.Context,
name string, args *MessageArgs, opts ...pulumi.ResourceOption) (*Message, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DatasetId == nil {
return nil, errors.New("invalid value for required argument 'DatasetId'")
}
if args.Hl7V2StoreId == nil {
return nil, errors.New("invalid value for required argument 'Hl7V2StoreId'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"datasetId",
"hl7V2StoreId",
"location",
"project",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource Message
err := ctx.RegisterResource("google-native:healthcare/v1:Message", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetMessage gets an existing Message resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetMessage(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *MessageState, opts ...pulumi.ResourceOption) (*Message, error) {
var resource Message
err := ctx.ReadResource("google-native:healthcare/v1:Message", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Message resources.
type messageState struct {
}
type MessageState struct {
}
func (MessageState) ElementType() reflect.Type {
return reflect.TypeOf((*messageState)(nil)).Elem()
}
type messageArgs struct {
// Raw message bytes.
Data *string `pulumi:"data"`
DatasetId string `pulumi:"datasetId"`
Hl7V2StoreId string `pulumi:"hl7V2StoreId"`
// User-supplied key-value pairs used to organize HL7v2 stores. Label keys must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: \p{Ll}\p{Lo}{0,62} Label values are optional, must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63} No more than 64 labels can be associated with a given store.
Labels map[string]string `pulumi:"labels"`
Location *string `pulumi:"location"`
// The message type for this message. MSH-9.1.
MessageType *string `pulumi:"messageType"`
// Resource name of the Message, of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/hl7V2Stores/{hl7_v2_store_id}/messages/{message_id}`. Assigned by the server.
Name *string `pulumi:"name"`
// All patient IDs listed in the PID-2, PID-3, and PID-4 segments of this message.
PatientIds []PatientId `pulumi:"patientIds"`
Project *string `pulumi:"project"`
// The parsed version of the raw message data schematized according to this store's schemas and type definitions.
SchematizedData *SchematizedData `pulumi:"schematizedData"`
// The hospital that this message came from. MSH-4.
SendFacility *string `pulumi:"sendFacility"`
// The datetime the sending application sent this message. MSH-7.
SendTime *string `pulumi:"sendTime"`
}
// The set of arguments for constructing a Message resource.
type MessageArgs struct {
// Raw message bytes.
Data pulumi.StringPtrInput
DatasetId pulumi.StringInput
Hl7V2StoreId pulumi.StringInput
// User-supplied key-value pairs used to organize HL7v2 stores. Label keys must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: \p{Ll}\p{Lo}{0,62} Label values are optional, must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63} No more than 64 labels can be associated with a given store.
Labels pulumi.StringMapInput
Location pulumi.StringPtrInput
// The message type for this message. MSH-9.1.
MessageType pulumi.StringPtrInput
// Resource name of the Message, of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/hl7V2Stores/{hl7_v2_store_id}/messages/{message_id}`. Assigned by the server.
Name pulumi.StringPtrInput
// All patient IDs listed in the PID-2, PID-3, and PID-4 segments of this message.
PatientIds PatientIdArrayInput
Project pulumi.StringPtrInput
// The parsed version of the raw message data schematized according to this store's schemas and type definitions.
SchematizedData SchematizedDataPtrInput
// The hospital that this message came from. MSH-4.
SendFacility pulumi.StringPtrInput
// The datetime the sending application sent this message. MSH-7.
SendTime pulumi.StringPtrInput
}
func (MessageArgs) ElementType() reflect.Type {
return reflect.TypeOf((*messageArgs)(nil)).Elem()
}
type MessageInput interface {
pulumi.Input
ToMessageOutput() MessageOutput
ToMessageOutputWithContext(ctx context.Context) MessageOutput
}
func (*Message) ElementType() reflect.Type {
return reflect.TypeOf((**Message)(nil)).Elem()
}
func (i *Message) ToMessageOutput() MessageOutput {
return i.ToMessageOutputWithContext(context.Background())
}
func (i *Message) ToMessageOutputWithContext(ctx context.Context) MessageOutput {
return pulumi.ToOutputWithContext(ctx, i).(MessageOutput)
}
type MessageOutput struct{ *pulumi.OutputState }
func (MessageOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Message)(nil)).Elem()
}
func (o MessageOutput) ToMessageOutput() MessageOutput {
return o
}
func (o MessageOutput) ToMessageOutputWithContext(ctx context.Context) MessageOutput {
return o
}
// The datetime when the message was created. Set by the server.
func (o MessageOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v *Message) pulumi.StringOutput { return v.CreateTime }).(pulumi.StringOutput)
}
// Raw message bytes.
func (o MessageOutput) Data() pulumi.StringOutput {
return o.ApplyT(func(v *Message) pulumi.StringOutput { return v.Data }).(pulumi.StringOutput)
}
func (o MessageOutput) DatasetId() pulumi.StringOutput {
return o.ApplyT(func(v *Message) pulumi.StringOutput { return v.DatasetId }).(pulumi.StringOutput)
}
func (o MessageOutput) Hl7V2StoreId() pulumi.StringOutput {
return o.ApplyT(func(v *Message) pulumi.StringOutput { return v.Hl7V2StoreId }).(pulumi.StringOutput)
}
// User-supplied key-value pairs used to organize HL7v2 stores. Label keys must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: \p{Ll}\p{Lo}{0,62} Label values are optional, must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63} No more than 64 labels can be associated with a given store.
func (o MessageOutput) Labels() pulumi.StringMapOutput {
return o.ApplyT(func(v *Message) pulumi.StringMapOutput { return v.Labels }).(pulumi.StringMapOutput)
}
func (o MessageOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *Message) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// The message type for this message. MSH-9.1.
func (o MessageOutput) MessageType() pulumi.StringOutput {
return o.ApplyT(func(v *Message) pulumi.StringOutput { return v.MessageType }).(pulumi.StringOutput)
}
// Resource name of the Message, of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/hl7V2Stores/{hl7_v2_store_id}/messages/{message_id}`. Assigned by the server.
func (o MessageOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Message) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The parsed version of the raw message data.
func (o MessageOutput) ParsedData() ParsedDataResponseOutput {
return o.ApplyT(func(v *Message) ParsedDataResponseOutput { return v.ParsedData }).(ParsedDataResponseOutput)
}
// All patient IDs listed in the PID-2, PID-3, and PID-4 segments of this message.
func (o MessageOutput) PatientIds() PatientIdResponseArrayOutput {
return o.ApplyT(func(v *Message) PatientIdResponseArrayOutput { return v.PatientIds }).(PatientIdResponseArrayOutput)
}
func (o MessageOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *Message) pulumi.StringOutput { return v.Project }).(pulumi.StringOutput)
}
// The parsed version of the raw message data schematized according to this store's schemas and type definitions.
func (o MessageOutput) SchematizedData() SchematizedDataResponseOutput {
return o.ApplyT(func(v *Message) SchematizedDataResponseOutput { return v.SchematizedData }).(SchematizedDataResponseOutput)
}
// The hospital that this message came from. MSH-4.
func (o MessageOutput) SendFacility() pulumi.StringOutput {
return o.ApplyT(func(v *Message) pulumi.StringOutput { return v.SendFacility }).(pulumi.StringOutput)
}
// The datetime the sending application sent this message. MSH-7.
func (o MessageOutput) SendTime() pulumi.StringOutput {
return o.ApplyT(func(v *Message) pulumi.StringOutput { return v.SendTime }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*MessageInput)(nil)).Elem(), &Message{})
pulumi.RegisterOutputType(MessageOutput{})
}