1

I have a project in which I have to perform a a FHIR validation. I have implemented this functionality in a regular Java application using the hapi-fhir library with the Instance Validator and Schematron Validator. I am trying to do the same for android but I have concluded that hapi-fhir using a caching library (caffeine) which is not supported in android.

Is there any way I can implement this? Maybe bypass caffeine caching or something I can't think of?

Any suggestions can be very helpful!!

konkouts
  • 51
  • 1
  • 6
  • Have you checked their GitHub page ? There's a dependecy `hapi-fhir-android` [here](https://github.com/hapifhir/hapi-fhir/tree/01d6e15f905a344dc0b833c1b0e59808ffea973d/hapi-fhir-android) – Davut Gürbüz Apr 18 '22 at 07:46
  • Hello @DavutGürbüz. I have checked the android dependency but I can't figure out if and how I can perform validation in particular. – konkouts Apr 18 '22 at 09:26
  • I don't wanna direct you to wrong, but what I see [here](https://github.com/hapifhir/hapi-fhir/blob/01d6e15f905a344dc0b833c1b0e59808ffea973d/hapi-fhir-android/src/test/java/ca/uhn/fhir/android/client/GenericClientDstu3IT.java) there is a test case. `ourCtx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER);` inside that factory some validation related methods are implemented, like `newValidator()` which is returning FHIRValidator. Maybe from the project contributors you can get required help. – Davut Gürbüz Apr 18 '22 at 10:47
  • Thank you very much for the hint. I will look what I can get from this. Appreciate it. – konkouts Apr 18 '22 at 10:53

1 Answers1

3

My advice would definitely be to offload any StructureDefinition (i.e profile) validation to a server, e.g. by calling the $validate operation.

FHIR's native validation capabilities are really powerful, but they are by their nature very compute-intensive which is always going to be problematic on a mobile device.

For what it's worth, the approach I've seen people take generally is to hand-roll any validation rules on the device that are required for a good UI experience (e.g. mandatory fields and that kind of thing) but then to defer the complex structuredefinition rules until the data hits a server.

James Agnew
  • 701
  • 4
  • 3