Andrew Goodchild wrote:

> Hi,
>
> Does anyone know what it actually means to specialize an archetype? 
> And what the rules are?
>
> I looked at the archetype editor and created a specialized archetype 
> of another. The editor seemed to just copy the parent archetype and 
> then allowed the user to change anything about the archetype.
>
> For example, I can now make a mandatory field optional, or I can 
> extend a parent archetype with new mandatory fields that don?t exist 
> as optional fields in the parent archetype
>
> To me this particular example is not safe as one of the basic rules of 
> specializing archetypes is you should be able to validate any new 
> specialized EHR data against the parent archetype.
>
At the moment I would not read anything into the specialisation facility 
in the editor; it isn't implemented yet.

The specialisation rules are, informally, that the constraint 
represented by the cADL section of an archetype must be wholly contained 
within that of a parent. The constraint structure of an archetype is a 
kind of nested set specification structure, or alternatively a nested 
query specification structure. So specialisation means that the 
specialised archetype's constraint structure must be, on a node-by-node 
basis, "inside" the constraint structure of the parent. This is fairly 
easily implementable with a function:
is_inside(a_node: C_OBJECT): Boolean
This needs to be executed on every node recursively. The node_id on each 
node is how to ensure the comparison is done between the correct nodes. 
Then the trick is to implement this function properly. The 
implementation is relatively simple for each of the leaf types, such as 
Integer ranges etc. It gets a bit harder for leaf nodes representing 
vocabulary subsets, indicated either in-line, or marked by acNNNN codes. 
The latter are probably the hardest to get right, since it requries the 
presence of the vocabulary server to resolve the queries and do the 
comparison. For non-leaf nodes, the cardinality, occurrences and 
existence have to be taken into account; this is relatively simple.

These rules will be documented release 1.0 archetype specifiaction.

I am working on a paper which describes the mathematics of this formally.

- thomas beale

-
If you have any questions about using this list,
please send a message to d.lloyd at openehr.org

Reply via email to