Leave a comment at the end of this page or email contact@krishagni.com
Data Validations(Edit Check)
Data validation is used to enter high-quality data. This ensures that the user does not violate any data entry rules while entering the data.
Data validation can be defined either at the system or CP levels. The data validations defined at the CP level take precedence over the system-level data validations.
Edit Check is a paid plugin; please get in touch with support@krishagni.com for further details.
What is Data Validation or Edit Check?
Data Validation is a series of constraints designed to check the validity of the input data.
Constraints can be made of variables of a single record or multiple records.
Data Validation is designed to ensure high-quality specimen data is collected.
Edit Check supported for below List of modules and level
Participant Fields, Custom Form, and Custom Fields
Visit Fields, Custom Form, and Custom Fields
Specimen Fields, Events, Custom Forms, and Custom Fields
Shipment
Order
How to define data validation?
Data validation has two attributes - records and rules
records - whenever any of the specified records are modified, the constraint rules should be evaluated/enforced
rules - a list of integrity rules that should be satisfied by the records.
A rule is made up of three attributes when, expr, and description.
When: The attribute 'when' is optional and specifies when the rule is applicable? For example, the rule is applicable only for primary specimens.
expr: The attribute 'expr' specifies the check constraint that should be satisfied.
description: The attribute 'description' describes the constraint in user-friendly language. This is also used in error messages when the rule is broken or not satisfied.
The aliases available in the rules are - “cpr, visit, primary Specimen, specimen”.
Example JSON
Visit date should be same or later than the registration date
The specimen collection date should be the same or later than the registration date
Specimen should be stored at room temperature
Specimen anatomic site should be Liver
{
"name" : "editChecks",
"data" : {
"constraints" : [
{
"records" : [ "cpr", "visit" ],
"rules" : [
{
"expr" : "#cpr.registrationDate != null && #visit.visitDate != null && !#cpr.registrationDate.after(#visit.visitDate)",
"description" : "Visit date should be same or later than the registration date!"
}
]
},
{
"records" : [ "cpr", "primarySpecimen" ],
"rules" : [
{
"when" : "#specimen.status == 'Collected'",
"expr" : "!#cpr.registrationDate.after(#specimen.collectionEvent.time)",
"description" : "The specimen #specimen.label (#specimen.type) collection date should be same or later than the registration date!"
},
{
"when" : "#specimen.status == 'Collected'",
"expr" : "#cpr.participant.gender != 'Male Gender' || #specimen.extensionDetail?.getAttrsMap()?.get('DD6') == 'Room Temperature'",
"description" : "Specimen #specimen.label should be stored at room temperature!"
}
]
},
{
"records" : [ "visit", "primarySpecimen" ],
"rules" : [
{
"when" : "#primarySpecimen.status == 'Collected'",
"expr" : "!#containsAny(#visit.clinicalDiagnoses, {'Liver regeneration (disorder)', 'Liver cell adenoma'}) || #primarySpecimen.anatomicSite == 'Liver'",
"description" : "Specimen #specimen.label anatomic site should be Liver"
}
]
}
]
}
}
|
---|
Attribute types and examples
Attribute Type | Description | Example JSON |
---|---|---|
DropDown |
| {
"records" : [ "cpr" ],
"rules" : [
{
"expr" : "#cpr.participant.gender != null && !#containsAny(#cpr.participant.gender, {'Female', 'Unknown', 'Undifferentiated'})",
"description" : "Only Male patient should be register"
}
]
},
{
"records" : [ "cpr" ],
"rules" : [
{
"when" : "#containsAny(#cpr.participant.races, {'White', 'Asian'})",
"expr" : "#containsAny(#cpr.participant.ethnicities, {'American'})",
"description" : "For White/Asian races, Ethnicity should be American"
}
]
}, |
Dropdown and Muliselect |
|
|
Calculated Field (Age) | Participant age at the time of registration should be more than 18 years | |
DropDown Custom Field | If the patient is ‘Dead’, enter the values for the 'Diagnosed With' field from the dropdown. |
|
DropDown Multiselect (Custom Field) | If the patient is 'Alive', enter the values for the 'City lived In field from the dropdown. | |
Fancy Control-User | If the user (Surgeon) is 'Krishna W' then the user needs to provide the death cause value (Custom Field) for the patient. |
Participant page examples
Attribute Type | Description | Example JSON |
---|---|---|
Text | Patient first name, last name should not be null. | |
Text | Allow only capital letters in the field first name | |
Text Custom Field | If the patient is ‘Dead’ then, specify the value ‘Cause of death.’ | |
Custom Form Field | In the ‘Smoking History Form’ attached at the ‘Participant Forms’ level, if the value of ‘Have you ever smoked’ is ‘Yes’, the error ‘Smokers not allowed!’ should be thrown. |
|
Custom Form Field | ‘Male’ participants with the value of ‘Have you ever smoked?’ as ‘Yes’ are not allowed. Error ‘Male smokers not allowed!’ should be thrown. |
|
Custom form Date Field | ‘Date of participant signed' is a date type custom field. The date is valid if Valid Date = (Date signed ≤ Today’s Date) otherwise invalid |
Visit page examples
Attribute Type | Description | Example JSON |
---|---|---|
Dropdown | Clinical diagnosis should be one of | |
Dropdown custom field | If the clinical diagnosis is one of | |
Date | Participant/Visit fields: "Visit date should be the same or later than the registration date!" | |
Dropdown (Core fields) | If ‘Clinical Diagnoses’ is one of List a then acceptable ‘Anatomic Site’ values will be among List b. |
|
Dropdown (Custom Form fields) | If the ‘Tumor Site/Anatomic site’ value from the custom form is ‘Extrahepatic bile duct', 'Intrahepatic bile duct', 'Liver', then the allowed values for the 'Tumor Morphology Diagnosis’ field from the custom form will be '10 weeks gestation of pregnancy', '11 weeks gestation of pregnancy', '12 weeks gestation of pregnancy, '13 weeks gestation of pregnancy, '14 weeks gestation of pregnancy' |
|
Dropdown (Core and Custom Form) | If the 'Primary Site' values (Custom Form) are 'Extrahepatic bile duct', 'Intrahepatic bile duct', 'Liver', the allowed value for Clinical Diagnosis (Core) should be in {'10 weeks gestation of pregnancy', '11 weeks gestation of pregnancy', '12 weeks gestation of pregnancy', '13 weeks gestation of pregnancy', '14 weeks gestation of pregnancy'} |
|
Dropdown (Core and Custom Form) | If the diagnosis field from the visit level form contains values from the below List, then the allowed value for Clinical Diagnosis (Core) should be ' List: ‘8006/2 Observation for suspected malignant neoplasm’, '8009/1 Non-malignant diagnosis, no history of cancer (Other Medical Care)'. Why is RegEx used in the edit check? Providing these long multi-choice values in the edit check is not flexible, so RegEx checks for the statement and matches the values. |
|
Primary specimen page examples
Attribute Type | Description | Example JSON |
---|---|---|
Date | Registration Date vs. Collection Date The specimen collection date should be the same or later than the registration date. | |
Dropdown custom | The anatomic site should be Brain NOS OR Abdomen NOS for tissue samples | |
Dropdown core | If the participant gender is ‘Male’, then the anatomic site cannot include 'Female genital tract, NOS', 'Overlapping lesion of female genital organs', 'Other specified parts of female genital organs', 'Breast, NOS' |
|
Date field (core) | Specimen data should be the same or later than the Visit date! (Visit date allows only ‘Date' whereas Specimen collection date allows 'Date and time data entry. In this Edit check, similar date format is provided for both the date fields.) |
|
Shipment page examples
Attribute Type | Description | Example JSON |
---|---|---|
Shipment Shipped Date | Shipment Shipped date should be lesser than current date/time | |
Received Date | Shipment received date should be lesser than current date/time | |
Shipment Shipped Date Vs. Specimen Collection Date | Shipment Shipped date should be greater than the specimen collection date
| |
Shipment Received Date Vs. Specimen Collection Date | Shipment received date should be greater than the specimen collection date | |
Shipment shipped Date Vs. Specimen Collection Date | Shipment shipped date should be greater than the specimen collection date, where the collection is date considered as one day earlier than actual. Passing condition: Shipped date:07-02-2023 00:00 Collection date:07-02-2023 22:14 Failed condition: Shipped date:07-02-2023 00:00 Collection date:08-02-2023 02.14 | |
Shipment shipped Date Vs. Specimen Collection Date | Shipment shipped date should be greater than the specimen collection date on specimen event page edit. The regular expression of comparing shipped Vs collection date doesn’t work on Specimen Event page. To ensure the check validate on ‘Editing' the ‘Collection Event date and time’ this expression is used. | |
Shipment shipped Date Vs. Specimen Collection Date | The Shipment shipped date can be lesser than specimen collection date by 24 hours, not more than that. Passing condition: Shipped date:06-02-2023 20:00 Collection date:07-02-2023 18:14 Failed condition: Shipped date:06-02-2023 20:00 Collection date:08-02-2023 22.14 |
|
Shipment shipped Date Vs. Specimen Collection Date | This expression only compares both shipped date Vs Collection Date and ignore the time attached to both fields. |
Order page examples
Attribute Type | Description | Example JSON |
---|---|---|
Distribution date | Order date should be lesser than current date/time | |
Distribution date Vs. Collection Date | Order date should be greater than the specimen collection date |
Field Dictionary
Leave a comment at the end of this page or email contact@krishagni.com