Got feedback or spotted a mistake?

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?

  1. Data Validation is a series of constraints designed to check the validity of the input data.

  2. Constraints can be made of variables of a single record or multiple records.

  3. 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

  1. records - whenever any of the specified records are modified, the constraint rules should be evaluated/enforced

  2. 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

  1. Visit date should be same or later than the registration date

  2. The specimen collection date should be the same or later than the registration date

  3. Specimen should be stored at room temperature

  4. 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" } ] } ] } }

 

{ "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

Attribute Type

Description

Example JSON

DropDown

  1. Only male participant registrations are allowed

  2. If Race is one (White or Asian), then Ethnicity should be 'American.'

{ "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

  1. If Registration Site='MCRI Repository', then Race values is one of 'White' or 'Asian'

  2. If the patient is ‘Alive’ then Ethnicity should be ‘African’ or 'American'

 

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

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

Attribute Type

Description

Example JSON

Dropdown

Clinical diagnosis should be one of 'Cholera', 'Liver cell carcinoma'

Dropdown custom field

If the clinical diagnosis is one of 'Cholera', 'Liver cell carcinoma', then the Diagnosis subtype ID 'Negative'

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.
List a: '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
List b: Extrahepatic bile duct Intrahepatic bile duct Liver

 

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 'Non-malignant'.

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

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

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

Core Fields Dictionary for Participants, Visits, and Specimens.

Level

Field Name

Field Expression

Level

Field Name

Field Expression

Participant

PPID

Participant

First Name

Participant

Middle Name

Participant

Last Name

Participant

Registration Date

Participant

External Subject ID

Participant

Registration Site

Participant

Birth Date

Participant

Social Security Number

Participant

eMPI

Participant

Gender

Participant

Vital Status

Participant

Death Date

Participant

Races

Participant

Ethnicity

Participant

MRN

Visit

Name

Visit

Name

Visit

Status

Visit

Missed By

Visit

Missed Reason

Visit

Visit Date

Visit

Visit Site

Visit

Clinical Diagnosis

Visit

Clinical Status

Visit

SPR

Visit

Visit Comments

Specimen

Label

Specimen

Barcode

Specimen

Lineage

Specimen

Collection Status

Specimen

Type

Specimen

Anatomic Site

Specimen

Laterality

Specimen

Pathology Status

Specimen

Initial Qty

Specimen

Available Qty

Specimen

Concentration

Specimen

Parent Specimen Label

Specimen

Biohazard

Specimen

Location

Specimen

Created On

Specimen

Freezer Thaw Cycle

Specimen

Increment Freeze Thaw Cycle

Specimen

Comments

Specimen

Collection Date

Specimen

Collector

Specimen

Received Date

Specimen

Receiver

Specimen

Collection Container

Specimen

Collection Procedure

Specimen

Received Quality

Specimen

Frozen Time

Specimen

Frozen Method

Specimen

Frozen Comments

Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com