PIH first introduce “Diagnoses” in the emrapi module for their Mirebalais project (storing the actual data in an obs group). This has been included in the Reference Application and in Bahmni for years without any real changes being requested to the use case, so I’m pretty confident that we’ve got this right, and it’s time to implement Encounter Diagnoses in openmrs-core.
The general idea would be to add an encounter_diagnosis table (and to deprecate what is being done in emrapi).
@darius@burke@jteich@mogoodrich@bharatak we have an opening on Wednesday, January 25 and Monday, January 30th. I am guessing with this group that the Monday date works best but please correct me if I’m wrong.
I will be travelling the next two weeks so it’s unclear if I could make either of those times, but I don’t need to be there.
I don’t have a problem with it being moved over, however in the spirit of “if-it’s-not-broke-don’t-fix-it”, @darius do you have a compelling reason to prioritize this?
I think it is better to move important & useful features to openmrs-core so that it is useful for larger community. emrapi does a lot of things, i think this is a better to make it leaner
In our 2017 Bahmni roadmap we intend to work on Condition Lists, Care Plans, and also some FHIR work. We’d rather have these things work against openmrs-core code, rather than having yet more new functionality require the emrapi module.
There’s not a specific driver right now but I’m trying to get us ahead of things.
Thanks @darius and @bharatak. I have similar concerns to @mogoodrich and would love to be a part of a design call where we can think through some of the implications of this change on the rest of the module and distribution ecosystem, and work to mitigate it. Personally I think this needs to be given equal or greater design consideration and forethought than the actual design of the encounter diagnoses feature.
@mogoodrich and I could probably join the call on Monday the 30th, but the Wednesday call would be more difficult.
I figured as much but wanted to leave the option out there. @bharatak let me know if you want to make it to this discussion and we will get this on a Monday call.
I expect (hope?) there will not be much design discussion.
I think the big question is going to be what steps need to be taken to ensure an easy upgrade path. So it would be great if one of @mogoodrich and @mseaton could be there to represent their concerns on that front.
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 CodedOrFreeTextAnswer to Condition (will be used for condition lists and anywhere else we need conditions aka diagnosis/problem/health concern)
Migrate Diagnosis to EncounterDiagnosis, which extends Condition to 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_diagnosis table
Condition aligns us with FHIR’s Condition resource
CodedOrFreeTextAnswer is a generic solution to supporting coded or free text that adds another layer of abstraction in the API. We prefer to incorporate this functionality into Condition
Both @jteich and I preferred EncounterDiagnosis to simply Diagnosis (ambiguous) or Indication (FHIR’s term)
Some renaming:
Order is replaced with Ordinality for PRIMARY vs SECONDARY
Certainty becomes VerificationStatus supporting PROVISIONAL (previously PRESUMED) and CONFIRMED to align with FHIR
We eliminate the need for DiagnosisService once EncounterDiagnosis is a property of Encounter
Things that I would expect in the OpenMRS condition model that aren’t in your diagram:
link to previousCondition (so we can track a history)
Date onsetDate
String additionalDetail
Date endDate
Concept endReason
I’m not in love with calling the new core class Condition without adding some extra fields (which might not be directly relevant to EncounterDiagnosis)…