Skip to content

Data APIs for visualization

pplegend edited this page Dec 13, 2011 · 11 revisions

Data APIs for visualization

1 http://jimu.cs.hut.fi/side/person/projects/get/json

Get the project that the person participant in.

Parameters: None. Get user's id through Drupal function: $user->id.

Requirement: Log in as person or researcher

Output format: JSON. Such as:

[ { "project_code": "100031", "name": "ZZZZZ", "id": "14" }, { "project_code": "100034", "name": "New project", "id": "18" } ]

2 http://jimu.cs.hut.fi/side/person/observations/get/json/?type=3&proid=14&end=2012&start=2010

Get the observation for person by drupal user id.

Parameters: 1) observation type. type=0 means hear beat. type=2 means glucose. type=3 means Blood Pressure 2) proid: Project id 3) end: end time such as 2012-10-12 4) start:start time

Requirement: Log in as person or researcher

Output: JSON,

{ "person": { "id": "28" }, "observations": [ { "id": "3", "name": "Blood Pressure", "records": [ { "time": "2011-10-06 13:29:00", "diastolic": "66.0", "systolic": "119.0" }, { "time": "2011-10-06 13:29:00", "diastolic": "66.0", "systolic": "119.0" }, { "time": "2011-10-06 13:29:00", "diastolic": "66.0", "systolic": "119.0" } ] } ] }

3 http://jimu.cs.hut.fi/side/researcher/observations/data/json?type=0&start=2010-10-14&end=2011-12-12&perid=28&proid=14

Get the observations values. It get the user id by $_GET['perid'].

Parameters: 1) observation type. type=0 means hear beat. type=2 means glucose. type=3 means Blood Pressure 2) proid: Project id 3) end: end time such as 2012-10-12 4) start:start time 4) perid: person id

Requirement: Log in as researcher

Output: JSON.

{ "person": { "id": "28" }, "observations": [ { "id": "3", "name": "Blood Pressure", "records": [ { "time": "2011-10-06 13:29:00", "diastolic": "66.0", "systolic": "119.0" }, { "time": "2011-10-06 13:29:00", "diastolic": "66.0", "systolic": "119.0" }, { "time": "2011-10-06 13:29:00", "diastolic": "66.0", "systolic": "119.0" } ] } ] }

4 http://jimu.cs.hut.fi/side/researcher/projects/json

Get all the projects that the researcher is participant in.

Parameters: None.

Requirement: Log in as researcher

Output: JSON,

[ { "nid": "14", "title": "ZZZZZ", "description": "<p>dcdcs</p>\r\n" }, { "nid": "18", "title": "New project", "description": "<p>Description</p>\r\n" } ]

5 http://jimu.cs.hut.fi/side/researcher/projects/persons/json/project_id

Get all the persons that are in a certain project.

Parameters: project_id. the project id.

Requirement: Log in as researcher

Output: JSON.

[ { "id": "19", "name": "m.golivkin@gmail" }, { "id": "14", "name": "[email protected]" }, { "id": "3", "name": "XiaoHang.Zou" }, { "id": "28", "name": "maksim@androidaa" }, { "id": "18", "name": "Maksim" }, { "id": "30", "name": "[email protected]" }, { "id": "31", "name": "Maksim.Foobar" } ]

6 http://jimu.cs.hut.fi/side/project/date/get/json?perid=28&proid=14&start=2011-10-00&end=2011-11-00

Api for getting which date has data in one certain month.

Parameters: perid. proid. start. end. If there is no perid parameter, the default perid is the login use id.

Requirement: Log in as researcher

Outputs: [ { "DAYOFMONTH(time)": "11" }, { "DAYOFMONTH(time)": "25" }, { "DAYOFMONTH(time)": "26" }, { "DAYOFMONTH(time)": "6" }, { "DAYOFMONTH(time)": "18" } ]

Clone this wiki locally