Modeling Entity Classes and Types
In this section
This section will help you:
Understand the relationship between Entity Class, Entity Type, and Entity
Understand the relationship between Product and Batch
Understand design considerations and best practices for modeling Entities in L7|ESP
Know how to create new Entity Classes and Entity Types
Key Terms
Term | Definition |
Entity | A resource that is submitted to or a component of a business process. Entities are instances, or occurrences, of Entity Types. |
Entity Type | Defines the attributes of an Entity, including its custom fields and ID Sequence(s). |
Entity Class | A categorical way of grouping different Entity Types. Each Entity Class will receive its own app in L7|ESP, useful for managing User access. |
Custom Fields | Entity data defined at the level of the Entity Type. |
Var Groups | Organize custom fields into tabs on the Entity details page. |
Workgroups | Used to organize Users and restrict access to content. |
MES Products and Batches
In MES, the Recipe (Workflow Chain) represents the manufacturing process for a Product. The Batch is a child of the Product, and records the steps taken to create the Product.
L7|ESP has a core Entity Class and Entity Type for Products:
Entity Class - MESProduct
Entity Type - MES Product
However, Super Users can create their own Entity Types for Products, but they must be assigned to the MESProduct Entity Class and have at least two (2) custom fields:
Field Name | Field Type |
MES Process | Resource Link to a Workflow Chain. |
Product Name | Free-form text entry. |
Note
Batch Entity Types cannot be based on the MESProduct Entity Class.
A generic Batch Entity Type can be created for all Products, or Product-specific Batch Entity Types can be configured. There are no custom field requirements for Batch Entity Types, but these fields can be used to collect Batch level data like Kit assignments. This data is collected during Batch creation, not in the Batch Record itself.
Products are created in the Entities or MESProduct app, while Batches are created in the MES app. Recall that the Batch is a child of the Product, so the Product must be created first.
What does an Entity look like for an End User?
When an End User selects an Entity, they see:
The Entity’s metadata (Data tab)
Production data associated with the Entity (Process Data tab)
The Entity’s relationship to other Entities (Parents & Children tab)
The files the Entity is associated with (Attachments tab)
The Entity’s history (History tab)
How to Model Entities
Entities are at the center of all processes modeled in L7|ESP, and the reason L7|ESP is agnostic to any business process in the life sciences and healthcare.
When to create an Entity Class?
If more than one (1) Entity Type can be organized into the same category
If you want to restrict access to a category of Entities
When to create an Entity Type?
If you have a resource that you wish to register and track as part of a business process
Containers and Items have their own data models in L7|ESP
If two (2) Entities have different custom fields
More than one (1) ID Sequence can be assigned to the same Entity Type, assuming these different Entities share the same custom fields
Design Considerations:
When in the process will this Entity Type be created?
Is there any data that needs to be attributed to this Entity Type?
How will this data be collected?
Can a Sequence ID be attributed to this Entity Type?
If so, does this ID require any contextual data?
What contextual data is available for Sequence IDs?
Are there legacy Entities that need to be migrated into L7|ESP?
Does this Entity Type require a custom view?
Should this custom view be applied to all Entity Types in the assigned Class?
Note
Custom Entity views are covered in more detail here and in the Developer MasterClass.
How to Create Entity Classes
Go to: Builders (L7|Master) → Entity Classes → + New Entity Class
How to Create Entity Types
Go to: Builders (L7|Master) → Entity Types → + New Entity Type
Display Name and Entity Class are required fields
Note that the Entity Class must be created first in order to appear as an option
Note
Display Name vs. ID: Display Name is the name that appears in the user interface (UI). ID is a fixed value used to reference the resource. This differentiation ensures stability when changing the name of a resource (i.e., Entity).
L7|ESP will set the Display Name as the ID if the User does not define the ID themselves.
Entity Class: L7|ESP has four (4) core classes: MESProduct, Sample, Container, and Item. Containers in the Location app and Items in the Inventory app automatically belong to Class Container and Item, respectively.
Newly created Entity Types cannot be assigned to these two (2) Classes.
How to Add Custom Fields to Entity Types
Custom fields define the data model for an Entity Type. This data should be immutable properties of the Entity. To add a custom field, go to the Entity Type details page → + Add Custom Field
Var Group – organizes custom fields into tabs on the Entity details page
Type – field options include:
Type | Purpose |
Free-form text entry | Enter any character (both text and numbers allowed). |
Numbers only allowed | Enter any number. |
Picklist | Select one (1) or more options. |
Date/Time | Select a date and/or time in predefined or custom formats. |
Checkbox | Boolean true or false. |
Attachment | Attach a file. |
Barcode | Capture data as a barcode (1D, mini data matrix, or QR). NoteValue does not become the resource’s barcode. |
Resource Link | Link to another L7|ESP resource. If the Link Type is Entity Class, Container, Item, or Service Type, a multi-select picklist will appear to restrict to the selected:
|
Conditionally Required, Read only, Visible
These conditions can only be configured by referencing the value of another custom field associated with the same Entity Type using the entity_value
expression.
For example, Field 1 is a picklist with options: A, B, C, and D. Field 2 is only visible if the value of Field 1 is equal to C. This means that for Field 2, visible is conditional
using the expression:
{{ entity_value('Field 1') == 'C' }}
Note
Other comparison operators can also be used in addition to equal to.
Numeric Fields
Values for numeric fields are not formatted by default, but can be rendered as a percentage or currency.
Note
Percentages should be recorded as decimal values. L7|ESP will automatically convert 0.85 to 85% (no Unit of Measure required).
Note
Spec Type and Unit of Measure are only supported in Protocols.
The three-letter currency code dictates precision, whereas percentages and unformatted values can be displayed to a specified number of decimal places or significant figures.
Note
Precision only impacts the displayed value. The underlying value is not changed.
A minimum and maximum limit can be applied to all numeric fields, regardless of format. If a hard limit is exceeded, L7|ESP will automatically adjust the out-of-range value to the most recently saved in-range value. This includes null if no in-range value has been saved yet. An error message will also appear in the bottom-right corner of the screen.
If a soft limit is exceeded, the field will be colored orange and the error will be replaced with a warning. These errors and warnings are transient, but can be sent as a notification to one (1) or more Workgroups.
How to Manage Versions
Any changes you make to an Entity Type will be saved as a separate version with the option to migrate existing Entities of the same type to reflect the changes. Otherwise, the saved changes will only apply to newly created Entities.
Warning
Changes to Entity ID Sequences cannot be migrated to existing Entities.