Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

Rules engine refactoring #1037

Merged
merged 36 commits into from
May 3, 2024
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
f5e94fe
Refactored validation rule engine in preparation for tranformation en…
basiliskus Apr 23, 2024
28505a5
Fixed instantiation
basiliskus Apr 23, 2024
2c3f69d
Merge branch 'main' into story/1024/transformation-engine
basiliskus Apr 24, 2024
bdd568a
Refactored to make Rule interface more generic
basiliskus Apr 25, 2024
f65cede
Fixed tests
basiliskus Apr 25, 2024
0cf5640
Update transformation_definitions.json
luis-pabon-tf Apr 25, 2024
a08c687
Merge branch 'main' into story/1024/transformation-engine
basiliskus Apr 25, 2024
8631334
Added missing override tags
basiliskus Apr 25, 2024
6214e84
Fixed arg naming
basiliskus Apr 25, 2024
4756364
Use generics to deserialize correct type of Rule implementation
basiliskus Apr 25, 2024
1de28ef
Converted RuleEngine back into a singleton and added parameters
basiliskus Apr 26, 2024
5c8073b
Refactored to have a separate implementation for ValidationRuleEngine
basiliskus Apr 26, 2024
45a3bca
Refactored to pass TypeReference and fix mapping issue
basiliskus Apr 26, 2024
d5490e8
Added missing override tags
basiliskus Apr 26, 2024
8e7398c
Fixed tests in ValidationRuleEngineIntegrationTest
basiliskus Apr 26, 2024
dbd8043
Fixed more tests
basiliskus Apr 26, 2024
d399054
Removed transformation engine implementation to move into new PR
basiliskus Apr 26, 2024
76b7d82
Update ValidationRuleTest.groovy
luis-pabon-tf Apr 29, 2024
27ea75d
Update ValidationRuleEngineTest.groovy
luis-pabon-tf Apr 29, 2024
0f1b275
Update ValidationRuleEngine.java
luis-pabon-tf Apr 29, 2024
5acab7a
Update ValidationRuleEngineTest.groovy
luis-pabon-tf Apr 29, 2024
28b0d7a
Update ValidationRuleEngineTest.groovy
luis-pabon-tf Apr 29, 2024
1f57bb1
Update Rule loading to handle Path for flexibility
saquino0827 Apr 29, 2024
5d4dd9e
Merge branch 'story/1024/transformation-engine' of https://github.com…
saquino0827 Apr 29, 2024
34a2bf9
Fixed remaining test
basiliskus Apr 29, 2024
e137c1d
Fixed actual remaining test
basiliskus Apr 29, 2024
0fc78c5
Changed naming
basiliskus Apr 29, 2024
95d4b2d
Update ValidationRuleEngineTest.groovy
luis-pabon-tf Apr 29, 2024
a27a876
Merge branch 'story/1024/transformation-engine' of https://github.com…
luis-pabon-tf Apr 29, 2024
c0f0093
Added test coverage
basiliskus Apr 29, 2024
2a5f7ab
Updated javadocs
basiliskus Apr 29, 2024
4a5068d
Created trasnformation package and moved transformation engine files
basiliskus Apr 29, 2024
2bd21c8
Changed implementation for rules implementation to inherit from Rule …
basiliskus Apr 29, 2024
6ba1943
Clean up
basiliskus Apr 29, 2024
a03dd0b
Added missing override tag
basiliskus Apr 29, 2024
e9290aa
Create RuleTest.groovy
luis-pabon-tf Apr 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update ValidationRuleTest.groovy
Fix method names
luis-pabon-tf committed Apr 29, 2024
commit 76b7d82e14f57f399d7eddecafb88adb4621215b
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ class ValidationRuleTest extends Specification {
rule.getRules() == validations
}

def "appliesTo returns expected boolean depending on conditions"() {
def "shouldRun returns expected boolean depending on conditions"() {
given:
def mockFhir = Mock(HapiFhir)
mockFhir.evaluateCondition(_ as Object, _ as String) >> true >> conditionResult
@@ -58,7 +58,7 @@ class ValidationRuleTest extends Specification {
false | false
}

def "appliesTo logs an error and returns false if an exception happens when evaluating a condition"() {
def "shouldRun logs an error and returns false if an exception happens when evaluating a condition"() {
given:
def mockFhir = Mock(HapiFhirImplementation)
mockFhir.evaluateCondition(_ as Object, "condition") >> { throw new Exception() }
@@ -74,7 +74,7 @@ class ValidationRuleTest extends Specification {
!applies
}

def "isValid returns expected boolean depending on validations"() {
def "runRule returns expected boolean depending on validations"() {
given:
def mockFhir = Mock(HapiFhir)
TestApplicationContext.register(HapiFhir, mockFhir)
@@ -101,7 +101,7 @@ class ValidationRuleTest extends Specification {
0 * mockLogger.logError(_ as String, _ as Exception)
}

def "isValid logs an error and returns false if an exception happens when evaluating a validation"() {
def "runRule logs an error and returns false if an exception happens when evaluating a validation"() {
given:
def mockFhir = Mock(HapiFhirImplementation)
mockFhir.evaluateCondition(_ as Object, "condition") >> { throw new Exception() }