Hey everybody, I’m working on re-implementing the /conceptreferencerange endpoint for platforms < 2.7 (originally from PR #654, removed in #670). Ticket here.
Approach:
- For 2.5-2.6: Using
ConceptNumericas the delegate class (noConceptReferenceRangeAPI available). Returns static reference range values from theConceptNumericitself.isCriteriaBased = falsesince ranges aren’t patient-specific. - For 2.7+: Uses
ConceptReferenceRangewith criteria-based patient-specific lookup.isCriteriaBased = true.
The resource implementation is straightforward, but I’m unsure about the testing approach. Since the test environment uses OpenMRS 2.8.3, the 2.7 resource gets loaded instead of the 2.5 resource, causing controller tests to fail. What’s the recommended approach for testing version-specific resources in the current consolidated codebase? Should we:
- Use resource-level tests only (directly instantiating the resource)
- Re-introduce version-specific modules like the original PR #654
- Use Maven profiles to switch OpenMRS test versions
- Something else?
For context, this is blocking a related PR that requires the endpoint for < 2.7:: (feat) O3-5307: Use criteria-based reference ranges in lab results display by UjjawalPrabhat · Pull Request #2928 · openmrs/openmrs-esm-patient-chart · GitHub
Thanks!