Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewVita committed Oct 29, 2018
1 parent d3a345b commit 05325ec
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ curl -X POST 'https://localhost:8300/rest_router.php?resource=/api/patient' -d \
"race": "",
"ethnicity": ""
}'
```

#### PUT /api/patient/:pid

```
curl -X PUT 'https://localhost:8300/rest_router.php?resource=/api/patient/:pid' -d \
curl -X PUT 'https://localhost:8300/rest_router.php?resource=/api/patient/1' -d \
'{
"title": "Mr",
"fname": "Baz",
Expand All @@ -133,7 +133,7 @@ curl -X PUT 'https://localhost:8300/rest_router.php?resource=/api/patient/:pid' -
"state": "FL",
"country_code": "US",
"phone_contact": "123-456-7890",
"dob": "1992-02-02",
"dob": "1992-02-03",
"sex": "Male",
"race": "",
"ethnicity": ""
Expand Down Expand Up @@ -763,9 +763,9 @@ curl -X DELETE 'https://localhost:8300/rest_router.php?resource=/api/patient/1/me
- TODO(sherwin): Encounter POST
- TODO(matthew): Fix authorization piece & cleanup authentication piece
- TODO(?): Prevent `ListService` from using `enddate` of `0000-00-00` by default
- TODO(?): `PatientService`'s `insert` doesn't handle `dob` correctly
- TODO(?): API for fee sheets
- TODO(?): API for pharmacies
- TODO(?): API for immunizations
- TODO(?): API for prescriptions
- TODO(?): Drug search API
- TODO(?): API for onotes
Expand Down
1 change: 1 addition & 0 deletions services/ListService.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public function insert($data)
{
$sql = " INSERT INTO lists SET";
$sql .= " date=NOW(),";
$sql .= " activity=1,";
$sql .= " pid='" . add_escape_custom($data['pid']) . "',";
$sql .= " type='" . add_escape_custom($data['type']) . "',";
$sql .= " title='" . add_escape_custom($data["title"]) . "',";
Expand Down
2 changes: 1 addition & 1 deletion services/PatientService.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public static function getChartTrackerInformation()
public function getFreshPid() {
$pid = sqlQuery("SELECT MAX(pid)+1 AS pid FROM patient_data");

return $pid['pid'];
return $pid['pid'] === null ? 1 : $pid['pid'];
}

public function insert($data)
Expand Down

0 comments on commit 05325ec

Please sign in to comment.