by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
kiranp0
@kiranp0
Screenshot from 2020-05-17 17-12-37.png
Please help me
Thanks
Jordi Puiggené
@xispa
Hi @kiranp0 , pin senaite.lims 1.3.3.1 in your buildout configuration file
Jordi Puiggené
@xispa
@kiranp0 we've released a new version of senaite.health with this issue resolved: https://pypi.org/project/senaite.health/
Can you run bin/buildout again?
mateoke
@mateoke
In Senaite Health, is there a way to bulk upload a list of patients?
Jordi Puiggené
@xispa
There is no such functionality. You might consider to create your own script and use senaite.jsonapi:
https://senaitejsonapi.readthedocs.io/en/latest/
Another, but not recommended option, is to use the legacy xlsx for setupdata (test.xlsx): https://github.com/senaite/senaite.health/tree/master/bika/health/setupdata/test
4 replies
nassimcha
@nassimcha
Hello everyone. I am a complete noob when it comes to Google Cloud. I managed to create an Ubuntu VM and install senaite on it
But I can't access it unfortunately. I already installed it on a local machine and I could access it on localhost, but when it comes to cloud there is no documentation about how to access to it
Can anyone please help me with this?
ernesso
@ernesso
Hello Everyone I am new on senaite. in fact i just installed senaite lims. I wanted to customize the home page by adding a css file thanks
Mullins360
@Iniciativa360
@nassimcha I saw your message and was about to start down the same path. Did you manage to get the issue resolved?
Jordi Puiggené
@xispa

@nassimcha @Iniciativa360 you need the host to redirect the requests to the internal VM by using a reverse proxy. It should look similar to this in nginx:

location / {
        proxy_pass https://<your_vm_ip>;
        proxy_set_header    X-Forwarded-Proto https;
        proxy_set_header    Host            $host;
        proxy_set_header    X-Real-IP       $remote_addr;
        proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_ssl_verify    off;
    }

See nginx's ngx_http_proxy_module

Jordi Puiggené
@xispa

@ernesso you can add your own add-on and create your own adapter by making use of the IFrontPageAdapter like follows:

from bika.lims import api
from bika.lims.interfaces import IFrontPageAdapter
from zope import interface

class MyFrontPageAdapter(object):
    interface.implements(IFrontPageAdapter)

    def get_front_page_url(self):
        return api.get_url("my_frontpage")

Register the adapter in configure.zcml:

<configure
    xmlns="http://namespaces.zope.org/zope">

  <!-- Adapter for custom front-page  -->
  <adapter
    factory=".myfrontpage.MyFrontPage"
    provides="bika.lims.interfaces.IFrontPageAdapter"
    for="*" />

</configure>

And add your view ' MyFrontPage` in "myfrontpage.py" and template.

Alternatively (not reccomended), you can tweak the "vanilla" template: https://github.com/senaite/senaite.core/blob/1.3.x/bika/lims/browser/templates/senaite-frontpage.pt

Please, refer to Plone documentation for further info on how to add your views, templates, adapters, etc.

axelfiedler
@axelfiedler

Hi! I am trying to fetch some sample information and attachments that are stored in Senaite using Python to post-process them in a different web app. I believe the senaite.jsonapi should be the right tool to do so. However I am a little confused how to set this up. On Github it says to install the api I need to add it to the Plone eggs. I understand that this would add the json functionality to the Senaite installation. However what do I need to install on the system where my post processing web app ist running to use e.g.

from bika.lims import api

Do I need to install Senaite on that system as well just to get the api in Python?

