Nitesh,
Has the rest api for matching a collection protocol registration? I checked the online documentation and did not find it. Just want to make sure.
Thanks,
Jmfeng
Nitesh,
Has the rest api for matching a collection protocol registration? I checked the online documentation and did not find it. Just want to make sure.
Thanks,
Jmfeng
Hi @jmfeng,
The API for matching participant is present. The documentation is available at https://catissueplus.atlassian.net/wiki/x/AgDnAQ.
~Nitesh
Nitesh,
I need to match a participant registration in the collection protocol, not the participant itself. A participant could be registered with two protocols or no protocol at all, right?
Thanks,
jfmeng
Nitesh,
I got the following error when parsing the return result from matching a participant.
Error: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2
response = matchingParticipant(detail);
String responseString = response.getEntity(String.class);
System.out.println(responseString);
ParticipantDetail registeredParticipant = gson.fromJson(responseString, ParticipantDetail.class);
The return string is correct but when convert to object in the last line it gives the error. It seems that the return is an array which could not convert into participant object. Any idea?
The following is the return string:
[{“firstName”:“fname54”,“lastName”:“lname54”,“middleName”:null,“birthDate”:“1999-11-10”,“deathDate”:null,“gender”:null,“race”:[“White”,“Asian”],“vitalStatus”:null,“pmiCollection”:[{“siteName”:“z_Demo”,“mrn”:“z_Demo_054”}],“sexGenotype”:null,“ethnicity”:null,“ssn”:null,“activityStatus”:“Active”,“id”:12466}]
Hi @jmfeng,
This API supposed to return list of matching participants. For this you need to update the client code to handle the list and parse it accordingly.
So you need to replace the below line
ParticipantDetail registeredParticipant = gson.fromJson(responseString, ParticipantDetail.class);
with
Type type = new TypeToken<List<ParticipantDetail>>() {
}.getType();
List<ParticipantDetail> osSiteDetails = gson.fromJson(rString, type);
~Nitesh
There is an error with Type type = new TypeToken<List>() { }.getType();
Error: Missing type parameter.
Another problem is that I also need to match a collection protocol registration. But I did not find the REST API for this. Does it exist? If so please post an example code how to use it.
Thanks.