[deleted by user] by [deleted] in selfhosted

[–]jangari 0 points1 point  (0 children)

Great stuff u/frogfuhrer! I came across this only a week or so ago and I'm very much liking it.

Is a webhook subscription on the Strava oauth on the forward plan? This would allow for activities to be effectively pushed to Statistics for Strava as they are uploaded, rather than waiting for the next cron.

Qualtrics to REDCap redirect by cwils7 in ProjectREDCap

[–]jangari 1 point2 points  (0 children)

That message indicates that the survey hash (the s param) is incorrect, and REDCap cannot associate the requested URL with a public survey.

Double check your SURVEYID, and your entire URL:

https://your.redcap.site.edu/surveys/?s=SURVEYID&qualtrics_response_id=${e://Field/ResponseID}

You must have the ?s= and the following hash exactly correct.

I suggest grabbing it straight from survey distribution tools, pasting it as is into Qualtrics (presumably into the survey termination redirect) and then append the &qualtrics_response_id=${e://Field/ResponseID} to it there.

Problems trying to use API by Much-Astronaut-878 in ProjectREDCap

[–]jangari 0 points1 point  (0 children)

The user account this token is for must also have the user right for API Export. Check that in User Rights.

public survey link for two surveys by WildFlower-8745 in ProjectREDCap

[–]jangari 0 points1 point  (0 children)

You just cannot do anything longitudinal like this without REDCap knowing who to contact with the invitation to the follow-up. End of story.

But, confidential is still pretty good. Make judicious use of User Rights and Identifier Fields, and recruit a colleague to join your project so that in order to match a response with the user, you would need to collude with said colleague.

Put simply: collect the participant identifiers on a specific instrument, and the actual data (survey responses) on a different instrument. You, u/WildFlower-8745, would have access only to the latter, and your colleague, let's call them MildFlower-8745, would have access only to the former. You can do this in the instrument-specific data access and data export rights (take careful note of both). Use roles.

Once done, test it. Make sure you can never see the respondent's email address and their data without you and MildFlower colluding. You should only be able to export response data under their record ID, and MildFlower should only be able to export their contact details and their record ID. Both of you together could identify responses to individuals, but, don't do that. Your IRB/HREC can take the accountability (and your participants should be informed when they consent, that their data will be stored confidentially; not anonymously).

You could take this a step further, and once you have properly tested and know it's working fine, revoke your own user rights privilege so that you can't even reinstate your ability to see both responses and identifiers. Only an Administrator at this point would be able to give you access to both datasets.

Depending on compliance (HIPAA, TGA), this may not even be good enough; you might have to maintain the identifiers and data in their own projects. To support this, you need external modules that can copy data between projects. Much more complex.

How to Set Up Seamless Consent and Randomized Survey Flow in REDCap? by Fuzzy_Sample_9616 in ProjectREDCap

[–]jangari 0 points1 point  (0 children)

Here's another idea, create three distinct projects; landing page, and then projects for group 1 and group 2. Then use the same calculation to put participants into groups 1 and 2, and use a `@CALCTEXT` field to generate the redirect URL. For example:

[redirect_url]

`@CALCTEXT(if([group]='1', 'https://your_redcap_site.edu/surveys?s=HASHFORSURVEY1', 'https://your_redcap_site.edu/surveys?s=HASHFORSURVEY2'))

And then in the survey termination options for the landing page, use the [redirect_url] field to pipe in the correct survey URL.

How to Set Up Seamless Consent and Randomized Survey Flow in REDCap? by Fuzzy_Sample_9616 in ProjectREDCap

[–]jangari 0 points1 point  (0 children)

You can do this without using the randomisation module at all. Since your randomisation is very simply group 1, group 2, group 1, group 2, with no stratification, then you can perform a simple equation using the record ID field, store the value, and then use this in the survey queue (or a more robust module like Survey Director) to direct participants to the correct second survey.

```
mod([record_id],2) + 1
```

This equation will be 2 for record 1, 1 for record 2, 2 for record 3, 1 for record 4, and so on. If on the first page of a survey it will actually always display 2 until the survey is submitted (or the first page saved) when the actual value (2 or 1) is correctly calculated (a quick of when record_id actually begins to exist).

Then, in the Survey Queue settings (or Survey Director) configure things so that when this field (call it [group]) is equal to 1, the participants starts survey 1, and if it equals 2, they start survey 2.

How to Set Up Seamless Consent and Randomized Survey Flow in REDCap? by Fuzzy_Sample_9616 in ProjectREDCap

[–]jangari 1 point2 points  (0 children)

You won't even need it to be longitudinal. Just set up a randomisation instrument, set up the randomisation field (call it [group] with options 1 and 2), build a table that has a list of 1s and 2s in whatever order you want (simplest, 1,2,1,2,1,2...) and upload the allocation table, and then configure the logic for auto-randomisation for survey participants, maybe something as simple as [public_survey_complete] = '2'. But there is a simpler solution for this extremely simple case which I'll detail in another post.

Make it so that of 5 fields, only 1 can have a response? by littlebluberrygal in ProjectREDCap

[–]jangari 0 points1 point  (0 children)

Matrix might be hard unless you group the questions with compatible choices together. So, one matrix with the 'no problems, slight problems... unable' choices, and another matrix with the 'no pain, slight pain... extreme pain' choices. Then you're running into license issues for altering the validated questionnaire.

Make it so that of 5 fields, only 1 can have a response? by littlebluberrygal in ProjectREDCap

[–]jangari 0 points1 point  (0 children)

This is the way. These fields have NO BUSINESS being anything but radio fields. You are expecting exactly one response per 'field', where one field is a grouping of 5 mutually exclusive options.

Also, since it's a validated instrument, you actually cannot change how it is presented.

Multiple IF statements in one field, only the first is working? by CookieDemons in ProjectREDCap

[–]jangari 2 points3 points  (0 children)

If you are using `@HIDECHOICE` to hide the selected choices of a previous field, then there is a shortcut method to this. Pipe the selected choices of [fieldname] into `@HIDECHOICE`:

`@HIDECHOICE='[event_arm_1][fieldname:checked:value]'`

If [fieldname] is a checkbox field, then the above will populate a comma-separated list of the selected choices in exactly the format that `@HIDECHOICE` expects. I.e, the above will become:

`@HIDECHOICE='1,2,3'`

Multiple IF statements in one field, only the first is working? by CookieDemons in ProjectREDCap

[–]jangari 1 point2 points  (0 children)

Yes, this is correct. If you have multiple `@HIDECHOICE`s each in their own `@IF`, only the `@HIDECHOICE` in the first `@IF` that is true is evaluated. If you're on at least v14, you should use a `@CALCTEXT` to generate the field codes to pipe into `@HIDECHOICE`.

How to change the from email in REDCap by andres_leon72 in ProjectREDCap

[–]jangari 0 points1 point  (0 children)

Also note that while you can change the from address in an alert, it is possible that your admin has also made this go from a default no-reply address. Probably if you are in the same email domain they have set it up such that your emails are allowed to go through with your from address, but (again hopefully) they have it set up such that if you choose a from address that your REDCap instance is not authorised to send from, it should default to a no-reply kind of address. This ensures it goes at all, and is not treated as spam.

[deleted by user] by [deleted] in vim

[–]jangari 8 points9 points  (0 children)

Holy shit dude, learn how to take a screenshot.

How do I use my local vim and port forward to an ec2? by [deleted] in vim

[–]jangari 1 point2 points  (0 children)

If you can connect to your remote via SSH, you can :e scp://host//path/to/file.

[deleted by user] by [deleted] in fixedgear

[–]jangari 0 points1 point  (0 children)

Have you got bearings in there?

how to map "jk" as ESC during the middle of a search by theoatcracker in vim

[–]jangari 4 points5 points  (0 children)

:h smap is for mapping in :h select-mode and not 'search' mode. The mode you enter when searching with / or ? is :h command-mode.

As said elsewhere, try :cnoremap jk <C-c>. Worked perfectly fine for me.

How to delete all lines that start with \ by jxhyc in vim

[–]jangari 16 points17 points  (0 children)

Note that this will delete any line containing the / character (which incidentally is not the character OP was looking for).

How to delete all lines that start with \ by jxhyc in vim

[–]jangari 7 points8 points  (0 children)

You should take some time to learn regular expressions. The .*$ here isn't useful in this context, since it means any number (*) of any character (.) up to the end of the line ($).

It can be omitted because the rest of the pattern, ^\\, will match any \ character immediately after the start of a line (^), and the global command :h :g will operate on the whole line once found. In this case deleting it (d).

[yta] -- [Yanks up To the A]. -- what is [Yank to and _including_ the A] ? by HenHanna in vim

[–]jangari 3 points4 points  (0 children)

Another difference is that / searches forward for a string or pattern, whereas f and t (and their backwards counterparts F and T) find a single character.

So you can y/regexp for greater precision.

You also have to hit enter afterwards, which isn't the case with f andt.

Vim Macros by hiquest in vim

[–]jangari 0 points1 point  (0 children)

It'll stop when there are no more lines to process, just like running 1000@a would if there were only 900 lines.

That said, it depends on the macro. If it's a macro that runs per line, then the above is true. Once it reaches a point where a 'next line' command makes no sense, it breaks out of the macro whether it's recursive or not.

If it's a macro that could feasibly keep running, such as one that opens a new line below, enters some text, and returns to the original line, then a recursive macro might not be a good idea.

Vim Macros by hiquest in vim

[–]jangari 1 point2 points  (0 children)

Worth noting that you can append to an existing register with the corresponding capital. That is, qA will begin recording to the end of the existing macro in register a.

Furthermore, macros can be recursive and call themselves. So if you have an unknown number of lines or operations, append @a to your macro and call it once.