MeasureAuthoringTool / health-data-standards

https://rubygems.org/gems/health-data-standards
Apache License 2.0
94 stars 93 forks source link

merging of encounters ignores start/end times #187

Open yoon opened 10 years ago

yoon commented 10 years ago

In https://groups.google.com/d/topic/pophealth-dev/V0dG0Bq1gPI/discussion we discuss:

"If, in a single cat1 file, encounters share the same id because they refer to the same visit (e.g. ED visit, hospital admission), but have different times, what should the importer do? The record ends up with the start/end time of the first encounter in the XML file, which is not a reliable source of order."

The 2014 CMS QRDA Cat 1 Eligible Hospital Sample Files April 2014, accessible at http://cms.gov/Regulations-and-Guidance/Legislation/EHRIncentivePrograms/eCQM_Library.html, have a sample file for measure 0435 where all of the encounter ids are 2a620155-9d11-439e-92b3-5d9815ff4de8 (incidentally, the same id as the HL7 Implementation Guide for cat1), but the encounters have the same time.

This issue and #188 address two different approaches to this problem. This issue assumes that, because encounters have the same, id, they should be merged. But if they have different dates/times, then the merge should take that into account - perhaps by taking the earliest start time and latest end time.