Stream: hapi
Topic: Code Templates
Grahame Grieve (Jun 26 2017 at 03:32):
how many people would find it useful if we generated a stub set of java lines for populating and reading the different resource types?
Grahame Grieve (Jun 26 2017 at 03:34):
something along the lines of
Grahame Grieve (Jun 26 2017 at 03:34):
CodeSystem cs = new CodeSystem(); cs.setId(); cs.setUrl(url+"/"+cs.getId()); cs.addIdentifier().setSystem().setValue(); cs.setName(); cs.setTitle(); cs.setStatus(); cs.setExperimental();
David Hay (Jun 27 2017 at 01:07):
excuse my ignorance, but doesn't hapi already do that?
Grahame Grieve (Jun 27 2017 at 02:03):
does it? I haven't seen it
Kevin Mayfield (Jun 27 2017 at 07:45):
It does but you need to specify the parameters. Is that the point?
David Hay (Jun 27 2017 at 21:48):
Isn't it this: http://hapifhir.io/doc_fhirobjects.html ??
Grahame Grieve (Jun 27 2017 at 21:49):
no, that explains how it works. What I'm thinking is pre-generated java psudo-code that you can copy and paste into your source, and then fill out the values
David Hay (Jun 27 2017 at 23:00):
What would the advantage be over simply using the hapi library?
James Agnew (Jun 28 2017 at 02:14):
I think the idea here is that if you're using the HAPI library, this would be a snippet of code you could use to populate one of HAPI's objects by filling in the various blanks.
How would you decide which fields to populate in a given resource? Like would your stub code cover all fields in the resource (would likely be overwhelming), just the required ones (wouldn't be much help) or some predetermined list of "popular" ones or something?
Grahame Grieve (Jun 28 2017 at 02:15):
I would do all elements to the data type level - paste them in, delete the ones I'm not going to use
Grahame Grieve (Jun 28 2017 at 02:16):
but I do very often do fluent setters.. that complicates matters for the template...
James Agnew (Jun 28 2017 at 02:20):
yeah, i generally go pretty nuts with the fluent setters. i just love those things.
truthfully I'm not sure I'd use these much personally.. if you do end up doing this we could certainly find a home for them on the HAPI website though.
Grahame Grieve (Jun 28 2017 at 04:56):
well, I'd generate something like this:
Grahame Grieve (Jun 28 2017 at 04:56):
https://web.archive.org/web/20160321140303/http://www.sproutee.com/mytemplates.xml
Hannes Ulrich (Jun 28 2017 at 15:43):
There is a code template feature in Postman, where you can try the http call and then generate the corresponding snippet. This works pretty well, maybe a FHIR support comes handy!
Grahame Grieve (Jun 29 2017 at 06:27):
thx I hadn't seen that before.
Grahame Grieve (Jun 29 2017 at 06:27):
maybe I should add this to the notepad++ plug-in to work the same...
Brian Postlethwaite (Jul 04 2017 at 03:42):
That's a groovy Idea, I might suggest it on the .net channel too!
Last updated: Apr 12 2022 at 19:14 UTC