Stream: implementers
Topic: reusable software components
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
Erich Schulz (May 30 2016 at 22:44):
and I'm wondering how much history/ground-work has gone in the space?
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
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
Erich Schulz (May 30 2016 at 23:01):
although noting an abundance of off the shelf REST client and server things
Erich Schulz (May 30 2016 at 23:02):
so its more the "controller" utilities and presentation that maybe of more interest
Erich Schulz (May 30 2016 at 23:03):
(i started this flight of ideas considering angular directives)
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
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
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.
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
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
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 (?)
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.
Erich Schulz (Jun 01 2016 at 03:45):
main thing would be to share conceptual work
Erich Schulz (Jun 01 2016 at 03:46):
yes code wont share - but possibly many function signatures would be similar (?identical)
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
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
Erich Schulz (Jun 01 2016 at 03:48):
rather than trawlling through 1000's of lines of code I'm hoping for pointers :-)
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
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
Grahame Grieve (Jun 01 2016 at 03:51):
how would you know?
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
Grahame Grieve (Jun 01 2016 at 03:55):
HAPI builds lots of other things on top of that too
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.
Grahame Grieve (Jun 01 2016 at 03:57):
some kind of UI binding thing? sounds very context specific, as well as implementation specific
Yunwei Wang (Jun 01 2016 at 03:58):
That's my guess from his post.
Erich Schulz (Jun 01 2016 at 04:15):
sweet
Erich Schulz (Jun 01 2016 at 04:16):
so game would be to isolate functions with clean injectable dependancies
Erich Schulz (Jun 01 2016 at 04:18):
this would not necessarily be a UI related
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
Grahame Grieve (Jun 01 2016 at 04:21):
I haven't found anything like that myself yet
Erich Schulz (Jun 01 2016 at 04:21):
(i also am thinking some UI widgets maybe sharable but that is truly highly context specific)
Erich Schulz (Jun 01 2016 at 04:21):
mmm
Grahame Grieve (Jun 01 2016 at 04:21):
UI widget for good code look up --> that would be a winner
Erich Schulz (Jun 01 2016 at 04:21):
heh
Erich Schulz (Jun 01 2016 at 04:22):
the angular ui-bootstrap "typeahead" is probably a good start for a code look up
Erich Schulz (Jun 01 2016 at 04:22):
it plays nice with RESTful endpoints
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
Erich Schulz (Jun 01 2016 at 04:26):
or "status=final" for an observation
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
Grahame Grieve (Jun 01 2016 at 04:32):
but the impact of that on your UI is highly variable
Erich Schulz (Jun 01 2016 at 04:38):
sure
Erich Schulz (Jun 01 2016 at 04:38):
that's why its a library
Erich Schulz (Jun 01 2016 at 04:38):
use it if it works or not, or let users toggle both "cleaned" and "full" display
Erich Schulz (Jun 01 2016 at 04:39):
if there are some common variations they could be parameters
Erich Schulz (Jun 01 2016 at 04:39):
but 80:20 rule would apply
Erich Schulz (Jun 01 2016 at 04:39):
point being that is a single example
Erich Schulz (Jun 01 2016 at 04:43):
if some kind of classification engine is injected then some more interesting possibilities exist
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....
Erich Schulz (Jun 01 2016 at 04:45):
if 100 repeated observation in a short period then reduce that to a range
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
Erich Schulz (Jun 01 2016 at 04:49):
the lodash library is the closest example to what I'm imagining
Erich Schulz (Jun 01 2016 at 04:50):
another nice example is the moment library
Erich Schulz (Jun 01 2016 at 04:51):
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?
Erich Schulz (Jun 01 2016 at 04:51):
sure moment is a set of functions that just do things with dates and times
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)
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
Erich Schulz (Jun 01 2016 at 04:55):
Erich Schulz (Jun 01 2016 at 04:56):
ie just simple collections of simple functions with no external dependancies
Erich Schulz (Jun 01 2016 at 04:56):
that save 1000's of coders having to reinvent wheels
Erich Schulz (Jun 01 2016 at 08:47):
got home from work... starting to make a doc to capture the above ramblings...
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
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
Erich Schulz (Jun 01 2016 at 09:27):
:-)
Erich Schulz (Jun 01 2016 at 09:31):
I'm going to continue to make some notes here
Erich Schulz (Jun 01 2016 at 09:31):
@Josh Mandel this seems a bit like your kind of thing??
Grahame Grieve (Jun 01 2016 at 09:37):
can you read pascal?
Grahame Grieve (Jun 01 2016 at 09:37):
there's a bunch of them in here:
Erich Schulz (Jun 01 2016 at 09:38):
takes me back to Delphi
Erich Schulz (Jun 01 2016 at 09:38):
1996...
Grahame Grieve (Jun 01 2016 at 09:39):
https://github.com/grahamegrieve/fhirserver/blob/master/reference-platform/dstu3/FHIRUtilities.pas
Erich Schulz (Jun 01 2016 at 09:40):
strewth - theres not a lot of comments in that file!!!
Grahame Grieve (Jun 01 2016 at 09:41):
nah. not that one.
Erich Schulz (Jun 01 2016 at 09:43):
but i can spot a few likely sounding contenders in there
Erich Schulz (Jun 01 2016 at 09:44):
HumanNamesAsText()
Erich Schulz (Jun 01 2016 at 11:20):
i think I would need some assistance in identifying the high-value functions
Erich Schulz (Jun 01 2016 at 11:20):
if given some test cases I'd have a crack at some JS implementations
Grahame Grieve (Jun 01 2016 at 11:36):
those are the ones. Those are easy to transform to js too
Erich Schulz (Jun 01 2016 at 11:39):
all of them?
Grahame Grieve (Jun 01 2016 at 11:40):
all the gen() methods
Erich Schulz (Jun 01 2016 at 11:44):
so thats an overloaded function dependant on strong typing - all returning string?
Erich Schulz (Jun 01 2016 at 11:44):
not sure if even typescript supports overloading...
Erich Schulz (Jun 01 2016 at 11:44):
but a type
parameter would enable same functionality
Erich Schulz (Jun 01 2016 at 11:45):
any chance of some testcases?
Grahame Grieve (Jun 01 2016 at 11:45):
well, in JS you'd name them differently
Grahame Grieve (Jun 01 2016 at 11:45):
gen[Type]
Erich Schulz (Jun 01 2016 at 11:46):
[{in: {type: <string>, value: <JSON>}, out: <json>}, ... ]
Grahame Grieve (Jun 01 2016 at 11:47):
well, that's probably a good idea, but no, I don't have test cases
Erich Schulz (Jun 01 2016 at 11:48):
json test cases would enable cross language compatibility...
Erich Schulz (Jun 01 2016 at 11:50):
having type as a parameter would simplify calling
Erich Schulz (Jun 01 2016 at 11:56):
if the muse takes you - chuck a few at me and I'll have a crack
Erich Schulz (Jun 01 2016 at 11:56):
others then may chip in?
Erich Schulz (Jun 01 2016 at 11:58):
btw, is "gen" short for "generate a text representation of supplied object"?
Grahame Grieve (Jun 01 2016 at 12:03):
y
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
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...
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...
Erich Schulz (Jun 02 2016 at 03:22):
awesome @David Hay ! I've been making some notes here
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
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
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