Versions Compared

Key

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

...

  1. Navigate to Settings → Biospecimen → System Workflows
  2. Click URL displayed for setting to download workflows JSON
  3. Open workflows JSON file in any editor of your choice
  4. Prepare locking fields configuration JSON as illustrated below. Add this JSON to the workflows array in downloaded workflows JSON file. Ensure there is only one array element named "locked-fields". The example configuration instructs OpenSpecimen to disallow edits to identified fields of participants sourced from EPIC. EPIC is an example of data source. It could be REDCap, OpenClinica, OnCore etc. The default data source name for participants created directly in OS is OpenSpecimen.
  5. The system workflow JSON file should look like the attached file system-workflows.json
  6. Upload updated workflows JSON by clicking on System Workflows setting.
  7. Test that the locking of fields is done properly based on the "data source name".

Code Block
    {
        "name": "locked-fields",
        "data": {
            "participant": {
              "EPIC": [
                  "cpr.participant.firstName",
                  "cpr.participant.lastName",
                  "cpr.participant.middleName",
                  "cpr.participant.birthDate",
                  "cpr.participant.gender",
                  "cpr.participant.pmis",
                  "cpr.participant.ethnicity",
                  "cpr.participant.races",
                  "cpr.participant.empi",
                  "cpr.participant.vitalStatus",
                  "cpr.participant.deathDate",
                  "cpr.participant.uid"
              ]
            }
        }
    }

...

  1. Download existing system workflow settings using below API:

    GET $APP_URL/rest/ng/config-settings/files?module=biospecimen&property=sys_workflows

    This will return JSON array with each element representing configuration for a workflow / feature.

  2. Prepare the locking fields configuration as illustrated in above section

  3. Upload edited system workflows file using HTTP POST multipart form data request as illustrated below

    POST $APP_URL/rest/ng/config-settings/files
    Content-Type: multipart/form-data

    Body:
    Multipart request containing file contents attached to variable "file"

    The API will return file ID like below for use in subsequent API

    4e0db682-ec8d-4ca6-be30-9239e78127e8_system-workflows-9.json


  4. Using the response of API in step #3, associate the uploaded file as system workflows setting using below API

    PUT $APP_URL/rest/ng/config-settings
    Content-Type: application/json
    Body:
    {
       "module": "biospecimen",
       "property": "sys_workflows",
       "value": "4e0db682-ec8d-4ca6-be30-9239e78127e8_system-workflows-9.json"
    }