Calculating a field on the observation form based on another field can be achieved by using “On Change of Values (Control Event)” as explained here
eg. Calculating EDD based on LMP as shown here