-
Notifications
You must be signed in to change notification settings - Fork 10
Update Barcode Scanner #632
base: master
Are you sure you want to change the base?
Conversation
This add the ability to change biomass_remaining, sequencing_status and obsolete from the barcode scanner
|
Ok all these changes should be made with the info we have right now. |
👍 |
This is on webdev now :) |
Thanks! On Fri, Feb 21, 2014 at 4:22 PM, teravest [email protected] wrote:
|
Minor aesthetic comment: can you change the |
metadata checker gets triggered regardless of project and/or project_group, so that should be conditional for AG at this point |
The default value for "Sequencing Status" in the database is NULL, so I think there needs to be an "unknown" (or "N/A" or something to that effect) option in that dropdown |
Many of the fields have a "Current: " next to them (I assume so that you can tell if you're changing something before you hit submit?), but others don't. |
Barcode 000007185 is office succession, but the checkbox or emailing says "Send kit owner an email" I might be mistaken, but I don't think that study has kits |
Not sure, but I think only projects in the AG project group currently work (do not have access to SQL developer atm) |
I forgot the code to look up the barcode itself currently uses a stored procedure that looks in an american gut table. So this will only work with American Gut right now. I am going separate that into two stored procedures and only call the american gut one if it is an american gut barcode :) |
Updates are deployed on Webdev |
Updated webdev again this morning. |
open group_name_ for | ||
select g.group_name from project_groups g inner join project p on g.group_id = p.group_id | ||
where p.project = project_name; | ||
null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the null for? Doesn't appear to be in other SPs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uhg, I always forget to remove those. Its from the create new procedure thing on sql developer. I want to wait till tomorrow to do this so we don't lose it.
form['obsolete_status']) | ||
data_access.setBarcodeProjType(form['project'], prev_barcode) | ||
req.write("General Barcode Information Updated<br>") | ||
except: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you except a particular type of Exception here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you guys know what type of exceptions the database throws?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not offhand, might have to check cx_Oracle docs
@teravest not sure if this has to be part of this pull request, but I looked for barcode
I'm looking at the code now. |
con = self.getMetadataDatabaseConnection() | ||
result = con.cursor() | ||
con.cursor().callproc('get_sequencing_statuses', [result]) | ||
seq_statuses = [row[0] for row in result] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this fail with an IndexError
and should this be caught?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. Even if no rows are returned seq_statuses
will end up as an empty list. And unless the procedure returns a row with zero fields (I don't think this is possible), row[0]
will always exist. This might be the kind of place you'd use an assert, I guess, because these tests would be for things that should not be possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha, thanks for the explanation.
Great stuff @teravest |
I will deploy this to webdev after we deploy the mapmarker to live
…issue626barcodeseparate
@teravest, is this ready to be merged? |
no, I have some things to change and its gonna need another review and more On Wed, Mar 26, 2014 at 11:07 AM, adamrp [email protected] wrote:
|
Fair enough, thanks @teravest |
Addresses issue #626
This updates the barcode scanner to be able to edit the fields in the barcode table.
I also created a controlled vocabulary for the sequencing_status column.
I also rewrote a giant req.write in barcode_utils.psp so that it was in html instead of a string.