DT-CIUS-PT-020_7.1
The BT-22 when prefixed with '#HASHCODE@ATCERTIFIEDPROGRAM#', have to meet the defined format: alphanumeric with size between 1 and 20.
What the rule checks
As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.
//ubl:Invoice/cbc:Note | //cn:CreditNote/cbc:Note
starts-with(normalize-space(.),'#HASHCODE@ATCERTIFIEDPROGRAM#') and not(matches(normalize-space(substring-before(substring-after(.,'#HASHCODE@ATCERTIFIEDPROGRAM#'),'#')),'^(.{1,20})$'))
Checked with Portugal CIUS-PT Invoice (UBL), Portugal CIUS-PT Credit Note (UBL)