Validator seemingly applying R5 rules to R4 context/profiles post HAPI upgrade

114 views
Skip to first unread message

Duncan Johnstone

unread,
Sep 8, 2023, 5:16:19 PM9/8/23
to HAPI FHIR
First a major thanks to all involved supporting HAPI-FHIR; truly a great initiative!

Hoping the group can point me in the right direction for specific R4 validation issues tied to a HAPI upgrade.  Forgive me if this has topic been addressed in prior threads, as I couldn't find an exact fit.


We have been trying to upgrade HAPI-FHIR libraries taking a 'large' leap from v5.0.2 to v6.8.0. In v5.0.2, passing R4 context for our R4 profiles (v4.0.1), we did not face any validation issues (no warnings/errors).  However, in v6.8.0 we are facing new warnings & errors under the 'new' validator for the same R4 profiles (still passing the same R4 context, per the non-deprecated guidance here)

 

On the surface, the 'new' validation issues appear to be tied to 'new' rules only present in R5, and not in R4.  One example is a warning for constraint rule bdl-18 "Self link is required for searchsets".  We see this constraint in an R5 bundle, but seemingly not in an R4 bundle, hence it is an unexpected warning when receiving it HAPI v6.8.0 (passing R4 context and an R4 profile without this self link)

  

        {

            "severity""warning",

            "code""processing",

            "details": {

                "coding": [

                    {

                        "system""http://hl7.org/fhir/java-core-messageId",

                        "code""BUNDLE_SEARCH_NOSELF"

                    }

                ]

            },

            "diagnostics""SearchSet Bundles should have a self link that specifies what the search was",

            "location": [

                "Bundle",

                "Line 1, Col 2838"

            ]

        }


In trying to debug, it appears HAPI upgrade is ‘up-converting' our R4 profiles (per R4 context passed) to R5 and validating per single R5 validator.


In our current implementation, we are not ignoring any warnings or errors, so hoping to find a solution here without workarounds.   Hoping I am missing something obvious thinking these validations are only applicable to R5, when somehow they are now applicable to prior versions. Our goal is to keep HAPI current, but remain R4 in the short term.


Thanks in advance...

Duncan Johnstone

unread,
Sep 12, 2023, 4:00:47 PM9/12/23
to HAPI FHIR
Summary;   

This inquiry can be closed, as the issue is our R4 profiles are not actually R4 compliant.  Per evolution of HAPI libraries, validator is now catching an existing R4 issue in our profiles that was identified by the validator in previous HAPI releases. See details below.

Details;

Learning that the issue described above is tied to our R4 code & profiles not currently conforming to the R4 Search constraint which requires self-links in the Search response detailing query criteria applied on the server side via returned URL in the self link (HTTP GET construct).  This is caught as a warning per our use of newer HAPI version & validator as detailed above (incorrectly interpreted to be R5 rule tied to R5 bundles) , but for unknown reasons, this was not caught for the same  profiles when using older HAPI version & validator (hence we incorrectly assumed R4 compliance, and this 'new' warning being R5 Bundle constraint related).  The R4 Search Conformance section defines this, and the R5 Search Self Link section elaborates on it for R5.  

Our team will reimplement self-links on our Search response accordingly, rationalizing the self links returned for Patient Search (GET, POST) queries vs. Patient $match operation queries (POST), where the common validation rule per HAPI FHIR is searchset response bundles requring self link with server query criteria applied.  This isn't self-evident in the $match operation pages (unless we missed it), which contributed to the confusion re: bundle rules vs. search rules.

Thanks again to the HAPI and FHIR teams for maintaining the resources to support this analysis and solution.

Please consider this inquiry as now closed...

James Agnew

unread,
Sep 12, 2023, 4:04:38 PM9/12/23
to Duncan Johnstone, HAPI FHIR
Hi Duncan,

(Sorry for missing your first message - for some reason I just discovered that GMail has been sending a lot of my messages in this group to my spam folder. Sigh)

This is actually just a new rule that was introduced in a newer version of the validator. Often, things that the validator did not catch in previous versions of the validator get added so that they are caught by newer versions of the validator. In this case, it looks like Grahame added this in April 2021.

The R5 message is a bit misleading - we use a single R5 codebase for handling all versions of validation, with StructureDefinitions and other definitional resources being "up-converted" in order to use them in the R5 validator. The validator is still applying R4 rules though in R4 mode.

Cheers,
James

--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/356fb620-afba-47ac-9770-6c7585569db5n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages