We had a good design call discussion today (including myself, @jteich, @mogoodrich, @wyclif), discussing how we could incorporate Encounter Diagnoses into core.
We considered both the EMRAPI module and FHIR resources and came up with this plan:
1. Support for encounter diagnoses in core:
- Migrate CodedOrFreeTextAnswertoCondition(will be used for condition lists and anywhere else we need conditions aka diagnosis/problem/health concern)
- Migrate DiagnosistoEncounterDiagnosis, which extendsConditionto add ordinality (PRIMARY vs. SECONDARY)
- Add methods to get primary and secondary diagnoses to Encounter
2. Backwards compatibility
- Refactor the EMRAPI module’s diagnoses as a façade using the new encounter diagnoses in core.
3. Going forward
- Create a ticket to migrate data into core’s new encounter_diagnosistable
- Update UIs to use new features from core
Here’s a side-by-side comparison:
Notes
- 
Conditionaligns us with FHIR’s Condition resource
- 
CodedOrFreeTextAnsweris a generic solution to supporting coded or free text that adds another layer of abstraction in the API. We prefer to incorporate this functionality intoCondition
- Both @jteich and I preferred EncounterDiagnosisto simplyDiagnosis(ambiguous) orIndication(FHIR’s term)
- Some renaming:
- 
Orderis replaced withOrdinalityfor PRIMARY vs SECONDARY
- 
CertaintybecomesVerificationStatussupporting PROVISIONAL (previously PRESUMED) and CONFIRMED to align with FHIR
 
- 
- We eliminate the need for DiagnosisServiceonceEncounterDiagnosisis a property ofEncounter
- Design call notes here
I’ve adjusted TRUNK-5015 accordingly.
