Summary| Tags| Feature: allergy/allergy.feature| AllergyIntolerance Resource Validation
Scenario: [1:25] TC-ALG-001 | REQ-ALG-001 GET /AllergyIntolerance/{id} returns 200 and resourceType = AllergyIntolerance
ms: 9882
>>
Background:
14
* url baseUrl
1
21:54:42.929 baseUrl: https://hapi.fhir.org/baseR4 21:54:42.929 fhirVersion: 4.0.1
15
Given path 'AllergyIntolerance'
0
16
And params ({ 'patient:missing': 'false', '_count': '1' })
7
17
When method GET
4857
21:54:43.375 request: 1 > GET https://hapi.fhir.org/baseR4/AllergyIntolerance?patient%3Amissing=false&_count=1 1 > Host: hapi.fhir.org 1 > Connection: Keep-Alive 1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 1 > Accept-Encoding: gzip,deflate 21:54:47.818 response time in milliseconds: 4441 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:54:47 GMT 1 < Content-Type: application/fhir+json;charset=utf-8 1 < Transfer-Encoding: chunked 1 < Connection: keep-alive 1 < X-Cache: HIT from https://hapi.fhir.org/baseR4 1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 1 < X-Request-ID: sNh8zS1Dj9PTDmPu 1 < Last-Modified: Tue, 21 Apr 2026 21:54:43 GMT { "resourceType": "Bundle", "id": "13cf20f5-018f-4c68-baa5-8acef1192e95", "meta": { "lastUpdated": "2026-04-21T21:54:43.781+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/AllergyIntolerance?_count=1&patient%3Amissing=false" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=13cf20f5-018f-4c68-baa5-8acef1192e95&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/AllergyIntolerance/pharyngitis-traj1-allergy-v1", "resource": { "resourceType": "AllergyIntolerance", "id": "pharyngitis-traj1-allergy-v1", "meta": { "versionId": "7", "lastUpdated": "2026-02-22T23:14:57.613+00:00", "source": "#ABVxnhWJC6Bqf10P" }, "clinicalStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical", "code": "active" } ] }, "verificationStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification", "code": "confirmed" } ] }, "type": "allergy", "category": [ "medication" ], "criticality": "high", "code": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ], "text": "Penicillin" }, "patient": { "reference": "Patient/pharyngitis-traj1-pt-v1" }, "note": [ { "text": "Father reports penicillin allergy at age 2 with hives requiring ER visit. Contraindicates all penicillin-class antibiotics including amoxicillin." } ], "reaction": [ { "substance": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ] }, "manifestation": [ { "coding": [ { "system": "http://snomed.info/sct", "code": "126485001", "display": "Urticaria" } ], "text": "Hives" } ], "description": "Developed generalized hives at age 2, required ER visit", "severity": "moderate" } ] }, "search": { "mode": "match" } } ] }
18
Then status 200
0
19
* def hasEntry = response.entry != null && response.entry.length > 0
1
20
* match hasEntry == true
1
21
* def allergyId = response.entry[0].resource.id
1
22
* match response.entry[0].resource.resourceType == 'AllergyIntolerance'
1
23
* karate.log('Resolved allergyId: ' + allergyId)
1
21:54:47.826 Resolved allergyId: pharyngitis-traj1-allergy-v1
26
Given path 'AllergyIntolerance', allergyId
1
27
When method GET
4977
21:54:47.828 request: 2 > GET https://hapi.fhir.org/baseR4/AllergyIntolerance/pharyngitis-traj1-allergy-v1 2 > Host: hapi.fhir.org 2 > Connection: Keep-Alive 2 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 2 > Accept-Encoding: gzip,deflate 21:54:52.803 response time in milliseconds: 4975 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:54:52 GMT 2 < Content-Type: application/fhir+json;charset=utf-8 2 < Transfer-Encoding: chunked 2 < Connection: keep-alive 2 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 2 < ETag: W/"7" 2 < X-Request-ID: DdIEQDnEi0S5oaae 2 < Content-Location: https://hapi.fhir.org/baseR4/AllergyIntolerance/pharyngitis-traj1-allergy-v1/_history/7 2 < Last-Modified: Sun, 22 Feb 2026 23:14:57 GMT { "resourceType": "AllergyIntolerance", "id": "pharyngitis-traj1-allergy-v1", "meta": { "versionId": "7", "lastUpdated": "2026-02-22T23:14:57.613+00:00", "source": "#ABVxnhWJC6Bqf10P" }, "clinicalStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical", "code": "active" } ] }, "verificationStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification", "code": "confirmed" } ] }, "type": "allergy", "category": [ "medication" ], "criticality": "high", "code": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ], "text": "Penicillin" }, "patient": { "reference": "Patient/pharyngitis-traj1-pt-v1" }, "note": [ { "text": "Father reports penicillin allergy at age 2 with hives requiring ER visit. Contraindicates all penicillin-class antibiotics including amoxicillin." } ], "reaction": [ { "substance": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ] }, "manifestation": [ { "coding": [ { "system": "http://snomed.info/sct", "code": "126485001", "display": "Urticaria" } ], "text": "Hives" } ], "description": "Developed generalized hives at age 2, required ER visit", "severity": "moderate" } ] }
28
Then status 200
0
29
And assert responseTime < 10000
6
30
And match responseHeaders['Content-Type'][0] contains 'application/fhir+json'
1
31
And match responseHeaders['ETag'][0] == '#present'
1
32
And match response.resourceType == 'AllergyIntolerance'
1
33
* karate.write(response, 'responses/allergy/allergy-read.json')
24
21:54:52.837 write to file: target/responses/allergy/allergy-read.json
Scenario: [2:35] TC-ALG-002 | REQ-ALG-002 clinicalStatus.coding[0].code is active inactive or resolved
ms: 6854
>>
Background:
14
* url baseUrl
1
21:54:42.923 baseUrl: https://hapi.fhir.org/baseR4 21:54:42.924 fhirVersion: 4.0.1
15
Given path 'AllergyIntolerance'
0
16
And params ({ 'patient:missing': 'false', '_count': '1' })
7
17
When method GET
1860
21:54:43.376 request: 1 > GET https://hapi.fhir.org/baseR4/AllergyIntolerance?patient%3Amissing=false&_count=1 1 > Host: hapi.fhir.org 1 > Connection: Keep-Alive 1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 1 > Accept-Encoding: gzip,deflate 21:54:44.821 response time in milliseconds: 1444 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:54:44 GMT 1 < Content-Type: application/fhir+json;charset=utf-8 1 < Transfer-Encoding: chunked 1 < Connection: keep-alive 1 < X-Cache: HIT from https://hapi.fhir.org/baseR4 1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 1 < X-Request-ID: vDkjYdhNUDq7dNTw 1 < Last-Modified: Tue, 21 Apr 2026 21:54:43 GMT { "resourceType": "Bundle", "id": "13cf20f5-018f-4c68-baa5-8acef1192e95", "meta": { "lastUpdated": "2026-04-21T21:54:43.781+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/AllergyIntolerance?_count=1&patient%3Amissing=false" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=13cf20f5-018f-4c68-baa5-8acef1192e95&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/AllergyIntolerance/pharyngitis-traj1-allergy-v1", "resource": { "resourceType": "AllergyIntolerance", "id": "pharyngitis-traj1-allergy-v1", "meta": { "versionId": "7", "lastUpdated": "2026-02-22T23:14:57.613+00:00", "source": "#ABVxnhWJC6Bqf10P" }, "clinicalStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical", "code": "active" } ] }, "verificationStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification", "code": "confirmed" } ] }, "type": "allergy", "category": [ "medication" ], "criticality": "high", "code": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ], "text": "Penicillin" }, "patient": { "reference": "Patient/pharyngitis-traj1-pt-v1" }, "note": [ { "text": "Father reports penicillin allergy at age 2 with hives requiring ER visit. Contraindicates all penicillin-class antibiotics including amoxicillin." } ], "reaction": [ { "substance": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ] }, "manifestation": [ { "coding": [ { "system": "http://snomed.info/sct", "code": "126485001", "display": "Urticaria" } ], "text": "Hives" } ], "description": "Developed generalized hives at age 2, required ER visit", "severity": "moderate" } ] }, "search": { "mode": "match" } } ] }
18
Then status 200
0
19
* def hasEntry = response.entry != null && response.entry.length > 0
2
20
* match hasEntry == true
1
21
* def allergyId = response.entry[0].resource.id
1
22
* match response.entry[0].resource.resourceType == 'AllergyIntolerance'
2
23
* karate.log('Resolved allergyId: ' + allergyId)
1
21:54:44.831 Resolved allergyId: pharyngitis-traj1-allergy-v1
36
Given path 'AllergyIntolerance', allergyId
1
37
When method GET
4973
21:54:44.833 request: 2 > GET https://hapi.fhir.org/baseR4/AllergyIntolerance/pharyngitis-traj1-allergy-v1 2 > Host: hapi.fhir.org 2 > Connection: Keep-Alive 2 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 2 > Accept-Encoding: gzip,deflate 21:54:49.804 response time in milliseconds: 4970 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:54:49 GMT 2 < Content-Type: application/fhir+json;charset=utf-8 2 < Transfer-Encoding: chunked 2 < Connection: keep-alive 2 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 2 < ETag: W/"7" 2 < X-Request-ID: 06rPdAxVEowlf5Eh 2 < Content-Location: https://hapi.fhir.org/baseR4/AllergyIntolerance/pharyngitis-traj1-allergy-v1/_history/7 2 < Last-Modified: Sun, 22 Feb 2026 23:14:57 GMT { "resourceType": "AllergyIntolerance", "id": "pharyngitis-traj1-allergy-v1", "meta": { "versionId": "7", "lastUpdated": "2026-02-22T23:14:57.613+00:00", "source": "#ABVxnhWJC6Bqf10P" }, "clinicalStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical", "code": "active" } ] }, "verificationStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification", "code": "confirmed" } ] }, "type": "allergy", "category": [ "medication" ], "criticality": "high", "code": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ], "text": "Penicillin" }, "patient": { "reference": "Patient/pharyngitis-traj1-pt-v1" }, "note": [ { "text": "Father reports penicillin allergy at age 2 with hives requiring ER visit. Contraindicates all penicillin-class antibiotics including amoxicillin." } ], "reaction": [ { "substance": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ] }, "manifestation": [ { "coding": [ { "system": "http://snomed.info/sct", "code": "126485001", "display": "Urticaria" } ], "text": "Hives" } ], "description": "Developed generalized hives at age 2, required ER visit", "severity": "moderate" } ] }
38
Then status 200
0
39
And match response.clinicalStatus == '#present'
1
40
And match response.clinicalStatus.coding == '#[_ > 0]'
2
41
And match response.clinicalStatus.coding[0].code == '#regex (active|inactive|resolved)'
1
42
* karate.log('clinicalStatus: ' + response.clinicalStatus.coding[0].code)
1
21:54:49.812 clinicalStatus: active
Scenario: [3:44] TC-ALG-003 | REQ-ALG-003 verificationStatus is present
ms: 8853
>>
Background:
14
* url baseUrl
1
21:54:42.923 baseUrl: https://hapi.fhir.org/baseR4 21:54:42.923 fhirVersion: 4.0.1
15
Given path 'AllergyIntolerance'
1
16
And params ({ 'patient:missing': 'false', '_count': '1' })
8
17
When method GET
3854
21:54:43.375 request: 1 > GET https://hapi.fhir.org/baseR4/AllergyIntolerance?patient%3Amissing=false&_count=1 1 > Host: hapi.fhir.org 1 > Connection: Keep-Alive 1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 1 > Accept-Encoding: gzip,deflate 21:54:46.816 response time in milliseconds: 3440 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:54:46 GMT 1 < Content-Type: application/fhir+json;charset=utf-8 1 < Transfer-Encoding: chunked 1 < Connection: keep-alive 1 < X-Cache: HIT from https://hapi.fhir.org/baseR4 1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 1 < X-Request-ID: pDvdb9VwtU2q3FDJ 1 < Last-Modified: Tue, 21 Apr 2026 21:54:43 GMT { "resourceType": "Bundle", "id": "13cf20f5-018f-4c68-baa5-8acef1192e95", "meta": { "lastUpdated": "2026-04-21T21:54:43.781+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/AllergyIntolerance?_count=1&patient%3Amissing=false" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=13cf20f5-018f-4c68-baa5-8acef1192e95&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/AllergyIntolerance/pharyngitis-traj1-allergy-v1", "resource": { "resourceType": "AllergyIntolerance", "id": "pharyngitis-traj1-allergy-v1", "meta": { "versionId": "7", "lastUpdated": "2026-02-22T23:14:57.613+00:00", "source": "#ABVxnhWJC6Bqf10P" }, "clinicalStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical", "code": "active" } ] }, "verificationStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification", "code": "confirmed" } ] }, "type": "allergy", "category": [ "medication" ], "criticality": "high", "code": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ], "text": "Penicillin" }, "patient": { "reference": "Patient/pharyngitis-traj1-pt-v1" }, "note": [ { "text": "Father reports penicillin allergy at age 2 with hives requiring ER visit. Contraindicates all penicillin-class antibiotics including amoxicillin." } ], "reaction": [ { "substance": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ] }, "manifestation": [ { "coding": [ { "system": "http://snomed.info/sct", "code": "126485001", "display": "Urticaria" } ], "text": "Hives" } ], "description": "Developed generalized hives at age 2, required ER visit", "severity": "moderate" } ] }, "search": { "mode": "match" } } ] }
18
Then status 200
0
19
* def hasEntry = response.entry != null && response.entry.length > 0
2
20
* match hasEntry == true
1
21
* def allergyId = response.entry[0].resource.id
1
22
* match response.entry[0].resource.resourceType == 'AllergyIntolerance'
1
23
* karate.log('Resolved allergyId: ' + allergyId)
1
21:54:46.824 Resolved allergyId: pharyngitis-traj1-allergy-v1
45
Given path 'AllergyIntolerance', allergyId
1
46
When method GET
4979
21:54:46.827 request: 2 > GET https://hapi.fhir.org/baseR4/AllergyIntolerance/pharyngitis-traj1-allergy-v1 2 > Host: hapi.fhir.org 2 > Connection: Keep-Alive 2 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 2 > Accept-Encoding: gzip,deflate 21:54:51.804 response time in milliseconds: 4976 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:54:51 GMT 2 < Content-Type: application/fhir+json;charset=utf-8 2 < Transfer-Encoding: chunked 2 < Connection: keep-alive 2 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 2 < ETag: W/"7" 2 < X-Request-ID: N5EE5xjM5IeYPOCf 2 < Content-Location: https://hapi.fhir.org/baseR4/AllergyIntolerance/pharyngitis-traj1-allergy-v1/_history/7 2 < Last-Modified: Sun, 22 Feb 2026 23:14:57 GMT { "resourceType": "AllergyIntolerance", "id": "pharyngitis-traj1-allergy-v1", "meta": { "versionId": "7", "lastUpdated": "2026-02-22T23:14:57.613+00:00", "source": "#ABVxnhWJC6Bqf10P" }, "clinicalStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical", "code": "active" } ] }, "verificationStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification", "code": "confirmed" } ] }, "type": "allergy", "category": [ "medication" ], "criticality": "high", "code": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ], "text": "Penicillin" }, "patient": { "reference": "Patient/pharyngitis-traj1-pt-v1" }, "note": [ { "text": "Father reports penicillin allergy at age 2 with hives requiring ER visit. Contraindicates all penicillin-class antibiotics including amoxicillin." } ], "reaction": [ { "substance": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ] }, "manifestation": [ { "coding": [ { "system": "http://snomed.info/sct", "code": "126485001", "display": "Urticaria" } ], "text": "Hives" } ], "description": "Developed generalized hives at age 2, required ER visit", "severity": "moderate" } ] }
47
Then status 200
0
48
And match response.verificationStatus == '#present'
2
49
* karate.log('verificationStatus: ' + response.verificationStatus.coding[0].code)
1
21:54:51.808 verificationStatus: confirmed
Scenario: [4:51] TC-ALG-004 | REQ-ALG-004 patient reference is present
ms: 7854
>>
Background:
14
* url baseUrl
2
21:54:42.927 baseUrl: https://hapi.fhir.org/baseR4 21:54:42.927 fhirVersion: 4.0.1
15
Given path 'AllergyIntolerance'
0
16
And params ({ 'patient:missing': 'false', '_count': '1' })
6
17
When method GET
2858
21:54:43.376 request: 1 > GET https://hapi.fhir.org/baseR4/AllergyIntolerance?patient%3Amissing=false&_count=1 1 > Host: hapi.fhir.org 1 > Connection: Keep-Alive 1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 1 > Accept-Encoding: gzip,deflate 21:54:45.818 response time in milliseconds: 2441 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:54:45 GMT 1 < Content-Type: application/fhir+json;charset=utf-8 1 < Transfer-Encoding: chunked 1 < Connection: keep-alive 1 < X-Cache: HIT from https://hapi.fhir.org/baseR4 1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 1 < X-Request-ID: 09rIckgG9lunVTLL 1 < Last-Modified: Tue, 21 Apr 2026 21:54:43 GMT { "resourceType": "Bundle", "id": "13cf20f5-018f-4c68-baa5-8acef1192e95", "meta": { "lastUpdated": "2026-04-21T21:54:43.781+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/AllergyIntolerance?_count=1&patient%3Amissing=false" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=13cf20f5-018f-4c68-baa5-8acef1192e95&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/AllergyIntolerance/pharyngitis-traj1-allergy-v1", "resource": { "resourceType": "AllergyIntolerance", "id": "pharyngitis-traj1-allergy-v1", "meta": { "versionId": "7", "lastUpdated": "2026-02-22T23:14:57.613+00:00", "source": "#ABVxnhWJC6Bqf10P" }, "clinicalStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical", "code": "active" } ] }, "verificationStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification", "code": "confirmed" } ] }, "type": "allergy", "category": [ "medication" ], "criticality": "high", "code": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ], "text": "Penicillin" }, "patient": { "reference": "Patient/pharyngitis-traj1-pt-v1" }, "note": [ { "text": "Father reports penicillin allergy at age 2 with hives requiring ER visit. Contraindicates all penicillin-class antibiotics including amoxicillin." } ], "reaction": [ { "substance": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ] }, "manifestation": [ { "coding": [ { "system": "http://snomed.info/sct", "code": "126485001", "display": "Urticaria" } ], "text": "Hives" } ], "description": "Developed generalized hives at age 2, required ER visit", "severity": "moderate" } ] }, "search": { "mode": "match" } } ] }
18
Then status 200
0
19
* def hasEntry = response.entry != null && response.entry.length > 0
2
20
* match hasEntry == true
1
21
* def allergyId = response.entry[0].resource.id
1
22
* match response.entry[0].resource.resourceType == 'AllergyIntolerance'
1
23
* karate.log('Resolved allergyId: ' + allergyId)
1
21:54:45.826 Resolved allergyId: pharyngitis-traj1-allergy-v1
52
Given path 'AllergyIntolerance', allergyId
1
53
When method GET
4978
21:54:45.829 request: 2 > GET https://hapi.fhir.org/baseR4/AllergyIntolerance/pharyngitis-traj1-allergy-v1 2 > Host: hapi.fhir.org 2 > Connection: Keep-Alive 2 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 2 > Accept-Encoding: gzip,deflate 21:54:50.804 response time in milliseconds: 4975 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:54:50 GMT 2 < Content-Type: application/fhir+json;charset=utf-8 2 < Transfer-Encoding: chunked 2 < Connection: keep-alive 2 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 2 < ETag: W/"7" 2 < X-Request-ID: Bwph3J81mupvamxo 2 < Content-Location: https://hapi.fhir.org/baseR4/AllergyIntolerance/pharyngitis-traj1-allergy-v1/_history/7 2 < Last-Modified: Sun, 22 Feb 2026 23:14:57 GMT { "resourceType": "AllergyIntolerance", "id": "pharyngitis-traj1-allergy-v1", "meta": { "versionId": "7", "lastUpdated": "2026-02-22T23:14:57.613+00:00", "source": "#ABVxnhWJC6Bqf10P" }, "clinicalStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical", "code": "active" } ] }, "verificationStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification", "code": "confirmed" } ] }, "type": "allergy", "category": [ "medication" ], "criticality": "high", "code": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ], "text": "Penicillin" }, "patient": { "reference": "Patient/pharyngitis-traj1-pt-v1" }, "note": [ { "text": "Father reports penicillin allergy at age 2 with hives requiring ER visit. Contraindicates all penicillin-class antibiotics including amoxicillin." } ], "reaction": [ { "substance": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ] }, "manifestation": [ { "coding": [ { "system": "http://snomed.info/sct", "code": "126485001", "display": "Urticaria" } ], "text": "Hives" } ], "description": "Developed generalized hives at age 2, required ER visit", "severity": "moderate" } ] }
54
Then status 200
0
55
And match response.patient == '#present'
1
56
And match response.patient.reference == '#string'
1
57
* karate.log('patient reference: ' + response.patient.reference)
1
21:54:50.809 patient reference: Patient/pharyngitis-traj1-pt-v1
Scenario: [5:60] TC-ALG-005 | REQ-ALG-005 reaction manifestation coding present (conditional)
ms: 5866
>>
Background:
14
* url baseUrl
1
21:54:42.924 baseUrl: https://hapi.fhir.org/baseR4 21:54:42.925 fhirVersion: 4.0.1
15
Given path 'AllergyIntolerance'
1
16
And params ({ 'patient:missing': 'false', '_count': '1' })
7
17
When method GET
931
21:54:43.375 request: 1 > GET https://hapi.fhir.org/baseR4/AllergyIntolerance?patient%3Amissing=false&_count=1 1 > Host: hapi.fhir.org 1 > Connection: Keep-Alive 1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 1 > Accept-Encoding: gzip,deflate 21:54:43.873 response time in milliseconds: 494 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:54:43 GMT 1 < Content-Type: application/fhir+json;charset=utf-8 1 < Transfer-Encoding: chunked 1 < Connection: keep-alive 1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 1 < X-Request-ID: 7syFVNpUYCT7IWHY 1 < Last-Modified: Tue, 21 Apr 2026 21:54:43 GMT { "resourceType": "Bundle", "id": "13cf20f5-018f-4c68-baa5-8acef1192e95", "meta": { "lastUpdated": "2026-04-21T21:54:43.781+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/AllergyIntolerance?_count=1&patient%3Amissing=false" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=13cf20f5-018f-4c68-baa5-8acef1192e95&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/AllergyIntolerance/pharyngitis-traj1-allergy-v1", "resource": { "resourceType": "AllergyIntolerance", "id": "pharyngitis-traj1-allergy-v1", "meta": { "versionId": "7", "lastUpdated": "2026-02-22T23:14:57.613+00:00", "source": "#ABVxnhWJC6Bqf10P" }, "clinicalStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical", "code": "active" } ] }, "verificationStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification", "code": "confirmed" } ] }, "type": "allergy", "category": [ "medication" ], "criticality": "high", "code": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ], "text": "Penicillin" }, "patient": { "reference": "Patient/pharyngitis-traj1-pt-v1" }, "note": [ { "text": "Father reports penicillin allergy at age 2 with hives requiring ER visit. Contraindicates all penicillin-class antibiotics including amoxicillin." } ], "reaction": [ { "substance": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ] }, "manifestation": [ { "coding": [ { "system": "http://snomed.info/sct", "code": "126485001", "display": "Urticaria" } ], "text": "Hives" } ], "description": "Developed generalized hives at age 2, required ER visit", "severity": "moderate" } ] }, "search": { "mode": "match" } } ] }
18
Then status 200
0
19
* def hasEntry = response.entry != null && response.entry.length > 0
8
20
* match hasEntry == true
10
21
* def allergyId = response.entry[0].resource.id
1
22
* match response.entry[0].resource.resourceType == 'AllergyIntolerance'
12
23
* karate.log('Resolved allergyId: ' + allergyId)
4
21:54:43.928 Resolved allergyId: pharyngitis-traj1-allergy-v1
61
Given path 'AllergyIntolerance', allergyId
8
62
When method GET
4871
21:54:43.939 request: 2 > GET https://hapi.fhir.org/baseR4/AllergyIntolerance/pharyngitis-traj1-allergy-v1 2 > Host: hapi.fhir.org 2 > Connection: Keep-Alive 2 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 2 > Accept-Encoding: gzip,deflate 21:54:48.807 response time in milliseconds: 4867 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:54:48 GMT 2 < Content-Type: application/fhir+json;charset=utf-8 2 < Transfer-Encoding: chunked 2 < Connection: keep-alive 2 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 2 < ETag: W/"7" 2 < X-Request-ID: ux2TJsDCkv3B2cDM 2 < Content-Location: https://hapi.fhir.org/baseR4/AllergyIntolerance/pharyngitis-traj1-allergy-v1/_history/7 2 < Last-Modified: Sun, 22 Feb 2026 23:14:57 GMT { "resourceType": "AllergyIntolerance", "id": "pharyngitis-traj1-allergy-v1", "meta": { "versionId": "7", "lastUpdated": "2026-02-22T23:14:57.613+00:00", "source": "#ABVxnhWJC6Bqf10P" }, "clinicalStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical", "code": "active" } ] }, "verificationStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification", "code": "confirmed" } ] }, "type": "allergy", "category": [ "medication" ], "criticality": "high", "code": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ], "text": "Penicillin" }, "patient": { "reference": "Patient/pharyngitis-traj1-pt-v1" }, "note": [ { "text": "Father reports penicillin allergy at age 2 with hives requiring ER visit. Contraindicates all penicillin-class antibiotics including amoxicillin." } ], "reaction": [ { "substance": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ] }, "manifestation": [ { "coding": [ { "system": "http://snomed.info/sct", "code": "126485001", "display": "Urticaria" } ], "text": "Hives" } ], "description": "Developed generalized hives at age 2, required ER visit", "severity": "moderate" } ] }
63
Then status 200
0
64
* def hasReaction = response.reaction != null && response.reaction.length > 0
1
65
* if (!hasReaction) karate.log('TC-ALG-005: SKIP — no reaction element on resolved AllergyIntolerance ' + allergyId)
2
66
* if (hasReaction) karate.match(response.reaction[0].manifestation, '#[_ > 0]')
5
67
* if (hasReaction) karate.match(response.reaction[0].manifestation[0].coding, '#[_ > 0]')
2
68
* if (hasReaction) karate.log('reaction manifestation coding present')
1
21:54:48.821 reaction manifestation coding present
Scenario: [6:70] TC-ALG-006 | REQ-ALG-006 | REQ-OO-001 non-existent ID returns 404 and OperationOutcome
ms: 9983
>>
Background:
14
* url baseUrl
0
21:54:48.831 baseUrl: https://hapi.fhir.org/baseR4 21:54:48.831 fhirVersion: 4.0.1
15
Given path 'AllergyIntolerance'
0
16
And params ({ 'patient:missing': 'false', '_count': '1' })
1
17
When method GET
4986
21:54:48.834 request: 1 > GET https://hapi.fhir.org/baseR4/AllergyIntolerance?patient%3Amissing=false&_count=1 1 > Host: hapi.fhir.org 1 > Connection: Keep-Alive 1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 1 > Accept-Encoding: gzip,deflate 21:54:53.818 response time in milliseconds: 4983 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:54:53 GMT 1 < Content-Type: application/fhir+json;charset=utf-8 1 < Transfer-Encoding: chunked 1 < Connection: keep-alive 1 < X-Cache: HIT from https://hapi.fhir.org/baseR4 1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 1 < X-Request-ID: uSSCVeMmxtCpE7Ri 1 < Last-Modified: Tue, 21 Apr 2026 21:54:43 GMT { "resourceType": "Bundle", "id": "13cf20f5-018f-4c68-baa5-8acef1192e95", "meta": { "lastUpdated": "2026-04-21T21:54:43.781+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/AllergyIntolerance?_count=1&patient%3Amissing=false" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=13cf20f5-018f-4c68-baa5-8acef1192e95&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/AllergyIntolerance/pharyngitis-traj1-allergy-v1", "resource": { "resourceType": "AllergyIntolerance", "id": "pharyngitis-traj1-allergy-v1", "meta": { "versionId": "7", "lastUpdated": "2026-02-22T23:14:57.613+00:00", "source": "#ABVxnhWJC6Bqf10P" }, "clinicalStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical", "code": "active" } ] }, "verificationStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification", "code": "confirmed" } ] }, "type": "allergy", "category": [ "medication" ], "criticality": "high", "code": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ], "text": "Penicillin" }, "patient": { "reference": "Patient/pharyngitis-traj1-pt-v1" }, "note": [ { "text": "Father reports penicillin allergy at age 2 with hives requiring ER visit. Contraindicates all penicillin-class antibiotics including amoxicillin." } ], "reaction": [ { "substance": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ] }, "manifestation": [ { "coding": [ { "system": "http://snomed.info/sct", "code": "126485001", "display": "Urticaria" } ], "text": "Hives" } ], "description": "Developed generalized hives at age 2, required ER visit", "severity": "moderate" } ] }, "search": { "mode": "match" } } ] }
18
Then status 200
0
19
* def hasEntry = response.entry != null && response.entry.length > 0
1
20
* match hasEntry == true
1
21
* def allergyId = response.entry[0].resource.id
0
22
* match response.entry[0].resource.resourceType == 'AllergyIntolerance'
0
23
* karate.log('Resolved allergyId: ' + allergyId)
0
21:54:53.822 Resolved allergyId: pharyngitis-traj1-allergy-v1
71
Given path 'AllergyIntolerance', 'INVALID-ID-99999'
2
72
When method GET
4986
21:54:53.825 request: 2 > GET https://hapi.fhir.org/baseR4/AllergyIntolerance/INVALID-ID-99999 2 > Host: hapi.fhir.org 2 > Connection: Keep-Alive 2 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 2 > Accept-Encoding: gzip,deflate 21:54:58.809 response time in milliseconds: 4984 2 < 404 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:54:58 GMT 2 < Content-Type: application/fhir+json;charset=utf-8 2 < Transfer-Encoding: chunked 2 < Connection: keep-alive 2 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 2 < X-Request-ID: YTQlo77nUgROK8jp { "resourceType": "OperationOutcome", "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><tr><td style=\"font-weight: bold;\">ERROR</td><td>[]</td><td>HAPI-2001: Resource AllergyIntolerance/INVALID-ID-99999 is not known</td></tr></table></div>" }, "issue": [ { "severity": "error", "code": "processing", "diagnostics": "HAPI-2001: Resource AllergyIntolerance/INVALID-ID-99999 is not known" } ] }
73
Then status 404
0
74
And match response.resourceType == 'OperationOutcome'
1
75
And match response.issue == '#[_ > 0]'
2
76
* karate.log('404 severity: ' + response.issue[0].severity)
1
21:54:58.814 404 severity: error
77
* karate.log('404 code: ' + response.issue[0].code)
1
21:54:58.815 404 code: processing
Scenario: [7:79] TC-ALG-007 | REQ-GEN-001 captured allergy-read.json exists for HL7 Validator
ms: 5013
>>
Background:
14
* url baseUrl
0
21:54:49.820 baseUrl: https://hapi.fhir.org/baseR4 21:54:49.821 fhirVersion: 4.0.1
15
Given path 'AllergyIntolerance'
0
16
And params ({ 'patient:missing': 'false', '_count': '1' })
1
17
When method GET
4998
21:54:49.823 request: 1 > GET https://hapi.fhir.org/baseR4/AllergyIntolerance?patient%3Amissing=false&_count=1 1 > Host: hapi.fhir.org 1 > Connection: Keep-Alive 1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 1 > Accept-Encoding: gzip,deflate 21:54:54.820 response time in milliseconds: 4996 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:54:54 GMT 1 < Content-Type: application/fhir+json;charset=utf-8 1 < Transfer-Encoding: chunked 1 < Connection: keep-alive 1 < X-Cache: HIT from https://hapi.fhir.org/baseR4 1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 1 < X-Request-ID: kaBxogSbDd4SjEno 1 < Last-Modified: Tue, 21 Apr 2026 21:54:43 GMT { "resourceType": "Bundle", "id": "13cf20f5-018f-4c68-baa5-8acef1192e95", "meta": { "lastUpdated": "2026-04-21T21:54:43.781+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/AllergyIntolerance?_count=1&patient%3Amissing=false" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=13cf20f5-018f-4c68-baa5-8acef1192e95&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/AllergyIntolerance/pharyngitis-traj1-allergy-v1", "resource": { "resourceType": "AllergyIntolerance", "id": "pharyngitis-traj1-allergy-v1", "meta": { "versionId": "7", "lastUpdated": "2026-02-22T23:14:57.613+00:00", "source": "#ABVxnhWJC6Bqf10P" }, "clinicalStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical", "code": "active" } ] }, "verificationStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification", "code": "confirmed" } ] }, "type": "allergy", "category": [ "medication" ], "criticality": "high", "code": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ], "text": "Penicillin" }, "patient": { "reference": "Patient/pharyngitis-traj1-pt-v1" }, "note": [ { "text": "Father reports penicillin allergy at age 2 with hives requiring ER visit. Contraindicates all penicillin-class antibiotics including amoxicillin." } ], "reaction": [ { "substance": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ] }, "manifestation": [ { "coding": [ { "system": "http://snomed.info/sct", "code": "126485001", "display": "Urticaria" } ], "text": "Hives" } ], "description": "Developed generalized hives at age 2, required ER visit", "severity": "moderate" } ] }, "search": { "mode": "match" } } ] }
18
Then status 200
0
19
* def hasEntry = response.entry != null && response.entry.length > 0
0
20
* match hasEntry == true
0
21
* def allergyId = response.entry[0].resource.id
0
22
* match response.entry[0].resource.resourceType == 'AllergyIntolerance'
0
23
* karate.log('Resolved allergyId: ' + allergyId)
0
21:54:54.823 Resolved allergyId: pharyngitis-traj1-allergy-v1
80
* def fileExists = java.nio.file.Files.exists(java.nio.file.Paths.get('target/responses/allergy/allergy-read.json'))
10
81
* assert fileExists == true
2
Scenario: [8:83] TC-ALG-008 | REQ-GEN-002a | REQ-GEN-002b meta.lastUpdated and meta.versionId are present
ms: 9992
>>
Background:
14
* url baseUrl
0
21:54:50.817 baseUrl: https://hapi.fhir.org/baseR4 21:54:50.818 fhirVersion: 4.0.1
15
Given path 'AllergyIntolerance'
0
16
And params ({ 'patient:missing': 'false', '_count': '1' })
1
17
When method GET
4998
21:54:50.821 request: 1 > GET https://hapi.fhir.org/baseR4/AllergyIntolerance?patient%3Amissing=false&_count=1 1 > Host: hapi.fhir.org 1 > Connection: Keep-Alive 1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 1 > Accept-Encoding: gzip,deflate 21:54:55.817 response time in milliseconds: 4995 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:54:55 GMT 1 < Content-Type: application/fhir+json;charset=utf-8 1 < Transfer-Encoding: chunked 1 < Connection: keep-alive 1 < X-Cache: HIT from https://hapi.fhir.org/baseR4 1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 1 < X-Request-ID: EWxs1GqWnvMdoXkA 1 < Last-Modified: Tue, 21 Apr 2026 21:54:43 GMT { "resourceType": "Bundle", "id": "13cf20f5-018f-4c68-baa5-8acef1192e95", "meta": { "lastUpdated": "2026-04-21T21:54:43.781+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/AllergyIntolerance?_count=1&patient%3Amissing=false" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=13cf20f5-018f-4c68-baa5-8acef1192e95&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/AllergyIntolerance/pharyngitis-traj1-allergy-v1", "resource": { "resourceType": "AllergyIntolerance", "id": "pharyngitis-traj1-allergy-v1", "meta": { "versionId": "7", "lastUpdated": "2026-02-22T23:14:57.613+00:00", "source": "#ABVxnhWJC6Bqf10P" }, "clinicalStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical", "code": "active" } ] }, "verificationStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification", "code": "confirmed" } ] }, "type": "allergy", "category": [ "medication" ], "criticality": "high", "code": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ], "text": "Penicillin" }, "patient": { "reference": "Patient/pharyngitis-traj1-pt-v1" }, "note": [ { "text": "Father reports penicillin allergy at age 2 with hives requiring ER visit. Contraindicates all penicillin-class antibiotics including amoxicillin." } ], "reaction": [ { "substance": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ] }, "manifestation": [ { "coding": [ { "system": "http://snomed.info/sct", "code": "126485001", "display": "Urticaria" } ], "text": "Hives" } ], "description": "Developed generalized hives at age 2, required ER visit", "severity": "moderate" } ] }, "search": { "mode": "match" } } ] }
18
Then status 200
0
19
* def hasEntry = response.entry != null && response.entry.length > 0
1
20
* match hasEntry == true
0
21
* def allergyId = response.entry[0].resource.id
0
22
* match response.entry[0].resource.resourceType == 'AllergyIntolerance'
0
23
* karate.log('Resolved allergyId: ' + allergyId)
0
21:54:55.820 Resolved allergyId: pharyngitis-traj1-allergy-v1
84
Given path 'AllergyIntolerance', allergyId
0
85
When method GET
4988
21:54:55.822 request: 2 > GET https://hapi.fhir.org/baseR4/AllergyIntolerance/pharyngitis-traj1-allergy-v1 2 > Host: hapi.fhir.org 2 > Connection: Keep-Alive 2 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 2 > Accept-Encoding: gzip,deflate 21:55:00.808 response time in milliseconds: 4985 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:55:00 GMT 2 < Content-Type: application/fhir+json;charset=utf-8 2 < Transfer-Encoding: chunked 2 < Connection: keep-alive 2 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 2 < ETag: W/"7" 2 < X-Request-ID: 3RzYSnnE8zo8uMRF 2 < Content-Location: https://hapi.fhir.org/baseR4/AllergyIntolerance/pharyngitis-traj1-allergy-v1/_history/7 2 < Last-Modified: Sun, 22 Feb 2026 23:14:57 GMT { "resourceType": "AllergyIntolerance", "id": "pharyngitis-traj1-allergy-v1", "meta": { "versionId": "7", "lastUpdated": "2026-02-22T23:14:57.613+00:00", "source": "#ABVxnhWJC6Bqf10P" }, "clinicalStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical", "code": "active" } ] }, "verificationStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification", "code": "confirmed" } ] }, "type": "allergy", "category": [ "medication" ], "criticality": "high", "code": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ], "text": "Penicillin" }, "patient": { "reference": "Patient/pharyngitis-traj1-pt-v1" }, "note": [ { "text": "Father reports penicillin allergy at age 2 with hives requiring ER visit. Contraindicates all penicillin-class antibiotics including amoxicillin." } ], "reaction": [ { "substance": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "7980", "display": "Penicillin" } ] }, "manifestation": [ { "coding": [ { "system": "http://snomed.info/sct", "code": "126485001", "display": "Urticaria" } ], "text": "Hives" } ], "description": "Developed generalized hives at age 2, required ER visit", "severity": "moderate" } ] }
86
Then status 200
0
87
And match response.meta.lastUpdated == '#present'
1
88
And match response.meta.versionId == '#present'
0
89
* karate.log('meta.lastUpdated: ' + response.meta.lastUpdated)
1
21:55:00.810 meta.lastUpdated: 2026-02-22T23:14:57.613+00:00
90
* karate.log('meta.versionId: ' + response.meta.versionId)
1
21:55:00.811 meta.versionId: 7