This is my first time to post in this forum. Not a professional programmer, but am taking a graduate Python course and have been spending regular time over the past several months developing a clinical diagnostic interview with LimeSurvey.
There are three LimeSurvey interview modules. I've written code to export the answers from each module and massage them into one final product suitable for copy/pasting into an electronic health record. "export_responses_by_token" is working well using JSON.
Am trying to get another Python module written for office staff to input a token number and patient name, using these to initialize one participant for all three LimeSurvey interview modules. I want the token number to be the patient's medical record number.
However, I can't seem to set the token value via the "add_participants" API method. I've run this through my code and
Lindsay Stevens
code with similar results. The "add_participants" command works fully, successfully adding participants to all three interview modules ... but the tokens are automatically generated as random values rather than accepting the token value I'm trying to set.
Using Version 2.64.7+170404
Have tried the following parameter strings with no joy (various combinations of bCreateToken values and use of integers vs. strings):
{"method": "add_participants", "params": {"sSessionKey": "xnwizxpv25n2upzei9xjbr9866h6hrjk", "iSurveyID": 556469, "aParticipantData": [{"token": 9876543, "firstname": "Frank", "lastname": "Smith", "participant_id": 9876543, "tid": 9876543}], "bCreateToken": "false"}, "id": 1}
{"method": "add_participants", "params": {"sSessionKey": "ga9e7cwsn3ce53zfjmihdgkh4qd8456q", "iSurveyID": 556469, "aParticipantData": [{"token": 9876543, "firstname": "Frank", "lastname": "Smith", "participant_id": 9876543, "tid": 9876543}], "bCreateToken": "true"}, "id": 1}
{"method": "add_participants", "params": {"sSessionKey": "a38yj6mpse8bsp9v3wbttc65aim73qm8", "iSurveyID": 556469, "aParticipantData": [{"token": "9876543", "firstname": "Frank", "lastname": "Smith", "participant_id": "9876543", "tid": "9876543"}], "bCreateToken": "true"}, "id": 1}
{"method": "add_participants", "params": {"sSessionKey": "n78jn7fitdkt27t6td9xsmpujbxn8yht", "iSurveyID": 556469, "aParticipantData": [{"token": "9876543", "firstname": "Frank", "lastname": "Smith", "participant_id": "9876543", "tid": "9876543"}], "bCreateToken": "false"}, "id": 1}
These all work (I delete the newly created participants between trial runs) ... except for the token still being automatically generated instead of manually set.
Am worried I'm just missing something very obvious.