cdisc-org / cdisc-org/cdisc-rules-engine
Custom Rules: Get Custom standards and versions functioning in editor
- Dominant language
- Python
- Stars
- 113
- Forks
- 43
- Avg merge
- 14h 51m
- Merged PRs (30d)
- 14
Description
the TestRule endpoint uses the [cachepopulator ](https://github.com/cdisc-org/cdisc-rules-engine/blob/8c1e342200b61dd206690f51105bba9b3e29db09/TestRule/__init__.py#L77) which uses CDISCLibraryClient to make API calls to cdisc library to get standards and caches it whenever a rule is tested in editor.
- We would need to detect custom standards from the library tab (likely with a naming convention `custom_`) and this would direct engine to make the API calls to a custom endpoint (configured in the .env) that returns your standards and versions.
- custom standards will need to be nested in JSON structure similar to CDISC standards to allow for parsing logic to function properly when the standards are retrieved
- We would also likely need standard custom session logic where the user gives a CUSTOM_API_KEY in the .env to initiate a session.
A/C:
- detect custom standards/version in editor, calling CustomLibraryService which contains custom API logic with base_api_URL and api-key coming from .env. see [here](https://github.com/cdisc-org/cdisc-library-client/blob/92d4cd7d3847eb157fe1161ae0052894abaef711/cdisc_library_client/library_client.py#L17)
- assuming the json is structured similarly to CDISC standards, CachePopulator would be able to parse the standard. Some changes in the parse logic may be needed.
- readme defining implementation, environment variables, and the standardized endpoints (would use the standard name and version similar to how CDISC endpoints are defined but parse it from the standard/version
```
def get_cdash(self, version):
href = f"/mdr/cdash/{version}"
return self.get_api_json(href)
```
if standard is custom_standard2 and version 2.0, engine would ping your_base_api_url/standard2/2-0 endpoint
Contributor guide
Assessment
This issue has not been assessed yet.