Skip to content

Instantly share code, notes, and snippets.

@yoon
Last active August 29, 2015 14:11
Show Gist options
  • Save yoon/0fb3199935f923580d39 to your computer and use it in GitHub Desktop.
Save yoon/0fb3199935f923580d39 to your computer and use it in GitHub Desktop.
DRAFT health-data-standards JSON schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"definitions": {
"entry": {
"allOf": [
{ "$ref": "#/definitions/thing_with_codes" },
{ "properties": {
"description": { "type": ["string", "null"] },
"specifics": { "type": ["string", "null"] },
"time": { "type": ["integer", "null"] },
"start_time": { "type": ["integer", "null"] },
"end_time": { "type": ["integer", "null"] },
"status_code": { "type": ["object", "null"] },
"mood_code": {
"type": "string",
"default": "EVN"
},
"negation_ind": { "type": ["boolean", "null"] },
"negation_reason": { "type": ["object", "null"] },
"oid": { "type": ["string", "null"] },
"reason": { "type": ["object", "null"] },
"cda_identifier": { "type": ["object", "null"] },
"values": { "type": ["array", "null"] }
}
}
]
},
"provider": {
"allOf": [
{ "$ref": "#/definitions/person" },
{ "properties": {
"specialty": { "type": ["string", "null"] },
"phone": { "type": ["string", "null"] },
"organization": { "$ref": "#/definitions/organization" },
"cda_identifiers": {
"type": "array",
"items": { "$ref": "#/definitions/cda_identifier" }
}
}
}
]
},
"transfer": {
"allOf": [
{ "$ref": "#/definitions/thing_with_codes" },
{ "properties": {
"time": { "type": ["integer", "null"] }
}
}
]
},
"lab_result": {
"allOf": [
{ "$ref": "#/definitions/entry" },
{ "properties": {
"reference_range": { "type": ["string", "null"] },
"interpretation": { "type": ["object", "null"] }
}
}
]
},
"fulfillment_history": {
"type": "object",
"properties": {
"prescription_number": { "type": ["string", "null"] },
"dispense_date": { "type": ["integer", "null"] },
"quantity_dispensed": { "type": ["object", "null"] },
"fill_number": { "type": ["integer", "null"] },
"fill_status": { "type": ["string", "null"] }
}
},
"order_information": {
"type": "object",
"properties": {
"order_number": { "type": ["string", "null"] },
"fills": { "type": ["integer", "null"] },
"quantity_ordered": { "type": ["hash", "null"] },
"order_expiration_date_time": { "type": ["integer", "null"] },
"order_date_time": { "type": ["integer", "null"] }
}
},
"address": {
"type": "object",
"properties": {
"street": { "type": ["array", "null"], "default": [] },
"city": { "type": ["string", "null"] },
"state": { "type": ["string", "null"] },
"zip": { "type": ["string", "null"] },
"country": { "type": ["string", "null"] },
"use": { "type": ["string", "null"] }
}
},
"telecom": {
"type": "object",
"properties": {
"use": { "type": ["string", "null"] },
"value": { "type": ["string", "null"] },
"preferred": { "type": ["boolean", "null"] }
}
},
"organization": {
"type": "object",
"properties": {
"name": { "type": ["string", "null"] },
"addresses": {
"type": "array",
"items": { "$ref": "#/definitions/address" }
},
"telecoms": {
"type": "array",
"items": { "$ref": "#/definitions/telecom" }
}
}
},
"person": {
"type": "object",
"properties": {
"title": { "type": ["string", "null"] },
"given_name": { "type": ["string", "null"] },
"family_name": { "type": ["string", "null"] },
"addresses": {
"type": "array",
"items": { "$ref": "#/definitions/address" }
},
"telecoms": {
"type": "array",
"items": { "$ref": "#/definitions/telecom" }
}
}
},
"guarantor": {
"type": "object",
"properties": {
"organization": { "$ref": "#/definitions/organization" },
"person": { "$ref": "#/definitions/person" },
"time": { "type": ["integer", "null"] },
"start_time": { "type": ["integer", "null"] },
"end_time": { "type": ["integer", "null"] }
}
},
"cda_identifier": {
"type": "object",
"properties": {
"root": { "type": ["string", "null"]},
"extension": { "type": ["string", "null"]}
}
},
"encounter": {
"allOf": [
{ "$ref": "#/definitions/entry" },
{ "properties": {
"admit_type": { "type": ["object", "null"]},
"discharge_disposition": { "type": ["object", "null"]},
"admit_time": { "type": ["integer", "null"]},
"discharge_time": { "type": ["integer", "null"]},
"transfer_to": { "$ref": "#/definitions/transfer" },
"transfer_from": { "$ref": "#/definitions/transfer" },
"facility": { "type": ["object", "null"] },
"reason": {
"oneOf": [
{ "type": "null" },
{ "$ref": "#/definitions/entry" }
]
}
}
}
]
},
"result_value": {
"type": "object"
},
"thing_with_codes": {
"type": "object",
"properties": {
"codes": { "type": ["object", "null"], "default": {} }
}
},
"provider_performance": {
"type": "object",
"properties": {
"start_date": { "type": ["integer", "null"] },
"end_date": { "type": ["integer", "null"] }
}
}
},
"type": "object",
"properties": {
"title": { "type": ["string", "null"] },
"first": { "type": ["string", "null"] },
"last": { "type": ["string", "null"] },
"gender": { "type": ["string", "null"] },
"birthdate": { "type": ["integer", "null"] },
"deathdate": { "type": ["integer", "null"] },
"religious_affiliation": { "type": ["object", "null"] },
"effective_time": { "type": ["integer", "null"] },
"race": { "type": ["object", "null"] },
"ethnicity": { "type": ["object", "null"] },
"languages": {
"type": "array",
"default": []
},
"test_id": { "type": ["string", "null"] },
"marital_status": { "type": ["object", "null"] },
"medical_record_number": { "type": ["string", "null"] },
"medical_record_assigner": { "type": ["string", "null"] },
"expired": { "type": ["boolean", "null"] },
"clinical_trial_participant": { "type": ["boolean", "null"] },
"provider_performances": {
"type": "array",
"items": { "$ref": "#/definitions/provider_performance" }
},
"addresses": {
"type": "array",
"items": { "$ref": "#/definitions/address" }
},
"telecoms": {
"type": "array",
"items": { "$ref": "#/definitions/telecom" }
},
"allergies": {
"type": "array",
"items": {
"allOf": [
{ "$ref": "#/definitions/entry" },
{ "properties": {
"type": { "type": ["object", "null"] },
"reaction": { "type": ["object", "null"] },
"severity": { "type": ["object", "null"] }
}
}
]
}
},
"care_goals": {
"type": "array",
"items": {
"$ref": "#/definitions/entry"
}
},
"conditions": {
"type": "array",
"items": {
"allOf": [
{ "$ref": "#/definitions/entry" },
{ "properties": {
"type": { "type": ["string", "null"] },
"cause_of_death": { "type": ["boolean", "null"] },
"time_of_death": { "type": ["integer", "null"] },
"priority": { "type": ["integer", "null"] },
"name": { "type": ["string", "null"] },
"ordinality": { "type": ["object", "null"] },
"severity": { "type": ["object", "null"] },
"treating_provider": {
"type": "array",
"items": { "$ref": "#/definitions/provider" }
}
}
}
]
}
},
"encounters": {
"type": "array",
"items": { "$ref": "#/definitions/encounter" }
},
"immunizations": {
"type": "array",
"items": {
"allOf": [
{ "$ref": "#/definitions/entry" },
{ "properties": {
"series_number": { "type": ["integer", "null"] },
"performer": { "$ref": "#/definitions/provider" },
"medication_product": { "type": ["object", "null"] }
}
}
]
}
},
"medical_equipment": {
"type": "array",
"items": {
"allOf": [
{ "$ref": "#/definitions/entry" },
{ "properties": {
"manufacturer": { "type": ["string", "null"] },
"anatomical_structure": { "type": ["object", "null"] },
"removal_time": { "type": ["integer", "null"] }
}
}
]
}
},
"medications": {
"type": "array",
"items": {
"allOf": [
{ "$ref": "#/definitions/entry" },
{ "properties": {
"administration_timing": { "type": ["object", "null"] },
"freetextsig": { "type": ["string", "null"] },
"dose": { "type": ["object", "null"] },
"type_of_medication": { "type": ["object", "null"] },
"status_of_medication": { "type": ["object", "null"] },
"fulfillment_history": {
"type": "array",
"items": { "$ref": "#/definitions/fulfillment_history" }
},
"order_information": {
"type": "array",
"items": { "$ref": "#/definitions/order_information" }
},
"route": { "type": ["object", "null"] },
"site": { "type": ["object", "null"] },
"dose_restriction": { "type": ["object", "null"] },
"fulfillment_instructions": { "type": ["string", "null"] },
"indication": { "type": ["object", "null"] },
"product_form": { "type": ["object", "null"] },
"vehicle": { "type": ["object", "null"] },
"reaction": { "type": ["object", "null"] },
"delivery_method": { "type": ["object", "null"] },
"patient_instructions": { "type": ["string", "null"] },
"dose_indicator": { "type": ["string", "null"] },
"cumulative_medication_duration": { "type": ["object", "null"] }
}
}
]
}
},
"procedures": {
"type": "array",
"items": {
"allOf": [
{ "$ref": "#/definitions/entry" },
{ "properties": {
"site": { "type": ["object", "null"] },
"incision_time": { "type": ["integer", "null"] },
"ordinality": { "type": ["object", "null"] },
"source": { "type": ["object", "null"] }
}
}
]
}
},
"results": {
"type": "array",
"items": { "$ref": "#/definitions/lab_result" }
},
"social_history": {
"type": "array",
"items": {
"$ref": "#/definitions/entry"
}
},
"vital_signs": {
"type": "array",
"items": { "$ref": "#/definitions/lab_result" }
},
"support": {
"type": "array",
"items": {
"allOf": [
{ "$ref": "#/definitions/entry" },
{ "properties": {
"address": { "$ref": "#/definitions/address" },
"telecom": { "$ref": "#/definitions/telecom" },
"title": { "type": ["string", "null"] },
"given_name": { "type": ["string", "null"] },
"family_name": { "type": ["string", "null"] },
"mothers_maiden_name": { "type": ["string", "null"] },
"type": { "type": ["string", "null"] },
"relationship": { "type": ["string", "null"] }
}
}
]
}
},
"advance_directives": {
"type": "array",
"items": { "$ref": "#/definitions/entry" }
},
"insurance_providers": {
"type": "array",
"items": {
"allOf": [
{ "$ref": "#/definitions/entry" },
{ "properties": {
"payer": { "$ref": "#/definitions/organization" },
"guarantors": {
"type": "array",
"items": { "$ref": "#/definitions/guarantor" }
},
"subscriber": { "$ref": "#/definitions/person" },
"type": { "type": ["string", "null"] },
"member_id": { "type": ["string", "null"] },
"relationship": { "type": ["object", "null"] },
"financial_responsibility_type": { "type": ["object", "null"] },
"name": { "type": ["string", "null"] }
}
}
]
}
},
"functional_statuses": {
"type": "array",
"items": {
"allOf": [
{ "$ref": "#/definitions/entry" },
{ "properties": {
"type": { "type": ["string", "null"] },
"source": { "type": ["object", "null"] }
}
}
]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment