Created
January 14, 2016 04:41
-
-
Save ameyawebonise/263b41eda0de901d3e62 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"compliance" : "BOTH", | |
"who" : [ { | |
"lhs" : { | |
"type" : "AllTrackers" | |
}, | |
"operator" : null, | |
"rhs" : [ ] | |
} ], | |
"what" : [ { | |
"type" : "Expression", | |
"requirement" : { | |
"type" : "TrackerItem", | |
"id" : 4495 | |
}, | |
"field" : "SMART_FIELDS", | |
"operator" : "VHR_FIELDS_DRILLDOWN_OPERATOR", | |
"values" : [ {"questionId":"1","answer":"1","questionId":"3","answer":"2"} ] | |
} ] | |
} | |
} |
the above JSON is incorrect.we dont need the values as a map of sectionId:List.
{
"searchTerms": {
"who": [
{
"lhs": {
"type": "AllTrackers"
},
"operator": null,
"rhs": [
]
}
],
"what": [
{
"type": "And",
"expressions": [
{
"type": "Expression",
"requirement": {
"type": "TrackerItem",
"id": 4491
},
"field": "SMART_FIELDS",
"operator": "VHR_FIELDS_DRILLDOWN_OPERATOR",
"values":[{"questionId":500,"answer":1},{"questionId":26,"answer":1}]
},
{
"type": "Expression",
"requirement": {
"type": "AnyTrackerItem"
},
"field": "NEXT_ACTION_DATE",
"operator": "EQUALS",
"values": [
"2016-01-06"
]
},
{
"type": "Expression",
"requirement": {
"type": "TrackerItem",
"id": 4491
},
"field": "SMART_FIELDS",
"operator": "VHR_FIELDS_DRILLDOWN_OPERATOR",
"values": {
"6": {
"questions": [
{
"questionId": 500,
"sectionId": 6,
"questionName": "Do you have an Epi Pen for this allergy?",
"widgetId": 18,
"questionHelp": null,
"answer": true
},
{
"questionId": 26,
"sectionId": 6,
"questionName": "Do you have any Allergies",
"widgetId": 20,
"questionHelp": null,
"answer": true
}
],
"sectionName": "Allergies"
}
}
}
]
}
],
"compliance": "BOTH"
},
"name": "test",
"shared": false
}
the json posted above is correct.We need values to be a List<QuestionAnswerMapping>
where QuestionAnswerMapping is as follows:
public class QuestionAnswerMapping{ int questionId; //question id chosen for filter int answer; //answer = 1 if yes 2 if no }
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please see the below json i have created and passing
{
"searchTerms": {
"who": [
{
"lhs": {
"type": "AllTrackers"
},
"operator": null,
"rhs": [
},
"name": "test",
"shared": false
}