RulesEngineService
Provide access to utility functions accessible to the users defining rules in JSON format.
Functions
This function takes inputDate and returns a difference (for examples 15, 30 etc) between inputDate and the currentDate
This function returns a true or false value if any ( matchAll= false) or all ( matchAll= true) of the resources satisfy the conditionalFhirPathExpression provided
Extracts a Patient/RelatedPerson's age
This function extracts a Patient/RelatedPerson's DOB from the FHIR resource
Extracts and returns a translated string for the gender in the resource
This function fetches assignment data separately that is; PractitionerId, PractitionerCareTeam, PractitionerOrganization and PractitionerLocation, using rules on the configs.
This function filters resources provided the condition extracted from the conditionalFhirPathExpression is met. Returns the original source or empty resources list if FHIR path expression is null.
Filters Resource s by comparing the given value against the value obtained after extracting data on each Resource using FHIRPath with the provided fhirPathExpression. The value is cast to the DataType to facilitate comparison using the compareTo function which returns zero if this object is equal to the specified other object, a negative number if it's less than other, or a positive number if it's greater than other.
This function is responsible for formatting a date for whatever expectedFormat we need. It takes an input a date as input and then it gives output in expected Format, expectedFormat is by default (Example: Mon, Nov 5 2021)
This function is responsible for formatting a date for whatever expectedFormat we need. It takes an inputDate string along with the inputDateFormat so it can convert it to the Date and then it gives output in expected Format, expectedFormat is by default (Example: Mon, Nov 5 2021)
This function generates a random 6-digit integer between a hard-coded range. It may generate duplicate outputs on subsequent function calls.
This function combines all string indexes to a list separated by the separator and regex defined by the content author
This function combines all the string values retrieved from the resources using the fhirPathExpression to a list separated by the separator
This function transform the provided resources into a list of label given that the fhirPathExpression for each of the resources is evaluated to true.
Transforms a resource into label if the fhirPathExpression is evaluated to true.
This function takes inputDate and returns a difference (for examples 7 hours, 2 day, 5 months, 3 years etc)
This function takes inputDateString like 2022-7-1 and returns a difference (for examples 7 hours ago, 2 days ago, 5 months ago, 3 years ago etc) inputDateString can give given as 2022-02 or 2022
This method retrieve a parentResource for a given relatedResource from the facts map It fetches a list of facts of the given parentResourceType then iterates through this list in order to return a resource whose logical id matches the subject reference retrieved via fhirPath from the childResource
This method retrieves a list of relatedResources for a given resource from the facts map It fetches a list of facts of the given relatedResourceKey then iterates through this list in order to return a list of all resources whose subject reference matches the logical Id of the resource
This function sorts resources by comparing the values extracted by FHIRPath using the fhirPathExpression. The dataType is required for ordering of the items. You can optionally specify the Order of sorting.