In most cases, just take a copy of the sample subset of the response you need, and wrap it in a general ?type? matcher (or if it?s an array, the `MinType` matcher). Any additional array elements are tested against the example
So for example, if the provider actually returns this:
```{
"resourceType": "Bundle",
"id": "60e1070e-f326-486d-a4c8-83efc1516366",
"meta": {
"lastUpdated": "2021-03-12T13:18:06.762+05:30"
},
"type": "searchset",
"total": 2,
"link": [
{
"relation": "self",
"url": "
https://10.167.167.97:44370/4.0/fhir/Patient?_format=json&_pretty=true&name-or-identifier=Austin%20E%20"
}
],
"entry": [
{
"fullUrl": "
https://10.167.167.97:44370/4.0/fhir/Patient/Patient-64851",
"resource": {
"resourceType": "Patient",
"id": "Patient-64851",
"meta": {
"versionId": "135436046",
"lastUpdated": "2008-04-24T13:16:51.060+05:30",
"profile": [
"
http://varian.com/fhir/v1/StructureDefinition/Patient"
],
"tag": [
{
"code": "DirectiveStatus",
"display": "Not Present"
},
{
"code": "AllergyStatus",
"display": "Not Present"
},
{
"code": "InfectionStatus",
"display": "Not Present"
}
]
},
"extension": [
{
"url": "
http://varian.com/fhir/v1/StructureDefinition/patient-status",
"valueCodeableConcept": {
"coding": [
{
"system": "
http://varian.com/fhir/CodeSystem/patient-status",
"code": "New Patient (NP)"
}
]
}
},
{
"url": "
http://varian.com/fhir/v1/StructureDefinition/patient-class",
"valueCodeableConcept": {
"coding": [
{
"system": "
http://varian.com/fhir/CodeSystem/patient-class",
"code": "Out Patient"
}
]
}
},
{
"url": "
http://varian.com/fhir/v1/StructureDefinition/recordedOn",
"valueDateTime": "2008-04-24T11:51:21+05:30"
},
{
"url": "
http://varian.com/fhir/v1/StructureDefinition/patient-clinicalTrial",
"valueBoolean": false
},
{
"url": "
http://varian.com/fhir/v1/StructureDefinition/patient-carePlan",
"valueReference": {
"reference": "CarePath/CarePath-50782",
"display": "Added Activities"
}
}
],
"identifier": [
{
"use": "usual",
"system": "
http://varian.com/fhir/identifier/Patient/ARIAID1",
"value": "771512730"
},
{
"system": "
http://varian.com/fhir/identifier/Patient/MedOnc-Id",
"value": "20580000000000038502"
},
{
"system": "
http://varian.com/fhir/identifier/Patient/RadOnc-Id",
"value": "64851"
},
{
"system": "
http://varian.com/fhir/identifier/Patient/patient-uid",
"value": "4.7.720.829.87.01.7592.45745.03478294955497"
},
{
"system": "
http://varian.com/fhir/identifier/Patient/SSN",
"value": "826403832"
},
{
"system": "
http://varian.com/fhir/identifier/Patient/ARIAID2",
"value": "PatientId264851"
}
],
"active": true,
"name": [
{
"use": "official",
"family": "Doernberg",
"given": [
"Austin E"
]
}
],
"telecom": [
{
"system": "phone",
"value": "024-988-0858",
"use": "home"
}
],
"gender": "male",
"birthDate": "1929-03-10",
"address": [
{
"id": "145187",
"extension": [
{
"url": "
http://varian.com/fhir/v1/StructureDefinition/address-telephone1",
"valueString": "947-157-6980"
}
],
"use": "home",
"type": "both",
"line": [
"673 Yofee Lv."
],
"city": "CityO145187",
"state": "Pa",
"postalCode": "73158"
}
],
"contact": [
{
"id": "29324",
"extension": [
{
"url": "
http://varian.com/fhir/v1/StructureDefinition/patient-contact-subrelation",
"valueString": "Cousin"
},
{
"url": "
http://varian.com/fhir/v1/StructureDefinition/patient-contact-isPrimary",
"valueBoolean": true
}
],
"relationship": [
{
"coding": [
{
"system": "
http://terminology.hl7.org/CodeSystem/v2-0131",
"code": "C",
"display": "Emergency Contact"
}
]
}
],
"name": {
"use": "official",
"family": "Orvosh",
"given": [
"Nicholas"
]
},
"telecom": [
{
"system": "phone",
"value": "093-317-4103",
"use": "home"
}
]
}
],
"managingOrganization": {
"reference": "Organization/Organization-Prov-1",
"display": "UTXG Fayied Iewyed"
}
},
"search": {
"mode": "match"
}
},
{
"fullUrl": "
https://10.167.167.97:44370/4.0/fhir/Patient/Patient-12716",
"resource": {
"resourceType": "Patient",
"id": "Patient-12716",
"meta": {
"versionId": "135311015",
"lastUpdated": "2004-05-04T15:03:29.640+05:30",
"profile": [
"
http://varian.com/fhir/v1/StructureDefinition/Patient"
],
"tag": [
{
"code": "DirectiveStatus",
"display": "Not Present"
},
{
"code": "AllergyStatus",
"display": "Not Present"
},
{
"code": "InfectionStatus",
"display": "Not Present"
}
]
},
"extension": [
{
"url": "
http://hl7.org/fhir/us/core/StructureDefinition/us-core-race",
"extension": [
{
"url": "text",
"valueString": "White"
},
{
"url": "
http://varian.com/fhir/v1/StructureDefinition/isPrimary",
"valueBoolean": true
}
]
},
{
"url": "
http://hl7.org/fhir/StructureDefinition/patient-citizenship",
"extension": [
{
"url": "code",
"valueCodeableConcept": {
"coding": [
{
"system": "
http://varian.com/fhir/CodeSystem/patient-citizenship",
"code": "USA",
"display": "United States"
}
]
}
}
]
},
{
"url": "
http://varian.com/fhir/v1/StructureDefinition/patient-status",
"valueCodeableConcept": {
"coding": [
{
"system": "
http://varian.com/fhir/CodeSystem/patient-status",
"code": "New Patient (NP)"
}
]
}
},
{
"url": "
http://varian.com/fhir/v1/StructureDefinition/patient-class",
"valueCodeableConcept": {
"coding": [
{
"system": "
http://varian.com/fhir/CodeSystem/patient-class",
"code": "Out Patient"
}
]
}
},
{
"url": "
http://varian.com/fhir/v1/StructureDefinition/recordedOn",
"valueDateTime": "2003-12-15T15:41:32+05:30"
},
{
"url": "
http://varian.com/fhir/v1/StructureDefinition/patient-clinicalTrial",
"valueBoolean": false
},
{
"url": "
http://varian.com/fhir/v1/StructureDefinition/patient-carePlan",
"valueReference": {
"reference": "CarePath/CarePath-10936",
"display": "Tmpl10936"
}
}
],
"identifier": [
{
"use": "usual",
"system": "
http://varian.com/fhir/identifier/Patient/ARIAID1",
"value": "330307229"
},
{
"system": "
http://varian.com/fhir/identifier/Patient/ARIAID2",
"value": "DJB"
},
{
"system": "
http://varian.com/fhir/identifier/Patient/MedOnc-Id",
"value": "70190000000000009107"
},
{
"system": "
http://varian.com/fhir/identifier/Patient/RadOnc-Id",
"value": "12716"
},
{
"system": "
http://varian.com/fhir/identifier/Patient/patient-uid",
"value": "6.1.927.146.99.86.3321.69652.01141691677049"
},
{
"system": "
http://varian.com/fhir/identifier/Patient/SSN",
"value": "945875123"
}
],
"active": true,
"name": [
{
"use": "official",
"family": "Yates",
"given": [
"Austin E"
]
}
],
"telecom": [
{
"system": "phone",
"value": "172P495-5173",
"use": "work"
},
{
"system": "phone",
"value": "844-391-2085",
"use": "home"
}
],
"gender": "female",
"birthDate": "1956-01-24",
"address": [
{
"id": "15799",
"use": "home",
"type": "both",
"line": [
"429 Oeepxoor Vn."
],
"city": "CityO15799",
"state": "Pa",
"postalCode": "21201",
"country": "USA"
}
],
"managingOrganization": {
"reference": "Organization/Organization-Prov-1",
"display": "UTXG Fayied Iewyed"
}
},
"search": {
"mode": "match"
}
}
]```
but all you care about is
```{
"resourceType": "Bundle",
"id": "60e1070e-f326-486d-a4c8-83efc1516366",
"link": [
{
"relation": "self",
"url": "
https://10.167.167.97:44370/4.0/fhir/Patient?_format=json&_pretty=true&name-or-identifier=Austin%20E%20"
}
],
"entry": [
{
"fullUrl": "
https://10.167.167.97:44370/4.0/fhir/Patient/Patient-64851",
"resource": {
"resourceType": "Patient",
"id": "Patient-64851",
"meta": {
"versionId": "135436046",
"lastUpdated": "2008-04-24T13:16:51.060+05:30",
"profile": [
"
http://varian.com/fhir/v1/StructureDefinition/Patient"
],
"tag": [
{
"code": "DirectiveStatus",
"display": "Not Present"
}
]
},
"active": true
},
"search": {
"mode": "match"
}
}
]
}```