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: 6047
>>
Background:
14
* url baseUrl
1
03:39:24.304 baseUrl: https://hapi.fhir.org/baseR4 03:39:24.305 fhirVersion: 4.0.1
15
Given path 'AllergyIntolerance'
1
16
And params ({ 'patient:missing': 'false', '_count': '1' })
9
17
When method GET
1080
03:39:24.690 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 03:39:25.405 response time in milliseconds: 711 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Thu, 16 Apr 2026 03:39:25 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: IhfMMJSQnUMranL8 1 < Last-Modified: Thu, 16 Apr 2026 03:39:25 GMT { "resourceType": "Bundle", "id": "aa2a0ae0-51cc-40dc-a5aa-acc3f5bf5aed", "meta": { "lastUpdated": "2026-04-16T03:39:25.318+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=aa2a0ae0-51cc-40dc-a5aa-acc3f5bf5aed&_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
7
20
* match hasEntry == true
11
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
03:39:25.458 Resolved allergyId: pharyngitis-traj1-allergy-v1
26
Given path 'AllergyIntolerance', allergyId
6
27
When method GET
4887
03:39:25.466 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 03:39:30.350 response time in milliseconds: 4883 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Thu, 16 Apr 2026 03:39:30 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: Z5x0c8HJ3fkRBlpW 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
4
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'
0
33
* karate.write(response, 'responses/allergy/allergy-read.json')
23
03:39:30.381 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: 10022
>>
Background:
14
* url baseUrl
1
03:39:24.303 baseUrl: https://hapi.fhir.org/baseR4 03:39:24.304 fhirVersion: 4.0.1
15
Given path 'AllergyIntolerance'
3
16
And params ({ 'patient:missing': 'false', '_count': '1' })
6
17
When method GET
5021
03:39:24.689 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 03:39:29.363 response time in milliseconds: 4673 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Thu, 16 Apr 2026 03:39:29 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: N0XSioUyRyHv1fri 1 < Last-Modified: Thu, 16 Apr 2026 03:39:25 GMT { "resourceType": "Bundle", "id": "aa2a0ae0-51cc-40dc-a5aa-acc3f5bf5aed", "meta": { "lastUpdated": "2026-04-16T03:39:25.318+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=aa2a0ae0-51cc-40dc-a5aa-acc3f5bf5aed&_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
03:39:29.370 Resolved allergyId: pharyngitis-traj1-allergy-v1
36
Given path 'AllergyIntolerance', allergyId
1
37
When method GET
4979
03:39:29.373 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 03:39:34.350 response time in milliseconds: 4976 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Thu, 16 Apr 2026 03:39:34 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: JziG4jHYORG0jtuG 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
03:39:34.357 clinicalStatus: active
Scenario: [3:44] TC-ALG-003 | REQ-ALG-003 verificationStatus is present
ms: 8015
>>
Background:
14
* url baseUrl
1
03:39:24.306 baseUrl: https://hapi.fhir.org/baseR4 03:39:24.307 fhirVersion: 4.0.1
15
Given path 'AllergyIntolerance'
0
16
And params ({ 'patient:missing': 'false', '_count': '1' })
6
17
When method GET
3023
03:39:24.690 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 03:39:27.364 response time in milliseconds: 2673 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Thu, 16 Apr 2026 03:39:27 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: IjhvfwUPsLhD6wMw 1 < Last-Modified: Thu, 16 Apr 2026 03:39:25 GMT { "resourceType": "Bundle", "id": "aa2a0ae0-51cc-40dc-a5aa-acc3f5bf5aed", "meta": { "lastUpdated": "2026-04-16T03:39:25.318+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=aa2a0ae0-51cc-40dc-a5aa-acc3f5bf5aed&_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
03:39:27.373 Resolved allergyId: pharyngitis-traj1-allergy-v1
45
Given path 'AllergyIntolerance', allergyId
1
46
When method GET
4975
03:39:27.375 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 03:39:32.348 response time in milliseconds: 4973 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Thu, 16 Apr 2026 03:39:32 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: gE5DsYt9D1rFrVZh 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'
1
49
* karate.log('verificationStatus: ' + response.verificationStatus.coding[0].code)
2
03:39:32.352 verificationStatus: confirmed
Scenario: [4:51] TC-ALG-004 | REQ-ALG-004 patient reference is present
ms: 9016
>>
Background:
14
* url baseUrl
1
03:39:24.303 baseUrl: https://hapi.fhir.org/baseR4 03:39:24.304 fhirVersion: 4.0.1
15
Given path 'AllergyIntolerance'
0
16
And params ({ 'patient:missing': 'false', '_count': '1' })
5
17
When method GET
4019
03:39:24.689 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 03:39:28.361 response time in milliseconds: 3672 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Thu, 16 Apr 2026 03:39:28 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: scVPLQPPwlmu5qLX 1 < Last-Modified: Thu, 16 Apr 2026 03:39:25 GMT { "resourceType": "Bundle", "id": "aa2a0ae0-51cc-40dc-a5aa-acc3f5bf5aed", "meta": { "lastUpdated": "2026-04-16T03:39:25.318+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=aa2a0ae0-51cc-40dc-a5aa-acc3f5bf5aed&_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
03:39:28.367 Resolved allergyId: pharyngitis-traj1-allergy-v1
52
Given path 'AllergyIntolerance', allergyId
1
53
When method GET
4982
03:39:28.369 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 03:39:33.349 response time in milliseconds: 4979 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Thu, 16 Apr 2026 03:39:33 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: CmUn7khPjkN7lldJ 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
03:39:33.354 patient reference: Patient/pharyngitis-traj1-pt-v1
Scenario: [5:60] TC-ALG-005 | REQ-ALG-005 reaction manifestation coding present (conditional)
ms: 7023
>>
Background:
14
* url baseUrl
1
03:39:24.306 baseUrl: https://hapi.fhir.org/baseR4 03:39:24.307 fhirVersion: 4.0.1
15
Given path 'AllergyIntolerance'
0
16
And params ({ 'patient:missing': 'false', '_count': '1' })
6
17
When method GET
2024
03:39:24.690 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 03:39:26.365 response time in milliseconds: 1674 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Thu, 16 Apr 2026 03:39:26 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: 1p3WPOPJCFqwhOWu 1 < Last-Modified: Thu, 16 Apr 2026 03:39:25 GMT { "resourceType": "Bundle", "id": "aa2a0ae0-51cc-40dc-a5aa-acc3f5bf5aed", "meta": { "lastUpdated": "2026-04-16T03:39:25.318+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=aa2a0ae0-51cc-40dc-a5aa-acc3f5bf5aed&_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'
2
23
* karate.log('Resolved allergyId: ' + allergyId)
1
03:39:26.373 Resolved allergyId: pharyngitis-traj1-allergy-v1
61
Given path 'AllergyIntolerance', allergyId
1
62
When method GET
4976
03:39:26.376 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 03:39:31.349 response time in milliseconds: 4973 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Thu, 16 Apr 2026 03:39:31 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: BNTK34oKKamSInL4 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]')
4
67
* if (hasReaction) karate.match(response.reaction[0].manifestation[0].coding, '#[_ > 0]')
2
68
* if (hasReaction) karate.log('reaction manifestation coding present')
1
03:39:31.360 reaction manifestation coding present
Scenario: [6:70] TC-ALG-006 | REQ-ALG-006 | REQ-OO-001 non-existent ID returns 404 and OperationOutcome
ms: 9970
>>
Background:
14
* url baseUrl
0
03:39:30.394 baseUrl: https://hapi.fhir.org/baseR4 03:39:30.394 fhirVersion: 4.0.1
15
Given path 'AllergyIntolerance'
0
16
And params ({ 'patient:missing': 'false', '_count': '1' })
1
17
When method GET
4969
03:39:30.397 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 03:39:35.364 response time in milliseconds: 4966 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Thu, 16 Apr 2026 03:39:35 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: YrV9jmj46ndhDBk5 1 < Last-Modified: Thu, 16 Apr 2026 03:39:25 GMT { "resourceType": "Bundle", "id": "aa2a0ae0-51cc-40dc-a5aa-acc3f5bf5aed", "meta": { "lastUpdated": "2026-04-16T03:39:25.318+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=aa2a0ae0-51cc-40dc-a5aa-acc3f5bf5aed&_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
03:39:35.368 Resolved allergyId: pharyngitis-traj1-allergy-v1
71
Given path 'AllergyIntolerance', 'INVALID-ID-99999'
2
72
When method GET
4991
03:39:35.372 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 03:39:40.361 response time in milliseconds: 4988 2 < 404 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Thu, 16 Apr 2026 03:39:40 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: q6o23ZSAJ5S31gbW { "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]'
1
76
* karate.log('404 severity: ' + response.issue[0].severity)
1
03:39:40.365 404 severity: error
77
* karate.log('404 code: ' + response.issue[0].code)
1
03:39:40.366 404 code: processing
Scenario: [7:79] TC-ALG-007 | REQ-GEN-001 captured allergy-read.json exists for HL7 Validator
ms: 5020
>>
Background:
14
* url baseUrl
0
03:39:31.368 baseUrl: https://hapi.fhir.org/baseR4 03:39:31.369 fhirVersion: 4.0.1
15
Given path 'AllergyIntolerance'
0
16
And params ({ 'patient:missing': 'false', '_count': '1' })
1
17
When method GET
4995
03:39:31.371 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 03:39:36.364 response time in milliseconds: 4993 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Thu, 16 Apr 2026 03:39:36 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: Zv0ByBA8QPBMV8kx 1 < Last-Modified: Thu, 16 Apr 2026 03:39:25 GMT { "resourceType": "Bundle", "id": "aa2a0ae0-51cc-40dc-a5aa-acc3f5bf5aed", "meta": { "lastUpdated": "2026-04-16T03:39:25.318+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=aa2a0ae0-51cc-40dc-a5aa-acc3f5bf5aed&_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
03:39:36.368 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'))
15
81
* assert fileExists == true
7
Scenario: [8:83] TC-ALG-008 | REQ-GEN-002a | REQ-GEN-002b meta.lastUpdated and meta.versionId are present
ms: 9990
>>
Background:
14
* url baseUrl
0
03:39:32.361 baseUrl: https://hapi.fhir.org/baseR4 03:39:32.362 fhirVersion: 4.0.1
15
Given path 'AllergyIntolerance'
0
16
And params ({ 'patient:missing': 'false', '_count': '1' })
1
17
When method GET
5001
03:39:32.365 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 03:39:37.364 response time in milliseconds: 4999 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Thu, 16 Apr 2026 03:39:37 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: w8PEECc0yEAHKyZR 1 < Last-Modified: Thu, 16 Apr 2026 03:39:25 GMT { "resourceType": "Bundle", "id": "aa2a0ae0-51cc-40dc-a5aa-acc3f5bf5aed", "meta": { "lastUpdated": "2026-04-16T03:39:25.318+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=aa2a0ae0-51cc-40dc-a5aa-acc3f5bf5aed&_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
03:39:37.367 Resolved allergyId: pharyngitis-traj1-allergy-v1
84
Given path 'AllergyIntolerance', allergyId
0
85
When method GET
4983
03:39:37.368 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 03:39:42.349 response time in milliseconds: 4981 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Thu, 16 Apr 2026 03:39:42 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: 1qivPwO1gR8ROThn 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
03:39:42.352 meta.lastUpdated: 2026-02-22T23:14:57.613+00:00
90
* karate.log('meta.versionId: ' + response.meta.versionId)
1
03:39:42.353 meta.versionId: 7