Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
numeric_observation.h
Go to the documentation of this file.
1 /*
2  * numeric_observation.h
3  *
4  * Created on: 16 Mar 2022
5  * Author: billy
6  */
7 
8 #ifndef SERVICES_FIELD_TRIALS_INCLUDE_NUMERIC_OBSERVATION_H_
9 #define SERVICES_FIELD_TRIALS_INCLUDE_NUMERIC_OBSERVATION_H_
10 
11 #include "observation.h"
12 #include "typedefs.h"
13 
14 typedef struct NumericObservation
15 {
17 
18 
22  double64 *no_raw_value_p;
23 
28 
29 
31 
32 
33 
34 #ifdef __cplusplus
35 extern "C"
36 {
37 #endif
38 
39 
40 
41 DFW_FIELD_TRIAL_SERVICE_LOCAL NumericObservation *AllocateNumericObservation (bson_oid_t *id_p, const struct tm *start_date_p, const struct tm *end_date_p, MeasuredVariable *phenotype_p, MEM_FLAG phenotype_mem, const double *raw_value_p, const double *corrected_value_p,
42  const char *growth_stage_s, const char *method_s, Instrument *instrument_p, const ObservationNature nature, const uint32 *index_p, const char *notes_s);
43 
44 
46 
47 
49 
50 
52 
53 
68 DFW_FIELD_TRIAL_SERVICE_LOCAL bool SetNumericObservationRawValue (NumericObservation *observation_p, const double64 *value_p);
69 
70 
71 
73 
74 
89 DFW_FIELD_TRIAL_SERVICE_LOCAL bool SetNumericObservationCorrectedValue (NumericObservation *observation_p, const double64 *value_p);
90 
91 
93 
94 
96 
97 
99 
100 
101 DFW_FIELD_TRIAL_SERVICE_LOCAL bool AddNumericObservationValuesToJSON (const Observation *obs_p, const char *raw_key_s, const char *corrected_key_s, json_t *json_p, const char *null_sequence_s, bool only_if_exists_flag);
102 
103 
104 DFW_FIELD_TRIAL_SERVICE_LOCAL bool AddNumericObservationRawValueToJSON (const NumericObservation *obs_p, const char *key_s, json_t *json_p, const char *null_sequence_s, bool only_if_exists_flag);
105 
106 
107 DFW_FIELD_TRIAL_SERVICE_LOCAL bool AddNumericObservationCorrectedValueToJSON (const NumericObservation *obs_p, const char *key_s, json_t *json_p, const char *null_sequence_s, bool only_if_exists_flag);
108 
109 
110 DFW_FIELD_TRIAL_SERVICE_LOCAL bool GetNumericObservationRawValueAsString (NumericObservation *observation_p, char **value_ss, bool *free_flag_p);
111 
112 
113 DFW_FIELD_TRIAL_SERVICE_LOCAL bool GetNumericObservationCorrectedValueAsString (NumericObservation *observation_p, char **value_ss, bool *free_flag_p);
114 
115 
116 #ifdef __cplusplus
117 }
118 #endif
119 
120 
121 
122 #endif /* SERVICES_FIELD_TRIALS_INCLUDE_NUMERIC_OBSERVATION_H_ */
Instrument
Definition: instrument.h:33
AddNumericObservationRawValueToJSON
bool AddNumericObservationRawValueToJSON(const NumericObservation *obs_p, const char *key_s, json_t *json_p, const char *null_sequence_s, bool only_if_exists_flag)
MEM_FLAG
MEM_FLAG
An enum specifying the particular status of a piece of dynamically allocated memory for a particular ...
Definition: memory_allocations.h:38
SetNumericObservationRawValueFromString
bool SetNumericObservationRawValueFromString(NumericObservation *observation_p, const char *value_s)
NumericObservation::no_base_observation
Observation no_base_observation
Definition: numeric_observation.h:16
AddNumericObservationCorrectedValueToJSON
bool AddNumericObservationCorrectedValueToJSON(const NumericObservation *obs_p, const char *key_s, json_t *json_p, const char *null_sequence_s, bool only_if_exists_flag)
AddNumericObservationValuesToJSON
bool AddNumericObservationValuesToJSON(const Observation *obs_p, const char *raw_key_s, const char *corrected_key_s, json_t *json_p, const char *null_sequence_s, bool only_if_exists_flag)
AllocateNumericObservation
NumericObservation * AllocateNumericObservation(bson_oid_t *id_p, const struct tm *start_date_p, const struct tm *end_date_p, MeasuredVariable *phenotype_p, MEM_FLAG phenotype_mem, const double *raw_value_p, const double *corrected_value_p, const char *growth_stage_s, const char *method_s, Instrument *instrument_p, const ObservationNature nature, const uint32 *index_p, const char *notes_s)
NumericObservation::SetNumericObservationRawValue
bool SetNumericObservationRawValue(NumericObservation *observation_p, const double64 *value_p)
Set the raw value for a given Observation.
DFW_FIELD_TRIAL_SERVICE_LOCAL
#define DFW_FIELD_TRIAL_SERVICE_LOCAL
Definition: dfw_field_trial_service_library.h:43
MeasuredVariable
Definition: measured_variable.h:39
GetNumericObservationRawValueAsString
bool GetNumericObservationRawValueAsString(NumericObservation *observation_p, char **value_ss, bool *free_flag_p)
typedefs.h
GetNumericObservationAsJSON
json_t * GetNumericObservationAsJSON(const NumericObservation *observation_p, const ViewFormat format)
SetNumericObservationCorrectedValueFromString
bool SetNumericObservationCorrectedValueFromString(NumericObservation *observation_p, const char *value_s)
SetNumericObservationRawValueFromJSON
bool SetNumericObservationRawValueFromJSON(NumericObservation *observation_p, const json_t *value_p)
NumericObservation::SetNumericObservationCorrectedValue
bool SetNumericObservationCorrectedValue(NumericObservation *observation_p, const double64 *value_p)
Set the corrected value for a given Observation.
NumericObservation::no_corrected_value_p
double64 * no_corrected_value_p
The corrected phenotypic value for this Observation.
Definition: numeric_observation.h:27
GetNumericObservationCorrectedValueAsString
bool GetNumericObservationCorrectedValueAsString(NumericObservation *observation_p, char **value_ss, bool *free_flag_p)
NumericObservation::no_raw_value_p
double64 * no_raw_value_p
The raw phenotypic value for this Observation.
Definition: numeric_observation.h:22
ObservationNature
ObservationNature
Definition: observation.h:41
observation.h
Observation
A datatype for storing a phneotypic observation within an experiment.
Definition: observation.h:63
ClearNumericObservation
void ClearNumericObservation(Observation *observation_p)
FieldTrialServiceData
The configuration data used by the DFW Field Trial Service.
Definition: dfw_field_trial_service_data.h:118
ViewFormat
ViewFormat
An indicator of what the output destination is for the JSON data values.
Definition: view_format.h:19
SetNumericObservationCorrectedValueFromJSON
bool SetNumericObservationCorrectedValueFromJSON(NumericObservation *observation_p, const json_t *value_p)
NumericObservation
Definition: numeric_observation.h:14
GetNumericObservationFromJSON
NumericObservation * GetNumericObservationFromJSON(const json_t *phenotype_json_p, FieldTrialServiceData *data_p)