Did you know there are four places in which files can be attached to the GenoLogics LIMS?
We probably all know that files can be attached to ResultFile placeholders in the genealogy, and also attached to Projects (Sample Submission Spreadsheets for example), but files can also be attached to Samples and Processes. These latter two cases are not common, but they can be used as ‘work arounds’ in some cases.
For example, you have a process that is a purposed ‘out-of-the-box’ process , and not configurable. You’d like to be able to attach a file to a ResultFile placeholder but you can’t, as you can’t modify the outputs produced by the process. You can still attach a file to the Process though. Since it’s not an output of the process it won’t show up in the genealogy, but you can still browse and search for it, and if you look at the Files attached to the parent Project, you’ll see it there too.
So, how would you go about doing this programmatically? It’s the normal three steps (documented here: Attaching a file to a process placeholder using EPP), but with one minor modification:
It’s the second line which is the key:
where LUID is the LIMS Unique-Id of the process you want the file attached to.
Incidentally, if you want the file attached to a Project, use:
where LUID is the LIMS Unique-Id of the project you want the file attached to.
Further, if you want the file attached to a Sample, use:
where LUID is the LIMS Unique-Id of the Sample you want the file attached to.
If your POST in Step 1 is successful, the XML returned will tell you exactly where to upload the file to. This is something you need to do in your code, using any of the SSH/FTP libraries that are out in the wild. As an example, if I’m coding in Python I tend to use the excellent Paramiko module.
Assuming that your POST in Step 1 was successful, take the XML that was returned, and POST it to the files entity.