oral-health-and-disease-ontologies / NDPBRN

Repository for code and ontology files for the NDPBN project
Creative Commons Zero v1.0 Universal
3 stars 1 forks source link

Confirm EagleSoft Tooth History Counts #3

Closed knappkl closed 7 years ago

knappkl commented 7 years ago

The databases Ted used with hisapplication are the ones now uploaded to the IU box in the NDPBRN Practitioner Date (Eaglesoft)\ES New Updated Files folder. These are the databases used to create the files located in the ES Tooth History Files folder.

These databases are the same as the original P# databases, but with all patient and related data deleted where those patients did not meet the criteria. This was done as requested so that we would not have to continually have to add filters to not include patients that did not match the criteria.
So basically, the following SQL, DELETE FROM tables (patient and related) WHERE patient_id NOT IN
( select patient_id from transactions_detail td join transactions_header th on th.tran_num = td.tran_num where th.service_code in ( select service_code from services where RIGHT(ada_code,4) IN ('2385','2386','2387','2388','2391','2392','2393','2394','3310','3320','3330') or description like '%root canal%' ) and th.type = 'S' and th.status = 'A' and th.tran_date between start_date and end_date );

was run on each of the original databases first. Then the tooth history files were created using the SQL we provided.

Ted loaded up the original P1 database database. Ran Bill's tooth history sql and got the 199151 number of records, then ran Bill's tooth history sql but with the WHERE table_name.patient_id IN… sql added to each of them and got the 135072 number of records. Ted then loaded up the new P1(31).zip database and ran your original tooth history sql and also got the 135072 number of records as well.

chen-regen commented 7 years ago

Hey, @knappkl I think this issues needs to be assigned to Jim.