You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
Version 1
Current »
Purpose
This WS is designed to allow employee with appropriate scopes to search device definitions.
Key points
This is a GraphQL query method used in Administration panel only.
Only authenticated and authorized employee with appropriate scope can search for device definitions.
User can filter list by search params.
Specification
index.graphql
"Reads and enables pagination through a set of `DeviceDefinition`."
deviceDefinitions(
"A condition to be used in determining which values should be returned by the collection."
filter: DeviceDefitinionFilter
"The method to use when ordering collection items."
orderBy: DeviceDefitinionOrderBy
"Read all values in the set after (below) this cursor."
after: String
"Read all values in the set before (above) this cursor."
before: String
"Only read the first _n_ values of the set."
first: Int
"Only read the last _n_ values of the set."
last: Int
): DeviceDefinitionConnection!
deviceDefinitions.graphql
"""
DeviceDefitinion filter.
"""
input DeviceDefitinionFilter {
"Primary key identifier from the database."
databaseId: UUID
"Device name."
deviceNames: DeviceDefinitionName
"is_active status."
isActive: Boolean
"A classification or risk class of the device model. The value should be present in the `device_classification_type` dictionary."
classificationType: String
"Name of device manufacturer."
manufacturerName: String
"The catalog or model number for the device for example as defined by the manufacturer."
modelNumber: String
}
"""
Methods to use when ordering `DeviceDefitinion`.
"""
enum DeviceDefitinionOrderBy {
"Sort by classification_type in ascending order."
CLASSIFICATION_TYPE_ASC
"Sort by classification_type in descending order."
CLASSIFICATION_TYPE_DESC
"Sort by inserted_at in ascending order."
INSERTED_AT_ASC
"Sort by inserted_at in descending order."
INSERTED_AT_DESC
"Sort by model_number in ascending order."
MODEL_NUMBER_ASC
"Sort by model_number in descending order."
MODEL_NUMBER_DESC
}
"""
A connection to a list of `DeviceDefinition` items.
"""
type DeviceDefinitionConnection {
"Information to aid in pagination."
pageInfo: PageInfo!
"A list of nodes."
nodes: [DeviceDefinition]
"A list of edges."
edges: [DeviceDefinitionEdge]
}
"""
An edge in a connection of `DeviceDefinition`.
"""
type DeviceDefinitionEdge {
"The item at the end of the edge."
node: DeviceDefinition!
"A cursor for use in pagination."
cursor: String!
}
"""
A component part of medication. User must have a scope **device_definition:read**
"""
type DeviceDefinition implements Node {
"The ID of an object."
id: ID!
"Primary key identifier from the database."
databaseId: UUID!
"Device identifier in external system."
externalId: String
"Device names."
deviceNames: [DeviceName]!
"A classification or risk class of the device model. The value should be present in the `device_classification_type` dictionary."
classificationType: String!
"Description of the device."
description: String
"Name of device manufacturer"
manufacturerName: String!
"Country of manufacture. The value should be present in the `COUNTRY` dictionary."
manufacturerCountry: String!
"The catalog or model number for the device for example as defined by the manufacturer."
modelNumber: String!
"The part number or catalog number of the device."
partNumber: String
"A code that defines the specific type of packaging. The value should be present in the `device_definition_packaging_type` dictionary."
packagingType: String!
"The number of items contained in the package."
packagingCount: Int!
"Unit of measurement. The value should be present in the `DEVICE_UNIT` dictionary."
packagingUnit: String!
"Device notes and comments."
note: String
"Array of device properties."
properties: [DeviceDefinitionProperty]
"Reference to parent device definition."
parentId: UUID
"is_active status."
isActive: Boolean!
"Date and time when record was inserted"
insertedAt: DateTime!
"Date and time when record was updated"
updatedAt: DateTime!
}
"""
A component part of DeviceDefinition.
"""
type DeviceName implements DeviceDefinition {
"Device name type. The value should be present in the `device_name_type` dictionary."
type: String!
"Device name."
name: String!
}
"""
A component part of DeviceDefinition.
"""
type DeviceDefinitionProperty implements DeviceDefinition {
"Device property type. The value should be present in the `device_properties` dictionary."
type: String!
"Device property value in integer format."
valueInteger: Int
"Device property value in string format."
valueString: String
"Device property value in boolean format."
valueBoolean: Boolean
"Device property value in decimal format."
valueDecimal: Float
}
Authorize
Verify the validity of access token
Verify that token is not expired
Check user scopes in order to perform this action (scope = 'device_definition:read')
Validate legal entity
Extract client_id from token.
Check legal entity status (status = ACTIVE)
Check client type (type = NHS)
Service logic
Get all records from device_definitions and device_definition_names tables in PRM database
Apply additional search params (connect by logical AND):
databaseId - search by device_definitions.id (using exact match with =
operator)
deviceNames.type - seach by device_definition_names.type (using exact match with =
operator )
deviceNames.name - device_definition_names.name (using like
match, case insensitive)
isActive - search by device_definitions.is_active (using exact match with =
operator)
classificationType - search by device_definitions.classification_type (using exact match with =
operator)
manufacturerName - search by device_definitions.manufacturer_name (using like
match, case insensitive)
modelNumber - search by device_definitions.model_number (using like
match, case insensitive)
Apply optional ordering
if no $.orderBy
is passed - order records by inserted_at
field in descending order.
Render a response according to specification