Practice Location Details

I am looking to return some details on reports like invoices based on practice location

For example

[openvpms.get(OpenVPMS.location,'abn')

- I created a /detail/abn node on practice location 

However I would like to return EFT details 

my options are to create  another couple of detail nodes and then return them OR a

access the details stored in deposit accounts.

However this brings a slight issue that of multiple deposit accounts and which one to return.

[openvpms.get(openvpms.get(OpenVPMS.location,'depositAccounts')[1],'bank')]

I wasnt sure if I need to use a list: function or get would return a set quite happily.

Thoughts.

Ben

Comment viewing options

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

Re: Practice Location Details

It may be possible to come up with an xpath expression to do this, but it will be convoluted. The main issue is that the collections aren't sorted, so [1] will give different results. You'd need to select the appropriate one based on its id or name.

I think the easiest approach is to define a practice location-deposit account relationship with maxCardinality=1 which is solely used for reporting purposes.

 

Re: Practice Location Details

I agree.  with regard to name I would assume a name like EFTAccount as the node name would be appropriate.

Given that i cant think of any other reporting purpse aside from Electronic deposits.

 

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Practice Location Details

I will go ahead and define this locally...unless its felt that its worthwhile adding it back to the Core distro?

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Practice Location Details

Oddly enought 

[openvpms.get(OpenVPMS.location,'abn')]

doesnt work despite

Type
Name
Display Name
Type
Path
Min Cardinality
Max Cardinality
Min Length
Max Length
Default Value
Derived
Derived Value
Node scheduleViews Schedule Views java.util.HashSet /sourceEntityRelationships 0 -1 0 255  
 
Node tills Tills java.util.HashSet /entityRelationships 0 -1 0 255  
 
Node stockControl Stock Control java.lang.Boolean /details/stockControl 0 1 0 255 false()
 
Node active Active java.lang.Boolean /active 0 1 0 255 true()
 
Node templates Templates java.util.HashSet /entityRelationships 0 -1 0 255  
 
Node abn Australian Business Number java.lang.String /details/abn 0 1 0 255  
 
Node id Id java.lang.Long /id 0 1 0 255  
 
Node defaultPrinter Default Printer java.lang.String /details/defaultPrinter 0 1 0 255  
 
Node depositAccounts Deposit Accounts java.util.HashSet /entityRelationshi

 

being present in the location archetype.

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Practice Location Details

When used within xpath, you need to refer to OpenVPMS.location as a variable:

[openvpms.get($OpenVPMS.location,'abn')]

You should also be able to do:

[$OpenVPMS.location.abn]

 

Re: Practice Location Details

OpenVPMS.location.abn does work however.

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Practice Location Details

The $ is not required in JRXML files I am not sure if thats intended or not

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Practice Location Details

Sorry to be more clear when using

OpenVPMS.location.abn the $ is not required

$F{OpenVPMS.location.abn} works fine

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Practice Location Details

My point was that you can't use JasperReports fields within xpath expressions, but the OpenVPMS fields are also declared as variables and these can be used.

Re: Practice Location Details

I have just added a sentence to http://www.openvpms.org/documentation/csh/1.8/reference/jxpath to reference Application Fields.  Regards, Tim G

Re: Practice Location Details

Actually Tim I dont think these parameters are available to ANY subreports.  You specify they are not available to SQL sub reports on the Application Variables help page. but I think thats technically not correct.  No OPENVPMS functions are available in that context. You can also access the context provided and cant use reflection to get higher in the data tree.  

IE you cant access the practice details from a subreport unless they are explicity provided in the dataExpression from the parent report.

I think.

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Practice Location Details

You are correct Ben.  I will see if I can clarify the documentation.  Regards, Tim G

Re: Practice Location Details

Ben - after a query from Tim A, I had a play.  Application fields work quite happily in non-sql subreports.  I had a hack at our invoice items so it shows the current location name - ie

and you get:

Regards, Tim G

PS - I am running Build 6595 and Jasper Studio 6.1.0

Re: Practice Location Details

have you ever tried using party functions in sub reports?
 

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Practice Location Details

No - but just tried - $F{[party:getTelephone($OpenVPMS.practice)]}  worked OK.

$F{[party:getTelephone(.)]} gave 'expression error'

$F{[party:getTelephone($OpenVPMS.customer)]} worked OK

$F{[party:getPatientWeight($OpenVPMS.patient)]} gave 'expression error'

Remember that I am playing with the invoice items subreport.  Hence the code handling the party functions knows the practice location and the customer (or more strictly we have a current customer and practice location - because we are doing Preview from the Customers|Charges screen).  However, I do not have a current patient set.

If I go and select the patient ZZ-Cat then the getPatientWeight expression works and I get:

However, this is ZZ-Cat's weight, not ZZ-Dog's.

Conclusion: party functions work, and Application Fields work - but you have to understand what is currently selected.  In the above case I should have used:
$F{[party:getPatientWeight(openvpms:get(.,"target.patient.entity"))]} which works as expected.

Regards, Tim G

Syndicate content