Wiki Spaces
Documentation
Projects
Resources
Get Help from Others
Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack
Manage Accounts dashboard contains these following features,
As the default, the common fields which are annexed with the Add New Account page are (* - required)
In addition to those common fields, We can add some custom fragments to this sections
Requirments
You need to follow these guidelines to create an extension with all required properties to add the custom fragment to the Add/Edit section of the person details.
Copy this JSON content into that file, and edit the values for your needs
{ "id": "${project.parent.groupId}.${project.parent.artifactId}.userAccount.personAttributeEditLocation", "extensionPointId": "userAccount.personAttributeEditFragment", "extensionParams": { "title" : "Location", "type": "personAttribute", "label": "Select Location", "formFieldName": "personLocationId", "uuid": "8b5c95ef-103c-41bc-9f24-368b8f77e070", "provider": "${project.parent.artifactId}", "fragment": "manageAccount/addLocation" } }
If the "type" is "personAttribute", then replace the "uuid" property with the respected personAttributeType which should added into the person Attribute (you need to create this personAttibuteType before adding this). If not, then no need to add the "uuid" property here.
If the "type" is Person attribute, then it will be automatically updated during the usual save/update though the dashboard. If the custom field type is not person attribute, then the custom fragment should handle those.
Required extension properties : id, extensionPointId, type, formfieldName, provider, fragment, uuid(if only type is personAttribute), label(if only you want to use it through the fragment config), title(if only you want to use it through the fragment config)
It will be used to add the custom fragments to view the additional information in the person details section. Please follow these guidelines to create an extension with all required properties,
Copy this JSON content into that file, and edit the values for your needs
{ "id": "${project.parent.groupId}.${project.parent.artifactId}.userAccount.personAttributeViewLocation", "extensionPointId": "userAccount.personAttributeViewFragment", "extensionParams": { "label": "Location", "type": "personAttribute", "provider": "${project.parent.artifactId}", "fragment": "manageAccount/viewLocation" } }
If the type is Person attribute, then it will be automatically fetched the value and add that value to the "initialValue" property of the fragment Configuration. You can use this value to get the actual objects from your view fragments (i.e : Convert to location object)
Required extension properties : id, extensionPointId, type, provider, fragment, label(if only you want to use it through the fragment config)
You need to follow these guidelines to create an extension with all required properties to add the custom fragment to the Add/Edit section of the user account details.
Copy this JSON content into that file, and edit the values for your needs
{ "id": "${project.parent.groupId}.${project.parent.artifactId}.userAccount.userPropertyEditLocation", "extensionPointId": "userAccount.userPropertyEditFragment", "extensionParams": { "title" : "Location", "type": "userProperty", "userPropertyName" : "locationId", "label": "Select Location", "provider": "${project.parent.artifactId}", "fragment": "manageAccount/addLocation" } }
If the "type" is "userProperty", then replace the "userPropertyName" property with the respected user property name which should added with the user.
If the "type" is "userProperty" , then it will be automatically updated during the usual save/update though the dashboard.
Use the userPropertyName as your custom field Id value and name value to auto wire the Angular services with your custom fragments. Or use the fragment Configuration to retrieve the formFieldName as follows to get the actual formFieldName which can auto wire the HTML element with angular services.
<input type="text" id="${config.formFieldName}" name="${config.formFieldName}">
Required extension properties : id, extensionPointId, type, userPropertyName(use this as the formFiledName to auto wire with Angular services), provider, fragment, label(if only you want to use it through the fragment config), title(if only you want to use it through the fragment config)
It will be used to add the custom fragments to view the additional information in the user account details section. Please follow these guidelines to create an extension with all required properties,
Copy this JSON content into that file, and edit the values for your needs
{ "id": "${project.parent.groupId}.${project.parent.artifactId}.userAccount.userPropertyViewLocation", "extensionPointId": "userAccount.userPropertyViewFragment", "extensionParams": { "label": "Location", "type": "userProperty", "userPropertyName" : "locationId", "provider": "${project.parent.artifactId}", "fragment": "manageAccount/viewUserLocation" } }
Do not change the "extensionPointId": "userAccount.userPropertyViewFragment", if you need to add this fragment to View User section.
Required extension properties : id, extensionPointId, type, userPropertyName, provider, fragment, label(if only you want to use it through the fragment config)