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.
string_observation.h
Go to the documentation of this file.
1 /*
2  * string_observation.h
3  *
4  * Created on: 16 Mar 2022
5  * Author: billy
6  */
7 
8 #ifndef SERVICES_FIELD_TRIALS_INCLUDE_STRING_OBSERVATION_H_
9 #define SERVICES_FIELD_TRIALS_INCLUDE_STRING_OBSERVATION_H_
10 
11 #include "observation.h"
12 
13 
14 typedef struct StringObservation
15 {
17 
22 
27 
28 
29 
31 
32 
33 
34 #ifdef __cplusplus
35 extern "C"
36 {
37 #endif
38 
39 
40 
41 DFW_FIELD_TRIAL_SERVICE_LOCAL StringObservation *AllocateStringObservation (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 char * const raw_value_s, const char * const corrected_value_s,
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 
45 
47 
48 
50 
51 
53 
54 
55 
70 DFW_FIELD_TRIAL_SERVICE_LOCAL bool SetStringObservationRawValue (StringObservation *observation_p, const char *value_s);
71 
72 
88 
89 
90 
92 
93 
109 
110 
111 DFW_FIELD_TRIAL_SERVICE_LOCAL bool AddStringObservationRawValueToJSON (const StringObservation *obs_p, const char *key_s, json_t *json_p, const char *null_sequence_s, bool only_if_exists_flag);
112 
113 
114 
115 DFW_FIELD_TRIAL_SERVICE_LOCAL bool AddStringObservationCorrectedValueToJSON (const StringObservation *obs_p, const char *key_s, json_t *json_p, const char *null_sequence_s, bool only_if_exists_flag);
116 
117 
118 DFW_FIELD_TRIAL_SERVICE_LOCAL bool AddStringObservationValuesToJSON (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);
119 
120 
121 #ifdef __cplusplus
122 }
123 #endif
124 
125 
126 
127 #endif /* SERVICES_FIELD_TRIALS_INCLUDE_STRING_OBSERVATION_H_ */
StringObservation::SetStringObservationRawValue
bool SetStringObservationRawValue(StringObservation *observation_p, const char *value_s)
Set the raw value for a given Observation.
SetStringObservationRawValueFromJSON
bool SetStringObservationRawValueFromJSON(StringObservation *observation_p, const json_t *value_p)
AddStringObservationCorrectedValueToJSON
bool AddStringObservationCorrectedValueToJSON(const StringObservation *obs_p, const char *key_s, json_t *json_p, const char *null_sequence_s, bool only_if_exists_flag)
Instrument
Definition: instrument.h:33
AddStringObservationValuesToJSON
bool AddStringObservationValuesToJSON(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)
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
StringObservation::SetStringObservationCorrectedValueFromJSON
bool SetStringObservationCorrectedValueFromJSON(StringObservation *observation_p, const json_t *value_p)
Set the corrected value for a given Observation.
StringObservation::so_raw_value_s
char * so_raw_value_s
The raw phenotypic value for this Observation.
Definition: string_observation.h:21
StringObservation::SetStringObservationCorrectedValue
bool SetStringObservationCorrectedValue(StringObservation *observation_p, const char *value_s)
Set the corrected value for a given Observation.
StringObservation::so_base_observation
Observation so_base_observation
Definition: string_observation.h:16
StringObservation
Definition: string_observation.h:14
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
ClearStringObservation
void ClearStringObservation(Observation *observation_p)
AllocateStringObservation
StringObservation * AllocateStringObservation(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 char *const raw_value_s, const char *const corrected_value_s, const char *growth_stage_s, const char *method_s, Instrument *instrument_p, const ObservationNature nature, const uint32 *index_p, const char *notes_s)
GetStringObservationAsJSON
json_t * GetStringObservationAsJSON(const StringObservation *observation_p, const ViewFormat format)
GetStringObservationFromJSON
StringObservation * GetStringObservationFromJSON(const json_t *phenotype_json_p, FieldTrialServiceData *data_p)
StringObservation::so_corrected_value_s
char * so_corrected_value_s
The corrected phenotypic value for this Observation.
Definition: string_observation.h:26
AddStringObservationRawValueToJSON
bool AddStringObservationRawValueToJSON(const StringObservation *obs_p, const char *key_s, json_t *json_p, const char *null_sequence_s, bool only_if_exists_flag)
ObservationNature
ObservationNature
Definition: observation.h:41
observation.h
Observation
A datatype for storing a phneotypic observation within an experiment.
Definition: observation.h:63
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