Custom Rules: Get Custom Standards And Versions Functioning In Editor
Introduction
In the context of the CDISC Rules Engine, custom standards and versions can be a valuable addition to the existing library of standards. However, implementing custom standards requires a deep understanding of the underlying architecture and the necessary modifications to the engine. In this article, we will explore the process of getting custom standards and versions functioning in the editor, including the detection of custom standards, the creation of a custom library service, and the necessary changes to the cache populator and session logic.
Detecting Custom Standards in the Editor
To begin, we need to detect custom standards in the library tab. This can be achieved by implementing a naming convention, such as custom_
, to identify custom standards. Once detected, the engine will direct the user to make API calls to a custom endpoint, which is configured in the .env
file. This custom endpoint will return the custom standards and versions.
# Custom Standards Detection
To detect custom standards, we will implement a naming convention of `custom_` in the library tab.
This will direct the engine to make API calls to a custom endpoint, configured in the `.env` file.
Custom Library Service
The custom library service will contain custom API logic, including the base API URL and API key, which are obtained from the .env
file. This service will be responsible for making API calls to the custom endpoint and retrieving the custom standards and versions.
# Custom Library Service
The custom library service will contain custom API logic, including the base API URL and API key.
This service will be responsible for making API calls to the custom endpoint and retrieving the custom standards and versions.
Custom Session Logic
To initiate a session, the user will need to provide a CUSTOM_API_KEY in the .env
file. This key will be used to authenticate the user and retrieve the custom standards and versions.
# Custom Session Logic
To initiate a session, the user will need to provide a CUSTOM_API_KEY in the `.env` file.
This key will be used to authenticate the user and retrieve the custom standards and versions.
Parsing Custom Standards
Assuming the JSON structure of the custom standards is similar to the CDISC standards, the cache populator will be able to parse the standard. However, some changes in the parse logic may be necessary to accommodate the custom standards.
# Parsing Custom Standards
Assuming the JSON structure of the custom standards is similar to the CDISC standards,
the cache populator will be able to parse the standard.
However, some changes in the parse logic may be necessary to accommodate the custom standards.
Standardized Endpoints
To define the implementation, environment variables, and standardized endpoints, we will use the standard name and version, similar to how CDISC endpoints are defined. However, we will parse the standard and version from the custom standard.
# Standardized Endpoints
To define the implementation, environment variables, and standardized endpoints,
we will use the standard name and version, similar to how CDISC endpoints are defined.
However, we will parse the standard and version from the custom standard.
Example Implementation
Here is an example implementation of the custom library service and the necessary changes to the cache populator and session logic:
# Custom Library Service
class CustomLibraryService:
def __init__(self, base_api_url, api_key):
self.base_api_url = base_api_url
self.api_key = api_key
def get_custom_standard(self, standard_name, version):
href = f"/{standard_name}/{version}"
return self.get_api_json(href)
# Cache Populator
class CachePopulator:
def __init__(self, custom_library_service):
self.custom_library_service = custom_library_service
def parse_custom_standard(self, standard_json):
# Parse the custom standard from the JSON structure
pass
# Session Logic
class SessionLogic:
def __init__(self, custom_api_key):
self.custom_api_key = custom_api_key
def initiate_session(self):
# Initiate a session using the custom API key
pass
Conclusion
Introduction
In our previous article, we explored the process of getting custom standards and versions functioning in the editor. However, we understand that there may be many questions and concerns regarding this implementation. In this article, we will address some of the most frequently asked questions and provide additional information to help clarify the process.
Q&A
Q: What is the purpose of the custom library service?
A: The custom library service is responsible for making API calls to the custom endpoint and retrieving the custom standards and versions. It contains custom API logic, including the base API URL and API key, which are obtained from the .env
file.
Q: How do I detect custom standards in the editor?
A: To detect custom standards, you will need to implement a naming convention, such as custom_
, in the library tab. This will direct the engine to make API calls to a custom endpoint, configured in the .env
file.
Q: What is the difference between CDISC standards and custom standards?
A: CDISC standards are pre-defined standards that are widely used in the industry. Custom standards, on the other hand, are user-defined standards that are specific to an organization or project.
Q: How do I parse custom standards?
A: Assuming the JSON structure of the custom standards is similar to the CDISC standards, the cache populator will be able to parse the standard. However, some changes in the parse logic may be necessary to accommodate the custom standards.
Q: What is the purpose of the standardized endpoints?
A: The standardized endpoints are used to define the implementation, environment variables, and standardized endpoints. They are similar to how CDISC endpoints are defined, but they parse the standard and version from the custom standard.
Q: How do I initiate a session using the custom API key?
A: To initiate a session, you will need to provide a CUSTOM_API_KEY in the .env
file. This key will be used to authenticate the user and retrieve the custom standards and versions.
Q: What are the benefits of implementing custom standards and versions?
A: Implementing custom standards and versions provides several benefits, including:
- Increased flexibility and customization
- Improved data quality and accuracy
- Enhanced collaboration and communication
- Better alignment with organizational or project-specific requirements
Q: What are the challenges of implementing custom standards and versions?
A: Some of the challenges of implementing custom standards and versions include:
- Complexity and difficulty in parsing custom standards
- Limited support and resources for custom standards
- Potential conflicts with existing CDISC standards
- Difficulty in maintaining and updating custom standards
Conclusion
In conclusion, implementing custom standards and versions in the CDISC Rules Engine requires a deep understanding of the underlying architecture and the necessary modifications to the engine. By addressing some of the most frequently asked questions and providing additional information, we hope to have clarified the process and provided a better understanding of the benefits and challenges of implementing custom standards and versions.
Additional Resources
For more information on implementing custom standards and versions, please refer to the following resources:
- CDISC Rules Engine documentation
- CDISC Library documentation
- Custom Library Service documentation
- Cache Populator documentation
- Session Logic documentation
Contact Us
If you have any further questions or concerns regarding implementing custom standards and versions, please do not hesitate to contact us. We are here to help and provide support.