FHIR Appointment search filtered by location and all its partOf locations - hl7-fhir

FHIR Location resources can have a .partOf property that points to another Location.
Let's say we have locations nested like this. Where each location is partOf the parent Location.
hospital
building
clinic
exam room
Let's say that an Appoinment has an actor that is a Location.
How do I query for appointments at these various levels, if I just have a Location Id.
For example: How do I query for all appointments at the hospital? Or for all appointments at the building, etc.
Also, it could be that the actor Location is an ID at any one of these levels and we don't know which, at the time of the search.
I'd like to be able to query Appointments filtered by whatever the current location hierarchy level it is, and everything below.
I know I can do /Appointment?location=LOCATION_ID and /Appointment?location.partOf=LOCATION_ID
But, is there any way to do both and everything below in the same search request?

If the server you are using supports it, you should be able to use the :below modifier on the location search:
/Appointment?location:below=LOCATION_ID
See http://hl7.org/fhir/search.html#recursive for the documentation.

Related

HL7 FHIR implementation of animal owners

We are working on implementing the FHIR API in a veterinary health care system. One question that has come up is which resource type we should be using for the owner of the animal (patient). In the context of the animal it is easy to see that the owner information can go into the contact of the Patient resource.
However, an animal owner is quite often referenced outside the context of an individual patient. So that leads me to RelatedPerson. The description of the RelatedPerson resource gives an example of "The owner or trainer of a horse", so it seems it might fit. However, one big issue with this is that a RelatedPerson can only be linked to a single patient. The relationship between animals and owners in the veterinary domain is many to many. So an owner often has more than one animal.
This issue led me to the Person resource. This at least gives a way to have multiple Patient's (animals) belonging to one Person (owner).
In either case we'll have to add a "percentOwnership" attribute as an extension to the resource since an animal can potentially have multiple owners.
If this is the way we should do it (using the Person resource), my next question is how would one search using the API for all Patient's linked from a given Person? If we used the RelatedPerson (which is probably not workable due to the limitation mentioned above), it seems like this search would use the relatedPerson compartment to search. However, there doesn't seem to be a person compartment in the spec.
Summary:
What resource to use for the owner of an animal?
How to search for all animals belonging to a particular owner?
If you just want contact information, then Patient.contact is fine. If you're interested in the owner as a potential actor (information recipient, informer, performer, etc.) then RelatedPerson will be necessary. However, RelatedPerson is specific to a particular Patient's record (i.e. you'll have a distinct RelatedPerson instance for each animal). To link all of the RelatedPerson instances together and say "this is the same person", you'd use Person. To query, you'd query on Person where link matched one of the desired RelatedPerson records. Then you'd need to do an include of Person.link and RelatedPerson.patient to bring back all of the animals

Some basics of compartment search

I am new to FHIR, and am unable to understand the concept of compartment search.I have read compartment is a group of similar resources, but when we do compartment search we provide the following path:
/[compartment]/[id]/?[parameters]
'/[compartment]/[id]/[type]?[parameters]'
'/[compartment]/id/condition '
Can anyone please give reasons why we are using ID as a parameter in each request, and also please give one one example of each request.
You can do this:
/Patient/1/$everything, however that's not really a compartment based search. It's a resource-instance specific operation that depends on the existence of compartments to function - it says "find me everything in this patient's compartment"
For compartment based search, you'll either have this:
/[compartment]/[id]/[type] (e.g. /Patient/1/Condition) if you want all records of the specified type within the compartment
or this
/[compartment]/[id]/[type]?[parameters] (e.g. /Patient/1/Condition?category=diagnosis) if you want to further filter the records.
id isn't a parameter, it's identify the compartment. In the example above, you're saying "I want the conditions that belong to patient 1". There's no difference between the following two queries:
/Patient/1/Condition
/Condition?patient=1
The only reason we support compartments is that some systems like to do logic or security based on URL. Nesting queries beneath a selected Patient or Practitioner, etc. lets them do that.

CLP and ACL for multi-tenant app in Parse.com

Imagine a website that agregates online ordering for many restaurants and is built using parse.com.
In parse.com there is a class called Order where all of the orders are stored.
Each order belongs to one, and only one, restaurant.
When querying the Order class, each restaurant can only read (and write) its own orders. A restaurant should not see (and write) orders for other restaurants.
To solve this, I've tried using one role per restaurant and add the restaurant-role to the each restaurants order's ACLs. So I've created one role for each of the Restaurants using the following naming taxonomy: Restaurant-[restaurantObjectId].
I have taken care that user's belong to their respective restaurant-role.
I've also fiddle with Class Level Permissions (CLPs) without results: either total access or total lack of access, none of access limited to restaurant data.
Any clues?
It seems that one has to have make the Find operation available to the Public. Otherwise it gives the not authorized error.

XPages: can i filter a view to show only entries that belong to a group?

i have a view in an xpage with some entries (lets say clients). I have an acl group of persons (clients) that contains some of the clients of the view. Now i want to use the search attribute of the view to show only entries that belong to the group.
I already use search attribute to select users by name e.g:
FIELD Name Contains "Chuck Norris"
Is there any similar query? (maybe using #isMember on the field....?)
UPDATE: i will have the group entries (client names) into a text list in a document too. so can i filter the "name" field of the view based on the values of a text list?
Perhaps using a reader field is a good idea. You're talking about restricting document access to a group of Domino users - that's exactly what reader fields are for.
For example, make your text list field containing client names into a reader field like this:
var item = document1.getFirstItem("myfield");
item.setReaders(true);
document1.save();
myfield needs to contain canonical names (CN=firstname lastname/O=organisation).
Using reader fields, you don't need to do any view filtering at all, it happens automatically. If you have really many documents (say, half a million or so), it could slow down things, otherwise, it's a nice approach.
When you want to restrict displaying documents only in one certain view reader fields are no solution, though. In that case, you need to do the view filtering yourself as you tried.
If you want to filter only for ONE certain client, then using a categorized view is the way to go. You can give the view panel the name of one client as category filter then.
If you want to filter for multiple clients, you need to do it based on fulltext search, just as you already tried. In that case, make sure you're working with Domino 9. Previous Domino versions don't apply the view sorting order to a fulltext search result, which means you have to search it manually using custom javascript or so, which is complicated.
Or, as Frantisek suggested, write a scheduled agent which puts documents in folders depending on their clients - but depending on the number of clients you want to filter the view for this may lead to many folders, which may lead to other problems. Furthermore, you need to make sure to remove folders when they are not needed anymore, and you have a lag until new documents appear in a folder.
So in a nutshell, if you want to do an application wide restriction based on client names, use reader fields.
If you want to restrict for one client name at a time, use categories.
Otherwise, use fulltext search with Domino 9.

Filtering among Exposed Filters: Parent/Child relationship between two Exposed Filter in Drupal View

I wanted to make a page with exposed filter search app in Drupal for a list of people.
I started by creating content type Bio and populated it as following:-
Then, I continued making a view with exposed filters of the fields of content type Bio. With the help of Better Exposed Filters, I am showing both Filters through Checkboxes through AJAX, as below:-
Now, uptil now, it's working fine. when I select a region or/and any city, the content updates according to that.
What I am hoping to create is a dependency between the region and city. All I want is that when I select any region in the Filter by Region, the lower filter values in the Filter by City automatically adjust and show me only the cities for which the region field in Bio is the selected city.
As an example, If a user selects EMEA, the city exposed filters should only show European cities.
I have been stuck in this for hours now. I have tried various solutions (View Dependent Filtersand Filter Fields) but to no avail.
You can use the views_hacks module and its views_filters_selective option.

Resources