Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

A draft specification is available in the BASE component, see here.

This page is for discussion on this Rules language, including built-in and plug-in functions, operators and value referencing.

Built-in Functions

Current list of built-in functions

Rules in Archetypes - natural language

Archetypes currently use no language-dependent symbols, other than the adl language keywords ('archetype', 'description', 'definition' etc). But if we add rules in a typical programming language fashion, we get language-dependency, like this:

rules
	$map_value: Real := /data[id2]/events[id7]/data[id4]/items[id1007]/value/magnitude
	$sys_bp_val: Real := /data[id2]/events[id7]/data[id4]/items[id5]/value/magnitude
	$dia_bp_val: Real := /data[id2]/events[id7]/data[id4]/items[id6]/value/magnitude

	mean_arterial_pressure: $map_value = $dia_bp_val + 0.33 * ($sys_bp_val - $dia_bp_val)

	$pulse_pressure_val: Real := /data[id2]/events[id7]/data[id4]/items[id1008]/value/magnitude

	pulse_pressure: $pulse_pressure_val = $sys_bp_val - $dia_bp_val

Here, the variables '$map_value' etc are all in English; so are the assertion tags 'mean_arterial_pressure' and 'pulse_pressure'. To make this language-independent, we would need to do something like this:

rules
	$rv1: Real := /data[id2]/events[id7]/data[id4]/items[id1007]/value/magnitude
	$rv2: Real := /data[id2]/events[id7]/data[id4]/items[id5]/value/magnitude
	$rv3: Real := /data[id2]/events[id7]/data[id4]/items[id6]/value/magnitude

	rt1: $rv1= $rv3 + 0.33 * ( $rv2 - $rv3 )

	$rv4: Real := /data[id2]/events[id7]/data[id4]/items[id1008]/value/magnitude

	rt2: $rv4= $rv2 - $rv3
 
terminology
	term_definitions = <
		["en"] = <
			...
			["rv1"] = <
				text = <"map_value">
				description = <"MAP value variable">
			>
			["rv2"] = <
				text = <"sys_bp_val">
				description = <"Systolic BP value variable">
			>
			["rv3"] = <
				text = <"dia_bp_val">
				description = <"Diastolic BP value variable">
			>
			["rv4"] = <
				text = <"pulse_pressure_val">
				description = <"Pulse pressure value variable">
			>
			["rt1"] = <
				text = <"mean_arterial_pressure">
				description = <"MAP assertion tag">
			>
			["rt2"] = <
				text = <"pulse_pressure">
				description = <"Pulse pressure assertion tag">
			>

		>
		["es"] = <
			...
		>
	>
	

In this approach, we are adding new kinds of terms 'rv' = rule variable, 'rt' = rule tag. The implication is that textual substitution of 'rv1' by 'map_value' etc would be done in a GUI tool, and optionally before passing the rules text to an evaluator.

This is perhaps overkill - but it does preserve archetype language independence.

 

  • No labels