Pau Soliva
@Espurna
Installing the egg will add the RESTful JSON API for CRU operations through GET and POST
You have more information here: https://senaitejsonapi.readthedocs.io/en/latest/
You do not have to install SENAITE on your other system, just send http requests to your SENAITE instance
SENAITE will send the result for each request in JSON format
axelfiedler
@axelfiedler
Hi @Espurna thanks for your reply! I think I was reading the wrong documentation first. The one you send me is exactly what I was looking for. Thank you!
After playing around a little bit I am able to fetch AnalysisRequests via json. Is it also possible to get a list of all samples and all attachments of the samples?
ernesso
@ernesso
thanks @xispa
Pau Soliva
@Espurna
@axelfiedler Yes, you can get all the Python object information in JSON: https://senaitejsonapi.readthedocs.io/en/latest/quickstart.html?highlight=object#get-records-full-data
axelfiedler
@axelfiedler
Thanks for your help!
axelfiedler
@axelfiedler

I have one remaining issue. When I am logged in in a browser I am able to access /senaite/@@API/senaite/v1/analysisrequest manually. However if I try to fetch the information via Javascript like this:

  function jsontest() {
    // alert('Test1')
    $.getJSON('http://IP.TO.SENAITE/senaite/@@API/senaite/v1/analysisrequest', function(data) {
      alert('Test2')
      console.log(data)
    });
  }
  document.getElementById('test').addEventListener('click', jsontest, false);

the fetch seems not to be successful and the second alert as well as the console log is not performed. Do I somehow need to authorize myself differently when trying to fetch the data through JS?

axelfiedler
@axelfiedler
I was able to solve this using requests.Session():
    with requests.Session() as se:
        se.get("http://<senaite_ip>/senaite/@@API/senaite/v1/login?__ac_name=admin&__ac_password=adminpw")
        response = se.get("http://<senaite_ip>/senaite/@@API/senaite/v1/analysisrequest?complete=True")
axelfiedler
@axelfiedler
Hi, I ran into another question. How can I find via JSON the connected analysis request of an attachment, where an analysis service was selected instead of the option "Attach to Analysis Request"? If the attached to an analysis request I can find the attachment in the json item under "Attachment". However if I select an analysis service this field is set to null. I also can't find any connection between the analysis request and the attachment in /senaite/@@API/senaite/v1/attachment/ or in /senaite/@@API/senaite/v1/AnalysisService. Where is this connection established?
Jordi Puiggené
@xispa
@axelfiedler , note the "AnalysisService" content type is used as a the "template" on "Analysis" content types creation process. "AnalysisRequest" content types (aka Samples) contain "Analysis" (not "AnalysisService"), thereofre you assign the attachments to "Analysis"
axelfiedler
@axelfiedler
@xispa Thanks for the clarification. I think I got it now!
Ronald
@ronna
Morning @xispa and @ramonski I have created an issue for a missing add client button, I am not sure if it was a Senaite Core or LIMS issue. senaite/senaite.core#1608
ernesso
@ernesso
Hello All. Please I would like to add a step at the start of the sample workflow. Thus, just after creation of the analyzes the sample goes to the stage to be invoiced. a cashier role user (that I would also like to add) modifies the state to be sampled by generating the invoice (it would go from the stage not yet invoiced to the invoiced state) thank you
NEWAGE-Labs
@NEWAGE-Labs

Hello! We are currently building a custom report using senaite.impress, and had a question about multi-sample reports. We are trying to get multiple AR's to show up on one report, rather than generating a separate report for each. Is there a way to prevent the report from automatically generating a page for every AR?

We tried just printing the first AR's ID without including any other ARs, and can't seem to do that with this code:

<tal:report define="AR1 python:view.collection[0];">
    <h1 tal:content="AR1/id">ID Placeholder</h1>
</tal:report>

It repeats every ARs ID, not just the first one. Is there a different way to handle the "collection" object for multi-reports? The goal is to be able to show 2 samples side-by-side within a custom comparison report. Something like:

<tal:report define="AR1 python:view.collection[0]; AR2 python:view.collection[1];">
    <h1 tal:content="AR1/id">This will be replaced with the ID of the first AR</h1>
    <h1 tal:content="AR2/id">This will be replaced with the ID of the second AR</h1>
</tal:report>

