This is an old revision of the document!
Oftentimes you have external data coming from a REST HTTP API and want access to it through the Pathomation software platform for digital pathology and virtual microscopy. Importing the data as Pathomation form data may not always make sense for a variety of reasons.
PMA.core allows you to link external rest APIs and use them as regular form data. This works by invoking a user defined command line application, that must exist in the system that hosts PMA.core. Such applications can be:
PMA.core executes the application for a given image path and can also supply extra command line arguments. Once the application has finished, PMA.core reads the standard output stream and expects a JSON response, in which it attempts to read values for particular fields.
To configure your external HTTP API data link to PMA.core, click on the Add button in the External API data section of the External Data page, of the administrator front-end UI.
On the next page you will be prompted to add
After creating the external database connection we need to create a link between the data and the slides in PMA.core. To accomplish this we need to define an SQL query that will instruct PMA.core how each slide is linked to one or more rows of data in the external connection. To start that we need to click ton Add button in the external data source page
Even though the Add Query page seems complicated it is nothing more than an intuitive UI to create an SQL query so that PMA.core can link the the external data to the slides provided. The page is divided in two parts, on the right hand side there is a treeview with PMA.core slides that is only used for testing the query and on the left hand side UI to create the query. The parts that are needed to successfully create the query are:
As stated an above the #SLIDE_IDENTIFIER# part of the query is dependent on the mode selected and the regular expression if provided. So this can be the file name or the barcode text of a slide, after it is transformed by the regular expression.
Before your query is ready you need to test that it works as expected
To test your query for errors and validating its results you can use the Test query field. You can either write a slide identifier manually in the text box or use the Set from treeview button after selecting a slide from the treeview on the right hand side of the screen.
Clicking on the Execute button will execute the query on the server. Any errors in syntax will be reported immediately bellow the execute button. If no errors occur a popup will appear that will show the results of the query.
After creating the queries you can now use the FormData API to request data by using the Query Id as the Form Id, the same way you request native PMA.core Form Data.
This is the same API that is used to provide external data in downstream application like PMA.studio, PMA.slidebox, PMA.control etc.
See our blog article.