Skip to content

Commit

Permalink
Odds and ends
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewVita committed Oct 29, 2018
1 parent 4f1ff04 commit d3a345b
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ curl -X POST 'http:https://localhost:8300/rest_router.php?resource=/api/patient/1/appo
"pc_eventDate": "2018-10-19",
"pc_startTime": "09:00",
"pc_facility": "9",
"pc_billing_facility": "10"
"pc_billing_location": "10"
}'
```

Expand Down Expand Up @@ -761,13 +761,13 @@ curl -X DELETE 'http:https://localhost:8300/rest_router.php?resource=/api/patient/1/me

- TODO(team): Consider using Symfony's router
- TODO(sherwin): Encounter POST
- TODO(matthew): Implement Particle's `lessThan` validation for numeric fields
- 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 prescriptions
- TODO(?): Drug search API
- TODO(?): API for onotes


Expand Down
2 changes: 1 addition & 1 deletion rest_controllers/AppointmentRestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function post($pid, $data)
if (is_array($validationHandlerResult)) { return $validationHandlerResult; }

$serviceResult = $this->appointmentService->insert($pid, $data);
return RestControllerHelper::responseHandler($serviceResult, null, 200);
return RestControllerHelper::responseHandler(array("id" => $serviceResult), null, 200);
}

public function delete($eid)
Expand Down
4 changes: 2 additions & 2 deletions rest_controllers/FacilityRestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function post($data)
if (is_array($validationHandlerResult)) { return $validationHandlerResult; }

$serviceResult = $this->facilityService->insert($data);
return RestControllerHelper::responseHandler($serviceResult, array('id' => $serviceResult), 201);
return RestControllerHelper::responseHandler($serviceResult, array('fid' => $serviceResult), 201);
}

public function put($data)
Expand All @@ -63,6 +63,6 @@ public function put($data)
if (is_array($validationHandlerResult)) { return $validationHandlerResult; }

$serviceResult = $this->facilityService->update($data);
return RestControllerHelper::responseHandler($serviceResult, array('id' => $data['fid']), 200);
return RestControllerHelper::responseHandler($serviceResult, array('fid' => $data['fid']), 200);
}
}
4 changes: 2 additions & 2 deletions rest_controllers/InsuranceCompanyRestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function post($data)
if (is_array($addressValidationHandlerResult)) { return $addressValidationHandlerResult; }

$serviceResult = $this->insuranceCompanyService->insert($data);
return RestControllerHelper::responseHandler($serviceResult, array('id' => $serviceResult), 201);
return RestControllerHelper::responseHandler($serviceResult, array('iid' => $serviceResult), 201);
}

public function put($iid, $data)
Expand All @@ -74,6 +74,6 @@ public function put($iid, $data)
if (is_array($addressValidationHandlerResult)) { return $addressValidationHandlerResult; }

$serviceResult = $this->insuranceCompanyService->update($data, $iid);
return RestControllerHelper::responseHandler($serviceResult, array('id' => $serviceResult), 200);
return RestControllerHelper::responseHandler($serviceResult, array('iid' => $iid), 200);
}
}
4 changes: 2 additions & 2 deletions rest_controllers/MessageRestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function put($pid, $mid, $data)
if (is_array($validationHandlerResult)) { return $validationHandlerResult; }

$serviceResult = $this->messageService->update($pid, $mid, $data);
return RestControllerHelper::responseHandler($serviceResult, array("id" => $mid), 200);
return RestControllerHelper::responseHandler($serviceResult, array("mid" => $mid), 200);
}

public function post($pid, $data)
Expand All @@ -53,7 +53,7 @@ public function post($pid, $data)
if (is_array($validationHandlerResult)) { return $validationHandlerResult; }

$serviceResult = $this->messageService->insert($pid, $data);
return RestControllerHelper::responseHandler($serviceResult, array("id" => $serviceResult), 201);
return RestControllerHelper::responseHandler($serviceResult, array("mid" => $serviceResult), 201);
}

public function delete($pid, $mid)
Expand Down
2 changes: 1 addition & 1 deletion services/AppointmentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function validate($appointment)
$validator->required('pc_eventDate')->datetime('Y-m-d');
$validator->required('pc_startTime')->length(5); // HH:MM is 5 chars
$validator->required('pc_facility')->numeric();
$validator->required('pc_billing_facility')->numeric();
$validator->required('pc_billing_location')->numeric();

return $validator->validate($appointment);
}
Expand Down
10 changes: 5 additions & 5 deletions services/FacilityService.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ public function validate($facility)
$validator->optional('federal_ein')->lengthBetween(2, 15);
$validator->optional('website')->url();
$validator->optional('color')->lengthBetween(4, 7);
$validator->optional('service_location')->numeric()->lessThan(2);
$validator->optional('billing_location')->numeric()->lessThan(2);
$validator->optional('accepts_assignment')->numeric()->lessThan(2);
$validator->optional('pos_code')->numeric()->lessThan(5);
$validator->optional('service_location')->numeric();
$validator->optional('billing_location')->numeric();
$validator->optional('accepts_assignment')->numeric();
$validator->optional('pos_code')->numeric();
$validator->optional('domain_identifier')->lengthBetween(2, 60);
$validator->optional('attn')->lengthBetween(2, 65);
$validator->optional('tax_id_type')->lengthBetween(2, 31);
$validator->optional('primary_business_entity')->numeric()->lessThan(11);
$validator->optional('primary_business_entity')->numeric();
$validator->optional('facility_npi')->lengthBetween(2, 15);
$validator->optional('facility_code')->lengthBetween(2, 31);
$validator->optional('facility_taxonomy')->lengthBetween(2, 15);
Expand Down

0 comments on commit d3a345b

Please sign in to comment.