Opened 8 years ago
Closed 6 years ago
#1811 closed enhancement (fixed)
taxonomy species citation lookup change
| Reported by: | Melanie Schori | Owned by: | Kurt Endress |
|---|---|---|---|
| Priority: | medium | Milestone: | Server 1.10.5 |
| Component: | Dataviews (CT) | Version: | N/A |
| Severity: | Keywords: | ||
| Cc: | Database Engine: | N/A | |
| Operating System: | N/A |
Description
Please modify the SQL for taxonomy_species_citation_lookup. The current SQL is below:
SELECT
cit.citation_id AS value_member,
COALESCE('. ' + l.abbreviation, )
+ COALESCE( '. ' + COALESCE(cit.citation_title, cit.title), )
+ COALESCE(cit.author_name, 'Unrecorded Author')
+ COALESCE( '. ' + CONVERT(NVARCHAR, cit.citation_year), )
+ COALESCE( '. ' + cit.reference, )
AS display_member,
cit.taxonomy_species_id,
ts.current_taxonomy_species_id
FROM
citation cit
LEFT JOIN literature l ON cit.literature_id = l.literature_id
INNER JOIN taxonomy_species ts ON cit.taxonomy_species_id = ts.taxonomy_species_id
Changed SQL:
SELECT
cit.citation_id AS value_member,
COALESCE('. ' + l.abbreviation, ) can the initial '. ' be removed?
add CASE statement here with COALESCE to check for and display citation.type_code
+ COALESCE( '. ' + CONVERT(NVARCHAR, cit.citation_year), ) moved up
+ COALESCE( '. ' + COALESCE(cit.citation_title, cit.title), )
+ COALESCE(cit.author_name, ) Unrecorded Author removed
+ COALESCE( '; ' + cit.reference, ) first coalesce option changed from . to ;
AS display_member,
cit.taxonomy_species_id,
ts.current_taxonomy_species_id
FROM
citation cit
LEFT JOIN literature l ON cit.literature_id = l.literature_id
INNER JOIN taxonomy_species ts ON cit.taxonomy_species_id = ts.taxonomy_species_id
- I would like the initial '. ' to be removed because it prevents me from typing the initial letter of the reference I want as a means of opening the lookup picker
- The citation type_code needs to be added so we can distinguish between NULL, 'RELATIVE', 'NODULATION', AND 'MEDICINAL'. Rather than display the full type code, please use a CASE statement to return '. ' + cit.type_code using 'CWR' for 'RELATIVE', 'NOD' for 'NODULATION', and 'MED' for 'MEDICINAL'.
- I would like the year to appear after the type code.
- 'Unrecorded Author' is completely unhelpful and can be removed.
- Author names often finish with a '.', so adding another '. ' directly after is not helpful. I would prefer a semicolon instead.
Please let me know if there are potential problems created by any of these changes.
Attachments (1)
Change History (5)
comment:1 by , 8 years ago
| Component: | Other → Dataviews |
|---|---|
| Milestone: | → Server 1.10.5 |
| Status: | new → addressed |
by , 7 years ago
| Attachment: | Tax species citation lookup picker.png added |
|---|
comment:2 by , 7 years ago
This appears to have major problems. I created an entry into the new CWR table for Solanum insanum. The attached screenshot shows what I got - the last two citations seem to be modified, but the other ones are not.
comment:4 by , 6 years ago
| Resolution: | → fixed |
|---|---|
| Status: | addressed → closed |

Lookup modified on npgsdev and available for testing there. Saved as taxonomy_species_citation_lookup_20190405.dataviewxml