Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com

Attribute Types Examples

In case of custom fields

Please note: For versions 8.0 and above, you need to use 'variableName' and for those prior to v8.0, the field names would be DD1, ST2, RB3 etc.

You will observe that 'variableName' is used in all examples. These are field names based upon control types present in the form attached at the custom fields' level.

Steps to add the custom fields to the JSON:

  1. Go to the Forms tab → Click on the form → Click on Export → zipped file is downloaded.

  2. Extract the zipped file and open the XML file.

  3. For each field in XML, you can observe these names are enclosed within '<name> </name>' tag. For example: <name>variableName</name>

  4. Use these names to define the fields in JSON.

  5. Ensure that the form is attached to the CP at the particular custom field level.

Below is a list of different attribute types that can be used during the SDE or RDE setup. 

Level

Attribute Type

Description

Example JSON

Level

Attribute Type

Description

Example JSON

1

Participant

Text Custom Field

The custom text field is to be displayed on the participant add, edit and overview pages.

 

You need to specify the 'pattern' to if you want to restrict the text input on to follow certain condition.

If links or URL are added to the text fields, they will be hyperlinked and clickable on the overview pages.

{ "name": "cpr.participant.extensionDetail.attrsMap.variableName", "caption": "Country", "type": "text", "optional": true }

 

Example pattern to allow only capital letters.

"pattern" : "/^[A-Z]+$/"
2

Participant

Date Custom Field

'DOB of Mother' is a field that stores date hence marked as 'date' in the property type.

{ "name": "cpr.participant.extensionDetail.attrsMap.variableName", "caption": "DOB of Mother", "type": "date", "dateOnly": true, "optional": true }
3

Participant

Note Custom Field (v9.0)

Adds a note field. You can add multiple note fields within JSON as: "name": "cpr.note1", "name": "cpr.note2", and so on.

For visit: "name": "visit.note5"

For specimen: "name": "specimen.note6"

  1. This field will only be visible on the data entry screens.

  2. You can directly add the code in CP JSON. There is no need to create a custom form for adding notes.

 

4

Participant

Number Custom Field with pattern

When you want to validate the pattern during data-entry, use 'type': “text”.

Use case: The first digit of the age field should always be between 1 and 9.

 

image-20240416-165156.png

 

5

Participant

Number Custom Field (v11)

When you don’t want to validate the pattern during data-entry, we use 'type': “number” (supported in v11).

6

Participant

Number Custom Field (With decimal values)

You need to specify the 'pattern' to allow decimal values.

Simple example:

a) Max. 2 digits before decimal point. Max. 10 digits after decimal point

b) Any number of digits before decimal point. Exact 2 digits after decimal point, if any

c) Same as b) but allow negative fractions as well

Explanation:

a) ^ (caret) - Indicates start of string/input

b) $ - end of the string/input

c) ? - any character, group or pattern before this is optional

d) \d - any digit 0-9

e) + - one or more occurrences of the preceding character, group, or pattern

f) {m, n} - specifies the preceding character, group, or pattern should match at least m times and at max n times.

Detailed explanation:

^-?: minus sign should appear at the start of the string/input. The minus sign is optional.

^-?\d+: An optional minus sign can appear at the start of the string/input. Followed by that, at least one digit (0, 9) should occur in the input string.

^-?\d+(\.\d{2,5})?$: An optional minus sign can appear at the start of the input string. Followed by that, at least one digit. An optional dot and at least 2 digits, at max 5 digits after the dot can appear. After this, no more characters can appear in the string.

7

Participant

DropDown Custom Field

A dropdown field from the custom form 'JSONTParticipantExtention' named 'Select Any Option' is fetched here.

8

Participant

Text area Custom Field

The custom text area field is to be displayed on the participant overview page/create participant page.

9

Participant

Radio Button Custom Field

The field 'Is participant Allergic?' is mapped to a field, and the options are 'Yes'/'No'.

You can also specify a default value to be populated for the field using the property 'defaultValue'.

Note At present, the radio button works with only inline options.

10

Participant

Dropdown Multiselect Custom Field

Multiple select dropdown fields from the custom form 'JSONTParticipantExtention' named Diagnosis Subtype' are fetched here. 



11

Specimen

Text

The field specimen label will be displayed only if the specimen label format is not specified or manual input for the specimen label field is allowed.

This is the 'showif' condition added in the example JSON.

12

Specimen

Text

Additional Label

13

Specimen

Number

When adding a numeric field user can specify the 'pattern', which will allow only specific numbers.

14

Participant

Dropdown (OS standard field)

To retrieve the standard values from the OpenSpecimen dropdown, you must specify the type as 'pvs'.

15

Specimen

Dropdown (custom field)

A dropdown field from the custom form 'SpecimenAdditionalFields' named 'Method' is fetched here. 





16

Participant

Dropdown (custom field) with the selection of multiple options.

A dropdown field from the custom form 'lCPHExtension' named 'Diagnosis Subtype' is fetched here.

All the values will be populated from the control name 'variableName'.

It supports the selection of multiple options from the dropdown. In the code, the value against 'multiple' needs to be set to 'true'.

17

Specimen

Radiobutton

The field 'Medical database' is mapped to a field with a control name as 'variableName', and the options are 'Yes' / 'No'.

You can also specify a default value to be populated for the field using the property 'defaultValue'.

18

Specimen

