Using regular expressions (Regex), you can enforce specific formatting rules when configuring patient fields. This helps maintain consistency by automatically rejecting invalid input that does not match the defined pattern.
What is a Regular Expression (Regex)?
A regular expression (regex) is a sequence of characters that defines a search pattern. It allows you to specify rules for entering data and ensures uniformity across patient records.
For example:
A regex for a government ID might require exactly 10 digits:
`^\d{10}$`
A regex for a Medical Record Number (MRN) could enforce a standard format:
^[A-Za-z0-9\-]{6,12}$
How to Set Up Regex Validation
To configure regex validation, you must have access to Patients > Data Management. This requires either "company_write" permissions or an Admin/Owner role.
Steps to Enable Regex Validation:
Go to Patients > Data Management.
2. Choose an existing field to edit or create a new field where validation is needed.
3. In the field settings modal, locate and enable "Validate using regular expression (regex)".
4. Enter the regex pattern that defines the required input format.
5. Click on Save or Update to apply the validation.
What Happens if Input Does Not Match?
If users enter data that does not conform to the specified regex pattern, they will receive an error message and must correct their input before proceeding.
Using regex validation ensures cleaner, standardized patient data, reducing record errors and inconsistencies. If you're unfamiliar with regex, you can consult a regex reference guide or seek assistance from your technical team.