Hello,
For my project I have a JSON feeder. I call the feeder and get a random record, so the feeder works.
However; the application that I need to check has users, and connected to these users are patients. Each user has multiple patients. For now I have a record with one user and one patient, so as you expect (and like me dislike), I have multiple records with the same user.
I have tried to nest the patients within the user record with another array, but this doesn’t seem to work.
The question is, is it possible, to randomly select a user (seems to work), and then randomly select a patient from that user record?
I have here the JSON lay out. The first one is the current situation, and the second one is my preferred situation, that doesn’t give me an answer.
CURRENT
[
{
"username": "UserA",
"agendaID": AgendaA_ID,
"patientID": PatientX_ID,
"patientID64": "PatientX_ID64"
},
{
"username": "UserA",
"agendaID": AgendaA_ID,
"patientID": PatientY_ID,
"patientID64": "PatientY_ID64"
},
{
"username": "UserB",
"agendaID": AgendaB_ID,
"patientID": PatientZ_ID,
"patientID64": "PatientZ_ID64"
}
]
PREFERRED
[
{
"username": "UserA",
"agendaID": AgendaA_ID,
"patients": [
{
"patientID": PatientX_ID,
"patientID64": "PatientX_ID64"
},
{
"patientID": PatientY_ID,
"patientID64": "PatientY_ID64"
},
]
},
{
"username": "UserB",
"agendaID": AgendaB_ID,
"patientID": PatientZ_ID,
"patientID64": "PatientZ_ID64"
}
]