Interface QuestionnaireService

    • Method Detail

      • getQuestionnaires

        java.util.stream.Stream<org.molgenis.data.meta.model.EntityType> getQuestionnaires()
        Return a list of all questionnaires. Checks current user progress to set status.

        If user does not have a data entry for a questionnaire, status is set to 'NOT_STARTED'.

        Returns:
        A List of QuestionnaireResponse
      • startQuestionnaire

        QuestionnaireResponse startQuestionnaire​(java.lang.String entityTypeId)
        Start a questionnaire based on ID. If current user does not have a row for the specified questionnaire, one is created.

        Created questionnaire entries get the status 'OPEN'.

        Parameters:
        entityTypeId - The ID of a questionnaire type
        Returns:
        QuestionnaireResponse to return the added questionaire to the frontend
      • getQuestionnaireSubmissionText

        java.lang.String getQuestionnaireSubmissionText​(java.lang.String id)
        Retrieve static content for a specific questionnaire containing a "Thank you" text which is shown on submission.

        If no static content is specified, will return a text with HTML contents by default.

        Parameters:
        id - The ID of a questionnaire
        Returns:
        A piece of text which can be shown after submission of a questionnaire
      • findQuestionnaireEntity

        Questionnaire findQuestionnaireEntity​(java.lang.String entityTypeId)
        Find the single row in the Questionnaire table that belongs to the current user. Returns null if no row is found, or the questionnaire ID does not exist.
        Parameters:
        entityTypeId - The ID of a questionnaire table
        Returns:
        An Entity of type Questionnaire or Null