Batch validation
Load R4-compliant Patients, validate against a US-Core-modeled profile, and chart the results (valid/invalid, issues by type, concentration).
18 cells · updated Jul 15, 2026
This notebook runs $batch-validate on a set of Patients and charts what
fails. It seeds sample data, creates a profile modeled on US Core Patient,
validates, and shows the results.
Patient sample data
A transaction Bundle: ~50 Patients that are valid FHIR R4 but miss some US Core requirements, plus the SQLQuery resources the charts below run. Run once.
POST /fhir
Content-Type: application/json
{
"resourceType": "Bundle",
"type": "transaction",
"entry": [
{
"request": {
"method": "PUT",
"url": "Library/bv-valid-invalid"
},
"resource": {
"resourceType": "Library",
"id": "bv-valid-invalid",
"url": "https://aidbox.app/notebooks/batch-validation/valid-invalid",
"meta": {
"profile": [
"https://sql-on-fhir.org/ig/StructureDefinition/SQLQuery"
]
},
"status": "active",
"type": {
"coding": [
{
"system": "https://sql-on-fhir.org/ig/CodeSystem/LibraryTypesCodes",
"code": "sql-query"
}
]
},
"content": [
{
"extension": [
{
"url": "https://sql-on-fhir.org/ig/StructureDefinition/sql-text",
"valueString": "WITH s AS (\n SELECT sum(validated) AS validated, sum(invalid) AS invalid\n FROM aidbox_batch_validation.chunk_stat\n WHERE run_id = (SELECT run_id FROM aidbox_batch_validation.chunk_stat GROUP BY run_id ORDER BY max(ts) DESC LIMIT 1) AND completed\n)\nSELECT 'valid' AS status, (validated - invalid) AS resources FROM s\nUNION ALL\nSELECT 'invalid' AS status, invalid AS resources FROM s"
}
],
"contentType": "application/sql",
"data": "V0lUSCBzIEFTICgKICBTRUxFQ1Qgc3VtKHZhbGlkYXRlZCkgQVMgdmFsaWRhdGVkLCBzdW0oaW52YWxpZCkgQVMgaW52YWxpZAogIEZST00gYWlkYm94X2JhdGNoX3ZhbGlkYXRpb24uY2h1bmtfc3RhdAogIFdIRVJFIHJ1bl9pZCA9IChTRUxFQ1QgcnVuX2lkIEZST00gYWlkYm94X2JhdGNoX3ZhbGlkYXRpb24uY2h1bmtfc3RhdCBHUk9VUCBCWSBydW5faWQgT1JERVIgQlkgbWF4KHRzKSBERVNDIExJTUlUIDEpIEFORCBjb21wbGV0ZWQKKQpTRUxFQ1QgJ3ZhbGlkJyAgIEFTIHN0YXR1cywgKHZhbGlkYXRlZCAtIGludmFsaWQpIEFTIHJlc291cmNlcyBGUk9NIHMKVU5JT04gQUxMClNFTEVDVCAnaW52YWxpZCcgQVMgc3RhdHVzLCBpbnZhbGlkICAgICAgICAgICAgICAgQVMgcmVzb3VyY2VzIEZST00gcw=="
}
]
}
},
{
"request": {
"method": "PUT",
"url": "Library/bv-by-issue"
},
"resource": {
"resourceType": "Library",
"id": "bv-by-issue",
"url": "https://aidbox.app/notebooks/batch-validation/by-issue",
"meta": {
"profile": [
"https://sql-on-fhir.org/ig/StructureDefinition/SQLQuery"
]
},
"status": "active",
"type": {
"coding": [
{
"system": "https://sql-on-fhir.org/ig/CodeSystem/LibraryTypesCodes",
"code": "sql-query"
}
]
},
"content": [
{
"extension": [
{
"url": "https://sql-on-fhir.org/ig/StructureDefinition/sql-text",
"valueString": "SELECT coalesce(nullif(f.norm_path, ''), '(resource)') || ' / ' || f.code AS issue,\n count(DISTINCT o.resource_id) AS resources\nFROM aidbox_batch_validation.issue f\nJOIN aidbox_batch_validation.invalid_resource o\n ON o.run_id = f.run_id AND o.issue_id = f.issue_id\nWHERE f.run_id = (SELECT run_id FROM aidbox_batch_validation.chunk_stat GROUP BY run_id ORDER BY max(ts) DESC LIMIT 1)\nGROUP BY issue\nORDER BY resources DESC"
}
],
"contentType": "application/sql",
"data": "U0VMRUNUIGNvYWxlc2NlKG51bGxpZihmLm5vcm1fcGF0aCwgJycpLCAnKHJlc291cmNlKScpIHx8ICcgLyAnIHx8IGYuY29kZSBBUyBpc3N1ZSwKICAgICAgIGNvdW50KERJU1RJTkNUIG8ucmVzb3VyY2VfaWQpIEFTIHJlc291cmNlcwpGUk9NIGFpZGJveF9iYXRjaF92YWxpZGF0aW9uLmlzc3VlIGYKSk9JTiBhaWRib3hfYmF0Y2hfdmFsaWRhdGlvbi5pbnZhbGlkX3Jlc291cmNlIG8KICBPTiBvLnJ1bl9pZCA9IGYucnVuX2lkIEFORCBvLmlzc3VlX2lkID0gZi5pc3N1ZV9pZApXSEVSRSBmLnJ1bl9pZCA9IChTRUxFQ1QgcnVuX2lkIEZST00gYWlkYm94X2JhdGNoX3ZhbGlkYXRpb24uY2h1bmtfc3RhdCBHUk9VUCBCWSBydW5faWQgT1JERVIgQlkgbWF4KHRzKSBERVNDIExJTUlUIDEpCkdST1VQIEJZIGlzc3VlCk9SREVSIEJZIHJlc291cmNlcyBERVND"
}
]
}
},
{
"request": {
"method": "PUT",
"url": "Library/bv-top-elements"
},
"resource": {
"resourceType": "Library",
"id": "bv-top-elements",
"url": "https://aidbox.app/notebooks/batch-validation/top-elements",
"meta": {
"profile": [
"https://sql-on-fhir.org/ig/StructureDefinition/SQLQuery"
]
},
"status": "active",
"type": {
"coding": [
{
"system": "https://sql-on-fhir.org/ig/CodeSystem/LibraryTypesCodes",
"code": "sql-query"
}
]
},
"content": [
{
"extension": [
{
"url": "https://sql-on-fhir.org/ig/StructureDefinition/sql-text",
"valueString": "SELECT coalesce(nullif(f.norm_path, ''), '(resource)') AS element,\n f.code AS code,\n count(*) AS resources\nFROM aidbox_batch_validation.issue f\nJOIN aidbox_batch_validation.invalid_resource o\n ON o.run_id = f.run_id AND o.issue_id = f.issue_id\nWHERE f.run_id = (SELECT run_id FROM aidbox_batch_validation.chunk_stat GROUP BY run_id ORDER BY max(ts) DESC LIMIT 1)\nGROUP BY element, f.code\nORDER BY resources DESC\nLIMIT 10"
}
],
"contentType": "application/sql",
"data": "U0VMRUNUIGNvYWxlc2NlKG51bGxpZihmLm5vcm1fcGF0aCwgJycpLCAnKHJlc291cmNlKScpIEFTIGVsZW1lbnQsCiAgICAgICBmLmNvZGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBUyBjb2RlLAogICAgICAgY291bnQoKikgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQVMgcmVzb3VyY2VzCkZST00gYWlkYm94X2JhdGNoX3ZhbGlkYXRpb24uaXNzdWUgZgpKT0lOIGFpZGJveF9iYXRjaF92YWxpZGF0aW9uLmludmFsaWRfcmVzb3VyY2UgbwogIE9OIG8ucnVuX2lkID0gZi5ydW5faWQgQU5EIG8uaXNzdWVfaWQgPSBmLmlzc3VlX2lkCldIRVJFIGYucnVuX2lkID0gKFNFTEVDVCBydW5faWQgRlJPTSBhaWRib3hfYmF0Y2hfdmFsaWRhdGlvbi5jaHVua19zdGF0IEdST1VQIEJZIHJ1bl9pZCBPUkRFUiBCWSBtYXgodHMpIERFU0MgTElNSVQgMSkKR1JPVVAgQlkgZWxlbWVudCwgZi5jb2RlCk9SREVSIEJZIHJlc291cmNlcyBERVNDCkxJTUlUIDEw"
}
]
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-1"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1000"
}
],
"name": [
{
"family": "Lee",
"given": [
"Sam"
]
}
],
"gender": "male",
"id": "nb-pt-1"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-2"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1001"
}
],
"name": [
{
"family": "Ng",
"given": [
"Alex"
]
}
],
"gender": "female",
"id": "nb-pt-2"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-3"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1002"
}
],
"name": [
{
"family": "Diaz",
"given": [
"Jo"
]
}
],
"gender": "male",
"id": "nb-pt-3"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-4"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1003"
}
],
"name": [
{
"family": "Khan",
"given": [
"Kim"
]
}
],
"gender": "female",
"id": "nb-pt-4"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-5"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1004"
}
],
"name": [
{
"family": "Roy",
"given": [
"Lou"
]
}
],
"gender": "male",
"id": "nb-pt-5"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-6"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1005"
}
],
"name": [
{
"family": "Cruz",
"given": [
"Max"
]
}
],
"gender": "female",
"id": "nb-pt-6"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-7"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1006"
}
],
"name": [
{
"family": "Mori",
"given": [
"Ari"
]
}
],
"gender": "male",
"id": "nb-pt-7"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-8"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1007"
}
],
"name": [
{
"family": "Bauer",
"given": [
"Ren"
]
}
],
"gender": "female",
"id": "nb-pt-8"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-9"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1008"
}
],
"name": [
{
"family": "Ito",
"given": [
"Bo"
]
}
],
"gender": "male",
"id": "nb-pt-9"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-10"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1009"
}
],
"name": [
{
"family": "Frost",
"given": [
"Ivy"
]
}
],
"gender": "female",
"id": "nb-pt-10"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-11"
},
"resource": {
"resourceType": "Patient",
"name": [
{
"family": "Lee",
"given": [
"Sam"
]
}
],
"gender": "male",
"id": "nb-pt-11"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-12"
},
"resource": {
"resourceType": "Patient",
"name": [
{
"family": "Ng",
"given": [
"Alex"
]
}
],
"gender": "male",
"id": "nb-pt-12"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-13"
},
"resource": {
"resourceType": "Patient",
"name": [
{
"family": "Diaz",
"given": [
"Jo"
]
}
],
"gender": "male",
"id": "nb-pt-13"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-14"
},
"resource": {
"resourceType": "Patient",
"name": [
{
"family": "Khan",
"given": [
"Kim"
]
}
],
"gender": "male",
"id": "nb-pt-14"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-15"
},
"resource": {
"resourceType": "Patient",
"name": [
{
"family": "Roy",
"given": [
"Lou"
]
}
],
"gender": "male",
"id": "nb-pt-15"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-16"
},
"resource": {
"resourceType": "Patient",
"name": [
{
"family": "Cruz",
"given": [
"Max"
]
}
],
"gender": "male",
"id": "nb-pt-16"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-17"
},
"resource": {
"resourceType": "Patient",
"name": [
{
"family": "Mori",
"given": [
"Ari"
]
}
],
"gender": "male",
"id": "nb-pt-17"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-18"
},
"resource": {
"resourceType": "Patient",
"name": [
{
"family": "Bauer",
"given": [
"Ren"
]
}
],
"gender": "male",
"id": "nb-pt-18"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-19"
},
"resource": {
"resourceType": "Patient",
"name": [
{
"family": "Ito",
"given": [
"Bo"
]
}
],
"gender": "male",
"id": "nb-pt-19"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-20"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1019"
}
],
"gender": "female",
"id": "nb-pt-20"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-21"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1020"
}
],
"gender": "female",
"id": "nb-pt-21"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-22"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1021"
}
],
"gender": "female",
"id": "nb-pt-22"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-23"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1022"
}
],
"gender": "female",
"id": "nb-pt-23"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-24"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1023"
}
],
"gender": "female",
"id": "nb-pt-24"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-25"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1024"
}
],
"gender": "female",
"id": "nb-pt-25"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-26"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1025"
}
],
"gender": "female",
"id": "nb-pt-26"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-27"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1026"
}
],
"gender": "female",
"id": "nb-pt-27"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-28"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1027"
}
],
"name": [
{
"family": "Bauer",
"given": [
"Ren"
]
}
],
"id": "nb-pt-28"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-29"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1028"
}
],
"name": [
{
"family": "Ito",
"given": [
"Bo"
]
}
],
"id": "nb-pt-29"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-30"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1029"
}
],
"name": [
{
"family": "Frost",
"given": [
"Ivy"
]
}
],
"id": "nb-pt-30"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-31"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1030"
}
],
"name": [
{
"family": "Lee",
"given": [
"Sam"
]
}
],
"id": "nb-pt-31"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-32"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1031"
}
],
"name": [
{
"family": "Ng",
"given": [
"Alex"
]
}
],
"id": "nb-pt-32"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-33"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1032"
}
],
"name": [
{
"family": "Diaz",
"given": [
"Jo"
]
}
],
"id": "nb-pt-33"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-34"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1033"
}
],
"name": [
{
"family": "Khan",
"given": [
"Kim"
]
}
],
"id": "nb-pt-34"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-35"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1034"
}
],
"name": [
{
"use": "official"
}
],
"gender": "male",
"id": "nb-pt-35"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-36"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1035"
}
],
"name": [
{
"use": "official"
}
],
"gender": "male",
"id": "nb-pt-36"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-37"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1036"
}
],
"name": [
{
"use": "official"
}
],
"gender": "male",
"id": "nb-pt-37"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-38"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1037"
}
],
"name": [
{
"use": "official"
}
],
"gender": "male",
"id": "nb-pt-38"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-39"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1038"
}
],
"name": [
{
"use": "official"
}
],
"gender": "male",
"id": "nb-pt-39"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-40"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5",
"value": "MRN-1039"
}
],
"name": [
{
"use": "official"
}
],
"gender": "male",
"id": "nb-pt-40"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-41"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"value": "MRN-1040"
}
],
"name": [
{
"family": "Lee",
"given": [
"Sam"
]
}
],
"gender": "female",
"id": "nb-pt-41"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-42"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"value": "MRN-1041"
}
],
"name": [
{
"family": "Ng",
"given": [
"Alex"
]
}
],
"gender": "female",
"id": "nb-pt-42"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-43"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"value": "MRN-1042"
}
],
"name": [
{
"family": "Diaz",
"given": [
"Jo"
]
}
],
"gender": "female",
"id": "nb-pt-43"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-44"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"value": "MRN-1043"
}
],
"name": [
{
"family": "Khan",
"given": [
"Kim"
]
}
],
"gender": "female",
"id": "nb-pt-44"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-45"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"value": "MRN-1044"
}
],
"name": [
{
"family": "Roy",
"given": [
"Lou"
]
}
],
"gender": "female",
"id": "nb-pt-45"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-46"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"name": [
{
"family": "Cruz",
"given": [
"Max"
]
}
],
"gender": "male",
"id": "nb-pt-46"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-47"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"name": [
{
"family": "Mori",
"given": [
"Ari"
]
}
],
"gender": "male",
"id": "nb-pt-47"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-48"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"name": [
{
"family": "Bauer",
"given": [
"Ren"
]
}
],
"gender": "male",
"id": "nb-pt-48"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-49"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"name": [
{
"family": "Ito",
"given": [
"Bo"
]
}
],
"gender": "male",
"id": "nb-pt-49"
}
},
{
"request": {
"method": "PUT",
"url": "Patient/nb-pt-50"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"name": [
{
"family": "Frost",
"given": [
"Ivy"
]
}
],
"gender": "male",
"id": "nb-pt-50"
}
}
]
}
{
"type": "transaction-response",
"resourceType": "Bundle",
"entry": [
{
"resource": {
"url": "https://aidbox.app/notebooks/batch-validation/valid-invalid",
"meta": {
"profile": [
"https://sql-on-fhir.org/ig/StructureDefinition/SQLQuery"
]
},
"status": "active",
"type": {
"coding": [
{
"system": "https://sql-on-fhir.org/ig/CodeSystem/LibraryTypesCodes",
"code": "sql-query"
}
]
},
"content": [
{
"extension": [
{
"url": "https://sql-on-fhir.org/ig/StructureDefinition/sql-text",
"valueString": "WITH s AS (\n SELECT sum(validated) AS validated, sum(invalid) AS invalid\n FROM aidbox_batch_validation.chunk_stat\n WHERE run_id = (SELECT run_id FROM aidbox_batch_validation.chunk_stat GROUP BY run_id ORDER BY max(ts) DESC LIMIT 1) AND completed\n)\nSELECT 'valid' AS status, (validated - invalid) AS resources FROM s\nUNION ALL\nSELECT 'invalid' AS status, invalid AS resources FROM s"
}
],
"contentType": "application/sql",
"data": "V0lUSCBzIEFTICgKICBTRUxFQ1Qgc3VtKHZhbGlkYXRlZCkgQVMgdmFsaWRhdGVkLCBzdW0oaW52YWxpZCkgQVMgaW52YWxpZAogIEZST00gYWlkYm94X2JhdGNoX3ZhbGlkYXRpb24uY2h1bmtfc3RhdAogIFdIRVJFIHJ1bl9pZCA9IChTRUxFQ1QgcnVuX2lkIEZST00gYWlkYm94X2JhdGNoX3ZhbGlkYXRpb24uY2h1bmtfc3RhdCBHUk9VUCBCWSBydW5faWQgT1JERVIgQlkgbWF4KHRzKSBERVNDIExJTUlUIDEpIEFORCBjb21wbGV0ZWQKKQpTRUxFQ1QgJ3ZhbGlkJyAgIEFTIHN0YXR1cywgKHZhbGlkYXRlZCAtIGludmFsaWQpIEFTIHJlc291cmNlcyBGUk9NIHMKVU5JT04gQUxMClNFTEVDVCAnaW52YWxpZCcgQVMgc3RhdHVzLCBpbnZhbGlkICAgICAgICAgICAgICAgQVMgcmVzb3VyY2VzIEZST00gcw=="
}
],
"id": "bv-valid-invalid",
"resourceType": "Library"
},
"response": {
"location": "/Library/bv-valid-invalid/_history/",
"status": "200"
}
},
{
"resource": {
"url": "https://aidbox.app/notebooks/batch-validation/by-issue",
"meta": {
"profile": [
"https://sql-on-fhir.org/ig/StructureDefinition/SQLQuery"
]
},
"status": "active",
"type": {
"coding": [
{
"system": "https://sql-on-fhir.org/ig/CodeSystem/LibraryTypesCodes",
"code": "sql-query"
}
]
},
"content": [
{
"extension": [
{
"url": "https://sql-on-fhir.org/ig/StructureDefinition/sql-text",
"valueString": "SELECT coalesce(nullif(f.norm_path, ''), '(resource)') || ' / ' || f.code AS issue,\n count(DISTINCT o.resource_id) AS resources\nFROM aidbox_batch_validation.issue f\nJOIN aidbox_batch_validation.invalid_resource o\n ON o.run_id = f.run_id AND o.issue_id = f.issue_id\nWHERE f.run_id = (SELECT run_id FROM aidbox_batch_validation.chunk_stat GROUP BY run_id ORDER BY max(ts) DESC LIMIT 1)\nGROUP BY issue\nORDER BY resources DESC"
}
],
"contentType": "application/sql",
"data": "U0VMRUNUIGNvYWxlc2NlKG51bGxpZihmLm5vcm1fcGF0aCwgJycpLCAnKHJlc291cmNlKScpIHx8ICcgLyAnIHx8IGYuY29kZSBBUyBpc3N1ZSwKICAgICAgIGNvdW50KERJU1RJTkNUIG8ucmVzb3VyY2VfaWQpIEFTIHJlc291cmNlcwpGUk9NIGFpZGJveF9iYXRjaF92YWxpZGF0aW9uLmlzc3VlIGYKSk9JTiBhaWRib3hfYmF0Y2hfdmFsaWRhdGlvbi5pbnZhbGlkX3Jlc291cmNlIG8KICBPTiBvLnJ1bl9pZCA9IGYucnVuX2lkIEFORCBvLmlzc3VlX2lkID0gZi5pc3N1ZV9pZApXSEVSRSBmLnJ1bl9pZCA9IChTRUxFQ1QgcnVuX2lkIEZST00gYWlkYm94X2JhdGNoX3ZhbGlkYXRpb24uY2h1bmtfc3RhdCBHUk9VUCBCWSBydW5faWQgT1JERVIgQlkgbWF4KHRzKSBERVNDIExJTUlUIDEpCkdST1VQIEJZIGlzc3VlCk9SREVSIEJZIHJlc291cmNlcyBERVND"
}
],
"id": "bv-by-issue",
"resourceType": "Library"
},
"response": {
"location": "/Library/bv-by-issue/_history/",
"status": "200"
}
},
{
"resource": {
"url": "https://aidbox.app/notebooks/batch-validation/top-elements",
"meta": {
"profile": [
"https://sql-on-fhir.org/ig/StructureDefinition/SQLQuery"
]
},
"status": "active",
"type": {
"coding": [
{
"system": "https://sql-on-fhir.org/ig/CodeSystem/LibraryTypesCodes",
"code": "sql-query"
}
]
},
"content": [
{
"extension": [
{
"url": "https://sql-on-fhir.org/ig/StructureDefinition/sql-text",
"valueString": "SELECT coalesce(nullif(f.norm_path, ''), '(resource)') AS element,\n f.code AS code,\n count(*) AS resources\nFROM aidbox_batch_validation.issue f\nJOIN aidbox_batch_validation.invalid_resource o\n ON o.run_id = f.run_id AND o.issue_id = f.issue_id\nWHERE f.run_id = (SELECT run_id FROM aidbox_batch_validation.chunk_stat GROUP BY run_id ORDER BY max(ts) DESC LIMIT 1)\nGROUP BY element, f.code\nORDER BY resources DESC\nLIMIT 10"
}
],
"contentType": "application/sql",
"data": "U0VMRUNUIGNvYWxlc2NlKG51bGxpZihmLm5vcm1fcGF0aCwgJycpLCAnKHJlc291cmNlKScpIEFTIGVsZW1lbnQsCiAgICAgICBmLmNvZGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBUyBjb2RlLAogICAgICAgY291bnQoKikgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQVMgcmVzb3VyY2VzCkZST00gYWlkYm94X2JhdGNoX3ZhbGlkYXRpb24uaXNzdWUgZgpKT0lOIGFpZGJveF9iYXRjaF92YWxpZGF0aW9uLmludmFsaWRfcmVzb3VyY2UgbwogIE9OIG8ucnVuX2lkID0gZi5ydW5faWQgQU5EIG8uaXNzdWVfaWQgPSBmLmlzc3VlX2lkCldIRVJFIGYucnVuX2lkID0gKFNFTEVDVCBydW5faWQgRlJPTSBhaWRib3hfYmF0Y2hfdmFsaWRhdGlvbi5jaHVua19zdGF0IEdST1VQIEJZIHJ1bl9pZCBPUkRFUiBCWSBtYXgodHMpIERFU0MgTElNSVQgMSkKR1JPVVAgQlkgZWxlbWVudCwgZi5jb2RlCk9SREVSIEJZIHJlc291cmNlcyBERVNDCkxJTUlUIDEw"
}
],
"id": "bv-top-elements",
"resourceType": "Library"
},
"response": {
"location": "/Library/bv-top-elements/_history/",
"status": "200"
}
},
{
"resource": {
"name": [
{
"given": [
"Sam"
],
"family": "Lee"
}
],
"gender": "male",
"identifier": [
{
"value": "MRN-1000",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-1",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "65",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "65",
"location": "/Patient/nb-pt-1/_history/65",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Alex"
],
"family": "Ng"
}
],
"gender": "female",
"identifier": [
{
"value": "MRN-1001",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-2",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "66",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "66",
"location": "/Patient/nb-pt-2/_history/66",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Jo"
],
"family": "Diaz"
}
],
"gender": "male",
"identifier": [
{
"value": "MRN-1002",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-3",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "67",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "67",
"location": "/Patient/nb-pt-3/_history/67",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Kim"
],
"family": "Khan"
}
],
"gender": "female",
"identifier": [
{
"value": "MRN-1003",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-4",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "68",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "68",
"location": "/Patient/nb-pt-4/_history/68",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Lou"
],
"family": "Roy"
}
],
"gender": "male",
"identifier": [
{
"value": "MRN-1004",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-5",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "69",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "69",
"location": "/Patient/nb-pt-5/_history/69",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Max"
],
"family": "Cruz"
}
],
"gender": "female",
"identifier": [
{
"value": "MRN-1005",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-6",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "70",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "70",
"location": "/Patient/nb-pt-6/_history/70",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Ari"
],
"family": "Mori"
}
],
"gender": "male",
"identifier": [
{
"value": "MRN-1006",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-7",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "71",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "71",
"location": "/Patient/nb-pt-7/_history/71",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Ren"
],
"family": "Bauer"
}
],
"gender": "female",
"identifier": [
{
"value": "MRN-1007",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-8",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "72",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "72",
"location": "/Patient/nb-pt-8/_history/72",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Bo"
],
"family": "Ito"
}
],
"gender": "male",
"identifier": [
{
"value": "MRN-1008",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-9",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "73",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "73",
"location": "/Patient/nb-pt-9/_history/73",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Ivy"
],
"family": "Frost"
}
],
"gender": "female",
"identifier": [
{
"value": "MRN-1009",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-10",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "74",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "74",
"location": "/Patient/nb-pt-10/_history/74",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Sam"
],
"family": "Lee"
}
],
"gender": "male",
"id": "nb-pt-11",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "75",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "75",
"location": "/Patient/nb-pt-11/_history/75",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Alex"
],
"family": "Ng"
}
],
"gender": "male",
"id": "nb-pt-12",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "76",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "76",
"location": "/Patient/nb-pt-12/_history/76",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Jo"
],
"family": "Diaz"
}
],
"gender": "male",
"id": "nb-pt-13",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "77",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "77",
"location": "/Patient/nb-pt-13/_history/77",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Kim"
],
"family": "Khan"
}
],
"gender": "male",
"id": "nb-pt-14",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "78",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "78",
"location": "/Patient/nb-pt-14/_history/78",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Lou"
],
"family": "Roy"
}
],
"gender": "male",
"id": "nb-pt-15",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "79",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "79",
"location": "/Patient/nb-pt-15/_history/79",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Max"
],
"family": "Cruz"
}
],
"gender": "male",
"id": "nb-pt-16",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "80",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "80",
"location": "/Patient/nb-pt-16/_history/80",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Ari"
],
"family": "Mori"
}
],
"gender": "male",
"id": "nb-pt-17",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "81",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "81",
"location": "/Patient/nb-pt-17/_history/81",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Ren"
],
"family": "Bauer"
}
],
"gender": "male",
"id": "nb-pt-18",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "82",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "82",
"location": "/Patient/nb-pt-18/_history/82",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Bo"
],
"family": "Ito"
}
],
"gender": "male",
"id": "nb-pt-19",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "83",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "83",
"location": "/Patient/nb-pt-19/_history/83",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"gender": "female",
"identifier": [
{
"value": "MRN-1019",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-20",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "84",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "84",
"location": "/Patient/nb-pt-20/_history/84",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"gender": "female",
"identifier": [
{
"value": "MRN-1020",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-21",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "85",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "85",
"location": "/Patient/nb-pt-21/_history/85",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"gender": "female",
"identifier": [
{
"value": "MRN-1021",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-22",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "86",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "86",
"location": "/Patient/nb-pt-22/_history/86",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"gender": "female",
"identifier": [
{
"value": "MRN-1022",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-23",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "87",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "87",
"location": "/Patient/nb-pt-23/_history/87",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"gender": "female",
"identifier": [
{
"value": "MRN-1023",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-24",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "88",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "88",
"location": "/Patient/nb-pt-24/_history/88",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"gender": "female",
"identifier": [
{
"value": "MRN-1024",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-25",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "89",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "89",
"location": "/Patient/nb-pt-25/_history/89",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"gender": "female",
"identifier": [
{
"value": "MRN-1025",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-26",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "90",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "90",
"location": "/Patient/nb-pt-26/_history/90",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"gender": "female",
"identifier": [
{
"value": "MRN-1026",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-27",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "91",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "91",
"location": "/Patient/nb-pt-27/_history/91",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Ren"
],
"family": "Bauer"
}
],
"identifier": [
{
"value": "MRN-1027",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-28",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "92",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "92",
"location": "/Patient/nb-pt-28/_history/92",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Bo"
],
"family": "Ito"
}
],
"identifier": [
{
"value": "MRN-1028",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-29",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "93",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "93",
"location": "/Patient/nb-pt-29/_history/93",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Ivy"
],
"family": "Frost"
}
],
"identifier": [
{
"value": "MRN-1029",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-30",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "94",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "94",
"location": "/Patient/nb-pt-30/_history/94",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Sam"
],
"family": "Lee"
}
],
"identifier": [
{
"value": "MRN-1030",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-31",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "95",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "95",
"location": "/Patient/nb-pt-31/_history/95",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Alex"
],
"family": "Ng"
}
],
"identifier": [
{
"value": "MRN-1031",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-32",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "96",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "96",
"location": "/Patient/nb-pt-32/_history/96",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Jo"
],
"family": "Diaz"
}
],
"identifier": [
{
"value": "MRN-1032",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-33",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "97",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "97",
"location": "/Patient/nb-pt-33/_history/97",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Kim"
],
"family": "Khan"
}
],
"identifier": [
{
"value": "MRN-1033",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-34",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "98",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "98",
"location": "/Patient/nb-pt-34/_history/98",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"use": "official"
}
],
"gender": "male",
"identifier": [
{
"value": "MRN-1034",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-35",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "99",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "99",
"location": "/Patient/nb-pt-35/_history/99",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"use": "official"
}
],
"gender": "male",
"identifier": [
{
"value": "MRN-1035",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-36",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "100",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "100",
"location": "/Patient/nb-pt-36/_history/100",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"use": "official"
}
],
"gender": "male",
"identifier": [
{
"value": "MRN-1036",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-37",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "101",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "101",
"location": "/Patient/nb-pt-37/_history/101",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"use": "official"
}
],
"gender": "male",
"identifier": [
{
"value": "MRN-1037",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-38",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "102",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "102",
"location": "/Patient/nb-pt-38/_history/102",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"use": "official"
}
],
"gender": "male",
"identifier": [
{
"value": "MRN-1038",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-39",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "103",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "103",
"location": "/Patient/nb-pt-39/_history/103",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"use": "official"
}
],
"gender": "male",
"identifier": [
{
"value": "MRN-1039",
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-40",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "104",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "104",
"location": "/Patient/nb-pt-40/_history/104",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Sam"
],
"family": "Lee"
}
],
"gender": "female",
"identifier": [
{
"value": "MRN-1040"
}
],
"id": "nb-pt-41",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "105",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "105",
"location": "/Patient/nb-pt-41/_history/105",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Alex"
],
"family": "Ng"
}
],
"gender": "female",
"identifier": [
{
"value": "MRN-1041"
}
],
"id": "nb-pt-42",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "106",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "106",
"location": "/Patient/nb-pt-42/_history/106",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Jo"
],
"family": "Diaz"
}
],
"gender": "female",
"identifier": [
{
"value": "MRN-1042"
}
],
"id": "nb-pt-43",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "107",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "107",
"location": "/Patient/nb-pt-43/_history/107",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Kim"
],
"family": "Khan"
}
],
"gender": "female",
"identifier": [
{
"value": "MRN-1043"
}
],
"id": "nb-pt-44",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "108",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "108",
"location": "/Patient/nb-pt-44/_history/108",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Lou"
],
"family": "Roy"
}
],
"gender": "female",
"identifier": [
{
"value": "MRN-1044"
}
],
"id": "nb-pt-45",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "109",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "109",
"location": "/Patient/nb-pt-45/_history/109",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Max"
],
"family": "Cruz"
}
],
"gender": "male",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-46",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "110",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "110",
"location": "/Patient/nb-pt-46/_history/110",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Ari"
],
"family": "Mori"
}
],
"gender": "male",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-47",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "111",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "111",
"location": "/Patient/nb-pt-47/_history/111",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Ren"
],
"family": "Bauer"
}
],
"gender": "male",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-48",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "112",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "112",
"location": "/Patient/nb-pt-48/_history/112",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Bo"
],
"family": "Ito"
}
],
"gender": "male",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-49",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "113",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "113",
"location": "/Patient/nb-pt-49/_history/113",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
},
{
"resource": {
"name": [
{
"given": [
"Ivy"
],
"family": "Frost"
}
],
"gender": "male",
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5"
}
],
"id": "nb-pt-50",
"resourceType": "Patient",
"meta": {
"lastUpdated": "2026-07-14T16:00:22.994776Z",
"versionId": "114",
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2026-07-14T16:00:22.994776Z"
}
]
}
},
"response": {
"etag": "114",
"location": "/Patient/nb-pt-50/_history/114",
"status": "200",
"lastModified": "2026-07-14T16:00:22.994776Z"
}
}
],
"id": "5fd73b7b-7e11-4f73-bb6a-8604238c86e6"
}Create a profile
Modeled on US Core Patient:
a Patient must have an identifier (with system and value), a name
(with family or given), and a gender.
PUT /fhir/StructureDefinition/notebook-patient
Content-Type: application/json
{
"resourceType": "StructureDefinition",
"id": "notebook-patient",
"url": "http://example.org/fhir/StructureDefinition/notebook-patient",
"name": "NotebookPatient",
"status": "active",
"kind": "resource",
"abstract": false,
"type": "Patient",
"baseDefinition": "http://hl7.org/fhir/StructureDefinition/Patient",
"derivation": "constraint",
"differential": {
"element": [
{
"id": "Patient.identifier",
"path": "Patient.identifier",
"min": 1
},
{
"id": "Patient.identifier.system",
"path": "Patient.identifier.system",
"min": 1
},
{
"id": "Patient.identifier.value",
"path": "Patient.identifier.value",
"min": 1
},
{
"id": "Patient.name",
"path": "Patient.name",
"min": 1,
"constraint": [
{
"key": "nb-name",
"severity": "error",
"human": "name must have family or given",
"expression": "family.exists() or given.exists()"
}
]
},
{
"id": "Patient.gender",
"path": "Patient.gender",
"min": 1
}
]
}
}
{
"derivation": "constraint",
"name": "NotebookPatient",
"abstract": false,
"type": "Patient",
"resourceType": "StructureDefinition",
"status": "active",
"id": "notebook-patient",
"kind": "resource",
"url": "http://example.org/fhir/StructureDefinition/notebook-patient",
"differential": {
"element": [
{
"id": "Patient.identifier",
"path": "Patient.identifier",
"min": 1
},
{
"id": "Patient.identifier.system",
"path": "Patient.identifier.system",
"min": 1
},
{
"id": "Patient.identifier.value",
"path": "Patient.identifier.value",
"min": 1
},
{
"id": "Patient.name",
"path": "Patient.name",
"min": 1,
"constraint": [
{
"key": "nb-name",
"severity": "error",
"human": "name must have family or given",
"expression": "family.exists() or given.exists()"
}
]
},
{
"id": "Patient.gender",
"path": "Patient.gender",
"min": 1
}
]
},
"baseDefinition": "http://hl7.org/fhir/StructureDefinition/Patient"
}Validate against the profile
$batch-validate checks every Patient in one call. This set is small, so
it runs synchronously and returns the summary: counts plus one entry per
distinct issue, worst first.
POST /fhir/Patient/$batch-validate
Content-Type: application/json
{"resourceType": "Parameters",
"parameter": [{"name": "_since", "valueInstant": "1970-01-01T00:00:00Z"},
{"name": "profile", "valueCanonical": "http://example.org/fhir/StructureDefinition/notebook-patient"}]}
{
"resourceType": "Parameters",
"parameter": [
{
"name": "task-id",
"valueString": "16fb6433-6d72-4be3-bb8d-218b73186cd1"
},
{
"name": "validated",
"valueUnsignedInt": 50
},
{
"name": "valid",
"valueUnsignedInt": 10
},
{
"name": "invalid",
"valueUnsignedInt": 40
},
{
"name": "bytes",
"valueDecimal": 8027
},
{
"name": "invalid-resources",
"valueUrl": "http://localhost:8765/fhir/$batch-validate/16fb6433-6d72-4be3-bb8d-218b73186cd1/invalid-resources"
},
{
"name": "issue",
"part": [
{
"name": "id",
"valueString": "0f7e2aa8cecfca3e5c1bece457515ebe"
},
{
"name": "invalid-resources",
"valueUrl": "http://localhost:8765/fhir/$batch-validate/16fb6433-6d72-4be3-bb8d-218b73186cd1/invalid-resources?_issue=0f7e2aa8cecfca3e5c1bece457515ebe"
},
{
"name": "code",
"valueCode": "required-key"
},
{
"name": "expression",
"valueString": "identifier"
},
{
"name": "count",
"valueUnsignedInt": 9
},
{
"name": "diagnostics",
"valueString": "Patient.identifier: required element is missing"
}
]
},
{
"name": "issue",
"part": [
{
"name": "id",
"valueString": "82665eb56ff78a8350090962c11855ff"
},
{
"name": "invalid-resources",
"valueUrl": "http://localhost:8765/fhir/$batch-validate/16fb6433-6d72-4be3-bb8d-218b73186cd1/invalid-resources?_issue=82665eb56ff78a8350090962c11855ff"
},
{
"name": "code",
"valueCode": "required-key"
},
{
"name": "expression",
"valueString": "name"
},
{
"name": "count",
"valueUnsignedInt": 8
},
{
"name": "diagnostics",
"valueString": "Patient.name: required element is missing"
}
]
},
{
"name": "issue",
"part": [
{
"name": "id",
"valueString": "0f4dc9c0c84a7e3780a673286a47040c"
},
{
"name": "invalid-resources",
"valueUrl": "http://localhost:8765/fhir/$batch-validate/16fb6433-6d72-4be3-bb8d-218b73186cd1/invalid-resources?_issue=0f4dc9c0c84a7e3780a673286a47040c"
},
{
"name": "code",
"valueCode": "required-key"
},
{
"name": "expression",
"valueString": "gender"
},
{
"name": "count",
"valueUnsignedInt": 7
},
{
"name": "diagnostics",
"valueString": "Patient.gender: required element is missing"
}
]
},
{
"name": "issue",
"part": [
{
"name": "id",
"valueString": "64a648b718c9b6802981b5c6ebd24f12"
},
{
"name": "invalid-resources",
"valueUrl": "http://localhost:8765/fhir/$batch-validate/16fb6433-6d72-4be3-bb8d-218b73186cd1/invalid-resources?_issue=64a648b718c9b6802981b5c6ebd24f12"
},
{
"name": "code",
"valueCode": "constraint-error"
},
{
"name": "expression",
"valueString": "name"
},
{
"name": "profile",
"valueString": "NotebookPatient"
},
{
"name": "count",
"valueUnsignedInt": 6
},
{
"name": "constraint",
"valueString": "nb-name"
},
{
"name": "diagnostics",
"valueString": "Patient.name: constraint nb-name is not satisfied"
}
]
},
{
"name": "issue",
"part": [
{
"name": "id",
"valueString": "10bee9687705ac0083cab4120ee304b7"
},
{
"name": "invalid-resources",
"valueUrl": "http://localhost:8765/fhir/$batch-validate/16fb6433-6d72-4be3-bb8d-218b73186cd1/invalid-resources?_issue=10bee9687705ac0083cab4120ee304b7"
},
{
"name": "code",
"valueCode": "required-key"
},
{
"name": "expression",
"valueString": "identifier.value"
},
{
"name": "profile",
"valueString": "NotebookPatient"
},
{
"name": "count",
"valueUnsignedInt": 5
},
{
"name": "diagnostics",
"valueString": "Patient.identifier.value: required element is missing"
}
]
},
{
"name": "issue",
"part": [
{
"name": "id",
"valueString": "5178f5061d8286521bb703b9f6b88b42"
},
{
"name": "invalid-resources",
"valueUrl": "http://localhost:8765/fhir/$batch-validate/16fb6433-6d72-4be3-bb8d-218b73186cd1/invalid-resources?_issue=5178f5061d8286521bb703b9f6b88b42"
},
{
"name": "code",
"valueCode": "required-key"
},
{
"name": "expression",
"valueString": "identifier.system"
},
{
"name": "profile",
"valueString": "NotebookPatient"
},
{
"name": "count",
"valueUnsignedInt": 5
},
{
"name": "diagnostics",
"valueString": "Patient.identifier.system: required element is missing"
}
]
}
]
}Explore invalid Patients
The invalid Patients from the latest run, each with the element and error code that flagged it.
SELECT o.resource_id as patient_id,
coalesce(nullif(f.norm_path, ''), '(resource)') AS element,
f.code
FROM aidbox_batch_validation.invalid_resource o
JOIN aidbox_batch_validation.issue f ON f.run_id = o.run_id
AND f.issue_id = o.issue_id
WHERE o.run_id = (
SELECT run_id
FROM aidbox_batch_validation.chunk_stat
GROUP BY run_id
ORDER BY max(ts) DESC
LIMIT 1
)
ORDER BY o.resource_id
LIMIT 50| code | element | patient_id |
|---|---|---|
| required-key | identifier | nb-pt-11 |
| required-key | identifier | nb-pt-12 |
| required-key | identifier | nb-pt-13 |
| required-key | identifier | nb-pt-14 |
| required-key | identifier | nb-pt-15 |
| required-key | identifier | nb-pt-16 |
| required-key | identifier | nb-pt-17 |
| required-key | identifier | nb-pt-18 |
| required-key | identifier | nb-pt-19 |
| required-key | name | nb-pt-20 |
| required-key | name | nb-pt-21 |
| required-key | name | nb-pt-22 |
| required-key | name | nb-pt-23 |
| required-key | name | nb-pt-24 |
| required-key | name | nb-pt-25 |
| required-key | name | nb-pt-26 |
| required-key | name | nb-pt-27 |
| required-key | gender | nb-pt-28 |
| required-key | gender | nb-pt-29 |
| required-key | gender | nb-pt-30 |
| required-key | gender | nb-pt-31 |
| required-key | gender | nb-pt-32 |
| required-key | gender | nb-pt-33 |
| required-key | gender | nb-pt-34 |
| constraint-error | name | nb-pt-35 |
| constraint-error | name | nb-pt-36 |
| constraint-error | name | nb-pt-37 |
| constraint-error | name | nb-pt-38 |
| constraint-error | name | nb-pt-39 |
| constraint-error | name | nb-pt-40 |
| required-key | identifier.system | nb-pt-41 |
| required-key | identifier.system | nb-pt-42 |
| required-key | identifier.system | nb-pt-43 |
| required-key | identifier.system | nb-pt-44 |
| required-key | identifier.system | nb-pt-45 |
| required-key | identifier.value | nb-pt-46 |
| required-key | identifier.value | nb-pt-47 |
| required-key | identifier.value | nb-pt-48 |
| required-key | identifier.value | nb-pt-49 |
| required-key | identifier.value | nb-pt-50 |
Stats and charts
Results are aggregated in the aidbox_batch_validation schema. The
queries below read the latest run. Headline counts as a table:
WITH s AS (
SELECT sum(validated) AS validated,
sum(invalid) AS invalid,
sum(bytes) AS bytes
FROM aidbox_batch_validation.chunk_stat
WHERE run_id = (
SELECT run_id
FROM aidbox_batch_validation.chunk_stat
GROUP BY run_id
ORDER BY max(ts) DESC
LIMIT 1
)
AND completed
)
SELECT validated,
invalid,
(validated - invalid) AS valid,
bytes
FROM s| bytes | valid | invalid | validated |
|---|---|---|---|
| 8027 | 10 | 40 | 50 |
Valid vs invalid
Invalid Patients by issue
Each distinct issue (element and error code) is its own slice.
Where the problems concentrate
The same issues ranked, colored by error code.
Going further
- Install a real IG (e.g. US Core) and pass its canonical instead of the custom profile.
- Tune a run with
disable-terminology-validation,disable-constraint,strict-profile-resolution, and friends. - For a large type, add
Prefer: respond-asyncand raisenumber-of-chunks.