FHIR Chat · reusable software components · implementers

Stream: implementers

Topic: reusable software components


view this post on Zulip Erich Schulz (May 30 2016 at 22:30):

I've been poking around in javascript (angular/express) of late... and attempting to avoid reinventing of wheels

view this post on Zulip Erich Schulz (May 30 2016 at 22:44):

and I'm wondering how much history/ground-work has gone in the space?

view this post on Zulip Erich Schulz (May 30 2016 at 22:47):

I'm particularly interested in javascript (bower/npm) packages - but I imagine that much of this logic (and even some of the architectural scope decisions) would transcend language choice

view this post on Zulip Erich Schulz (May 30 2016 at 23:01):

there seem to be cluster of demonstration projects - but I'm yet to see (without looking hard!) a pattern that separates [client], [server], [presentation] and [controller] components as stand-alone reusable packages

view this post on Zulip Erich Schulz (May 30 2016 at 23:01):

although noting an abundance of off the shelf REST client and server things

view this post on Zulip Erich Schulz (May 30 2016 at 23:02):

so its more the "controller" utilities and presentation that maybe of more interest

view this post on Zulip Erich Schulz (May 30 2016 at 23:03):

(i started this flight of ideas considering angular directives)

view this post on Zulip Erich Schulz (May 30 2016 at 23:04):

but I'm also thinking there maybe scope for a kind of "lodash for FHIR" general utility library

view this post on Zulip Erich Schulz (May 30 2016 at 23:06):

I'm imagining that many of the demonstration project authors would have encountered or created many such little reusable gems

view this post on Zulip Josh Mandel (May 31 2016 at 15:29):

I think you're correct to be thinking along these lines (though possible better to do so in the javascript stream) @Erich Schulz -- the trick is to produce a compelling enough set of these utilities that developers are willing to follow your conventions to benefit from them. Critical mass, in other words.

view this post on Zulip Erich Schulz (May 31 2016 at 22:15):

@Josh Mandel I'm thinking this much bigger than javascript - I've noticed work going on in both java and c# - and I think that there would be little nuggets of reusable goodness in these projects already

view this post on Zulip Erich Schulz (May 31 2016 at 22:17):

i'm thinking having some common patterns in a "utility belt" library that transcended language would help achieve critical mass

view this post on Zulip Erich Schulz (May 31 2016 at 22:18):

although javascript seems like the way of the future to me - a colleague was just singing the virtues of python of all things and predicting it rise (?)

view this post on Zulip Grahame Grieve (Jun 01 2016 at 03:11):

I'm not sure how you plan to share a library that transcends platforms. We do talk a lot about similarity of design between java and dotnet, but it's not exactly the same - mostly for a good reasons.

view this post on Zulip Erich Schulz (Jun 01 2016 at 03:45):

main thing would be to share conceptual work

view this post on Zulip Erich Schulz (Jun 01 2016 at 03:46):

yes code wont share - but possibly many function signatures would be similar (?identical)

view this post on Zulip Grahame Grieve (Jun 01 2016 at 03:46):

well, you can look at what the Java and dotnet libraries have. But it's not obvious that the javascript library should have the same functionality as them or not

view this post on Zulip Erich Schulz (Jun 01 2016 at 03:47):

also by thinking cross platform it could be that some of the implied knowledge can be dropped as a config file that all languages can use

view this post on Zulip Erich Schulz (Jun 01 2016 at 03:48):

rather than trawlling through 1000's of lines of code I'm hoping for pointers :-)

view this post on Zulip Erich Schulz (Jun 01 2016 at 03:50):

when I get a mo I'll start a google doc to write up a few functions to illustrate the kinds of things i'm think of

view this post on Zulip Erich Schulz (Jun 01 2016 at 03:51):

2 use cases I have already is taking a raw JSON blob and trimming out the stuff that could be considered as "noise" in a ui context

view this post on Zulip Grahame Grieve (Jun 01 2016 at 03:51):

how would you know?

view this post on Zulip Grahame Grieve (Jun 01 2016 at 03:55):

here's the stuff we have in the java library:
- A run time context for holding factories and loaded conformance resources
- generated object model + parsers (generated using the Object Model mappings in the resources)
- element based object model + validating parsers
- fluent path engine
- validator
- narrative generator
- a bunch of terminology and conformance utilities that power the build
- StructureMap based transform engine
- client

view this post on Zulip Grahame Grieve (Jun 01 2016 at 03:55):

HAPI builds lots of other things on top of that too

view this post on Zulip Yunwei Wang (Jun 01 2016 at 03:56):

