triumf
(Triumf Maqedonci)
August 3, 2022, 1:01pm
1
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)?
@gsluthra or @angshuonline can you help me with this?
gsluthra
(Gurpreet Luthra)
August 4, 2022, 8:41am
2
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.
json.encounterTypeUuid = encounterTypeUuid;
json.locationUuid = locationUuid;
json.providers(0).uuid = currentProviderUuid;
http("post vitals for a patient")
.post("/openmrs/ws/rest/v1/bahmnicore/bahmniencounter")
.body(StringBody(json.toString()))
.asJson
}
def postOrderEncounter(patientUuid: String, encounterTypeUuid: String, locationUuid: String,
currentProviderUuid: String): HttpRequestBuilder = {
val jsonString: String = Source.fromFile(("src/test/resources/bodies/" +
"orders_body.json")).mkString
val json = dijon.parse(jsonString)
json.patientUuid = patientUuid;
json.encounterTypeUuid = encounterTypeUuid;
json.locationUuid = locationUuid;
json.providers(0).uuid = currentProviderUuid;
"&conceptNames=Prevention+of+Mother-to-Child+Transmission+Intake+Template&conceptNames=Procedure+Notes" +
"&conceptNames=Psychiatrist%27s+Recommendation&conceptNames=Psychosis+Followup+Note" +
"&conceptNames=Psychosis+Intake+Note&conceptNames=Rheumatoid+Arthritis,+Progress" +
"&conceptNames=Rheumatic+Heart+Disease,+Progress&conceptNames=Safe+Abortion" +
"&conceptNames=Seizure+Disorder,+Progress&conceptNames=Sextually+Transmitted+Infections+Intake+Template" +
"&conceptNames=Stroke+OPD&conceptNames=Trauma+Notes&conceptNames=Tuberculosis,+Intake&conceptNames=USG+Notes" +
"&numberOfVisits=1&s=byPatientUuid&v=visitFormDetails")
.queryParam("patient", patientUuid)
}
def getLabOrderResults(patientUuid: String): HttpRequestBuilder = {
http("get lab order results")
.get("/openmrs/ws/rest/v1/bahmnicore/labOrderResults?numberOfVisits=1")
.queryParam("patientUuid", patientUuid)
}
def getVitals(patientUuid: String): HttpRequestBuilder = {
http("get vitals")
.get("/openmrs/ws/rest/v1/bahmnicore/observations?numberOfVisits=2")
.queryParam("concept", "Vitals")
.queryParam("patientUuid", patientUuid)
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.
triumf
(Triumf Maqedonci)
August 4, 2022, 11:51am
3
@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?
gsluthra
(Gurpreet Luthra)
August 8, 2022, 11:04am
4
cc: @angshuonline @binduak @rohit.yawalkar – can you suggest if this is possible?
1 Like
triumf
(Triumf Maqedonci)
September 6, 2022, 1:34pm
5
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>