/
Make the fields read-only
Got feedback or spotted a mistake?
Leave a comment at the end of this page or email contact@krishagni.com
Make the fields read-only
When the values for fields is coming from the HL7 or any other system to the OpenSpecimen at that time user doesn't allow to edit those fields on OpenSpecimen UI.
To achieve that, the user is able to make those fields read -only by configuring the below code in the JSON workflow.
Below is the list of different attribute types that can be made as read-only.
Attribute Type | Description | Example JSON |
---|---|---|
Text | Gender field made as read-only by setting 'type: span" | text field { "name" : "cpr.participant.gender", "caption" : "Gender", "type" : "span", "attr" : "gender", "optional" : true }, |
date | To made the date field as read-only, set the "type" : "span" and "formatType" : "date" | date { "name" : "cpr.participant.birthDate", "caption" : "Birth Date", "type" : "span", "formatType" : "date", "dateOnly" : true, "optional" : true }, |
Number | Made the customs form field as read-only | Custom form field { "name" : "specimen.extensionDetail.attrsMap.ST30", "caption" : "Time Lapse", "type" : "span", "optional" : true } |
Dropdown(custom field) | A drop-down field from the custom form is also able to make as read-only by setting the "type": "span" from "dropdown" | dropdown { "name": "specimen.extensionDetail.attrsMap.DD20", "caption": "Method", "type": "span", "optional": true, "listSource": { "apiUrl": "forms/permissible-values", "selectProp": "value", "displayProp": "value", "queryParams": { "dynamic": {}, "static": { "formName": "SpecimenAdditionalFields", "controlName": "DD20" } } } } |
Radiobutton | Made radio button field read-only by specifying the "type": "span". | radio { "name": "specimen.extensionDetail.attrsMap.RB2", "caption": "Medical data base", "type": "span", "optional": true, "options": ["Yes","No"], "defaultValue": "Yes" } |
Checkbox | Made Checkbox to the read-only field by specifying "type": "span". | checkbox { "name": "specimen.incrParentFreezeThaw", "caption": "Increment parent specimen's Freeze/Thaw cycles?", "type": "span", "optional": true, "options": [ { "caption": "Yes", "value": 1 }, { "caption": "No", "value": 0 } ] } |
, multiple selections available,
Related content
How to lock/unlock participant fields?
How to lock/unlock participant fields?
More like this
Hide/Unhide Fields Based on Value of Another Field
Hide/Unhide Fields Based on Value of Another Field
Read with this
Configure Fields on Main Pages
Configure Fields on Main Pages
More like this
Skip logic for custom fields
Skip logic for custom fields
More like this
Initialise values based on other fields
Initialise values based on other fields
More like this
Configuring Field Values per CP
Configuring Field Values per CP
More like this
Got feedback or spotted a mistake?
Leave a comment at the end of this page or email contact@krishagni.com