Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing support for externalized content when using HAPI FHIR #478

Open
jkiddo opened this issue Jun 10, 2024 · 2 comments
Open

Missing support for externalized content when using HAPI FHIR #478

jkiddo opened this issue Jun 10, 2024 · 2 comments

Comments

@jkiddo
Copy link

jkiddo commented Jun 10, 2024

The functionality here:

is missing HAPI FHIR support when used together with the externalized content feature as documented here: https://smilecdr.com/docs/fhir_repository/binary_data.html#externalized-binary-storage as it missing to look up the HAPI FHIR defined extension on the data field if used. Example of piece of data as follows:

{
    "resourceType": "Library",
    "id": "14",
    "meta": {
        "versionId": "1",
        "lastUpdated": "2024-06-09T20:52:41.320+02:00"
    },
    "url": "http:https://trifork.com/Library/LastDueDate",
    "identifier": [
        {
            "use": "official",
            "value": "LastDueDate"
        }
    ],
    "version": "1.0.0",
    "name": "LastDueDate",
    "status": "active",
    "experimental": false,
    "type": {
        "coding": [
            {
                "system": "http:https://terminology.hl7.org/CodeSystem/library-type",
                "code": "logic-library",
                "display": "Logic Library"
            }
        ]
    },
    "date": "2024-06-06",
    "content": [
        {
            "contentType": "text/cql",
            "_data": {
                "extension": [
                    {
                        "url": "http:https://hapifhir.io/fhir/StructureDefinition/externalized-binary-id",
                        "valueString": "N7UFAtfVcrpt88IJZCdQFqCDFimQf3mlHuHQbvWLupfiEcIOQNRZ515N2a1V89d1TQg2afKf3kY7WtsKxO1OsYVAz7kMlOsVyUZG"
                    }
                ]
            },
            "size": 386
        }
    ]
}
@jkiddo
Copy link
Author

jkiddo commented Jun 16, 2024

I guess one way to fix it would be to extract this

public static AdapterFactory getAdapterFactory(FhirContext fhirContext) {
and let the adaptors from the factory do the lifting. Then everything else could be left untouched.

@jkiddo
Copy link
Author

jkiddo commented Jun 23, 2024

@barhodes I can do a PR that fixes it but it will have quite the impact on the current architecture. Due the static design on CqlEngine and the switch statements for obtaining a AdapterFactory I'd prefer a discussion before heading into a PR adventure. I did the original design on e.g. https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/java/ca/uhn/fhir/jpa/starter/annotations/OnEitherVersion.java and I would suggest to head the same direction - having the version of the AdaptorFactories being bound to configs outside the CqlEngine - or at least injected into it. There isn't many Spring annotations in the existing codebase and I assume you guys would prefer it stays that way? Preferrably and overall I would suggest let the specific AdaptorFactory be constructed by Spring and let that be arried through the different places. Let me know what you think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant