Skip to content

Commit

Permalink
fix incorrect refs to user defined enum fields
Browse files Browse the repository at this point in the history
  • Loading branch information
jambun committed Jun 28, 2022
1 parent 2e3ff96 commit 2f2c6da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion backend/model/reftracker_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ class RefTrackerClient


def self.get_question(question_no)
resp = ASUtils.json_parse(self.get('getQuestion', {:parameters => {:key => 'question_no', :value => question_no, :format => 'json'}.to_json}))
# resp = ASUtils.json_parse(self.get('getQuestion', {:parameters => {:key => 'question_no', :value => question_no, :format => 'json'}.to_json}))

resp = ASUtils.json_parse(File.read(File.join(File.dirname(__FILE__), '..', '..', 'samples', 'question.json')))

# if the question doesn't exist it returns this:
# [{"result":"No Question for these parameters format:json key:question_no value:blah","status":"200"}]
Expand Down
7 changes: 4 additions & 3 deletions backend/model/reftracker_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ def self.map_accession(qp, agent_uri, subject_uris)

acc['title'] = qp['bib_title']

acc['id_0'] = qp['bib_udf_tb03']
acc['id_0'] = qp['bib_number']
# acc['id_0'] = qp['bib_udf_tb03']

acc['accession_date'] = qp['question_closed_datetime'].split[0]

Expand All @@ -157,8 +158,8 @@ def self.map_accession(qp, agent_uri, subject_uris)
acc['user_defined']['text_2'] = qp['bib_udf_ta02']
acc['user_defined']['text_4'] = qp['question_udf_tb15']
acc['user_defined']['text_5'] = qp['question_udf_ta09']
acc['user_defined']['controlled_value_1'] = map_valuation_status(qp['question_udf_cl18'])
acc['user_defined']['controlled_value_3'] = qp['question_udf_cl01']
acc['user_defined']['enum_1'] = map_valuation_status(qp['question_udf_cl18'])
acc['user_defined']['enum_3'] = qp['question_udf_cl01']

acc['extents'] = [{}]
acc['extents'][0]['container_summary'] = qp['bib_udf_tb01']
Expand Down

0 comments on commit 2f2c6da

Please sign in to comment.