Может ли кто-нибудь указать мне правильное направление для написания теста в Postman, чтобы проверить наличие определенного ключа или значения из следующего ответа. В ответе много вложенных объектов. В частности, я хочу проверить следующее:
- Я хочу подтвердить, что в output.treatments есть ключ «type» со значением «Diet»
- , и я также хочу чтобы убедиться, что в output.treatments.details есть ключ «name» со значением «SULFAMETHOXAZOLE / TRIMETHOPRIM»
Спасибо!
Ответ API выглядит следующим образом:
{
"additionalInformation": {
"knownDrugAllergies": [],
"knownDrugConflicts": [
{
"conflict": "OXYBUTYNIN CHLORIDE",
"potentialDrugs": [
"item1",
"item2"
]
}
],
"knownPrecautionConflicts": [
{
"conflict": "OXYBUTYNIN CHLORIDE",
"potentialDrugs": [
"Drowsy",
"Gastroesophageal Reflux",
"Myasthenia Gravis",
"Parkinsonism",
"Ulcerative Colitis"
]
}
]
},
"output": [
{
"icdCode": "N39.3",
"icdDesc": "Stress incontinence (female) (male)",
"isIllness": true,
"treatments": [
{
"details": [],
"type": "Physical Exam"
},
{
"details": [
{
"directions": [],
"dosage": "",
"groupName": "Group Placeholder",
"longName": "Normal Diet",
"name": "Normal Diet",
"nameDetails": "The patient has no dietary restrictions",
"priority": 16,
"rank": 1,
"reasons": [],
"sources": [
[
"TEST",
"https://google.com"
],
[
"TEST",
"https://google.com"
]
]
}
],
"type": "Diet"
},
{
"details": [
{
"directions": [],
"dosage": "",
"groupName": "Group Placeholder",
"longName": "No Restrictions",
"name": "No Restrictions",
"nameDetails": "The patient has no activity restrictions",
"priority": 16,
"rank": 1,
"reasons": [],
"sources": [
[
"TEST",
"https://google.com"
],
[
"TEST",
"https://google.com"
]
]
}
],
"type": "Activity"
},
{
"details": [
{
"directions": [],
"dosage": "",
"groupName": "Group Placeholder",
"longName": "None Needed ",
"name": "None Needed",
"nameDetails": "No physical therapy is needed.",
"priority": 20,
"rank": 1,
"reasons": [],
"sources": [
[
"TEST",
"https://google.com"
],
[
"TEST",
"https://google.com"
]
]
}
],
"type": "Physical Therapy"
},
{
"details": [
{
"directions": [],
"dosage": "",
"groupName": "Group Placeholder",
"longName": "Kegel Exercises",
"name": "Kegel Exercises",
"nameDetails": "INCOMPLETE",
"priority": 20,
"rank": 1,
"reasons": [],
"sources": [
[
"TEST",
"https://google.com"
],
[
"TEST",
"https://google.com"
]
]
}
],
"type": "Counseling"
},
{
"details": [
{
"directions": [],
"dosage": "",
"groupName": "Group Placeholder",
"longName": "Patient Can Resume Work/School Immediately",
"name": "Immediately",
"nameDetails": "Patient Can Resume Work/School Immediately",
"priority": 8,
"rank": 1,
"reasons": [],
"sources": [
[
"TEST",
"https://google.com"
],
[
"TEST",
"https://google.com"
]
]
}
],
"type": "Return to Work/School Status"
},
{
"details": [
{
"directions": [],
"dosage": "",
"groupName": "Group Placeholder",
"longName": "Wound Care Not Needed",
"name": "Not Needed",
"nameDetails": "Wound Care Not Needed",
"priority": 20,
"rank": 1,
"reasons": [],
"sources": [
[
"TEST",
"https://google.com"
],
[
"TEST",
"https://google.com"
]
]
}
],
"type": "Wound Care"
},
{
"details": [
{
"directions": [],
"dosage": "",
"groupName": "Group Placeholder",
"longName": "Urine Analysis",
"name": "Urine Analysis",
"nameDetails": "Evaluate the urine for electrolytes and pH.",
"priority": 20,
"rank": 1,
"reasons": [],
"sources": [
[
"TEST",
"https://google.com"
]
]
}
],
"type": "Labs"
},
{
"details": [
{
"directions": [],
"dosage": "",
"groupName": "Group Placeholder",
"longName": "Specialist Consultation",
"name": "Specialist Consult",
"nameDetails": "The patient should consult with a specialist in the appropriate field.",
"priority": 29,
"rank": 1,
"reasons": [],
"sources": [
[
"TEST",
"https://google.com"
]
]
}
],
"type": "Discharge Disposition"
},
{
"details": [
{
"directions": [],
"dosage": "",
"groupName": "Group 2",
"longName": "placeholder",
"name": "DULOXETINE HCL",
"nameDetails": "Name Details Placeholder",
"priority": 20,
"protocol": [
"example"
],
"rank": 1,
"reasons": [],
"sources": [
[
"TEST",
"https://google.com"
]
]
},
{
"directions": [],
"dosage": "",
"groupName": "Standard",
"longName": "placeholder",
"name": "SULFAMETHOXAZOLE/TRIMETHOPRIM",
"nameDetails": "Name Details Placeholder",
"priority": 20,
"protocol": [
"example"
],
"rank": 3,
"reasons": [],
"sources": [
[
"TEST",
"https://google.com"
]
]
},
{
"directions": [],
"dosage": "",
"groupName": "Standard",
"longName": "placeholder",
"name": "TOLTERODINE TARTRATE",
"nameDetails": "Name Details Placeholder",
"priority": 20,
"protocol": [
"example"
],
"rank": 1,
"reasons": [],
"sources": [
[
"no sources",
"no URL"
]
]
}
],
"type": "Prescription Drugs"
},
{
"details": [
{
"directions": [],
"dosage": "",
"groupName": "Standard",
"longName": "placeholder",
"name": "OXYBUTYNIN",
"nameDetails": "Name Details Placeholder",
"priority": 20,
"protocol": [
"example"
],
"rank": 2,
"reasons": [],
"sources": [
[
"TEST",
"https://google.com"
]
]
}
],
"type": "OTC Drugs"
}
]
}
],
"status": "Complete",
"version": 3
}