XPath For Insurance
Submitted by Ben_Charlton on Fri, 28/01/2022 - 11:16
We are starting to see an increasing number of insurers outside the Petsure plugin. It would be helpful to have some xpath functions that can access things like patient current policy - so we can create email templates to submit these claims manually via email.
Thoughts
Re: XPath For Insurance
Have you had a look at the Insurance Claim.jrxml template?
This is used to generate the claim summary when emailing or printing claims. When emailing, it is attached as a PDF.
Re: XPath For Insurance
Yep Absolutely
It uses fields like $F{policy.target.insurerId.identity}. Contextually would these fields be available to an email template?
WHat I mean is that when you email - the subject line would want be something along the lines off
"Insurance Claim: Insurer: XXXXXX Policy: XXXXXXXXX Patient: XXXX XXXX"
Re: XPath For Insurance
You should be able to use JasperReport field names in $F{...} in a corresponding openvpms:get(...) xpath expression.
E.g, in an Email Template, set the Subject Type to Expression and enter the following for the Subject:
Re: XPath For Insurance
Worked Like a treat for reference for others
Subject Field (Expression)
Content Field (expression)
Re: XPath For Insurance
Tim
The template above does NOT work if used during the submission of a manual claim - you get a class cast exception on one of the Openvpms:get() statements - I assume policy details.
The other thing is if you then cancel the MAIL submission the claim is still submitted. Then if you try and MAIL the claim it only attaches the primary claim document, not the other documents associated with that claim.
I have the error if you want it. - its an XPath error.
Re: XPath For Insurance
Make sure you have the latest claim templates loaded for your release.
If they are up-to-date, and you are still getting errors, send me the details.
Re: XPath For Insurance
Sorry I am confused - there is no issue with claims templates or anything like that the claims generate as expected. Its all to do with the MAIL template - the one i mention above and it seems the context thats available during manual submission. The mail template is not auto generated I use the TEMPLATE drop down to select the template I want to send and its at that point the error occurs.
Re: XPath For Insurance
I would also add that despite setting the EMAIL template for the Insurance Claim Report. It does not apply during manual submission
I select it as a Template then this error occurs. If I remove the openvpms:get(policy) based statements the template works as expected.
Placing those fields back into the template causes the error...However if I then Highlight the now "Submitted" claim and select MAIL
You can see the Insurer Name and policy number auto fill perfectly.
Re: XPath For Insurance
I would also add that the template DOES auto apply when you select MAIL and have the claim highlighted.
It seems there is some sort of context missing when the claim is manually submitted -
Re: XPath For Insurance
Hi Ben,
Did you manage to figure out how to get the police number when sending from an invoice?
I am trying to create an email template to send to GapOnly for pre-approval. If I select an insurance claim and then press Mail, it merges in the policy number correctly, however if I send from an estimate it errors.
Is there a way to get the patient insurance policy number if sending from a client estimate or invoice?
This is what my content is:
concat('Please find attached the medical history and an estimate for ', openvpms:get($patient,'name') ,' ', openvpms:get($customer,'lastName') ,' to process a pre-approval for GapOnly cover request.
Policy Number: ', openvpms:get(., 'policy.target.insurerId.identity') , '
Patient Name: ', openvpms:get($patient,'name') ,'
Client Name: ', openvpms:get($customer,'firstName') ,' ', openvpms:get($customer,'lastName') ,'
Client Address or Phone Number:
Diagnosis (or leading differential diagnosis):
Prescribed Treatment:
Proposed Treatment Date:
Itemised Invoice Estimate (if available): attached
Veterinary history (if available) or referring hospital: ',openvpms:get(party:getPatientReferralVetPractice($patient),'name'),'
Thank you,
From the Team at ', openvpms:get($location,'name') , '
')
Re: XPath For Insurance
There isn't any facility to get the policy number for a patient from an invoice or estimate.
It works from a claim because the policy is linked to the claim.