Schedule View Display Expression

Hi,

I am trying to change the schedule view as I have had a request for it also to display the appointment type and notes.

Is this possible? Any attempts I have made to change the view and test it have failed. I looked http://www.openvpms.org/documentation/csh/1.7/admin/organisation/scheduleView#UsefulExpressions

however have not been able to make work any additions to the tempalte already there. Is there a restriction on how much can be in the field?

Thank you,

Adrian

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Schedule View Display Expression

Adrian -I had a play -I can get you the notes - use openvpms:get(., 'act.description')

but I cannot access the appointment type.

First your "is there a restriction?" - yes - but it is 5000 characters, so that is not the problem.

To get the Notes, I went and looked at the archetype for the appoinment (act.customerAppointment) and I saw that the field named 'description' had a label 'Notes' - ie what you seen on the screen as Notes is held in 'description' - hence the act.description

To get the appointment type, I started down the same path - ie there is an 'appointmentType' field (actually node is the correct term), but this is linked in a different way (it's something called a participation) and I cannot figure out how to get to that. [For the other 'participation' things like the customer and patient, there  are built in functions that access them, but there isn't one for the appointmentType.]

So unless someone comes to the rescue, I think that you are in the poo as far as the appointment type is concerned.

Incidently, why do you want the Notes to show - ins't the balloon good enough?

Also if you switch to single schedule view, then you get the lot.

Finally, when this discussion gets finalised, I will tweak the CSH text a little as a result of this exercise [like how best to debug expression errors - add little at a time].

Regards, Tim G

Re: Schedule View Display Expression

You can treat the appointment type like any other participation node i.e.:

 openvpms:get(.,"appointmentType.entity.name") 

You read this as:

Get the value of "appointmentType.entity.name" from the current object (i.e.: .), which is an act.customerAppointment.

Looking at the act.customerAppointment archetype, the appointmentType node is a participation of type participation.appointmentType.

In the participation.appointmentType archetype, the entity node refers to an entity.appointmentType.

Finally, in the entity.appointmentType archetype, the name  node is a simple string.

The above is short for:

openvpms:get(openvpms:get(openvpms:get(.,"appointmentType"), "entity"), "name")

-Tim A

Re: Schedule View Display Expression

Tim A - openvpms:get(.,"appointmentType.entity.name") get rejected with Expression error

Also, in playing with the problem, I thought: the customer node is a participation of type participation.customer, and in this the entity node refers to party.customerperson and in this name is a simple string, so openvpms:get(.,"customer.entity.name") should work - but it is also rejected with expression error.

Basically I was trying to work from the openvpms:get(.,'customer.name') which works but which obviously has some shortcut available because the entity link is to a party, not an entity. 

Signed, Confused of Dyers Crossing

Re: Schedule View Display Expression

I think the appointment type is returned with

openvpms:get(., "scheduleType.name")
 

that works for us

Re: Schedule View Display Expression

Sorry - I should have tried it out. The above applies when you are dealing with archetypes. For schedules and worklists, a simpler strategy is used, to improve performance.

I got it right in this post in May: http://www.openvpms.org/forum/display-event-type-appointment-description:

openvpms:get(., "scheduleType.name")

-Tim

Re: Schedule View Display Expression

Hi all,

Thank you for the help.

What I think I was doing wrong...

- Not realising that you had to close the whole expression with a double brackets "))"

- Not realising '\n' = new line

- Incorrect positioning of commas.

Re: Schedule View Display Expression

Adrian - if you look at http://www.openvpms.org/documentation/csh/1.7/admin/organisation/scheduleView you will see that I have incorporate parts of the above discussion in the CSH text.

Regards, Tim G

Re: Schedule View Display Expression

Thank you, I think this is helpful.

Re: Schedule View Display Expression

Now all we need Tim is to make the address clickable and bring up a google map of the address, using google NAV and your HC vet will get navigation detailS!!!

Re: Schedule View Display Expression

Actually Ben, I did check that when I imported the schedule into Google Calendar (see community contributions), that one could click on the address. It turned out that in the example I was using there was to much detail - I had to cut off the floor and building name leaving just the street address, and then it was happy and showed the address correctly.  Regards, Tim G

Syndicate content