From 581a014ec2d4f7534a2300d297fdcecdb2fb3796 Mon Sep 17 00:00:00 2001 From: Paul Kalhorn <67231903+PaulKalho@users.noreply.github.com> Date: Tue, 10 Sep 2024 00:20:26 +0200 Subject: [PATCH] adds patientPropertyMatchers (#804) * feat: add patientPropertyMatchers * feat: add projection handling * tests * errors * Merge branch 'main' into 'issue/801-patient-property-matcher' * move map assertion up --- .../v1/property_value_svc.pb.dart | 84 ++++- .../v1/property_value_svc.pbjson.dart | 23 +- .../v1/property_views_svc.pb.dart | 20 +- .../v1/property_views_svc.pbjson.dart | 5 +- .../property_svc/v1/property_value_svc.pb.go | 331 ++++++++++++------ .../property_svc/v1/property_views_svc.pb.go | 95 +++-- .../property_svc/v1/property_value_svc_pb2.py | 20 +- .../property_svc/v1/property_views_svc_pb2.py | 12 +- .../v1/property_value_svc_pb.d.ts | 43 +++ .../property_svc/v1/property_value_svc_pb.js | 276 ++++++++++++++- .../v1/property_views_svc_pb.d.ts | 7 + .../property_svc/v1/property_views_svc_pb.js | 58 ++- .../property_svc/v1/property_value_svc.proto | 6 + .../property_svc/v1/property_views_svc.proto | 1 + .../property_svc/v1/property_value_svc_pb2.py | 20 +- .../property_svc/v1/property_views_svc_pb2.py | 12 +- .../internal/property-value/api/grpc.go | 15 + .../internal/property-view/api/grpc_test.go | 145 +++++++- .../property-view/events/v1/events.go | 13 +- .../models/patient_property_matcher.go | 115 ++++++ .../models/property_view_rule.go | 4 + .../models/task_property_matchers.go | 30 +- .../property_rules_postgres.go} | 58 +-- .../property_rules_postgres_test.go} | 83 ++++- services/property-svc/main.go | 4 +- .../migrations/000006_patient_views.down.sql | 1 + .../migrations/000006_patient_views.up.sql | 5 + .../property-svc/repos/patient_views_repo.sql | 23 ++ .../repos/patient_views_repo/db.go | 32 ++ .../repos/patient_views_repo/models.go | 73 ++++ .../patient_views_repo.sql.go | 93 +++++ .../repos/property_repo/models.go | 6 + .../repos/property_value_repo/models.go | 6 + .../repos/task_views_repo/models.go | 6 + .../property-svc/repos/views_repo/models.go | 6 + services/property-svc/schema.sql | 44 ++- services/property-svc/sqlc.yaml | 7 + 37 files changed, 1534 insertions(+), 248 deletions(-) create mode 100644 services/property-svc/internal/property-view/models/patient_property_matcher.go rename services/property-svc/internal/property-view/projections/{task_views_postgres/task_views_postgres.go => property_rules_postgres/property_rules_postgres.go} (81%) rename services/property-svc/internal/property-view/projections/{task_views_postgres/task_views_postgres_test.go => property_rules_postgres/property_rules_postgres_test.go} (60%) create mode 100644 services/property-svc/migrations/000006_patient_views.down.sql create mode 100644 services/property-svc/migrations/000006_patient_views.up.sql create mode 100644 services/property-svc/repos/patient_views_repo.sql create mode 100644 services/property-svc/repos/patient_views_repo/db.go create mode 100644 services/property-svc/repos/patient_views_repo/models.go create mode 100644 services/property-svc/repos/patient_views_repo/patient_views_repo.sql.go diff --git a/gen/dart/lib/services/property_svc/v1/property_value_svc.pb.dart b/gen/dart/lib/services/property_svc/v1/property_value_svc.pb.dart index b3dd68c86..47f9a585b 100644 --- a/gen/dart/lib/services/property_svc/v1/property_value_svc.pb.dart +++ b/gen/dart/lib/services/property_svc/v1/property_value_svc.pb.dart @@ -308,19 +308,88 @@ class TaskPropertyMatcher extends $pb.GeneratedMessage { void clearTaskId() => clearField(2); } +class PatientPropertyMatcher extends $pb.GeneratedMessage { + factory PatientPropertyMatcher({ + $core.String? wardId, + $core.String? patientId, + }) { + final $result = create(); + if (wardId != null) { + $result.wardId = wardId; + } + if (patientId != null) { + $result.patientId = patientId; + } + return $result; + } + PatientPropertyMatcher._() : super(); + factory PatientPropertyMatcher.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory PatientPropertyMatcher.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'PatientPropertyMatcher', package: const $pb.PackageName(_omitMessageNames ? '' : 'services.property_svc.v1'), createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'wardId') + ..aOS(2, _omitFieldNames ? '' : 'patientId') + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + PatientPropertyMatcher clone() => PatientPropertyMatcher()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + PatientPropertyMatcher copyWith(void Function(PatientPropertyMatcher) updates) => super.copyWith((message) => updates(message as PatientPropertyMatcher)) as PatientPropertyMatcher; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static PatientPropertyMatcher create() => PatientPropertyMatcher._(); + PatientPropertyMatcher createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static PatientPropertyMatcher getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static PatientPropertyMatcher? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get wardId => $_getSZ(0); + @$pb.TagNumber(1) + set wardId($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasWardId() => $_has(0); + @$pb.TagNumber(1) + void clearWardId() => clearField(1); + + @$pb.TagNumber(2) + $core.String get patientId => $_getSZ(1); + @$pb.TagNumber(2) + set patientId($core.String v) { $_setString(1, v); } + @$pb.TagNumber(2) + $core.bool hasPatientId() => $_has(1); + @$pb.TagNumber(2) + void clearPatientId() => clearField(2); +} + enum GetAttachedPropertyValuesRequest_Matcher { taskMatcher, + patientMatcher, notSet } class GetAttachedPropertyValuesRequest extends $pb.GeneratedMessage { factory GetAttachedPropertyValuesRequest({ TaskPropertyMatcher? taskMatcher, + PatientPropertyMatcher? patientMatcher, }) { final $result = create(); if (taskMatcher != null) { $result.taskMatcher = taskMatcher; } + if (patientMatcher != null) { + $result.patientMatcher = patientMatcher; + } return $result; } GetAttachedPropertyValuesRequest._() : super(); @@ -329,11 +398,13 @@ class GetAttachedPropertyValuesRequest extends $pb.GeneratedMessage { static const $core.Map<$core.int, GetAttachedPropertyValuesRequest_Matcher> _GetAttachedPropertyValuesRequest_MatcherByTag = { 1 : GetAttachedPropertyValuesRequest_Matcher.taskMatcher, + 2 : GetAttachedPropertyValuesRequest_Matcher.patientMatcher, 0 : GetAttachedPropertyValuesRequest_Matcher.notSet }; static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'GetAttachedPropertyValuesRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'services.property_svc.v1'), createEmptyInstance: create) - ..oo(0, [1]) + ..oo(0, [1, 2]) ..aOM(1, _omitFieldNames ? '' : 'taskMatcher', subBuilder: TaskPropertyMatcher.create) + ..aOM(2, _omitFieldNames ? '' : 'patientMatcher', subBuilder: PatientPropertyMatcher.create) ..hasRequiredFields = false ; @@ -371,6 +442,17 @@ class GetAttachedPropertyValuesRequest extends $pb.GeneratedMessage { void clearTaskMatcher() => clearField(1); @$pb.TagNumber(1) TaskPropertyMatcher ensureTaskMatcher() => $_ensure(0); + + @$pb.TagNumber(2) + PatientPropertyMatcher get patientMatcher => $_getN(1); + @$pb.TagNumber(2) + set patientMatcher(PatientPropertyMatcher v) { setField(2, v); } + @$pb.TagNumber(2) + $core.bool hasPatientMatcher() => $_has(1); + @$pb.TagNumber(2) + void clearPatientMatcher() => clearField(2); + @$pb.TagNumber(2) + PatientPropertyMatcher ensurePatientMatcher() => $_ensure(1); } enum GetAttachedPropertyValuesResponse_Value_Value { diff --git a/gen/dart/lib/services/property_svc/v1/property_value_svc.pbjson.dart b/gen/dart/lib/services/property_svc/v1/property_value_svc.pbjson.dart index 622ea03ec..de6503a7a 100644 --- a/gen/dart/lib/services/property_svc/v1/property_value_svc.pbjson.dart +++ b/gen/dart/lib/services/property_svc/v1/property_value_svc.pbjson.dart @@ -72,11 +72,31 @@ final $typed_data.Uint8List taskPropertyMatcherDescriptor = $convert.base64Decod 'ChNUYXNrUHJvcGVydHlNYXRjaGVyEhwKB3dhcmRfaWQYASABKAlIAFIGd2FyZElkiAEBEhwKB3' 'Rhc2tfaWQYAiABKAlIAVIGdGFza0lkiAEBQgoKCF93YXJkX2lkQgoKCF90YXNrX2lk'); +@$core.Deprecated('Use patientPropertyMatcherDescriptor instead') +const PatientPropertyMatcher$json = { + '1': 'PatientPropertyMatcher', + '2': [ + {'1': 'ward_id', '3': 1, '4': 1, '5': 9, '9': 0, '10': 'wardId', '17': true}, + {'1': 'patient_id', '3': 2, '4': 1, '5': 9, '9': 1, '10': 'patientId', '17': true}, + ], + '8': [ + {'1': '_ward_id'}, + {'1': '_patient_id'}, + ], +}; + +/// Descriptor for `PatientPropertyMatcher`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List patientPropertyMatcherDescriptor = $convert.base64Decode( + 'ChZQYXRpZW50UHJvcGVydHlNYXRjaGVyEhwKB3dhcmRfaWQYASABKAlIAFIGd2FyZElkiAEBEi' + 'IKCnBhdGllbnRfaWQYAiABKAlIAVIJcGF0aWVudElkiAEBQgoKCF93YXJkX2lkQg0KC19wYXRp' + 'ZW50X2lk'); + @$core.Deprecated('Use getAttachedPropertyValuesRequestDescriptor instead') const GetAttachedPropertyValuesRequest$json = { '1': 'GetAttachedPropertyValuesRequest', '2': [ {'1': 'task_matcher', '3': 1, '4': 1, '5': 11, '6': '.services.property_svc.v1.TaskPropertyMatcher', '9': 0, '10': 'taskMatcher'}, + {'1': 'patient_matcher', '3': 2, '4': 1, '5': 11, '6': '.services.property_svc.v1.PatientPropertyMatcher', '9': 0, '10': 'patientMatcher'}, ], '8': [ {'1': 'matcher'}, @@ -87,7 +107,8 @@ const GetAttachedPropertyValuesRequest$json = { final $typed_data.Uint8List getAttachedPropertyValuesRequestDescriptor = $convert.base64Decode( 'CiBHZXRBdHRhY2hlZFByb3BlcnR5VmFsdWVzUmVxdWVzdBJSCgx0YXNrX21hdGNoZXIYASABKA' 'syLS5zZXJ2aWNlcy5wcm9wZXJ0eV9zdmMudjEuVGFza1Byb3BlcnR5TWF0Y2hlckgAUgt0YXNr' - 'TWF0Y2hlckIJCgdtYXRjaGVy'); + 'TWF0Y2hlchJbCg9wYXRpZW50X21hdGNoZXIYAiABKAsyMC5zZXJ2aWNlcy5wcm9wZXJ0eV9zdm' + 'MudjEuUGF0aWVudFByb3BlcnR5TWF0Y2hlckgAUg5wYXRpZW50TWF0Y2hlckIJCgdtYXRjaGVy'); @$core.Deprecated('Use getAttachedPropertyValuesResponseDescriptor instead') const GetAttachedPropertyValuesResponse$json = { diff --git a/gen/dart/lib/services/property_svc/v1/property_views_svc.pb.dart b/gen/dart/lib/services/property_svc/v1/property_views_svc.pb.dart index 61f2b0bfb..1e796361d 100644 --- a/gen/dart/lib/services/property_svc/v1/property_views_svc.pb.dart +++ b/gen/dart/lib/services/property_svc/v1/property_views_svc.pb.dart @@ -91,6 +91,7 @@ class FilterUpdate extends $pb.GeneratedMessage { enum UpdatePropertyViewRuleRequest_Matcher { taskMatcher, + patientMatcher, notSet } @@ -98,6 +99,7 @@ class UpdatePropertyViewRuleRequest extends $pb.GeneratedMessage { factory UpdatePropertyViewRuleRequest({ FilterUpdate? filterUpdate, $4.TaskPropertyMatcher? taskMatcher, + $4.PatientPropertyMatcher? patientMatcher, }) { final $result = create(); if (filterUpdate != null) { @@ -106,6 +108,9 @@ class UpdatePropertyViewRuleRequest extends $pb.GeneratedMessage { if (taskMatcher != null) { $result.taskMatcher = taskMatcher; } + if (patientMatcher != null) { + $result.patientMatcher = patientMatcher; + } return $result; } UpdatePropertyViewRuleRequest._() : super(); @@ -114,12 +119,14 @@ class UpdatePropertyViewRuleRequest extends $pb.GeneratedMessage { static const $core.Map<$core.int, UpdatePropertyViewRuleRequest_Matcher> _UpdatePropertyViewRuleRequest_MatcherByTag = { 2 : UpdatePropertyViewRuleRequest_Matcher.taskMatcher, + 3 : UpdatePropertyViewRuleRequest_Matcher.patientMatcher, 0 : UpdatePropertyViewRuleRequest_Matcher.notSet }; static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'UpdatePropertyViewRuleRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'services.property_svc.v1'), createEmptyInstance: create) - ..oo(0, [2]) + ..oo(0, [2, 3]) ..aOM(1, _omitFieldNames ? '' : 'filterUpdate', subBuilder: FilterUpdate.create) ..aOM<$4.TaskPropertyMatcher>(2, _omitFieldNames ? '' : 'taskMatcher', subBuilder: $4.TaskPropertyMatcher.create) + ..aOM<$4.PatientPropertyMatcher>(3, _omitFieldNames ? '' : 'patientMatcher', subBuilder: $4.PatientPropertyMatcher.create) ..hasRequiredFields = false ; @@ -168,6 +175,17 @@ class UpdatePropertyViewRuleRequest extends $pb.GeneratedMessage { void clearTaskMatcher() => clearField(2); @$pb.TagNumber(2) $4.TaskPropertyMatcher ensureTaskMatcher() => $_ensure(1); + + @$pb.TagNumber(3) + $4.PatientPropertyMatcher get patientMatcher => $_getN(2); + @$pb.TagNumber(3) + set patientMatcher($4.PatientPropertyMatcher v) { setField(3, v); } + @$pb.TagNumber(3) + $core.bool hasPatientMatcher() => $_has(2); + @$pb.TagNumber(3) + void clearPatientMatcher() => clearField(3); + @$pb.TagNumber(3) + $4.PatientPropertyMatcher ensurePatientMatcher() => $_ensure(2); } class UpdatePropertyViewRuleResponse extends $pb.GeneratedMessage { diff --git a/gen/dart/lib/services/property_svc/v1/property_views_svc.pbjson.dart b/gen/dart/lib/services/property_svc/v1/property_views_svc.pbjson.dart index 17e95c898..1d27b00c0 100644 --- a/gen/dart/lib/services/property_svc/v1/property_views_svc.pbjson.dart +++ b/gen/dart/lib/services/property_svc/v1/property_views_svc.pbjson.dart @@ -38,6 +38,7 @@ const UpdatePropertyViewRuleRequest$json = { '2': [ {'1': 'filter_update', '3': 1, '4': 1, '5': 11, '6': '.services.property_svc.v1.FilterUpdate', '10': 'filterUpdate'}, {'1': 'task_matcher', '3': 2, '4': 1, '5': 11, '6': '.services.property_svc.v1.TaskPropertyMatcher', '9': 0, '10': 'taskMatcher'}, + {'1': 'patient_matcher', '3': 3, '4': 1, '5': 11, '6': '.services.property_svc.v1.PatientPropertyMatcher', '9': 0, '10': 'patientMatcher'}, ], '8': [ {'1': 'matcher'}, @@ -49,7 +50,9 @@ final $typed_data.Uint8List updatePropertyViewRuleRequestDescriptor = $convert.b 'Ch1VcGRhdGVQcm9wZXJ0eVZpZXdSdWxlUmVxdWVzdBJLCg1maWx0ZXJfdXBkYXRlGAEgASgLMi' 'Yuc2VydmljZXMucHJvcGVydHlfc3ZjLnYxLkZpbHRlclVwZGF0ZVIMZmlsdGVyVXBkYXRlElIK' 'DHRhc2tfbWF0Y2hlchgCIAEoCzItLnNlcnZpY2VzLnByb3BlcnR5X3N2Yy52MS5UYXNrUHJvcG' - 'VydHlNYXRjaGVySABSC3Rhc2tNYXRjaGVyQgkKB21hdGNoZXI='); + 'VydHlNYXRjaGVySABSC3Rhc2tNYXRjaGVyElsKD3BhdGllbnRfbWF0Y2hlchgDIAEoCzIwLnNl' + 'cnZpY2VzLnByb3BlcnR5X3N2Yy52MS5QYXRpZW50UHJvcGVydHlNYXRjaGVySABSDnBhdGllbn' + 'RNYXRjaGVyQgkKB21hdGNoZXI='); @$core.Deprecated('Use updatePropertyViewRuleResponseDescriptor instead') const UpdatePropertyViewRuleResponse$json = { diff --git a/gen/go/services/property_svc/v1/property_value_svc.pb.go b/gen/go/services/property_svc/v1/property_value_svc.pb.go index b54b8d22d..9dbecb8db 100644 --- a/gen/go/services/property_svc/v1/property_value_svc.pb.go +++ b/gen/go/services/property_svc/v1/property_value_svc.pb.go @@ -277,6 +277,61 @@ func (x *TaskPropertyMatcher) GetTaskId() string { return "" } +type PatientPropertyMatcher struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + WardId *string `protobuf:"bytes,1,opt,name=ward_id,json=wardId,proto3,oneof" json:"ward_id,omitempty" validate:"omitempty,omitnil,uuid4"` // @gotags: validate:"omitempty,omitnil,uuid4" + PatientId *string `protobuf:"bytes,2,opt,name=patient_id,json=patientId,proto3,oneof" json:"patient_id,omitempty" validate:"omitempty,omitnil,uuid4"` // @gotags: validate:"omitempty,omitnil,uuid4" +} + +func (x *PatientPropertyMatcher) Reset() { + *x = PatientPropertyMatcher{} + if protoimpl.UnsafeEnabled { + mi := &file_services_property_svc_v1_property_value_svc_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PatientPropertyMatcher) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PatientPropertyMatcher) ProtoMessage() {} + +func (x *PatientPropertyMatcher) ProtoReflect() protoreflect.Message { + mi := &file_services_property_svc_v1_property_value_svc_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PatientPropertyMatcher.ProtoReflect.Descriptor instead. +func (*PatientPropertyMatcher) Descriptor() ([]byte, []int) { + return file_services_property_svc_v1_property_value_svc_proto_rawDescGZIP(), []int{3} +} + +func (x *PatientPropertyMatcher) GetWardId() string { + if x != nil && x.WardId != nil { + return *x.WardId + } + return "" +} + +func (x *PatientPropertyMatcher) GetPatientId() string { + if x != nil && x.PatientId != nil { + return *x.PatientId + } + return "" +} + type GetAttachedPropertyValuesRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -285,13 +340,14 @@ type GetAttachedPropertyValuesRequest struct { // Types that are assignable to Matcher: // // *GetAttachedPropertyValuesRequest_TaskMatcher + // *GetAttachedPropertyValuesRequest_PatientMatcher Matcher isGetAttachedPropertyValuesRequest_Matcher `protobuf_oneof:"matcher"` } func (x *GetAttachedPropertyValuesRequest) Reset() { *x = GetAttachedPropertyValuesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_services_property_svc_v1_property_value_svc_proto_msgTypes[3] + mi := &file_services_property_svc_v1_property_value_svc_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -304,7 +360,7 @@ func (x *GetAttachedPropertyValuesRequest) String() string { func (*GetAttachedPropertyValuesRequest) ProtoMessage() {} func (x *GetAttachedPropertyValuesRequest) ProtoReflect() protoreflect.Message { - mi := &file_services_property_svc_v1_property_value_svc_proto_msgTypes[3] + mi := &file_services_property_svc_v1_property_value_svc_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -317,7 +373,7 @@ func (x *GetAttachedPropertyValuesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAttachedPropertyValuesRequest.ProtoReflect.Descriptor instead. func (*GetAttachedPropertyValuesRequest) Descriptor() ([]byte, []int) { - return file_services_property_svc_v1_property_value_svc_proto_rawDescGZIP(), []int{3} + return file_services_property_svc_v1_property_value_svc_proto_rawDescGZIP(), []int{4} } func (m *GetAttachedPropertyValuesRequest) GetMatcher() isGetAttachedPropertyValuesRequest_Matcher { @@ -334,6 +390,13 @@ func (x *GetAttachedPropertyValuesRequest) GetTaskMatcher() *TaskPropertyMatcher return nil } +func (x *GetAttachedPropertyValuesRequest) GetPatientMatcher() *PatientPropertyMatcher { + if x, ok := x.GetMatcher().(*GetAttachedPropertyValuesRequest_PatientMatcher); ok { + return x.PatientMatcher + } + return nil +} + type isGetAttachedPropertyValuesRequest_Matcher interface { isGetAttachedPropertyValuesRequest_Matcher() } @@ -342,8 +405,15 @@ type GetAttachedPropertyValuesRequest_TaskMatcher struct { TaskMatcher *TaskPropertyMatcher `protobuf:"bytes,1,opt,name=task_matcher,json=taskMatcher,proto3,oneof"` } +type GetAttachedPropertyValuesRequest_PatientMatcher struct { + PatientMatcher *PatientPropertyMatcher `protobuf:"bytes,2,opt,name=patient_matcher,json=patientMatcher,proto3,oneof"` +} + func (*GetAttachedPropertyValuesRequest_TaskMatcher) isGetAttachedPropertyValuesRequest_Matcher() {} +func (*GetAttachedPropertyValuesRequest_PatientMatcher) isGetAttachedPropertyValuesRequest_Matcher() { +} + type GetAttachedPropertyValuesResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -355,7 +425,7 @@ type GetAttachedPropertyValuesResponse struct { func (x *GetAttachedPropertyValuesResponse) Reset() { *x = GetAttachedPropertyValuesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_services_property_svc_v1_property_value_svc_proto_msgTypes[4] + mi := &file_services_property_svc_v1_property_value_svc_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -368,7 +438,7 @@ func (x *GetAttachedPropertyValuesResponse) String() string { func (*GetAttachedPropertyValuesResponse) ProtoMessage() {} func (x *GetAttachedPropertyValuesResponse) ProtoReflect() protoreflect.Message { - mi := &file_services_property_svc_v1_property_value_svc_proto_msgTypes[4] + mi := &file_services_property_svc_v1_property_value_svc_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -381,7 +451,7 @@ func (x *GetAttachedPropertyValuesResponse) ProtoReflect() protoreflect.Message // Deprecated: Use GetAttachedPropertyValuesResponse.ProtoReflect.Descriptor instead. func (*GetAttachedPropertyValuesResponse) Descriptor() ([]byte, []int) { - return file_services_property_svc_v1_property_value_svc_proto_rawDescGZIP(), []int{4} + return file_services_property_svc_v1_property_value_svc_proto_rawDescGZIP(), []int{5} } func (x *GetAttachedPropertyValuesResponse) GetValues() []*GetAttachedPropertyValuesResponse_Value { @@ -415,7 +485,7 @@ type GetAttachedPropertyValuesResponse_Value struct { func (x *GetAttachedPropertyValuesResponse_Value) Reset() { *x = GetAttachedPropertyValuesResponse_Value{} if protoimpl.UnsafeEnabled { - mi := &file_services_property_svc_v1_property_value_svc_proto_msgTypes[5] + mi := &file_services_property_svc_v1_property_value_svc_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -428,7 +498,7 @@ func (x *GetAttachedPropertyValuesResponse_Value) String() string { func (*GetAttachedPropertyValuesResponse_Value) ProtoMessage() {} func (x *GetAttachedPropertyValuesResponse_Value) ProtoReflect() protoreflect.Message { - mi := &file_services_property_svc_v1_property_value_svc_proto_msgTypes[5] + mi := &file_services_property_svc_v1_property_value_svc_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -441,7 +511,7 @@ func (x *GetAttachedPropertyValuesResponse_Value) ProtoReflect() protoreflect.Me // Deprecated: Use GetAttachedPropertyValuesResponse_Value.ProtoReflect.Descriptor instead. func (*GetAttachedPropertyValuesResponse_Value) Descriptor() ([]byte, []int) { - return file_services_property_svc_v1_property_value_svc_proto_rawDescGZIP(), []int{4, 0} + return file_services_property_svc_v1_property_value_svc_proto_rawDescGZIP(), []int{5, 0} } func (x *GetAttachedPropertyValuesResponse_Value) GetPropertyId() string { @@ -621,88 +691,101 @@ var file_services_property_svc_v1_property_value_svc_proto_rawDesc = []byte{ 0x1c, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x74, 0x61, - 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x22, 0x81, 0x01, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, + 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x22, 0x75, 0x0a, 0x16, 0x50, 0x61, 0x74, 0x69, 0x65, 0x6e, 0x74, + 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, + 0x1c, 0x0a, 0x07, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x00, 0x52, 0x06, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x22, 0x0a, + 0x0a, 0x70, 0x61, 0x74, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x01, 0x52, 0x09, 0x70, 0x61, 0x74, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x88, 0x01, + 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x42, 0x0d, 0x0a, + 0x0b, 0x5f, 0x70, 0x61, 0x74, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x22, 0xde, 0x01, 0x0a, + 0x20, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x52, 0x0a, 0x0c, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x5f, 0x73, 0x76, 0x63, 0x2e, + 0x76, 0x31, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x4d, + 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0b, 0x74, 0x61, 0x73, 0x6b, 0x4d, 0x61, + 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x5b, 0x0a, 0x0f, 0x70, 0x61, 0x74, 0x69, 0x65, 0x6e, 0x74, + 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, + 0x74, 0x79, 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x74, 0x69, 0x65, 0x6e, + 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, + 0x48, 0x00, 0x52, 0x0e, 0x70, 0x61, 0x74, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, + 0x65, 0x72, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x22, 0xf5, 0x04, + 0x0a, 0x21, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x50, 0x72, 0x6f, + 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x65, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, + 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x1a, 0xf4, + 0x03, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, + 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x49, 0x64, 0x12, 0x42, 0x0a, 0x0a, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, + 0x79, 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x09, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x25, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x61, + 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, + 0x73, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 0x12, 0x1f, 0x0a, 0x0a, 0x74, 0x65, 0x78, + 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, + 0x09, 0x74, 0x65, 0x78, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x6e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x01, + 0x48, 0x00, 0x52, 0x0b, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x1f, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x3f, 0x0a, 0x0a, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, + 0x44, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x09, 0x64, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x44, 0x0a, 0x0f, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, + 0x6d, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, + 0x0b, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x07, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0xb6, 0x02, 0x0a, 0x14, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, + 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x84, + 0x01, 0x0a, 0x13, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, + 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x34, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, + 0x31, 0x2e, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, + 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x50, 0x72, + 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x96, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x52, 0x0a, 0x0c, 0x74, 0x61, - 0x73, 0x6b, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, - 0x65, 0x72, 0x74, 0x79, 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x73, 0x6b, - 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x48, - 0x00, 0x52, 0x0b, 0x74, 0x61, 0x73, 0x6b, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x42, 0x09, - 0x0a, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x22, 0xf5, 0x04, 0x0a, 0x21, 0x47, 0x65, - 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, - 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x59, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x41, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x65, - 0x72, 0x74, 0x79, 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x74, - 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x1a, 0xf4, 0x03, 0x0a, 0x05, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, - 0x72, 0x74, 0x79, 0x49, 0x64, 0x12, 0x42, 0x0a, 0x0a, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x5f, 0x73, 0x76, - 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, - 0x66, 0x69, 0x65, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x48, 0x01, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x61, 0x72, 0x63, 0x68, 0x69, - 0x76, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x41, 0x72, 0x63, - 0x68, 0x69, 0x76, 0x65, 0x64, 0x12, 0x1f, 0x0a, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x74, 0x65, 0x78, - 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x0b, - 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0a, 0x62, - 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x48, - 0x00, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3f, 0x0a, 0x0a, - 0x64, 0x61, 0x74, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, - 0x65, 0x72, 0x74, 0x79, 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x61, 0x74, 0x65, - 0x48, 0x00, 0x52, 0x09, 0x64, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x44, 0x0a, - 0x0f, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x48, 0x00, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x65, 0x6c, - 0x65, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x32, 0xb6, 0x02, 0x0a, 0x14, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x84, 0x01, 0x0a, 0x13, 0x41, - 0x74, 0x74, 0x61, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x12, 0x34, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, - 0x74, 0x61, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x5f, 0x73, 0x76, 0x63, - 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x96, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, - 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, - 0x3a, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x65, + 0x75, 0x65, 0x73, 0x12, 0x3a, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x65, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, + 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x3b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3b, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x5f, - 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, - 0x65, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0xd4, 0x01, 0x0a, 0x1c, 0x63, - 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, - 0x65, 0x72, 0x74, 0x79, 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x42, 0x15, 0x50, 0x72, 0x6f, - 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x76, 0x63, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, - 0x79, 0x2d, 0x73, 0x76, 0x63, 0xa2, 0x02, 0x03, 0x53, 0x50, 0x58, 0xaa, 0x02, 0x17, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x53, - 0x76, 0x63, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x17, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x5c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x53, 0x76, 0x63, 0x5c, 0x56, 0x31, 0xe2, - 0x02, 0x23, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x5c, 0x50, 0x72, 0x6f, 0x70, 0x65, - 0x72, 0x74, 0x79, 0x53, 0x76, 0x63, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x53, 0x76, 0x63, 0x3a, 0x3a, 0x56, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0xd4, + 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x42, + 0x15, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x76, + 0x63, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, + 0x70, 0x65, 0x72, 0x74, 0x79, 0x2d, 0x73, 0x76, 0x63, 0xa2, 0x02, 0x03, 0x53, 0x50, 0x58, 0xaa, + 0x02, 0x17, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x79, 0x53, 0x76, 0x63, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x17, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x73, 0x5c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x53, 0x76, 0x63, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x23, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x5c, 0x50, + 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x53, 0x76, 0x63, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x73, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x53, 0x76, + 0x63, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -717,35 +800,37 @@ func file_services_property_svc_v1_property_value_svc_proto_rawDescGZIP() []byte return file_services_property_svc_v1_property_value_svc_proto_rawDescData } -var file_services_property_svc_v1_property_value_svc_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_services_property_svc_v1_property_value_svc_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_services_property_svc_v1_property_value_svc_proto_goTypes = []interface{}{ (*AttachPropertyValueRequest)(nil), // 0: services.property_svc.v1.AttachPropertyValueRequest (*AttachPropertyValueResponse)(nil), // 1: services.property_svc.v1.AttachPropertyValueResponse (*TaskPropertyMatcher)(nil), // 2: services.property_svc.v1.TaskPropertyMatcher - (*GetAttachedPropertyValuesRequest)(nil), // 3: services.property_svc.v1.GetAttachedPropertyValuesRequest - (*GetAttachedPropertyValuesResponse)(nil), // 4: services.property_svc.v1.GetAttachedPropertyValuesResponse - (*GetAttachedPropertyValuesResponse_Value)(nil), // 5: services.property_svc.v1.GetAttachedPropertyValuesResponse.Value - (*Date)(nil), // 6: services.property_svc.v1.Date - (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp - (FieldType)(0), // 8: services.property_svc.v1.FieldType + (*PatientPropertyMatcher)(nil), // 3: services.property_svc.v1.PatientPropertyMatcher + (*GetAttachedPropertyValuesRequest)(nil), // 4: services.property_svc.v1.GetAttachedPropertyValuesRequest + (*GetAttachedPropertyValuesResponse)(nil), // 5: services.property_svc.v1.GetAttachedPropertyValuesResponse + (*GetAttachedPropertyValuesResponse_Value)(nil), // 6: services.property_svc.v1.GetAttachedPropertyValuesResponse.Value + (*Date)(nil), // 7: services.property_svc.v1.Date + (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp + (FieldType)(0), // 9: services.property_svc.v1.FieldType } var file_services_property_svc_v1_property_value_svc_proto_depIdxs = []int32{ - 6, // 0: services.property_svc.v1.AttachPropertyValueRequest.date_value:type_name -> services.property_svc.v1.Date - 7, // 1: services.property_svc.v1.AttachPropertyValueRequest.date_time_value:type_name -> google.protobuf.Timestamp - 2, // 2: services.property_svc.v1.GetAttachedPropertyValuesRequest.task_matcher:type_name -> services.property_svc.v1.TaskPropertyMatcher - 5, // 3: services.property_svc.v1.GetAttachedPropertyValuesResponse.values:type_name -> services.property_svc.v1.GetAttachedPropertyValuesResponse.Value - 8, // 4: services.property_svc.v1.GetAttachedPropertyValuesResponse.Value.field_type:type_name -> services.property_svc.v1.FieldType - 6, // 5: services.property_svc.v1.GetAttachedPropertyValuesResponse.Value.date_value:type_name -> services.property_svc.v1.Date - 7, // 6: services.property_svc.v1.GetAttachedPropertyValuesResponse.Value.date_time_value:type_name -> google.protobuf.Timestamp - 0, // 7: services.property_svc.v1.PropertyValueService.AttachPropertyValue:input_type -> services.property_svc.v1.AttachPropertyValueRequest - 3, // 8: services.property_svc.v1.PropertyValueService.GetAttachedPropertyValues:input_type -> services.property_svc.v1.GetAttachedPropertyValuesRequest - 1, // 9: services.property_svc.v1.PropertyValueService.AttachPropertyValue:output_type -> services.property_svc.v1.AttachPropertyValueResponse - 4, // 10: services.property_svc.v1.PropertyValueService.GetAttachedPropertyValues:output_type -> services.property_svc.v1.GetAttachedPropertyValuesResponse - 9, // [9:11] is the sub-list for method output_type - 7, // [7:9] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 7, // 0: services.property_svc.v1.AttachPropertyValueRequest.date_value:type_name -> services.property_svc.v1.Date + 8, // 1: services.property_svc.v1.AttachPropertyValueRequest.date_time_value:type_name -> google.protobuf.Timestamp + 2, // 2: services.property_svc.v1.GetAttachedPropertyValuesRequest.task_matcher:type_name -> services.property_svc.v1.TaskPropertyMatcher + 3, // 3: services.property_svc.v1.GetAttachedPropertyValuesRequest.patient_matcher:type_name -> services.property_svc.v1.PatientPropertyMatcher + 6, // 4: services.property_svc.v1.GetAttachedPropertyValuesResponse.values:type_name -> services.property_svc.v1.GetAttachedPropertyValuesResponse.Value + 9, // 5: services.property_svc.v1.GetAttachedPropertyValuesResponse.Value.field_type:type_name -> services.property_svc.v1.FieldType + 7, // 6: services.property_svc.v1.GetAttachedPropertyValuesResponse.Value.date_value:type_name -> services.property_svc.v1.Date + 8, // 7: services.property_svc.v1.GetAttachedPropertyValuesResponse.Value.date_time_value:type_name -> google.protobuf.Timestamp + 0, // 8: services.property_svc.v1.PropertyValueService.AttachPropertyValue:input_type -> services.property_svc.v1.AttachPropertyValueRequest + 4, // 9: services.property_svc.v1.PropertyValueService.GetAttachedPropertyValues:input_type -> services.property_svc.v1.GetAttachedPropertyValuesRequest + 1, // 10: services.property_svc.v1.PropertyValueService.AttachPropertyValue:output_type -> services.property_svc.v1.AttachPropertyValueResponse + 5, // 11: services.property_svc.v1.PropertyValueService.GetAttachedPropertyValues:output_type -> services.property_svc.v1.GetAttachedPropertyValuesResponse + 10, // [10:12] is the sub-list for method output_type + 8, // [8:10] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_services_property_svc_v1_property_value_svc_proto_init() } @@ -792,7 +877,7 @@ func file_services_property_svc_v1_property_value_svc_proto_init() { } } file_services_property_svc_v1_property_value_svc_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetAttachedPropertyValuesRequest); i { + switch v := v.(*PatientPropertyMatcher); i { case 0: return &v.state case 1: @@ -804,7 +889,7 @@ func file_services_property_svc_v1_property_value_svc_proto_init() { } } file_services_property_svc_v1_property_value_svc_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetAttachedPropertyValuesResponse); i { + switch v := v.(*GetAttachedPropertyValuesRequest); i { case 0: return &v.state case 1: @@ -816,6 +901,18 @@ func file_services_property_svc_v1_property_value_svc_proto_init() { } } file_services_property_svc_v1_property_value_svc_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAttachedPropertyValuesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_services_property_svc_v1_property_value_svc_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetAttachedPropertyValuesResponse_Value); i { case 0: return &v.state @@ -837,10 +934,12 @@ func file_services_property_svc_v1_property_value_svc_proto_init() { (*AttachPropertyValueRequest_SelectValue)(nil), } file_services_property_svc_v1_property_value_svc_proto_msgTypes[2].OneofWrappers = []interface{}{} - file_services_property_svc_v1_property_value_svc_proto_msgTypes[3].OneofWrappers = []interface{}{ + file_services_property_svc_v1_property_value_svc_proto_msgTypes[3].OneofWrappers = []interface{}{} + file_services_property_svc_v1_property_value_svc_proto_msgTypes[4].OneofWrappers = []interface{}{ (*GetAttachedPropertyValuesRequest_TaskMatcher)(nil), + (*GetAttachedPropertyValuesRequest_PatientMatcher)(nil), } - file_services_property_svc_v1_property_value_svc_proto_msgTypes[5].OneofWrappers = []interface{}{ + file_services_property_svc_v1_property_value_svc_proto_msgTypes[6].OneofWrappers = []interface{}{ (*GetAttachedPropertyValuesResponse_Value_TextValue)(nil), (*GetAttachedPropertyValuesResponse_Value_NumberValue)(nil), (*GetAttachedPropertyValuesResponse_Value_BoolValue)(nil), @@ -854,7 +953,7 @@ func file_services_property_svc_v1_property_value_svc_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_services_property_svc_v1_property_value_svc_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 7, NumExtensions: 0, NumServices: 1, }, diff --git a/gen/go/services/property_svc/v1/property_views_svc.pb.go b/gen/go/services/property_svc/v1/property_views_svc.pb.go index 1fb941e29..1f1b506d2 100644 --- a/gen/go/services/property_svc/v1/property_views_svc.pb.go +++ b/gen/go/services/property_svc/v1/property_views_svc.pb.go @@ -106,6 +106,7 @@ type UpdatePropertyViewRuleRequest struct { // Types that are assignable to Matcher: // // *UpdatePropertyViewRuleRequest_TaskMatcher + // *UpdatePropertyViewRuleRequest_PatientMatcher Matcher isUpdatePropertyViewRuleRequest_Matcher `protobuf_oneof:"matcher"` } @@ -162,6 +163,13 @@ func (x *UpdatePropertyViewRuleRequest) GetTaskMatcher() *TaskPropertyMatcher { return nil } +func (x *UpdatePropertyViewRuleRequest) GetPatientMatcher() *PatientPropertyMatcher { + if x, ok := x.GetMatcher().(*UpdatePropertyViewRuleRequest_PatientMatcher); ok { + return x.PatientMatcher + } + return nil +} + type isUpdatePropertyViewRuleRequest_Matcher interface { isUpdatePropertyViewRuleRequest_Matcher() } @@ -170,8 +178,14 @@ type UpdatePropertyViewRuleRequest_TaskMatcher struct { TaskMatcher *TaskPropertyMatcher `protobuf:"bytes,2,opt,name=task_matcher,json=taskMatcher,proto3,oneof"` } +type UpdatePropertyViewRuleRequest_PatientMatcher struct { + PatientMatcher *PatientPropertyMatcher `protobuf:"bytes,3,opt,name=patient_matcher,json=patientMatcher,proto3,oneof"` +} + func (*UpdatePropertyViewRuleRequest_TaskMatcher) isUpdatePropertyViewRuleRequest_Matcher() {} +func (*UpdatePropertyViewRuleRequest_PatientMatcher) isUpdatePropertyViewRuleRequest_Matcher() {} + type UpdatePropertyViewRuleResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -238,7 +252,7 @@ var file_services_property_svc_v1_property_views_svc_proto_rawDesc = []byte{ 0x77, 0x61, 0x79, 0x73, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x1b, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x44, 0x6f, 0x6e, 0x74, 0x41, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x22, - 0xcb, 0x01, 0x0a, 0x1d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, + 0xa8, 0x02, 0x0a, 0x1d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x69, 0x65, 0x77, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4b, 0x0a, 0x0d, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, @@ -250,34 +264,40 @@ var file_services_property_svc_v1_property_views_svc_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0b, 0x74, 0x61, 0x73, 0x6b, 0x4d, 0x61, 0x74, 0x63, 0x68, - 0x65, 0x72, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x22, 0x20, 0x0a, - 0x1e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, - 0x69, 0x65, 0x77, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, - 0xa6, 0x01, 0x0a, 0x14, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x69, 0x65, 0x77, - 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x8d, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x69, 0x65, 0x77, 0x52, - 0x75, 0x6c, 0x65, 0x12, 0x37, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x69, 0x65, - 0x77, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, - 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, - 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x69, 0x65, 0x77, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0xd4, 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x79, 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x42, 0x15, 0x50, 0x72, 0x6f, 0x70, 0x65, - 0x72, 0x74, 0x79, 0x56, 0x69, 0x65, 0x77, 0x73, 0x53, 0x76, 0x63, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x1f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x2d, - 0x73, 0x76, 0x63, 0xa2, 0x02, 0x03, 0x53, 0x50, 0x58, 0xaa, 0x02, 0x17, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x53, 0x76, 0x63, - 0x2e, 0x56, 0x31, 0xca, 0x02, 0x17, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x5c, 0x50, - 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x53, 0x76, 0x63, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x23, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x5c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, - 0x79, 0x53, 0x76, 0x63, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x3a, 0x3a, - 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x53, 0x76, 0x63, 0x3a, 0x3a, 0x56, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x72, 0x12, 0x5b, 0x0a, 0x0f, 0x70, 0x61, 0x74, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x61, + 0x74, 0x63, 0x68, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x5f, + 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x74, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x72, + 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x48, 0x00, 0x52, + 0x0e, 0x70, 0x61, 0x74, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x42, + 0x09, 0x0a, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x22, 0x20, 0x0a, 0x1e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x69, 0x65, 0x77, + 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xa6, 0x01, 0x0a, + 0x14, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x69, 0x65, 0x77, 0x73, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x8d, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x69, 0x65, 0x77, 0x52, 0x75, 0x6c, 0x65, + 0x12, 0x37, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x69, 0x65, 0x77, 0x52, 0x75, + 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x5f, 0x73, 0x76, + 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x79, 0x56, 0x69, 0x65, 0x77, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0xd4, 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x5f, + 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x42, 0x15, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, + 0x56, 0x69, 0x65, 0x77, 0x73, 0x53, 0x76, 0x63, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x1f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x2d, 0x73, 0x76, 0x63, + 0xa2, 0x02, 0x03, 0x53, 0x50, 0x58, 0xaa, 0x02, 0x17, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x53, 0x76, 0x63, 0x2e, 0x56, 0x31, + 0xca, 0x02, 0x17, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x5c, 0x50, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x53, 0x76, 0x63, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x23, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x73, 0x5c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x53, 0x76, + 0x63, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x19, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x3a, 0x3a, 0x50, 0x72, 0x6f, + 0x70, 0x65, 0x72, 0x74, 0x79, 0x53, 0x76, 0x63, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -298,17 +318,19 @@ var file_services_property_svc_v1_property_views_svc_proto_goTypes = []interface (*UpdatePropertyViewRuleRequest)(nil), // 1: services.property_svc.v1.UpdatePropertyViewRuleRequest (*UpdatePropertyViewRuleResponse)(nil), // 2: services.property_svc.v1.UpdatePropertyViewRuleResponse (*TaskPropertyMatcher)(nil), // 3: services.property_svc.v1.TaskPropertyMatcher + (*PatientPropertyMatcher)(nil), // 4: services.property_svc.v1.PatientPropertyMatcher } var file_services_property_svc_v1_property_views_svc_proto_depIdxs = []int32{ 0, // 0: services.property_svc.v1.UpdatePropertyViewRuleRequest.filter_update:type_name -> services.property_svc.v1.FilterUpdate 3, // 1: services.property_svc.v1.UpdatePropertyViewRuleRequest.task_matcher:type_name -> services.property_svc.v1.TaskPropertyMatcher - 1, // 2: services.property_svc.v1.PropertyViewsService.UpdatePropertyViewRule:input_type -> services.property_svc.v1.UpdatePropertyViewRuleRequest - 2, // 3: services.property_svc.v1.PropertyViewsService.UpdatePropertyViewRule:output_type -> services.property_svc.v1.UpdatePropertyViewRuleResponse - 3, // [3:4] is the sub-list for method output_type - 2, // [2:3] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 4, // 2: services.property_svc.v1.UpdatePropertyViewRuleRequest.patient_matcher:type_name -> services.property_svc.v1.PatientPropertyMatcher + 1, // 3: services.property_svc.v1.PropertyViewsService.UpdatePropertyViewRule:input_type -> services.property_svc.v1.UpdatePropertyViewRuleRequest + 2, // 4: services.property_svc.v1.PropertyViewsService.UpdatePropertyViewRule:output_type -> services.property_svc.v1.UpdatePropertyViewRuleResponse + 4, // [4:5] is the sub-list for method output_type + 3, // [3:4] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_services_property_svc_v1_property_views_svc_proto_init() } @@ -357,6 +379,7 @@ func file_services_property_svc_v1_property_views_svc_proto_init() { } file_services_property_svc_v1_property_views_svc_proto_msgTypes[1].OneofWrappers = []interface{}{ (*UpdatePropertyViewRuleRequest_TaskMatcher)(nil), + (*UpdatePropertyViewRuleRequest_PatientMatcher)(nil), } type x struct{} out := protoimpl.TypeBuilder{ diff --git a/gen/python/services/property_svc/v1/property_value_svc_pb2.py b/gen/python/services/property_svc/v1/property_value_svc_pb2.py index 5420d93ea..49b1d7f8e 100644 --- a/gen/python/services/property_svc/v1/property_value_svc_pb2.py +++ b/gen/python/services/property_svc/v1/property_value_svc_pb2.py @@ -16,7 +16,7 @@ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n1services/property_svc/v1/property_value_svc.proto\x12\x18services.property_svc.v1\x1a$services/property_svc/v1/types.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf8\x02\n\x1a\x41ttachPropertyValueRequest\x12\x1d\n\nsubject_id\x18\x01 \x01(\tR\tsubjectId\x12\x1f\n\x0bproperty_id\x18\x02 \x01(\tR\npropertyId\x12\x1f\n\ntext_value\x18\x03 \x01(\tH\x00R\ttextValue\x12#\n\x0cnumber_value\x18\x04 \x01(\x01H\x00R\x0bnumberValue\x12\x1f\n\nbool_value\x18\x05 \x01(\x08H\x00R\tboolValue\x12?\n\ndate_value\x18\x06 \x01(\x0b\x32\x1e.services.property_svc.v1.DateH\x00R\tdateValue\x12\x44\n\x0f\x64\x61te_time_value\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\rdateTimeValue\x12#\n\x0cselect_value\x18\x08 \x01(\tH\x00R\x0bselectValueB\x07\n\x05value\"I\n\x1b\x41ttachPropertyValueResponse\x12*\n\x11property_value_id\x18\x01 \x01(\tR\x0fpropertyValueId\"i\n\x13TaskPropertyMatcher\x12\x1c\n\x07ward_id\x18\x01 \x01(\tH\x00R\x06wardId\x88\x01\x01\x12\x1c\n\x07task_id\x18\x02 \x01(\tH\x01R\x06taskId\x88\x01\x01\x42\n\n\x08_ward_idB\n\n\x08_task_id\"\x81\x01\n GetAttachedPropertyValuesRequest\x12R\n\x0ctask_matcher\x18\x01 \x01(\x0b\x32-.services.property_svc.v1.TaskPropertyMatcherH\x00R\x0btaskMatcherB\t\n\x07matcher\"\xf5\x04\n!GetAttachedPropertyValuesResponse\x12Y\n\x06values\x18\x01 \x03(\x0b\x32\x41.services.property_svc.v1.GetAttachedPropertyValuesResponse.ValueR\x06values\x1a\xf4\x03\n\x05Value\x12\x1f\n\x0bproperty_id\x18\x01 \x01(\tR\npropertyId\x12\x42\n\nfield_type\x18\x02 \x01(\x0e\x32#.services.property_svc.v1.FieldTypeR\tfieldType\x12\x12\n\x04name\x18\x03 \x01(\tR\x04name\x12%\n\x0b\x64\x65scription\x18\x04 \x01(\tH\x01R\x0b\x64\x65scription\x88\x01\x01\x12\x1f\n\x0bis_archived\x18\x05 \x01(\x08R\nisArchived\x12\x1f\n\ntext_value\x18\x06 \x01(\tH\x00R\ttextValue\x12#\n\x0cnumber_value\x18\x07 \x01(\x01H\x00R\x0bnumberValue\x12\x1f\n\nbool_value\x18\x08 \x01(\x08H\x00R\tboolValue\x12?\n\ndate_value\x18\t \x01(\x0b\x32\x1e.services.property_svc.v1.DateH\x00R\tdateValue\x12\x44\n\x0f\x64\x61te_time_value\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\rdateTimeValue\x12#\n\x0cselect_value\x18\x0b \x01(\tH\x00R\x0bselectValueB\x07\n\x05valueB\x0e\n\x0c_description2\xb6\x02\n\x14PropertyValueService\x12\x84\x01\n\x13\x41ttachPropertyValue\x12\x34.services.property_svc.v1.AttachPropertyValueRequest\x1a\x35.services.property_svc.v1.AttachPropertyValueResponse\"\x00\x12\x96\x01\n\x19GetAttachedPropertyValues\x12:.services.property_svc.v1.GetAttachedPropertyValuesRequest\x1a;.services.property_svc.v1.GetAttachedPropertyValuesResponse\"\x00\x42\xd4\x01\n\x1c\x63om.services.property_svc.v1B\x15PropertyValueSvcProtoP\x01Z\x1fgen/proto/services/property-svc\xa2\x02\x03SPX\xaa\x02\x17Services.PropertySvc.V1\xca\x02\x17Services\\PropertySvc\\V1\xe2\x02#Services\\PropertySvc\\V1\\GPBMetadata\xea\x02\x19Services::PropertySvc::V1b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n1services/property_svc/v1/property_value_svc.proto\x12\x18services.property_svc.v1\x1a$services/property_svc/v1/types.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf8\x02\n\x1a\x41ttachPropertyValueRequest\x12\x1d\n\nsubject_id\x18\x01 \x01(\tR\tsubjectId\x12\x1f\n\x0bproperty_id\x18\x02 \x01(\tR\npropertyId\x12\x1f\n\ntext_value\x18\x03 \x01(\tH\x00R\ttextValue\x12#\n\x0cnumber_value\x18\x04 \x01(\x01H\x00R\x0bnumberValue\x12\x1f\n\nbool_value\x18\x05 \x01(\x08H\x00R\tboolValue\x12?\n\ndate_value\x18\x06 \x01(\x0b\x32\x1e.services.property_svc.v1.DateH\x00R\tdateValue\x12\x44\n\x0f\x64\x61te_time_value\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\rdateTimeValue\x12#\n\x0cselect_value\x18\x08 \x01(\tH\x00R\x0bselectValueB\x07\n\x05value\"I\n\x1b\x41ttachPropertyValueResponse\x12*\n\x11property_value_id\x18\x01 \x01(\tR\x0fpropertyValueId\"i\n\x13TaskPropertyMatcher\x12\x1c\n\x07ward_id\x18\x01 \x01(\tH\x00R\x06wardId\x88\x01\x01\x12\x1c\n\x07task_id\x18\x02 \x01(\tH\x01R\x06taskId\x88\x01\x01\x42\n\n\x08_ward_idB\n\n\x08_task_id\"u\n\x16PatientPropertyMatcher\x12\x1c\n\x07ward_id\x18\x01 \x01(\tH\x00R\x06wardId\x88\x01\x01\x12\"\n\npatient_id\x18\x02 \x01(\tH\x01R\tpatientId\x88\x01\x01\x42\n\n\x08_ward_idB\r\n\x0b_patient_id\"\xde\x01\n GetAttachedPropertyValuesRequest\x12R\n\x0ctask_matcher\x18\x01 \x01(\x0b\x32-.services.property_svc.v1.TaskPropertyMatcherH\x00R\x0btaskMatcher\x12[\n\x0fpatient_matcher\x18\x02 \x01(\x0b\x32\x30.services.property_svc.v1.PatientPropertyMatcherH\x00R\x0epatientMatcherB\t\n\x07matcher\"\xf5\x04\n!GetAttachedPropertyValuesResponse\x12Y\n\x06values\x18\x01 \x03(\x0b\x32\x41.services.property_svc.v1.GetAttachedPropertyValuesResponse.ValueR\x06values\x1a\xf4\x03\n\x05Value\x12\x1f\n\x0bproperty_id\x18\x01 \x01(\tR\npropertyId\x12\x42\n\nfield_type\x18\x02 \x01(\x0e\x32#.services.property_svc.v1.FieldTypeR\tfieldType\x12\x12\n\x04name\x18\x03 \x01(\tR\x04name\x12%\n\x0b\x64\x65scription\x18\x04 \x01(\tH\x01R\x0b\x64\x65scription\x88\x01\x01\x12\x1f\n\x0bis_archived\x18\x05 \x01(\x08R\nisArchived\x12\x1f\n\ntext_value\x18\x06 \x01(\tH\x00R\ttextValue\x12#\n\x0cnumber_value\x18\x07 \x01(\x01H\x00R\x0bnumberValue\x12\x1f\n\nbool_value\x18\x08 \x01(\x08H\x00R\tboolValue\x12?\n\ndate_value\x18\t \x01(\x0b\x32\x1e.services.property_svc.v1.DateH\x00R\tdateValue\x12\x44\n\x0f\x64\x61te_time_value\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\rdateTimeValue\x12#\n\x0cselect_value\x18\x0b \x01(\tH\x00R\x0bselectValueB\x07\n\x05valueB\x0e\n\x0c_description2\xb6\x02\n\x14PropertyValueService\x12\x84\x01\n\x13\x41ttachPropertyValue\x12\x34.services.property_svc.v1.AttachPropertyValueRequest\x1a\x35.services.property_svc.v1.AttachPropertyValueResponse\"\x00\x12\x96\x01\n\x19GetAttachedPropertyValues\x12:.services.property_svc.v1.GetAttachedPropertyValuesRequest\x1a;.services.property_svc.v1.GetAttachedPropertyValuesResponse\"\x00\x42\xd4\x01\n\x1c\x63om.services.property_svc.v1B\x15PropertyValueSvcProtoP\x01Z\x1fgen/proto/services/property-svc\xa2\x02\x03SPX\xaa\x02\x17Services.PropertySvc.V1\xca\x02\x17Services\\PropertySvc\\V1\xe2\x02#Services\\PropertySvc\\V1\\GPBMetadata\xea\x02\x19Services::PropertySvc::V1b\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -30,12 +30,14 @@ _globals['_ATTACHPROPERTYVALUERESPONSE']._serialized_end=602 _globals['_TASKPROPERTYMATCHER']._serialized_start=604 _globals['_TASKPROPERTYMATCHER']._serialized_end=709 - _globals['_GETATTACHEDPROPERTYVALUESREQUEST']._serialized_start=712 - _globals['_GETATTACHEDPROPERTYVALUESREQUEST']._serialized_end=841 - _globals['_GETATTACHEDPROPERTYVALUESRESPONSE']._serialized_start=844 - _globals['_GETATTACHEDPROPERTYVALUESRESPONSE']._serialized_end=1473 - _globals['_GETATTACHEDPROPERTYVALUESRESPONSE_VALUE']._serialized_start=973 - _globals['_GETATTACHEDPROPERTYVALUESRESPONSE_VALUE']._serialized_end=1473 - _globals['_PROPERTYVALUESERVICE']._serialized_start=1476 - _globals['_PROPERTYVALUESERVICE']._serialized_end=1786 + _globals['_PATIENTPROPERTYMATCHER']._serialized_start=711 + _globals['_PATIENTPROPERTYMATCHER']._serialized_end=828 + _globals['_GETATTACHEDPROPERTYVALUESREQUEST']._serialized_start=831 + _globals['_GETATTACHEDPROPERTYVALUESREQUEST']._serialized_end=1053 + _globals['_GETATTACHEDPROPERTYVALUESRESPONSE']._serialized_start=1056 + _globals['_GETATTACHEDPROPERTYVALUESRESPONSE']._serialized_end=1685 + _globals['_GETATTACHEDPROPERTYVALUESRESPONSE_VALUE']._serialized_start=1185 + _globals['_GETATTACHEDPROPERTYVALUESRESPONSE_VALUE']._serialized_end=1685 + _globals['_PROPERTYVALUESERVICE']._serialized_start=1688 + _globals['_PROPERTYVALUESERVICE']._serialized_end=1998 # @@protoc_insertion_point(module_scope) diff --git a/gen/python/services/property_svc/v1/property_views_svc_pb2.py b/gen/python/services/property_svc/v1/property_views_svc_pb2.py index a39afadea..80dbe3ab2 100644 --- a/gen/python/services/property_svc/v1/property_views_svc_pb2.py +++ b/gen/python/services/property_svc/v1/property_views_svc_pb2.py @@ -15,7 +15,7 @@ from services.property_svc.v1 import property_value_svc_pb2 as services_dot_property__svc_dot_v1_dot_property__value__svc__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n1services/property_svc/v1/property_views_svc.proto\x12\x18services.property_svc.v1\x1a\x31services/property_svc/v1/property_value_svc.proto\"\x8c\x02\n\x0c\x46ilterUpdate\x12\x37\n\x18\x61ppend_to_always_include\x18\x01 \x03(\tR\x15\x61ppendToAlwaysInclude\x12;\n\x1aremove_from_always_include\x18\x02 \x03(\tR\x17removeFromAlwaysInclude\x12@\n\x1d\x61ppend_to_dont_always_include\x18\x03 \x03(\tR\x19\x61ppendToDontAlwaysInclude\x12\x44\n\x1fremove_from_dont_always_include\x18\x04 \x03(\tR\x1bremoveFromDontAlwaysInclude\"\xcb\x01\n\x1dUpdatePropertyViewRuleRequest\x12K\n\rfilter_update\x18\x01 \x01(\x0b\x32&.services.property_svc.v1.FilterUpdateR\x0c\x66ilterUpdate\x12R\n\x0ctask_matcher\x18\x02 \x01(\x0b\x32-.services.property_svc.v1.TaskPropertyMatcherH\x00R\x0btaskMatcherB\t\n\x07matcher\" \n\x1eUpdatePropertyViewRuleResponse2\xa6\x01\n\x14PropertyViewsService\x12\x8d\x01\n\x16UpdatePropertyViewRule\x12\x37.services.property_svc.v1.UpdatePropertyViewRuleRequest\x1a\x38.services.property_svc.v1.UpdatePropertyViewRuleResponse\"\x00\x42\xd4\x01\n\x1c\x63om.services.property_svc.v1B\x15PropertyViewsSvcProtoP\x01Z\x1fgen/proto/services/property-svc\xa2\x02\x03SPX\xaa\x02\x17Services.PropertySvc.V1\xca\x02\x17Services\\PropertySvc\\V1\xe2\x02#Services\\PropertySvc\\V1\\GPBMetadata\xea\x02\x19Services::PropertySvc::V1b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n1services/property_svc/v1/property_views_svc.proto\x12\x18services.property_svc.v1\x1a\x31services/property_svc/v1/property_value_svc.proto\"\x8c\x02\n\x0c\x46ilterUpdate\x12\x37\n\x18\x61ppend_to_always_include\x18\x01 \x03(\tR\x15\x61ppendToAlwaysInclude\x12;\n\x1aremove_from_always_include\x18\x02 \x03(\tR\x17removeFromAlwaysInclude\x12@\n\x1d\x61ppend_to_dont_always_include\x18\x03 \x03(\tR\x19\x61ppendToDontAlwaysInclude\x12\x44\n\x1fremove_from_dont_always_include\x18\x04 \x03(\tR\x1bremoveFromDontAlwaysInclude\"\xa8\x02\n\x1dUpdatePropertyViewRuleRequest\x12K\n\rfilter_update\x18\x01 \x01(\x0b\x32&.services.property_svc.v1.FilterUpdateR\x0c\x66ilterUpdate\x12R\n\x0ctask_matcher\x18\x02 \x01(\x0b\x32-.services.property_svc.v1.TaskPropertyMatcherH\x00R\x0btaskMatcher\x12[\n\x0fpatient_matcher\x18\x03 \x01(\x0b\x32\x30.services.property_svc.v1.PatientPropertyMatcherH\x00R\x0epatientMatcherB\t\n\x07matcher\" \n\x1eUpdatePropertyViewRuleResponse2\xa6\x01\n\x14PropertyViewsService\x12\x8d\x01\n\x16UpdatePropertyViewRule\x12\x37.services.property_svc.v1.UpdatePropertyViewRuleRequest\x1a\x38.services.property_svc.v1.UpdatePropertyViewRuleResponse\"\x00\x42\xd4\x01\n\x1c\x63om.services.property_svc.v1B\x15PropertyViewsSvcProtoP\x01Z\x1fgen/proto/services/property-svc\xa2\x02\x03SPX\xaa\x02\x17Services.PropertySvc.V1\xca\x02\x17Services\\PropertySvc\\V1\xe2\x02#Services\\PropertySvc\\V1\\GPBMetadata\xea\x02\x19Services::PropertySvc::V1b\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -26,9 +26,9 @@ _globals['_FILTERUPDATE']._serialized_start=131 _globals['_FILTERUPDATE']._serialized_end=399 _globals['_UPDATEPROPERTYVIEWRULEREQUEST']._serialized_start=402 - _globals['_UPDATEPROPERTYVIEWRULEREQUEST']._serialized_end=605 - _globals['_UPDATEPROPERTYVIEWRULERESPONSE']._serialized_start=607 - _globals['_UPDATEPROPERTYVIEWRULERESPONSE']._serialized_end=639 - _globals['_PROPERTYVIEWSSERVICE']._serialized_start=642 - _globals['_PROPERTYVIEWSSERVICE']._serialized_end=808 + _globals['_UPDATEPROPERTYVIEWRULEREQUEST']._serialized_end=698 + _globals['_UPDATEPROPERTYVIEWRULERESPONSE']._serialized_start=700 + _globals['_UPDATEPROPERTYVIEWRULERESPONSE']._serialized_end=732 + _globals['_PROPERTYVIEWSSERVICE']._serialized_start=735 + _globals['_PROPERTYVIEWSSERVICE']._serialized_end=901 # @@protoc_insertion_point(module_scope) diff --git a/gen/ts/services/property_svc/v1/property_value_svc_pb.d.ts b/gen/ts/services/property_svc/v1/property_value_svc_pb.d.ts index c1db90b20..d6adf1159 100644 --- a/gen/ts/services/property_svc/v1/property_value_svc_pb.d.ts +++ b/gen/ts/services/property_svc/v1/property_value_svc_pb.d.ts @@ -120,12 +120,53 @@ export namespace TaskPropertyMatcher { } } +export class PatientPropertyMatcher extends jspb.Message { + getWardId(): string; + setWardId(value: string): PatientPropertyMatcher; + hasWardId(): boolean; + clearWardId(): PatientPropertyMatcher; + + getPatientId(): string; + setPatientId(value: string): PatientPropertyMatcher; + hasPatientId(): boolean; + clearPatientId(): PatientPropertyMatcher; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): PatientPropertyMatcher.AsObject; + static toObject(includeInstance: boolean, msg: PatientPropertyMatcher): PatientPropertyMatcher.AsObject; + static serializeBinaryToWriter(message: PatientPropertyMatcher, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): PatientPropertyMatcher; + static deserializeBinaryFromReader(message: PatientPropertyMatcher, reader: jspb.BinaryReader): PatientPropertyMatcher; +} + +export namespace PatientPropertyMatcher { + export type AsObject = { + wardId?: string, + patientId?: string, + } + + export enum WardIdCase { + _WARD_ID_NOT_SET = 0, + WARD_ID = 1, + } + + export enum PatientIdCase { + _PATIENT_ID_NOT_SET = 0, + PATIENT_ID = 2, + } +} + export class GetAttachedPropertyValuesRequest extends jspb.Message { getTaskMatcher(): TaskPropertyMatcher | undefined; setTaskMatcher(value?: TaskPropertyMatcher): GetAttachedPropertyValuesRequest; hasTaskMatcher(): boolean; clearTaskMatcher(): GetAttachedPropertyValuesRequest; + getPatientMatcher(): PatientPropertyMatcher | undefined; + setPatientMatcher(value?: PatientPropertyMatcher): GetAttachedPropertyValuesRequest; + hasPatientMatcher(): boolean; + clearPatientMatcher(): GetAttachedPropertyValuesRequest; + getMatcherCase(): GetAttachedPropertyValuesRequest.MatcherCase; serializeBinary(): Uint8Array; @@ -139,11 +180,13 @@ export class GetAttachedPropertyValuesRequest extends jspb.Message { export namespace GetAttachedPropertyValuesRequest { export type AsObject = { taskMatcher?: TaskPropertyMatcher.AsObject, + patientMatcher?: PatientPropertyMatcher.AsObject, } export enum MatcherCase { MATCHER_NOT_SET = 0, TASK_MATCHER = 1, + PATIENT_MATCHER = 2, } } diff --git a/gen/ts/services/property_svc/v1/property_value_svc_pb.js b/gen/ts/services/property_svc/v1/property_value_svc_pb.js index c983da182..9da9274c8 100644 --- a/gen/ts/services/property_svc/v1/property_value_svc_pb.js +++ b/gen/ts/services/property_svc/v1/property_value_svc_pb.js @@ -33,6 +33,7 @@ goog.exportSymbol('proto.services.property_svc.v1.GetAttachedPropertyValuesReque goog.exportSymbol('proto.services.property_svc.v1.GetAttachedPropertyValuesResponse', null, global); goog.exportSymbol('proto.services.property_svc.v1.GetAttachedPropertyValuesResponse.Value', null, global); goog.exportSymbol('proto.services.property_svc.v1.GetAttachedPropertyValuesResponse.Value.ValueCase', null, global); +goog.exportSymbol('proto.services.property_svc.v1.PatientPropertyMatcher', null, global); goog.exportSymbol('proto.services.property_svc.v1.TaskPropertyMatcher', null, global); /** * Generated by JsPbCodeGenerator. @@ -97,6 +98,27 @@ if (goog.DEBUG && !COMPILED) { */ proto.services.property_svc.v1.TaskPropertyMatcher.displayName = 'proto.services.property_svc.v1.TaskPropertyMatcher'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.services.property_svc.v1.PatientPropertyMatcher = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.services.property_svc.v1.PatientPropertyMatcher, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.services.property_svc.v1.PatientPropertyMatcher.displayName = 'proto.services.property_svc.v1.PatientPropertyMatcher'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -971,6 +993,202 @@ proto.services.property_svc.v1.TaskPropertyMatcher.prototype.hasTaskId = functio + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.services.property_svc.v1.PatientPropertyMatcher.prototype.toObject = function(opt_includeInstance) { + return proto.services.property_svc.v1.PatientPropertyMatcher.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.services.property_svc.v1.PatientPropertyMatcher} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.services.property_svc.v1.PatientPropertyMatcher.toObject = function(includeInstance, msg) { + var f, obj = { + wardId: jspb.Message.getFieldWithDefault(msg, 1, ""), + patientId: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.services.property_svc.v1.PatientPropertyMatcher} + */ +proto.services.property_svc.v1.PatientPropertyMatcher.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.services.property_svc.v1.PatientPropertyMatcher; + return proto.services.property_svc.v1.PatientPropertyMatcher.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.services.property_svc.v1.PatientPropertyMatcher} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.services.property_svc.v1.PatientPropertyMatcher} + */ +proto.services.property_svc.v1.PatientPropertyMatcher.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setWardId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setPatientId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.services.property_svc.v1.PatientPropertyMatcher.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.services.property_svc.v1.PatientPropertyMatcher.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.services.property_svc.v1.PatientPropertyMatcher} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.services.property_svc.v1.PatientPropertyMatcher.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string ward_id = 1; + * @return {string} + */ +proto.services.property_svc.v1.PatientPropertyMatcher.prototype.getWardId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.services.property_svc.v1.PatientPropertyMatcher} returns this + */ +proto.services.property_svc.v1.PatientPropertyMatcher.prototype.setWardId = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.services.property_svc.v1.PatientPropertyMatcher} returns this + */ +proto.services.property_svc.v1.PatientPropertyMatcher.prototype.clearWardId = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.services.property_svc.v1.PatientPropertyMatcher.prototype.hasWardId = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional string patient_id = 2; + * @return {string} + */ +proto.services.property_svc.v1.PatientPropertyMatcher.prototype.getPatientId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.services.property_svc.v1.PatientPropertyMatcher} returns this + */ +proto.services.property_svc.v1.PatientPropertyMatcher.prototype.setPatientId = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.services.property_svc.v1.PatientPropertyMatcher} returns this + */ +proto.services.property_svc.v1.PatientPropertyMatcher.prototype.clearPatientId = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.services.property_svc.v1.PatientPropertyMatcher.prototype.hasPatientId = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all @@ -979,14 +1197,15 @@ proto.services.property_svc.v1.TaskPropertyMatcher.prototype.hasTaskId = functio * @private {!Array>} * @const */ -proto.services.property_svc.v1.GetAttachedPropertyValuesRequest.oneofGroups_ = [[1]]; +proto.services.property_svc.v1.GetAttachedPropertyValuesRequest.oneofGroups_ = [[1,2]]; /** * @enum {number} */ proto.services.property_svc.v1.GetAttachedPropertyValuesRequest.MatcherCase = { MATCHER_NOT_SET: 0, - TASK_MATCHER: 1 + TASK_MATCHER: 1, + PATIENT_MATCHER: 2 }; /** @@ -1027,7 +1246,8 @@ proto.services.property_svc.v1.GetAttachedPropertyValuesRequest.prototype.toObje */ proto.services.property_svc.v1.GetAttachedPropertyValuesRequest.toObject = function(includeInstance, msg) { var f, obj = { - taskMatcher: (f = msg.getTaskMatcher()) && proto.services.property_svc.v1.TaskPropertyMatcher.toObject(includeInstance, f) + taskMatcher: (f = msg.getTaskMatcher()) && proto.services.property_svc.v1.TaskPropertyMatcher.toObject(includeInstance, f), + patientMatcher: (f = msg.getPatientMatcher()) && proto.services.property_svc.v1.PatientPropertyMatcher.toObject(includeInstance, f) }; if (includeInstance) { @@ -1069,6 +1289,11 @@ proto.services.property_svc.v1.GetAttachedPropertyValuesRequest.deserializeBinar reader.readMessage(value,proto.services.property_svc.v1.TaskPropertyMatcher.deserializeBinaryFromReader); msg.setTaskMatcher(value); break; + case 2: + var value = new proto.services.property_svc.v1.PatientPropertyMatcher; + reader.readMessage(value,proto.services.property_svc.v1.PatientPropertyMatcher.deserializeBinaryFromReader); + msg.setPatientMatcher(value); + break; default: reader.skipField(); break; @@ -1106,6 +1331,14 @@ proto.services.property_svc.v1.GetAttachedPropertyValuesRequest.serializeBinaryT proto.services.property_svc.v1.TaskPropertyMatcher.serializeBinaryToWriter ); } + f = message.getPatientMatcher(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.services.property_svc.v1.PatientPropertyMatcher.serializeBinaryToWriter + ); + } }; @@ -1146,6 +1379,43 @@ proto.services.property_svc.v1.GetAttachedPropertyValuesRequest.prototype.hasTas }; +/** + * optional PatientPropertyMatcher patient_matcher = 2; + * @return {?proto.services.property_svc.v1.PatientPropertyMatcher} + */ +proto.services.property_svc.v1.GetAttachedPropertyValuesRequest.prototype.getPatientMatcher = function() { + return /** @type{?proto.services.property_svc.v1.PatientPropertyMatcher} */ ( + jspb.Message.getWrapperField(this, proto.services.property_svc.v1.PatientPropertyMatcher, 2)); +}; + + +/** + * @param {?proto.services.property_svc.v1.PatientPropertyMatcher|undefined} value + * @return {!proto.services.property_svc.v1.GetAttachedPropertyValuesRequest} returns this +*/ +proto.services.property_svc.v1.GetAttachedPropertyValuesRequest.prototype.setPatientMatcher = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.services.property_svc.v1.GetAttachedPropertyValuesRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.services.property_svc.v1.GetAttachedPropertyValuesRequest} returns this + */ +proto.services.property_svc.v1.GetAttachedPropertyValuesRequest.prototype.clearPatientMatcher = function() { + return this.setPatientMatcher(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.services.property_svc.v1.GetAttachedPropertyValuesRequest.prototype.hasPatientMatcher = function() { + return jspb.Message.getField(this, 2) != null; +}; + + /** * List of repeated fields within this message type. diff --git a/gen/ts/services/property_svc/v1/property_views_svc_pb.d.ts b/gen/ts/services/property_svc/v1/property_views_svc_pb.d.ts index a6a45cd3f..81f56b193 100644 --- a/gen/ts/services/property_svc/v1/property_views_svc_pb.d.ts +++ b/gen/ts/services/property_svc/v1/property_views_svc_pb.d.ts @@ -52,6 +52,11 @@ export class UpdatePropertyViewRuleRequest extends jspb.Message { hasTaskMatcher(): boolean; clearTaskMatcher(): UpdatePropertyViewRuleRequest; + getPatientMatcher(): services_property_svc_v1_property_value_svc_pb.PatientPropertyMatcher | undefined; + setPatientMatcher(value?: services_property_svc_v1_property_value_svc_pb.PatientPropertyMatcher): UpdatePropertyViewRuleRequest; + hasPatientMatcher(): boolean; + clearPatientMatcher(): UpdatePropertyViewRuleRequest; + getMatcherCase(): UpdatePropertyViewRuleRequest.MatcherCase; serializeBinary(): Uint8Array; @@ -66,11 +71,13 @@ export namespace UpdatePropertyViewRuleRequest { export type AsObject = { filterUpdate?: FilterUpdate.AsObject, taskMatcher?: services_property_svc_v1_property_value_svc_pb.TaskPropertyMatcher.AsObject, + patientMatcher?: services_property_svc_v1_property_value_svc_pb.PatientPropertyMatcher.AsObject, } export enum MatcherCase { MATCHER_NOT_SET = 0, TASK_MATCHER = 2, + PATIENT_MATCHER = 3, } } diff --git a/gen/ts/services/property_svc/v1/property_views_svc_pb.js b/gen/ts/services/property_svc/v1/property_views_svc_pb.js index f9b301093..85a63b621 100644 --- a/gen/ts/services/property_svc/v1/property_views_svc_pb.js +++ b/gen/ts/services/property_svc/v1/property_views_svc_pb.js @@ -402,14 +402,15 @@ proto.services.property_svc.v1.FilterUpdate.prototype.clearRemoveFromDontAlwaysI * @private {!Array>} * @const */ -proto.services.property_svc.v1.UpdatePropertyViewRuleRequest.oneofGroups_ = [[2]]; +proto.services.property_svc.v1.UpdatePropertyViewRuleRequest.oneofGroups_ = [[2,3]]; /** * @enum {number} */ proto.services.property_svc.v1.UpdatePropertyViewRuleRequest.MatcherCase = { MATCHER_NOT_SET: 0, - TASK_MATCHER: 2 + TASK_MATCHER: 2, + PATIENT_MATCHER: 3 }; /** @@ -451,7 +452,8 @@ proto.services.property_svc.v1.UpdatePropertyViewRuleRequest.prototype.toObject proto.services.property_svc.v1.UpdatePropertyViewRuleRequest.toObject = function(includeInstance, msg) { var f, obj = { filterUpdate: (f = msg.getFilterUpdate()) && proto.services.property_svc.v1.FilterUpdate.toObject(includeInstance, f), - taskMatcher: (f = msg.getTaskMatcher()) && services_property_svc_v1_property_value_svc_pb.TaskPropertyMatcher.toObject(includeInstance, f) + taskMatcher: (f = msg.getTaskMatcher()) && services_property_svc_v1_property_value_svc_pb.TaskPropertyMatcher.toObject(includeInstance, f), + patientMatcher: (f = msg.getPatientMatcher()) && services_property_svc_v1_property_value_svc_pb.PatientPropertyMatcher.toObject(includeInstance, f) }; if (includeInstance) { @@ -498,6 +500,11 @@ proto.services.property_svc.v1.UpdatePropertyViewRuleRequest.deserializeBinaryFr reader.readMessage(value,services_property_svc_v1_property_value_svc_pb.TaskPropertyMatcher.deserializeBinaryFromReader); msg.setTaskMatcher(value); break; + case 3: + var value = new services_property_svc_v1_property_value_svc_pb.PatientPropertyMatcher; + reader.readMessage(value,services_property_svc_v1_property_value_svc_pb.PatientPropertyMatcher.deserializeBinaryFromReader); + msg.setPatientMatcher(value); + break; default: reader.skipField(); break; @@ -543,6 +550,14 @@ proto.services.property_svc.v1.UpdatePropertyViewRuleRequest.serializeBinaryToWr services_property_svc_v1_property_value_svc_pb.TaskPropertyMatcher.serializeBinaryToWriter ); } + f = message.getPatientMatcher(); + if (f != null) { + writer.writeMessage( + 3, + f, + services_property_svc_v1_property_value_svc_pb.PatientPropertyMatcher.serializeBinaryToWriter + ); + } }; @@ -620,6 +635,43 @@ proto.services.property_svc.v1.UpdatePropertyViewRuleRequest.prototype.hasTaskMa }; +/** + * optional PatientPropertyMatcher patient_matcher = 3; + * @return {?proto.services.property_svc.v1.PatientPropertyMatcher} + */ +proto.services.property_svc.v1.UpdatePropertyViewRuleRequest.prototype.getPatientMatcher = function() { + return /** @type{?proto.services.property_svc.v1.PatientPropertyMatcher} */ ( + jspb.Message.getWrapperField(this, services_property_svc_v1_property_value_svc_pb.PatientPropertyMatcher, 3)); +}; + + +/** + * @param {?proto.services.property_svc.v1.PatientPropertyMatcher|undefined} value + * @return {!proto.services.property_svc.v1.UpdatePropertyViewRuleRequest} returns this +*/ +proto.services.property_svc.v1.UpdatePropertyViewRuleRequest.prototype.setPatientMatcher = function(value) { + return jspb.Message.setOneofWrapperField(this, 3, proto.services.property_svc.v1.UpdatePropertyViewRuleRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.services.property_svc.v1.UpdatePropertyViewRuleRequest} returns this + */ +proto.services.property_svc.v1.UpdatePropertyViewRuleRequest.prototype.clearPatientMatcher = function() { + return this.setPatientMatcher(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.services.property_svc.v1.UpdatePropertyViewRuleRequest.prototype.hasPatientMatcher = function() { + return jspb.Message.getField(this, 3) != null; +}; + + diff --git a/proto/services/property_svc/v1/property_value_svc.proto b/proto/services/property_svc/v1/property_value_svc.proto index 274a333cc..b234d301e 100644 --- a/proto/services/property_svc/v1/property_value_svc.proto +++ b/proto/services/property_svc/v1/property_value_svc.proto @@ -37,9 +37,15 @@ message TaskPropertyMatcher { optional string task_id = 2; // @gotags: validate:"omitempty,omitnil,uuid4" } +message PatientPropertyMatcher { + optional string ward_id = 1; // @gotags: validate:"omitempty,omitnil,uuid4" + optional string patient_id = 2; // @gotags: validate:"omitempty,omitnil,uuid4" +} + message GetAttachedPropertyValuesRequest { oneof matcher { TaskPropertyMatcher task_matcher = 1; + PatientPropertyMatcher patient_matcher = 2; } } diff --git a/proto/services/property_svc/v1/property_views_svc.proto b/proto/services/property_svc/v1/property_views_svc.proto index e3f592a04..d1436e5ed 100644 --- a/proto/services/property_svc/v1/property_views_svc.proto +++ b/proto/services/property_svc/v1/property_views_svc.proto @@ -27,6 +27,7 @@ message UpdatePropertyViewRuleRequest { oneof matcher { TaskPropertyMatcher task_matcher = 2; + PatientPropertyMatcher patient_matcher = 3; } } diff --git a/services/impulse_svc/gen/services/property_svc/v1/property_value_svc_pb2.py b/services/impulse_svc/gen/services/property_svc/v1/property_value_svc_pb2.py index 5420d93ea..49b1d7f8e 100644 --- a/services/impulse_svc/gen/services/property_svc/v1/property_value_svc_pb2.py +++ b/services/impulse_svc/gen/services/property_svc/v1/property_value_svc_pb2.py @@ -16,7 +16,7 @@ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n1services/property_svc/v1/property_value_svc.proto\x12\x18services.property_svc.v1\x1a$services/property_svc/v1/types.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf8\x02\n\x1a\x41ttachPropertyValueRequest\x12\x1d\n\nsubject_id\x18\x01 \x01(\tR\tsubjectId\x12\x1f\n\x0bproperty_id\x18\x02 \x01(\tR\npropertyId\x12\x1f\n\ntext_value\x18\x03 \x01(\tH\x00R\ttextValue\x12#\n\x0cnumber_value\x18\x04 \x01(\x01H\x00R\x0bnumberValue\x12\x1f\n\nbool_value\x18\x05 \x01(\x08H\x00R\tboolValue\x12?\n\ndate_value\x18\x06 \x01(\x0b\x32\x1e.services.property_svc.v1.DateH\x00R\tdateValue\x12\x44\n\x0f\x64\x61te_time_value\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\rdateTimeValue\x12#\n\x0cselect_value\x18\x08 \x01(\tH\x00R\x0bselectValueB\x07\n\x05value\"I\n\x1b\x41ttachPropertyValueResponse\x12*\n\x11property_value_id\x18\x01 \x01(\tR\x0fpropertyValueId\"i\n\x13TaskPropertyMatcher\x12\x1c\n\x07ward_id\x18\x01 \x01(\tH\x00R\x06wardId\x88\x01\x01\x12\x1c\n\x07task_id\x18\x02 \x01(\tH\x01R\x06taskId\x88\x01\x01\x42\n\n\x08_ward_idB\n\n\x08_task_id\"\x81\x01\n GetAttachedPropertyValuesRequest\x12R\n\x0ctask_matcher\x18\x01 \x01(\x0b\x32-.services.property_svc.v1.TaskPropertyMatcherH\x00R\x0btaskMatcherB\t\n\x07matcher\"\xf5\x04\n!GetAttachedPropertyValuesResponse\x12Y\n\x06values\x18\x01 \x03(\x0b\x32\x41.services.property_svc.v1.GetAttachedPropertyValuesResponse.ValueR\x06values\x1a\xf4\x03\n\x05Value\x12\x1f\n\x0bproperty_id\x18\x01 \x01(\tR\npropertyId\x12\x42\n\nfield_type\x18\x02 \x01(\x0e\x32#.services.property_svc.v1.FieldTypeR\tfieldType\x12\x12\n\x04name\x18\x03 \x01(\tR\x04name\x12%\n\x0b\x64\x65scription\x18\x04 \x01(\tH\x01R\x0b\x64\x65scription\x88\x01\x01\x12\x1f\n\x0bis_archived\x18\x05 \x01(\x08R\nisArchived\x12\x1f\n\ntext_value\x18\x06 \x01(\tH\x00R\ttextValue\x12#\n\x0cnumber_value\x18\x07 \x01(\x01H\x00R\x0bnumberValue\x12\x1f\n\nbool_value\x18\x08 \x01(\x08H\x00R\tboolValue\x12?\n\ndate_value\x18\t \x01(\x0b\x32\x1e.services.property_svc.v1.DateH\x00R\tdateValue\x12\x44\n\x0f\x64\x61te_time_value\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\rdateTimeValue\x12#\n\x0cselect_value\x18\x0b \x01(\tH\x00R\x0bselectValueB\x07\n\x05valueB\x0e\n\x0c_description2\xb6\x02\n\x14PropertyValueService\x12\x84\x01\n\x13\x41ttachPropertyValue\x12\x34.services.property_svc.v1.AttachPropertyValueRequest\x1a\x35.services.property_svc.v1.AttachPropertyValueResponse\"\x00\x12\x96\x01\n\x19GetAttachedPropertyValues\x12:.services.property_svc.v1.GetAttachedPropertyValuesRequest\x1a;.services.property_svc.v1.GetAttachedPropertyValuesResponse\"\x00\x42\xd4\x01\n\x1c\x63om.services.property_svc.v1B\x15PropertyValueSvcProtoP\x01Z\x1fgen/proto/services/property-svc\xa2\x02\x03SPX\xaa\x02\x17Services.PropertySvc.V1\xca\x02\x17Services\\PropertySvc\\V1\xe2\x02#Services\\PropertySvc\\V1\\GPBMetadata\xea\x02\x19Services::PropertySvc::V1b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n1services/property_svc/v1/property_value_svc.proto\x12\x18services.property_svc.v1\x1a$services/property_svc/v1/types.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf8\x02\n\x1a\x41ttachPropertyValueRequest\x12\x1d\n\nsubject_id\x18\x01 \x01(\tR\tsubjectId\x12\x1f\n\x0bproperty_id\x18\x02 \x01(\tR\npropertyId\x12\x1f\n\ntext_value\x18\x03 \x01(\tH\x00R\ttextValue\x12#\n\x0cnumber_value\x18\x04 \x01(\x01H\x00R\x0bnumberValue\x12\x1f\n\nbool_value\x18\x05 \x01(\x08H\x00R\tboolValue\x12?\n\ndate_value\x18\x06 \x01(\x0b\x32\x1e.services.property_svc.v1.DateH\x00R\tdateValue\x12\x44\n\x0f\x64\x61te_time_value\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\rdateTimeValue\x12#\n\x0cselect_value\x18\x08 \x01(\tH\x00R\x0bselectValueB\x07\n\x05value\"I\n\x1b\x41ttachPropertyValueResponse\x12*\n\x11property_value_id\x18\x01 \x01(\tR\x0fpropertyValueId\"i\n\x13TaskPropertyMatcher\x12\x1c\n\x07ward_id\x18\x01 \x01(\tH\x00R\x06wardId\x88\x01\x01\x12\x1c\n\x07task_id\x18\x02 \x01(\tH\x01R\x06taskId\x88\x01\x01\x42\n\n\x08_ward_idB\n\n\x08_task_id\"u\n\x16PatientPropertyMatcher\x12\x1c\n\x07ward_id\x18\x01 \x01(\tH\x00R\x06wardId\x88\x01\x01\x12\"\n\npatient_id\x18\x02 \x01(\tH\x01R\tpatientId\x88\x01\x01\x42\n\n\x08_ward_idB\r\n\x0b_patient_id\"\xde\x01\n GetAttachedPropertyValuesRequest\x12R\n\x0ctask_matcher\x18\x01 \x01(\x0b\x32-.services.property_svc.v1.TaskPropertyMatcherH\x00R\x0btaskMatcher\x12[\n\x0fpatient_matcher\x18\x02 \x01(\x0b\x32\x30.services.property_svc.v1.PatientPropertyMatcherH\x00R\x0epatientMatcherB\t\n\x07matcher\"\xf5\x04\n!GetAttachedPropertyValuesResponse\x12Y\n\x06values\x18\x01 \x03(\x0b\x32\x41.services.property_svc.v1.GetAttachedPropertyValuesResponse.ValueR\x06values\x1a\xf4\x03\n\x05Value\x12\x1f\n\x0bproperty_id\x18\x01 \x01(\tR\npropertyId\x12\x42\n\nfield_type\x18\x02 \x01(\x0e\x32#.services.property_svc.v1.FieldTypeR\tfieldType\x12\x12\n\x04name\x18\x03 \x01(\tR\x04name\x12%\n\x0b\x64\x65scription\x18\x04 \x01(\tH\x01R\x0b\x64\x65scription\x88\x01\x01\x12\x1f\n\x0bis_archived\x18\x05 \x01(\x08R\nisArchived\x12\x1f\n\ntext_value\x18\x06 \x01(\tH\x00R\ttextValue\x12#\n\x0cnumber_value\x18\x07 \x01(\x01H\x00R\x0bnumberValue\x12\x1f\n\nbool_value\x18\x08 \x01(\x08H\x00R\tboolValue\x12?\n\ndate_value\x18\t \x01(\x0b\x32\x1e.services.property_svc.v1.DateH\x00R\tdateValue\x12\x44\n\x0f\x64\x61te_time_value\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\rdateTimeValue\x12#\n\x0cselect_value\x18\x0b \x01(\tH\x00R\x0bselectValueB\x07\n\x05valueB\x0e\n\x0c_description2\xb6\x02\n\x14PropertyValueService\x12\x84\x01\n\x13\x41ttachPropertyValue\x12\x34.services.property_svc.v1.AttachPropertyValueRequest\x1a\x35.services.property_svc.v1.AttachPropertyValueResponse\"\x00\x12\x96\x01\n\x19GetAttachedPropertyValues\x12:.services.property_svc.v1.GetAttachedPropertyValuesRequest\x1a;.services.property_svc.v1.GetAttachedPropertyValuesResponse\"\x00\x42\xd4\x01\n\x1c\x63om.services.property_svc.v1B\x15PropertyValueSvcProtoP\x01Z\x1fgen/proto/services/property-svc\xa2\x02\x03SPX\xaa\x02\x17Services.PropertySvc.V1\xca\x02\x17Services\\PropertySvc\\V1\xe2\x02#Services\\PropertySvc\\V1\\GPBMetadata\xea\x02\x19Services::PropertySvc::V1b\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -30,12 +30,14 @@ _globals['_ATTACHPROPERTYVALUERESPONSE']._serialized_end=602 _globals['_TASKPROPERTYMATCHER']._serialized_start=604 _globals['_TASKPROPERTYMATCHER']._serialized_end=709 - _globals['_GETATTACHEDPROPERTYVALUESREQUEST']._serialized_start=712 - _globals['_GETATTACHEDPROPERTYVALUESREQUEST']._serialized_end=841 - _globals['_GETATTACHEDPROPERTYVALUESRESPONSE']._serialized_start=844 - _globals['_GETATTACHEDPROPERTYVALUESRESPONSE']._serialized_end=1473 - _globals['_GETATTACHEDPROPERTYVALUESRESPONSE_VALUE']._serialized_start=973 - _globals['_GETATTACHEDPROPERTYVALUESRESPONSE_VALUE']._serialized_end=1473 - _globals['_PROPERTYVALUESERVICE']._serialized_start=1476 - _globals['_PROPERTYVALUESERVICE']._serialized_end=1786 + _globals['_PATIENTPROPERTYMATCHER']._serialized_start=711 + _globals['_PATIENTPROPERTYMATCHER']._serialized_end=828 + _globals['_GETATTACHEDPROPERTYVALUESREQUEST']._serialized_start=831 + _globals['_GETATTACHEDPROPERTYVALUESREQUEST']._serialized_end=1053 + _globals['_GETATTACHEDPROPERTYVALUESRESPONSE']._serialized_start=1056 + _globals['_GETATTACHEDPROPERTYVALUESRESPONSE']._serialized_end=1685 + _globals['_GETATTACHEDPROPERTYVALUESRESPONSE_VALUE']._serialized_start=1185 + _globals['_GETATTACHEDPROPERTYVALUESRESPONSE_VALUE']._serialized_end=1685 + _globals['_PROPERTYVALUESERVICE']._serialized_start=1688 + _globals['_PROPERTYVALUESERVICE']._serialized_end=1998 # @@protoc_insertion_point(module_scope) diff --git a/services/impulse_svc/gen/services/property_svc/v1/property_views_svc_pb2.py b/services/impulse_svc/gen/services/property_svc/v1/property_views_svc_pb2.py index a39afadea..80dbe3ab2 100644 --- a/services/impulse_svc/gen/services/property_svc/v1/property_views_svc_pb2.py +++ b/services/impulse_svc/gen/services/property_svc/v1/property_views_svc_pb2.py @@ -15,7 +15,7 @@ from services.property_svc.v1 import property_value_svc_pb2 as services_dot_property__svc_dot_v1_dot_property__value__svc__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n1services/property_svc/v1/property_views_svc.proto\x12\x18services.property_svc.v1\x1a\x31services/property_svc/v1/property_value_svc.proto\"\x8c\x02\n\x0c\x46ilterUpdate\x12\x37\n\x18\x61ppend_to_always_include\x18\x01 \x03(\tR\x15\x61ppendToAlwaysInclude\x12;\n\x1aremove_from_always_include\x18\x02 \x03(\tR\x17removeFromAlwaysInclude\x12@\n\x1d\x61ppend_to_dont_always_include\x18\x03 \x03(\tR\x19\x61ppendToDontAlwaysInclude\x12\x44\n\x1fremove_from_dont_always_include\x18\x04 \x03(\tR\x1bremoveFromDontAlwaysInclude\"\xcb\x01\n\x1dUpdatePropertyViewRuleRequest\x12K\n\rfilter_update\x18\x01 \x01(\x0b\x32&.services.property_svc.v1.FilterUpdateR\x0c\x66ilterUpdate\x12R\n\x0ctask_matcher\x18\x02 \x01(\x0b\x32-.services.property_svc.v1.TaskPropertyMatcherH\x00R\x0btaskMatcherB\t\n\x07matcher\" \n\x1eUpdatePropertyViewRuleResponse2\xa6\x01\n\x14PropertyViewsService\x12\x8d\x01\n\x16UpdatePropertyViewRule\x12\x37.services.property_svc.v1.UpdatePropertyViewRuleRequest\x1a\x38.services.property_svc.v1.UpdatePropertyViewRuleResponse\"\x00\x42\xd4\x01\n\x1c\x63om.services.property_svc.v1B\x15PropertyViewsSvcProtoP\x01Z\x1fgen/proto/services/property-svc\xa2\x02\x03SPX\xaa\x02\x17Services.PropertySvc.V1\xca\x02\x17Services\\PropertySvc\\V1\xe2\x02#Services\\PropertySvc\\V1\\GPBMetadata\xea\x02\x19Services::PropertySvc::V1b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n1services/property_svc/v1/property_views_svc.proto\x12\x18services.property_svc.v1\x1a\x31services/property_svc/v1/property_value_svc.proto\"\x8c\x02\n\x0c\x46ilterUpdate\x12\x37\n\x18\x61ppend_to_always_include\x18\x01 \x03(\tR\x15\x61ppendToAlwaysInclude\x12;\n\x1aremove_from_always_include\x18\x02 \x03(\tR\x17removeFromAlwaysInclude\x12@\n\x1d\x61ppend_to_dont_always_include\x18\x03 \x03(\tR\x19\x61ppendToDontAlwaysInclude\x12\x44\n\x1fremove_from_dont_always_include\x18\x04 \x03(\tR\x1bremoveFromDontAlwaysInclude\"\xa8\x02\n\x1dUpdatePropertyViewRuleRequest\x12K\n\rfilter_update\x18\x01 \x01(\x0b\x32&.services.property_svc.v1.FilterUpdateR\x0c\x66ilterUpdate\x12R\n\x0ctask_matcher\x18\x02 \x01(\x0b\x32-.services.property_svc.v1.TaskPropertyMatcherH\x00R\x0btaskMatcher\x12[\n\x0fpatient_matcher\x18\x03 \x01(\x0b\x32\x30.services.property_svc.v1.PatientPropertyMatcherH\x00R\x0epatientMatcherB\t\n\x07matcher\" \n\x1eUpdatePropertyViewRuleResponse2\xa6\x01\n\x14PropertyViewsService\x12\x8d\x01\n\x16UpdatePropertyViewRule\x12\x37.services.property_svc.v1.UpdatePropertyViewRuleRequest\x1a\x38.services.property_svc.v1.UpdatePropertyViewRuleResponse\"\x00\x42\xd4\x01\n\x1c\x63om.services.property_svc.v1B\x15PropertyViewsSvcProtoP\x01Z\x1fgen/proto/services/property-svc\xa2\x02\x03SPX\xaa\x02\x17Services.PropertySvc.V1\xca\x02\x17Services\\PropertySvc\\V1\xe2\x02#Services\\PropertySvc\\V1\\GPBMetadata\xea\x02\x19Services::PropertySvc::V1b\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -26,9 +26,9 @@ _globals['_FILTERUPDATE']._serialized_start=131 _globals['_FILTERUPDATE']._serialized_end=399 _globals['_UPDATEPROPERTYVIEWRULEREQUEST']._serialized_start=402 - _globals['_UPDATEPROPERTYVIEWRULEREQUEST']._serialized_end=605 - _globals['_UPDATEPROPERTYVIEWRULERESPONSE']._serialized_start=607 - _globals['_UPDATEPROPERTYVIEWRULERESPONSE']._serialized_end=639 - _globals['_PROPERTYVIEWSSERVICE']._serialized_start=642 - _globals['_PROPERTYVIEWSSERVICE']._serialized_end=808 + _globals['_UPDATEPROPERTYVIEWRULEREQUEST']._serialized_end=698 + _globals['_UPDATEPROPERTYVIEWRULERESPONSE']._serialized_start=700 + _globals['_UPDATEPROPERTYVIEWRULERESPONSE']._serialized_end=732 + _globals['_PROPERTYVIEWSSERVICE']._serialized_start=735 + _globals['_PROPERTYVIEWSSERVICE']._serialized_end=901 # @@protoc_insertion_point(module_scope) diff --git a/services/property-svc/internal/property-value/api/grpc.go b/services/property-svc/internal/property-value/api/grpc.go index ce341f581..de7d7b3fb 100644 --- a/services/property-svc/internal/property-value/api/grpc.go +++ b/services/property-svc/internal/property-value/api/grpc.go @@ -16,6 +16,7 @@ import ( type MatchersRequest interface { GetTaskMatcher() *pb.TaskPropertyMatcher + GetPatientMatcher() *pb.PatientPropertyMatcher } // DeMuxMatchers de-multiplexes the matchers in a grpc request @@ -38,6 +39,20 @@ func DeMuxMatchers(req MatchersRequest) (viewModels.PropertyMatchers, error) { WardID: wardID, TaskID: taskID, } + } else if patientMatcher := req.GetPatientMatcher(); patientMatcher != nil { + wardID, err := hwutil.ParseNullUUID(patientMatcher.WardId) + if err != nil { + return nil, fmt.Errorf("DeMuxMatchers: WardID invalid: %w", err) + } + patientID, err := hwutil.ParseNullUUID(patientMatcher.PatientId) + if err != nil { + return nil, fmt.Errorf("DeMuxMatchers: PatientID invalid: %w", err) + } + + matcher = viewModels.PatientPropertyMatchers{ + WardID: wardID, + PatientID: patientID, + } } return matcher, nil } diff --git a/services/property-svc/internal/property-view/api/grpc_test.go b/services/property-svc/internal/property-view/api/grpc_test.go index e238da414..e0c0049bf 100644 --- a/services/property-svc/internal/property-view/api/grpc_test.go +++ b/services/property-svc/internal/property-view/api/grpc_test.go @@ -221,7 +221,7 @@ func TestPropertyViewGrpcService_UpdatePropertyViewRule_AllEmptyNoEffect(t *test as.ExpectToBeEmpty(t) } -func TestPropertyViewGrpcService_UpdatePropertyViewRule_GreenPath_Created(t *testing.T) { +func TestPropertyViewGrpcService_UpdatePropertyViewRule_TaskPropertyMatcher_GreenPath_Created(t *testing.T) { ctx, client, as, dbMock, teardown := setup(t) defer teardown() @@ -259,7 +259,8 @@ func TestPropertyViewGrpcService_UpdatePropertyViewRule_GreenPath_Created(t *tes ], "Matchers":{ "TaskId":"bca23ec4-e8fd-407d-8e7d-0d0a52ba097f", - "WardId":null + "WardId":null, + "PropertyMatcherType":"task_property_matcher" }, "RuleId": "{{ . }}" }` @@ -275,7 +276,62 @@ func TestPropertyViewGrpcService_UpdatePropertyViewRule_GreenPath_Created(t *tes }) } -func TestPropertyViewGrpcService_UpdatePropertyViewRule_GreenPath_Updated(t *testing.T) { +func TestPropertyViewGrpcService_UpdatePropertyViewRule_PatientPropertyMatcher_GreenPath_Created(t *testing.T) { + ctx, client, as, dbMock, teardown := setup(t) + defer teardown() + + // Mock Empty Row response from database + dbMock.ExpectQuery(".*"). + WithArgs(uuid.NullUUID{}, uuid.NullUUID{UUID: uuid.MustParse("bca23ec4-e8fd-407d-8e7d-0d0a52ba097f"), Valid: true}). + WillReturnRows(pgxmock.NewRows([]string{})) + + _, _ = client.UpdatePropertyViewRule(ctx, &pb.UpdatePropertyViewRuleRequest{ + Matcher: &pb.UpdatePropertyViewRuleRequest_PatientMatcher{ + PatientMatcher: &pb.PatientPropertyMatcher{ + WardId: nil, + PatientId: hwutil.PtrTo("bca23ec4-e8fd-407d-8e7d-0d0a52ba097f"), + }, + }, + FilterUpdate: &pb.FilterUpdate{ + AppendToAlwaysInclude: nil, + RemoveFromAlwaysInclude: []string{"a7ff7a87-7787-42b4-9aa8-037293ac9d90", "08b23992-9489-41d2-b80d-d7d49c4c9168"}, + AppendToDontAlwaysInclude: []string{"08b23992-9489-41d2-b80d-d7d49c4c9168", "db59dd1b-fd1c-488e-a73c-6926abe68c34"}, + RemoveFromDontAlwaysInclude: []string{"08b23992-9489-41d2-b80d-d7d49c4c9168"}, + }, + }) + + as.ExpectAnyStream(t, func(streamName string, events []hwes.Event) bool { + if !assert.NotEmpty(t, events) { + return false + } + event := events[0] + + expData := `{ + "AlwaysInclude":[], + "DontAlwaysInclude": [ + "08b23992-9489-41d2-b80d-d7d49c4c9168", + "db59dd1b-fd1c-488e-a73c-6926abe68c34" + ], + "Matchers":{ + "PatientID":"bca23ec4-e8fd-407d-8e7d-0d0a52ba097f", + "WardID":null, + "PropertyMatcherType":"patient_property_matcher" + }, + "RuleId": "{{ . }}" + }` + s := "" + buf := bytes.NewBufferString(s) + tmplt, _ := template.New("").Parse(expData) + _ = tmplt.ExecuteTemplate(buf, "", strings.Split(streamName, aggregate.PropertyViewRuleAggregateType+"-")[1]) + s = buf.String() + + return assert.Equal(t, v1.PropertyRuleCreated, event.EventType) && + assert.Equal(t, hwes.AggregateType(aggregate.PropertyViewRuleAggregateType), event.AggregateType) && + assert.JSONEq(t, s, string(event.Data)) + }) +} + +func TestPropertyViewGrpcService_UpdatePropertyViewRule_TaskPropertyMatcher_GreenPath_Updated(t *testing.T) { ctx, client, as, dbMock, teardown := setup(t) defer teardown() @@ -289,7 +345,8 @@ func TestPropertyViewGrpcService_UpdatePropertyViewRule_GreenPath_Updated(t *tes priorData := []byte(`{ "Matchers": { "WardId": null, - "TaskId": "bca23ec4-e8fd-407d-8e7d-0d0a52ba097f" + "TaskId": "bca23ec4-e8fd-407d-8e7d-0d0a52ba097f", + "PropertyMatcherType": "task_property_matcher" }, "AlwaysInclude": ["a7ff7a87-7787-42b4-9aa8-037293ac9d90"], "DontAlwaysInclude": [], @@ -353,3 +410,83 @@ func TestPropertyViewGrpcService_UpdatePropertyViewRule_GreenPath_Updated(t *tes assert.JSONEq(t, s, string(event.Data)) }) } + +func TestPropertyViewGrpcService_UpdatePropertyViewRule_PatientPropertyMatcher_GreenPath_Updated(t *testing.T) { + ctx, client, as, dbMock, teardown := setup(t) + defer teardown() + + // Mock Existing Row response from database + dbMock.ExpectQuery(".*"). + WithArgs(uuid.NullUUID{}, uuid.NullUUID{UUID: uuid.MustParse("bca23ec4-e8fd-407d-8e7d-0d0a52ba097f"), Valid: true}). + WillReturnRows(pgxmock.NewRows([]string{"property_view_rules"}).AddRow("96e7ffe9-8b18-4e58-b2e1-a756fdbe1273")) + + streamsPrior := make(map[string][]hwes.Event) + + priorData := []byte(`{ + "Matchers": { + "WardId": null, + "TaskId": "bca23ec4-e8fd-407d-8e7d-0d0a52ba097f", + "PropertyMatcherType": "patient_property_matcher" + }, + "AlwaysInclude": ["a7ff7a87-7787-42b4-9aa8-037293ac9d90"], + "DontAlwaysInclude": [], + "RuleId": "96e7ffe9-8b18-4e58-b2e1-a756fdbe1273" + }`) + + nameOfRelevantStream := aggregate.PropertyViewRuleAggregateType + "-96e7ffe9-8b18-4e58-b2e1-a756fdbe1273" + streamsPrior[nameOfRelevantStream] = []hwes.Event{ + { + EventID: uuid.MustParse("227592bd-7aa0-4018-bcd4-c68fb06090ee"), + EventType: v1.PropertyRuleCreated, + AggregateID: uuid.MustParse("96e7ffe9-8b18-4e58-b2e1-a756fdbe1273"), + AggregateType: aggregate.PropertyViewRuleAggregateType, + Data: priorData, + Timestamp: time.Time{}, // warning: nonsensical default value, but not relevant for this test + Version: 0, // warning: nonsensical default value, but not relevant for this test + CommitterUserID: nil, // warning: nonsensical default value, but not relevant for this test + }, + } + as.SetStreams(streamsPrior) + + _, _ = client.UpdatePropertyViewRule(ctx, &pb.UpdatePropertyViewRuleRequest{ + Matcher: &pb.UpdatePropertyViewRuleRequest_PatientMatcher{ + PatientMatcher: &pb.PatientPropertyMatcher{ + WardId: nil, + PatientId: hwutil.PtrTo("bca23ec4-e8fd-407d-8e7d-0d0a52ba097f"), + }, + }, + FilterUpdate: &pb.FilterUpdate{ + AppendToAlwaysInclude: nil, + RemoveFromAlwaysInclude: []string{"a7ff7a87-7787-42b4-9aa8-037293ac9d90", "08b23992-9489-41d2-b80d-d7d49c4c9168"}, + AppendToDontAlwaysInclude: []string{"08b23992-9489-41d2-b80d-d7d49c4c9168", "db59dd1b-fd1c-488e-a73c-6926abe68c34"}, + RemoveFromDontAlwaysInclude: []string{"08b23992-9489-41d2-b80d-d7d49c4c9168"}, + }, + }) + + as.ExpectAnyStream(t, func(streamName string, events []hwes.Event) bool { + if streamName != nameOfRelevantStream { + return false + } + if !assert.Len(t, events, 2, "updated event was not created") { + return false + } + event := events[1] // new event + + expData := `{ + "AppendToAlwaysInclude":[], + "RemoveFromAlwaysInclude":["a7ff7a87-7787-42b4-9aa8-037293ac9d90", "08b23992-9489-41d2-b80d-d7d49c4c9168"], + "AppendToDontAlwaysInclude":["08b23992-9489-41d2-b80d-d7d49c4c9168", "db59dd1b-fd1c-488e-a73c-6926abe68c34"], + "RemoveFromDontAlwaysInclude": ["08b23992-9489-41d2-b80d-d7d49c4c9168"], + "RuleId": "{{ . }}" + }` + s := "" + buf := bytes.NewBufferString(s) + tmplt, _ := template.New("").Parse(expData) + _ = tmplt.ExecuteTemplate(buf, "", strings.Split(streamName, aggregate.PropertyViewRuleAggregateType+"-")[1]) + s = buf.String() + + return assert.Equal(t, v1.PropertyRuleListsUpdated, event.EventType) && + assert.Equal(t, hwes.AggregateType(aggregate.PropertyViewRuleAggregateType), event.AggregateType) && + assert.JSONEq(t, s, string(event.Data)) + }) +} diff --git a/services/property-svc/internal/property-view/events/v1/events.go b/services/property-svc/internal/property-view/events/v1/events.go index cd96bf424..36c4c35a8 100644 --- a/services/property-svc/internal/property-view/events/v1/events.go +++ b/services/property-svc/internal/property-view/events/v1/events.go @@ -70,14 +70,21 @@ func (m *PropertyRuleCreatedEvent) FromJSON(data []byte) error { DontAlwaysInclude: dontAlwaysIncludeUUIDs, } - if taskMatchers, ok := models.TaskPropertyMatchersFromMap(inter["Matchers"]); ok { + matchers, ok := inter["Matchers"].(map[string]interface{}) + if !ok { + return errors.New("Could not assert matchers to a map") + } + + if taskMatchers, ok := models.TaskPropertyMatchersFromMap(matchers); ok { rule.Matchers = taskMatchers m.PropertyViewRule = rule return nil + } else if patientMatchers, ok := models.PatientPropertyMatchersFromMap(matchers); ok { + rule.Matchers = patientMatchers + m.PropertyViewRule = rule + return nil } - // add other matchers once we have more - return errors.New("could not find matcher in event") } diff --git a/services/property-svc/internal/property-view/models/patient_property_matcher.go b/services/property-svc/internal/property-view/models/patient_property_matcher.go new file mode 100644 index 000000000..cd0fda4e0 --- /dev/null +++ b/services/property-svc/internal/property-view/models/patient_property_matcher.go @@ -0,0 +1,115 @@ +package models + +import ( + "context" + "errors" + "github.com/google/uuid" + "hwdb" + "hwutil" + "property-svc/repos/patient_views_repo" +) + +const PatientPropertyMatcherType = "patient_property_matcher" + +type PatientPropertyMatchers struct { + WardID uuid.NullUUID `json:"ward_id,omitempty"` + PatientID uuid.NullUUID `json:"patient_id,omitempty"` +} + +func (m PatientPropertyMatchers) FindExactRuleId(ctx context.Context) (*uuid.UUID, error) { + patientViews := patient_views_repo.New(hwdb.GetDB()) + return hwdb.Optional(patientViews.GetPatientRuleIdUsingExactMatchers)(ctx, patient_views_repo.GetPatientRuleIdUsingExactMatchersParams{ + WardID: m.WardID, + PatientID: m.PatientID, + }) +} + +type queryPatientPropertiesRow struct { + patient_views_repo.GetPatientPropertiesUsingMatchersRow +} + +func (r queryPatientPropertiesRow) GetPropertyID() uuid.UUID { + return r.PropertyID +} + +func (r queryPatientPropertiesRow) GetDontAlwaysInclude() bool { + return r.DontAlwaysInclude +} + +func (r queryPatientPropertiesRow) GetSpecificity() int32 { + return r.Specificity +} + +func (m PatientPropertyMatchers) GetType() string { + return PatientPropertyMatcherType +} + +func (m PatientPropertyMatchers) QueryProperties(ctx context.Context) ([]PropertiesQueryRow, error) { + patientViews := patient_views_repo.New(hwdb.GetDB()) + + rows, err := patientViews.GetPatientPropertiesUsingMatchers(ctx, patient_views_repo.GetPatientPropertiesUsingMatchersParams{ + WardID: m.WardID, + PatientID: m.PatientID, + }) + + cast := func(row patient_views_repo.GetPatientPropertiesUsingMatchersRow) PropertiesQueryRow { + return queryPatientPropertiesRow{row} + } + + return hwutil.Map(rows, cast), err +} + +func (m PatientPropertyMatchers) GetSubjectId() (uuid.UUID, error) { + if !m.PatientID.Valid { + return uuid.UUID{}, errors.New("PatientPropertyMatchers GetSubjectId: PatientID not valid") + } + return m.PatientID.UUID, nil +} + +func (m PatientPropertyMatchers) ToMap() map[string]interface{} { + mp := make(map[string]interface{}) + if m.WardID.Valid { + mp["WardID"] = m.WardID.UUID.String() + } else { + mp["WardID"] = nil + } + if m.PatientID.Valid { + mp["PatientID"] = m.PatientID.UUID.String() + } else { + mp["PatientID"] = nil + } + + mp["PropertyMatcherType"] = m.GetType() + + return mp +} + +func PatientPropertyMatchersFromMap(m map[string]interface{}) (PatientPropertyMatchers, bool) { + propertyMatcherType, ok := m["PropertyMatcherType"] + if !ok || propertyMatcherType != PatientPropertyMatcherType { + return PatientPropertyMatchers{}, false + } + + matcher := PatientPropertyMatchers{} + + if wardIDRaw, ok := m["WardID"].(string); ok { + parsed, err := hwutil.ParseNullUUID(&wardIDRaw) + if err != nil { + return PatientPropertyMatchers{}, false + } + matcher.WardID = parsed + } else { + matcher.WardID = uuid.NullUUID{Valid: false} + } + if patientIDRaw, ok := m["PatientID"].(string); ok { + parsed, err := hwutil.ParseNullUUID(&patientIDRaw) + if err != nil { + return PatientPropertyMatchers{}, false + } + matcher.PatientID = parsed + } else { + matcher.PatientID = uuid.NullUUID{Valid: false} + } + + return matcher, true +} diff --git a/services/property-svc/internal/property-view/models/property_view_rule.go b/services/property-svc/internal/property-view/models/property_view_rule.go index 4da6c046e..ae616a0f5 100644 --- a/services/property-svc/internal/property-view/models/property_view_rule.go +++ b/services/property-svc/internal/property-view/models/property_view_rule.go @@ -23,6 +23,10 @@ type PropertyMatchers interface { QueryProperties(context.Context) ([]PropertiesQueryRow, error) GetSubjectId() (uuid.UUID, error) + + // returns the respective type identifier of the property matcher + // should be used to identify the matcher when converting it from a map to the respective type + GetType() string } type PropertyViewRule struct { diff --git a/services/property-svc/internal/property-view/models/task_property_matchers.go b/services/property-svc/internal/property-view/models/task_property_matchers.go index 6aeb5a175..ff9f1ca69 100644 --- a/services/property-svc/internal/property-view/models/task_property_matchers.go +++ b/services/property-svc/internal/property-view/models/task_property_matchers.go @@ -10,6 +10,8 @@ import ( "github.com/google/uuid" ) +const TaskPropertyMatcherType = "task_property_matcher" + // TaskPropertyMatchers implements PropertyMatchers type TaskPropertyMatchers struct { WardID uuid.NullUUID `json:"ward_id,omitempty"` @@ -24,22 +26,26 @@ func (m TaskPropertyMatchers) FindExactRuleId(ctx context.Context) (*uuid.UUID, }) } -type queryPropertiesRow struct { +type queryTaskPropertiesRow struct { task_views_repo.GetTaskPropertiesUsingMatchersRow } -func (r queryPropertiesRow) GetPropertyID() uuid.UUID { +func (r queryTaskPropertiesRow) GetPropertyID() uuid.UUID { return r.PropertyID } -func (r queryPropertiesRow) GetDontAlwaysInclude() bool { +func (r queryTaskPropertiesRow) GetDontAlwaysInclude() bool { return r.DontAlwaysInclude } -func (r queryPropertiesRow) GetSpecificity() int32 { +func (r queryTaskPropertiesRow) GetSpecificity() int32 { return r.Specificity } +func (m TaskPropertyMatchers) GetType() string { + return TaskPropertyMatcherType +} + func (m TaskPropertyMatchers) QueryProperties(ctx context.Context) ([]PropertiesQueryRow, error) { taskViews := task_views_repo.New(hwdb.GetDB()) @@ -49,7 +55,7 @@ func (m TaskPropertyMatchers) QueryProperties(ctx context.Context) ([]Properties }) cast := func(row task_views_repo.GetTaskPropertiesUsingMatchersRow) PropertiesQueryRow { - return queryPropertiesRow{row} + return queryTaskPropertiesRow{row} } return hwutil.Map(rows, cast), err @@ -74,19 +80,21 @@ func (m TaskPropertyMatchers) ToMap() map[string]interface{} { } else { mp["TaskId"] = nil } + + mp["PropertyMatcherType"] = m.GetType() + return mp } -func TaskPropertyMatchersFromMap(m interface{}) (TaskPropertyMatchers, bool) { - mp, ok := m.(map[string]interface{}) - if !ok { - // not even a map +func TaskPropertyMatchersFromMap(m map[string]interface{}) (TaskPropertyMatchers, bool) { + propertyMatcherType, ok := m["PropertyMatcherType"] + if !ok || propertyMatcherType != TaskPropertyMatcherType { return TaskPropertyMatchers{}, false } matcher := TaskPropertyMatchers{} - if wardIdRaw, ok := mp["WardId"].(string); ok { + if wardIdRaw, ok := m["WardId"].(string); ok { parsed, err := hwutil.ParseNullUUID(&wardIdRaw) if err != nil { return TaskPropertyMatchers{}, false @@ -95,7 +103,7 @@ func TaskPropertyMatchersFromMap(m interface{}) (TaskPropertyMatchers, bool) { } else { matcher.WardID = uuid.NullUUID{Valid: false} } - if taskIdRaw, ok := mp["TaskId"].(string); ok { + if taskIdRaw, ok := m["TaskId"].(string); ok { parsed, err := hwutil.ParseNullUUID(&taskIdRaw) if err != nil { return TaskPropertyMatchers{}, false diff --git a/services/property-svc/internal/property-view/projections/task_views_postgres/task_views_postgres.go b/services/property-svc/internal/property-view/projections/property_rules_postgres/property_rules_postgres.go similarity index 81% rename from services/property-svc/internal/property-view/projections/task_views_postgres/task_views_postgres.go rename to services/property-svc/internal/property-view/projections/property_rules_postgres/property_rules_postgres.go index e2fd33e43..b357f1a84 100644 --- a/services/property-svc/internal/property-view/projections/task_views_postgres/task_views_postgres.go +++ b/services/property-svc/internal/property-view/projections/property_rules_postgres/property_rules_postgres.go @@ -1,4 +1,4 @@ -package task_views_postgres +package property_rules_postgres import ( "context" @@ -15,6 +15,7 @@ import ( "property-svc/internal/property-view/aggregate" eventsV1 "property-svc/internal/property-view/events/v1" "property-svc/internal/property-view/models" + "property-svc/repos/patient_views_repo" "property-svc/repos/task_views_repo" "property-svc/repos/views_repo" "slices" @@ -22,13 +23,14 @@ import ( type Projection struct { *custom.CustomProjection - db hwdb.DBTX - taskViewsRepo *task_views_repo.Queries - viewsRepo *views_repo.Queries + db hwdb.DBTX + taskViewsRepo *task_views_repo.Queries + patientViewsRepo *patient_views_repo.Queries + viewsRepo *views_repo.Queries } func NewProjection(es custom.EventStoreClient, serviceName string) *Projection { - subscriptionGroupName := fmt.Sprintf("%s-task-views-postgres-projection", serviceName) + subscriptionGroupName := fmt.Sprintf("%s-property-rules-postgres-projection", serviceName) p := &Projection{ CustomProjection: custom.NewCustomProjection(es, subscriptionGroupName, &[]string{fmt.Sprintf("%s-", aggregate.PropertyViewRuleAggregateType)}), db: hwdb.GetDB(), @@ -52,19 +54,10 @@ func (p *Projection) onPropertyRuleCreated(ctx context.Context, evt hwes.Event) return err, hwutil.PtrTo(esdb.NackActionPark) } - log.Debug().Any("payload", payload).Msg("payload") - if payload.RuleId == uuid.Nil { return fmt.Errorf("ruleID missing"), hwutil.PtrTo(esdb.NackActionSkip) } - // TODO: add more matchers - - matchers, ok := payload.Matchers.(models.TaskPropertyMatchers) - if !ok { - return fmt.Errorf("wrong type, expected TaskPropertyMatcher, got %T", payload.Matchers), hwutil.PtrTo(esdb.NackActionSkip) - } - tx, err := p.db.Begin(ctx) if err != nil { log.Error().Err(err).Msg("failed to begin transaction") @@ -77,7 +70,7 @@ func (p *Projection) onPropertyRuleCreated(ctx context.Context, evt hwes.Event) } }() - taskViewsQuery := p.taskViewsRepo.WithTx(tx) + // Create Rule viewsQuery := p.viewsRepo.WithTx(tx) err = viewsQuery.CreateRule(ctx, payload.RuleId) @@ -86,16 +79,35 @@ func (p *Projection) onPropertyRuleCreated(ctx context.Context, evt hwes.Event) return err, hwutil.PtrTo(esdb.NackActionRetry) } - err = taskViewsQuery.CreateTaskRule(ctx, task_views_repo.CreateTaskRuleParams{ - RuleID: payload.RuleId, - WardID: matchers.WardID, - TaskID: matchers.TaskID, - }) - if err != nil { - log.Error().Err(err).Msg("could not create task rule") - return err, hwutil.PtrTo(esdb.NackActionRetry) + // Decide on matchers + switch matchers := payload.Matchers.(type) { + case models.TaskPropertyMatchers: + taskViewsQuery := p.taskViewsRepo.WithTx(tx) + err = taskViewsQuery.CreateTaskRule(ctx, task_views_repo.CreateTaskRuleParams{ + RuleID: payload.RuleId, + WardID: matchers.WardID, + TaskID: matchers.TaskID, + }) + if err != nil { + log.Error().Err(err).Msg("could not create task rule") + return fmt.Errorf("could not create patient rule: %w", err), hwutil.PtrTo(esdb.NackActionRetry) + } + case models.PatientPropertyMatchers: + patientViewsQuery := p.patientViewsRepo.WithTx(tx) + err = patientViewsQuery.CreatePatientRule(ctx, patient_views_repo.CreatePatientRuleParams{ + RuleID: payload.RuleId, + WardID: matchers.WardID, + PatientID: matchers.PatientID, + }) + if err != nil { + log.Error().Err(err).Msg("could not create patient rule") + return fmt.Errorf("could not create patient rule: %w", err), hwutil.PtrTo(esdb.NackActionRetry) + } + default: + return fmt.Errorf("unexpected matchers type, got %T", payload.Matchers), hwutil.PtrTo(esdb.NackActionSkip) } + // handle (dont)alwaysInclude logic mapper := func(dontAlwaysInclude bool) func(uuid.UUID) views_repo.AddToAlwaysIncludeParams { return func(propertyId uuid.UUID) views_repo.AddToAlwaysIncludeParams { return views_repo.AddToAlwaysIncludeParams{ diff --git a/services/property-svc/internal/property-view/projections/task_views_postgres/task_views_postgres_test.go b/services/property-svc/internal/property-view/projections/property_rules_postgres/property_rules_postgres_test.go similarity index 60% rename from services/property-svc/internal/property-view/projections/task_views_postgres/task_views_postgres_test.go rename to services/property-svc/internal/property-view/projections/property_rules_postgres/property_rules_postgres_test.go index ccc7202b1..540661a77 100644 --- a/services/property-svc/internal/property-view/projections/task_views_postgres/task_views_postgres_test.go +++ b/services/property-svc/internal/property-view/projections/property_rules_postgres/property_rules_postgres_test.go @@ -1,4 +1,4 @@ -package task_views_postgres +package property_rules_postgres import ( "bytes" @@ -45,7 +45,7 @@ func setup() (ctx context.Context, projection *Projection, dbMock pgxmock.PgxPoo return ctx, projection, dbMock, teardown } -func TestPropertyViewTaskViewsProjection_Create_GreenPath(t *testing.T) { +func TestPropertyViewPropertyRulesProjection_Create_TaskPropertyMatcher_GreenPath(t *testing.T) { ctx, projection, dbMock, teardown := setup() defer teardown() @@ -65,7 +65,8 @@ func TestPropertyViewTaskViewsProjection_Create_GreenPath(t *testing.T) { data := []byte(`{ "Matchers": { "WardId": null, - "TaskId": "bca23ec4-e8fd-407d-8e7d-0d0a52ba097f" + "TaskId": "bca23ec4-e8fd-407d-8e7d-0d0a52ba097f", + "PropertyMatcherType": "task_property_matcher" }, "AlwaysInclude": ["a7ff7a87-7787-42b4-9aa8-037293ac9d90"], "DontAlwaysInclude": [], @@ -87,7 +88,7 @@ func TestPropertyViewTaskViewsProjection_Create_GreenPath(t *testing.T) { assert.Nil(t, action) } -func TestPropertyViewTaskViewsProjection_Update_GreenPath(t *testing.T) { +func TestPropertyViewPropertyRulesProjection_Update_GreenPath(t *testing.T) { ctx, projection, dbMock, teardown := setup() defer teardown() @@ -139,3 +140,77 @@ func TestPropertyViewTaskViewsProjection_Update_GreenPath(t *testing.T) { assert.NoError(t, err) assert.Nil(t, action) } + +func TestPropertyViewPropertyRulesProjection_Create_PatientPropertyMatcher_GreenPath(t *testing.T) { + ctx, projection, dbMock, teardown := setup() + defer teardown() + + dbMock.ExpectBeginTx(pgx.TxOptions{}) + dbMock.ExpectExec(`.*INSERT INTO property_view_rules.*`). + WithArgs(uuid.MustParse("c976b4fa-ee37-4aff-b7f9-c88fe5c8d238")). + WillReturnResult(pgconn.NewCommandTag("INSERT 1")) + dbMock.ExpectExec(`.*INSERT INTO patient_property_view_rules.*`). + WithArgs(uuid.MustParse("c976b4fa-ee37-4aff-b7f9-c88fe5c8d238"), uuid.NullUUID{}, uuid.NullUUID{UUID: uuid.MustParse("4342530b-6b0d-40b5-9d98-be5a14681969"), Valid: true}). + WillReturnResult(pgconn.NewCommandTag("INSERT 1")) + + dbMock.ExpectCopyFrom(pgx.Identifier{"property_view_filter_always_include_items"}, []string{"rule_id", "property_id", "dont_always_include"}).WillReturnResult(1) + dbMock.ExpectCopyFrom(pgx.Identifier{"property_view_filter_always_include_items"}, []string{"rule_id", "property_id", "dont_always_include"}).WillReturnResult(0) + + dbMock.ExpectCommit() + + data := []byte(`{ + "Matchers": { + "WardID": null, + "PatientID": "4342530b-6b0d-40b5-9d98-be5a14681969", + "PropertyMatcherType": "patient_property_matcher" + }, + "AlwaysInclude": ["a7ff7a87-7787-42b4-9aa8-037293ac9d90"], + "DontAlwaysInclude": [], + "RuleId": "c976b4fa-ee37-4aff-b7f9-c88fe5c8d238" + }`) + + err, action := projection.onPropertyRuleCreated(ctx, hwes.Event{ + EventID: uuid.MustParse("227592bd-7aa0-4018-bcd4-c68fb06090ee"), + EventType: v1.PropertyRuleCreated, + AggregateID: uuid.MustParse("c976b4fa-ee37-4aff-b7f9-c88fe5c8d238"), + AggregateType: aggregate.PropertyViewRuleAggregateType, + Data: data, + Timestamp: time.Time{}, // warning: nonsensical default value, but not relevant for this test + Version: 0, // warning: nonsensical default value, but not relevant for this test + CommitterUserID: nil, // warning: nonsensical default value, but not relevant for this test + }) + + assert.NoError(t, err) + assert.Nil(t, action) +} + +func TestPropertyViewPropertyRulesProjection_Create_InvalidPropertyMatcher(t *testing.T) { + ctx, projection, _, teardown := setup() + defer teardown() + + data := []byte(`{ + "Matchers": { + "WardID": null, + "PatientID": "4342530b-6b0d-40b5-9d98-be5a14681969", + "PropertyMatcherType": "invalid_property_matcher" + }, + "AlwaysInclude": ["a7ff7a87-7787-42b4-9aa8-037293ac9d90"], + "DontAlwaysInclude": [], + "RuleId": "c976b4fa-ee37-4aff-b7f9-c88fe5c8d238" + }`) + + err, action := projection.onPropertyRuleCreated(ctx, hwes.Event{ + EventID: uuid.MustParse("227592bd-7aa0-4018-bcd4-c68fb06090ee"), + EventType: v1.PropertyRuleCreated, + AggregateID: uuid.MustParse("c976b4fa-ee37-4aff-b7f9-c88fe5c8d238"), + AggregateType: aggregate.PropertyViewRuleAggregateType, + Data: data, + Timestamp: time.Time{}, // warning: nonsensical default value, but not relevant for this test + Version: 0, // warning: nonsensical default value, but not relevant for this test + CommitterUserID: nil, // warning: nonsensical default value, but not relevant for this test + }) + + assert.Error(t, err) + assert.Equal(t, err.Error(), "could not find matcher in event") + assert.NotNil(t, action) +} diff --git a/services/property-svc/main.go b/services/property-svc/main.go index 3c208b0ac..440543e0e 100644 --- a/services/property-svc/main.go +++ b/services/property-svc/main.go @@ -11,7 +11,7 @@ import ( propertyValue "property-svc/internal/property-value/api" "property-svc/internal/property-value/projections/property_value_postgres_projection" propertyViews "property-svc/internal/property-view/api" - "property-svc/internal/property-view/projections/task_views_postgres" + "property-svc/internal/property-view/projections/property_rules_postgres" property "property-svc/internal/property/api" "property-svc/internal/property/projections/property_postgres_projection" @@ -73,7 +73,7 @@ func main() { }() go func() { - taskViewsPostgresProjection := task_views_postgres.NewProjection(eventStore, ServiceName) + taskViewsPostgresProjection := property_rules_postgres.NewProjection(eventStore, ServiceName) if err := taskViewsPostgresProjection.Subscribe(ctx); err != nil { log.Err(err).Msg("error during taskViewsPostgresProjection subscription") cancel() diff --git a/services/property-svc/migrations/000006_patient_views.down.sql b/services/property-svc/migrations/000006_patient_views.down.sql new file mode 100644 index 000000000..2c8efdf10 --- /dev/null +++ b/services/property-svc/migrations/000006_patient_views.down.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS patient_property_view_rules; diff --git a/services/property-svc/migrations/000006_patient_views.up.sql b/services/property-svc/migrations/000006_patient_views.up.sql new file mode 100644 index 000000000..e42b81c18 --- /dev/null +++ b/services/property-svc/migrations/000006_patient_views.up.sql @@ -0,0 +1,5 @@ +CREATE TABLE IF NOT EXISTS patient_property_view_rules ( + ward_id uuid, + patient_id uuid, + UNIQUE (ward_id, patient_id) +) INHERITS (property_view_rules); diff --git a/services/property-svc/repos/patient_views_repo.sql b/services/property-svc/repos/patient_views_repo.sql new file mode 100644 index 000000000..1899fd835 --- /dev/null +++ b/services/property-svc/repos/patient_views_repo.sql @@ -0,0 +1,23 @@ +-- name: CreatePatientRule :exec +INSERT INTO patient_property_view_rules (rule_id, ward_id, patient_id) +VALUES (@rule_id, sqlc.narg('ward_id'), sqlc.narg('patient_id')); + +-- name: GetPatientRuleIdUsingExactMatchers :one +SELECT + rules.rule_id as rule_id + FROM patient_property_view_rules as rules + WHERE + (rules.ward_id = sqlc.narg('ward_id') OR (rules.ward_id IS NULL AND sqlc.narg('ward_id') IS NULL)) + AND ((rules.patient_id = sqlc.narg('patient_id')) OR (rules.patient_id IS NULL AND sqlc.narg('patient_id') IS NULL)); + +-- name: GetPatientPropertiesUsingMatchers :many +SELECT + list_items.property_id, + list_items.dont_always_include, + calc_rule_specificity(rules.patient_id IS NOT NULL, rules.ward_id IS NOT NULL) as specificity +FROM patient_property_view_rules as rules +JOIN property_view_filter_always_include_items as list_items ON list_items.rule_id = rules.rule_id +WHERE + (rules.ward_id = @ward_id OR rules.ward_id IS NULL) +AND (rules.patient_id = @patient_id OR rules.patient_id IS NULL) +ORDER BY specificity; diff --git a/services/property-svc/repos/patient_views_repo/db.go b/services/property-svc/repos/patient_views_repo/db.go new file mode 100644 index 000000000..632b819a5 --- /dev/null +++ b/services/property-svc/repos/patient_views_repo/db.go @@ -0,0 +1,32 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.27.0 + +package patient_views_repo + +import ( + "context" + + "github.com/jackc/pgx/v5" + "github.com/jackc/pgx/v5/pgconn" +) + +type DBTX interface { + Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error) + Query(context.Context, string, ...interface{}) (pgx.Rows, error) + QueryRow(context.Context, string, ...interface{}) pgx.Row +} + +func New(db DBTX) *Queries { + return &Queries{db: db} +} + +type Queries struct { + db DBTX +} + +func (q *Queries) WithTx(tx pgx.Tx) *Queries { + return &Queries{ + db: tx, + } +} diff --git a/services/property-svc/repos/patient_views_repo/models.go b/services/property-svc/repos/patient_views_repo/models.go new file mode 100644 index 000000000..045aa4ae0 --- /dev/null +++ b/services/property-svc/repos/patient_views_repo/models.go @@ -0,0 +1,73 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.27.0 + +package patient_views_repo + +import ( + "github.com/google/uuid" + "github.com/jackc/pgx/v5/pgtype" +) + +type PatientPropertyViewRule struct { + RuleID uuid.UUID + WardID uuid.NullUUID + PatientID uuid.NullUUID +} + +type Property struct { + ID uuid.UUID + SubjectType int32 + FieldType int32 + Name string + Description string + IsArchived bool + SetID uuid.NullUUID + SelectDataID uuid.NullUUID +} + +type PropertyValue struct { + ID uuid.UUID + PropertyID uuid.UUID + SubjectID uuid.UUID + TextValue *string + NumberValue *float64 + BoolValue *bool + DateValue pgtype.Date + DateTimeValue pgtype.Timestamp + SelectValue uuid.NullUUID +} + +type PropertyViewFilterAlwaysIncludeItem struct { + DontAlwaysInclude bool + RuleID uuid.UUID + PropertyID uuid.UUID +} + +type PropertyViewRule struct { + RuleID uuid.UUID +} + +type SchemaMigration struct { + Version int64 + Dirty bool +} + +type SelectData struct { + ID uuid.UUID + AllowFreetext bool +} + +type SelectOption struct { + ID uuid.UUID + Name string + Description string + IsCustom bool + SelectDataID uuid.UUID +} + +type TaskPropertyViewRule struct { + RuleID uuid.UUID + WardID uuid.NullUUID + TaskID uuid.NullUUID +} diff --git a/services/property-svc/repos/patient_views_repo/patient_views_repo.sql.go b/services/property-svc/repos/patient_views_repo/patient_views_repo.sql.go new file mode 100644 index 000000000..adb9e2565 --- /dev/null +++ b/services/property-svc/repos/patient_views_repo/patient_views_repo.sql.go @@ -0,0 +1,93 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.27.0 +// source: patient_views_repo.sql + +package patient_views_repo + +import ( + "context" + + "github.com/google/uuid" +) + +const createPatientRule = `-- name: CreatePatientRule :exec +INSERT INTO patient_property_view_rules (rule_id, ward_id, patient_id) +VALUES ($1, $2, $3) +` + +type CreatePatientRuleParams struct { + RuleID uuid.UUID + WardID uuid.NullUUID + PatientID uuid.NullUUID +} + +func (q *Queries) CreatePatientRule(ctx context.Context, arg CreatePatientRuleParams) error { + _, err := q.db.Exec(ctx, createPatientRule, arg.RuleID, arg.WardID, arg.PatientID) + return err +} + +const getPatientPropertiesUsingMatchers = `-- name: GetPatientPropertiesUsingMatchers :many +SELECT + list_items.property_id, + list_items.dont_always_include, + calc_rule_specificity(rules.patient_id IS NOT NULL, rules.ward_id IS NOT NULL) as specificity +FROM patient_property_view_rules as rules +JOIN property_view_filter_always_include_items as list_items ON list_items.rule_id = rules.rule_id +WHERE + (rules.ward_id = $1 OR rules.ward_id IS NULL) +AND (rules.patient_id = $2 OR rules.patient_id IS NULL) +ORDER BY specificity +` + +type GetPatientPropertiesUsingMatchersParams struct { + WardID uuid.NullUUID + PatientID uuid.NullUUID +} + +type GetPatientPropertiesUsingMatchersRow struct { + PropertyID uuid.UUID + DontAlwaysInclude bool + Specificity int32 +} + +func (q *Queries) GetPatientPropertiesUsingMatchers(ctx context.Context, arg GetPatientPropertiesUsingMatchersParams) ([]GetPatientPropertiesUsingMatchersRow, error) { + rows, err := q.db.Query(ctx, getPatientPropertiesUsingMatchers, arg.WardID, arg.PatientID) + if err != nil { + return nil, err + } + defer rows.Close() + items := []GetPatientPropertiesUsingMatchersRow{} + for rows.Next() { + var i GetPatientPropertiesUsingMatchersRow + if err := rows.Scan(&i.PropertyID, &i.DontAlwaysInclude, &i.Specificity); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const getPatientRuleIdUsingExactMatchers = `-- name: GetPatientRuleIdUsingExactMatchers :one +SELECT + rules.rule_id as rule_id + FROM patient_property_view_rules as rules + WHERE + (rules.ward_id = $1 OR (rules.ward_id IS NULL AND $1 IS NULL)) + AND ((rules.patient_id = $2) OR (rules.patient_id IS NULL AND $2 IS NULL)) +` + +type GetPatientRuleIdUsingExactMatchersParams struct { + WardID uuid.NullUUID + PatientID uuid.NullUUID +} + +func (q *Queries) GetPatientRuleIdUsingExactMatchers(ctx context.Context, arg GetPatientRuleIdUsingExactMatchersParams) (uuid.UUID, error) { + row := q.db.QueryRow(ctx, getPatientRuleIdUsingExactMatchers, arg.WardID, arg.PatientID) + var rule_id uuid.UUID + err := row.Scan(&rule_id) + return rule_id, err +} diff --git a/services/property-svc/repos/property_repo/models.go b/services/property-svc/repos/property_repo/models.go index eba9e43f0..3f7139c7f 100644 --- a/services/property-svc/repos/property_repo/models.go +++ b/services/property-svc/repos/property_repo/models.go @@ -9,6 +9,12 @@ import ( "github.com/jackc/pgx/v5/pgtype" ) +type PatientPropertyViewRule struct { + RuleID uuid.UUID + WardID uuid.NullUUID + PatientID uuid.NullUUID +} + type Property struct { ID uuid.UUID SubjectType int32 diff --git a/services/property-svc/repos/property_value_repo/models.go b/services/property-svc/repos/property_value_repo/models.go index 8b38d3e41..242d501b8 100644 --- a/services/property-svc/repos/property_value_repo/models.go +++ b/services/property-svc/repos/property_value_repo/models.go @@ -9,6 +9,12 @@ import ( "github.com/jackc/pgx/v5/pgtype" ) +type PatientPropertyViewRule struct { + RuleID uuid.UUID + WardID uuid.NullUUID + PatientID uuid.NullUUID +} + type Property struct { ID uuid.UUID SubjectType int32 diff --git a/services/property-svc/repos/task_views_repo/models.go b/services/property-svc/repos/task_views_repo/models.go index 56a2241b5..21c8bb021 100644 --- a/services/property-svc/repos/task_views_repo/models.go +++ b/services/property-svc/repos/task_views_repo/models.go @@ -9,6 +9,12 @@ import ( "github.com/jackc/pgx/v5/pgtype" ) +type PatientPropertyViewRule struct { + RuleID uuid.UUID + WardID uuid.NullUUID + PatientID uuid.NullUUID +} + type Property struct { ID uuid.UUID SubjectType int32 diff --git a/services/property-svc/repos/views_repo/models.go b/services/property-svc/repos/views_repo/models.go index 9a08ea5a6..37d34902a 100644 --- a/services/property-svc/repos/views_repo/models.go +++ b/services/property-svc/repos/views_repo/models.go @@ -9,6 +9,12 @@ import ( "github.com/jackc/pgx/v5/pgtype" ) +type PatientPropertyViewRule struct { + RuleID uuid.UUID + WardID uuid.NullUUID + PatientID uuid.NullUUID +} + type Property struct { ID uuid.UUID SubjectType int32 diff --git a/services/property-svc/schema.sql b/services/property-svc/schema.sql index 5c0ff040d..f418a9bcd 100644 --- a/services/property-svc/schema.sql +++ b/services/property-svc/schema.sql @@ -77,6 +77,26 @@ SET default_tablespace = ''; SET default_table_access_method = heap; +-- +-- Name: property_view_rules; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.property_view_rules ( + rule_id uuid DEFAULT public.uuid_generate_v4() NOT NULL +); + + +-- +-- Name: patient_property_view_rules; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.patient_property_view_rules ( + ward_id uuid, + patient_id uuid +) +INHERITS (public.property_view_rules); + + -- -- Name: properties; Type: TABLE; Schema: public; Owner: - -- @@ -123,15 +143,6 @@ CREATE TABLE public.property_view_filter_always_include_items ( ); --- --- Name: property_view_rules; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.property_view_rules ( - rule_id uuid DEFAULT public.uuid_generate_v4() NOT NULL -); - - -- -- Name: schema_migrations; Type: TABLE; Schema: public; Owner: - -- @@ -176,6 +187,13 @@ CREATE TABLE public.task_property_view_rules ( INHERITS (public.property_view_rules); +-- +-- Name: patient_property_view_rules rule_id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.patient_property_view_rules ALTER COLUMN rule_id SET DEFAULT public.uuid_generate_v4(); + + -- -- Name: task_property_view_rules rule_id; Type: DEFAULT; Schema: public; Owner: - -- @@ -183,6 +201,14 @@ INHERITS (public.property_view_rules); ALTER TABLE ONLY public.task_property_view_rules ALTER COLUMN rule_id SET DEFAULT public.uuid_generate_v4(); +-- +-- Name: patient_property_view_rules patient_property_view_rules_ward_id_patient_id_key; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.patient_property_view_rules + ADD CONSTRAINT patient_property_view_rules_ward_id_patient_id_key UNIQUE (ward_id, patient_id); + + -- -- Name: properties properties_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- diff --git a/services/property-svc/sqlc.yaml b/services/property-svc/sqlc.yaml index dc28b01eb..cdadbb11f 100644 --- a/services/property-svc/sqlc.yaml +++ b/services/property-svc/sqlc.yaml @@ -39,3 +39,10 @@ sql: <<: *repo-go package: "property_value_repo" out: "repos/property_value_repo" + - <<: *repo + queries: "./repos/patient_views_repo.sql" + gen: + go: + <<: *repo-go + package: "patient_views_repo" + out: "repos/patient_views_repo"