Wiki Spaces

Documentation
Projects
Resources

Get Help from Others

Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack

Documentation

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. create a JSON into your omod → module → resources → app → customAddEditPersonInfoName.json
  2. Copy this JSON content into that file, and edit the values for your needs

    Code Block
    firstline1
    titleAdd/Edit person info - custom fragment extension.json
    linenumberstrue
    {
    "id": "${project.parent.groupId}.${project.parent.artifactId}.userAccount.personLocationpersonAttributeEditLocation",
    "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"
    }


  3. Do not change the "extensionPointId": "userAccount.personAttributeEditFragment", if you need to add this fragment to Add/Edit Person section.
  4. 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.

  5. 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.

  6. Update the other properties as usual way of creating the extensions for OpenMRS.

...

  1. create a JSON into your omod → module → resources → app → customViewPersonInfoName.json
  2. Copy this JSON content into that file, and edit the values for your needs

    Code Block
    titleView person info - custom fragment extension.json
    linenumberstrue
    {
    "id": "${project.parent.groupId}.${project.parent.artifactId}.userAccount.personViewLocationpersonAttributeViewLocation",
    "extensionPointId": "userAccount.personAttributeViewFragment",
    "extensionParams": {
       "label": "Location",
       "type": "personAttribute",
       "provider": "${project.parent.artifactId}",
       "fragment": "manageAccount/viewLocation"
    }
    }


  3. Do not change the "extensionPointId": "userAccount.personAttributeViewFragment", if you need to add this fragment to View Person section.
  4. 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)

  5. Update the other properties as usual way of creating the extensions for OpenMRS.

...

  1. create a JSON into your omod → module → resources → app → customAddEditUserInfoName.json
  2. Copy this JSON content into that file, and edit the values for your needs

    Code Block
    titleAdd/Edit User info - custom fragment extension.json
    linenumberstrue
    {
    "id": "${project.parent.groupId}.${project.parent.artifactId}.userAccount.userLocationuserPropertyEditLocation",
    "extensionPointId": "userAccount.userPropertyEditFragment",
    "extensionParams": {
      "title" : "Location",
      "type": "userProperty",
      "userPropertyName" : "locationId",
      "label": "Select Location",
      "provider": "${project.parent.artifactId}",
      "fragment": "manageAccount/addLocation"
    }
    }


  3. Do not change the "extensionPointId": "userAccount.userPropertyEditFragment", if you need to add this fragment to Add/Edit User Account section.
  4. If the "type" is "userProperty", then replace the "userPropertyName" property with the respected user property name which should added with the user. 

  5. If the "type" is "userProperty" , then it will be automatically updated during the usual save/update though the dashboard.

  6. 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.

    Code Block
    <input type="text" id="${config.formFieldName}" name="${config.formFieldName}">


  7. Update the other properties as usual way of creating the extensions for OpenMRS.

...

  1. create a JSON into your omod → module → resources → app → customViewUserInfoName.json
  2. Copy this JSON content into that file, and edit the values for your needs

    Code Block
    titleView user info - custom fragment extension.json
    linenumberstrue
    {
    "id": "${project.parent.groupId}.${project.parent.artifactId}.userAccount.userViewLocationuserPropertyViewLocation",
    "extensionPointId": "userAccount.userPropertyViewFragment",
    "extensionParams": {
       "label": "Location",
       "type": "userProperty",
       "userPropertyName" : "locationId",
       "provider": "${project.parent.artifactId}",
       "fragment": "manageAccount/viewUserLocation"
    }
    }


  3. Do not change the "extensionPointId": "userAccount.userPropertyViewFragment", if you need to add this fragment to View User section.

  4. Update the other properties as usual way of creating the extensions for OpenMRS.

...