Opened 5 years ago

Closed 4 years ago

#2333 closed enhancement (fixed)

Add new column to inventory dataview for origin (grow out location) of the inventory lot

Reported by: Lisa Burke Owned by: Benjamin Haag
Priority: medium Milestone: Server 2.3.1
Component: Database, Schema Changes Version: N/A
Severity: Keywords:
Cc: lisa.burke@…, kurt.endress@… Database Engine: N/A
Operating System: N/A

Description

Could we add an “Origin” field to the inventory dataview that can be used to capture geography (Country, State, etc.) information about where each particular inventory lot was grown, maintained, or produced?


Propose field in inventory dataview

“Inventory Origin” geography_id – Geography key field showing where the inventory was grown, produced, or clonally propagated.



The distribution of germplasm, especially internationally, often requires stating the “origin” of the plant material. In shipping, “Origin” refers to the country where the product was grown, produced, manufactured, or processed. FedEx: ​https://shippingchannel.fedex.com/en-gb/customs-clearance/certificate-of-origin.html


Knowing the grow out location of the inventory is important for phytosanitary concerns (pests / pathogens) and quarantine procedures for domestic (state to state) and international seed movement. The international distribution of goods often asks for the country of origin and the USMCA asks for the country, state. Origin is also listed on all phytosanitary certificates.



The addition of an Origin field in the Inventory dataview would greatly simplify the process of identifying where the inventory lot was grown/clonal plant is physically being propagated. Currently this geographical information is sometimes captured in various inventory actions, methods, or notes since there is not a single geography lookup picker field where the information could be captured. The inventory dataview has latitude/longitude fields but it does not have a geography lookup fields. Sometimes the cooperator record associated with the ‘harvested’ action is not from the same geography as the grow-out location (nurseries, external private sector grow out/donation, etc.).




Attachments (2)

Inventory lot origin column.pdf​ (885.1 KB ) - added by Lisa Burke 5 years ago.
Inventory lot origin column
Trac_2333.sql​ (2.4 KB ) - added by Benjamin Haag 4 years ago.

Download all attachments as: .zip

Change History (21)

by Lisa Burke, 5 years ago

Inventory lot origin column

comment:1 by Lisa Burke, 5 years ago

Curator feedback - create a trigger where the grow out location field is filled in based on the Harvested inventory action coop field.

comment:2 by Kurt Endress, 5 years ago

Has this ticket changed from a request to add a field to a dataview into a request for a new datatrigger? I don't understand what is being requested.

comment:3 by Lisa Burke, 5 years ago

It is requesting both:

  1. A new field in the inventory dataview
  2. A data trigger that adds the cooperator geography from the Harvested Action into that field.

comment:4 by Kurt Endress, 5 years ago

For testing I've modified the get inventory dataview on npgsDev to include a Lot Origin field that is computed from the geography of the cooperator of the most recent HARVESTED inventory action. Saved as get_inventory_20210910.

comment:5 by Lisa Burke, 5 years ago

Change column name to Regeneration Locality (the geography ID where the lot was grown - country, state and county).

comment:6 by Lisa Burke, 5 years ago

Separate things to verify:


New column will be editable in the inventory dataview via a geography lookup picker.

The new column will initially be populated through a script that pulls geography information from inventory actions:
Preference source: 1. method 2. Cooperator
Preference action: 1. Harvested 2. Received


Independently from how the column is initially populated:

Trigger checks to see if inventory origin field is null. ONLY IF field is null, then auto-populate with geography captured in the HARVESTED action (method then cooperator)

comment:7 by Lisa Burke, 5 years ago

Amendment to the original request:
Simplify but requesting a new column in the inventory dataview called "Production Location"
Definition = Geographical location where the seed/plant lot was produced". The Column will have a Geography lockup.

comment:8 by Kurt Endress, 5 years ago

Cc: devteam@… removed
Component: Dataviews → Database, Schema Changes
Owner: changed from Kurt Endress to Benjamin Haag

comment:9 by Lisa Burke, 5 years ago

CCB have approved putting this on DEV for testing

comment:10 by Benjamin Haag, 5 years ago

1) Added regeneration_locality_geography_id column to inventory table on DEV.

comment:11 by Benjamin Haag, 5 years ago

2) Added FK from inventory to geography.

comment:12 by Benjamin Haag, 5 years ago

Cc: kurt.endress@… added
Status: new → accepted

comment:13 by Benjamin Haag, 4 years ago

Dataview is ready for testing on DEV.

comment:14 by Benjamin Haag, 4 years ago

Dataview is ready for testing on DEV. Changed new field name to Production Location as requested (above).

by Benjamin Haag, 4 years ago

Attachment: Trac_2333.sql​ added

comment:15 by Lisa Burke, 4 years ago

tested on DEV by Mark Millard and Lisa Burke. Please promote to production when possible.

comment:16 by Mark J. Millard, 4 years ago

Seems to be working after the latest fix to the dataview. Should be ready to move to production.

comment:17 by Lisa Burke, 4 years ago

Milestone: → Next Release - CT

comment:18 by Benjamin Haag, 4 years ago

Milestone: Next Release - CT → Server 2.3.1

comment:19 by Lisa Burke, 4 years ago

Resolution: → fixed
Status: accepted → closed
Note: See TracTickets for help on using tickets.