Skip to content

Latest commit

 

History

History
240 lines (159 loc) · 4.38 KB

README.md

File metadata and controls

240 lines (159 loc) · 4.38 KB

Get Image

Returns json data about a single image resource.

  • URL

    /tscharts/v1/image/id

  • Method:

    GET

  • URL Params

    None

  • Data Params

    None

  • Success Response:

    • Code: 200
      Content: {"patient":id,"data":"base64","clinic":id,"station":id,"type":"Headshot|Xray|Surgery|Audiogram","id":id}
  • Error Response:

    • Code: 404 NOT FOUND
  • Example:

GET /tscharts/v1/image/63/ HTTP/1.1
Host: 127.0.0.1:8000
Accept-Encoding: gzip, deflate, compress
Accept: */*
User-Agent: python-requests/2.2.1 CPython/2.7.6 Linux/4.2.0-27-generic
Content-Type: application/json
Authorization: Token 53f29e4dfc917c28a0e71f26525307250f1f8101


HTTP/1.0 200 OK
Date: Wed, 19 Apr 2017 01:53:04 GMT
Server: WSGIServer/0.1 Python/2.7.6
Vary: Accept
X-Frame-Options: SAMEORIGIN
Content-Type: application/json
Allow: GET, POST, DELETE, HEAD, OPTIONS


{"patient":343,"data":"ABCDEFG","clinic":276,"station":117,"type":"Headshot","id":63}

Get Multiple Images

Returns a vector of image ids matching supplied search parameters.

  • URL

    /tscharts/v1/image/

  • Method:

    GET

  • URL Params

    Required:

    patient patient id

    Optional:

    type case-sensitive string, one of "Headshot", "Surgery", "Audiogram", or "Xray"
    clinic clinic id
    station station id
    sort ["true" | "false"] -- sort by image timestamp
    newest ["true" | "false"] -- return most recent image

  • Data Params

    None

  • Success Response:

    • Code: 200
      Content: [id, ...]
  • Error Response:

    • Code: 400 BAD REQUEST
    • Code: 403 NOT FOUND
    • Code: 500 SERVER ERROR
  • Example:

GET /tscharts/v1/image/?station=3 HTTP/1.1
Host: localhost
Content-Length: 2
Accept-Encoding: gzip, deflate, compress
Accept: */*
User-Agent: python-requests/2.2.1 CPython/2.7.6 Linux/4.2.0-27-generic
Content-Type: application/json
Authorization: Token 53f29e4dfc917c28a0e71f26525307250f1f8101


{}HTTP/1.1 200 OK
Date: Sat, 17 Feb 2018 00:24:36 GMT
Server: Apache/2.4.7 (Ubuntu)
Vary: Accept
X-Frame-Options: SAMEORIGIN
Allow: GET, POST, DELETE, HEAD, OPTIONS
Transfer-Encoding: chunked
Content-Type: application/json


29
[5,6,7,8,9,25,26,27,28,29,45,46,47,48,49]
0

Create Image

Create a image instance.

  • URL

    /tscharts/v1/image/

  • Method:

    POST

  • URL Params

    None

  • Data Params

    Required:

    type case-sensitive string, one of "Headshot", "Surgery", "Audiogram", or "Xray"
    clinic clinic id
    station station id
    patient patient id
    data base64 image data

Note that clinic and station are both available in a clinicstation object.

  • Success Response:

    • Code: 200
      Content: { id : 12 }
  • Error Response:

    • Code: 400 BAD REQUEST
    • Code: 403 NOT FOUND
    • Code: 500 SERVER ERROR
  • Example:

POST /tscharts/v1/image/ HTTP/1.1
Host: 127.0.0.1:8000
Content-Length: 86
Accept-Encoding: gzip, deflate, compress
Accept: */*
User-Agent: python-requests/2.2.1 CPython/2.7.6 Linux/4.2.0-27-generic
Content-Type: application/json
Authorization: Token 53f29e4dfc917c28a0e71f26525307250f1f8101


{"type": "Headshot", "clinic": 276, "station": 117, "patient": 343, "data": "ABCDEFG"}HTTP/1.0 200 OK
Date: Wed, 19 Apr 2017 01:53:04 GMT
Server: WSGIServer/0.1 Python/2.7.6
Vary: Accept
X-Frame-Options: SAMEORIGIN
Content-Type: application/json
Allow: GET, POST, DELETE, HEAD, OPTIONS


{"id":63}

Delete Image

Delete an image instance.

  • URL

    /tscharts/v1/image/id

  • Method:

    DELETE

  • URL Params

    None

  • Data Params

    None

  • Success Response:

    • Code: 200
      Content: None
  • Error Response:

    • Code: 404 NOT FOUND
  • Example:

DELETE /tscharts/v1/image/122/ HTTP/1.1
Host: 127.0.0.1:8000
Content-Length: 2
Accept-Encoding: gzip, deflate, compress
Accept: */*
User-Agent: python-requests/2.2.1 CPython/2.7.6 Linux/4.2.0-27-generic
Content-Type: application/json
Authorization: Token 53f29e4dfc917c28a0e71f26525307250f1f8101


{}HTTP/1.0 200 OK
Date: Tue, 18 Apr 2017 20:17:14 GMT
Server: WSGIServer/0.1 Python/2.7.6
Vary: Accept
X-Frame-Options: SAMEORIGIN
Content-Type: application/json
Allow: GET, POST, PUT, DELETE, HEAD, OPTIONS


{}