iNTERFACEWARE Products Manual > Learning Center > Tutorials and Sample Scenarios > Routing and Processing Messages > Data Validation > Solution One: Using Python |
|
Looking for Iguana v.5 or v.6? Learn More or see the Help Center.
Chameleon allows you to execute SQL queries against your database from any Python code inside your VMD file.
To solve the example problem outlined in the previous section, we can record the value of our MRN number in a global Python variable called MRN by using the Python Inbound Script for PID field two: Then, we only need to add a Python validation rule to our PID segment's Patient Internal ID field (field three). Once inside the validation rule dialog, select Python Validation Rule from the list box and give the validation rule a useful name (such as ValidateIDs). Then, paste the following Python code into the text field of the validation rule dialog:
This code ensures that the MRN and PRK numbers match. |