We hope you'll join us for our 4/23 webinar on using data tables to apply reference ranges and AE codes in OC4. For more information and to register, visit https://register.gotowebinar.com/register/2882170018956684555

Validation Cleanup

It has been a while since I’ve looked at the validation code… so bear with me.

If I remember correctly, I thought the validation code was great. Oh, wait, I see where you are going with that. It would be nice to make it easier to add new types of validation.

I think that _most_ validation can be achieved using regex for strings and some sort of calculation engine for numerical/dates. The only other case I can think of is the one where someone wants to check a value against an outside source (i.e. see if a file exists or if a username is already in use within the system.) That is the case that would require subclasses.

I’m about out of time, but would it make sense to have an abstract Validation base class, a RegexValidation subclass to take care of most of the textual validations, a CalcuatingValidation to check numerical values, then the ability for users to create their own types of Validations?

This would require a factory to create the current set of validations… for example, ValidationFactory.getValidation(IS_A_PHONE_NUMBER) which would create an instance of the regexValidation with the correct regex for phone numbers… when a user creates their own validation, they’d simply register it with the factory, then it could be used anywhere within the code.

What do you think?



The materials in this e-mail are private and may contain Protected Health Information. If you are not the intended recipient be advised that any unauthorized use, disclosure, copying, distribution or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone at 314-747-8162 or by return e-mail.
Sent: Friday, January 20, 2006 10:59 AM
To: [email protected]
Subject: RE: [Developers] first post.

Hi Jordan and Shai,

You both raise very good points about incorporating frameworks into the OpenClinica code. Jordan, some of us had also previously been discussing the idea of using Struts Action to take over for our control servlets, do you have any experience with either Struts package (Action or Shale) and how they stack up against Spring? What are some of the tradeoffs?

Shai, you raise a good point about the business logic layer--we had discussed getting Drools to help us with that a little and I had put some stubs of code for a small business-logic class in the code base, they should still be there under org.akaza.openclinica.logic.core.

Jordan, the regular expression code is in the 1.0 release, and I would certainly like to hear more about the external hooks you were able to put into the system. What application did you use to package them up? Were there issues with security and user validation?

Cheers,
Tom

Tom Hickerson
Senior Project Coordinator
Akaza Research
One Kendall Square, Bldg 400, Fourth Floor
Cambridge, MA 02139
p 617.621.8585 x15
f 617.621.0065
"Open informatics for public research"
http://www.akazaresearch.com/
Sent: Friday, January 20, 2006 10:55 AM
To: Woerndle,Jordan; [email protected]
Subject: RE: [Developers] first post.
Hi Jordan,

Thanks for your email. Certainly a lot of good ideas in here.

Porting OpenClinica to Hibernate is certainly a good idea, and I hope to look into that in the near future. From a code infrastructure point of view, what other ideas do you have on improving the code base? For example, another priority for me is to clean up the Validation class and define a clean interface so that developers can create new validation types by subclassing an abstract ValidationType class (or something like that.) The current class started out as a much more lightweight piece of code, but I think an overhaul is in order.

Another priority is developing a business rules layer separate from the servlet/form processing layer. Right now there are a lot of business rules running around the application - for example, you can't perform double data entry on a CRF unless a) you did not perform the first round of data entry or b) more than 12 hours have passed since you completed the first round of data entry. This is a good rule, but it's hard to find in the code. It would be nice to put such rules in small, easy to find (and change, if the mood strikes you) classes. We did some research on business rules engines a while back, and at some point I'd like to dust that off and see if we can't work it into the code base.

Any other thoughts?

Shai Sachs
Director of Research and Development
Isovera.com
One Kendall Square, Building 400
Cambridge, MA 02139
office: 617-621-8555 x 12
mobile: 617-833-3648
http://www.isovera.com
Sent: Thursday, January 19, 2006 4:56 PM
To: [email protected]
Subject: [Developers] first post.
Hi there,

I’m glad to see the developer’s mailing list up and running. Tom asked me to start a thread on how I integrated beanshell to support scriptable actions on individual items. I’d be happy to explain if anyone is interested. In fact, let me know if you’re interested in my implementation of:

Regular expression data entry validation (is that included in the 1.0 release?)

BeanShell scripting for data entry validation (ranges, data types, calls to external sources.. pretty much anything you can think of.)

External hooks to create subjects and events in response to external events. I built a client app that packages data and ships it to our server. OpenClinica can pick the data up and create/populate new events. It will also notify people that new events are ready for review.

As a side note, does anyone want to port openclinica to use spring/hibernate/acegi? Why? Well, I couldn’t bend OpenClinica to do something we needed so I spent the last month building something from scratch. I built similar features into my new app with about 530k of source code (including jsp’s) and configuration. My last count of open clinica source is 4 MB and about 2MB of jsp’s.

Jordan


The materials in this e-mail are private and may contain Protected Health Information. If you are not the intended recipient be advised that any unauthorized use, disclosure, copying, distribution or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone at 314-747-8162 or by return e-mail.
This discussion has been closed.