How to determine mother and child appointment

Hello,

For an dashboard we are creating we are querying the FindAppointment archive provider using odata, we want to filter out any child appointments and only get the mother appointments. We though we could do this with the booking field but that is true for both the mother and the child.

How can we determine what appointment is a child booking?

Example GET:

https://xxx/api/v1/Archive/SimpleAppointment?$filter=(appointmentId eq 964257 or appointmentId eq 964254)&$select=appointmentId,booking,visibleInDiary,rawType

Database:

As you can see 964254 is the mother here, and 964257 the child, but both have booking 'true':

RE: How to determine mother and child appointment

isChild = mother_id != 0 && (mother_id != appointment_id)

isMother = mother_id != 0 && (mother_id == appointment_id)

(given a collection of related appointments..)

this is what we do in the win c++ code anyway...
You may be able to add it as an additional restriction perhaps?

/conrad

 

Av: Conrad Weyns 14. sep 2021

RE: How to determine mother and child appointment

Hi Conrad,

Sadly the motherId field is returned in the REST API, so I can't use that as a restriction.

 

Av: David Hollegien 14. sep 2021

RE: How to determine mother and child appointment

Looks like the dynamic provider is the only option here then. 

Av: Tony Yates 15. sep 2021

RE: How to determine mother and child appointment

Would have used that already if this was an external integration or something, but this is used in an PowerBI dashboard, reading the archive provider with odata, so using the dynamic archive provider is not really an option, since that does not return metatdata about the available columns. (which is expected with the dynamic archive provider)

I hope there was someway to determine mother/child appointment with the available columns in findappointment.

Av: David Hollegien 15. sep 2021

RE: How to determine mother and child appointment

Appointment providers have a column called "booking" ...
Not entirely sure if this could be of any help.
/conrad

 

Av: Conrad Weyns 15. sep 2021

RE: How to determine mother and child appointment

Hi Conrad,

Correct, but like I mentioned in my start post, for both the mother and child appointment the field "booking" is true.

Av: David Hollegien 15. sep 2021

RE: How to determine mother and child appointment

Hi David,

If the Dynamic provider were declared in the metadata document as an open type, like I suggested last year, then you might be able to solve your problem, as it seems like open types are supported by Power BI.

Av: Véronique Borel 15. sep 2021

RE: How to determine mother and child appointment

Instead of the RESful REST swagger file, is the Agents swagger file not any better for tooling? Then you can just call something like

/api/v1/Agents/Archive/GetArchiveListByColumns2
Av: Tony Yates 15. sep 2021