I think @Erich Schulz wants to use config file to pinpoint UI element to individual data attribute in JSON/XML raw data.

view this post on Zulip Grahame Grieve (Jun 01 2016 at 03:57):

some kind of UI binding thing? sounds very context specific, as well as implementation specific

view this post on Zulip Yunwei Wang (Jun 01 2016 at 03:58):

That's my guess from his post.

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:15):

sweet

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:16):

so game would be to isolate functions with clean injectable dependancies

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:18):

this would not necessarily be a UI related

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:18):

the general theme is little bits of transformation that occur commonly in the context of FHIR handling but are not handled by standard language constructs

view this post on Zulip Grahame Grieve (Jun 01 2016 at 04:21):

I haven't found anything like that myself yet

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:21):

(i also am thinking some UI widgets maybe sharable but that is truly highly context specific)

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:21):

mmm

view this post on Zulip Grahame Grieve (Jun 01 2016 at 04:21):

UI widget for good code look up --> that would be a winner

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:21):

heh

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:22):

the angular ui-bootstrap "typeahead" is probably a good start for a code look up

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:22):

it plays nice with RESTful endpoints

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:24):

recurring theme I noticed in presenting the observation, flag, condition resources is there are are often code values that basically mean "normal" ie a "confirmed condition" is basically "condition" - to say "confirmed" is just visual clutter in the UI

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:26):

or "status=final" for an observation

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:30):

a more interesting example is the "status" value for encounters... if the event is in the future then "planned" is implied, wherase if it is in the past then "finished" is implied

view this post on Zulip Grahame Grieve (Jun 01 2016 at 04:32):

but the impact of that on your UI is highly variable

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:38):

sure

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:38):

that's why its a library

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:38):

use it if it works or not, or let users toggle both "cleaned" and "full" display

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:39):

if there are some common variations they could be parameters

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:39):

but 80:20 rule would apply

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:39):

point being that is a single example

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:43):

if some kind of classification engine is injected then some more interesting possibilities exist

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:44):

eg to remove or collapse reduntant observations and condtions (if problem list includes "asthma" and "acute asthma" only show the second....

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:45):

if 100 repeated observation in a short period then reduce that to a range

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:47):

this is in the unix philosophy of small simple tools that do a single job and are easy to plug into bigger systems

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:49):

the lodash library is the closest example to what I'm imagining

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:50):

another nice example is the moment library

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:51):

http://momentjs.com/

view this post on Zulip Grahame Grieve (Jun 01 2016 at 04:51):

since I - and probably most readers - have no idea what they are, do you want to describe them?

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:51):

sure moment is a set of functions that just do things with dates and times

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:53):

lodash is more heterogenous but provides a stack of function that manipulate JS arrays, objects and collections (sort, extract columns, search, iterate over etc)

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:54):

I think these would be two of the most commonly used JS packages and they transcend the framework

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:55):

https://lodash.com/docs

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:56):

ie just simple collections of simple functions with no external dependancies

view this post on Zulip Erich Schulz (Jun 01 2016 at 04:56):

that save 1000's of coders having to reinvent wheels

view this post on Zulip Erich Schulz (Jun 01 2016 at 08:47):

got home from work... starting to make a doc to capture the above ramblings...

view this post on Zulip Erich Schulz (Jun 01 2016 at 08:48):

these are some examples of the kind of thing I'm picturing: dob to age text formatter
codeable concept displayer
period displayer
human name displayer
generate a random religion for testing purposes
clean up empty arrays to null values to facilitate presentation with angular templates

view this post on Zulip Grahame Grieve (Jun 01 2016 at 09:26):

actually, some of them do ring a bell. I have a nuber of summary displayers in my code base

view this post on Zulip Erich Schulz (Jun 01 2016 at 09:27):

:-)

view this post on Zulip Erich Schulz (Jun 01 2016 at 09:31):

I'm going to continue to make some notes here

view this post on Zulip Erich Schulz (Jun 01 2016 at 09:31):

@Josh Mandel this seems a bit like your kind of thing??

view this post on Zulip Grahame Grieve (Jun 01 2016 at 09:37):

can you read pascal?

view this post on Zulip Grahame Grieve (Jun 01 2016 at 09:37):

there's a bunch of them in here:

view this post on Zulip Erich Schulz (Jun 01 2016 at 09:38):

takes me back to Delphi

view this post on Zulip Erich Schulz (Jun 01 2016 at 09:38):

1996...

view this post on Zulip Grahame Grieve (Jun 01 2016 at 09:39):

