• FEATURES
  • PRICING
  • MARKETPLACE
  • CASE STUDIES
  • BLOG
  • Adding new fields to the search filters

    Hello,

    I am trying to add DoB field to the participant search by altering json files:

    "filters" : [ {
    "filters" : [ {
      "expr" : "Participant.ppid",
      "caption" : "PPID",
      "searchType" : "contains"
    }, {
      "expr" : "Participant.regDate",
      "caption" : "Registration Date"
    }, {
      "expr" : "Participant.dateOfBirth",
      "caption" : "Date of Birth",
    

    I was able to add/ remove fields using the same strategy so I am wondering what is going wrong??

    I’m using the 6.3R2 Version.

    Many thanks,
    Andreia

    The following error comes up: “Invalid request. Please consult API docs for more detail on API usage (COMMON_INVALID_REQUEST”

    Hi @Andreia_Silva,

    Below are the issues in your above code snippet.

    1. Added an extra comma after “caption” : "Date of Birth"
    2. Missed to close the curly bracket in the last line
    3. added the “filters” : [ { two times.

    You can use the online JSON validator to identify the errors like the missing comma, brackets, etc.

    If you are still not able to figure out the issue then send us the complete JSON file.

    Thanks,
    Tushar

    Thank you so much Tushar.Very much appreciated.

    The DOB field appears on the search now. However, it comes up with with 2 fields: Min date of birth and Max date of birth. How can I just have one DOB field where we search one date only? Can I change that or is a setting/format that can’t be changed?

    Filters%20OS

    Many thanks,
    Andreia

    Hi @Andreia_Silva,

    There is no way to add the single field in filter for date and the integer type fields. It will default come up with the range.

    The advantage of the range is, you can search the particular date of birth or you can search the date of birth in range. (See the below screenshot)

    Thanks,
    Tushar

    Thank you. It is still very helpful adding that field to the filters.

    I was reading your wikipages and found out it is possible to restrict registration dropdown to CP sites (our version if 6.2R3 and therefore it is still not possible to do the same for the visit sites).

    I used the following script:

    }, {
    “name” : “cpr.participant.pmis”,
    “type” : “collection”,
    “fields” : [ {
    “name” : “siteName”,
    “caption” : “Site (Referring Hospital)”,
    “type” : “dropdown”,
    “multiple” : false,
    “optional” : false,
    “listSource” : {
    “apiUrl” : “collection-protocols/{{cp.id}}/sites”,
    “displayProp” : “name”,
    “selectProp” : “name”,
    “queryParams” : {
    “dynamic” : {
    “operation” : “op”
    },
    “static” : {
    “resource” : “ParticipantPhi”
    },
    “search” : “name”
    }
    }
    }

    However, it comes up with the error:
    image

    I am not sure what is going wrong.

    Many thanks,
    Andreia

    Hi,

    I am also wondering if the Visit Date can be added to the filters:

    }, {
      "expr" : "visit.visitDate",
      "caption" : "Visit Date".
    

    The field comes up as invalid:

    image

    Many thanks,
    Andreia

    Hi @Andreia_Silva,

    Sorry for the delayed response. Please find my answers below.

    Registration site restriction:

    Only visit and registration sites can be configured to restrict to CP sites. The visit site configuration is supported in v7.0. Refer to this Wiki page for more details.

    The code you mentioned is the MRN site code, which cannot be restricted to CP sites as of now, we will support this in the future versions.

    Visit Date :
    Are you trying to add the visit date on the participant list view page filter? If yes, then it is not supported. Only participant fields can be configured on the participant-list view page.

    Please refer to the Wiki page to configure the list-view pages.

    Thanks,
    Tushar