Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extensions representation #3

Open
niquola opened this issue Jun 16, 2017 · 0 comments
Open

Extensions representation #3

niquola opened this issue Jun 16, 2017 · 0 comments

Comments

@niquola
Copy link
Member

niquola commented Jun 16, 2017

Problem

Extensions representation is essentially driven by statically typed implementations
and XML. Both of have troubles with custom key-value objects and force to represent
extensions like a collection. Such representation again forces constraint on collections, unnecessary order, complexity with incidental accessing such attributes and expression in JSON schema.
But for JSON-like data-structures more natural would be use
object representation - just compare:

{
  resourceType: "Patient",
  extension: [{
      url: "ombCategory",
      valueCoding: {
        "system": "http://hl7.org/fhir/v3/Race",
        "code": "2106-3",
        "display": "White"
      }
    },....
  ]
}

pt.extension.where(system=...).valueCoding.code

{
  resourceType: "Patient",
  extension: {
    "omb/race": {
       $type: "Codding",
       coding: {
         system: "http://hl7.org/fhir/v3/Race",
         code: "2106-3",
         display: "White"
       }
    }
  }
}

pt.extension["omb/race"].coding.code

Notes

Problem with polymorphic elements and extensions is solved very nice in json-ld by context.
So, may be we could use json-ld with some constraints/conventions as primary format for FHIR JSON.

Also Grahame published manifest proposal, which is similar solution - http://www.healthintersections.com.au/?p=2626

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant