Database
LabPipe Server works with MongoDB.
Required collections
Collection
Description
Access tokens
Roles
To provide parameter list for the client
API endpoint roles
Operators, can be used for login on the client
Research studies
Dynamic form templates to be retrieved on the client
Report html templates for record notification email
Instruments
Devices attached to instruments for collection
Sample types
Locations
Email groups for notification email
ACCESS_TOKENS
Parameter
Format
Required
token
string
Yes
keyhash
string
Yes
roles
string[]
No
Example
{
"token": "token",
"keyhash": "$2a$10$oSnRBce/gDbLWsVv2wOx8.Rhv88zMPLCMRZb6j0gtZwKZvvohJWIa",
"roles": [
"general-token"
]
}
ROLES
Parameter
Format
Required
identifier
string
Yes
name
string
Yes
Example
{
"identifier": "general-token",
"name": "Accessible by all token"
}
CLIENT_SETTINGS
Parameter
Format
Required
Value
identifier
string
Yes
client_init
name
string
Yes
value
string[]
No
Example
{
"identifier": "client_init",
"name": "Parameter list for client init",
"value": [
"LOCATIONS",
"OPERATORS",
"STUDIES",
"INSTRUMENTS",
"COLLECTORS"
]
}
API_ACCESS_ROLES
Parameter
Format
Required
url
string
Yes
roles
string[]
Yes
Example
{
"url": "/api/general/connect/auth",
"roles": [
"general-auth"
]
}
OPERATORS
Parameter
Format
Required
name
string
Yes
passwordHash
string
Yes
username
string
Yes
string
Yes
active
boolean
Yes
projects
string[]
No
notificationGroup
string[]
No
roles
string[]
No
Example
{
"name": "Test User",
"passwordHash": "$2a$10$QC4LEBrdfLvMoy0TetVKWeA2p4tbhv3mPhiYRdSbfjdXMJ3.ErtUC",
"username": "testuser",
"email": "[email protected]",
"active": true,
"projects": [
"project1",
"project2"
],
"notificationGroup": [
"test-email-group"
],
"roles": [
"general-auth"
]
}
STUDIES
Parameter
Format
Required
identifier
string
Yes
name
string
Yes
config
object
Yes
Example
{
"code": "EMBER",
"name": "East Midlands Breathomics Pathology Node",
"config": {
"participant_id": {
"prefix": [
"AAA"
],
"length": 4
},
"visit_id": [
"A",
"B"
],
"location": [
"LOC1",
"LOC2"
],
"instrument": [
"PTR",
"R"
],
"collector": [
"R"
],
"sample_type": [
{
"identifier": "BS",
"name": "BBBSSS",
"available_at": [
{
"instrument": [
"PTR"
],
"collector": [
"R"
]
},
{
"instrument": [
"R"
]
}
]
},
{
"identifier": "RP",
"name": "RRRPPP",
"available_at": [
{
"instrument": [
"R"
]
}
]
}
]
}
}
FORMS
Parameter
Format
Required
identifier
string
Yes
name
string
Yes
studyIdentifier
string
Yes
instrumentIdentifier
string
Yes
template
object
Yes
url
string
Yes
notificationStyle
string
Yes
Example
{
"identifier": "ember-form-1",
"name": "Test Form",
"studyIdentifier": "EMBER",
"instrumentIdentifier": "R",
"template": {
"title": "Sample",
"pages": [
{
"title": "Sample Information",
"navTitle": "Sample Infomation",
"requireValidForm": true,
"order": 1,
"questions": [
{
"key": "participant_id_prefix",
"label": "Participant ID Prefix",
"required": "true",
"order": 1,
"controlType": "select",
"options": "__config::participant_id::prefix__",
"helperText": "SN for screening visit only. Once enrolled, use STP."
},
{
"key": "participant_id_number",
"label": "Participant ID Number",
"required": true,
"order": 2,
"controlType": "input",
"type": "text",
"helperText": "Participant ID number part, e.g. [0001] in [XXX0001]",
"pattern": "__config::participant_id::length__"
},
{
"key": "visit_id",
"label": "Visit ID",
"required": true,
"order": 3,
"controlType": "select",
"type": "text",
"helperText": "0 for screening visit only.",
"options": "__config::visit_id__"
}
],
"formValidProcess": [
{
"newField": "participant_id",
"processType": "concat",
"dataField": "-::participant_id_prefix::participant_id_number",
"required": true,
"allowCopy": true
},
{
"newField": "sample_id",
"processType": "concat",
"dataField": "-::participant_id_prefix::participant_id_number::visit_id::--R::--RP",
"required": true,
"allowCopy": true
}
],
"key": "p_sample_info"
},
{
"title": "File Upload",
"key": "p_file",
"navTitle": "File",
"requireValidForm": "true",
"order": "3",
"questions": [
{
"key": "file",
"label": "Sample File",
"required": false,
"order": 1,
"controlType": "file",
"helperText": "Select file to upload",
"target": "file",
"multiple": true,
"filter": [
{
"name": "HDF5 file",
"extensions": [
"h5"
]
}
]
}
]
}
]
},
"url": "/api/record/add",
"notification_style": "ADMIN_ONLY"
}
REPORT_TEMPLATES
Parameter
Format
Required
identifier
string
Yes
name
string
Yes
formIdentifier
string
Yes
text
string
No
html
object[]
Yes
active
boolean
Yes
Example
{
"code": "test",
"name": "Test Report",
"form_code": "test",
"text": "",
"html": [
{
"type": "REPORT_TITLE",
"source": "STATIC",
"method": "VALUE",
"value": "Test LabPipe Report Title",
"order": 1
},
{
"type": "SECTION_TITLE",
"source": "STATIC",
"method": "VALUE",
"value": "Section 1 table for different objects",
"order": 2
},
{
"type": "TABLE_KEYVALUE",
"source": "FORM_DATA",
"method": "PROPERTY",
"value": "p_basic",
"order": 3
},
{
"type": "SECTION_TITLE",
"source": "STATIC",
"method": "VALUE",
"value": "Section 2 table for same type objects"
},
{
"type": "TABLE_LOOP",
"source": "FORM_DATA",
"method": "PROPERTY",
"value": "p_file.file",
"order": 4
},
{
"type": "SECTION_TITLE",
"source": "STATIC",
"method": "VALUE",
"value": "Section 3 list",
"order": 5
},
{
"type": "LIST",
"source": "FORM_DATA",
"method": "PROPERTY",
"value": "p_file.file",
"order": 6
},
{
"type": "REPORT_TITLE",
"source": "FORM_CONFIG",
"method": "PROPERTY",
"value": "study_code",
"order": 7
},
{
"type": "SECTION_TITLE",
"source": "FORM_CONFIG",
"method": "PROPERTY",
"value": "instrument_code",
"order": 8
}
],
"active": true
}
INSTRUMENTS
Parameter
Format
Required
identifier
string
Yes
name
string
Yes
realtime
boolean
Yes
fileType
string[]
Yes
Example
{
"identifier": "R",
"name": "ReCIVA",
"realtime": true,
"fileType": [
"h5"
]
}
COLLECTORS
TBA.
SAMPLE_TYPES
TBA.
LOCATIONS
Parameter
Format
Required
identifier
string
Yes
name
string
Yes
type
string[]
No
Example
{
"identifier": "LOC1",
"name": "Location 1",
"type": []
}
EMAIL_GROUPS
Parameter
Format
Required
identifier
string
Yes
name
string
Yes
studyIdentifier
string
Yes
formIdentifier
string
Yes
admin
string[]
No
member
string[]
No
Example
{
"identifier": "test-email-group",
"studyIdentifier": "ember",
"formIdentifier": "test",
"name": "Test Email Group Wahaha",
"admin": [
"bo.zhao"
],
"member": []
}
Last updated
Was this helpful?