view · edit · sidebar · attach · print · history

20100928-resolve-missing-link-limitation-bug

<< Masa.20101018-update-xls2odat | 2010 | Masa.20100927-search-link-between_sl_entry_and_limitation_text >>


  1. Test the solution yesterday on all the data locally
  2. Update xls2odat
  3. Update gem for xls2odat suspend
  4. Add prefix in xls2odat

Goal
  • Resolve Limitation Text bug / 100%
  • Update xls2odat / 100%
Milestones
  1. Test locally 9:30
  2. Summarize the new task 11:00
  3. BraSt solutin 11:30
  4. Experiment 12:00
  5. Make a test 14:00
  6. Test it for the actual data
  7. Commit & Push 14:45
  8. Make a gem for installation suspend
  9. Add prefix in xls2odat 16:40
Summary
Commits
  1. oddb.org Temporary treatment for missing limitation text link
  2. xls2odat Updated analazer method for Price iteration
  3. xls2odat Possible to add prefix in column A
ToDo Tomorrow
Keep in Mind
Attached Files

Test the solution yesterday on all the data locally

Default

Test code
src/plugin/bsv_xml.rb

# in order to refresh limitation text old objects in ODBA cache before updating
# otherwise, the link between sl_entry and limitation_text may not produced
# even if there are both objects in ODBA cache
if sl_entry.limitation_text || txt_ptr.resolve(@app)
    @app.delete txt_ptr
end
                @app.update txt_ptr.creator, lim_data, :bag

Result

Ticket 242 result Before

After

Commit

Update xls2odat

Davatz-san's mail

We need to get table 7 for xls2odat 3.0 Export right. Please see the attached conf-file file. See the fields

       07 4
       07 6

An iteration for the same price would look like this:

 07|20071011000000|15866|PPUB|4|17.15|||
 07|20071011000000|15866|PSL1|4|7.61|||

The codes that can be set are

 PPUB = public price
 PPHA = chemist&#8223;s price
 PEXF = Ex-Factory price
 PDOC = doctor&#8223;s price (for example IVF supplier)

Second task:

Here is the update config file for Galdat 3.0

The filenames for galdat 3.0 should be

       s01x

and following.

For the future:

       h01x

would just be Mutation. But that is not necessary at the moment.

If xls2odat detects that there is a table 7 specified in conf.xls then the files names should start with

       s01x
       s03x    [ this is Galdat 3.0 nameing convention ]
       s07x

etc. If there is no table 7 specified in conf.xls then the file names should be

       H01
       H03     [ this is Galdat 2.1 nameing convention ]
       H07

etc.

Also if there _is_ a table 7 there then we do not need any logfiles. If there is _no_ table 7 in the conf.xls we do need the *.LOG files.

BraSt for Solution (task 1)

  • The iteration depends on the configuration information
  • Two thing, Price Type and Price column, are necessary to set
  • Lets think about setting duplication of configuration regarding price

Notes (task 2)

  • Galdat 3.0 includes 07 configuration
  • We can judge the version, 2.1 or 3.0, by checking 07 configuration
  • sXX includes all the data in version 3.0
  • hXX includes only diff data in version 3.0

Confirm the current result

masa@masa ~/ywesee/xls2odat $ ruby -I lib bin/xls2odat conf_gal3.xls Biopartner_neu.xls

Result

  • No error
masa@masa ~/ywesee/xls2odat $ ls
bin                 conf_gal3.xls      doc                  H01      H03      H06      H07      H19      lib      README    test
Biopartner_neu.xls  conf_gal3.xls.org  galdat_3.0_2010.pdf  H01.LOG  H03.LOG  H06.LOG  H07.LOG  H19.LOG  LICENSE  setup.rb  xls2odat-1.1.2.gem

H07

07|20100928|30000000|PPUB|1|1.75
07|20100928|30000001|PPUB|1|1.9
07|20100928|30000002|PPUB|1|1.3

.....

Goal (z.B.)

07|20100928|30000000|PPUB|1|1.75
07|20100928|30000000|PPHA|1|2.75
07|20100928|30000001|PPUB|1|1.9
07|20100928|30000001|PPHA|1|2.9
07|20100928|30000002|PPUB|1|1.3
07|20100928|30000002|PPHA|1|2.3

.....

Restore the algorithm in my brain
xls2odat

...reviewing...

Notes

  • 'iteration' is implemented by ','
  • but it is only for column name
  • the easiest solution will be the update the iteration process also for string data
  • z.B. not only 'A,B' but also '"A","B"'

Test first
test/test_xls2odat.rb

    def test_analyzer
      # iteration
      aseert_equal "AAA", @parser.send(:analyzer, '"AAA","BBB"', row, @data)

Confirm to fail


masa@masa ~/ywesee/xls2odat $ ruby test/test_xls2odat.rb 
Loaded suite test/test_xls2odat
Started
F
Finished in 0.019698 seconds.

  1) Failure:
test_analyzer(Xls2odatTest) [test/test_xls2odat.rb:127]:
<"AAA"> expected but was
<"AAA\",\"BBB">.

1 tests, 12 assertions, 1 failures, 0 errors

Update the method
lib/xls2odat.rb

masa@masa ~/ywesee/xls2odat $ ruby test/test_xls2odat.rb 
Loaded suite test/test_xls2odat
Started
.
Finished in 0.017786 seconds.

1 tests, 17 assertions, 0 failures, 0 errors

Test it for actual data

07|20100928|30000000|PEXF|1|1.12
07|20100928|30000000|PPUB|1|1.75
07|20100928|30000001|PEXF|1|1.51
07|20100928|30000001|PPUB|1|1.9
.....
  • looks good

Commit

Update gem for xls2odat

Error

masa@masa ~/work/xls2odat $ gem build xls2odat.gemspec 
WARNING:  no rubyforge_project specified
ERROR:  While executing gem ... (NoMethodError)
    undefined method `>' for nil:NilClass
masa@masa ~/work/xls2odat $ gem -v
1.3.7

suspend

Add prefix in xls2odat

Task

  • if there is only A column in a line AND there is spaces before the data
  • then add the data as prefix the following A column data

Algorithm

  • when parsing the data file, when checking the number of data,
  • if there is only one data in column A AND there is space before the data
  • keep it
  • if column A data is called from analyzer method,
  • put it before the data

Commit

view · edit · sidebar · attach · print · history
Page last modified on July 13, 2011, at 11:58 AM