From 02babf7460697a63bf0a341b66387ad3230d3080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Mon, 1 Jul 2024 09:41:29 +0200 Subject: [PATCH 1/2] Add manipulation to create ContextState with Association, specific Validator and excluded Identification (#80) The Manipulation is useful for testing EnsembleContexts. # Checklist The following aspects have been respected by the author of this pull request, confirmed by both pull request assignee **and** reviewer: * Changelog update (necessity checked and entry added or not added respectively) * [x] Pull Request Assignee * [x] Reviewer * README update (necessity checked and entry added or not added respectively) * [x] Pull Request Assignee * [x] Reviewer --- CHANGELOG.md | 1 + src/t2iapi/context/context_requests.proto | 10 ++++++++++ src/t2iapi/context/context_responses.proto | 11 +++++++++++ src/t2iapi/context/service.proto | 20 ++++++++++++++++++++ 4 files changed, 42 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92f529a..30ecfd7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- manipulation AssociateValidateAndChangeIdentificationOfPatientOrLocationContextState for contexts - manipulation ProvideInformationAboutLastCalibration for devices - manipulation ProvideInformationAboutNextCalibration for devices - manipulation SetSystemContextActivationStateAndContextAssociation for combined settings diff --git a/src/t2iapi/context/context_requests.proto b/src/t2iapi/context/context_requests.proto index b03e3fa..e5f1ced 100644 --- a/src/t2iapi/context/context_requests.proto +++ b/src/t2iapi/context/context_requests.proto @@ -55,6 +55,16 @@ message CreateContextStateWithAssociationAndValidatorsRequest { string num_validators = 3; // number of pm:Validator elements } +/* +Request to create or adapt a pm:PatientContextState or pm:LocationContextState instance with +@ContextAssociation = Assoc for the given @DescriptorHandle, with a given number +of pm:Validator elements and a changed pm:Identification. + */ +message AssociateValidateAndChangeIdentificationOfPatientOrLocationContextStateRequest { + string descriptor_handle = 1; + string num_validators = 2; // number of pm:Validator elements +} + /* Request to create or adapt a context state with a given association and specific validator. */ diff --git a/src/t2iapi/context/context_responses.proto b/src/t2iapi/context/context_responses.proto index a394b58..4f7c649 100644 --- a/src/t2iapi/context/context_responses.proto +++ b/src/t2iapi/context/context_responses.proto @@ -24,6 +24,17 @@ message CreateContextStateWithAssociationResponse { string context_state_handle = 2; // handle of the context state, that was created or adapted } +/* +Response containing the context state handle and the prior mdib version. + */ +message AssociateValidateAndChangeIdentificationOfPatientOrLocationContextStateResponse { + BasicResponse status = 1; + string context_state_handle = 2; // handle of the context state, that was created or adapted + uint64 prior_mdib_version = 3; // mdib version before the change - contains the previously associated + // context state whose pm:Identification the changed + // pm:Identification must structurally differ from. +} + /* Response which contains all context types supported by the DUT. */ diff --git a/src/t2iapi/context/service.proto b/src/t2iapi/context/service.proto index 48e9a2c..82cdff1 100644 --- a/src/t2iapi/context/service.proto +++ b/src/t2iapi/context/service.proto @@ -105,6 +105,26 @@ service ContextService { t2iapi.context.CreateContextStateWithAssocAndSpecificValidatorRequest) returns (t2iapi.context.CreateContextStateWithAssociationResponse); + /* + Create or adapt a patient- or location context state, such that + - it belongs to the given @DescriptorHandle, + - it has @ContextAssociation = Assoc, + - it has the given number of pm:Validators, and + - its pm:Identification changes. + The pm:Identification of the created resp. adapted context state must differ structurally from + the pm:Identification of the previously associated context state of the same @DescriptorHandle. + Returns the handle of the created or adapted context state and an mdib version + that contains the version of the previously associated context state whose pm:Identification + the changed pm:Identification must structurally differ from. + The mdib version must represent the mdib of the device before the changes of the + manipulation are applied to the mdib. + The manipulated state shall be persistent until a next manipulation call. If the device is not able to maintain + the static state, it shall return RESULT_NOT_SUPPORTED. + */ + rpc AssociateValidateAndChangeIdentificationOfPatientOrLocationContextState( + t2iapi.context.AssociateValidateAndChangeIdentificationOfPatientOrLocationContextStateRequest) + returns (AssociateValidateAndChangeIdentificationOfPatientOrLocationContextStateResponse); + /* Create or adapt neonatal patient with a given type of association and including the mothers identification. From 863c4ff2ac23f7dc940650fa608175fcbfbf2c64 Mon Sep 17 00:00:00 2001 From: pstaeck <36667270+pstaeck@users.noreply.github.com> Date: Wed, 10 Jul 2024 11:04:55 +0200 Subject: [PATCH 2/2] Add new manipulation get available meta data (#84) The purpose of the pull request is to have a manipulation that returns the device meta data that must be available. # Checklist The following aspects have been respected by the author of this pull request, confirmed by both pull request assignee **and** reviewer: * Changelog update (necessity checked and entry added or not added respectively) * [x] Pull Request Assignee * [x] Reviewer * README update (necessity checked and entry added or not added respectively) * [x] Pull Request Assignee * [x] Reviewer --- CHANGELOG.md | 1 + python/src/t2iapi/biceps/__init__.py | 4 +++ python/src/t2iapi/biceps/__init__.pyi | 4 +++ src/t2iapi/biceps/codedvalue.proto | 37 ++++++++++++++++++++ src/t2iapi/biceps/instanceidentifier.proto | 27 +++++++++++++++ src/t2iapi/biceps/localizedtext.proto | 27 +++++++++++++++ src/t2iapi/biceps/localizedtextwidth.proto | 32 +++++++++++++++++ src/t2iapi/biceps/metadata.proto | 40 ++++++++++++++++++++++ src/t2iapi/device/device_responses.proto | 9 +++++ src/t2iapi/device/service.proto | 8 +++++ 10 files changed, 189 insertions(+) create mode 100644 python/src/t2iapi/biceps/__init__.py create mode 100644 python/src/t2iapi/biceps/__init__.pyi create mode 100644 src/t2iapi/biceps/codedvalue.proto create mode 100644 src/t2iapi/biceps/instanceidentifier.proto create mode 100644 src/t2iapi/biceps/localizedtext.proto create mode 100644 src/t2iapi/biceps/localizedtextwidth.proto create mode 100644 src/t2iapi/biceps/metadata.proto diff --git a/CHANGELOG.md b/CHANGELOG.md index 30ecfd7..156bada 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- manipulation GetAvailableDeviceMetaData for device - manipulation AssociateValidateAndChangeIdentificationOfPatientOrLocationContextState for contexts - manipulation ProvideInformationAboutLastCalibration for devices - manipulation ProvideInformationAboutNextCalibration for devices diff --git a/python/src/t2iapi/biceps/__init__.py b/python/src/t2iapi/biceps/__init__.py new file mode 100644 index 0000000..8bde99b --- /dev/null +++ b/python/src/t2iapi/biceps/__init__.py @@ -0,0 +1,4 @@ +# This Source Code Form is subject to the terms of the MIT License. +# +# Copyright (c) 2024 Draegerwerk AG & Co. KGaA. +# SPDX-License-Identifier: MIT diff --git a/python/src/t2iapi/biceps/__init__.pyi b/python/src/t2iapi/biceps/__init__.pyi new file mode 100644 index 0000000..8bde99b --- /dev/null +++ b/python/src/t2iapi/biceps/__init__.pyi @@ -0,0 +1,4 @@ +# This Source Code Form is subject to the terms of the MIT License. +# +# Copyright (c) 2024 Draegerwerk AG & Co. KGaA. +# SPDX-License-Identifier: MIT diff --git a/src/t2iapi/biceps/codedvalue.proto b/src/t2iapi/biceps/codedvalue.proto new file mode 100644 index 0000000..ab0fc38 --- /dev/null +++ b/src/t2iapi/biceps/codedvalue.proto @@ -0,0 +1,37 @@ +/* +This Source Code Form is subject to the terms of the MIT License. +Copyright (c) 2024 Draegerwerk AG & Co. KGaA. + +SPDX-License-Identifier: MIT +*/ + +syntax = "proto3"; + +package t2iapi.biceps; + +option java_package = "com.draeger.medical.t2iapi.biceps"; +option java_outer_classname = "CodedValueProto"; + +import "t2iapi/biceps/localizedtext.proto"; +import "google/protobuf/wrappers.proto"; + +/* +Represents pm:CodedValue (defined in IEEE Std 11073-10207-2017). +*/ +message CodedValueMsg { + repeated LocalizedTextMsg coding_system_name = 1; + repeated LocalizedTextMsg concept_description = 2; + /* + Represents pm:Translation (defined in IEEE Std 11073-10207-2017). + */ + message TranslationMsg { + string code_attr = 3; + google.protobuf.StringValue coding_system_attr = 4; + google.protobuf.StringValue coding_system_version_attr = 5; + } + repeated TranslationMsg translation = 6; + string code_attr = 7; + google.protobuf.StringValue coding_system_attr = 8; + google.protobuf.StringValue coding_system_version_attr = 9; + google.protobuf.StringValue symbolic_code_name_attr = 10; +} diff --git a/src/t2iapi/biceps/instanceidentifier.proto b/src/t2iapi/biceps/instanceidentifier.proto new file mode 100644 index 0000000..be251a5 --- /dev/null +++ b/src/t2iapi/biceps/instanceidentifier.proto @@ -0,0 +1,27 @@ +/* +This Source Code Form is subject to the terms of the MIT License. +Copyright (c) 2024 Draegerwerk AG & Co. KGaA. + +SPDX-License-Identifier: MIT +*/ + +syntax = "proto3"; + +package t2iapi.biceps; + +option java_package = "com.draeger.medical.t2iapi.biceps"; +option java_outer_classname = "InstanceIdentifierProto"; + +import "google/protobuf/wrappers.proto"; +import "t2iapi/biceps/codedvalue.proto"; +import "t2iapi/biceps/localizedtext.proto"; + +/* +Represents pm:InstanceIdentifier (defined in IEEE Std 11073-10207-2017). +*/ +message InstanceIdentifierMsg { + CodedValueMsg type = 1; + repeated LocalizedTextMsg identifier_name = 2; + google.protobuf.StringValue root_attr = 3; + google.protobuf.StringValue extension_attr = 4; +} diff --git a/src/t2iapi/biceps/localizedtext.proto b/src/t2iapi/biceps/localizedtext.proto new file mode 100644 index 0000000..2c9781b --- /dev/null +++ b/src/t2iapi/biceps/localizedtext.proto @@ -0,0 +1,27 @@ +/* +This Source Code Form is subject to the terms of the MIT License. +Copyright (c) 2024 Draegerwerk AG & Co. KGaA. + +SPDX-License-Identifier: MIT +*/ + +syntax = "proto3"; + +package t2iapi.biceps; + +option java_package = "com.draeger.medical.t2iapi.biceps"; +option java_outer_classname = "LocalizedTextProto"; + +import "google/protobuf/wrappers.proto"; +import "t2iapi/biceps/localizedtextwidth.proto"; + +/* +Represents pm:LocalizedText (defined in IEEE Std 11073-10207-2017). +*/ +message LocalizedTextMsg { + google.protobuf.StringValue localized_text_content = 1; + google.protobuf.StringValue ref_attr = 2; + google.protobuf.StringValue lang_attr = 3; + google.protobuf.UInt64Value version_attr = 4; + LocalizedTextWidthMsg text_width_attr = 5; +} diff --git a/src/t2iapi/biceps/localizedtextwidth.proto b/src/t2iapi/biceps/localizedtextwidth.proto new file mode 100644 index 0000000..b1b3002 --- /dev/null +++ b/src/t2iapi/biceps/localizedtextwidth.proto @@ -0,0 +1,32 @@ +/* +This Source Code Form is subject to the terms of the MIT License. +Copyright (c) 2024 Draegerwerk AG & Co. KGaA. + +SPDX-License-Identifier: MIT +*/ + +syntax = "proto3"; + +package t2iapi.biceps; + +option java_package = "com.draeger.medical.t2iapi.biceps"; +option java_outer_classname = "LocalizedTextWidthProto"; + +/* +Represents pm:LocalizedTextWidth (defined in IEEE Std 11073-10207-2017). +*/ +message LocalizedTextWidthMsg { + /* + Indicates the width of a localized text based on the number of fullwidth characters + (defined in IEEE Std 11073-10207-2017). + */ + enum EnumType { + ENUM_TYPE_XS = 0; // A line has 4 or less fullwidth characters. + ENUM_TYPE_S = 1; // A line has 8 or less fullwidth characters. + ENUM_TYPE_M = 2; // A line has 12 or less fullwidth characters. + ENUM_TYPE_L = 3; // A line has 16 or less fullwidth characters. + ENUM_TYPE_XL = 4; // A line has 20 or less fullwidth characters. + ENUM_TYPE_XXL = 5; // A line has 21 or more fullwidth characters. + } + EnumType enum_type = 1; +} diff --git a/src/t2iapi/biceps/metadata.proto b/src/t2iapi/biceps/metadata.proto new file mode 100644 index 0000000..5fc513a --- /dev/null +++ b/src/t2iapi/biceps/metadata.proto @@ -0,0 +1,40 @@ +/* +This Source Code Form is subject to the terms of the MIT License. +Copyright (c) 2024 Draegerwerk AG & Co. KGaA. + +SPDX-License-Identifier: MIT +*/ + +syntax = "proto3"; + +package t2iapi.biceps; + +option java_package = "com.draeger.medical.t2iapi.biceps"; +option java_outer_classname = "MetadataProto"; + +import "t2iapi/biceps/localizedtext.proto"; +import "t2iapi/biceps/instanceidentifier.proto"; +import "google/protobuf/wrappers.proto"; + +/* +Contains the metadata of the device. Represents pm:MetaData (defined in IEEE Std 11073-10207-2017). + */ +message MetaDataMsg { + /* + Represents pm:Udi (defined in IEEE Std 11073-10207-2017). + */ + message UdiMsg { + string device_identifier = 1; + string human_readable_form = 2; + t2iapi.biceps.InstanceIdentifierMsg issuer = 3; + t2iapi.biceps.InstanceIdentifierMsg jurisdiction = 4; + } + repeated UdiMsg udi = 5; + google.protobuf.StringValue lot_number = 6; + repeated t2iapi.biceps.LocalizedTextMsg manufacturer = 7; + google.protobuf.StringValue manufacture_date = 8; + google.protobuf.StringValue expiration_date = 9; + repeated t2iapi.biceps.LocalizedTextMsg model_name = 10; + google.protobuf.StringValue model_number = 11; + repeated string serial_number = 12; +} diff --git a/src/t2iapi/device/device_responses.proto b/src/t2iapi/device/device_responses.proto index 21a757b..1721789 100644 --- a/src/t2iapi/device/device_responses.proto +++ b/src/t2iapi/device/device_responses.proto @@ -10,6 +10,7 @@ syntax = "proto3"; package t2iapi.device; import "t2iapi/basic_responses.proto"; +import "t2iapi/biceps/metadata.proto"; option java_package = "com.draeger.medical.t2iapi.device"; option java_outer_classname = "DeviceResponses"; @@ -28,4 +29,12 @@ Response containing the handle of the newly created mds descriptor. message InsertMdsDescriptorResponse { BasicResponse status = 1; string handle = 2; // handle of the mds descriptor, that was created +} + +/* +Response containing the available device metadata. + */ +message AvailableDeviceMetaDataResponse { + BasicResponse status = 1; + t2iapi.biceps.MetaDataMsg meta_data = 2; // available device metadata } \ No newline at end of file diff --git a/src/t2iapi/device/service.proto b/src/t2iapi/device/service.proto index 0c74993..7ffa506 100644 --- a/src/t2iapi/device/service.proto +++ b/src/t2iapi/device/service.proto @@ -135,4 +135,12 @@ service DeviceService { */ rpc ProvideInformationAboutNextCalibration (t2iapi.device.ProvideInformationAboutNextCalibrationRequest) returns (BasicResponse); + + /* + Get the available device metadata of the pm:MdsDescriptor for the given handle. For each item of the metadata + that is not available for this MDS leave the corresponding element empty. In this context, "available" does not + mean a copy of the data from the pm:MdsDescriptor/pm:MetaData. It means a provision of the data which, in the + user's opinion, must be present for this device. + */ + rpc GetAvailableDeviceMetaData(BasicHandleRequest) returns (AvailableDeviceMetaDataResponse); }