FHIR Chat · RESTful Objects · implementers

Stream: implementers

Topic: RESTful Objects


view this post on Zulip Grey Faulkenberry (Jan 19 2021 at 16:53):

I've been creating some FHIR packages for the Flutter platform (https://pub.dev/publishers/fhirfli.dev/packages). One of them is for RESTFul requests. I've been trying to create a way to enable easier querying, and I'm comfortable with what I have (create, delete, patch, transaction, etc) but not for searching.

I've thought about just letting anyone pass in a json map object as search parameters, but then I run the risk that they haven't formatted their values correctly (plus prefixes and whatnot). In the other direction, I could become extremely prescriptive, having a class object for composite, date, number, etc. That would include the value and any prefixes that were allowed. Something like this:
class SearchDate{
DateTime date;
bool missing;
DatePrefix prefix;
}

enum DatePrefix {
eq,
ne,
gt,
lt,
ge,
le,
sa,
eb,
ap,
}

Then I would have a class for each resource that can be searched for, along with fields of lists for each value that can be searched for:
PatientSearch {
List<Id> id;
List<searchDate> lastUpdated;
List<searchToken> deceased;
List<searchReference> link;
...
}

But together all of that feels pretty cumbersome. I guess I'm looking for some middle ground (or just some direction). Does anyone else know of an implementation that has done something like this that I could look at?

view this post on Zulip Michele Mottini (Jan 19 2021 at 19:06):

Pass the search parameters as simple strings - don't over-think it


Last updated: Apr 12 2022 at 19:14 UTC