The JSON archetype below was generated by traversing the P_XX class structure I have developed that simplifies the persisted form of an archetype. It mainly turns a lot of fields into Strings, including our old friends occurrences and cardinality. Things to note:
- ordering of attributes is somewhat random
- JSON is pretty mindless in some ways - Hash keys are serialised in the same way as attribute names, which must make input parsing pretty annoying. At least I think I have this right.
The Eiffel P_ classes can be found here; as yet I have not documented them, but the idea would be for the community to agree on the attribute structure of each class. I can change things quickly in the AWB for people to look at different options, and I have some rule-driven capability.
My first question is: can anyone validate this in some basic way? Then - can we work out what flavour of JSON we want for ADL 1.5 archetypes?
Feedback welcome.
- thomas
{
"original_language": "ISO_639-1::pt-br",
"translations": [
"en": {
"language": "ISO_639-1::en",
"author": [
"name": "Sergio Miranda Freire",
"organisation": "Universidade do Estado do Rio de Janeiro - UERJ",
"email": ["sergio@lampada.uerj.br"](mailto:sergio@lampada.uerj.br)
]
},
],
"description": {
"original_author": [
"name": "Sergio Miranda Freire & Rigoleta Dutra Mediano Dias",
"organisation": "Universidade do Estado do Rio de Janeiro - UERJ",
"email": ["sergio@lampada.uerj.br"](mailto:sergio@lampada.uerj.br),
"date": "22/05/2009",
],
"details": [
"en": {
"language": "ISO_639-1::en",
"purpose": "Representation of a person's demographic data.",
"use": "Used in demographic service to collect a person's data.",
"keywords": ["demographic service", "person's data"],
"misuse": "",
"copyright": "© 2011 openEHR Foundation"
},
"pt-br": {
"language": "ISO_639-1::pt-br",
"purpose": "Representação dos dados demográficos de uma pessoa.",
"use": "Usado em serviço demográficos para coletar os dados de uma pessoa.",
"keywords": ["serviço demográfico", "dados de uma pessoa"],
"misuse": "",
"copyright": "© 2011 openEHR Foundation"
},
],
"lifecycle_state": "Authordraft",
"other_contributors": ["Sebastian Garde, Ocean Informatics, Germany (Editor)", "Omer Hotomaroglu, Turkey (Editor)", "Heather Leslie, Ocean Informatics, Australia (Editor)"],
"other_details": [
"references": "ISO/TS 22220:2008(E) - Identification of Subject of Care - Technical Specification - International Organization for Standardization."
]
},
"artefact_object_type": "DIFFERENTIAL_ARCHETYPE",
"archetype_id": "openEHR-DEMOGRAPHIC-PERSON.person.v1",
"adl_version": "1.5",
"artefact_type": "archetype",
"definition": {
"rm_type_name": "PERSON",
"node_id": "at0000",
"attributes": [
{
"rm_attribute_name": "details",
"children": [
{
"rm_type_name": "ITEM_TREE",
"node_id": "at0001",
"occurrences": "1",
"includes": [
{
"expression": {
"type": "Boolean",
"operator": {
"value": 2007
},
"left_operand": {
"type": "String",
"reference_type": "attibute",
"item": "archetype_id/value"
},
"right_operand": {
"type": "C_STRING",
"reference_type": "constraint",
"item": {
"regexp": "(person_details)[a-zA-Z0-9_-]*\\.v1",
"is_open": False,
"regexp_default_delimiter": True
}
},
"precedence_overridden": False
}
},
],
"is_closed": False
},
],
"is_multiple": False
},
{
"rm_attribute_name": "identities",
"children": [
{
"rm_type_name": "PARTY_IDENTITY",
"node_id": "at0002",
"occurrences": "1",
"includes": [
{
"expression": {
"type": "Boolean",
"operator": {
"value": 2007
},
"left_operand": {
"type": "String",
"reference_type": "attibute",
"item": "archetype_id/value"
},
"right_operand": {
"type": "C_STRING",
"reference_type": "constraint",
"item": {
"regexp": "(person_name)[a-zA-Z0-9_-]*\\.v1",
"is_open": False,
"regexp_default_delimiter": True
}
},
"precedence_overridden": False
}
},
],
"is_closed": False
},
],
"is_multiple": True
},
{
"rm_attribute_name": "contacts",
"children": [
{
"rm_type_name": "CONTACT",
"node_id": "at0003",
"occurrences": "1",
"attributes": [
{
"rm_attribute_name": "addresses",
"children": [
{
"rm_type_name": "ADDRESS",
"node_id": "at0030",
"occurrences": "1",
"includes": [
{
"expression": {
"type": "Boolean",
"operator": {
"value": 2007
},
"left_operand": {
"type": "String",
"reference_type": "attibute",
"item": "archetype_id/value"
},
"right_operand": {
"type": "C_STRING",
"reference_type": "constraint",
"item": {
"regexp": "(address)([a-zA-Z0-9_-]+)*\\.v1",
"is_open": False,
"regexp_default_delimiter": True
}
},
"precedence_overridden": False
}
},
{
"expression": {
"type": "Boolean",
"operator": {
"value": 2007
},
"left_operand": {
"type": "String",
"reference_type": "attibute",
"item": "archetype_id/value"
},
"right_operand": {
"type": "C_STRING",
"reference_type": "constraint",
"item": {
"regexp": "(electronic_communication)[a-zA-Z0-9_-]*\\.v1",
"is_open": False,
"regexp_default_delimiter": True
}
},
"precedence_overridden": False
}
},
],
"is_closed": False
},
],
"is_multiple": True
}
]
},
],
"is_multiple": True
},
{
"rm_attribute_name": "relationships",
"children": [
{
"rm_type_name": "PARTY_RELATIONSHIP",
"node_id": "at0004",
"attributes": [
{
"rm_attribute_name": "details",
"children": [
{
"rm_type_name": "ITEM_TREE",
"attributes": [
{
"rm_attribute_name": "items",
"children": [
{
"rm_type_name": "ELEMENT",
"node_id": "at0040",
"attributes": [
{
"rm_attribute_name": "value",
"children": [
{
"rm_type_name": "DV_TEXT"
},
{
"rm_type_name": "DV_CODED_TEXT",
"attributes": [
{
"rm_attribute_name": "defining_code",
"children": [
{
"rm_type_name": "CODE_PHRASE",
"target": "ac0000"
},
],
"is_multiple": False
}
]
},
],
"is_multiple": False
}
]
},
],
"is_multiple": True
}
]
},
],
"is_multiple": False
}
]
},
],
"is_multiple": True
}
]
},
"ontology": {
"term_definitions": [
"pt-br": {
"at0000": {
"text": "Dados da pessoa",
"description": "Dados da pessoa."
},
"at0001": {
"text": "Detalhes",
"description": "Detalhes demográficos da pessoa."
},
"at0002": {
"text": "Nome",
"description": "Conjunto de dados que especificam o nome da pessoa."
},
"at0003": {
"text": "Contatos",
"description": "Contatos da pessoa."
},
"at0004": {
"text": "Relacionamentos",
"description": "Relacionamentos de uma pessoa, especialmente laços familiares."
},
"at0030": {
"text": "Endereço",
"description": "Endereços vinculados a um único contato, ou seja, com o mesmo período de validade."
},
"at0040": {
"text": "Grau de parentesco",
"description": "Define o grau de parentesco entre as pessoas envolvidas."
}
},
"en": {
"at0000": {
"text": "Person",
"description": "Personal demographic data."
},
"at0001": {
"text": "Demographic details",
"description": "A person's demographic details."
},
"at0002": {
"text": "Name",
"description": "A person's name."
},
"at0003": {
"text": "Contacts",
"description": "A person's contacts."
},
"at0004": {
"text": "Relationships",
"description": "A person's relationships, especially family ties."
},
"at0030": {
"text": "Addresses",
"description": "Addresses linked to a single contact, i.e. with the same time validity."
},
"at0040": {
"text": "Relationship type",
"description": "Defines the type of relationship between related persons."
}
},
],
"constraint_definitions": [
"pt-br": {
"ac0000": {
"text": "Códigos para tipo de parentesco",
"description": "códigos válidos para tipo de parentesco."
}
},
"en": {
"ac0000": {
"text": "Codes for type of relationship",
"description": "Valid codes for type of relationship."
}
}
]
},
"is_controlled": False,
"is_generated": True,
"is_valid": True
}
