dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #05155
Re: About Regex-Validation blueprint
Hi again,
If you want, you can download a copy of DHIS 1.4 from hispkerala.org and
take a look at the DataIntegrityCheck table. For instance, the rule
"OrgUnit Group Set Exclusive Violation"
is defined as
SELECT OrgUnit.OrgUnitName AS OrgUnit, OrgUnitGroupSet.OrgUnitGroupSetName
AS GroupSet, Count(OrgUnitGroupSet.OrgUnitGroupSetID) AS [Group Set
Allocations]
FROM OrgUnit INNER JOIN (OrgUnitGroupSet INNER JOIN (OrgUnitGroupSetMember
INNER JOIN OrgUnitGroupMember ON OrgUnitGroupSetMember.OrgUnitGroupID =
OrgUnitGroupMember.OrgUnitGroupID) ON OrgUnitGroupSet.OrgUnitGroupSetID =
OrgUnitGroupSetMember.OrgUnitGroupSetID) ON OrgUnit.OrgUnitID =
OrgUnitGroupMember.OrgUnitID
WHERE OrgUnitGroupSet.OrgUnitGroupSetExclusive=1 AND
OrgUnitGroupMember.Active = 1
GROUP BY OrgUnit.OrgUnitName, OrgUnitGroupSet.OrgUnitGroupSetName
HAVING Count(OrgUnitGroupSet.OrgUnitGroupSetID)>1
ORDER BY OrgUnit.OrgUnitName;
The data integrity check functionality in 1.4 is essentially exactly the
same as DHIS2, execept it is possible to extend the data integrity checks by
adding new SQL statements in the 1.4 database. I would really like this see
this feature in 2.0, as right now, all of the rules have been "hard-coded"
in Java, and are not extendible, except by modification of the source code
(Lars correct me if I am wrong). I expect that we could do it the 1.4 way,
by using ANSI compatible queries that would work across Postgres, MySQL and
H2. Anyway, that is another blueprint I think.
Regards,
Jason
On Mon, Mar 29, 2010 at 9:33 AM, Hieu Dang Duy
<hieu.hispvietnam@xxxxxxxxx>wrote:
>
> Yes, I understood now. Really thanks for your enthusiasm in explaining.
> However, I have never seen or used DHIS1.4. But is that "Data integrity
> checks" functionality in DHIS1.4 which is the same of "Data integrity" in
> DHIS2.0 ?
>
> On Mon, Mar 29, 2010 at 1:45 PM, Jason Pickering <
> jason.p.pickering@xxxxxxxxx> wrote:
>
>> OK, let me try and explain. Remember, I think in terms of databases, you
>> think in terms of Java, so I think we are getting tripped up on the
>> vocabulary. :)
>>
>> Basically, what I mean by "field level validation" is the ability to check
>> an individual field in a database table/object. So, in the example that I
>> have been using, organisationunit is the table, and "name" is the field to
>> be checked with. I guess in Java terms this would correspond to an object
>> and a property.
>>
>> So, again, I have been envisioning this functioning as a field/property
>> level validation function, similar to the data integrity checks. If you look
>> at DHIS 1.4, there are data integrity checks stored as SQL statements in the
>> database, which allows flexible definition of data integrity rules. What I
>> am envisioning is similar to this functionality, but allowing users the
>> ability to define a regular expression and then a field/property to match it
>> against.
>>
>> Hope this makes this more clear?
>>
>>
>> Regards,
>> Jason
>>
>> --
>> Jason P. Pickering
>> email: jason.p.pickering@xxxxxxxxx
>> tel:+260968395190
>>
>
>
>
> --
> Hieu.HISPVietnam
> Good Health !
>
--
--
Jason P. Pickering
email: jason.p.pickering@xxxxxxxxx
tel:+260968395190
Follow ups
References