Where both ARs can be manipulated simultaneously in the report, rather than using the tal:repeat and doing one at a time.

NEWAGE-Labs
@NEWAGE-Labs
Senaite.Impress v1.2.3
NEWAGE-Labs
@NEWAGE-Labs

After investigating more, we're not sure this is possible with a simple solution. We've tried a few different python calls, but cannot locate an object that contains both selected Samples. It appears that the context of 'view' can not access both Samples.

Does anyone know of a way to incorporate two samples into one report without them being in a Batch together? Is there a list of supermodels that can be accessed?

Ramon Bartl
@ramonski
@NEWAGE-Labs: You can have multiple Samples on one report as long as they belong to the same client. Have a look into the MultiDefaultByColumn Template:
https://github.com/senaite/senaite.impress/blob/1.x/src/senaite/impress/templates/reports/MultiDefaultByColumn.pt
If you need to show Samples from different Clients on the same PDF, you need to overwrite this piece of code:
https://github.com/senaite/senaite.impress/blob/1.x/src/senaite/impress/ajax.py#L192
Ramon Bartl
@ramonski
@ernesso: Try to add your desired states directly into the bika_ar_workflow in the ZMI first
states 2020-07-23 23-19-49.png
Afterwards, you can export your customized Worfklow to put it in your add-on
NEWAGE-Labs
@NEWAGE-Labs
@ramonski Awesome! Thanks!
ernesso
@ernesso
thanks you @ramonski I have already added my state but I cannot export it in order to be visible on my view of the samples
ernesso
@ernesso
Hello to all. please how to change senaite to non contractual lab. So we could print the invoice just after the analysis request and not wait for the verification or the publication before create or print invoice thanks
Ilia Volkov
@VolkovIlia
Hi to everyone! Can't find "Key-turn ready SENAITE VM" link for download, can anyone share it?
ernesso
@ernesso
Hi Everyone when i deploy my senaite lims on the server on line, i get this error "Mixed Content: The page at 'https://mydomain/analysisrequests/ar_add?ar_count=2' was loaded over "
Please any issue to solve it because i cant display the data i insert on line
Pau Soliva
@Espurna
Hi @VolkovIlia The VM is no longer available to download due to the high demand of help it generated. You can play with the LIMS using docker: https://github.com/senaite/senaite.docker#try-senaite
RaabJoh
@RaabJoh
Hello, I haven't been to involved with our Senaite LIMS in the last 12 months but recently got some time to look into issues which are still present. I created some new input fields here: https://github.com/senaite/senaite.core/blob/master/bika/lims/content/analysisrequest.py but I am unable to sort them in the "Schema" section for rearrangements... https://github.com/senaite/senaite.core/blob/master/bika/lims/content/analysisrequest.py#L1359
They just don't move ^^ Where else do I have to implement them to get some movement? and the next thing: I would like to force those properties onto a secondary without being able to change them (for instance, one field is manufacturer and that shouldn't change for secondaries and i would like to remove the possibility of some user changing it by mistake). As far as I remember I have to implement those here:? https://github.com/senaite/senaite.core/blob/master/bika/lims/browser/analysisrequest/add2.py#L1044 or am I mistaken?
Jordi Puiggené
@xispa

Hi @RaabJoh , better you create your own add-on and implemnt all that logic there. To add new fields in your add-on for a given type of object, you can use SchemaExtender. You can use SchemaModifierto modify the properties and behavior of the fields that come by default with the system (see https://github.com/plone/archetypes.schemaextender). You have an example on how to "extend" an object with more fields and modify those that come by default here:

Regarding your question about changing the behavior of Add Sample form, you can make use of the "hooks" Add form provides by using adapters providing bika.lims.interfaces.IGetDefaultFieldValueARAddHookand bika.lims.interfaces.IAddSampleObjectInfo. Take a look at senaite/senaite.health#149

RaabJoh
@RaabJoh
Alright thank you, I'll have a look at those things :)