Stream: javascript
Topic: FHIR.js dynamically assigning ID's
Tara Oskam (Jul 06 2016 at 15:56):
Hello, I'm working with the FHIR.js library @Josh Mandel @nicola and I'm wondering if there is a way to dynamically create IDs. I am creating a communication resource, which contains a patient, relatedperson and organization resource. I know the library will return an ID for the communication resource when posted to the UHN's test server, however, the contained relatedperson references the contained patient, which both require IDs and the contained patient resource references the contained organization as a contact
Tara Oskam (Jul 06 2016 at 15:56):
is there a way to dynamically reference them on create, or should I self-assign these ids?
Josh Mandel (Jul 06 2016 at 19:06):
Currently FHIR.js doesn't provide any tools for creatring or manipulating FHIR resources; it focused on the HTTP API, and expects the developer to effectively "deal with FHIR resources as JSON". It would be great to have a (separate?) helper library for that job, which is an idea that aligns well with some thoughts from @Erich Schulz .
Erich Schulz (Jul 07 2016 at 12:50):
Cool. Yes. Big fan of small single purpose libraries. It seems (on superficial examination) that reusability of much of the Fhir code would be increased if it was decomposed a bit more. Not sure what you mean by "deal with" tho @Josh Mandel
Michael Lawley (Jul 07 2016 at 22:45):
@Josh Mandel I'm curious about the value that a javascript library offers for the HTTP API given that HTTP requests are pretty well covered in javascript anyway (at least in the two framework contexts I have experience with: D3 and AngularJS). Is it more that they provide a (small) domain-oriented abstraction at the CRUD layer - read/create/search etc?
I can see value in a library that makes it simpler to deal with all the optionality that might exist between the JSON object you have and the nested value you want to get to. A fluentpath implementation maybe?
Grahame Grieve (Jul 07 2016 at 23:52):
utils - fluentpath, validation, terminology service abstraction, profile reasoning
Josh Mandel (Jul 08 2016 at 22:02):
Well, most lying it handles search parameters, and does a bit of bundle parsing and reference resolute logic. It just doesn't going "inside" of the resources (they're just JSON passed through).
Last updated: Apr 12 2022 at 19:14 UTC