https://github.com/grahamegrieve/fhirserver/blob/master/reference-platform/dstu3/FHIRUtilities.pas

view this post on Zulip Erich Schulz (Jun 01 2016 at 09:40):

strewth - theres not a lot of comments in that file!!!

view this post on Zulip Grahame Grieve (Jun 01 2016 at 09:41):

nah. not that one.

view this post on Zulip Erich Schulz (Jun 01 2016 at 09:43):

but i can spot a few likely sounding contenders in there

view this post on Zulip Erich Schulz (Jun 01 2016 at 09:44):

HumanNamesAsText()

view this post on Zulip Erich Schulz (Jun 01 2016 at 11:20):

i think I would need some assistance in identifying the high-value functions

view this post on Zulip Erich Schulz (Jun 01 2016 at 11:20):

if given some test cases I'd have a crack at some JS implementations

view this post on Zulip Grahame Grieve (Jun 01 2016 at 11:36):

those are the ones. Those are easy to transform to js too

view this post on Zulip Erich Schulz (Jun 01 2016 at 11:39):

all of them?

view this post on Zulip Grahame Grieve (Jun 01 2016 at 11:40):

all the gen() methods

view this post on Zulip Erich Schulz (Jun 01 2016 at 11:44):

so thats an overloaded function dependant on strong typing - all returning string?

view this post on Zulip Erich Schulz (Jun 01 2016 at 11:44):

not sure if even typescript supports overloading...

view this post on Zulip Erich Schulz (Jun 01 2016 at 11:44):

but a type parameter would enable same functionality

view this post on Zulip Erich Schulz (Jun 01 2016 at 11:45):

any chance of some testcases?

view this post on Zulip Grahame Grieve (Jun 01 2016 at 11:45):

well, in JS you'd name them differently

view this post on Zulip Grahame Grieve (Jun 01 2016 at 11:45):

gen[Type]

view this post on Zulip Erich Schulz (Jun 01 2016 at 11:46):

[{in: {type: <string>, value: <JSON>}, out: <json>}, ... ]

view this post on Zulip Grahame Grieve (Jun 01 2016 at 11:47):

well, that's probably a good idea, but no, I don't have test cases

view this post on Zulip Erich Schulz (Jun 01 2016 at 11:48):

json test cases would enable cross language compatibility...

view this post on Zulip Erich Schulz (Jun 01 2016 at 11:50):

having type as a parameter would simplify calling

view this post on Zulip Erich Schulz (Jun 01 2016 at 11:56):

if the muse takes you - chuck a few at me and I'll have a crack

view this post on Zulip Erich Schulz (Jun 01 2016 at 11:56):

others then may chip in?

view this post on Zulip Erich Schulz (Jun 01 2016 at 11:58):

btw, is "gen" short for "generate a text representation of supplied object"?

view this post on Zulip Grahame Grieve (Jun 01 2016 at 12:03):

y

view this post on Zulip David Hay (Jun 01 2016 at 14:13):

I do this in a couple of places in clinFHIR (though driven by the needs of the app - and 'organically' grown - rather than intended to be a library). These ones are datatype data entry templates (https://github.com/davidhay25/FHIRSampleCreator/tree/master/prTemplates ) and https://github.com/davidhay25/FHIRSampleCreator/blob/master/includes/dataTypeInputTemplates.html used in the Resource Builder

view this post on Zulip David Hay (Jun 01 2016 at 14:17):

And these are some utilities for generating a 'one line description' of resources to assist users selecting one as a reference target: seatch for 'getOneLineSummaryOfResource' in https://github.com/davidhay25/FHIRSampleCreator/blob/master/resourceBuilder/rbServices.js - I need to extend them to cover more resources at some point...

view this post on Zulip David Hay (Jun 01 2016 at 14:21):

If someones interested in building more 'formal' libraries of javascript components that would meet these needs - plus the 'build text' one that I'd certainly be happy to help out...

view this post on Zulip Erich Schulz (Jun 02 2016 at 03:22):

awesome @David Hay ! I've been making some notes here

view this post on Zulip Erich Schulz (Jun 02 2016 at 03:25):

the place to start maybe to see how many people are interested in workshopping some function signatures, the putting together list of test cases

view this post on Zulip Erich Schulz (Jun 02 2016 at 09:02):

hopefully putting together a set of simple test cases is simple activity that may attract a few contributors

view this post on Zulip Erich Schulz (Jun 02 2016 at 11:23):

some test cases of "codeableconcept" would be appreciated - especially with some some curly edge cases


Last updated: Apr 12 2022 at 19:14 UTC