CarpProtocolService
A CARP Core ProtocolService and ProtocolFactoryService that talks to CAWS.
Stores, versions and fetches StudyProtocols on the server. The user must be authenticated as a researcher. Participant apps normally do not need it; they get their deployment from CarpDeploymentService.
- Inheritance
-
- Object
- CarpBaseService
- CarpProtocolService
- Implemented types
Constructors
CarpProtocolService
Returns the singleton default instance of the CarpProtocolService. Before this instance can be used, it must be configured using the configure method.
Properties
rpcEndpointName
The name of this service's RPC endpoint at CAWS, like deployment-service.
Methods
add
- StudyProtocol protocol, [
- String? versionTag
Add the specified study protocol.
versionTag is an optional label used to identify this first version of the protocol. Timestamp of initial creation by default.
addVersion
- StudyProtocol protocol, [
- String? versionTag
Add a new version for the specified study protocol, of which a previous version with the same id, ownerId, and name is already stored.
versionTag is an optional unique label used to identify this specific version of the protocol. The current date/time by default.
createCustomProtocol
Create a study protocol to be deployed to a single device which has its own way of describing study protocols that deviates from the CARP core study protocol model.
The customProtocol is stored in a single CustomProtocolTask which in the CARP study protocol model is described as being triggered at the start of the study for a CustomProtocolDevice with role name "Custom device".
getAllForOwner
- String ownerId
Finds all StudyProtocols owned by the owner with ownerId. In CAWS, the ownerId is the CarpUser.id of the signed-in user.
Returns the last version of each StudyProtocol owned by the requested owner, or an empty list when none are found.
getBy
Return the StudyProtocol with the specified protocolId,
versionTag is the tag of the specific version of the protocol to return. The latest version is returned when not specified.
getVersionHistoryFor
- String protocolId
Returns all stored versions for the protocol with the specified protocolId.
updateParticipantDataConfiguration
- String protocolId,
- String versionTag,
- List<
ExpectedParticipantData> expectedParticipantData
Replace the expected participant data for the study protocol with the specified protocolId and versionTag with expectedParticipantData.
Returns the updated StudyProtocol.