Skip to content
New issue

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

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

Already on GitHub? # to your account

Missing support for externalized content when using HAPI FHIR #478

Closed
jkiddo opened this issue Jun 10, 2024 · 9 comments
Closed

Missing support for externalized content when using HAPI FHIR #478

jkiddo opened this issue Jun 10, 2024 · 9 comments

Comments

@jkiddo
Copy link
Contributor

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://trifork.com/Library/LastDueDate",
    "identifier": [
        {
            "use": "official",
            "value": "LastDueDate"
        }
    ],
    "version": "1.0.0",
    "name": "LastDueDate",
    "status": "active",
    "experimental": false,
    "type": {
        "coding": [
            {
                "system": "http://terminology.hl7.org/CodeSystem/library-type",
                "code": "logic-library",
                "display": "Logic Library"
            }
        ]
    },
    "date": "2024-06-06",
    "content": [
        {
            "contentType": "text/cql",
            "_data": {
                "extension": [
                    {
                        "url": "http://hapifhir.io/fhir/StructureDefinition/externalized-binary-id",
                        "valueString": "N7UFAtfVcrpt88IJZCdQFqCDFimQf3mlHuHQbvWLupfiEcIOQNRZ515N2a1V89d1TQg2afKf3kY7WtsKxO1OsYVAz7kMlOsVyUZG"
                    }
                ]
            },
            "size": 386
        }
    ]
}
@jkiddo
Copy link
Contributor 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
Contributor 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.

@barhodes
Copy link
Contributor

barhodes commented Jul 3, 2024

@jkiddo Apologies for the delayed response. We've been discussing this internally and have a few ideas for solutions. We would like to avoid putting this logic into the Adapters themselves and are currently leaning towards adding support for the extension into the BaseFhirLibrarySourceProvider.

Do you have some time next week we could meet to discuss so we can better understand what your use case is here and talk through some potential solutions?

@jkiddo
Copy link
Contributor Author

jkiddo commented Jul 5, 2024

@barhodes would love to do so but Im on vacation the next 3 weeks. Im good doing a meeting or so the 26th. Would that work out or is that too late?

@barhodes
Copy link
Contributor

barhodes commented Jul 5, 2024

@jkiddo That will work fine, we can schedule something when you're back.

@jkiddo
Copy link
Contributor Author

jkiddo commented Jul 25, 2024

@jkiddo
Copy link
Contributor Author

jkiddo commented Aug 6, 2024

@barhodes when would a meeting fit you?

@barhodes
Copy link
Contributor

barhodes commented Aug 6, 2024

@barhodes when would a meeting fit you?

Email me at brenin.rhodes@smiledigitalhealth.com and we can setup a meeting.

@JPercival
Copy link
Contributor

Resolved by #520

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

No branches or pull requests

3 participants