Range for lab test

Hello @all,

I want to know how can I create a range of one lab-test. e.g. (>90) e.g. (<90)

till now I have created this Post Request in the encounter entity and I can get the output range with MIN and MAX e.g. (1-100). Here you can find the post request and the output in bahmni.

How can I get the range like (>90) or (<90)?

image

@gsluthra or @angshuonline can you help me with this?

I didn’t exactly understand what you are attemping, but maybe this can help:

The team is writing performance tests in Gatling, to test the Bahmni server. These tests are written using Gatling (Scala based DSL). If you see this file, you can see different methods for constructing POST/GET calls over REST APIs to Bahmni server. Maybe you can mimic this in your code.

If this is not helpful, please provide more details of what you are trying to achieve, and maybe we can find sample code for you to refer.

@gsluthra thank you.

So the problem is I want a different type of range when I get the result from LIS Tools like in the image down in this comment. I want lab range results in those 3 types:

a) → (1 - 100)

b) → (>90)

c) → (<90.3)

For a) solution (1 -100) I have used the POST request in encounter like this:

{
   "patient":"c9e0b6f7-9a83-4d59-bc3b-155e6f404e76",
   "visit":"4f323c07-6b4c-492c-bb88-0de732688aa3",
   "encounterType":"82024e00-3f10-11e4-adec-0800271c1b75",
   "obs":[
      {
         "obsDatetime":"2022-08-02T02:29:58.000+0200",
         "order":"fc04e950-449a-431f-9607-6a116779449f",
         "concept":"3a3ab17e-6bf1-480b-bc09-8fabaa0773b1",
         "groupMembers":[
            {
               "obsDatetime":"2022-08-02T02:29:58.000+0200",
               "order":"fc04e950-449a-431f-9607-6a116779449f",
               "concept":"cc83aa7e-4e6c-4414-9682-806484c5eb88",
               "groupMembers":[
                  {
                     "concept":"cc83aa7e-4e6c-4414-9682-806484c5eb88",
                     "value":"6"
                  },
                  {
                     "concept":"82063446-3f10-11e4-adec-0800271c1b75",
                     "value":"1"
                  },
                  {
                     "concept":"8206f0cb-3f10-11e4-adec-0800271c1b75",
                     "value": "100"
                  }
               ]
            }
         ]
      }
   ],
   "encounterProviders":[
      {
         "provider":"7d162c29-3f12-11e4-adec-0800271c1b75",
         "encounterRole":"a0b03050-c99b-11e0-9572-0800200c9a66"
      }
   ]
}

What should I do to have b) and c)? First, is this possible and if yes do you know how to build the body for HTTP Request?

cc: @angshuonline @binduak @rohit.yawalkar – can you suggest if this is possible?

1 Like

First step

File → /var/www/bahmniapps/clinical/clinical.min.5fff11e9.js

Search for: ,$scope.hasNotes=function(){return!(!$scope.test.notes&&!$scope.test.showNotes)},

Replace with: ,$scope.hasNotes=function(){return!(!$scope.test.notes&&!$scope.test.showNotes)},$scope.getFormattedRange=function(test){if(test.minNormal&&test.maxNormal){return "(" + test.minNormal + " - " + test.maxNormal + ")"}else if(test.minNormal&&!test.maxNormal){return "(" + test.minNormal + "<)"}else if(!test.minNormal&&test.maxNormal){return "(<" + test.maxNormal + ")"}else{return ""}},

Second step

File → /var/www/bahmniapps/clinical/clinical.min.web.bb24fcfe.js

Search: ,result.hasRange=result.minNormal&&result.maxNormal})}

Replace with: ,result.hasRange=result.minNormal||result.maxNormal})}

Third step

File → /var/www/bahmniapps/clinical/displaycontrols/investigationresults/views/investigationTableRow.html

Search for: <span bo-text="'(' + test.minNormal + ' - ' + test.maxNormal + ')'"></span>

Replace with: <span bo-text="getFormattedRange(test)"></span>