Restricting Codes and Code-like Names
Overview
Restrictions on Code Characters
Since % and _ characters are wildcards for search criteria, it is suggested that these are not used in codes or code-like names.
Code Character Case
Codes are saved as uppercase.
Code Uniqueness
Codes within parent entities must be unique across the organisation and laboratory. For example, if the scope is organisation-scope, two entities with the same code cannot be defined for the same organisation; if the scope is laboratory-scope, two entities with the same code cannot be defined for the same organisation nor laboratory. (The only exception to this is that lab-enabled schemes have the same scheme code as their org-scope counterpart.)
Codes within child entities must be unique within the parent entity.
The code uniqueness rule is implemented as follows:
- If an object is first created for the organisation, then an object of the same type with the same code cannot be created for any laboratory in that organisation.
- If an object is first created for the laboratory, then an object of the same type with the same code cannot be created for the organisation associated with the laboratory.
- If object is first created for the laboratory, then an object of the same type with the same code can be created by other laboratories in that organisation.
Process
Validating Scheme and Analyte Codes
If the CODEVALIDATION_CHARACTERLIST_01 application preference is defined and contains a list of visible ASCII characters, then a scheme code must only contain characters from this list. If this preference is not defined, then a scheme code must only contain characters from the ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 string. The Scope for this preference is usually set at laboratory level.
If the CODEVALIDATION_CHARACTERLIST_01 application preference is defined and contains a list of visible ASCII characters, then an analyte code must only contain characters from this list. If this preference is not defined, then an analyte code must only contain characters from the ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 string. The Scope for this preference is usually set at laboratory level.
Set the CODEVALIDATION_CHARACTERLIST_01 preference
Validating Unit Codes
If the CODEVALIDATION_CHARACTERLIST_02 application preference is defined and contains a list of visible ASCII characters, then a unit code must only contain characters from this list. If this preference is not defined, then a unit code must only contain characters from the ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 string. The Scope for this preference is usually set at laboratory level.
Set the CODEVALIDATION_CHARACTERLIST_02 preference
Validating other Configuration Data Codes
If the CODEVALIDATION_CHARACTERLIST_03 application preference is defined and contains a list of visible ASCII characters, then the code of an entity that is not a scheme, analyte, unit, biofield, job or sample must only contain characters from this list. If this preference is not defined, then the code of an entity that is not a scheme, analyte, unit, biofield, job or sample must only contain characters from ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789. The Scope for this preference is usually set at laboratory level.
Set the CODEVALIDATION_CHARACTERLIST_03 preference
Validating Biofield Codes
A biofield code can contain letters, digits and underscores only. Also, where the biofield is for use on a search screen, then the biofield code must not start with a digit nor contain a hyphen. Searching uses the Java infrastructure's custom attribute searching capability, and in the Java infrastructure space, a hyphen is a special character used in identifying name spaces, so using a hyphen in a biofield code interferes with name space identification, resulting in an incorrect biofield code being sent to the search.
Validating Job Codes
Where the CODEVALIDATION_JOBCODE application preference is defined and contains a list of visible ASCII characters, then a valid job code only contains characters from this list. If this preference is not defined, then a valid job code only contains characters from the ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 character set. The Scope for this preference is usually set at laboratory level.
The laboratory/subcontract batch job's Job Code is generated by the syntax that is in scope and has a Syntax Type of Batch Code Syntax and a Syntax Code of BATCH_CODE_SYNTAX. If this syntax is not found, an error is returned. The syntax must produce a laboratory/subcontract batch job's Job Code that is unique within the organisation and contain valid characters. If the CODEVALIDATION_JOBCODE application preference is defined and contains a list of visible ASCII characters, then the Job Code must only contain characters from this list. If this preference is not defined, then the Job Code must only contain characters from ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789. The Scope for this preference is usually set at laboratory level.
Set the CODEVALIDATION_JOBCODE preference
Validating Job Names
Where the CODEVALIDATION_JOBNAME application preference is defined and contains a list of visible ASCII characters, then a valid job name only contains characters from this list. if this preference is not defined, then a valid job name only contains characters from the ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 character set. The Scope for this preference is usually set at laboratory level.
The laboratory batch job's Job Name defaults to the value set in the DEFAULT_BATCH_NAME_SYNTAX application preference. If the CODEVALIDATION_JOBNAME application preference is defined and contains a list of visible ASCII characters, then the laboratory batch job's Job Name must only contain characters from this list. If this preference is not defined, then the laboratory batch job's Job Name must only contain characters from ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789. The Scope for this preference is usually set at laboratory level.
Set the CODEVALIDATION_JOBNAME preference
Validating Sample Codes
A Sample Code is generated by the syntax that is in scope and has a Syntax Type of Other and a Syntax Code of SAMPLE_CODE_SYNTAX. If this syntax is not found, an error is returned. The syntax must produce a Sample Code that is unique within the organisation and contain valid characters.
If the CODEVALIDATION_SAMPLECODE application preference is defined and contains a list of visible ASCII characters, then the Sample Code must only contain characters from this list. If this preference is not defined, then the Sample Code must only contain characters from ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789. The Scope for this preference is usually set at laboratory level.
Set the CODEVALIDATION_SAMPLECODE preference
Validating Sample Names
The Sample Name is generated by the syntax that is in scope and has a Syntax Type of Sample and a Syntax Code of SAMPLE_NAME_SYNTAX. If this syntax is not found, an error is returned. The syntax must produce a Sample Name that is unique within the job and contain valid characters.
If the CODEVALIDATION_SAMPLENAME application preference is defined and contains a list of visible ASCII characters, then the Sample Name must only contain characters from this list. If this preference is not defined, then the Sample Name must only contain characters from ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789.
A common configuration is for the sample name to be generated by a concatenation of the Job Name + "." + a running sequence of numbers (001 onwards).
Set the CODEVALIDATION_SAMPLENAME preference
- Working with Scope and Codes
- Using the Screen Interface
- Maintaining Syntaxes
- Maintaining Container Syntaxes
- Maintaining Client and Client Contact Syntaxes
- Maintaining Job Syntaxes
- Maintaining Sample Syntaxes
- Maintaining Report Syntaxes
- Maintaining Instrument Syntaxes
- Maintaining Invoice Syntaxes and Laboratory-based Numbering Patterns
- Maintaining Organisations
- Maintaining Laboratories
- Maintaining Application Preferences
