Skip to content

Instantly share code, notes, and snippets.

@blakewest
Last active June 2, 2017 01:15
Show Gist options
  • Save blakewest/c1109fb160f5e252494fb36502d630cb to your computer and use it in GitHub Desktop.
Save blakewest/c1109fb160f5e252494fb36502d630cb to your computer and use it in GitHub Desktop.
Options 2 ("Visits") for Hint Procedures API
/*
// Option 2: Visits
// Standard CRUD actions to /api/provider/visits
// GET /api/provider/visits
// POST /api/provider/visits
// GET /api/provider/visits/:id
// PATCH /api/provider/visits/:id
// DELETE /api/provider/visits/:id
Business Logic:
- Procedures can only be added/altered through an array passed up in the visit params.
- For any PATCH to visits, Hint will always just overwrite the existing procedures with whatever procedures are sent up.
Thus, if a procedure was previously there, but is not present in the next PATCH, that procedure will be deleted. If it matches
an existing code, Hint will update all of it's attrs
*/
// Params
{
procedures: [
{
procedure_code: // String (required),
procedure_code_modifiers: // (array of 0-4 two character strings, unique in array, case insensitive, defaults to empty),
quantity: // Integer (defaults to 1),
fixed_price_in_cents: // Integer,
fixed_description: // String,
}
// More procedure codes if you got them...
],
date: // String (YYYY-MM-DD)
patient: {
id: // String (Hint ID or Integration Record ID)
},
practitioner: {
id: // String (the Hint ID, or Integration Record ID. Defaults to patient's practitioner)
},
}
// Example Response (200)
{
id: 'vis-134jL3k',
procedures: [
{
procedure_code: 'A4000',
procedure_code_modifiers: [],
quantity: 1,
fixed_price_in_cents: null,
fixed_description: null,
status: 'invoiced'
}
],
date: '2017-05-24',
patient: {
id: 'pat-2kJ3lkj2l'
},
practitioner: {
id: 'pct-LKj3kj33JL'
},
status: 'invoiced'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment