Get Medical History
In the following, content returned by GET (both forms), and accepted as request data for both PUT and POST will be identify by the string "MEDICAL_HISTORY_DATA, which consists of the following:
clinic
clinic resource id
patient
patient resource id
tuberculosis
true | false
pregnancy_duration
integer
epilepsy
true | false
recentcold
true | false
pain
true | false
pregnancy_complications
true | false
allergymeds
string
cancer
true | false
relative_cleft
true | false
meds
string
parents_cleft
true | false
athsma
true | false
mother_alcohol
true | false
troublespeaking
true | false
diabetes
true | false
congenitalheartdefect
true | false
pregnancy_smoke
true | false
troublehearing
true | false
troubleeating
true | false
birth_complications
true | false
hivaids
true | false
hepititis
true | false
health
"Good" | "Poor"
siblings_cleft
true | false
anemia
true | false
hemophilia
true | false
Returns json data about a single medicalhistory resource.
-
URL
/tscharts/v1/medicalhistory/id
-
Method:
GET
-
URL Params
None
-
Data Params
None
-
Success Response:
- Code: 200
Content:
{"id" : id, "clinic" : id, "patient" : id, "time" : UTC date time string,
MEDICAL_HISTORY_DATA
} - Code: 200
-
Error Response:
- Code: 404 NOT FOUND
-
Example:
GET /tscharts/v1/medicalhistory/13/ 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 b4e9102f85686fda0239562e4c8f7d3773438dae
HTTP/1.0 200 OK
Date: Sun, 23 Apr 2017 01:19:19 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
{"hepititis":false,"cancer":false,"epilepsy":false,"clinic":12,"recentcold":false,"pain":false,"pregnancy_complications":false,"id":13,"allergymeds":"","pregnancy_duration":9,"relative_cleft":false,"meds":"","health":"Good","athsma":false,"mother_alcohol":false,"troublespeaking":false,"anemia":false,"congenitalheartdefect":false,"pregnancy_smoke":false,"troublehearing":false,"patient":14,"troubleeating":false,"birth_complications":false,"hivaids":false,"tuberculosis":false,"parents_cleft":false,"siblings_cleft":false,"diabetes":false,"hemophilia":false,"time":"2017-04-23T01:19:19Z"}
Returns data about all matching medicalhistory resources.
-
URL
/tscharts/v1/medicalhistory/
-
Method:
GET
-
URL Params
None
-
Data Params
Required:
None
Optional:
One or more of the following are used to filter the results. At least one of the following must be specified for a bad request error is returned.
patient
clinic id
clinic
clinic id -
Success Response:
- Code: 200
Content: [{"id" : id, "clinic" : id, "patient" : id, "time" : UTC date time string,MEDICAL_HISTORY_DATA
}, ...]
- Code: 200
-
Error Response:
- Code: 400 BAD REQUEST
- Code: 403 NOT FOUND
- Code: 500 SERVER ERROR
- Code: 400 BAD REQUEST
-
Example:
GET /tscharts/v1/medicalhistory/ HTTP/1.1
Host: 127.0.0.1:8000
Content-Length: 14
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 b4e9102f85686fda0239562e4c8f7d3773438dae
{"clinic": 14}HTTP/1.0 200 OK
Date: Sun, 23 Apr 2017 01:19:20 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
[{"hepititis":false,"cancer":false,"epilepsy":false,"clinic":14,"recentcold":false,"pain":false,"pregnancy_complications":false,"id":17,"allergymeds":"","pregnancy_duration":9,"relative_cleft":false,"meds":"","health":"Good","athsma":false,"mother_alcohol":false,"troublespeaking":false,"anemia":false,"congenitalheartdefect":false,"pregnancy_smoke":false,"troublehearing":false,"patient":18,"troubleeating":false,"birth_complications":false,"hivaids":false,"tuberculosis":false,"parents_cleft":false,"siblings_cleft":false,"diabetes":false,"hemophilia":false,"time":"2017-04-23T01:19:20Z"},{"hepititis":false,"cancer":false,"epilepsy":false,"clinic":14,"recentcold":false,"pain":false,"pregnancy_complications":false,"id":16,"allergymeds":"","pregnancy_duration":9,"relative_cleft":false,"meds":"","health":"Good","athsma":false,"mother_alcohol":false,"troublespeaking":false,"anemia":false,"congenitalheartdefect":false,"pregnancy_smoke":false,"troublehearing":false,"patient":17,"troubleeating":false,"birth_complications":false,"hivaids":false,"tuberculosis":false,"parents_cleft":false,"siblings_cleft":false,"diabetes":false,"hemophilia":false,"time":"2017-04-23T01:19:20Z"},{"hepititis":false,"cancer":false,"epilepsy":false,"clinic":14,"recentcold":false,"pain":false,"pregnancy_complications":false,"id":15,"allergymeds":"","pregnancy_duration":9,"relative_cleft":false,"meds":"","health":"Good","athsma":false,"mother_alcohol":false,"troublespeaking":false,"anemia":false,"congenitalheartdefect":false,"pregnancy_smoke":false,"troublehearing":false,"patient":16,"troubleeating":false,"birth_complications":false,"hivaids":false,"tuberculosis":false,"parents_cleft":false,"siblings_cleft":false,"diabetes":false,"hemophilia":false,"time":"2017-04-23T01:19:20Z"}]
Create a medical history resource for a patient at a specific clinic.
-
URL
/tscharts/v1/medicalhistory/
-
Method:
POST
-
URL Params
None
-
Data Params
Required:
clinic
clinic resource id
patient
patient resource id
MEDICAL_HISTORY_DATA
Optional:
None
-
Success Response:
- Code: 200
Content:{ "id" : id }
- Code: 200
-
Error Response:
- Code: 400 BAD REQUEST
- Code: 404 NOT FOUND
- Code: 500 SERVER ERROR
- Code: 400 BAD REQUEST
-
Example:
POST /tscharts/v1/medicalhistory/ HTTP/1.1
Host: 127.0.0.1:8000
Content-Length: 606
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 b4e9102f85686fda0239562e4c8f7d3773438dae
{"tuberculosis": false, "pregnancy_duration": 9, "epilepsy": false, "clinic": 12, "recentcold": false, "pain": false, "pregnancy_complications": false, "allergymeds": "", "cancer": false, "relative_cleft": false, "meds": "", "parents_cleft": false, "athsma": false, "mother_alcohol": false, "troublespeaking": false, "diabetes": false, "congenitalheartdefect": false, "pregnancy_smoke": false, "troublehearing": false, "patient": 14, "troubleeating": false, "birth_complications": false, "hivaids": false, "hepititis": false, "health": "Good", "siblings_cleft": false, "anemia": false, "hemophilia": false}HTTP/1.0 200 OK
Date: Sun, 23 Apr 2017 01:19:19 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
{"id":13}
Update a medicalhistory instance
-
URL
/tscharts/v1/medicalhistory/id
-
Method:
PUT
-
URL Params
None
-
Data Params
Required:
One or more of the field/value pairs in
MEDICAL_HISTORY_DATA
-
Success Response:
- Code: 200
- Code: 200
-
Error Response:
- Code: 400 BAD REQUEST
- Code: 404 NOT FOUND
- Code: 500 SERVER ERROR
- Code: 400 BAD REQUEST
-
Example:
PUT /tscharts/v1/medicalhistory/24/ HTTP/1.1
Host: 127.0.0.1:8000
Content-Length: 18
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 b4e9102f85686fda0239562e4c8f7d3773438dae
{"health": "Poor"}HTTP/1.0 200 OK
Date: Sun, 23 Apr 2017 01:19:21 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
{}
Delete a registration. Use is not recommended except for unit test applications.
-
URL
/tscharts/v1/medicalhistory/id
-
Method:
DELETE
-
URL Params
None
-
Data Params
None
-
Success Response:
- Code: 200
Content: None
- Code: 200
-
Error Response:
- Code: 404 NOT FOUND
-
Example:
DELETE /tscharts/v1/medicalhistory/140/ 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: Fri, 21 Apr 2017 05:52:49 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
{}