At present there exists an API to get the currently configured global name template via GET /openmrs/ws/rest/v1/nametemplate, as implemented by
However, in order to support i18n layout in the O3 Patient Registration form, it would be better if we could retrieve an arbitrary NameTemplate by id. (In the case of NameTemplates, the codename is the unique identifier.)
In order to avoid breaking changes with the existing api, new API endpoints should be added, resulting in:
GET /openmrs/ws/rest/v1/nametemplate - (unchanged) get the currently configured global name template.
GET /openmrs/ws/rest/v1/nametemplates - (new) list all known name templates
GET /openmrs/ws/rest/v1/nametemplate/{codename} - (new) get a specific name template
GET /openmrs/ws/rest/v1/nametemplate/layout.name.format- (new) get the currently configured global name template. (duplication of existing functionality, but may allow the existing endpoint to be deprecated/retired in future)
It is inconvenient needing to use ‘nametemplates’ for listing all known templates, as opposed to the more conventional ‘nametemplate’, but it is more important to avoid breaking the existing API.
At present there exists an API to get the currently configured global name template via GET /openmrs/ws/rest/v1/nametemplate, as implemented by
However, in order to support i18n layout in the O3 Patient Registration form, it would be better if we could retrieve an arbitrary NameTemplate by id. (In the case of NameTemplates, the
codename
is the unique identifier.)In order to avoid breaking changes with the existing api, new API endpoints should be added, resulting in:
GET /openmrs/ws/rest/v1/nametemplate - (unchanged) get the currently configured global name template.
GET /openmrs/ws/rest/v1/nametemplates - (new) list all known name templates
GET /openmrs/ws/rest/v1/nametemplate/{codename} - (new) get a specific name template
GET /openmrs/ws/rest/v1/nametemplate/layout.name.format- (new) get the currently configured global name template. (duplication of existing functionality, but may allow the existing endpoint to be deprecated/retired in future)
It is inconvenient needing to use ‘nametemplates’ for listing all known templates, as opposed to the more conventional ‘nametemplate’, but it is more important to avoid breaking the existing API.