diff --git a/models/contacts/contacts.yml b/models/contacts/contacts.yml index 6043866d..1caf0aac 100644 --- a/models/contacts/contacts.yml +++ b/models/contacts/contacts.yml @@ -71,8 +71,6 @@ models: field: uuid - name: saved_timestamp data_type: timestamp - - name: date_of_birth - data_type: date - name: sex data_type: string - name: patient_id diff --git a/models/contacts/person.sql b/models/contacts/person.sql index 1b1f37d1..66955d36 100644 --- a/models/contacts/person.sql +++ b/models/contacts/person.sql @@ -13,15 +13,6 @@ SELECT contact.uuid, contact.saved_timestamp, - CASE - WHEN NULLIF(couchdb.doc->>'date_of_birth', '') IS NULL THEN NULL - WHEN couchdb.doc->>'date_of_birth' ~ '^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$' THEN - CASE - WHEN couchdb.doc->>'date_of_birth' IS NOT NULL AND TO_DATE(couchdb.doc->>'date_of_birth', 'YYYY-MM-DD')::text = couchdb.doc->>'date_of_birth' THEN TO_DATE(couchdb.doc->>'date_of_birth', 'YYYY-MM-DD') - ELSE NULL - END - ELSE NULL - END as date_of_birth, couchdb.doc->>'sex' as sex, couchdb.doc->>'phone' AS phone, couchdb.doc->>'alternative_phone' AS phone2, diff --git a/tests/fixtures/person/person_initial_expected.csv b/tests/fixtures/person/person_initial_expected.csv index 1321d031..fefb7325 100644 --- a/tests/fixtures/person/person_initial_expected.csv +++ b/tests/fixtures/person/person_initial_expected.csv @@ -1,3 +1,3 @@ -uuid,saved_timestamp,date_of_birth,sex,phone,phone2 -p1,2024-08-01 00:00:00,1980-01-01,M,12345,54321 -p2,2024-08-01 00:00:00,1990-05-15,F,67890,9876 +uuid,saved_timestamp,sex,phone,phone2 +p1,2024-08-01 00:00:00,M,12345,54321 +p2,2024-08-01 00:00:00,F,67890,9876