Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

A useful new The Medical Objects RESTful web service is now available. A POST is in json format and needs to include three things:

1. patient data in json (or cjson) format

2. Package data if needing an extension or separate package to the default HL7_v2_VMR

3. the gello code itself.

 


Information is available here.https://kb.medical-objects.com.au/display/pub/gello+rest+api+-+generic+version

This service is a research and development site currently. We welcome feedback from users to the info@medical-objects… address. If you wish to use it for commercial/mainstream purposes, please contact us.

 


Use of SNOMED-CT

Use of SNOMED CT through this web service requires a license from IHTSDO snomed.org . Do not use this functionality if you are not licensed to do so.

 

 

 


Worked example – Body Mass Index (BMI)

This worked example gets the latest height and weight for a patient and calculates the BMI on the MO web server, and then retrieves the result as json. The example makes use of the ‘Postman – REST Client’ chrome app.

 

 

 


Get it going in the editor first

 

Here .  Here is some GELLO code to calculate BMI:

 


     imports  imports HL7_v2_VMR_V1
     Context  Context SinglePatient
     Let  Let allWeights:Sequence(Observation) = vitals.weight 
 Let    Let allHeights:Sequence(Observation) = vitals.height
     Let Let mostRecentWeight:Observation = allWeights->sortedBy(dateTime)->last() 
 Let    Let mostRecentHeight:Observation = allHeights->sortedBy(dateTime)->last()
  Let    Let wt:Real = mostRecentWeight.value.oclAsType(PQ).value
     Let Let ht:Real = mostRecentHeight.value.oclAsType(PQ).convert('m').value
  Let    Let BMI: Real = wt/ht.power(2)
     If  If BMI < 18.5 then 'Underweight'
         else  else If BMI >= 18.5 and BMI < 25 then 'Normal'   
         else  else If BMI >= 25 and BMI < 30 then 'Overweight'               else
 else 'Obese'
               endif
            endif
         endif
 
 
 endif
 endif
 endif

Using fifthTest.xml, here is the result:

 

 Image Added


The url string for the POST in the REST client is:  http://mowgli.medical-objects.com.au/rest/gellov2/generic 

The json code for a POST is in the attached folder and here and it is named POST.txt.  Instance data for the data model starts on line 3. Package data starts on line 1912 and the The Gello query itself is on 19213604.

Here is a screen shot of Postman showing some of the POST json text:

 Image Added

 



and the result itself:

 Image Added

 

In the POST text note how the GELLO section is now written with  with new line characters at the start of each line. 

If we don’t need want to return all see the variables , delete ( say for debugging - although you would do this more in the editor), add ‘V,1’ from to line 2, to make it:


 

...

   "Debug": "V,1",

You can also return the result as a tuple instead of a single typed value (which in this case is simply a string).