Track who gets results printed #691
Changes from all commits
6a1bd98
dd7101d
c1f09fb
d4bfa07
134f47d
40092be
7e88158
42ccf69
b8e7a25
1d675fc
92d0e05
278653a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
reate or replace procedure ag_get_print_results( | ||
kit_id_ in varchar2, | ||
results_ in out types.ref_cursor | ||
)as | ||
begin | ||
open results_ for | ||
select print_results from ag_handout_kits | ||
where kit_id = kit_id_; | ||
end ag_get_print_results; | ||
|
||
|
||
/* | ||
variable user_data_ REFCURSOR; | ||
execute ag_get_print_results('test_kit', :user_data_); | ||
print user_data_; | ||
*/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
alter table ag_kit add print_results varchar(1) default ('n'); | ||
alter table ag_handout_kits add print_results varchar(1) default('n'); | ||
update ag_handout_kits set print_results = 'y'; | ||
update ag_handout_kits set print_results = 'n' where kit_id like 'ts_%'; | ||
update ag_handout_kits set print_results = 'n' where kit_id like 'pgp_%'; | ||
commit; | ||
|
||
update ag_kit set print_results = 'y'; | ||
update ag_kit set print_results = 'n' where SUPPLIED_KIT_ID like 'ts_%'; | ||
update ag_kit set print_results = 'n' where SUPPLIED_KIT_ID like 'pgp_%'; | ||
commit; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think recording this kind of information in the repo is a great idea. I wish we had started earlier, but better late than never! One thing that this currently lacks, however, is some comments There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. based on the last deploy, I thought this was a good idea :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure how I feel about doing this though :| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ElDeveloper do you want to voice your concerns here or offline? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this needs to be merged, then merge we should and we can discuss about this later. In any other case I would much rather discuss this offline, just to make this discussion much more agile, not with any other intent. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay -- let's discuss this evening and merge after There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This just needs to be deployed before May 1st. We can have this discussion before the merge. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -230,17 +230,19 @@ def reassignAGBarcode(self, ag_kit_id, barcode): | |
con = self.getMetadataDatabaseConnection() | ||
con.cursor().callproc('ag_reassign_barcode', [ag_kit_id, barcode]) | ||
|
||
def addAGKit(self, ag_login_id, kit_id, kit_password, swabs_per_kit, kit_verification_code): | ||
def addAGKit(self, ag_login_id, kit_id, kit_password, swabs_per_kit, | ||
kit_verification_code, printresults='n'): | ||
""" | ||
return values | ||
1: success | ||
-1: insert failed due to IntegrityError | ||
""" | ||
con = self.getMetadataDatabaseConnection() | ||
try: | ||
con.cursor().callproc('ag_insert_kit', [ag_login_id, kit_id, | ||
kit_password, swabs_per_kit, | ||
kit_verification_code]) | ||
con.cursor().callproc('ag_insert_kit', [ag_login_id, kit_id, | ||
kit_password, swabs_per_kit, | ||
kit_verification_code, | ||
printresults]) | ||
except cx_Oracle.IntegrityError: | ||
return -1 | ||
return 1 | ||
|
@@ -676,6 +678,7 @@ def handoutCheck(self, username, password): | |
|
||
return is_handout.strip() | ||
|
||
|
||
def checkBarcode(self, barcode): | ||
# return a tuple consists of: | ||
# site_sampled, sample_date, sample_time, participant_name, | ||
|
@@ -776,3 +779,12 @@ def getBarcodesByKit(self, kitID): | |
barcodes = [row[0] for row in results] | ||
return barcodes | ||
|
||
def checkPrintResults(self, kit_id): | ||
con = self.getMetadataDatabaseConnection() | ||
results = con.cursor() | ||
con.cursor().callproc('ag_get_print_results', [kit_id, results]) | ||
print_results = results.fetchone() | ||
if print_results is None: | ||
return None | ||
else: | ||
return print_results[0].strip() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just out of curiosity, is the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it has been necessary on there functions when pulling stuff out of the db. On Thu, May 1, 2014 at 4:26 PM, adamrp notifications@github.com wrote:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm I don't think it's needed, but it's also not hurting. So I'm fine with this 😄 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I remember this, it might seem redundant but some data was/is not sanitized on it's input. |
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 add an example call to the end of this file, as we have for other procedure files?
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.
Its in the db, but I didn't want to put kit_ids on github.
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.
Doesn't have to be a real Kit ID, but even if it is, I wouldn't be concerned.