FHIR Chat · SMART-on-FHIR TypeScript · smart

Stream: smart

Topic: SMART-on-FHIR TypeScript


view this post on Zulip Stefan Iseli (Jul 09 2018 at 08:27):

Hi there :)

I got a short suggestion.
In the issue #27 of the client.js repo on github (https://github.com/smart-on-fhir/client-js/issues/27) I’ve mentioned that we from the institute for medical informatics (I4MI) at the university of applied sciences bern are interested in a TypeScript version of the client.js library.

We would like to share/contribute our TypeScript library, which was developed according SMART on FHIR (as far as I know). Our library is assimilated to work with IONIC. So in the authentication process a cordova plugin is used and it is not as generic as we would it like to be. You can use every code snipped/function of the midata.ts in this library as a contribution for a new client.ts library, as long as you mention the BFH and the I4MI as a contributor for the new library and also mention them as co-authors in the source code (conditions of my superiors). I hope our little library will help to develop and result in a more generic library. The source code can be found on the following git link:
https://github.com/i4mi/midata.js

The file “midata.ts” is the main file which handles the authentication and the requests. I recommend to look at and checkout the dev-buildFix branch, because of it uses compatible versions of the npm plugins in the package.json.
The classes in the resources folder are pre-defined fhir resource used in our project. These pre-defined fhir objects will still be part of the I4MI and will be further developed by us. If you have any contribution on this part, we would appreciate it as well.

The idea behind our contribution/cooperation is, that there would be a generic client.ts library, which only handles the requests and returns the responses/objects to let them be handled differently for the different consumers. Now the client.js is handling the response of the authentication by itself (with the sessionStorage). Unfortunately not every framework (like IONIC) can or should handle the storage access like that. There are additional plugins needed. So we thought of making something like the following architecture:
midataJS_clinentJS_new.png

Like this it will easily be possible for other contributors to make wrappers/adapters for other frameworks. We (I4MI) will surely make an IONIC wrapper because the students at our university mostly use this framework. These wrappers would then be able to use the object-on-fhir library of our institute. We think that this solution will enable more people to contribute but also enables both sides to focus on specific tasks and not the whole.

What do you think about it?
I hope this helps and that we can come to a cooperation with the smart-on-fhir team.

Best
Stefan


Last updated: Apr 12 2022 at 19:14 UTC