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.
|
#include <time.h>
#include "dfw_field_trial_service_data.h"
#include "dfw_field_trial_service_library.h"
#include "field_trial.h"
#include "location.h"
#include "jansson.h"
#include "key_value_pair.h"
#include "crop.h"
#include "person.h"
#include "typedefs.h"
#include "address.h"
#include "json_processor.h"
#include "statistics.h"
Go to the source code of this file.
Data Structures | |
struct | Study |
struct | StudyNode |
Macros | |
#define | ST_UNKNOWN_DIRECTION_S "Unknown" |
The value to specify that the aspect parameter is not set. More... | |
Functions | |
const STUDY_PREFIX char *ST_NAME_S | STUDY_CONCAT_VAL (CONTEXT_PREFIX_SCHEMA_ORG_S, "name") |
const STUDY_PREFIX char *ST_LOCATION_ID_S | STUDY_VAL ("address_id") |
const STUDY_PREFIX char *ST_LOCATION_S | STUDY_VAL ("address") |
const STUDY_PREFIX char *ST_CONTACT_S | STUDY_VAL ("contact") |
const STUDY_PREFIX char *ST_CURATOR_S | STUDY_VAL ("curator") |
const STUDY_PREFIX char *ST_CONTRIBUTORS_S | STUDY_VAL ("contributors") |
const STUDY_PREFIX char *ST_ASPECT_S | STUDY_CONCAT_VAL (CONTEXT_PREFIX_NCI_THESAUSUS_ONTOLOGY_S, "C42677") |
const STUDY_PREFIX char *ST_SLOPE_S | STUDY_CONCAT_VAL (CONTEXT_PREFIX_ENVIRONMENT_ONTOLOGY_S, "00002000") |
const STUDY_PREFIX char *ST_PARENT_FIELD_TRIAL_S | STUDY_VAL ("parent_field_trial") |
const STUDY_PREFIX char *ST_PLOTS_S | STUDY_VAL ("plots") |
const STUDY_PREFIX char *ST_NUMBER_OF_PLOTS_S | STUDY_VAL ("number_of_plots") |
const STUDY_PREFIX char *ST_DATA_LINK_S | STUDY_CONCAT_VAL (CONTEXT_PREFIX_SCHEMA_ORG_S, "url") |
const STUDY_PREFIX char *ST_FRICTIONLESS_DATA_LINK_S | STUDY_CONCAT_VAL (CONTEXT_PREFIX_SCHEMA_ORG_S, "contentUrl") |
const STUDY_PREFIX char *ST_HANDBOOK_DATA_LINK_S | STUDY_VAL ("handbook") |
const STUDY_PREFIX char *ST_CURRENT_CROP_S | STUDY_VAL ("current_crop") |
const STUDY_PREFIX char *ST_PREVIOUS_CROP_S | STUDY_VAL ("previous_crop") |
const STUDY_PREFIX char *ST_DESCRIPTION_S | STUDY_CONCAT_VAL (CONTEXT_PREFIX_SCHEMA_ORG_S, "description") |
const STUDY_PREFIX char *ST_DESIGN_S | STUDY_VAL ("study_design") |
const STUDY_PREFIX char *ST_GROWING_CONDITIONS_S | STUDY_VAL ("growing_conditions") |
const STUDY_PREFIX char *ST_PHENOTYPE_GATHERING_NOTES_S | STUDY_VAL ("phenotype_gathering_notes") |
const STUDY_PREFIX char *ST_NUMBER_OF_PLOT_ROWS_S | STUDY_VAL ("num_rows") |
const STUDY_PREFIX char *ST_NUMBER_OF_PLOT_COLUMN_S | STUDY_VAL ("num_columns") |
const STUDY_PREFIX char *ST_NUMBER_OF_REPLICATES_S | STUDY_VAL ("num_replicates") |
const STUDY_PREFIX char *ST_PLOT_LENGTH_S | STUDY_VAL ("plot_length") |
const STUDY_PREFIX char *ST_PLOT_WIDTH_S | STUDY_VAL ("plot_width") |
const STUDY_PREFIX char *ST_WEATHER_S | STUDY_VAL ("weather") |
const STUDY_PREFIX char *ST_SHAPE_S | STUDY_VAL ("shape_data") |
const STUDY_PREFIX char *ST_HAS_SHAPE_S | STUDY_VAL ("has_shape_data") |
const STUDY_PREFIX char *ST_SHAPE_NOTES_S | STUDY_VAL ("shape_data_notes") |
const STUDY_PREFIX char *ST_PLOT_H_GAP_S | STUDY_VAL ("plot_horizontal_gap") |
const STUDY_PREFIX char *ST_PLOT_V_GAP_S | STUDY_VAL ("plot_vertical_gap") |
const STUDY_PREFIX char *ST_PLOT_BLOCK_H_GAP_S | STUDY_VAL ("plot_block_horizontal_gap") |
const STUDY_PREFIX char *ST_PLOT_BLOCK_V_GAP_S | STUDY_VAL ("plot_block_vertical_gap") |
const STUDY_PREFIX char *ST_PLOT_ROWS_PER_BLOCK_S | STUDY_VAL ("plot_block_rows") |
const STUDY_PREFIX char *ST_PLOT_COLS_PER_BLOCK_S | STUDY_VAL ("plot_block_columns") |
const STUDY_PREFIX char *ST_TREATMENTS_S | STUDY_VAL ("treatment_factors") |
const STUDY_PREFIX char *ST_PHENOTYPES_S | STUDY_VAL ("phenotypes") |
const STUDY_PREFIX char *ST_ACCESSIONS_S | STUDY_VAL ("accessions") |
const STUDY_PREFIX char *ST_PHENOTYPE_STATISTICS_S | STUDY_VAL ("statistics") |
const STUDY_PREFIX char *ST_PHENOTYPE_DEFINITION_S | STUDY_VAL ("definition") |
const STUDY_PREFIX char *ST_HARVEST_YEAR_S | STUDY_VAL ("harvest_year") |
const STUDY_PREFIX char *ST_SOWING_YEAR_S | STUDY_VAL ("sowing_year") |
const STUDY_PREFIX char *ST_PLAN_CHANGES_S | STUDY_VAL ("plan_changes") |
const STUDY_PREFIX char *ST_PHYSICAL_SAMPLES_COLLECTED_S | STUDY_VAL ("physical_samples_collected") |
const STUDY_PREFIX char *ST_DATA_NOT_INCLUDED_S | STUDY_VAL ("data_not_included") |
const STUDY_PREFIX char *ST_PHOTO_URL_S | STUDY_CONCAT_VAL (CONTEXT_PREFIX_SCHEMA_ORG_S, "image") |
const STUDY_PREFIX char *ST_IMAGE_COLLECTION_NOTE_S | STUDY_VAL ("image_collection_notes") |
STUDY_PREFIX int32 ST_UNSET_PH | STUDY_VAL (-1) |
Study * | AllocateStudy (bson_oid_t *id_p, const char *name_s, const char *data_url_s, const char *aspect_s, const char *slope_s, struct Location *location_p, FieldTrial *parent_field_trial_p, MEM_FLAG parent_field_trial_mem, Crop *current_crop_p, Crop *previous_crop_p, const char *description_s, const char *design_s, const char *growing_conditions_s, const char *phenotype_gathering_notes_s, const uint32 *num_rows_p, const uint32 *num_cols_p, const uint32 *num_replicates_p, const double64 *plot_width_p, const double64 *plot_length_p, const char *weather_s, const json_t *shape_p, const double64 *plot_horizontal_gap_p, const double64 *plot_vertical_gap_p, const uint32 *plot_rows_per_block_p, const uint32 *plot_columns_per_block_p, const double64 *plot_block_horizontal_gap_p, const double64 *plot_block_vertical_gap_p, Person *curator_p, Person *contact_p, const uint32 *sowing_year_p, const uint32 *harvest_year_p, const char *plan_changes_s, const char *physical_samples_collected_s, const char *data_not_included_s, const char *photo_url_s, const char *image_collection_notes_s, const char *gps_notes_s, const FieldTrialServiceData *data_p) |
void | FreeStudy (Study *study_p) |
StudyNode * | AllocateStudyNode (Study *study_p) |
void | FreeStudyNode (ListItem *node_p) |
json_t * | GetStudyAsJSON (Study *study_p, const ViewFormat format, JSONProcessor *processor_p, FieldTrialServiceData *data_p) |
Study * | GetStudyFromJSON (const json_t *json_p, const ViewFormat format, const FieldTrialServiceData *data_p) |
Study * | GetStudyWithParentTrialFromJSON (const json_t *json_p, FieldTrial *parent_trial_p, const ViewFormat format, const FieldTrialServiceData *data_p) |
bool | GetStudyPlots (Study *study_p, const ViewFormat format, FieldTrialServiceData *data_p) |
OperationStatus | SaveStudy (Study *study_p, ServiceJob *job_p, FieldTrialServiceData *data_p, const char *url_key_s) |
Study * | GetStudyByIdString (const char *study_id_s, const ViewFormat format, const FieldTrialServiceData *data_p) |
Study * | GetStudyById (bson_oid_t *st_id_p, const ViewFormat format, const FieldTrialServiceData *data_p) |
bool | HasStudyGotPlotLayoutDetails (const Study *study_p) |
bool | AddPhenotypesToJSON (const Study *study_p, json_t *study_json_p, const ViewFormat format, const FieldTrialServiceData *data_p) |
bool | AddPlotToStudy (Study *study_p, struct Plot *plot_p) |
int64 | GetNumberOfPlotsInStudy (const Study *study_p, const FieldTrialServiceData *data_p) |
OperationStatus | IndexStudy (Study *study_p, ServiceJob *job_p, const char *job_name_s, FieldTrialServiceData *data_p) |
bool | AddStudyContributor (Study *study_p, Person *person_p, MEM_FLAG mf) |
bool | IsMeasuredVariableOnStudy (const Study *const study_p, const char *mv_s) |
bool | AddPhenotypeStatisticsToStudy (Study *const study_p, const char *mv_s, const Statistics *stats_p) |
#define ST_UNKNOWN_DIRECTION_S "Unknown" |
The value to specify that the aspect parameter is not set.
const STUDY_PREFIX char* ST_NAME_S STUDY_CONCAT_VAL | ( | CONTEXT_PREFIX_SCHEMA_ORG_S | , |
"name" | |||
) |
const STUDY_PREFIX char* ST_LOCATION_ID_S STUDY_VAL | ( | "address_id" | ) |
const STUDY_PREFIX char* ST_LOCATION_S STUDY_VAL | ( | "address" | ) |
const STUDY_PREFIX char* ST_CONTACT_S STUDY_VAL | ( | "contact" | ) |
const STUDY_PREFIX char* ST_CURATOR_S STUDY_VAL | ( | "curator" | ) |
const STUDY_PREFIX char* ST_CONTRIBUTORS_S STUDY_VAL | ( | "contributors" | ) |
const STUDY_PREFIX char* ST_ASPECT_S STUDY_CONCAT_VAL | ( | CONTEXT_PREFIX_NCI_THESAUSUS_ONTOLOGY_S | , |
"C42677" | |||
) |
const STUDY_PREFIX char* ST_SLOPE_S STUDY_CONCAT_VAL | ( | CONTEXT_PREFIX_ENVIRONMENT_ONTOLOGY_S | , |
"00002000" | |||
) |
const STUDY_PREFIX char* ST_PARENT_FIELD_TRIAL_S STUDY_VAL | ( | "parent_field_trial" | ) |
const STUDY_PREFIX char* ST_PLOTS_S STUDY_VAL | ( | "plots" | ) |
const STUDY_PREFIX char* ST_NUMBER_OF_PLOTS_S STUDY_VAL | ( | "number_of_plots" | ) |
const STUDY_PREFIX char* ST_DATA_LINK_S STUDY_CONCAT_VAL | ( | CONTEXT_PREFIX_SCHEMA_ORG_S | , |
"url" | |||
) |
const STUDY_PREFIX char* ST_FRICTIONLESS_DATA_LINK_S STUDY_CONCAT_VAL | ( | CONTEXT_PREFIX_SCHEMA_ORG_S | , |
"contentUrl" | |||
) |
const STUDY_PREFIX char* ST_HANDBOOK_DATA_LINK_S STUDY_VAL | ( | "handbook" | ) |
const STUDY_PREFIX char* ST_CURRENT_CROP_S STUDY_VAL | ( | "current_crop" | ) |
const STUDY_PREFIX char* ST_PREVIOUS_CROP_S STUDY_VAL | ( | "previous_crop" | ) |
const STUDY_PREFIX char* ST_DESCRIPTION_S STUDY_CONCAT_VAL | ( | CONTEXT_PREFIX_SCHEMA_ORG_S | , |
"description" | |||
) |
const STUDY_PREFIX char* ST_DESIGN_S STUDY_VAL | ( | "study_design" | ) |
const STUDY_PREFIX char* ST_GROWING_CONDITIONS_S STUDY_VAL | ( | "growing_conditions" | ) |
const STUDY_PREFIX char* ST_PHENOTYPE_GATHERING_NOTES_S STUDY_VAL | ( | "phenotype_gathering_notes" | ) |
const STUDY_PREFIX char* ST_NUMBER_OF_PLOT_ROWS_S STUDY_VAL | ( | "num_rows" | ) |
const STUDY_PREFIX char* ST_NUMBER_OF_PLOT_COLUMN_S STUDY_VAL | ( | "num_columns" | ) |
const STUDY_PREFIX char* ST_NUMBER_OF_REPLICATES_S STUDY_VAL | ( | "num_replicates" | ) |
const STUDY_PREFIX char* ST_PLOT_LENGTH_S STUDY_VAL | ( | "plot_length" | ) |
const STUDY_PREFIX char* ST_PLOT_WIDTH_S STUDY_VAL | ( | "plot_width" | ) |
const STUDY_PREFIX char* ST_WEATHER_S STUDY_VAL | ( | "weather" | ) |
const STUDY_PREFIX char* ST_SHAPE_S STUDY_VAL | ( | "shape_data" | ) |
const STUDY_PREFIX char* ST_HAS_SHAPE_S STUDY_VAL | ( | "has_shape_data" | ) |
const STUDY_PREFIX char* ST_SHAPE_NOTES_S STUDY_VAL | ( | "shape_data_notes" | ) |
const STUDY_PREFIX char* ST_PLOT_H_GAP_S STUDY_VAL | ( | "plot_horizontal_gap" | ) |
const STUDY_PREFIX char* ST_PLOT_V_GAP_S STUDY_VAL | ( | "plot_vertical_gap" | ) |
const STUDY_PREFIX char* ST_PLOT_BLOCK_H_GAP_S STUDY_VAL | ( | "plot_block_horizontal_gap" | ) |
const STUDY_PREFIX char* ST_PLOT_BLOCK_V_GAP_S STUDY_VAL | ( | "plot_block_vertical_gap" | ) |
const STUDY_PREFIX char* ST_PLOT_ROWS_PER_BLOCK_S STUDY_VAL | ( | "plot_block_rows" | ) |
const STUDY_PREFIX char* ST_PLOT_COLS_PER_BLOCK_S STUDY_VAL | ( | "plot_block_columns" | ) |
const STUDY_PREFIX char* ST_TREATMENTS_S STUDY_VAL | ( | "treatment_factors" | ) |
const STUDY_PREFIX char* ST_PHENOTYPES_S STUDY_VAL | ( | "phenotypes" | ) |
const STUDY_PREFIX char* ST_ACCESSIONS_S STUDY_VAL | ( | "accessions" | ) |
const STUDY_PREFIX char* ST_PHENOTYPE_STATISTICS_S STUDY_VAL | ( | "statistics" | ) |
const STUDY_PREFIX char* ST_PHENOTYPE_DEFINITION_S STUDY_VAL | ( | "definition" | ) |
const STUDY_PREFIX char* ST_HARVEST_YEAR_S STUDY_VAL | ( | "harvest_year" | ) |
const STUDY_PREFIX char* ST_SOWING_YEAR_S STUDY_VAL | ( | "sowing_year" | ) |
const STUDY_PREFIX char* ST_PLAN_CHANGES_S STUDY_VAL | ( | "plan_changes" | ) |
const STUDY_PREFIX char* ST_PHYSICAL_SAMPLES_COLLECTED_S STUDY_VAL | ( | "physical_samples_collected" | ) |
const STUDY_PREFIX char* ST_DATA_NOT_INCLUDED_S STUDY_VAL | ( | "data_not_included" | ) |
const STUDY_PREFIX char* ST_PHOTO_URL_S STUDY_CONCAT_VAL | ( | CONTEXT_PREFIX_SCHEMA_ORG_S | , |
"image" | |||
) |
const STUDY_PREFIX char* ST_IMAGE_COLLECTION_NOTE_S STUDY_VAL | ( | "image_collection_notes" | ) |
STUDY_PREFIX int32 ST_UNSET_PH STUDY_VAL | ( | - | 1 | ) |
Study* AllocateStudy | ( | bson_oid_t * | id_p, |
const char * | name_s, | ||
const char * | data_url_s, | ||
const char * | aspect_s, | ||
const char * | slope_s, | ||
struct Location * | location_p, | ||
FieldTrial * | parent_field_trial_p, | ||
MEM_FLAG | parent_field_trial_mem, | ||
Crop * | current_crop_p, | ||
Crop * | previous_crop_p, | ||
const char * | description_s, | ||
const char * | design_s, | ||
const char * | growing_conditions_s, | ||
const char * | phenotype_gathering_notes_s, | ||
const uint32 * | num_rows_p, | ||
const uint32 * | num_cols_p, | ||
const uint32 * | num_replicates_p, | ||
const double64 * | plot_width_p, | ||
const double64 * | plot_length_p, | ||
const char * | weather_s, | ||
const json_t * | shape_p, | ||
const double64 * | plot_horizontal_gap_p, | ||
const double64 * | plot_vertical_gap_p, | ||
const uint32 * | plot_rows_per_block_p, | ||
const uint32 * | plot_columns_per_block_p, | ||
const double64 * | plot_block_horizontal_gap_p, | ||
const double64 * | plot_block_vertical_gap_p, | ||
Person * | curator_p, | ||
Person * | contact_p, | ||
const uint32 * | sowing_year_p, | ||
const uint32 * | harvest_year_p, | ||
const char * | plan_changes_s, | ||
const char * | physical_samples_collected_s, | ||
const char * | data_not_included_s, | ||
const char * | photo_url_s, | ||
const char * | image_collection_notes_s, | ||
const char * | gps_notes_s, | ||
const FieldTrialServiceData * | data_p | ||
) |
void FreeStudy | ( | Study * | study_p | ) |
void FreeStudyNode | ( | ListItem * | node_p | ) |
json_t* GetStudyAsJSON | ( | Study * | study_p, |
const ViewFormat | format, | ||
JSONProcessor * | processor_p, | ||
FieldTrialServiceData * | data_p | ||
) |
Study* GetStudyFromJSON | ( | const json_t * | json_p, |
const ViewFormat | format, | ||
const FieldTrialServiceData * | data_p | ||
) |
Study* GetStudyWithParentTrialFromJSON | ( | const json_t * | json_p, |
FieldTrial * | parent_trial_p, | ||
const ViewFormat | format, | ||
const FieldTrialServiceData * | data_p | ||
) |
bool GetStudyPlots | ( | Study * | study_p, |
const ViewFormat | format, | ||
FieldTrialServiceData * | data_p | ||
) |
OperationStatus SaveStudy | ( | Study * | study_p, |
ServiceJob * | job_p, | ||
FieldTrialServiceData * | data_p, | ||
const char * | url_key_s | ||
) |
Study* GetStudyByIdString | ( | const char * | study_id_s, |
const ViewFormat | format, | ||
const FieldTrialServiceData * | data_p | ||
) |
Study* GetStudyById | ( | bson_oid_t * | st_id_p, |
const ViewFormat | format, | ||
const FieldTrialServiceData * | data_p | ||
) |
bool HasStudyGotPlotLayoutDetails | ( | const Study * | study_p | ) |
bool AddPhenotypesToJSON | ( | const Study * | study_p, |
json_t * | study_json_p, | ||
const ViewFormat | format, | ||
const FieldTrialServiceData * | data_p | ||
) |
int64 GetNumberOfPlotsInStudy | ( | const Study * | study_p, |
const FieldTrialServiceData * | data_p | ||
) |
OperationStatus IndexStudy | ( | Study * | study_p, |
ServiceJob * | job_p, | ||
const char * | job_name_s, | ||
FieldTrialServiceData * | data_p | ||
) |
bool IsMeasuredVariableOnStudy | ( | const Study *const | study_p, |
const char * | mv_s | ||
) |
bool AddPhenotypeStatisticsToStudy | ( | Study *const | study_p, |
const char * | mv_s, | ||
const Statistics * | stats_p | ||
) |