Skip to content

Commit

Permalink
[FIX] connector_carepoint: Update for new attributes
Browse files Browse the repository at this point in the history
* Update fields for renaming in v10
  • Loading branch information
lasley committed Nov 17, 2016
1 parent 119af32 commit 2179d8b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion connector_carepoint/models/carepoint_organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def carepoint_id(self, record):
@only_create
def odoo_id(self, record):
""" Will bind the organization on a existing organization
with the same name & dob """
with the same name & birthdate_date """
name = self._get_name(record)
organization_id = self.env['carepoint.organization'].search(
[('name', 'ilike', name)],
Expand Down
12 changes: 6 additions & 6 deletions connector_carepoint/models/medical_patient.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ class MedicalPatientImportMapper(PersonImportMapper):
direct = [
(trim('ssn'), 'ref'),
(trim('email'), 'email'),
(none('birth_date'), 'dob'),
(none('death_date'), 'dod'),
(none('birth_date'), 'birthdate_date'),
(none('death_date'), 'date_death'),
('pat_status_cn', 'active'),
]

Expand All @@ -102,10 +102,10 @@ def carepoint_id(self, record):
@only_create
def odoo_id(self, record):
""" Will bind the patient on a existing patient
with the same name & dob """
with the same name & birthdate_date """
name = self._get_name(record)
patient_id = self.env['medical.patient'].search(
[('name', 'ilike', name), ('dob', '=', record.get('birth_date'))],
[('name', 'ilike', name), ('birthdate_date', '=', record.get('birth_date'))],
limit=1,
)
if patient_id:
Expand Down Expand Up @@ -140,8 +140,8 @@ class MedicalPatientExportMapper(PersonExportMapper):
direct = [
(none('ref'), 'ssn'),
(none('email'), 'email'),
(none('dob'), 'birth_date'),
(none('dod'), 'death_date'),
(none('birthdate_date'), 'birth_date'),
(none('date_death'), 'death_date'),
('active', 'pat_status_cn')
]

Expand Down
4 changes: 2 additions & 2 deletions connector_carepoint/models/medical_patient_disease.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class MedicalPatientDiseaseImportMapper(PartnerImportMapper):
_model_name = 'carepoint.medical.patient.disease'

direct = [
('onset_date', 'diagnosed_date'),
('onset_date', 'date_diagnosed'),
('resolution_date', 'healed_date'),
]

Expand Down Expand Up @@ -149,7 +149,7 @@ class MedicalPatientDiseaseExportMapper(ExportMapper):
_model_name = 'carepoint.medical.patient.disease'

direct = [
(none('diagnosed_date'), 'onset_date'),
(none('date_diagnosed'), 'onset_date'),
(none('healed_date'), 'resolution_date'),
(m2o_to_backend('patient_id'), 'pat_id'),
(m2o_to_backend('physician_id'), 'caring_md_id'),
Expand Down
6 changes: 3 additions & 3 deletions connector_carepoint/models/medical_prescription_order_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class MedicalPrescriptionOrderLineImportMapper(CarepointImportMapper):

direct = [
('start_date', 'date_start_treatment'),
('expire_date', 'date_stop_treatment'),
('date_expire', 'date_stop_treatment'),
('written_qty', 'qty'),
('freq_of_admin', 'frequency'),
('units_entered', 'quantity'),
Expand Down Expand Up @@ -243,9 +243,9 @@ class MedicalPrescriptionOrderLineExportMapper(ExportMapper):
(convert('date_start_treatment', fields.Datetime.from_string),
'start_date'),
(convert('date_stop_treatment', fields.Datetime.from_string),
'expire_date'),
'date_expire'),
(convert('date_stop_treatment', fields.Datetime.from_string),
'expire_date'),
'date_expire'),
('qty', 'written_qty'),
('frequency', 'freq_of_admin'),
('quantity', 'units_entered'),
Expand Down
2 changes: 1 addition & 1 deletion connector_carepoint/tests/models/test_medical_patient.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _create_patient(self):
return self.env['medical.patient'].create({
'name': '%s %s' % (self.record['fname'],
self.record['lname']),
'dob': self.record['birth_date'],
'birthdate_date': self.record['birth_date'],
})

def test_safety_caps_yn(self):
Expand Down

0 comments on commit 2179d8b

Please sign in to comment.