diff --git a/backend/model/reftracker_client.rb b/backend/model/reftracker_client.rb index 842d6b6..089e614 100644 --- a/backend/model/reftracker_client.rb +++ b/backend/model/reftracker_client.rb @@ -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"}] diff --git a/backend/model/reftracker_mapper.rb b/backend/model/reftracker_mapper.rb index 0c107ec..c96b4c3 100644 --- a/backend/model/reftracker_mapper.rb +++ b/backend/model/reftracker_mapper.rb @@ -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] @@ -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']