This is a very concise document explaining how to extract spirometry data from our systems. At the moment you are able to extract shared profiles and the complete spirometry sessions.
Get a list of user profiles currently shared with your organization
Retrieve spirometry tests for users who are sharing with you
SpirometrySession_spirometry_tests
The API key for the demo is api-demo123
You should be able to test it using CURL or another simple client.
$ curl -s -H "Authorization: api-demo123" https://portal.nuvoair.com/api/v1/profiles
$ curl -s -H "Authorization: api-demo123" https://portal.nuvoair.com/api/v1/timelines
https://portal.nuvoair.com/api/v1
name: Authorization
in: header
GET /profiles
Returns an array of profile ids. Required api_key in header
$ curl -s -H "Authorization: api-demo123" https://portal.nuvoair.com/api/v1/profiles
[{"id": "1caddf78e0e2359502600d6c", "email": "demo@nuvoair.com", "patient_name": "Lorenzo", "share_code": "demoshare123"}]
200 OK: successful operation
Array<Profile>
403 Forbidden: Access fobidden
[
{
"id": "660efccc4f3e060001c57e74",
"email": "bob@example.com",
"patient_name": "Bob Smith",
"share_code": "demoshare123"
}
]
{
"code": 403,
"message": "You are not authorized to access this resource. Did you forget your API key in the header request?"
}
| Schema | Scopes | | ---------------------------------------- | ------ | | api_key | |
GET /timelines
Requires api_key in header request
$ curl -s -H "Authorization: api-demo123" https://portal.nuvoair.com/api/v1/timelines
Using optional parameters Use begin_date
$ curl -s -H "Authorization: api-demo123" "https://portal.nuvoair.com/api/v1/timelines?begin_date=2017-01-01"
Using all the optional parameters
The following query uses begin_date
, profile_ids
, and raw
optional
parameters.
$ curl -s -H "Authorization: api-demo123" "https://portal.nuvoair.com/api/v1/timelines?begin_date=2017-01-01&profile_ids=1caddf78e0e2359502600d6c&raw=true"
Omitting begin_date
and end_date
will default to
begin_date=<current_day>
and end_date=<current_day> + 1 day
. If you
want yesterday's spirometry sessions then you must use
begin_date=<yesterdays_date>
begin_date: Beginning date from which to extract in YYYY-MM-DD format.
type: string If omitted it will default to today in YYYY-MM-DD format
in: query
end_date: Ending date from which to extract in YYYY-MM-DD format.
type: string If omitted it will default to tomorrow in YYYY-MM-DD format
in: query
profile_ids: A comma-separated list of profile ids.
type:string If omitted it will query against all shared profiles
in: query
raw: Inlcuding this parameter will ask the API to return the full raw spirometry arrays in the result sets. NOTE -- must be raw=true -- no other formats will be recognized
type: string
in: query
200 OK: successful operation
Array<SpirometrySession>
403 Forbidden:Access fobidden
[
{
"spirometry_tests": {
"best_test": {
"duration": "6.466757369614513,",
"fev1_actual": "3.625823,",
"fev1_predicted": "4.428738,",
"fev1_percentage": "0.8187034319934934,",
"fvc_actual": "4.823865,",
"fvc_predicted": "5.54989,",
"fvc_percentage": "0.8691820918973168,",
"pef_actual": "8.662488,",
"pef_predicted": "10.49482,",
"pef_percentage": "0.8254060574645395,",
"ratio_actual": "0.7516427,",
"ratio_predicted": "0.7979866,",
"ratio_percentage": 0.9419239621316949
},
"all_tests": [
{
"duration": "6.466757369614513,",
"fev1_actual": "3.625823,",
"fev1_predicted": "4.428738,",
"fev1_percentage": "0.8187034319934934,",
"fvc_actual": "4.823865,",
"fvc_predicted": "5.54989,",
"fvc_percentage": "0.8691820918973168,",
"pef_actual": "8.662488,",
"pef_predicted": "10.49482,",
"pef_percentage": "0.8254060574645395,",
"ratio_actual": "0.7516427,",
"ratio_predicted": "0.7979866,",
"ratio_percentage": 0.9419239621316949
},
{
"duration": "6.466757369614513,",
"fev1_actual": "3.625823,",
"fev1_predicted": "4.428738,",
"fev1_percentage": "0.8187034319934934,",
"fvc_actual": "4.823865,",
"fvc_predicted": "5.54989,",
"fvc_percentage": "0.8691820918973168,",
"pef_actual": "8.662488,",
"pef_predicted": "10.49482,",
"pef_percentage": "0.8254060574645395,",
"ratio_actual": "0.7516427,",
"ratio_predicted": "0.7979866,",
"ratio_percentage": 0.9419239621316949
}
]
},
"weight_in_kg": 1.4658129805029452,
"ethnicity": "ethnicity",
"gender": "male",
"medications": [
"medications",
"medications"
],
"name": "name",
"created_at": "2000-01-23T04:56:07.000+00:00",
"id": "id",
"diagnoses": [
"diagnoses",
"diagnoses"
],
"email": "email",
"age": 0.8008282,
"height_in_cm": 6.027456183070403
}
]
{
"code": 403,
"message": "You are not authorized to access this resource. Did you forget your API key in the header request?"
}
| Schema | Scopes | | ---------------------------------------- | ------ | | api_key | |
code: number (required)
message: string (required)
{
"code": 403,
"message": "You are not authorized to access this resource. Did you forget your API key in the header request?"
}
id: string
email: string (email)
patient_name: string
share_code: string
{
"id": "660efccc4f3e060001c57e74",
"email": "bob@example.com",
"patient_name": "Bob Smith",
"share_code": "demoshare123"
}
id: string
email: string (email)
name: string
age: number (float)
height_in_cm: number (int32)
weight_in_kg: number (int32)
medications: string[]
diagnoses: string[]
ethnicity: string
gender: string , x ∈ { male , female }
created_at: string (date-time)
spirometry_tests: SpirometrySession_spirometry_tests
{
"spirometry_tests": {
"best_test": {
"duration": "6.466757369614513,",
"fev1_actual": "3.625823,",
"fev1_predicted": "4.428738,",
"fev1_percentage": "0.8187034319934934,",
"fvc_actual": "4.823865,",
"fvc_predicted": "5.54989,",
"fvc_percentage": "0.8691820918973168,",
"pef_actual": "8.662488,",
"pef_predicted": "10.49482,",
"pef_percentage": "0.8254060574645395,",
"ratio_actual": "0.7516427,",
"ratio_predicted": "0.7979866,",
"ratio_percentage": 0.9419239621316949
},
"all_tests": [
{
"duration": "6.466757369614513,",
"fev1_actual": "3.625823,",
"fev1_predicted": "4.428738,",
"fev1_percentage": "0.8187034319934934,",
"fvc_actual": "4.823865,",
"fvc_predicted": "5.54989,",
"fvc_percentage": "0.8691820918973168,",
"pef_actual": "8.662488,",
"pef_predicted": "10.49482,",
"pef_percentage": "0.8254060574645395,",
"ratio_actual": "0.7516427,",
"ratio_predicted": "0.7979866,",
"ratio_percentage": 0.9419239621316949
},
{
"duration": "6.466757369614513,",
"fev1_actual": "3.625823,",
"fev1_predicted": "4.428738,",
"fev1_percentage": "0.8187034319934934,",
"fvc_actual": "4.823865,",
"fvc_predicted": "5.54989,",
"fvc_percentage": "0.8691820918973168,",
"pef_actual": "8.662488,",
"pef_predicted": "10.49482,",
"pef_percentage": "0.8254060574645395,",
"ratio_actual": "0.7516427,",
"ratio_predicted": "0.7979866,",
"ratio_percentage": 0.9419239621316949
}
]
},
"weight_in_kg": 1.4658129805029452,
"ethnicity": "ethnicity",
"gender": "male",
"medications": [
"medications",
"medications"
],
"name": "name",
"created_at": "2000-01-23T04:56:07.000+00:00",
"id": "id",
"diagnoses": [
"diagnoses",
"diagnoses"
],
"email": "email",
"age": 0.8008282,
"height_in_cm": 6.027456183070403
}
duration: number (float)
fev1_actual: number (float)
fev1_predicted: number (float)
fev1_percentage: number (float)
fvc_actual: number (float)
fvc_predicted: number (float)
fvc_percentage: number (float)
pef_actual: number (float)
pef_predicted: number (float)
pef_percentage: number (float)
ratio_actual: number (float)
ratio_predicted: number (float)
ratio_percentage: number (float)
{
"duration": "6.466757369614513,",
"fev1_actual": "3.625823,",
"fev1_predicted": "4.428738,",
"fev1_percentage": "0.8187034319934934,",
"fvc_actual": "4.823865,",
"fvc_predicted": "5.54989,",
"fvc_percentage": "0.8691820918973168,",
"pef_actual": "8.662488,",
"pef_predicted": "10.49482,",
"pef_percentage": "0.8254060574645395,",
"ratio_actual": "0.7516427,",
"ratio_predicted": "0.7979866,",
"ratio_percentage": 0.9419239621316949
}
code: string (required)
message: string (required)
{
"code": 403,
"message": "You are not authorized to access this resource. Did you forget your API key in the header request?"
}
id: string
email: string (email)
patient_name: string
share_code: string
{
"id": "660efccc4f3e060001c57e74",
"email": "bob@example.com",
"patient_name": "Bob Smith",
"share_code": "demoshare123"
}
id: string
email: string (email)
name: string
age: number (float)
height_in_cm: number (int32)
weight_in_kg: number (int32)
medications: string[]
diagnoses: string[]
ethnicity: string
gender: string , x ∈ { male , female }
created_at: string (date-time)
spirometry_tests: SpirometrySession_spirometry_tests
{
"spirometry_tests": {
"best_test": {
"duration": "6.466757369614513,",
"fev1_actual": "3.625823,",
"fev1_predicted": "4.428738,",
"fev1_percentage": "0.8187034319934934,",
"fvc_actual": "4.823865,",
"fvc_predicted": "5.54989,",
"fvc_percentage": "0.8691820918973168,",
"pef_actual": "8.662488,",
"pef_predicted": "10.49482,",
"pef_percentage": "0.8254060574645395,",
"ratio_actual": "0.7516427,",
"ratio_predicted": "0.7979866,",
"ratio_percentage": 0.9419239621316949
},
"all_tests": [
{
"duration": "6.466757369614513,",
"fev1_actual": "3.625823,",
"fev1_predicted": "4.428738,",
"fev1_percentage": "0.8187034319934934,",
"fvc_actual": "4.823865,",
"fvc_predicted": "5.54989,",
"fvc_percentage": "0.8691820918973168,",
"pef_actual": "8.662488,",
"pef_predicted": "10.49482,",
"pef_percentage": "0.8254060574645395,",
"ratio_actual": "0.7516427,",
"ratio_predicted": "0.7979866,",
"ratio_percentage": 0.9419239621316949
},
{
"duration": "6.466757369614513,",
"fev1_actual": "3.625823,",
"fev1_predicted": "4.428738,",
"fev1_percentage": "0.8187034319934934,",
"fvc_actual": "4.823865,",
"fvc_predicted": "5.54989,",
"fvc_percentage": "0.8691820918973168,",
"pef_actual": "8.662488,",
"pef_predicted": "10.49482,",
"pef_percentage": "0.8254060574645395,",
"ratio_actual": "0.7516427,",
"ratio_predicted": "0.7979866,",
"ratio_percentage": 0.9419239621316949
}
]
},
"weight_in_kg": 1.4658129805029452,
"ethnicity": "ethnicity",
"gender": "male",
"medications": [
"medications",
"medications"
],
"name": "name",
"created_at": "2000-01-23T04:56:07.000+00:00",
"id": "id",
"diagnoses": [
"diagnoses",
"diagnoses"
],
"email": "email",
"age": 0.8008282,
"height_in_cm": 6.027456183070403
}
duration: number (float)
fev1_actual: number (float)
fev1_predicted: number (float)
fev1_percentage: number (float)
fvc_actual: number (float)
fvc_predicted: number (float)
fvc_percentage: number (float)
pef_actual: number (float)
pef_predicted: number (float)
pef_percentage: number (float)
ratio_actual: number (float)
ratio_predicted: number (float)
ratio_percentage: number (float)
{
"duration": "6.466757369614513,",
"fev1_actual": "3.625823,",
"fev1_predicted": "4.428738,",
"fev1_percentage": "0.8187034319934934,",
"fvc_actual": "4.823865,",
"fvc_predicted": "5.54989,",
"fvc_percentage": "0.8691820918973168,",
"pef_actual": "8.662488,",
"pef_predicted": "10.49482,",
"pef_percentage": "0.8254060574645395,",
"ratio_actual": "0.7516427,",
"ratio_predicted": "0.7979866,",
"ratio_percentage": 0.9419239621316949
}
best_test: #definitons/SpirometryTest
all_tests: object[]
{
"best_test": {
"duration": "6.466757369614513,",
"fev1_actual": "3.625823,",
"fev1_predicted": "4.428738,",
"fev1_percentage": "0.8187034319934934,",
"fvc_actual": "4.823865,",
"fvc_predicted": "5.54989,",
"fvc_percentage": "0.8691820918973168,",
"pef_actual": "8.662488,",
"pef_predicted": "10.49482,",
"pef_percentage": "0.8254060574645395,",
"ratio_actual": "0.7516427,",
"ratio_predicted": "0.7979866,",
"ratio_percentage": 0.9419239621316949
},
"all_tests": [
{
"duration": "6.466757369614513,",
"fev1_actual": "3.625823,",
"fev1_predicted": "4.428738,",
"fev1_percentage": "0.8187034319934934,",
"fvc_actual": "4.823865,",
"fvc_predicted": "5.54989,",
"fvc_percentage": "0.8691820918973168,",
"pef_actual": "8.662488,",
"pef_predicted": "10.49482,",
"pef_percentage": "0.8254060574645395,",
"ratio_actual": "0.7516427,",
"ratio_predicted": "0.7979866,",
"ratio_percentage": 0.9419239621316949
},
{
"duration": "6.466757369614513,",
"fev1_actual": "3.625823,",
"fev1_predicted": "4.428738,",
"fev1_percentage": "0.8187034319934934,",
"fvc_actual": "4.823865,",
"fvc_predicted": "5.54989,",
"fvc_percentage": "0.8691820918973168,",
"pef_actual": "8.662488,",
"pef_predicted": "10.49482,",
"pef_percentage": "0.8254060574645395,",
"ratio_actual": "0.7516427,",
"ratio_predicted": "0.7979866,",
"ratio_percentage": 0.9419239621316949
}
]
}