Skip to content

Commit

Permalink
[FIX] connector_carepoint: Fix account sequencing
Browse files Browse the repository at this point in the history
* PK for cp_acct is `ID`, but sequence is `acct_id`. Overload create and inject
  • Loading branch information
lasley committed Oct 28, 2016
1 parent 34bd1e4 commit 365f324
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions connector_carepoint/models/carepoint_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ def _get_by_patient(self, patient, create=True, recurse=False):
class CarepointAccountAdapter(CarepointCRUDAdapter):
_model_name = 'carepoint.carepoint.account'

def create(self, data):
""" Wrapper to create a record on the external system
Params:
data: ``dict`` of Data to create record with
Returns:
``str`` of external carepoint_id
"""
data['ID'] = self.carepoint.get_next_sequence('acct_id')
return super(CarepointAccountAdapter, self).create(data)


@carepoint
class CarepointAccountUnit(ConnectorUnit):
Expand Down

0 comments on commit 365f324

Please sign in to comment.