Document file names

Donate to this project

Development Project Status: Completed

Total cost estimate (ex-Tax): 
$1510
Due date for completion of this stage: 
08/04/2014
Release: 
1.8
Current Percentage Funded: 
100.00%
Project funding: 

Pledges can be made by email by clicking here.
Development will not commence until fully funded.

Project description: 

Currently, when customer, patient and supplier documents are generated,  file names are assigned from the template file they are generated from.

This project will enable the file name assigned to customer and patient documents to be generated using an expression.

The expression used to generate file names will be :

  • be selectable via a dropdown in the Document Template
  • configured as lookups

If no expression is selected, then the template name will be used.

The expression will be provided with:

  • a $file variable - representing the file name of the original template, minus the extension
  • the document act (e.g. act.patientDocumentLetter, act.customerDocumentForm, act.supplierDocumentAttachment)
  • a $patient variable, if a patient is linked to the act
  • a $customer variable, if a customer is linked to the act, or the owner of the patient, if a there is only a patient present
  • a $supplier variable, if a supplier is linked to the act

 

This will enable expressions like:

  • concat($file, '  - ', $patient.name, ' ', $customer.lastName) - e.g. "Admission Consent Form - Fluffy Connor"

File name generation will occur when the document is created.

For letters, this occurs once. Forms are created on-demand, so the file name generation will occur each time the form is downloaded.

To ensure that generated file names are valid, any illegal characters such as '\', '/', ':', '*', '?', '<', '>', and '|' will be replaced with underscores.

JIRA: OVPMS-1483

Comments

Comment viewing options

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

Re: Document file names

Hi,

Sorry, I would just like to be 100% clear on this. Would this allow us to call on the "name" field of the document act (or for example the "description" field) as part of the file name?

Thanks,

Adrian

Re: Document file names

Yes. It will be passed the relevant document act, so you can access all of its nodes. e.g.:

  • openvpms:get(., 'name')
  • openvpms:get(., 'description')

In practice, the name node isn't all that useful, at least for the standard customer and patient document acts. E.g. 'Customer Attachment', 'Patient Letter'

Is there any particular file name format you want to be able to support?

Re: Document file names

Hi, I would like to be able to specify for file names such as:

Patient Medical History - Fluffy Simpson - 9th May 2014

Discharge Letter - Fluffy Simpson - 9th May 2014

Invoice - Fluffy Simpson - *Date Invoice Created*

Payment - Fluffy Simpson - *Date Payment Performed*

Re: Document file names

These could be covered as follows:

 

Display: Patient Medical History - Fluffy Simpson - 9th May 2014

Expression:

concat('Patient Medical History - ', $patient.name, ' ', $customer.lastName, ' - ', date:format(java.util.Date.new(), 'd MMM yyyy'))

Display: Discharge Letter - Fluffy Simpson - 9th May 2014

Expression:

concat($file, ' - ', $patient.name, ' ', $customer.lastName, ' - ', date:format(java.util.Date.new(), 'd MMM yyyy'))

Display: Invoice - Fluffy Simpson - *Date Invoice Created*

Expression:

concat($file, ' - ', $patient.name, ' ', $customer.lastName, ' - ', date:format(openvpms:get(., 'startTime'), 'd MMM yyyy'))

Display: Payment - Fluffy Simpson - *Date Payment Performed*

Expression:

concat('Payment - ', $patient.name, ' ', $customer.lastName, ' - ', date:format(openvpms:get(., 'startTime'), 'd MMM yyyy'))

 

There is one limitation - the day ordinals aren't supported by the format date:format() function, so you can't display '2nd' or '3rd'. It can display '9 May 2014' however.

 

Re: Document file names

Hi,

This is great. We will fund 50% of this.

Thanks,

Adrian

Re: Document file names

Thanks very much for funding 50 % of this project Adrian.

Another generous donor has funded the other 50% and the project will will now go ahead. Thanks to you both!

PeterG

Syndicate content