ehn-dcc-development / eu-dcc-business-rules

eHealth collaboration space business rules
Apache License 2.0
30 stars 16 forks source link

VR-UA-0003 Related Problem/Question #88

Closed dagdelenmustafa closed 1 year ago

dagdelenmustafa commented 2 years ago

Hi @dslmeinte,

I have realized that all the rules can run on different dcc types. I mean, even if I evaluate a "v" payload on a test result rule, it successfully evaluate and returns true because the payload does not have "t" field. But for VR-UA-0003 , the result is not the same. It returns all operands of a comparison operation must be of integer type error. I think there is a missing if operator which checks the existence of payload.v.0.dn and payload.v.0.sn fields.

My question is this something that we must handle or is this a rule definition error. If it's an error how can we inform the responsible people ?

VR-UA-0003 Rule Logic:

{
  "if": [
      {
          "<": [
              {
                  "var": "payload.v.0.dn"
              },
              {
                  "var": "payload.v.0.sd"
              }
          ]
      },
      {
          "not-after": [
              {
                  "plusTime": [
                      {
                          "var": "external.validationClock"
                      },
                      0,
                      "day"
                  ]
              },
              {
                  "plusTime": [
                      {
                          "var": "payload.v.0.dt"
                      },
                      120,
                      "day"
                  ]
              }
          ]
      },
      {
          "not-after": [
              {
                  "plusTime": [
                      {
                          "var": "external.validationClock"
                      },
                      0,
                      "day"
                  ]
              },
              {
                  "plusTime": [
                      {
                          "var": "payload.v.0.dt"
                      },
                      365,
                      "day"
                  ]
              }
          ]
      }
  ]
}
dslmeinte commented 2 years ago

Hi @dagdelenmustafa , You're absolutely right: this rule won't evaluate correctly (without throwing an error) on anything other than a vaccination-DCC. Apparently, the majority of DCCs coming into this particular country happen to be of that type. Of course, you should also handle the exception in a verifier app, ideally by considering it to evaluate to false and providing an appropriate error message. But the rule should also be amended. I tried to get hold of a business rules developer for this country, but haven't succeeded so far. Thanks for reminding me!

dagdelenmustafa commented 2 years ago

Hi, thanks for the quick response :) I understand the reason as well.

I also have one more concern which is not so technical. What should I do when I try to evaluate a Test-DCC against AL which has no defined rules for Test type. It returns true but the AL country has a vaccination rule. I am a bit confused at this situation. Do you have a suggestion ? Thanks again

dslmeinte commented 2 years ago

@dagdelenmustafa AL has 4 rules for a DCC of type Test, so that should not be a problem. But you certainly have a point, which was also raised through the LF Public Health Slack channel today. (I assume you're not Martin Wicke.)

dagdelenmustafa commented 2 years ago

@dslmeinte Yes, you are correct 😄 I'm not Martin but we are working together and sharing the same concern. Probably, that's why he also asked through the slack channel.

dslmeinte commented 2 years ago

Hi @dagdelenmustafa , You're absolutely right: this rule won't evaluate correctly (without throwing an error) on anything other than a vaccination-DCC. Apparently, the majority of DCCs coming into this particular country happen to be of that type. Of course, you should also handle the exception in a verifier app, ideally by considering it to evaluate to false and providing an appropriate error message. But the rule should also be amended. I tried to get hold of a business rules developer for this country, but haven't succeeded so far. Thanks for reminding me!

dslmeinte commented 2 years ago

We'll be picking this up as part of a new eHN DCC Business Rules Governance process.

dslmeinte commented 1 year ago

A governance process for business rules hasn't been installed in the meanwhile, and given that business rules are essentially defunct now, I'm closing this issue as a result.