/** * Modus document for submitting sample events to FMIS * * * File automatically generated using json-schema-to-typescript. * ! DO NOT MODIFY IT BY HAND ! * Instead, modify the source file ./modus/v1/modus-submit.schema.json of @oada/formats * and run `$ yarn build` to regenerate this file. * * @packageDocumentation */ /** * `$id` of the source schema * @see {@link https://formats.openag.io/modus/v1/modus-submit.schema.json} */ export declare const $id = "https://formats.openag.io/modus/v1/modus-submit.schema.json"; /** * JSON Schema used to generate this type * @see {@link https://formats.openag.io/modus/v1/modus-submit.schema.json} */ export declare const schema: { readonly $id: "https://formats.openag.io/modus/v1/modus-submit.schema.json"; readonly $schema: "http://json-schema.org/draft-07/schema#"; readonly description: "Modus document for submitting sample events to FMIS"; readonly $comment: "Sadly, the standard appears to duplicate a lot of things here from modus-result. Sticking to the standard in the hope of fixing in the future."; readonly type: "object"; readonly properties: { readonly _type: { readonly $comment: "content type for API responses"; readonly const: "application/vnd.modus.v1.modus-submit+json"; }; readonly Events: { readonly type: "array"; readonly items: { readonly $comment: "this is an \"Event\""; readonly type: "object"; readonly properties: { readonly EventMetaData: { readonly $ref: "./global.schema.json#/$defs/EventMetaData"; }; readonly LabMetaData: { readonly $ref: "./global.schema.json#/$defs/LabMetaData"; }; readonly FMISMetadata: { readonly $ref: "./global.schema.json#/$defs/FMISMetadata"; }; readonly SubmissionAttributes: { readonly $ref: "./global.schema.json#/$defs/SubmissionAttributes"; }; readonly EventSamples: { readonly type: "object"; readonly properties: { readonly Soil: { readonly type: "object"; readonly properties: { readonly DepthRefs: { readonly $ref: "./global.schema.json#/$defs/DepthRefs"; }; readonly RecommendationRefs: { readonly $ref: "./global.schema.json#/$defs/RecommendationRefs"; }; readonly SoilSamples: { readonly type: "array"; readonly items: { readonly $comment: "A \"SoilSample\""; readonly type: "object"; readonly properties: { readonly SampleMetaData: { readonly $ref: "./global.schema.json#/$defs/SampleMetaData"; }; readonly Depths: { readonly type: "array"; readonly items: { readonly type: "object"; readonly properties: { readonly DepthID: { readonly description: "Depth ID from the Depth Reference"; readonly type: "string"; }; }; }; }; readonly Comments: { readonly $ref: "./global.schema.json#/$defs/Comments"; }; }; }; }; }; }; readonly Plant: { readonly description: "Element to place samples and results from a plant tissue sample event"; readonly type: "object"; readonly properties: { readonly RecommendationRefs: { readonly $ref: "./global.schema.json#/$defs/RecommendationRefs"; }; readonly PlantSamples: { readonly type: "array"; readonly items: { readonly type: "object"; readonly properties: { readonly SampleMetaData: { readonly $ref: "./global.schema.json#/$defs/SampleMetaData"; }; readonly Comments: { readonly $ref: "./global.schema.json#/$defs/Comments"; }; }; }; }; }; }; readonly Nematode: { readonly description: "Element to place samples and results from a nematode sample event"; readonly type: "object"; readonly properties: { readonly DepthRefs: { readonly $ref: "./global.schema.json#/$defs/DepthRefs"; }; readonly NematodeSamples: { readonly type: "array"; readonly items: { readonly type: "object"; readonly properties: { readonly SampleMetaData: { readonly $ref: "./global.schema.json#/$defs/SampleMetaData"; }; readonly Depths: { readonly type: "array"; readonly items: { readonly type: "object"; readonly properties: { readonly DepthID: { readonly type: "integer"; readonly minimum: 1; }; }; }; }; readonly Comments: { readonly $ref: "./global.schema.json#/$defs/Comments"; }; }; }; }; }; }; readonly Water: { readonly type: "object"; readonly properties: { readonly WaterSamples: { readonly type: "array"; readonly items: { readonly type: "object"; readonly properties: { readonly SampleMetaData: { readonly $ref: "./global.schema.json#/$defs/SampleMetaData"; }; readonly Source: { readonly type: "string"; }; readonly NutrientResults: { readonly $ref: "./global.schema.json#/$defs/NutrientResults"; }; readonly Comments: { readonly $ref: "./global.schema.json#/$defs/Comments"; }; }; }; }; }; }; readonly Residue: { readonly type: "object"; readonly properties: { readonly ResidueSamples: { readonly type: "array"; readonly items: { readonly type: "object"; readonly properties: { readonly SampleMetaData: { readonly $ref: "./global.schema.json#/$defs/SampleMetaData"; }; readonly ResidueResults: { readonly $ref: "./global.schema.json#/$defs/ResidueResults"; }; readonly Comments: { readonly $ref: "./global.schema.json#/$defs/Comments"; }; }; }; }; }; }; }; }; readonly Comments: { readonly $ref: "./global.schema.json#/$defs/Comments"; }; readonly ModusSubmit: { readonly $comment: "can hold an entire ModusSubmit document?"; readonly $ref: "#"; }; }; }; }; readonly Version: { readonly type: "string"; readonly default: "1.0"; }; }; }; /** * Returns true if `val` is a @type `ModusSubmitSchema`, false otherwise */ export declare function is(val: unknown): val is ModusSubmitSchema; /** * Asserts that `val` is a @type `ModusSubmitSchema` */ export declare function assert(val: unknown): asserts val is ModusSubmitSchema; /** * Modus document for submitting sample events to FMIS * */ export default ModusSubmitSchema; export type TestPackageRefs = { TestPackageID?: string; Name?: string; LabBillingCode?: string; [k: string]: unknown; }[]; /** * Reference documentation for a lab recommendation */ export type RecommendationRequests = Recommendation[]; /** * Place to define a reference list for the depths used in the sample event */ export type DepthRefs = { /** * Name given to the depth to be used for display by FMIS systems. ex Depth 1, 6" */ Name?: string; /** * Depth at the start of the column depth in the DepthUnit */ StartingDepth?: number; /** * Depth at the end of the column depth in the DepthUnit */ EndingDepth?: number; /** * Total column depth (End - Start) in the DepthUnit */ ColumnDepth?: number; /** * Unit the depth is reported in. */ DepthUnit?: string; /** * Unique Sequential ID */ DepthID: number; [k: string]: unknown; }[]; /** * Reference documentation to a lab recommendation */ export type RecommendationRefs = Recommendation[]; /** * Nutrient results of a sample */ export type NutrientResults = { /** * Nutrient Element. See "Element List for Modus.xlsx" for supported elements */ Element?: string; /** * The value of the element */ Value?: number; /** * Unit of measure for the value */ ValueUnit?: string; /** * Analysis Name from "Soil Analysis Nomenclature Modus.xlsx" or "Botanical Analysis Nomenclature Modus.xlsx" */ ModusTestID?: string; /** * Type definition of the value */ ValueType?: 'Measured' | 'Percent' | 'Calculated' | 'Index'; /** * Value description assigned by the lab. */ ValueDesc?: 'Very Low' | 'Low' | 'Medium' | 'Optimum' | 'Very High' | 'VL' | 'L' | 'M' | 'O' | 'VH' | 'High' | 'H'; [k: string]: unknown; }[]; export type ResidueResults = { CASRN?: string; Value?: number; ValueUnit?: string; ValueType?: string; ValueDesc?: string; [k: string]: unknown; }[]; /** * Modus document for submitting sample events to FMIS */ export interface ModusSubmitSchema { _type?: 'application/vnd.modus.v1.modus-submit+json'; Events?: { EventMetaData?: EventMetaData; LabMetaData?: LabMetaData; FMISMetadata?: FMISMetadata; SubmissionAttributes?: SubmissionAttributes; EventSamples?: { Soil?: { DepthRefs?: DepthRefs; RecommendationRefs?: RecommendationRefs; SoilSamples?: { SampleMetaData?: SampleMetaData; Depths?: { /** * Depth ID from the Depth Reference */ DepthID?: string; [k: string]: unknown; }[]; Comments?: string; [k: string]: unknown; }[]; [k: string]: unknown; }; /** * Element to place samples and results from a plant tissue sample event */ Plant?: { RecommendationRefs?: RecommendationRefs; PlantSamples?: { SampleMetaData?: SampleMetaData; Comments?: string; [k: string]: unknown; }[]; [k: string]: unknown; }; /** * Element to place samples and results from a nematode sample event */ Nematode?: { DepthRefs?: DepthRefs; NematodeSamples?: { SampleMetaData?: SampleMetaData; Depths?: { DepthID?: number; [k: string]: unknown; }[]; Comments?: string; [k: string]: unknown; }[]; [k: string]: unknown; }; Water?: { WaterSamples?: { SampleMetaData?: SampleMetaData; Source?: string; NutrientResults?: NutrientResults; Comments?: string; [k: string]: unknown; }[]; [k: string]: unknown; }; Residue?: { ResidueSamples?: { SampleMetaData?: SampleMetaData; ResidueResults?: ResidueResults; Comments?: string; [k: string]: unknown; }[]; [k: string]: unknown; }; [k: string]: unknown; }; Comments?: string; ModusSubmit?: ModusSubmitSchema1; [k: string]: unknown; }[]; Version?: string; [k: string]: unknown; } export interface EventMetaData { /** * Unique human readable code for the sample event. Often referred to a Layer ID */ EventCode?: string; /** * Date the sample event was collected in the field */ EventDate?: string; EventType?: EventType; /** * The date the data in the even is to expire for use in a recommendation */ EventExpirationDate?: string; [k: string]: unknown; } export interface EventType { Soil?: true; Plant?: { PlantPart?: string; Crop?: Crop; [k: string]: unknown; }; Nematode?: true; Water?: true; Residue?: true; [k: string]: unknown; } export interface Crop { Name?: string; ClientID?: string; GrowthStage?: { Name?: string; ClientID?: string; [k: string]: unknown; }; SubGrowthStage?: { Name?: string; ClientID?: string; [k: string]: unknown; }; [k: string]: unknown; } /** * Metadata related to the testing lab */ export interface LabMetaData { /** * The name of the lab that ran the results */ LabName?: string; /** * ID for the lab that ran the results */ LabID?: string; /** * Internal Lab ID for the event */ LabEventID?: string; /** * Contact information at the lab */ Contact?: { Name?: string; PhoneNumber?: string; Address?: string; [k: string]: unknown; }; TestPackageRefs?: TestPackageRefs; /** * The date/time the sample where received at the lab */ ReceivedDate?: string; /** * The date/time the sample was processed by the lab */ ProcessedDate?: string; /** * List of lab reports */ Reports?: { /** * Incrementing reference number to associate this report data to individual samples */ ReportID?: number | string; /** * ID the lab has assigned to the report */ LabReportID?: string; /** * Description of the report file */ FileDescription?: string; /** * The file data for the report. The lab has the choice to pass a URL or embed the file data. */ File?: { /** * The url path to the report file */ URL?: { /** * The name for the file */ FileName?: string; /** * The path to the file */ Path: string; [k: string]: unknown; }; [k: string]: unknown; } | { /** * The file data */ FileData?: { /** * The name for the file */ FileName?: string; /** * File data base64 encoded */ FileData: string; [k: string]: unknown; }; [k: string]: unknown; }; [k: string]: unknown; }[]; /** * End user lab account information */ ClientAccount?: { AccountNumber?: string; Name?: string; Company?: string; City?: string; State?: string; [k: string]: unknown; }; [k: string]: unknown; } /** * Element that contains data needed for FMIS "Field Management Information Systems" */ export interface FMISMetadata { /** * Unique code for the sample event. Often an internal UUID from an FMIS */ FMISEventID?: string; FMISProfile?: FMISProfile; /** * Lab defined equations that are allowed by the lab to be used in the FMIS */ FMISAllowedLabEquations?: Equation[]; [k: string]: unknown; } /** * Grower/Farm/Field Name and ID's for FMIS */ export interface FMISProfile { 'Grower'?: { name?: string; ID?: string; [k: string]: unknown; }; 'Farm'?: { name?: string; ID?: string; [k: string]: unknown; }; 'Field'?: { name?: string; ID?: string; [k: string]: unknown; }; 'Sub-Field'?: { name?: string; ID?: string; [k: string]: unknown; }; [k: string]: unknown; } /** * Lab equation that is perminited to be used on this data set */ export interface Equation { /** * Name of the equation */ Name?: string; /** * Version of the lab equation */ Version?: string; /** * Set if an equation is to be the default equation */ Default?: boolean; /** * ID of the equation given by the lab */ ID?: string; [k: string]: unknown; } /** * Attributes that needed to be passed through for reference and recommendation. */ export interface SubmissionAttributes { /** * Person submiting the sample */ SubmittedBy?: string; /** * Person or company the sample is being submitted for. */ SubmittedFor?: string; SiteAttributes?: SiteAttributes; RecommendationRequests?: RecommendationRequests; [k: string]: unknown; } /** * Attributes that are collected for the site the sample are collected from. */ export interface SiteAttributes { Tillage?: string; Irrigated?: boolean; Tilled?: boolean; PrevCrop?: string; /** * Used to store additional variables to be passed through */ Variables?: { Name?: string; Value?: string; Unit?: string; [k: string]: unknown; }[]; [k: string]: unknown; } export interface Recommendation { /** * Name for the recommendation */ Name?: string; /** * List of the variables used in the recommendation */ Variables?: { /** * Name of variable used in the recommendation */ Name?: string; /** * Value of the variable used in the recommendation */ Value?: string; /** * Unit of the variable */ Unit?: string; [k: string]: unknown; }[]; Equation?: Equation; /** * Order the FMIS should display the rec in. */ DisplayOrder?: number; /** * The date the rec expires and should no longer be used. */ ExpirationDate?: string; /** * Id to be referenced in the sample */ RecID?: number; [k: string]: unknown; } /** * Metadata for a sample in the sample event */ export interface SampleMetaData { /** * Sample Number give the sample by during sample collection */ SampleNumber?: string; /** * Unique ID assigned by an FMIS for the sample */ FMISSampleID?: string; /** * Unique ID for the sample bag or container. i.e. Bar code */ SampleContainerID?: string; /** * ID number to reference different samples as one group */ SampleGroupID?: number; /** * ID number indicating lab report to which this sample belongs. */ ReportID?: number | string; /** * Flag to indicate if this result is to overwrite any previous results. e.g. for correcting a mistake. */ OverwriteResult?: boolean; /** * WKT Geometry Source: http://en.wikipedia.org/wiki/Well-known_text Limit types to Point, Polygon and MultiPolygon */ Geometry?: { /** * Projection ID of the Geometry Source: http://spatialreference.org/ref/?page=1 Default is WGS84 - Lat,Lon epsg: 4326 */ epsg?: number; [k: string]: unknown; }; /** * Sub Samples is where the location of the cores within a sample can be recorded */ SubSamples?: { /** * ID number assigned during collection. */ SubSampleNumber?: number; /** * Unique ID for the sub-sample assigned by an FMIS */ SubSampleID?: string; /** * WKT Geometry Source: http://en.wikipedia.org/wiki/Well-known_text Limit types to Point, Polygon and MultiPolygon */ Geometry?: { /** * Projection ID of the Geometry Source: http://spatialreference.org/ref/?page=1 Default is WGS84 - Lat,Lon epsg: 4326 */ epsg?: number; [k: string]: unknown; }; [k: string]: unknown; }[]; /** * The lab test packages used for the sample. */ TestPackages?: string[]; [k: string]: unknown; } /** * Modus document for submitting sample events to FMIS */ export interface ModusSubmitSchema1 { _type?: 'application/vnd.modus.v1.modus-submit+json'; Events?: { EventMetaData?: EventMetaData; LabMetaData?: LabMetaData; FMISMetadata?: FMISMetadata; SubmissionAttributes?: SubmissionAttributes; EventSamples?: { Soil?: { DepthRefs?: DepthRefs; RecommendationRefs?: RecommendationRefs; SoilSamples?: { SampleMetaData?: SampleMetaData; Depths?: { /** * Depth ID from the Depth Reference */ DepthID?: string; [k: string]: unknown; }[]; Comments?: string; [k: string]: unknown; }[]; [k: string]: unknown; }; /** * Element to place samples and results from a plant tissue sample event */ Plant?: { RecommendationRefs?: RecommendationRefs; PlantSamples?: { SampleMetaData?: SampleMetaData; Comments?: string; [k: string]: unknown; }[]; [k: string]: unknown; }; /** * Element to place samples and results from a nematode sample event */ Nematode?: { DepthRefs?: DepthRefs; NematodeSamples?: { SampleMetaData?: SampleMetaData; Depths?: { DepthID?: number; [k: string]: unknown; }[]; Comments?: string; [k: string]: unknown; }[]; [k: string]: unknown; }; Water?: { WaterSamples?: { SampleMetaData?: SampleMetaData; Source?: string; NutrientResults?: NutrientResults; Comments?: string; [k: string]: unknown; }[]; [k: string]: unknown; }; Residue?: { ResidueSamples?: { SampleMetaData?: SampleMetaData; ResidueResults?: ResidueResults; Comments?: string; [k: string]: unknown; }[]; [k: string]: unknown; }; [k: string]: unknown; }; Comments?: string; ModusSubmit?: ModusSubmitSchema1; [k: string]: unknown; }[]; Version?: string; [k: string]: unknown; }