Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/jannast/t2iapi into manipul…
Browse files Browse the repository at this point in the history
…ation_get_component_sw_version

# Conflicts:
#	CHANGELOG.md
#	src/t2iapi/device/device_responses.proto
#	src/t2iapi/device/service.proto
  • Loading branch information
jannast committed Jul 30, 2024
2 parents 8928c36 + 863c4ff commit db6cb8c
Show file tree
Hide file tree
Showing 13 changed files with 237 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- manipulation GetAvailableDeviceMetaData for device
- manipulation AssociateValidateAndChangeIdentificationOfPatientOrLocationContextState for contexts
- manipulation GetComponentSwVersion for devices
- manipulation ProvideInformationAboutLastCalibration for devices
- manipulation ProvideInformationAboutNextCalibration for devices
Expand Down
4 changes: 4 additions & 0 deletions python/src/t2iapi/biceps/__init__.py
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions python/src/t2iapi/biceps/__init__.pyi
Original file line number Diff line number Diff line change
@@ -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
37 changes: 37 additions & 0 deletions src/t2iapi/biceps/codedvalue.proto
Original file line number Diff line number Diff line change
@@ -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;
}
27 changes: 27 additions & 0 deletions src/t2iapi/biceps/instanceidentifier.proto
Original file line number Diff line number Diff line change
@@ -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;
}
27 changes: 27 additions & 0 deletions src/t2iapi/biceps/localizedtext.proto
Original file line number Diff line number Diff line change
@@ -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;
}
32 changes: 32 additions & 0 deletions src/t2iapi/biceps/localizedtextwidth.proto
Original file line number Diff line number Diff line change
@@ -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;
}
40 changes: 40 additions & 0 deletions src/t2iapi/biceps/metadata.proto
Original file line number Diff line number Diff line change
@@ -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;
}
10 changes: 10 additions & 0 deletions src/t2iapi/context/context_requests.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
11 changes: 11 additions & 0 deletions src/t2iapi/context/context_responses.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
20 changes: 20 additions & 0 deletions src/t2iapi/context/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
21 changes: 15 additions & 6 deletions src/t2iapi/device/device_responses.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -18,22 +19,30 @@ option java_outer_classname = "DeviceResponses";
Response which contains all descriptor handles that can be removed and reinserted into the MDIB of the device.
*/
message GetRemovableDescriptorsResponse {
BasicResponse status = 1;
repeated string handle = 2; // list of descriptor handles which can be removed and inserted
BasicResponse status = 1;
repeated string handle = 2; // list of descriptor handles which can be removed and inserted
}

/*
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
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
}

/*
Response containing the software version of the requested pm:AbstractDeviceComponentDescriptor handle when supported.
*/
message GetComponentSwVersionResponse {
BasicResponse status = 1; // status of the rpc
string software_version = 2; // Software version of the requested device component
BasicResponse status = 1; // status of the rpc
string software_version = 2; // Software version of the requested device component
}
8 changes: 8 additions & 0 deletions src/t2iapi/device/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ 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);

/*
Get the software version of the requested pm:AbstractDeviceComponentDescriptor handle if it is representing
a component with a software version.
Expand Down

0 comments on commit db6cb8c

Please sign in to comment.