# Resolving EHR_STATUS refs **Category:** [Platform](https://discourse.openehr.org/c/platform-implem/7) **Created:** 2024-08-27 11:20 UTC **Views:** 48 **Replies:** 2 **URL:** https://discourse.openehr.org/t/resolving-ehr-status-refs/5628 --- ## Post #1 by @sebastian.iancu It seems to me that EHRbase resolves OBJECT_REF refs in case of EHR_STATUS, replacing it with the actual object - see https://docs.ehrbase.org/docs/EHRbase/Explore/AQL/Common#retrieve-ehr-id-and-external-subject-id-of-a-patient, but basically it is about an AQL like: ``` SELECT e/ehr_id/value, e/ehr_status/subject/external_ref/id/value FROM EHR e ``` So my questions are: 1. Is this a (nice) EHRbase-feature, or an AQL requirement that I am not aware of? 2. Is this also working on Better platform AQL 3. Is this only implemented for EHR/EHR_STATUS refs, or is it also available to more other situations? (for example for refs somewhere inside COMPOSITION structures) --- ## Post #2 by @ian.mcnicoll The Better CDR works exactly the same - I would guess this comes from original Ocean CDR behaviour. Can you give an example of other Composition refs, other than LINKS and EHR_URIS that are not resolved? --- ## Post #3 by @sebastian.iancu I don't have an example, I was curious about what else besides EHR_STATUS is resolved in this fashion. These cases could be for instance refs of the other EHR aspects (directory, ehr_status, contribution, etc) or from FOLDERs enclosing COMPOSITION. any other place where OBJECT_REF is used. If this case of object ref is always resolved, then: 1. should we have this specified in the AQL specs? 2. what to do with an AQL that is considering the RM and is trying to get he OBJECT_REF? (e.g. `SELECT e/ehr_status/id/type FROM EHR e`) 3. What else (besides EHR_STATUS) should the specs state that it should be always resolved? In any case, the issue with accessing EHR_STATUS could have been solved in a different way, without having the engine replace the ref with the corresponding object, with using equivalent `SELECT es FROM EHR contains EHR_STATUS es`, right? --- **Canonical:** https://discourse.openehr.org/t/resolving-ehr-status-refs/5628 **Original content:** https://discourse.openehr.org/t/resolving-ehr-status-refs/5628