Example of uploading a PDF Report

The prior posts dealt with uploading text files – perhaps a csv file or a json file. Sometimes reports are sent as PDF. Today I received a good example of a PDF to show how to upload it.

An example of the file is shown below.

XenoGene S.L., CIF B93406692. NICA 46447. C/ Tampa, nº 2, C.P. 29007 de Málaga. Tel. 951 15 23 23 Fax 95

We use the Taxon Name and Rank process as done in this earlier post. The trick is pretty simple: decompose the file using itext7 or earlier versions. And then create an appropriate data table (same format as in the earlier post), and use the same store procedure.

As before, not found bacteria are written to a file for later analysis of exception. In this case there was only two items not found :-).

<XenoGene>
  <Table>
    <taxon_rank>species</taxon_rank>
    <taxon_name>Burkholderia sp. CCGE1002</taxon_name>
    <BaseOneMillion>100</BaseOneMillion>
  </Table>
  <Table>
    <taxon_rank>species</taxon_rank>
    <taxon_name>tsetse mealybug Leptospira santarosai</taxon_name>
    <BaseOneMillion>100</BaseOneMillion>
  </Table>
</XenoGene>

That’s it. Inspect the source to see the details. Note: For different reports, you will need to build custom parsers.

Source is at: https://github.com/Lassesen/Microbiome2/tree/master/uploadXenoGene