Server side data model for scripts

You can plot the graph associated with calorie expenditure in the fitness tab.
I plot in grey the calories days after days, and curves are moving averages on several periods (1 years, 3 weeks, 7 days)

@david in the top post you mention writing fields.

does that mean I can have one custom field called LOGIC that does everything and all other custom fields are “dumb” fields, that get written by the logic javascript?

because that doesn’t seem to work for me.

I created the field LOGIC, the field Demo1 and the field Demo2 and the following code does nothing:

{
    activity.Demo1 = 'activity test'
    icu.activity.Demo2 = 'icu.activity test'
}

That will work now. I just fixed a bug that was breaking updates of custom fields like that from scripts on activities. My “Logic” field looks like this (Demo1 is text, Demo2 is numeric):

{
  activity.Demo1 = 'foo'
  activity.Demo2 = 123.45
  'bar'
}