I hope you’re all doing well. I’ve got a question regarding our data management in the context of medical problems and encounters. We’ve been working with the APIs for medical problems and encounters to handle our data effectively. However, we’ve hit a bit of a roadblock when it comes to establishing a meaningful connection between these two essential aspects of our system.
Digging a bit into the API for medical problems, we find this query in the ConditionService and we found the following query:
$sql = "SELECT lists.*, lists.pid AS patient_id, lists.title, encounter.uuid as encounter_uuid, patient.puuid, patient.patient_uuid, condition_ids.condition_uuid, verification.title as verification_title ,provider.provider_id ,provider.provider_npi ,provider.provider_uuid ,provider.provider_username FROM lists INNER JOIN ( SELECT lists.uuid AS condition_uuid FROM lists ) condition_ids ON lists.uuid = condition_ids.condition_uuid LEFT JOIN list_options as verification ON verification.option_id = lists.verification and verification.list_id = 'condition-verification' RIGHT JOIN ( SELECT patient_data.uuid AS puuid ,patient_data.pid ,patient_data.uuid AS patient_uuid FROM patient_data ) patient ON patient.pid = lists.pid LEFT JOIN issue_encounter as issue ON issue.list_id =lists.id LEFT JOIN form_encounter as encounter ON encounter.encounter =issue.encounter LEFT JOIN ( select id AS provider_id ,uuid AS provider_uuid ,npi AS provider_npi ,username as provider_username FROM users ) provider ON lists.user = provider.provider_username";
Here we can see the relation between the medical problems (hosted on the lists table) and the encounters through the table issue_encounter.
Our question is the following: Is there a viable approach to establish a relationship between medical problems and encounters using the existing resources at hand, particularly the “issue_encounter” table? We believe that tapping into this untapped potential could unlock the synergy between medical data and encounter information, enhancing our data management and analysis capabilities.
Please don’t hesitate to share your thoughts, suggestions, or potential solutions. Your collective knowledge might just lead us to that “aha” moment we’re seeking.
Thank you for your time and valuable contributions.