Hi all, I have a question about clinical modeling: in a use case, which is similar to the current generic modeling for laboratory results, but for fluid replacement (solutions and blood products), I’m trying to model the recording of each solution or blood product administered to a patient by using a quantity as the value of the amount of fluid administered, and to say which was the fluid (saline solution, ringer, colloids, plasma, red cells, etc), I’m trying to use the ELEMENT.name as a coded text.
Since different fluid types could have a different unit of measure (ml, cc, …), I need a constraint based on the code in ELEMENT.name that will constraint ELEMENT.value.units (value is DV_QUANTITY).
Note: that is just an example of a more general use case which I don know if could be solved only with cADL
The question: is it possible to express such constraint based on dependencies to another field value in an archetype? How do others do this?
My guess is: cADL is not enough and some kind of rule/assertion is needed to express such constraint.
BTW, I’m cheating a little bit because I’m not really creating an archetype, but the rules for UI generation in that case, in fact I’m working on a UI specification in JSON, I’m share my findings later (what I need to realize is from where to get those constraints to use that metadata in the GUI generation / data validation).
This is a pseudo-code of the case:
ELEMENT {
name {
type: DV_CODED_TEXT
code <<< this defines the ELEMENT type, in my fluids example would be the type of fluid like "saline solution"
},
value: {
type: DV_QUANTITY
value: {
magnitude
units <<<< defined/constrained by setting the ELEMENT.name.code
}
}
}