Checkbox

While adding a checkbox, you need to use the type 'radio' and specify the value by casting them into Yes/No.

19

Participant

Date only field

To mark a field to store the only date, use the property 'dateOnly'.



20

Participant

Phone Number

Default Phone number field for participant level.

21

Participant

Received SMS(eConsent)

Received SMS checkbox, used for eConsent

 

22

Participant

Email

Email Address Field

 

23

Participant

Received Email

Received Email checkbox, used for eConsent

 

24

Participant

Subform(OS standard field)

The MRN and site fields are displayed in a subform section. 

Add the property 'search' helps in retrieving values in larger dropdowns. If this is not added, then only the first 100 values will be populated.

The 'listAll' property shows all the sites for users who have access to CP, irrespective of which site they have access to. If you don't add this property, you will only see those sites you have access to. 

25

Participant

Subform (custom field)

A subform with two attributes - dropdown and radio button- will be displayed on the participant overview page.

The subform name is SF6 which can be found in the exported form XML file.

The names of the fields under the subform are specified without extensions like DD7 or RB8, for example. 

While specifying the control name for the dropdown fields under the subform, you must include the subform name, such as SF6.DD7.

The "type": "Collection"  configuration is used explicitly for subform fields. If you remove the “type”: "collection" syntax and configure the field only as “type”: “pvs” the field will be displayed as a normal dropdown and not the subform field for multiple data entries. For any field type apart from the site, user, and storage container, you need to define the type as a collection to be configured as a subform field.



26

Specimen

Date & time field

'Created On' is a field that stores date and time hence marked as 'datetime' in the property type.

Since this field is available only for the child samples, a skip logic is added to edit this field only when the lineage is not 'New'.

27

Visit

Dropdown

Add the Visit Cohort field with the PV dropdown values.

28

Visit

Event

Add Event field in dictionary

29

Participant

Permissible Value Field

Site Dropdown: The example is stated for the participant-level site dropdown. 





30

Visit

Permissible Value Field

PV dropdown values can be used in the custom field using the control type as Permissible Value.

While adding the fancy control for the PV dropdown, use the unique id of the dropdown in the tag "attr": "unique_id". This appears enclosed in brackets when the user clicks a particular dropdown
(See dropdown manager wiki for more details)

For setting the default value to a PV dropdown fancy control, use "defaultValue": "<value>". Replace <value> with the value to be set as default.

31

Specimen

Permissible Value Field

There are two types of fancy controls 'User' and 'Site'.

While adding the fancy control for the user, add the property "selectProp": "id".

From v6.0, the ability to exclude contact users from the user list by adding "excludeType": "CONTACT" in the code block.



32

Visit

Multi-select checkbox

The field will be displayed as a multi-select dropdown.

33

Specimen

File upload

Using the File upload control, you can upload any file.

34

Specimen

Hyperlink Field

Use hyperlink control for easy navigation from one page to another. e.g., Hyperlink the parent specimen labels for easy navigation to the specimen page.

35

Specimen

Collection Status Field

The value will be shown as read-only.

To make the customized view look like the default view for showing distribution status, use this code in your workflow JSON.

36

Specimen

Specimen Requirement Label

How to add the specimen requirement label in the JSON nth step?

37

Specimen

Yes/No Checkbox

For Participant Level: Use the below code

"name":"cpr.participant.extensionDetail.attrsMap.variableName"

For Visit level: Use the below code

"name" : "visit.extensionDetail.attrsMap.variableName"

38

Visit

Event Label

Adds Event Label field on the visit page.

39

Specimen

Parent Custom Field

Adds parent custom field on the create derivative/aliquots page.

40

Specimen

Create aliquots

Add a create aliquots checkbox on the create the unplanned derivative page.

41

Specimen

Parent Specimen Qty Unit (v8.2)

Add parent specimen quantity unit on the create derivative/aliquots page.



42

Specimen

Parent Specimen Conc Unit (v8.2)

Add parent specimen concentration unit on the create derivative/aliquots page.

43

General

Tooltip (v9.0)

Adds a tooltip to fields



44

Specimen

Received By

Adds received user field on the specimen page

45

General

Image (v9.0)

Adds an image. You can add multiple images within JSON as:

"name": "cpr.note1", "name": "cpr.note2", and so on.

For visit: "name": "visit.note5"

For participant: "name": "cpr.note1"



46

Specimen

Close parent after child creation

Closes parent specimens after the creation of child specimens in the nth step.



47

Specimen

Specimen custom event

A specimen, custom event of dropdown type. Similarly, for any other type of field to be configured at specimen event level, the above attributes can be used with extension as below

"name":"specimen.events.form name.variable name"

Note: This is an example to include the events fields in a dictionary. This will not show the fields on the overview page. After adding the event field in the dictionary, these fields can be used in the nth step to collect the events during specimen collection.

48

Specimen

Subform with PVS field(custom field)

A subform with a PVs field will be displayed on the specimen overview page.

Consider below example:

The subform variable name is ‘histological_details’ which can be found in the exported form XML file.

The name of the PVs field under the subform is specified without extensions like ‘histological_qualityy’

While adding the fancy control for the PV dropdown, use the unique id of the dropdown in the tag "attr": "histological_quality". This appears enclosed in brackets when the user clicks a particular dropdown
(See dropdown manager wiki for more details)

 

 

Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com