The main goal of TwikFit is to streamline the creation and manufacturing of unique files. An indispensable feature here is the ability to place unique codes on the generated files.

The platform allows for individual and unique ID identifiers to be physically added to each part. This ID is imprinted into the orthoses. In turn, the unique identifier can be used to track a product throughout production, provide origin information, or assist in the logistics for manufacturing. 

Defining your own unique code

Since every organization and product template has its own needs regarding the content and length of the unique ID, a flexible format is available.

The Chunk Format

Each chunk has a type, defining what is being generated. Currently, there are 5 types of chunks:

  • Constant

  • Property

  • Parameter

  • Auto increment

  • Date

Constant
{
	"type": "Constant",
	"value": <constant-value-string>,
}
CODE

This is the simplest chunk. Apart from the type, which is set to ‘Constant’, it defines a value which is literally used as the generated part in the UID.

Property
{
	"type": "Property",
	"target": "Session" | "Product" | "Client",
	"lookup": <path-string>,
	"default": <default-value-string>
}
CODE

A Property chunk will result in a lookup for a certain property in a certain target. Currently, the target can either be ‘Product’ (the current product), ‘Session’ (the web session in which the product is used), or ‘Client’ (the current client). The lookup defines the (dot-separated) path of the property to find.

If the property is not found, the (optional) default value is used. If this default is not present, the generation will result in an error.

Parameter
{
	"type": "Parameter",
	"matchLines": [
		{
			"match": {
				<parameter-string>: <value-regex-string>,
				...
			},
			"result": <result-string>
		},
		...
	]
}
CODE

A Parameter chunk results in a matching of a certain combination of parameters. Match lines define a list of ‘maches’, each representing a specific combination of parameters. If the first matching combination is found in the current export’s list of parameters, the associated result represents the value for the current chunk.

the values are assumed to be regexes. Special characters may have to be escaped by (double!) “\\”. These are: '.', '*', '+', '-', '?', '^', '$', '{', '}', '(', ')', '|', '[', ']'

AutoIncrement
{
	"type": "AutoIncrement",
	"width": <with-number>
	"start": <optional-starting-number>
}
CODE

The AutoIncrement chunk is basically a place-holder for an auto-incremented value in the uid.

This means, if the generated uid in its whole is already used previously, the value at the current place of the newest found uid is incremented by one and used instead.

The width is the maximum number of characters that are added to the uid (starting from the right). If the length of the result is smaller, it is padded at the left with 0’s. For example, if the width is 3, the first 99 numbers are 001, 002, 003,…

The optional start specifies the number where the autoincrement must start counting (and hence will be the number used when no uid’s of the like are used yet).

Date
{
	"type": "Date",
	"format": <date-format-string>
}
CODE

The Date chunk results in a value generated form the current (export) date and time.

The format specifies how the date and time should be represented. See https://angular.io/api/common/DatePipe on how to create date format strings.

To minimize the dependencies on angular, the DatePipe will not be used anymore in the near future. This may have the effect that the formatting of the date might change.

Examples

"uidFormat": {
	"unique_id_key": "5689-uid-1-id",
	"chunks": [
		{
			"type": "Property",
			"target": "Client",
			"lookup": "customClientFields.initials.value",
			"default": "XX"
		},
		{
			"type": "Parameter",
			"matchLines": [
				{
					"match": {
						"2540-helm-design": "Sport"
					},
					"result": "101"
				},
				{
					"match": {
						"2540-helm-design": "Elegant"
					},
					"result": "102"
				},
				{
					"match": {
						"2540-helm-design": "Open"
					},
					"result": "103"
				}
			]
		},
		{
			"type": "Parameter",
			"matchLines": [
				{
					"match": {
						"54-helm-type": "P50-"
					},
					"result": "0"
				},
				{
					"match": {
						"54-helm-type": "P50\\+"
					},
					"result": "2"
				}
			]
		},
		{
			"type": "Parameter",
			"matchLines": [
				{
					"match": {
						"17-front-bumper-onoff": "Off",
						"18--rear-bumper-onoff": "Off",
						"19-ear-covers-onoff": "Off"
					},
					"result": "0"
				},
				{
					"match": {
						"17-front-bumper-onoff": "On",
						"18--rear-bumper-onoff": "Off",
						"19-ear-covers-onoff": "Off"
					},
					"result": "1"
				},
				{
					"match": {
						"17-front-bumper-onoff": "On",
						"18--rear-bumper-onoff": "On",
						"19-ear-covers-onoff": "Off"
					},
					"result": "2"
				},
				{
					"match": {
						"17-front-bumper-onoff": "On",
						"18--rear-bumper-onoff": "On",
						"19-ear-covers-onoff": "On"
					},
					"result": "3"
				},
				{
					"match": {
						"17-front-bumper-onoff": "On",
						"18--rear-bumper-onoff": "Off",
						"19-ear-covers-onoff": "On"
					},
					"result": "4"
				},
				{
					"match": {
						"17-front-bumper-onoff": "Off",
						"18--rear-bumper-onoff": "On",
						"19-ear-covers-onoff": "Off"
					},
					"result": "5"
				},
				{
					"match": {
						"17-front-bumper-onoff": "Off",
						"18--rear-bumper-onoff": "On",
						"19-ear-covers-onoff": "On"
					},
					"result": "6"
				},
				{
					"match": {
						"17-front-bumper-onoff": "Off",
						"18--rear-bumper-onoff": "Off",
						"19-ear-covers-onoff": "On"
					},
					"result": "7"
				}
			]
		},
		{
			"type": "Date",
			"format": "yyMM"
		},
		{
			"type": "AutoIncrement",
			"width": 1
		}
    }
}
CODE

Regulatory requirements

The medical device regulation (MDR) describes that each medical device needs to get a unique device identifier (UDI) assigned to it. TwikFit is compliant with this regulation.

https://ec.europa.eu/health/sites/default/files/md_topics-interest/docs/md_faq_udi_en.pdf