├── .gitignore ├── Gruntfile.js ├── client ├── bb-client.js ├── build-definitions.js ├── client.js ├── definitions.json ├── entry.js ├── guid.js ├── jquery.js ├── namespace.js ├── search-specification.js ├── search.js └── utils.js ├── dist ├── fhir-client.js ├── fhir-client.min.js └── test.html ├── example.js ├── example └── index.html ├── npm-shrinkwrap.json ├── package.json ├── tasks └── generate_js_client.py ├── test ├── fixtures │ ├── observation.json │ ├── observation.simplified.json │ ├── patient.json │ ├── patient.search.json │ └── patient.simplified.json ├── mocha.opts └── test.js └── vendor ├── conformance.json └── jQuery.js /.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | *.pyc 3 | *.tmproj 4 | *~ 5 | .project 6 | *# 7 | .#* 8 | *.swp 9 | node_modules 10 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | 3 | grunt.loadNpmTasks('grunt-contrib-clean'); 4 | grunt.loadNpmTasks('grunt-contrib-concat'); 5 | grunt.loadNpmTasks('grunt-browserify'); 6 | grunt.loadNpmTasks('grunt-shell'); 7 | grunt.loadNpmTasks('grunt-curl'); 8 | grunt.loadNpmTasks('grunt-contrib-uglify'); 9 | 10 | grunt.initConfig({ 11 | curl: { 12 | conformance: { 13 | dest: 'vendor/conformance.json', 14 | src: 'http://hl7-fhir.github.io/conformance-base.json' 15 | } 16 | }, 17 | shell: { 18 | browserify: { 19 | command: "./node_modules/.bin/browserify -e client/entry.js -i './node_modules/jsdom/**' > dist/fhir-client.js", 20 | options: { 21 | failOnError: true, 22 | stderr: true 23 | } 24 | } 25 | }, 26 | uglify: { 27 | minifiedLib: { 28 | files: { 29 | 'dist/fhir-client.min.js': ['dist/fhir-client.js'] 30 | } 31 | } 32 | } 33 | }); 34 | 35 | grunt.registerTask('browserify', 'Browserify to create window.FHIR', ['shell:browserify']); 36 | grunt.registerTask('conformance', 'Download conformance base', ['curl:conformance']); 37 | grunt.registerTask('default', ['browserify', 'uglify:minifiedLib']); 38 | grunt.registerTask('all', ['conformance', 'default']); 39 | }; 40 | -------------------------------------------------------------------------------- /client/bb-client.js: -------------------------------------------------------------------------------- 1 | var $ = jQuery = require('./jquery'); 2 | var FhirClient = require('./client'); 3 | var Guid = require('./guid'); 4 | 5 | var BBClient = module.exports = {debug: true} 6 | BBClient.jQuery = BBClient.$ = jQuery; 7 | 8 | BBClient.ready = function(hash, callback){ 9 | 10 | var mustClearHash = false; 11 | if (arguments.length == 1){ 12 | mustClearHash = true; 13 | callback = hash; 14 | hash = window.location.hash; 15 | } 16 | 17 | var oauthResult = hash.match(/#(.*)/); 18 | oauthResult = oauthResult ? oauthResult[1] : ""; 19 | oauthResult = oauthResult.split(/&/); 20 | 21 | BBClient.authorization = null; 22 | BBClient.state = null; 23 | 24 | var authorization = {}; 25 | for (var i = 0; i < oauthResult.length; i++){ 26 | var kv = oauthResult[i].split(/=/); 27 | if (kv[0].length > 0) { 28 | authorization[decodeURIComponent(kv[0])] = decodeURIComponent(kv[1]); 29 | } 30 | } 31 | 32 | if (Object.keys(authorization).length > 0 && authorization.state){ 33 | BBClient.authorization = authorization; 34 | BBClient.state = JSON.parse(localStorage[BBClient.authorization.state]); 35 | } else { 36 | return; 37 | } 38 | 39 | console.log(BBClient); 40 | 41 | // don't expose hash in the URL while in production mode 42 | if (mustClearHash && BBClient.debug !== true) { 43 | window.location.hash=""; 44 | } 45 | 46 | var fhirClientParams = BBClient.fhirAuth = { 47 | serviceUrl: BBClient.state.provider.bb_api.fhir_service_uri, 48 | patientId: authorization.patient 49 | }; 50 | 51 | if (BBClient.authorization.access_token !== undefined) { 52 | fhirClientParams.auth = { 53 | type: 'bearer', 54 | token: BBClient.authorization.access_token 55 | }; 56 | } 57 | process.nextTick(function(){ 58 | var ret = FhirClient(fhirClientParams); 59 | ret.state = JSON.parse(JSON.stringify(BBClient.state)); 60 | callback && callback(ret); 61 | }); 62 | } 63 | 64 | function providers(fhirServiceUrl, callback){ 65 | jQuery.get( 66 | fhirServiceUrl+"/metadata", 67 | function(r){ 68 | var res = { 69 | "name": "SMART on FHIR Testing Server", 70 | "description": "Dev server for SMART on FHIR", 71 | "url": null, 72 | "oauth2": { 73 | "registration_uri": null, 74 | "authorize_uri": null, 75 | "token_uri": null 76 | }, 77 | "bb_api":{ 78 | "fhir_service_uri": fhirServiceUrl, 79 | "search": fhirServiceUrl + "/DocumentReference" 80 | } 81 | }; 82 | 83 | try { 84 | jQuery.each(r.rest[0].security.extension, function(responseNum, arg){ 85 | if (arg.url === "http://fhir-registry.smartplatforms.org/Profile/oauth-uris#register") { 86 | res.oauth2.registration_uri = arg.valueUri; 87 | } else if (arg.url === "http://fhir-registry.smartplatforms.org/Profile/oauth-uris#authorize") { 88 | res.oauth2.authorize_uri = arg.valueUri; 89 | } else if (arg.url === "http://fhir-registry.smartplatforms.org/Profile/oauth-uris#token") { 90 | res.oauth2.token_uri = arg.valueUri; 91 | } 92 | }); 93 | } 94 | catch (err) { 95 | } 96 | 97 | callback && callback(res); 98 | }, 99 | "json" 100 | ); 101 | }; 102 | 103 | BBClient.noAuthFhirProvider = function(serviceUrl){ 104 | return { 105 | "oauth2": null, 106 | "bb_api":{ 107 | "fhir_service_uri": serviceUrl 108 | } 109 | } 110 | }; 111 | 112 | function relative(url){ 113 | return (window.location.protocol + "//" + window.location.host + window.location.pathname).match(/(.*\/)[^\/]*/)[1] + url; 114 | } 115 | 116 | function getParameterByName(name) { 117 | name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); 118 | var regexS = "[\\?&]" + name + "=([^&#]*)"; 119 | var regex = new RegExp(regexS); 120 | var results = regex.exec(window.location.search); 121 | if(results == null) 122 | return ""; 123 | else 124 | return decodeURIComponent(results[1].replace(/\+/g, " ")); 125 | } 126 | 127 | BBClient.authorize = function(params){ 128 | 129 | if (!params.client){ 130 | params = { 131 | client: params 132 | }; 133 | } 134 | 135 | if (!params.client.redirect_uri){ 136 | params.client.redirect_uri = relative(""); 137 | } 138 | 139 | if (!params.client.redirect_uri.match(/:\/\//)){ 140 | params.client.redirect_uri = relative(params.client.redirect_uri); 141 | } 142 | 143 | var launch = getParameterByName("launch"); 144 | if (launch){ 145 | if (!params.client.scope.match(/launch:/)){ 146 | params.client.scope += " launch:"+launch; 147 | } 148 | } 149 | 150 | var server = getParameterByName("iss"); 151 | if (server){ 152 | if (!params.server){ 153 | params.server = server; 154 | } 155 | } 156 | 157 | providers(params.server, function(provider){ 158 | 159 | params.provider = provider; 160 | 161 | var state = Guid.newGuid(); 162 | var client = params.client; 163 | 164 | if (params.provider.oauth2 == null) { 165 | localStorage[state] = JSON.stringify(params); 166 | window.location.href = client.redirect_uri + "#state="+state; 167 | return; 168 | } 169 | 170 | localStorage[state] = JSON.stringify(params); 171 | 172 | console.log("sending client reg", params.client); 173 | 174 | var redirect_to=params.provider.oauth2.authorize_uri + "?" + 175 | "client_id="+client.client_id+"&"+ 176 | "response_type=token&"+ 177 | "scope="+client.scope+"&"+ 178 | "redirect_uri="+client.redirect_uri+"&"+ 179 | "state="+state; 180 | 181 | window.location.href = redirect_to; 182 | }); 183 | }; 184 | 185 | 186 | -------------------------------------------------------------------------------- /client/build-definitions.js: -------------------------------------------------------------------------------- 1 | var c = require('../vendor/conformance.json'); 2 | var definitions = {}; 3 | var camelCased = function(s){ 4 | return s.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); }); 5 | }; 6 | 7 | c.rest[0].resource.forEach(function(r){ 8 | var params = []; 9 | definitions[r.type] = { 10 | params: params 11 | }; 12 | 13 | r.searchParam.forEach(function(sp){ 14 | params.push({ 15 | name: camelCased(sp.name), 16 | wireName: sp.name, 17 | type: sp.type 18 | }); 19 | }); 20 | }); 21 | 22 | module.exports = definitions; 23 | -------------------------------------------------------------------------------- /client/client.js: -------------------------------------------------------------------------------- 1 | var btoa = require('btoa'); 2 | var Search = require('./search'); 3 | var $ = jQuery = require('./jquery'); 4 | 5 | module.exports = FhirClient; 6 | 7 | function absolute(id, server) { 8 | if (id.match(/^http/)) return id; 9 | if (id.match(/^urn/)) return id; 10 | return server.serviceUrl + '/' + id; 11 | } 12 | 13 | var regexpSpecialChars = /([\[\]\^\$\|\(\)\\\+\*\?\{\}\=\!])/gi; 14 | 15 | function relative(id, server) { 16 | if (!id.match(/^http/)) { 17 | id = server.serviceUrl + '/' + id 18 | } 19 | var quotedBase = ( server.serviceUrl + '/' ).replace(regexpSpecialChars, '\\$1'); 20 | var matcher = new RegExp("^"+quotedBase + "([^/]+)/([^/]+)(?:/_history/(.*))?$"); 21 | var match = id.match(matcher); 22 | if (match === null) { 23 | throw "Couldn't determine a relative URI for " + id; 24 | } 25 | 26 | var params = { 27 | resource: match[1], 28 | id: match[2], 29 | version: match[3] 30 | }; 31 | 32 | return params; 33 | } 34 | 35 | function ClientPrototype(){}; 36 | var clientUtils = require('./utils'); 37 | Object.keys(clientUtils).forEach(function(k){ 38 | ClientPrototype.prototype[k] = clientUtils[k]; 39 | }); 40 | 41 | function FhirClient(p) { 42 | // p.serviceUrl 43 | // p.auth { 44 | // type: 'none' | 'basic' | 'bearer' 45 | // basic --> username, password 46 | // bearer --> token 47 | // } 48 | 49 | var cache = {}; 50 | var client = new ClientPrototype(); 51 | 52 | var server = client.server = { 53 | serviceUrl: p.serviceUrl, 54 | auth: p.auth 55 | } 56 | 57 | client.patientId = p.patientId; 58 | client.practitionerId = p.practitionerId; 59 | 60 | client.cache = { 61 | get: function(p) { 62 | var url = absolute(typeof p === 'string' ? p : (p.resource + '/'+p.id), server); 63 | if (url in cache) { 64 | return getLocal(url); 65 | } 66 | return null; 67 | } 68 | }; 69 | 70 | 71 | server.auth = server.auth || { 72 | type: 'none' 73 | }; 74 | 75 | if (!client.server.serviceUrl || !client.server.serviceUrl.match(/https?:\/\/.+[^\/]$/)) { 76 | throw "Must supply a `server` propery whose `serviceUrl` begins with http(s) " + 77 | "and does NOT include a trailing slash. E.g. `https://fhir.aws.af.cm/fhir`"; 78 | } 79 | 80 | client.indexResource = function(id, r) { 81 | r.resourceId = relative(id, server); 82 | var ret = [r]; 83 | cache[absolute(id, server)] = r; 84 | return ret; 85 | }; 86 | 87 | client.indexFeed = function(atomResult) { 88 | var ret = []; 89 | var feed = atomResult.feed || atomResult; 90 | (feed.entry || []).forEach(function(e){ 91 | var more = client.indexResource(e.id, e.content); 92 | [].push.apply(ret, more); 93 | }); 94 | return ret; 95 | }; 96 | 97 | client.authenticated = function(p) { 98 | if (server.auth.type === 'none') { 99 | return p; 100 | } 101 | 102 | var h; 103 | if (server.auth.type === 'basic') { 104 | h = "Basic " + btoa(server.auth.username + ":" + server.auth.password); 105 | } else if (server.auth.type === 'bearer') { 106 | h = "Bearer " + server.auth.token; 107 | } 108 | if (!p.headers) {p.headers = {};} 109 | p.headers['Authorization'] = h 110 | //p.beforeSend = function (xhr) { xhr.setRequestHeader ("Authorization", h); } 111 | 112 | return p; 113 | }; 114 | 115 | function handleReference(p){ 116 | return function(from, to) { 117 | 118 | // Resolve any of the following: 119 | // 1. contained resource 120 | // 2. already-fetched resource 121 | // 3. not-yet-fetched resource 122 | 123 | if (to.reference === undefined) { 124 | throw "Can't follow a non-reference: " + to; 125 | } 126 | 127 | if (to.reference.match(/^#/)) { 128 | return p.contained(from, to.reference.slice(1)); 129 | } 130 | 131 | var url = absolute(to.reference, server); 132 | if (url in cache) { 133 | return p.local(url); 134 | } 135 | 136 | if (!p.remote) { 137 | throw "Can't look up unfetched resource " + url; 138 | } 139 | 140 | return p.remote(url); 141 | } 142 | }; 143 | 144 | client.cachedLink = handleReference({ 145 | contained: getContained, 146 | local: getLocal 147 | }); 148 | 149 | client.followLink = handleReference({ 150 | contained: followContained, 151 | local: followLocal, 152 | remote: followRemote 153 | }); 154 | 155 | function getContained(from, id) { 156 | var matches = from.contained.filter(function(c){ 157 | return c.id === id; 158 | }); 159 | if (matches.length !== 1) { 160 | return null; 161 | } 162 | return matches[0]; 163 | } 164 | 165 | function getLocal(url) { 166 | return cache[url]; 167 | } 168 | 169 | function followContained(from, id) { 170 | var ret = new $.Deferred(); 171 | var val = getContained(from, id); 172 | setTimeout(function(){ 173 | if (val === null) { 174 | return ret.reject("No contained resource matches #"+id); 175 | } 176 | return ret.resolve(val); 177 | }, 0); 178 | return ret; 179 | }; 180 | 181 | function followLocal(url) { 182 | var ret = new $.Deferred(); 183 | var val = getLocal(url); 184 | setTimeout(function(){ 185 | if (val === null) { 186 | return ret.reject("No local resource matches #"+id); 187 | } 188 | return ret.resolve(val); 189 | }, 0); 190 | return ret; 191 | }; 192 | 193 | function followRemote(url) { 194 | var getParams = relative(url, server); 195 | return client.get(getParams); 196 | }; 197 | 198 | client.get = function(p) { 199 | // p.resource, p.id, ?p.version, p.include 200 | 201 | var ret = new $.Deferred(); 202 | var url = server.serviceUrl + '/' + p.resource + '/' + p.id; 203 | 204 | $.ajax(client.authenticated({ 205 | type: 'GET', 206 | url: url, 207 | dataType: 'json' 208 | })) 209 | .done(function(data, status){ 210 | var ids = client.indexResource(url, data); 211 | if (ids.length !== 1) { 212 | ret.reject("Didn't get exactly one result for " + url); 213 | } 214 | ret.resolve(ids[0]); 215 | }) 216 | .fail(function(){ 217 | ret.reject("Could not fetch " + url, arguments); 218 | }); 219 | return ret; 220 | }; 221 | 222 | client.urlFor = function(searchSpec){ 223 | return client.server.serviceUrl+searchSpec.queryUrl(); 224 | } 225 | 226 | client.search = function(searchSpec){ 227 | // p.resource, p.count, p.searchTerms 228 | var s = Search({ 229 | client: client, 230 | spec: searchSpec 231 | }); 232 | 233 | return s.execute(); 234 | } 235 | 236 | client.drain = function(searchSpec, batch){ 237 | var d = $.Deferred(); 238 | 239 | if (batch === undefined){ 240 | var db = []; 241 | batch = function(vs) { 242 | vs.forEach(function(v){ 243 | db.push(v); 244 | }); 245 | } 246 | } 247 | 248 | db = db || {}; 249 | client.search(searchSpec) 250 | .done(function drain(vs, cursor){ 251 | batch(vs); 252 | if (cursor.hasNext()){ 253 | cursor.next().done(drain); 254 | } else { 255 | d.resolve(); 256 | } 257 | }); 258 | return d.promise(); 259 | }; 260 | 261 | var specs = require('./search-specification')({ 262 | "search": client, 263 | "drain": client 264 | }); 265 | 266 | function patientPropertyName(searchSpec){ 267 | var propertyName = null; 268 | ['patient', 'subject'].forEach(function(pname){ 269 | if (typeof searchSpec[pname] === 'function'){ 270 | propertyName = pname; 271 | } 272 | }); 273 | return propertyName; 274 | } 275 | 276 | function withDefaultPatient(searchSpec){ 277 | var propertyName = patientPropertyName(searchSpec); 278 | if (propertyName !== null && client.patientId !== undefined){ 279 | searchSpec = searchSpec[propertyName](specs.Patient._id(client.patientId)); 280 | } else if (searchSpec.resourceName === 'Patient'){ 281 | searchSpec = searchSpec._id(client.patientId); 282 | } else { 283 | searchSpec = null; 284 | } 285 | 286 | return searchSpec; 287 | } 288 | 289 | function getterFor(r){ 290 | return function(id){ 291 | 292 | if (r.resourceName === 'Patient' && id === undefined){ 293 | id = client.patientId 294 | } 295 | 296 | return client.get({ 297 | resource: r.resourceName, 298 | id: id 299 | }); 300 | } 301 | }; 302 | 303 | function writeTodo(){ 304 | throw "Write functionality not implemented."; 305 | }; 306 | 307 | client.context = {}; 308 | 309 | client.context.practitioner = { 310 | 'read': function(){ 311 | return client.api.Practitioner.read(client.practitionerId); 312 | } 313 | }; 314 | 315 | client.context.patient = { 316 | 'read': function(){ 317 | return client.api.Patient.read(client.practitionerId); 318 | } 319 | }; 320 | 321 | client.api = {}; 322 | 323 | // Create SearchSpec-specific handlers 324 | // as properties on some target object 325 | // e.g. target.Alert, target.Condition, etc. 326 | function decorateWithApi(target, tweaks){ 327 | 328 | tweaks = tweaks || {filter:function(){return true;}}; 329 | 330 | Object.keys(specs).forEach(function(r){ 331 | 332 | if (!tweaks.filter(specs[r])){ 333 | return; 334 | } 335 | 336 | target[r] = { 337 | read: getterFor(specs[r]), 338 | post: writeTodo, 339 | put: writeTodo, 340 | delete: writeTodo, 341 | drain: function(){ 342 | return target[r].where.drain(); 343 | }, 344 | search: function(){ 345 | return target[r].where.search(); 346 | }, 347 | where: specs[r] 348 | }; 349 | 350 | if (tweaks.where){ 351 | target[r].where = tweaks.where(target[r].where); 352 | } 353 | 354 | }); 355 | } 356 | 357 | decorateWithApi(client.api); 358 | decorateWithApi(client.context.patient, { 359 | filter: withDefaultPatient, 360 | where: withDefaultPatient 361 | }); 362 | 363 | return client; 364 | } 365 | -------------------------------------------------------------------------------- /client/definitions.json: -------------------------------------------------------------------------------- 1 | { 2 | "Address": { 3 | "edges": { 4 | "city": { 5 | "parser": "string" 6 | }, 7 | "country": { 8 | "parser": "string" 9 | }, 10 | "line": { 11 | "parser": "string" 12 | }, 13 | "period": { 14 | "next": "Period" 15 | }, 16 | "state": { 17 | "parser": "string" 18 | }, 19 | "text": { 20 | "parser": "string" 21 | }, 22 | "use": { 23 | "parser": "string" 24 | }, 25 | "zip": { 26 | "parser": "string" 27 | } 28 | } 29 | }, 30 | "AdverseReaction": { 31 | "edges": { 32 | "contained": { 33 | "next": "Resource" 34 | }, 35 | "didNotOccurFlag": { 36 | "parser": "boolean" 37 | }, 38 | "exposure": { 39 | "next": "AdverseReaction.exposure" 40 | }, 41 | "extension": { 42 | "next": "Extension" 43 | }, 44 | "reactionDate": { 45 | "parser": "date" 46 | }, 47 | "recorder": { 48 | "next": "ResourceReference" 49 | }, 50 | "subject": { 51 | "next": "ResourceReference" 52 | }, 53 | "symptom": { 54 | "next": "AdverseReaction.symptom" 55 | }, 56 | "text": { 57 | "next": "Narrative" 58 | } 59 | } 60 | }, 61 | "AdverseReaction.exposure": { 62 | "edges": { 63 | "causalityExpectation": { 64 | "parser": "string" 65 | }, 66 | "exposureDate": { 67 | "parser": "date" 68 | }, 69 | "exposureType": { 70 | "parser": "string" 71 | }, 72 | "substance": { 73 | "next": "ResourceReference" 74 | } 75 | } 76 | }, 77 | "AdverseReaction.symptom": { 78 | "edges": { 79 | "code": { 80 | "next": "CodeableConcept" 81 | }, 82 | "severity": { 83 | "parser": "string" 84 | } 85 | } 86 | }, 87 | "Alert": { 88 | "edges": { 89 | "author": { 90 | "next": "ResourceReference" 91 | }, 92 | "category": { 93 | "next": "CodeableConcept" 94 | }, 95 | "contained": { 96 | "next": "Resource" 97 | }, 98 | "extension": { 99 | "next": "Extension" 100 | }, 101 | "note": { 102 | "parser": "string" 103 | }, 104 | "status": { 105 | "parser": "string" 106 | }, 107 | "subject": { 108 | "next": "ResourceReference" 109 | }, 110 | "text": { 111 | "next": "Narrative" 112 | } 113 | } 114 | }, 115 | "AllergyIntolerance": { 116 | "edges": { 117 | "contained": { 118 | "next": "Resource" 119 | }, 120 | "criticality": { 121 | "parser": "string" 122 | }, 123 | "extension": { 124 | "next": "Extension" 125 | }, 126 | "identifier": { 127 | "next": "Identifier" 128 | }, 129 | "reaction": { 130 | "next": "ResourceReference" 131 | }, 132 | "recordedDate": { 133 | "parser": "date" 134 | }, 135 | "recorder": { 136 | "next": "ResourceReference" 137 | }, 138 | "sensitivityTest": { 139 | "next": "ResourceReference" 140 | }, 141 | "sensitivityType": { 142 | "parser": "string" 143 | }, 144 | "status": { 145 | "parser": "string" 146 | }, 147 | "subject": { 148 | "next": "ResourceReference" 149 | }, 150 | "substance": { 151 | "next": "ResourceReference" 152 | }, 153 | "text": { 154 | "next": "Narrative" 155 | } 156 | } 157 | }, 158 | "Attachment": { 159 | "edges": { 160 | "contentType": { 161 | "parser": "string" 162 | }, 163 | "data": { 164 | "parser": "string" 165 | }, 166 | "hash": { 167 | "parser": "string" 168 | }, 169 | "language": { 170 | "parser": "string" 171 | }, 172 | "size": { 173 | "parser": "integer" 174 | }, 175 | "title": { 176 | "parser": "string" 177 | }, 178 | "url": { 179 | "parser": "string" 180 | } 181 | } 182 | }, 183 | "CarePlan": { 184 | "edges": { 185 | "activity": { 186 | "next": "CarePlan.activity" 187 | }, 188 | "concern": { 189 | "next": "ResourceReference" 190 | }, 191 | "contained": { 192 | "next": "Resource" 193 | }, 194 | "extension": { 195 | "next": "Extension" 196 | }, 197 | "goal": { 198 | "next": "CarePlan.goal" 199 | }, 200 | "identifier": { 201 | "next": "Identifier" 202 | }, 203 | "modified": { 204 | "parser": "date" 205 | }, 206 | "notes": { 207 | "parser": "string" 208 | }, 209 | "participant": { 210 | "next": "CarePlan.participant" 211 | }, 212 | "patient": { 213 | "next": "ResourceReference" 214 | }, 215 | "period": { 216 | "next": "Period" 217 | }, 218 | "status": { 219 | "parser": "string" 220 | }, 221 | "text": { 222 | "next": "Narrative" 223 | } 224 | } 225 | }, 226 | "CarePlan.activity": { 227 | "edges": { 228 | "actionTaken": { 229 | "next": "ResourceReference" 230 | }, 231 | "category": { 232 | "parser": "string" 233 | }, 234 | "code": { 235 | "next": "CodeableConcept" 236 | }, 237 | "dailyAmount": { 238 | "next": "Quantity" 239 | }, 240 | "details": { 241 | "parser": "string" 242 | }, 243 | "location": { 244 | "next": "ResourceReference" 245 | }, 246 | "notes": { 247 | "parser": "string" 248 | }, 249 | "performer": { 250 | "next": "ResourceReference" 251 | }, 252 | "product": { 253 | "next": "ResourceReference" 254 | }, 255 | "prohibited": { 256 | "parser": "boolean" 257 | }, 258 | "quantity": { 259 | "next": "Quantity" 260 | }, 261 | "status": { 262 | "parser": "string" 263 | }, 264 | "timingPeriod": { 265 | "next": "Period" 266 | }, 267 | "timingSchedule": { 268 | "next": "Schedule" 269 | }, 270 | "timingString": { 271 | "parser": "string" 272 | } 273 | } 274 | }, 275 | "CarePlan.goal": { 276 | "edges": { 277 | "description": { 278 | "parser": "string" 279 | }, 280 | "notes": { 281 | "parser": "string" 282 | }, 283 | "status": { 284 | "parser": "string" 285 | } 286 | } 287 | }, 288 | "CarePlan.participant": { 289 | "edges": { 290 | "member": { 291 | "next": "ResourceReference" 292 | }, 293 | "role": { 294 | "next": "CodeableConcept" 295 | } 296 | } 297 | }, 298 | "Choice": { 299 | "edges": { 300 | "code": { 301 | "parser": "string" 302 | }, 303 | "isOrdered": { 304 | "parser": "boolean" 305 | }, 306 | "option": { 307 | "next": "Choice.option" 308 | } 309 | } 310 | }, 311 | "Choice.option": { 312 | "edges": { 313 | "code": { 314 | "parser": "string" 315 | }, 316 | "display": { 317 | "parser": "string" 318 | } 319 | } 320 | }, 321 | "CodeableConcept": { 322 | "edges": { 323 | "coding": { 324 | "next": "Coding" 325 | }, 326 | "primary": { 327 | "parser": "string" 328 | }, 329 | "text": { 330 | "parser": "string" 331 | } 332 | } 333 | }, 334 | "Coding": { 335 | "edges": { 336 | "code": { 337 | "parser": "string" 338 | }, 339 | "display": { 340 | "parser": "string" 341 | }, 342 | "system": { 343 | "parser": "string" 344 | } 345 | } 346 | }, 347 | "Condition": { 348 | "edges": { 349 | "abatementAge": { 350 | "next": "Age" 351 | }, 352 | "abatementBoolean": { 353 | "parser": "boolean" 354 | }, 355 | "abatementDate": { 356 | "next": "date" 357 | }, 358 | "asserter": { 359 | "next": "ResourceReference" 360 | }, 361 | "category": { 362 | "next": "CodeableConcept" 363 | }, 364 | "certainty": { 365 | "next": "CodeableConcept" 366 | }, 367 | "code": { 368 | "next": "CodeableConcept" 369 | }, 370 | "contained": { 371 | "next": "Resource" 372 | }, 373 | "dateAsserted": { 374 | "next": "date" 375 | }, 376 | "encounter": { 377 | "next": "ResourceReference" 378 | }, 379 | "evidence": { 380 | "next": "Condition.evidence" 381 | }, 382 | "extension": { 383 | "next": "Extension" 384 | }, 385 | "location": { 386 | "next": "Condition.location" 387 | }, 388 | "notes": { 389 | "parser": "string" 390 | }, 391 | "onsetAge": { 392 | "next": "Age" 393 | }, 394 | "onsetDate": { 395 | "next": "date" 396 | }, 397 | "relatedItem": { 398 | "next": "Condition.relatedItem" 399 | }, 400 | "severity": { 401 | "next": "CodeableConcept" 402 | }, 403 | "stage": { 404 | "next": "Condition.stage" 405 | }, 406 | "status": { 407 | "parser": "string" 408 | }, 409 | "subject": { 410 | "next": "ResourceReference" 411 | }, 412 | "text": { 413 | "next": "Narrative" 414 | } 415 | } 416 | }, 417 | "Condition.evidence": { 418 | "edges": { 419 | "code": { 420 | "next": "CodeableConcept" 421 | }, 422 | "detail": { 423 | "next": "ResourceReference" 424 | } 425 | } 426 | }, 427 | "Condition.location": { 428 | "edges": { 429 | "code": { 430 | "next": "CodeableConcept" 431 | }, 432 | "detail": { 433 | "parser": "string" 434 | } 435 | } 436 | }, 437 | "Condition.relatedItem": { 438 | "edges": { 439 | "code": { 440 | "next": "CodeableConcept" 441 | }, 442 | "target": { 443 | "next": "ResourceReference" 444 | }, 445 | "type": { 446 | "parser": "string" 447 | } 448 | } 449 | }, 450 | "Condition.stage": { 451 | "edges": { 452 | "assessment": { 453 | "next": "ResourceReference" 454 | }, 455 | "summary": { 456 | "next": "CodeableConcept" 457 | } 458 | } 459 | }, 460 | "Conformance": { 461 | "edges": { 462 | "acceptUnknown": { 463 | "parser": "boolean" 464 | }, 465 | "contained": { 466 | "next": "Resource" 467 | }, 468 | "date": { 469 | "parser": "date" 470 | }, 471 | "description": { 472 | "parser": "string" 473 | }, 474 | "document": { 475 | "next": "Conformance.document" 476 | }, 477 | "experimental": { 478 | "parser": "boolean" 479 | }, 480 | "extension": { 481 | "next": "Extension" 482 | }, 483 | "fhirVersion": { 484 | "parser": "string" 485 | }, 486 | "format": { 487 | "parser": "string" 488 | }, 489 | "identifier": { 490 | "parser": "string" 491 | }, 492 | "implementation": { 493 | "next": "Conformance.implementation" 494 | }, 495 | "messaging": { 496 | "next": "Conformance.messaging" 497 | }, 498 | "name": { 499 | "parser": "string" 500 | }, 501 | "publisher": { 502 | "parser": "string" 503 | }, 504 | "rest": { 505 | "next": "Conformance.rest" 506 | }, 507 | "software": { 508 | "next": "Conformance.software" 509 | }, 510 | "status": { 511 | "parser": "string" 512 | }, 513 | "telecom": { 514 | "next": "Contact" 515 | }, 516 | "text": { 517 | "next": "Narrative" 518 | }, 519 | "version": { 520 | "parser": "string" 521 | } 522 | } 523 | }, 524 | "Conformance.document": { 525 | "edges": { 526 | "documentation": { 527 | "parser": "string" 528 | }, 529 | "mode": { 530 | "parser": "string" 531 | }, 532 | "profile": { 533 | "next": "ResourceReference" 534 | } 535 | } 536 | }, 537 | "Conformance.implementation": { 538 | "edges": { 539 | "description": { 540 | "parser": "string" 541 | }, 542 | "url": { 543 | "parser": "string" 544 | } 545 | } 546 | }, 547 | "Conformance.messaging": { 548 | "edges": { 549 | "documentation": { 550 | "parser": "string" 551 | }, 552 | "endpoint": { 553 | "parser": "string" 554 | }, 555 | "event": { 556 | "next": "Conformance.messaging.event" 557 | }, 558 | "reliableCache": { 559 | "parser": "integer" 560 | } 561 | } 562 | }, 563 | "Conformance.messaging.event": { 564 | "edges": { 565 | "code": { 566 | "parser": "string" 567 | }, 568 | "documentation": { 569 | "parser": "string" 570 | }, 571 | "focus": { 572 | "parser": "string" 573 | }, 574 | "mode": { 575 | "parser": "string" 576 | }, 577 | "protocol": { 578 | "next": "Coding" 579 | }, 580 | "request": { 581 | "next": "ResourceReference" 582 | }, 583 | "response": { 584 | "next": "ResourceReference" 585 | } 586 | } 587 | }, 588 | "Conformance.rest": { 589 | "edges": { 590 | "batch": { 591 | "parser": "boolean" 592 | }, 593 | "documentation": { 594 | "parser": "string" 595 | }, 596 | "history": { 597 | "parser": "boolean" 598 | }, 599 | "mode": { 600 | "parser": "string" 601 | }, 602 | "query": { 603 | "next": "Conformance.rest.query" 604 | }, 605 | "resource": { 606 | "next": "Conformance.rest.resource" 607 | }, 608 | "security": { 609 | "next": "Conformance.rest.security" 610 | } 611 | } 612 | }, 613 | "Conformance.rest.query": { 614 | "edges": { 615 | "documentation": { 616 | "parser": "string" 617 | }, 618 | "name": { 619 | "parser": "string" 620 | }, 621 | "parameter": { 622 | "next": "Conformance.rest.resource.searchParam" 623 | } 624 | } 625 | }, 626 | "Conformance.rest.resource": { 627 | "edges": { 628 | "operation": { 629 | "next": "Conformance.rest.resource.operation" 630 | }, 631 | "profile": { 632 | "next": "ResourceReference" 633 | }, 634 | "readHistory": { 635 | "parser": "boolean" 636 | }, 637 | "searchInclude": { 638 | "parser": "string" 639 | }, 640 | "searchParam": { 641 | "next": "Conformance.rest.resource.searchParam" 642 | }, 643 | "type": { 644 | "parser": "string" 645 | } 646 | } 647 | }, 648 | "Conformance.rest.resource.operation": { 649 | "edges": { 650 | "code": { 651 | "parser": "string" 652 | }, 653 | "documentation": { 654 | "parser": "string" 655 | } 656 | } 657 | }, 658 | "Conformance.rest.resource.searchParam": { 659 | "edges": { 660 | "chain": { 661 | "parser": "string" 662 | }, 663 | "documentation": { 664 | "parser": "string" 665 | }, 666 | "name": { 667 | "parser": "string" 668 | }, 669 | "source": { 670 | "parser": "string" 671 | }, 672 | "target": { 673 | "parser": "string" 674 | }, 675 | "type": { 676 | "parser": "string" 677 | }, 678 | "xpath": { 679 | "parser": "string" 680 | } 681 | } 682 | }, 683 | "Conformance.rest.security": { 684 | "edges": { 685 | "certificate": { 686 | "next": "Conformance.rest.security.certificate" 687 | }, 688 | "description": { 689 | "parser": "string" 690 | }, 691 | "service": { 692 | "next": "CodeableConcept" 693 | } 694 | } 695 | }, 696 | "Conformance.rest.security.certificate": { 697 | "edges": { 698 | "blob": { 699 | "parser": "string" 700 | }, 701 | "type": { 702 | "parser": "string" 703 | } 704 | } 705 | }, 706 | "Conformance.software": { 707 | "edges": { 708 | "name": { 709 | "parser": "string" 710 | }, 711 | "releaseDate": { 712 | "parser": "date" 713 | }, 714 | "version": { 715 | "parser": "string" 716 | } 717 | } 718 | }, 719 | "Contact": { 720 | "edges": { 721 | "period": { 722 | "next": "Period" 723 | }, 724 | "system": { 725 | "parser": "string" 726 | }, 727 | "use": { 728 | "parser": "string" 729 | }, 730 | "value": { 731 | "parser": "string" 732 | } 733 | } 734 | }, 735 | "Coverage": { 736 | "edges": { 737 | "contained": { 738 | "next": "Resource" 739 | }, 740 | "dependent": { 741 | "parser": "integer" 742 | }, 743 | "extension": { 744 | "next": "Extension" 745 | }, 746 | "group": { 747 | "next": "Identifier" 748 | }, 749 | "identifier": { 750 | "next": "Identifier" 751 | }, 752 | "issuer": { 753 | "next": "ResourceReference" 754 | }, 755 | "period": { 756 | "next": "Period" 757 | }, 758 | "plan": { 759 | "next": "Identifier" 760 | }, 761 | "sequence": { 762 | "parser": "integer" 763 | }, 764 | "subplan": { 765 | "next": "Identifier" 766 | }, 767 | "subscriber": { 768 | "next": "Coverage.subscriber" 769 | }, 770 | "text": { 771 | "next": "Narrative" 772 | }, 773 | "type": { 774 | "next": "Coding" 775 | } 776 | } 777 | }, 778 | "Coverage.subscriber": { 779 | "edges": { 780 | "address": { 781 | "next": "Address" 782 | }, 783 | "birthdate": { 784 | "next": "date" 785 | }, 786 | "name": { 787 | "next": "HumanName" 788 | } 789 | } 790 | }, 791 | "Device": { 792 | "edges": { 793 | "assignedId": { 794 | "next": "Identifier" 795 | }, 796 | "contact": { 797 | "next": "Contact" 798 | }, 799 | "contained": { 800 | "next": "Resource" 801 | }, 802 | "expiry": { 803 | "next": "date" 804 | }, 805 | "extension": { 806 | "next": "Extension" 807 | }, 808 | "identity": { 809 | "next": "Device.identity" 810 | }, 811 | "location": { 812 | "next": "ResourceReference" 813 | }, 814 | "manufacturer": { 815 | "parser": "string" 816 | }, 817 | "model": { 818 | "parser": "string" 819 | }, 820 | "owner": { 821 | "next": "ResourceReference" 822 | }, 823 | "patient": { 824 | "next": "ResourceReference" 825 | }, 826 | "text": { 827 | "next": "Narrative" 828 | }, 829 | "type": { 830 | "next": "CodeableConcept" 831 | }, 832 | "url": { 833 | "parser": "string" 834 | }, 835 | "version": { 836 | "parser": "string" 837 | } 838 | } 839 | }, 840 | "Device.identity": { 841 | "edges": { 842 | "gtin": { 843 | "parser": "string" 844 | }, 845 | "lot": { 846 | "parser": "string" 847 | }, 848 | "serialNumber": { 849 | "parser": "string" 850 | } 851 | } 852 | }, 853 | "DeviceCapabilities": { 854 | "edges": { 855 | "contained": { 856 | "next": "Resource" 857 | }, 858 | "extension": { 859 | "next": "Extension" 860 | }, 861 | "identity": { 862 | "next": "ResourceReference" 863 | }, 864 | "manufacturer": { 865 | "parser": "string" 866 | }, 867 | "name": { 868 | "parser": "string" 869 | }, 870 | "text": { 871 | "next": "Narrative" 872 | }, 873 | "type": { 874 | "next": "CodeableConcept" 875 | }, 876 | "virtualDevice": { 877 | "next": "DeviceCapabilities.virtualDevice" 878 | } 879 | } 880 | }, 881 | "DeviceCapabilities.virtualDevice": { 882 | "edges": { 883 | "channel": { 884 | "next": "DeviceCapabilities.virtualDevice.channel" 885 | }, 886 | "code": { 887 | "next": "CodeableConcept" 888 | } 889 | } 890 | }, 891 | "DeviceCapabilities.virtualDevice.channel": { 892 | "edges": { 893 | "code": { 894 | "next": "CodeableConcept" 895 | }, 896 | "metric": { 897 | "next": "DeviceCapabilities.virtualDevice.channel.metric" 898 | } 899 | } 900 | }, 901 | "DeviceCapabilities.virtualDevice.channel.metric": { 902 | "edges": { 903 | "code": { 904 | "next": "CodeableConcept" 905 | }, 906 | "facet": { 907 | "next": "DeviceCapabilities.virtualDevice.channel.metric.facet" 908 | }, 909 | "info": { 910 | "next": "DeviceCapabilities.virtualDevice.channel.metric.info" 911 | }, 912 | "key": { 913 | "parser": "string" 914 | } 915 | } 916 | }, 917 | "DeviceCapabilities.virtualDevice.channel.metric.facet": { 918 | "edges": { 919 | "code": { 920 | "next": "CodeableConcept" 921 | }, 922 | "info": { 923 | "next": "DeviceCapabilities.virtualDevice.channel.metric.info" 924 | }, 925 | "key": { 926 | "parser": "string" 927 | }, 928 | "scale": { 929 | "parser": "float" 930 | } 931 | } 932 | }, 933 | "DeviceCapabilities.virtualDevice.channel.metric.info": { 934 | "edges": { 935 | "system": { 936 | "parser": "string" 937 | }, 938 | "template": { 939 | "next": "SampledData" 940 | }, 941 | "type": { 942 | "parser": "string" 943 | }, 944 | "ucum": { 945 | "parser": "string" 946 | }, 947 | "units": { 948 | "parser": "string" 949 | } 950 | } 951 | }, 952 | "DeviceLog": { 953 | "edges": { 954 | "capabilities": { 955 | "next": "ResourceReference" 956 | }, 957 | "contained": { 958 | "next": "Resource" 959 | }, 960 | "extension": { 961 | "next": "Extension" 962 | }, 963 | "instant": { 964 | "parser": "date" 965 | }, 966 | "item": { 967 | "next": "DeviceLog.item" 968 | }, 969 | "subject": { 970 | "next": "ResourceReference" 971 | }, 972 | "text": { 973 | "next": "Narrative" 974 | } 975 | } 976 | }, 977 | "DeviceLog.item": { 978 | "edges": { 979 | "flag": { 980 | "parser": "string" 981 | }, 982 | "key": { 983 | "parser": "string" 984 | }, 985 | "value": { 986 | "parser": "string" 987 | } 988 | } 989 | }, 990 | "DeviceObservation": { 991 | "edges": { 992 | "code": { 993 | "next": "CodeableConcept" 994 | }, 995 | "contained": { 996 | "next": "Resource" 997 | }, 998 | "device": { 999 | "next": "ResourceReference" 1000 | }, 1001 | "extension": { 1002 | "next": "Extension" 1003 | }, 1004 | "identifier": { 1005 | "next": "Identifier" 1006 | }, 1007 | "issued": { 1008 | "parser": "date" 1009 | }, 1010 | "measurement": { 1011 | "next": "ResourceReference" 1012 | }, 1013 | "subject": { 1014 | "next": "ResourceReference" 1015 | }, 1016 | "text": { 1017 | "next": "Narrative" 1018 | } 1019 | } 1020 | }, 1021 | "DiagnosticOrder": { 1022 | "edges": { 1023 | "clinicalNotes": { 1024 | "parser": "string" 1025 | }, 1026 | "contained": { 1027 | "next": "Resource" 1028 | }, 1029 | "encounter": { 1030 | "next": "ResourceReference" 1031 | }, 1032 | "event": { 1033 | "next": "DiagnosticOrder.event" 1034 | }, 1035 | "extension": { 1036 | "next": "Extension" 1037 | }, 1038 | "identifier": { 1039 | "next": "Identifier" 1040 | }, 1041 | "item": { 1042 | "next": "DiagnosticOrder.item" 1043 | }, 1044 | "orderer": { 1045 | "next": "ResourceReference" 1046 | }, 1047 | "priority": { 1048 | "parser": "string" 1049 | }, 1050 | "specimen": { 1051 | "next": "ResourceReference" 1052 | }, 1053 | "status": { 1054 | "parser": "string" 1055 | }, 1056 | "subject": { 1057 | "next": "ResourceReference" 1058 | }, 1059 | "text": { 1060 | "next": "Narrative" 1061 | } 1062 | } 1063 | }, 1064 | "DiagnosticOrder.event": { 1065 | "edges": { 1066 | "actor": { 1067 | "next": "ResourceReference" 1068 | }, 1069 | "date": { 1070 | "parser": "date" 1071 | }, 1072 | "status": { 1073 | "parser": "string" 1074 | } 1075 | } 1076 | }, 1077 | "DiagnosticOrder.item": { 1078 | "edges": { 1079 | "bodySite": { 1080 | "next": "CodeableConcept" 1081 | }, 1082 | "code": { 1083 | "next": "CodeableConcept" 1084 | }, 1085 | "event": { 1086 | "next": "DiagnosticOrder.event" 1087 | }, 1088 | "specimen": { 1089 | "next": "ResourceReference" 1090 | }, 1091 | "status": { 1092 | "parser": "string" 1093 | } 1094 | } 1095 | }, 1096 | "DiagnosticReport": { 1097 | "edges": { 1098 | "codedDiagnosis": { 1099 | "next": "CodeableConcept" 1100 | }, 1101 | "conclusion": { 1102 | "parser": "string" 1103 | }, 1104 | "contained": { 1105 | "next": "Resource" 1106 | }, 1107 | "diagnosticTime": { 1108 | "parser": "date" 1109 | }, 1110 | "extension": { 1111 | "next": "Extension" 1112 | }, 1113 | "image": { 1114 | "next": "ResourceReference" 1115 | }, 1116 | "issued": { 1117 | "parser": "date" 1118 | }, 1119 | "performer": { 1120 | "next": "ResourceReference" 1121 | }, 1122 | "reportId": { 1123 | "next": "Identifier" 1124 | }, 1125 | "representation": { 1126 | "next": "Attachment" 1127 | }, 1128 | "requestDetail": { 1129 | "next": "DiagnosticReport.requestDetail" 1130 | }, 1131 | "results": { 1132 | "next": "DiagnosticReport.results" 1133 | }, 1134 | "serviceCategory": { 1135 | "next": "CodeableConcept" 1136 | }, 1137 | "status": { 1138 | "parser": "string" 1139 | }, 1140 | "subject": { 1141 | "next": "ResourceReference" 1142 | }, 1143 | "text": { 1144 | "next": "Narrative" 1145 | } 1146 | } 1147 | }, 1148 | "DiagnosticReport.requestDetail": { 1149 | "edges": { 1150 | "bodySite": { 1151 | "next": "CodeableConcept" 1152 | }, 1153 | "clinicalInfo": { 1154 | "parser": "string" 1155 | }, 1156 | "encounter": { 1157 | "next": "ResourceReference" 1158 | }, 1159 | "receiverOrderId": { 1160 | "next": "Identifier" 1161 | }, 1162 | "requestOrderId": { 1163 | "next": "Identifier" 1164 | }, 1165 | "requestTest": { 1166 | "next": "CodeableConcept" 1167 | }, 1168 | "requester": { 1169 | "next": "ResourceReference" 1170 | } 1171 | } 1172 | }, 1173 | "DiagnosticReport.results": { 1174 | "edges": { 1175 | "group": { 1176 | "next": "DiagnosticReport.results" 1177 | }, 1178 | "name": { 1179 | "next": "CodeableConcept" 1180 | }, 1181 | "result": { 1182 | "next": "ResourceReference" 1183 | }, 1184 | "specimen": { 1185 | "next": "ResourceReference" 1186 | } 1187 | } 1188 | }, 1189 | "Document": { 1190 | "edges": { 1191 | "attester": { 1192 | "next": "Document.attester" 1193 | }, 1194 | "author": { 1195 | "next": "ResourceReference" 1196 | }, 1197 | "confidentiality": { 1198 | "next": "Coding" 1199 | }, 1200 | "contained": { 1201 | "next": "Resource" 1202 | }, 1203 | "created": { 1204 | "parser": "date" 1205 | }, 1206 | "custodian": { 1207 | "next": "ResourceReference" 1208 | }, 1209 | "encounter": { 1210 | "next": "ResourceReference" 1211 | }, 1212 | "event": { 1213 | "next": "Document.event" 1214 | }, 1215 | "extension": { 1216 | "next": "Extension" 1217 | }, 1218 | "identifier": { 1219 | "next": "Identifier" 1220 | }, 1221 | "provenance": { 1222 | "next": "ResourceReference" 1223 | }, 1224 | "replaces": { 1225 | "parser": "string" 1226 | }, 1227 | "representation": { 1228 | "next": "Attachment" 1229 | }, 1230 | "section": { 1231 | "next": "Document.section" 1232 | }, 1233 | "status": { 1234 | "parser": "string" 1235 | }, 1236 | "stylesheet": { 1237 | "next": "Attachment" 1238 | }, 1239 | "subject": { 1240 | "next": "ResourceReference" 1241 | }, 1242 | "subtype": { 1243 | "next": "CodeableConcept" 1244 | }, 1245 | "text": { 1246 | "next": "Narrative" 1247 | }, 1248 | "title": { 1249 | "parser": "string" 1250 | }, 1251 | "type": { 1252 | "next": "CodeableConcept" 1253 | }, 1254 | "versionIdentifier": { 1255 | "next": "Identifier" 1256 | } 1257 | } 1258 | }, 1259 | "Document.attester": { 1260 | "edges": { 1261 | "mode": { 1262 | "parser": "string" 1263 | }, 1264 | "party": { 1265 | "next": "ResourceReference" 1266 | }, 1267 | "time": { 1268 | "parser": "date" 1269 | } 1270 | } 1271 | }, 1272 | "Document.event": { 1273 | "edges": { 1274 | "code": { 1275 | "next": "CodeableConcept" 1276 | }, 1277 | "detail": { 1278 | "next": "ResourceReference" 1279 | }, 1280 | "period": { 1281 | "next": "Period" 1282 | } 1283 | } 1284 | }, 1285 | "Document.section": { 1286 | "edges": { 1287 | "code": { 1288 | "next": "CodeableConcept" 1289 | }, 1290 | "content": { 1291 | "next": "ResourceReference" 1292 | }, 1293 | "section": { 1294 | "next": "Document.section" 1295 | }, 1296 | "subject": { 1297 | "next": "ResourceReference" 1298 | } 1299 | } 1300 | }, 1301 | "DocumentReference": { 1302 | "edges": { 1303 | "authenticator": { 1304 | "next": "ResourceReference" 1305 | }, 1306 | "author": { 1307 | "next": "ResourceReference" 1308 | }, 1309 | "confidentiality": { 1310 | "next": "CodeableConcept" 1311 | }, 1312 | "contained": { 1313 | "next": "Resource" 1314 | }, 1315 | "context": { 1316 | "next": "DocumentReference.context" 1317 | }, 1318 | "created": { 1319 | "parser": "date" 1320 | }, 1321 | "custodian": { 1322 | "next": "ResourceReference" 1323 | }, 1324 | "description": { 1325 | "parser": "string" 1326 | }, 1327 | "docStatus": { 1328 | "next": "CodeableConcept" 1329 | }, 1330 | "extension": { 1331 | "next": "Extension" 1332 | }, 1333 | "format": { 1334 | "next": "CodeableConcept" 1335 | }, 1336 | "hash": { 1337 | "parser": "string" 1338 | }, 1339 | "identifier": { 1340 | "next": "Identifier" 1341 | }, 1342 | "indexed": { 1343 | "parser": "date" 1344 | }, 1345 | "location": { 1346 | "parser": "string" 1347 | }, 1348 | "masterIdentifier": { 1349 | "next": "Identifier" 1350 | }, 1351 | "mimeType": { 1352 | "parser": "string" 1353 | }, 1354 | "primaryLanguage": { 1355 | "parser": "string" 1356 | }, 1357 | "service": { 1358 | "next": "DocumentReference.service" 1359 | }, 1360 | "size": { 1361 | "parser": "integer" 1362 | }, 1363 | "status": { 1364 | "parser": "string" 1365 | }, 1366 | "subject": { 1367 | "next": "ResourceReference" 1368 | }, 1369 | "subtype": { 1370 | "next": "CodeableConcept" 1371 | }, 1372 | "supercedes": { 1373 | "next": "ResourceReference" 1374 | }, 1375 | "text": { 1376 | "next": "Narrative" 1377 | }, 1378 | "type": { 1379 | "next": "CodeableConcept" 1380 | } 1381 | } 1382 | }, 1383 | "DocumentReference.context": { 1384 | "edges": { 1385 | "code": { 1386 | "next": "CodeableConcept" 1387 | }, 1388 | "facilityType": { 1389 | "next": "CodeableConcept" 1390 | }, 1391 | "period": { 1392 | "next": "Period" 1393 | } 1394 | } 1395 | }, 1396 | "DocumentReference.service": { 1397 | "edges": { 1398 | "address": { 1399 | "parser": "string" 1400 | }, 1401 | "parameter": { 1402 | "next": "DocumentReference.service.parameter" 1403 | }, 1404 | "type": { 1405 | "next": "CodeableConcept" 1406 | } 1407 | } 1408 | }, 1409 | "DocumentReference.service.parameter": { 1410 | "edges": { 1411 | "name": { 1412 | "parser": "string" 1413 | }, 1414 | "value": { 1415 | "parser": "string" 1416 | } 1417 | } 1418 | }, 1419 | "Encounter": { 1420 | "edges": { 1421 | "class": { 1422 | "parser": "string" 1423 | }, 1424 | "contained": { 1425 | "next": "Resource" 1426 | }, 1427 | "extension": { 1428 | "next": "Extension" 1429 | }, 1430 | "fulfills": { 1431 | "next": "ResourceReference" 1432 | }, 1433 | "hospitalization": { 1434 | "next": "Encounter.hospitalization" 1435 | }, 1436 | "identifier": { 1437 | "next": "Identifier" 1438 | }, 1439 | "indication": { 1440 | "next": "ResourceReference" 1441 | }, 1442 | "length": { 1443 | "next": "Duration" 1444 | }, 1445 | "location": { 1446 | "next": "Encounter.location" 1447 | }, 1448 | "partOf": { 1449 | "next": "ResourceReference" 1450 | }, 1451 | "participant": { 1452 | "next": "Encounter.participant" 1453 | }, 1454 | "priority": { 1455 | "next": "CodeableConcept" 1456 | }, 1457 | "reasonCodeableConcept": { 1458 | "next": "CodeableConcept" 1459 | }, 1460 | "reasonString": { 1461 | "parser": "string" 1462 | }, 1463 | "serviceProvider": { 1464 | "next": "ResourceReference" 1465 | }, 1466 | "start": { 1467 | "parser": "date" 1468 | }, 1469 | "status": { 1470 | "parser": "string" 1471 | }, 1472 | "subject": { 1473 | "next": "ResourceReference" 1474 | }, 1475 | "text": { 1476 | "next": "Narrative" 1477 | }, 1478 | "type": { 1479 | "next": "CodeableConcept" 1480 | } 1481 | } 1482 | }, 1483 | "Encounter.hospitalization": { 1484 | "edges": { 1485 | "accomodation": { 1486 | "next": "Encounter.hospitalization.accomodation" 1487 | }, 1488 | "admitSource": { 1489 | "next": "CodeableConcept" 1490 | }, 1491 | "destination": { 1492 | "next": "ResourceReference" 1493 | }, 1494 | "diet": { 1495 | "next": "CodeableConcept" 1496 | }, 1497 | "dischargeDisposition": { 1498 | "next": "CodeableConcept" 1499 | }, 1500 | "origin": { 1501 | "next": "ResourceReference" 1502 | }, 1503 | "period": { 1504 | "next": "Period" 1505 | }, 1506 | "preAdmissionIdentifier": { 1507 | "next": "Identifier" 1508 | }, 1509 | "reAdmission": { 1510 | "parser": "boolean" 1511 | }, 1512 | "specialArrangement": { 1513 | "next": "CodeableConcept" 1514 | }, 1515 | "specialCourtesy": { 1516 | "next": "CodeableConcept" 1517 | } 1518 | } 1519 | }, 1520 | "Encounter.hospitalization.accomodation": { 1521 | "edges": { 1522 | "bed": { 1523 | "next": "ResourceReference" 1524 | }, 1525 | "period": { 1526 | "next": "Period" 1527 | } 1528 | } 1529 | }, 1530 | "Encounter.location": { 1531 | "edges": { 1532 | "location": { 1533 | "next": "ResourceReference" 1534 | }, 1535 | "period": { 1536 | "next": "Period" 1537 | } 1538 | } 1539 | }, 1540 | "Encounter.participant": { 1541 | "edges": { 1542 | "practitioner": { 1543 | "next": "ResourceReference" 1544 | }, 1545 | "type": { 1546 | "parser": "string" 1547 | } 1548 | } 1549 | }, 1550 | "Extension": { 1551 | "edges": { 1552 | "isModifier": { 1553 | "parser": "boolean" 1554 | }, 1555 | "url": { 1556 | "parser": "string" 1557 | }, 1558 | "value": { 1559 | "next": "Extension.value" 1560 | } 1561 | } 1562 | }, 1563 | "FamilyHistory": { 1564 | "edges": { 1565 | "contained": { 1566 | "next": "Resource" 1567 | }, 1568 | "extension": { 1569 | "next": "Extension" 1570 | }, 1571 | "note": { 1572 | "parser": "string" 1573 | }, 1574 | "relation": { 1575 | "next": "FamilyHistory.relation" 1576 | }, 1577 | "subject": { 1578 | "next": "ResourceReference" 1579 | }, 1580 | "text": { 1581 | "next": "Narrative" 1582 | } 1583 | } 1584 | }, 1585 | "FamilyHistory.relation": { 1586 | "edges": { 1587 | "condition": { 1588 | "next": "FamilyHistory.relation.condition" 1589 | }, 1590 | "deceasedAge": { 1591 | "next": "Age" 1592 | }, 1593 | "deceasedBoolean": { 1594 | "parser": "boolean" 1595 | }, 1596 | "deceasedRange": { 1597 | "next": "Range" 1598 | }, 1599 | "deceasedString": { 1600 | "parser": "string" 1601 | }, 1602 | "name": { 1603 | "parser": "string" 1604 | }, 1605 | "note": { 1606 | "parser": "string" 1607 | }, 1608 | "relationship": { 1609 | "next": "CodeableConcept" 1610 | } 1611 | } 1612 | }, 1613 | "FamilyHistory.relation.condition": { 1614 | "edges": { 1615 | "note": { 1616 | "parser": "string" 1617 | }, 1618 | "onsetAge": { 1619 | "next": "Age" 1620 | }, 1621 | "onsetRange": { 1622 | "next": "Range" 1623 | }, 1624 | "onsetString": { 1625 | "parser": "string" 1626 | }, 1627 | "outcome": { 1628 | "next": "CodeableConcept" 1629 | }, 1630 | "type": { 1631 | "next": "CodeableConcept" 1632 | } 1633 | } 1634 | }, 1635 | "Group": { 1636 | "edges": { 1637 | "actual": { 1638 | "parser": "boolean" 1639 | }, 1640 | "characteristic": { 1641 | "next": "Group.characteristic" 1642 | }, 1643 | "code": { 1644 | "next": "CodeableConcept" 1645 | }, 1646 | "contained": { 1647 | "next": "Resource" 1648 | }, 1649 | "extension": { 1650 | "next": "Extension" 1651 | }, 1652 | "identifier": { 1653 | "next": "Identifier" 1654 | }, 1655 | "member": { 1656 | "next": "ResourceReference" 1657 | }, 1658 | "name": { 1659 | "parser": "string" 1660 | }, 1661 | "quantity": { 1662 | "parser": "integer" 1663 | }, 1664 | "text": { 1665 | "next": "Narrative" 1666 | }, 1667 | "type": { 1668 | "parser": "string" 1669 | } 1670 | } 1671 | }, 1672 | "Group.characteristic": { 1673 | "edges": { 1674 | "exclude": { 1675 | "parser": "boolean" 1676 | }, 1677 | "type": { 1678 | "next": "CodeableConcept" 1679 | }, 1680 | "valueBoolean": { 1681 | "parser": "boolean" 1682 | }, 1683 | "valueCodeableConcept": { 1684 | "next": "CodeableConcept" 1685 | }, 1686 | "valueQuantity": { 1687 | "next": "Quantity" 1688 | }, 1689 | "valueRange": { 1690 | "next": "Range" 1691 | }, 1692 | "valueString": { 1693 | "parser": "string" 1694 | } 1695 | } 1696 | }, 1697 | "HumanName": { 1698 | "edges": { 1699 | "family": { 1700 | "parser": "string" 1701 | }, 1702 | "given": { 1703 | "parser": "string" 1704 | }, 1705 | "period": { 1706 | "next": "Period" 1707 | }, 1708 | "prefix": { 1709 | "parser": "string" 1710 | }, 1711 | "suffix": { 1712 | "parser": "string" 1713 | }, 1714 | "text": { 1715 | "parser": "string" 1716 | }, 1717 | "use": { 1718 | "parser": "string" 1719 | } 1720 | } 1721 | }, 1722 | "Identifier": { 1723 | "edges": { 1724 | "assigner": { 1725 | "next": "ResourceReference" 1726 | }, 1727 | "key": { 1728 | "parser": "string" 1729 | }, 1730 | "label": { 1731 | "parser": "string" 1732 | }, 1733 | "period": { 1734 | "next": "Period" 1735 | }, 1736 | "system": { 1737 | "parser": "string" 1738 | }, 1739 | "use": { 1740 | "parser": "string" 1741 | } 1742 | } 1743 | }, 1744 | "ImagingStudy": { 1745 | "edges": { 1746 | "accessionNo": { 1747 | "next": "Identifier" 1748 | }, 1749 | "availability": { 1750 | "parser": "string" 1751 | }, 1752 | "clinicalInformation": { 1753 | "parser": "string" 1754 | }, 1755 | "contained": { 1756 | "next": "Resource" 1757 | }, 1758 | "dateTime": { 1759 | "parser": "date" 1760 | }, 1761 | "description": { 1762 | "parser": "string" 1763 | }, 1764 | "extension": { 1765 | "next": "Extension" 1766 | }, 1767 | "identifier": { 1768 | "next": "Identifier" 1769 | }, 1770 | "interpreter": { 1771 | "next": "ResourceReference" 1772 | }, 1773 | "modality": { 1774 | "parser": "string" 1775 | }, 1776 | "numberOfInstances": { 1777 | "parser": "integer" 1778 | }, 1779 | "numberOfSeries": { 1780 | "parser": "integer" 1781 | }, 1782 | "procedure": { 1783 | "next": "Coding" 1784 | }, 1785 | "referrer": { 1786 | "next": "ResourceReference" 1787 | }, 1788 | "series": { 1789 | "next": "ImagingStudy.series" 1790 | }, 1791 | "subject": { 1792 | "next": "ResourceReference" 1793 | }, 1794 | "text": { 1795 | "next": "Narrative" 1796 | }, 1797 | "uid": { 1798 | "parser": "string" 1799 | }, 1800 | "url": { 1801 | "parser": "string" 1802 | } 1803 | } 1804 | }, 1805 | "ImagingStudy.series": { 1806 | "edges": { 1807 | "availability": { 1808 | "parser": "string" 1809 | }, 1810 | "bodySite": { 1811 | "next": "Coding" 1812 | }, 1813 | "dateTime": { 1814 | "parser": "date" 1815 | }, 1816 | "description": { 1817 | "parser": "string" 1818 | }, 1819 | "instance": { 1820 | "next": "ImagingStudy.series.instance" 1821 | }, 1822 | "modality": { 1823 | "parser": "string" 1824 | }, 1825 | "number": { 1826 | "parser": "integer" 1827 | }, 1828 | "numberOfInstances": { 1829 | "parser": "integer" 1830 | }, 1831 | "uid": { 1832 | "parser": "string" 1833 | }, 1834 | "url": { 1835 | "parser": "string" 1836 | } 1837 | } 1838 | }, 1839 | "ImagingStudy.series.instance": { 1840 | "edges": { 1841 | "attachment": { 1842 | "next": "ResourceReference" 1843 | }, 1844 | "number": { 1845 | "parser": "integer" 1846 | }, 1847 | "sopclass": { 1848 | "parser": "string" 1849 | }, 1850 | "title": { 1851 | "parser": "string" 1852 | }, 1853 | "type": { 1854 | "parser": "string" 1855 | }, 1856 | "uid": { 1857 | "parser": "string" 1858 | }, 1859 | "url": { 1860 | "parser": "string" 1861 | } 1862 | } 1863 | }, 1864 | "Immunization": { 1865 | "edges": { 1866 | "contained": { 1867 | "next": "Resource" 1868 | }, 1869 | "date": { 1870 | "parser": "date" 1871 | }, 1872 | "doseQuantity": { 1873 | "next": "Quantity" 1874 | }, 1875 | "expirationDate": { 1876 | "next": "date" 1877 | }, 1878 | "explanation": { 1879 | "next": "Immunization.explanation" 1880 | }, 1881 | "extension": { 1882 | "next": "Extension" 1883 | }, 1884 | "location": { 1885 | "next": "ResourceReference" 1886 | }, 1887 | "lotNumber": { 1888 | "parser": "string" 1889 | }, 1890 | "manufacturer": { 1891 | "next": "ResourceReference" 1892 | }, 1893 | "performer": { 1894 | "next": "ResourceReference" 1895 | }, 1896 | "reaction": { 1897 | "next": "Immunization.reaction" 1898 | }, 1899 | "refusedIndicator": { 1900 | "parser": "boolean" 1901 | }, 1902 | "reported": { 1903 | "parser": "boolean" 1904 | }, 1905 | "requester": { 1906 | "next": "ResourceReference" 1907 | }, 1908 | "route": { 1909 | "next": "CodeableConcept" 1910 | }, 1911 | "site": { 1912 | "next": "CodeableConcept" 1913 | }, 1914 | "subject": { 1915 | "next": "ResourceReference" 1916 | }, 1917 | "text": { 1918 | "next": "Narrative" 1919 | }, 1920 | "vaccinationProtocol": { 1921 | "next": "Immunization.vaccinationProtocol" 1922 | }, 1923 | "vaccineType": { 1924 | "next": "CodeableConcept" 1925 | } 1926 | } 1927 | }, 1928 | "Immunization.explanation": { 1929 | "edges": { 1930 | "reason": { 1931 | "next": "CodeableConcept" 1932 | }, 1933 | "refusalReason": { 1934 | "next": "CodeableConcept" 1935 | } 1936 | } 1937 | }, 1938 | "Immunization.reaction": { 1939 | "edges": { 1940 | "date": { 1941 | "parser": "date" 1942 | }, 1943 | "detail": { 1944 | "next": "ResourceReference" 1945 | }, 1946 | "reported": { 1947 | "parser": "boolean" 1948 | } 1949 | } 1950 | }, 1951 | "Immunization.vaccinationProtocol": { 1952 | "edges": { 1953 | "authority": { 1954 | "next": "ResourceReference" 1955 | }, 1956 | "description": { 1957 | "parser": "string" 1958 | }, 1959 | "doseSequence": { 1960 | "parser": "integer" 1961 | }, 1962 | "doseStatus": { 1963 | "next": "CodeableConcept" 1964 | }, 1965 | "doseStatusReason": { 1966 | "next": "CodeableConcept" 1967 | }, 1968 | "doseTarget": { 1969 | "next": "CodeableConcept" 1970 | }, 1971 | "series": { 1972 | "parser": "string" 1973 | }, 1974 | "seriesDoses": { 1975 | "parser": "integer" 1976 | } 1977 | } 1978 | }, 1979 | "ImmunizationProfile": { 1980 | "edges": { 1981 | "contained": { 1982 | "next": "Resource" 1983 | }, 1984 | "extension": { 1985 | "next": "Extension" 1986 | }, 1987 | "recommendation": { 1988 | "next": "ImmunizationProfile.recommendation" 1989 | }, 1990 | "subject": { 1991 | "next": "ResourceReference" 1992 | }, 1993 | "text": { 1994 | "next": "Narrative" 1995 | } 1996 | } 1997 | }, 1998 | "ImmunizationProfile.recommendation": { 1999 | "edges": { 2000 | "dateCriterion": { 2001 | "next": "ImmunizationProfile.recommendation.dateCriterion" 2002 | }, 2003 | "doseNumber": { 2004 | "parser": "integer" 2005 | }, 2006 | "forecastStatus": { 2007 | "parser": "string" 2008 | }, 2009 | "protocol": { 2010 | "next": "ImmunizationProfile.recommendation.protocol" 2011 | }, 2012 | "recommendationDate": { 2013 | "parser": "date" 2014 | }, 2015 | "supportingAdverseEventReport": { 2016 | "next": "ImmunizationProfile.recommendation.supportingAdverseEventReport" 2017 | }, 2018 | "supportingImmunization": { 2019 | "next": "ResourceReference" 2020 | }, 2021 | "supportingPatientObservation": { 2022 | "next": "ResourceReference" 2023 | }, 2024 | "vaccineType": { 2025 | "next": "CodeableConcept" 2026 | } 2027 | } 2028 | }, 2029 | "ImmunizationProfile.recommendation.dateCriterion": { 2030 | "edges": { 2031 | "code": { 2032 | "next": "CodeableConcept" 2033 | }, 2034 | "value": { 2035 | "parser": "date" 2036 | } 2037 | } 2038 | }, 2039 | "ImmunizationProfile.recommendation.protocol": { 2040 | "edges": { 2041 | "authority": { 2042 | "next": "ResourceReference" 2043 | }, 2044 | "description": { 2045 | "parser": "string" 2046 | }, 2047 | "doseSequence": { 2048 | "parser": "integer" 2049 | }, 2050 | "series": { 2051 | "parser": "string" 2052 | } 2053 | } 2054 | }, 2055 | "ImmunizationProfile.recommendation.supportingAdverseEventReport": { 2056 | "edges": { 2057 | "identifier": { 2058 | "parser": "string" 2059 | }, 2060 | "reaction": { 2061 | "next": "ResourceReference" 2062 | }, 2063 | "reportDate": { 2064 | "parser": "date" 2065 | }, 2066 | "reportType": { 2067 | "next": "CodeableConcept" 2068 | }, 2069 | "text": { 2070 | "parser": "string" 2071 | } 2072 | } 2073 | }, 2074 | "List": { 2075 | "edges": { 2076 | "code": { 2077 | "next": "CodeableConcept" 2078 | }, 2079 | "contained": { 2080 | "next": "Resource" 2081 | }, 2082 | "date": { 2083 | "parser": "date" 2084 | }, 2085 | "emptyReason": { 2086 | "next": "CodeableConcept" 2087 | }, 2088 | "entry": { 2089 | "next": "List.entry" 2090 | }, 2091 | "extension": { 2092 | "next": "Extension" 2093 | }, 2094 | "mode": { 2095 | "parser": "string" 2096 | }, 2097 | "ordered": { 2098 | "parser": "boolean" 2099 | }, 2100 | "source": { 2101 | "next": "ResourceReference" 2102 | }, 2103 | "text": { 2104 | "next": "Narrative" 2105 | } 2106 | } 2107 | }, 2108 | "List.entry": { 2109 | "edges": { 2110 | "date": { 2111 | "parser": "date" 2112 | }, 2113 | "deleted": { 2114 | "parser": "boolean" 2115 | }, 2116 | "flag": { 2117 | "next": "CodeableConcept" 2118 | }, 2119 | "item": { 2120 | "next": "ResourceReference" 2121 | } 2122 | } 2123 | }, 2124 | "Location": { 2125 | "edges": { 2126 | "active": { 2127 | "parser": "boolean" 2128 | }, 2129 | "address": { 2130 | "next": "Address" 2131 | }, 2132 | "contained": { 2133 | "next": "Resource" 2134 | }, 2135 | "description": { 2136 | "parser": "string" 2137 | }, 2138 | "extension": { 2139 | "next": "Extension" 2140 | }, 2141 | "name": { 2142 | "parser": "string" 2143 | }, 2144 | "partOf": { 2145 | "next": "ResourceReference" 2146 | }, 2147 | "position": { 2148 | "next": "Location.position" 2149 | }, 2150 | "provider": { 2151 | "next": "ResourceReference" 2152 | }, 2153 | "telecom": { 2154 | "next": "Contact" 2155 | }, 2156 | "text": { 2157 | "next": "Narrative" 2158 | }, 2159 | "type": { 2160 | "next": "CodeableConcept" 2161 | } 2162 | } 2163 | }, 2164 | "Location.position": { 2165 | "edges": { 2166 | "altitude": { 2167 | "parser": "float" 2168 | }, 2169 | "latitude": { 2170 | "parser": "float" 2171 | }, 2172 | "longitude": { 2173 | "parser": "float" 2174 | } 2175 | } 2176 | }, 2177 | "Media": { 2178 | "edges": { 2179 | "contained": { 2180 | "next": "Resource" 2181 | }, 2182 | "content": { 2183 | "next": "Attachment" 2184 | }, 2185 | "dateTime": { 2186 | "parser": "date" 2187 | }, 2188 | "deviceName": { 2189 | "parser": "string" 2190 | }, 2191 | "extension": { 2192 | "next": "Extension" 2193 | }, 2194 | "frames": { 2195 | "parser": "integer" 2196 | }, 2197 | "height": { 2198 | "parser": "integer" 2199 | }, 2200 | "identifier": { 2201 | "next": "Identifier" 2202 | }, 2203 | "length": { 2204 | "parser": "integer" 2205 | }, 2206 | "operator": { 2207 | "next": "ResourceReference" 2208 | }, 2209 | "requester": { 2210 | "next": "ResourceReference" 2211 | }, 2212 | "subject": { 2213 | "next": "ResourceReference" 2214 | }, 2215 | "subtype": { 2216 | "next": "CodeableConcept" 2217 | }, 2218 | "text": { 2219 | "next": "Narrative" 2220 | }, 2221 | "type": { 2222 | "parser": "string" 2223 | }, 2224 | "view": { 2225 | "next": "CodeableConcept" 2226 | }, 2227 | "width": { 2228 | "parser": "integer" 2229 | } 2230 | } 2231 | }, 2232 | "Medication": { 2233 | "edges": { 2234 | "code": { 2235 | "next": "CodeableConcept" 2236 | }, 2237 | "contained": { 2238 | "next": "Resource" 2239 | }, 2240 | "extension": { 2241 | "next": "Extension" 2242 | }, 2243 | "isBrand": { 2244 | "parser": "boolean" 2245 | }, 2246 | "kind": { 2247 | "parser": "string" 2248 | }, 2249 | "manufacturer": { 2250 | "next": "ResourceReference" 2251 | }, 2252 | "name": { 2253 | "parser": "string" 2254 | }, 2255 | "package": { 2256 | "next": "Medication.package" 2257 | }, 2258 | "product": { 2259 | "next": "Medication.product" 2260 | }, 2261 | "text": { 2262 | "next": "Narrative" 2263 | } 2264 | } 2265 | }, 2266 | "Medication.package": { 2267 | "edges": { 2268 | "container": { 2269 | "next": "CodeableConcept" 2270 | }, 2271 | "content": { 2272 | "next": "Medication.package.content" 2273 | } 2274 | } 2275 | }, 2276 | "Medication.package.content": { 2277 | "edges": { 2278 | "amount": { 2279 | "next": "Quantity" 2280 | }, 2281 | "item": { 2282 | "next": "ResourceReference" 2283 | } 2284 | } 2285 | }, 2286 | "Medication.product": { 2287 | "edges": { 2288 | "form": { 2289 | "next": "CodeableConcept" 2290 | }, 2291 | "ingredient": { 2292 | "next": "Medication.product.ingredient" 2293 | } 2294 | } 2295 | }, 2296 | "Medication.product.ingredient": { 2297 | "edges": { 2298 | "amount": { 2299 | "next": "Ratio" 2300 | }, 2301 | "item": { 2302 | "next": "ResourceReference" 2303 | } 2304 | } 2305 | }, 2306 | "MedicationAdministration": { 2307 | "edges": { 2308 | "administrationDevice": { 2309 | "next": "ResourceReference" 2310 | }, 2311 | "contained": { 2312 | "next": "Resource" 2313 | }, 2314 | "dosage": { 2315 | "next": "MedicationAdministration.dosage" 2316 | }, 2317 | "encounter": { 2318 | "next": "ResourceReference" 2319 | }, 2320 | "extension": { 2321 | "next": "Extension" 2322 | }, 2323 | "identifier": { 2324 | "next": "Identifier" 2325 | }, 2326 | "medication": { 2327 | "next": "ResourceReference" 2328 | }, 2329 | "patient": { 2330 | "next": "ResourceReference" 2331 | }, 2332 | "practitioner": { 2333 | "next": "ResourceReference" 2334 | }, 2335 | "prescription": { 2336 | "next": "ResourceReference" 2337 | }, 2338 | "reasonNotGiven": { 2339 | "next": "CodeableConcept" 2340 | }, 2341 | "status": { 2342 | "parser": "string" 2343 | }, 2344 | "text": { 2345 | "next": "Narrative" 2346 | }, 2347 | "wasNotGiven": { 2348 | "parser": "boolean" 2349 | }, 2350 | "whenGiven": { 2351 | "next": "Period" 2352 | } 2353 | } 2354 | }, 2355 | "MedicationAdministration.dosage": { 2356 | "edges": { 2357 | "maxDosePerPeriod": { 2358 | "next": "Ratio" 2359 | }, 2360 | "method": { 2361 | "next": "CodeableConcept" 2362 | }, 2363 | "quantity": { 2364 | "next": "Quantity" 2365 | }, 2366 | "rate": { 2367 | "next": "Ratio" 2368 | }, 2369 | "route": { 2370 | "next": "CodeableConcept" 2371 | }, 2372 | "site": { 2373 | "next": "CodeableConcept" 2374 | }, 2375 | "timing": { 2376 | "next": "Schedule" 2377 | } 2378 | } 2379 | }, 2380 | "MedicationDispense": { 2381 | "edges": { 2382 | "authorizingPrescription": { 2383 | "next": "ResourceReference" 2384 | }, 2385 | "contained": { 2386 | "next": "Resource" 2387 | }, 2388 | "dispense": { 2389 | "next": "MedicationDispense.dispense" 2390 | }, 2391 | "dispenser": { 2392 | "next": "ResourceReference" 2393 | }, 2394 | "extension": { 2395 | "next": "Extension" 2396 | }, 2397 | "identifier": { 2398 | "next": "Identifier" 2399 | }, 2400 | "patient": { 2401 | "next": "ResourceReference" 2402 | }, 2403 | "status": { 2404 | "parser": "string" 2405 | }, 2406 | "substitution": { 2407 | "next": "MedicationDispense.substitution" 2408 | }, 2409 | "text": { 2410 | "next": "Narrative" 2411 | } 2412 | } 2413 | }, 2414 | "MedicationDispense.dispense": { 2415 | "edges": { 2416 | "destination": { 2417 | "next": "ResourceReference" 2418 | }, 2419 | "dosage": { 2420 | "next": "MedicationDispense.dispense.dosage" 2421 | }, 2422 | "identifier": { 2423 | "next": "Identifier" 2424 | }, 2425 | "medication": { 2426 | "next": "ResourceReference" 2427 | }, 2428 | "quantity": { 2429 | "next": "Quantity" 2430 | }, 2431 | "receiver": { 2432 | "next": "ResourceReference" 2433 | }, 2434 | "status": { 2435 | "parser": "string" 2436 | }, 2437 | "type": { 2438 | "next": "CodeableConcept" 2439 | }, 2440 | "whenHandedOver": { 2441 | "next": "Period" 2442 | }, 2443 | "whenPrepared": { 2444 | "next": "Period" 2445 | } 2446 | } 2447 | }, 2448 | "MedicationDispense.dispense.dosage": { 2449 | "edges": { 2450 | "additionalInstructionsCodeableConcept": { 2451 | "next": "CodeableConcept" 2452 | }, 2453 | "additionalInstructionsString": { 2454 | "parser": "string" 2455 | }, 2456 | "maxDosePerPeriod": { 2457 | "next": "Ratio" 2458 | }, 2459 | "method": { 2460 | "next": "CodeableConcept" 2461 | }, 2462 | "quantity": { 2463 | "next": "Quantity" 2464 | }, 2465 | "rate": { 2466 | "next": "Ratio" 2467 | }, 2468 | "route": { 2469 | "next": "CodeableConcept" 2470 | }, 2471 | "site": { 2472 | "next": "CodeableConcept" 2473 | }, 2474 | "timingDateTime": { 2475 | "parser": "date" 2476 | }, 2477 | "timingPeriod": { 2478 | "next": "Period" 2479 | }, 2480 | "timingSchedule": { 2481 | "next": "Schedule" 2482 | } 2483 | } 2484 | }, 2485 | "MedicationDispense.substitution": { 2486 | "edges": { 2487 | "reason": { 2488 | "next": "CodeableConcept" 2489 | }, 2490 | "responsibleParty": { 2491 | "next": "ResourceReference" 2492 | }, 2493 | "type": { 2494 | "next": "CodeableConcept" 2495 | } 2496 | } 2497 | }, 2498 | "MedicationPrescription": { 2499 | "edges": { 2500 | "contained": { 2501 | "next": "Resource" 2502 | }, 2503 | "dateWritten": { 2504 | "parser": "date" 2505 | }, 2506 | "dispense": { 2507 | "next": "MedicationPrescription.dispense" 2508 | }, 2509 | "dosageInstruction": { 2510 | "next": "MedicationPrescription.dosageInstruction" 2511 | }, 2512 | "encounter": { 2513 | "next": "ResourceReference" 2514 | }, 2515 | "extension": { 2516 | "next": "Extension" 2517 | }, 2518 | "identifier": { 2519 | "next": "Identifier" 2520 | }, 2521 | "medication": { 2522 | "next": "ResourceReference" 2523 | }, 2524 | "patient": { 2525 | "next": "ResourceReference" 2526 | }, 2527 | "prescriber": { 2528 | "next": "ResourceReference" 2529 | }, 2530 | "reasonForPrescribingCodeableConcept": { 2531 | "next": "CodeableConcept" 2532 | }, 2533 | "reasonForPrescribingString": { 2534 | "parser": "string" 2535 | }, 2536 | "status": { 2537 | "parser": "string" 2538 | }, 2539 | "substitution": { 2540 | "next": "MedicationPrescription.substitution" 2541 | }, 2542 | "text": { 2543 | "next": "Narrative" 2544 | } 2545 | } 2546 | }, 2547 | "MedicationPrescription.dispense": { 2548 | "edges": { 2549 | "expectedSupplyDuration": { 2550 | "next": "Duration" 2551 | }, 2552 | "medication": { 2553 | "next": "ResourceReference" 2554 | }, 2555 | "numberOfRepeatsAllowed": { 2556 | "parser": "integer" 2557 | }, 2558 | "quantity": { 2559 | "next": "Quantity" 2560 | }, 2561 | "validityPeriod": { 2562 | "next": "Period" 2563 | } 2564 | } 2565 | }, 2566 | "MedicationPrescription.dosageInstruction": { 2567 | "edges": { 2568 | "additionalInstructionsCodeableConcept": { 2569 | "next": "CodeableConcept" 2570 | }, 2571 | "additionalInstructionsString": { 2572 | "parser": "string" 2573 | }, 2574 | "dosageInstructionsText": { 2575 | "parser": "string" 2576 | }, 2577 | "doseQuantity": { 2578 | "next": "Quantity" 2579 | }, 2580 | "maxDosePerPeriod": { 2581 | "next": "Ratio" 2582 | }, 2583 | "method": { 2584 | "next": "CodeableConcept" 2585 | }, 2586 | "rate": { 2587 | "next": "Ratio" 2588 | }, 2589 | "route": { 2590 | "next": "CodeableConcept" 2591 | }, 2592 | "site": { 2593 | "next": "CodeableConcept" 2594 | }, 2595 | "timingDateTime": { 2596 | "parser": "date" 2597 | }, 2598 | "timingPeriod": { 2599 | "next": "Period" 2600 | }, 2601 | "timingSchedule": { 2602 | "next": "Schedule" 2603 | } 2604 | } 2605 | }, 2606 | "MedicationPrescription.substitution": { 2607 | "edges": { 2608 | "reason": { 2609 | "next": "CodeableConcept" 2610 | }, 2611 | "type": { 2612 | "next": "CodeableConcept" 2613 | } 2614 | } 2615 | }, 2616 | "MedicationStatement": { 2617 | "edges": { 2618 | "administrationDevice": { 2619 | "next": "ResourceReference" 2620 | }, 2621 | "contained": { 2622 | "next": "Resource" 2623 | }, 2624 | "dosage": { 2625 | "next": "MedicationStatement.dosage" 2626 | }, 2627 | "extension": { 2628 | "next": "Extension" 2629 | }, 2630 | "identifier": { 2631 | "next": "Identifier" 2632 | }, 2633 | "medication": { 2634 | "next": "ResourceReference" 2635 | }, 2636 | "patient": { 2637 | "next": "ResourceReference" 2638 | }, 2639 | "reasonNotGiven": { 2640 | "next": "CodeableConcept" 2641 | }, 2642 | "text": { 2643 | "next": "Narrative" 2644 | }, 2645 | "wasNotGiven": { 2646 | "parser": "boolean" 2647 | }, 2648 | "whenGiven": { 2649 | "next": "Period" 2650 | } 2651 | } 2652 | }, 2653 | "MedicationStatement.dosage": { 2654 | "edges": { 2655 | "maxDosePerPeriod": { 2656 | "next": "Ratio" 2657 | }, 2658 | "method": { 2659 | "next": "CodeableConcept" 2660 | }, 2661 | "quantity": { 2662 | "next": "Quantity" 2663 | }, 2664 | "rate": { 2665 | "next": "Ratio" 2666 | }, 2667 | "route": { 2668 | "next": "CodeableConcept" 2669 | }, 2670 | "site": { 2671 | "next": "CodeableConcept" 2672 | }, 2673 | "timing": { 2674 | "next": "Schedule" 2675 | } 2676 | } 2677 | }, 2678 | "Message": { 2679 | "edges": { 2680 | "author": { 2681 | "next": "ResourceReference" 2682 | }, 2683 | "contained": { 2684 | "next": "Resource" 2685 | }, 2686 | "data": { 2687 | "next": "ResourceReference" 2688 | }, 2689 | "destination": { 2690 | "next": "Message.destination" 2691 | }, 2692 | "effective": { 2693 | "next": "Period" 2694 | }, 2695 | "enterer": { 2696 | "next": "ResourceReference" 2697 | }, 2698 | "event": { 2699 | "parser": "string" 2700 | }, 2701 | "extension": { 2702 | "next": "Extension" 2703 | }, 2704 | "identifier": { 2705 | "parser": "string" 2706 | }, 2707 | "reason": { 2708 | "next": "CodeableConcept" 2709 | }, 2710 | "receiver": { 2711 | "next": "ResourceReference" 2712 | }, 2713 | "response": { 2714 | "next": "Message.response" 2715 | }, 2716 | "responsible": { 2717 | "next": "ResourceReference" 2718 | }, 2719 | "source": { 2720 | "next": "Message.source" 2721 | }, 2722 | "text": { 2723 | "next": "Narrative" 2724 | }, 2725 | "timestamp": { 2726 | "parser": "date" 2727 | } 2728 | } 2729 | }, 2730 | "Message.destination": { 2731 | "edges": { 2732 | "endpoint": { 2733 | "parser": "string" 2734 | }, 2735 | "name": { 2736 | "parser": "string" 2737 | }, 2738 | "target": { 2739 | "next": "ResourceReference" 2740 | } 2741 | } 2742 | }, 2743 | "Message.response": { 2744 | "edges": { 2745 | "code": { 2746 | "parser": "string" 2747 | }, 2748 | "details": { 2749 | "next": "ResourceReference" 2750 | }, 2751 | "identifier": { 2752 | "parser": "string" 2753 | } 2754 | } 2755 | }, 2756 | "Message.source": { 2757 | "edges": { 2758 | "contact": { 2759 | "next": "Contact" 2760 | }, 2761 | "endpoint": { 2762 | "parser": "string" 2763 | }, 2764 | "name": { 2765 | "parser": "string" 2766 | }, 2767 | "software": { 2768 | "parser": "string" 2769 | }, 2770 | "version": { 2771 | "parser": "string" 2772 | } 2773 | } 2774 | }, 2775 | "Narrative": { 2776 | "edges": { 2777 | "div": { 2778 | "parser": "string" 2779 | }, 2780 | "status": { 2781 | "parser": "string" 2782 | } 2783 | } 2784 | }, 2785 | "Observation": { 2786 | "edges": { 2787 | "appliesDateTime": { 2788 | "parser": "date" 2789 | }, 2790 | "appliesPeriod": { 2791 | "next": "Period" 2792 | }, 2793 | "bodySite": { 2794 | "next": "CodeableConcept" 2795 | }, 2796 | "comments": { 2797 | "parser": "string" 2798 | }, 2799 | "component": { 2800 | "next": "Observation.component" 2801 | }, 2802 | "contained": { 2803 | "next": "Resource" 2804 | }, 2805 | "extension": { 2806 | "next": "Extension" 2807 | }, 2808 | "identifier": { 2809 | "next": "Identifier" 2810 | }, 2811 | "interpretation": { 2812 | "next": "CodeableConcept" 2813 | }, 2814 | "issued": { 2815 | "parser": "date" 2816 | }, 2817 | "method": { 2818 | "next": "CodeableConcept" 2819 | }, 2820 | "name": { 2821 | "next": "CodeableConcept" 2822 | }, 2823 | "performer": { 2824 | "next": "ResourceReference" 2825 | }, 2826 | "referenceRange": { 2827 | "next": "Observation.referenceRange" 2828 | }, 2829 | "reliability": { 2830 | "parser": "string" 2831 | }, 2832 | "status": { 2833 | "parser": "string" 2834 | }, 2835 | "subject": { 2836 | "next": "ResourceReference" 2837 | }, 2838 | "text": { 2839 | "next": "Narrative" 2840 | }, 2841 | "valueAttachment": { 2842 | "next": "Attachment" 2843 | }, 2844 | "valueChoice": { 2845 | "next": "Choice" 2846 | }, 2847 | "valueCodeableConcept": { 2848 | "next": "CodeableConcept" 2849 | }, 2850 | "valuePeriod": { 2851 | "next": "Period" 2852 | }, 2853 | "valueQuantity": { 2854 | "next": "Quantity" 2855 | }, 2856 | "valueRatio": { 2857 | "next": "Ratio" 2858 | }, 2859 | "valueSampledData": { 2860 | "next": "SampledData" 2861 | }, 2862 | "valueString": { 2863 | "parser": "string" 2864 | } 2865 | } 2866 | }, 2867 | "Observation.component": { 2868 | "edges": { 2869 | "name": { 2870 | "next": "CodeableConcept" 2871 | }, 2872 | "valueAttachment": { 2873 | "next": "Attachment" 2874 | }, 2875 | "valueChoice": { 2876 | "next": "Choice" 2877 | }, 2878 | "valueCodeableConcept": { 2879 | "next": "CodeableConcept" 2880 | }, 2881 | "valuePeriod": { 2882 | "next": "Period" 2883 | }, 2884 | "valueQuantity": { 2885 | "next": "Quantity" 2886 | }, 2887 | "valueRatio": { 2888 | "next": "Ratio" 2889 | }, 2890 | "valueSampledData": { 2891 | "next": "SampledData" 2892 | }, 2893 | "valueString": { 2894 | "parser": "string" 2895 | } 2896 | } 2897 | }, 2898 | "Observation.referenceRange": { 2899 | "edges": { 2900 | "meaning": { 2901 | "next": "CodeableConcept" 2902 | }, 2903 | "rangeQuantity": { 2904 | "next": "Quantity" 2905 | }, 2906 | "rangeRange": { 2907 | "next": "Range" 2908 | }, 2909 | "rangeString": { 2910 | "parser": "string" 2911 | } 2912 | } 2913 | }, 2914 | "OperationOutcome": { 2915 | "edges": { 2916 | "contained": { 2917 | "next": "Resource" 2918 | }, 2919 | "extension": { 2920 | "next": "Extension" 2921 | }, 2922 | "issue": { 2923 | "next": "OperationOutcome.issue" 2924 | }, 2925 | "text": { 2926 | "next": "Narrative" 2927 | } 2928 | } 2929 | }, 2930 | "OperationOutcome.issue": { 2931 | "edges": { 2932 | "details": { 2933 | "parser": "string" 2934 | }, 2935 | "location": { 2936 | "parser": "string" 2937 | }, 2938 | "severity": { 2939 | "parser": "string" 2940 | }, 2941 | "type": { 2942 | "next": "Coding" 2943 | } 2944 | } 2945 | }, 2946 | "Order": { 2947 | "edges": { 2948 | "authority": { 2949 | "next": "ResourceReference" 2950 | }, 2951 | "contained": { 2952 | "next": "Resource" 2953 | }, 2954 | "date": { 2955 | "parser": "date" 2956 | }, 2957 | "detail": { 2958 | "next": "ResourceReference" 2959 | }, 2960 | "extension": { 2961 | "next": "Extension" 2962 | }, 2963 | "reason": { 2964 | "parser": "string" 2965 | }, 2966 | "source": { 2967 | "next": "ResourceReference" 2968 | }, 2969 | "subject": { 2970 | "next": "ResourceReference" 2971 | }, 2972 | "target": { 2973 | "next": "ResourceReference" 2974 | }, 2975 | "text": { 2976 | "next": "Narrative" 2977 | }, 2978 | "when": { 2979 | "next": "Order.when" 2980 | } 2981 | } 2982 | }, 2983 | "Order.when": { 2984 | "edges": { 2985 | "code": { 2986 | "next": "CodeableConcept" 2987 | }, 2988 | "schedule": { 2989 | "next": "Schedule" 2990 | } 2991 | } 2992 | }, 2993 | "OrderResponse": { 2994 | "edges": { 2995 | "authority": { 2996 | "next": "ResourceReference" 2997 | }, 2998 | "code": { 2999 | "parser": "string" 3000 | }, 3001 | "contained": { 3002 | "next": "Resource" 3003 | }, 3004 | "cost": { 3005 | "next": "Money" 3006 | }, 3007 | "date": { 3008 | "parser": "date" 3009 | }, 3010 | "description": { 3011 | "parser": "string" 3012 | }, 3013 | "extension": { 3014 | "next": "Extension" 3015 | }, 3016 | "fulfillment": { 3017 | "next": "ResourceReference" 3018 | }, 3019 | "request": { 3020 | "next": "ResourceReference" 3021 | }, 3022 | "text": { 3023 | "next": "Narrative" 3024 | }, 3025 | "who": { 3026 | "next": "ResourceReference" 3027 | } 3028 | } 3029 | }, 3030 | "Organization": { 3031 | "edges": { 3032 | "active": { 3033 | "parser": "boolean" 3034 | }, 3035 | "address": { 3036 | "next": "Address" 3037 | }, 3038 | "contact": { 3039 | "next": "Organization.contact" 3040 | }, 3041 | "contained": { 3042 | "next": "Resource" 3043 | }, 3044 | "extension": { 3045 | "next": "Extension" 3046 | }, 3047 | "identifier": { 3048 | "next": "Identifier" 3049 | }, 3050 | "name": { 3051 | "parser": "string" 3052 | }, 3053 | "partOf": { 3054 | "next": "ResourceReference" 3055 | }, 3056 | "telecom": { 3057 | "next": "Contact" 3058 | }, 3059 | "text": { 3060 | "next": "Narrative" 3061 | }, 3062 | "type": { 3063 | "next": "CodeableConcept" 3064 | } 3065 | } 3066 | }, 3067 | "Organization.contact": { 3068 | "edges": { 3069 | "address": { 3070 | "next": "Address" 3071 | }, 3072 | "gender": { 3073 | "next": "CodeableConcept" 3074 | }, 3075 | "name": { 3076 | "next": "HumanName" 3077 | }, 3078 | "purpose": { 3079 | "next": "CodeableConcept" 3080 | }, 3081 | "telecom": { 3082 | "next": "Contact" 3083 | } 3084 | } 3085 | }, 3086 | "Other": { 3087 | "edges": { 3088 | "author": { 3089 | "next": "ResourceReference" 3090 | }, 3091 | "code": { 3092 | "next": "CodeableConcept" 3093 | }, 3094 | "contained": { 3095 | "next": "Resource" 3096 | }, 3097 | "created": { 3098 | "next": "date" 3099 | }, 3100 | "extension": { 3101 | "next": "Extension" 3102 | }, 3103 | "subject": { 3104 | "next": "ResourceReference" 3105 | }, 3106 | "text": { 3107 | "next": "Narrative" 3108 | } 3109 | } 3110 | }, 3111 | "Patient": { 3112 | "edges": { 3113 | "active": { 3114 | "parser": "boolean" 3115 | }, 3116 | "address": { 3117 | "next": "Address" 3118 | }, 3119 | "animal": { 3120 | "next": "Patient.animal" 3121 | }, 3122 | "birthDate": { 3123 | "parser": "date" 3124 | }, 3125 | "communication": { 3126 | "next": "CodeableConcept" 3127 | }, 3128 | "contact": { 3129 | "next": "Patient.contact" 3130 | }, 3131 | "contained": { 3132 | "next": "Resource" 3133 | }, 3134 | "deceasedBoolean": { 3135 | "parser": "boolean" 3136 | }, 3137 | "deceasedDateTime": { 3138 | "parser": "date" 3139 | }, 3140 | "extension": { 3141 | "next": "Extension" 3142 | }, 3143 | "gender": { 3144 | "next": "CodeableConcept" 3145 | }, 3146 | "identifier": { 3147 | "next": "Identifier" 3148 | }, 3149 | "link": { 3150 | "next": "ResourceReference" 3151 | }, 3152 | "maritalStatus": { 3153 | "next": "CodeableConcept" 3154 | }, 3155 | "multipleBirthBoolean": { 3156 | "parser": "boolean" 3157 | }, 3158 | "multipleBirthInteger": { 3159 | "parser": "integer" 3160 | }, 3161 | "name": { 3162 | "next": "HumanName" 3163 | }, 3164 | "photo": { 3165 | "next": "Attachment" 3166 | }, 3167 | "provider": { 3168 | "next": "ResourceReference" 3169 | }, 3170 | "telecom": { 3171 | "next": "Contact" 3172 | }, 3173 | "text": { 3174 | "next": "Narrative" 3175 | } 3176 | } 3177 | }, 3178 | "Patient.animal": { 3179 | "edges": { 3180 | "breed": { 3181 | "next": "CodeableConcept" 3182 | }, 3183 | "genderStatus": { 3184 | "next": "CodeableConcept" 3185 | }, 3186 | "species": { 3187 | "next": "CodeableConcept" 3188 | } 3189 | } 3190 | }, 3191 | "Patient.contact": { 3192 | "edges": { 3193 | "address": { 3194 | "next": "Address" 3195 | }, 3196 | "gender": { 3197 | "next": "CodeableConcept" 3198 | }, 3199 | "name": { 3200 | "next": "HumanName" 3201 | }, 3202 | "organization": { 3203 | "next": "ResourceReference" 3204 | }, 3205 | "relationship": { 3206 | "next": "CodeableConcept" 3207 | }, 3208 | "telecom": { 3209 | "next": "Contact" 3210 | } 3211 | } 3212 | }, 3213 | "Period": { 3214 | "edges": { 3215 | "end": { 3216 | "parser": "date" 3217 | }, 3218 | "start": { 3219 | "parser": "date" 3220 | } 3221 | } 3222 | }, 3223 | "Practitioner": { 3224 | "edges": { 3225 | "address": { 3226 | "next": "Address" 3227 | }, 3228 | "birthDate": { 3229 | "parser": "date" 3230 | }, 3231 | "communication": { 3232 | "next": "CodeableConcept" 3233 | }, 3234 | "contained": { 3235 | "next": "Resource" 3236 | }, 3237 | "extension": { 3238 | "next": "Extension" 3239 | }, 3240 | "gender": { 3241 | "next": "CodeableConcept" 3242 | }, 3243 | "identifier": { 3244 | "next": "Identifier" 3245 | }, 3246 | "name": { 3247 | "next": "HumanName" 3248 | }, 3249 | "organization": { 3250 | "next": "ResourceReference" 3251 | }, 3252 | "period": { 3253 | "next": "Period" 3254 | }, 3255 | "photo": { 3256 | "next": "Attachment" 3257 | }, 3258 | "qualification": { 3259 | "next": "Practitioner.qualification" 3260 | }, 3261 | "role": { 3262 | "next": "CodeableConcept" 3263 | }, 3264 | "specialty": { 3265 | "next": "CodeableConcept" 3266 | }, 3267 | "telecom": { 3268 | "next": "Contact" 3269 | }, 3270 | "text": { 3271 | "next": "Narrative" 3272 | } 3273 | } 3274 | }, 3275 | "Practitioner.qualification": { 3276 | "edges": { 3277 | "code": { 3278 | "next": "CodeableConcept" 3279 | }, 3280 | "issuer": { 3281 | "next": "ResourceReference" 3282 | }, 3283 | "period": { 3284 | "next": "Period" 3285 | } 3286 | } 3287 | }, 3288 | "Procedure": { 3289 | "edges": { 3290 | "bodySite": { 3291 | "next": "CodeableConcept" 3292 | }, 3293 | "complication": { 3294 | "parser": "string" 3295 | }, 3296 | "contained": { 3297 | "next": "Resource" 3298 | }, 3299 | "date": { 3300 | "next": "Period" 3301 | }, 3302 | "encounter": { 3303 | "next": "ResourceReference" 3304 | }, 3305 | "extension": { 3306 | "next": "Extension" 3307 | }, 3308 | "followUp": { 3309 | "parser": "string" 3310 | }, 3311 | "indication": { 3312 | "parser": "string" 3313 | }, 3314 | "notes": { 3315 | "parser": "string" 3316 | }, 3317 | "outcome": { 3318 | "parser": "string" 3319 | }, 3320 | "performer": { 3321 | "next": "Procedure.performer" 3322 | }, 3323 | "relatedItem": { 3324 | "next": "Procedure.relatedItem" 3325 | }, 3326 | "report": { 3327 | "next": "ResourceReference" 3328 | }, 3329 | "subject": { 3330 | "next": "ResourceReference" 3331 | }, 3332 | "text": { 3333 | "next": "Narrative" 3334 | }, 3335 | "type": { 3336 | "next": "CodeableConcept" 3337 | } 3338 | } 3339 | }, 3340 | "Procedure.performer": { 3341 | "edges": { 3342 | "person": { 3343 | "next": "ResourceReference" 3344 | }, 3345 | "role": { 3346 | "next": "CodeableConcept" 3347 | } 3348 | } 3349 | }, 3350 | "Procedure.relatedItem": { 3351 | "edges": { 3352 | "target": { 3353 | "next": "ResourceReference" 3354 | }, 3355 | "type": { 3356 | "parser": "string" 3357 | } 3358 | } 3359 | }, 3360 | "Profile": { 3361 | "edges": { 3362 | "binding": { 3363 | "next": "Profile.binding" 3364 | }, 3365 | "code": { 3366 | "next": "Coding" 3367 | }, 3368 | "contained": { 3369 | "next": "Resource" 3370 | }, 3371 | "date": { 3372 | "parser": "date" 3373 | }, 3374 | "description": { 3375 | "parser": "string" 3376 | }, 3377 | "experimental": { 3378 | "parser": "boolean" 3379 | }, 3380 | "extension": { 3381 | "next": "Extension" 3382 | }, 3383 | "extensionDefn": { 3384 | "next": "Profile.extensionDefn" 3385 | }, 3386 | "fhirVersion": { 3387 | "parser": "string" 3388 | }, 3389 | "identifier": { 3390 | "parser": "string" 3391 | }, 3392 | "name": { 3393 | "parser": "string" 3394 | }, 3395 | "publisher": { 3396 | "parser": "string" 3397 | }, 3398 | "status": { 3399 | "parser": "string" 3400 | }, 3401 | "structure": { 3402 | "next": "Profile.structure" 3403 | }, 3404 | "telecom": { 3405 | "next": "Contact" 3406 | }, 3407 | "text": { 3408 | "next": "Narrative" 3409 | }, 3410 | "version": { 3411 | "parser": "string" 3412 | } 3413 | } 3414 | }, 3415 | "Profile.binding": { 3416 | "edges": { 3417 | "conformance": { 3418 | "parser": "string" 3419 | }, 3420 | "description": { 3421 | "parser": "string" 3422 | }, 3423 | "isExtensible": { 3424 | "parser": "boolean" 3425 | }, 3426 | "name": { 3427 | "parser": "string" 3428 | }, 3429 | "referenceResourceReference": { 3430 | "next": "ResourceReference" 3431 | }, 3432 | "referenceUri": { 3433 | "parser": "string" 3434 | } 3435 | } 3436 | }, 3437 | "Profile.extensionDefn": { 3438 | "edges": { 3439 | "code": { 3440 | "parser": "string" 3441 | }, 3442 | "context": { 3443 | "parser": "string" 3444 | }, 3445 | "contextType": { 3446 | "parser": "string" 3447 | }, 3448 | "definition": { 3449 | "next": "Profile.structure.element.definition" 3450 | } 3451 | } 3452 | }, 3453 | "Profile.structure": { 3454 | "edges": { 3455 | "element": { 3456 | "next": "Profile.structure.element" 3457 | }, 3458 | "name": { 3459 | "parser": "string" 3460 | }, 3461 | "publish": { 3462 | "parser": "boolean" 3463 | }, 3464 | "purpose": { 3465 | "parser": "string" 3466 | }, 3467 | "type": { 3468 | "parser": "string" 3469 | } 3470 | } 3471 | }, 3472 | "Profile.structure.element": { 3473 | "edges": { 3474 | "definition": { 3475 | "next": "Profile.structure.element.definition" 3476 | }, 3477 | "name": { 3478 | "parser": "string" 3479 | }, 3480 | "path": { 3481 | "parser": "string" 3482 | }, 3483 | "slicing": { 3484 | "next": "Profile.structure.element.slicing" 3485 | } 3486 | } 3487 | }, 3488 | "Profile.structure.element.definition": { 3489 | "edges": { 3490 | "binding": { 3491 | "parser": "string" 3492 | }, 3493 | "comments": { 3494 | "parser": "string" 3495 | }, 3496 | "condition": { 3497 | "parser": "string" 3498 | }, 3499 | "constraint": { 3500 | "next": "Profile.structure.element.definition.constraint" 3501 | }, 3502 | "example": { 3503 | "next": "Profile.structure.element.definition.example" 3504 | }, 3505 | "formal": { 3506 | "parser": "string" 3507 | }, 3508 | "isModifier": { 3509 | "parser": "boolean" 3510 | }, 3511 | "mapping": { 3512 | "next": "Profile.structure.element.definition.mapping" 3513 | }, 3514 | "max": { 3515 | "parser": "string" 3516 | }, 3517 | "maxLength": { 3518 | "parser": "integer" 3519 | }, 3520 | "min": { 3521 | "parser": "integer" 3522 | }, 3523 | "mustSupport": { 3524 | "parser": "boolean" 3525 | }, 3526 | "nameReference": { 3527 | "parser": "string" 3528 | }, 3529 | "requirements": { 3530 | "parser": "string" 3531 | }, 3532 | "short": { 3533 | "parser": "string" 3534 | }, 3535 | "synonym": { 3536 | "parser": "string" 3537 | }, 3538 | "type": { 3539 | "next": "Profile.structure.element.definition.type" 3540 | }, 3541 | "value": { 3542 | "next": "Profile.structure.element.definition.value" 3543 | } 3544 | } 3545 | }, 3546 | "Profile.structure.element.definition.constraint": { 3547 | "edges": { 3548 | "human": { 3549 | "parser": "string" 3550 | }, 3551 | "key": { 3552 | "parser": "string" 3553 | }, 3554 | "name": { 3555 | "parser": "string" 3556 | }, 3557 | "ocl": { 3558 | "parser": "string" 3559 | }, 3560 | "severity": { 3561 | "parser": "string" 3562 | }, 3563 | "xpath": { 3564 | "parser": "string" 3565 | } 3566 | } 3567 | }, 3568 | "Profile.structure.element.definition.mapping": { 3569 | "edges": { 3570 | "map": { 3571 | "parser": "string" 3572 | }, 3573 | "target": { 3574 | "parser": "string" 3575 | } 3576 | } 3577 | }, 3578 | "Profile.structure.element.definition.type": { 3579 | "edges": { 3580 | "bundled": { 3581 | "parser": "boolean" 3582 | }, 3583 | "code": { 3584 | "parser": "string" 3585 | }, 3586 | "profile": { 3587 | "parser": "string" 3588 | } 3589 | } 3590 | }, 3591 | "Profile.structure.element.slicing": { 3592 | "edges": { 3593 | "discriminator": { 3594 | "parser": "string" 3595 | }, 3596 | "ordered": { 3597 | "parser": "boolean" 3598 | }, 3599 | "rules": { 3600 | "parser": "string" 3601 | } 3602 | } 3603 | }, 3604 | "Provenance": { 3605 | "edges": { 3606 | "agent": { 3607 | "next": "Provenance.agent" 3608 | }, 3609 | "contained": { 3610 | "next": "Resource" 3611 | }, 3612 | "entity": { 3613 | "next": "Provenance.entity" 3614 | }, 3615 | "extension": { 3616 | "next": "Extension" 3617 | }, 3618 | "location": { 3619 | "next": "ResourceReference" 3620 | }, 3621 | "period": { 3622 | "next": "Period" 3623 | }, 3624 | "policy": { 3625 | "parser": "string" 3626 | }, 3627 | "reason": { 3628 | "next": "CodeableConcept" 3629 | }, 3630 | "recorded": { 3631 | "parser": "date" 3632 | }, 3633 | "signature": { 3634 | "parser": "string" 3635 | }, 3636 | "target": { 3637 | "next": "ResourceReference" 3638 | }, 3639 | "text": { 3640 | "next": "Narrative" 3641 | } 3642 | } 3643 | }, 3644 | "Provenance.agent": { 3645 | "edges": { 3646 | "display": { 3647 | "parser": "string" 3648 | }, 3649 | "reference": { 3650 | "parser": "string" 3651 | }, 3652 | "role": { 3653 | "next": "Coding" 3654 | }, 3655 | "type": { 3656 | "next": "Coding" 3657 | } 3658 | } 3659 | }, 3660 | "Provenance.entity": { 3661 | "edges": { 3662 | "agent": { 3663 | "next": "Provenance.agent" 3664 | }, 3665 | "display": { 3666 | "parser": "string" 3667 | }, 3668 | "reference": { 3669 | "parser": "string" 3670 | }, 3671 | "role": { 3672 | "parser": "string" 3673 | }, 3674 | "type": { 3675 | "next": "Coding" 3676 | } 3677 | } 3678 | }, 3679 | "Quantity": { 3680 | "edges": { 3681 | "code": { 3682 | "parser": "string" 3683 | }, 3684 | "comparator": { 3685 | "parser": "string" 3686 | }, 3687 | "system": { 3688 | "parser": "string" 3689 | }, 3690 | "units": { 3691 | "parser": "string" 3692 | }, 3693 | "value": { 3694 | "parser": "float" 3695 | } 3696 | } 3697 | }, 3698 | "Query": { 3699 | "edges": { 3700 | "contained": { 3701 | "next": "Resource" 3702 | }, 3703 | "extension": { 3704 | "next": "Extension" 3705 | }, 3706 | "identifier": { 3707 | "parser": "string" 3708 | }, 3709 | "parameter": { 3710 | "next": "Extension" 3711 | }, 3712 | "response": { 3713 | "next": "Query.response" 3714 | }, 3715 | "text": { 3716 | "next": "Narrative" 3717 | } 3718 | } 3719 | }, 3720 | "Query.response": { 3721 | "edges": { 3722 | "first": { 3723 | "next": "Extension" 3724 | }, 3725 | "identifier": { 3726 | "parser": "string" 3727 | }, 3728 | "last": { 3729 | "next": "Extension" 3730 | }, 3731 | "next": { 3732 | "next": "Extension" 3733 | }, 3734 | "outcome": { 3735 | "parser": "string" 3736 | }, 3737 | "parameter": { 3738 | "next": "Extension" 3739 | }, 3740 | "previous": { 3741 | "next": "Extension" 3742 | }, 3743 | "reference": { 3744 | "next": "ResourceReference" 3745 | }, 3746 | "total": { 3747 | "parser": "integer" 3748 | } 3749 | } 3750 | }, 3751 | "Questionnaire": { 3752 | "edges": { 3753 | "author": { 3754 | "next": "ResourceReference" 3755 | }, 3756 | "authored": { 3757 | "parser": "date" 3758 | }, 3759 | "contained": { 3760 | "next": "Resource" 3761 | }, 3762 | "encounter": { 3763 | "next": "ResourceReference" 3764 | }, 3765 | "extension": { 3766 | "next": "Extension" 3767 | }, 3768 | "group": { 3769 | "next": "Questionnaire.group" 3770 | }, 3771 | "identifier": { 3772 | "next": "Identifier" 3773 | }, 3774 | "name": { 3775 | "next": "CodeableConcept" 3776 | }, 3777 | "question": { 3778 | "next": "Questionnaire.question" 3779 | }, 3780 | "source": { 3781 | "next": "ResourceReference" 3782 | }, 3783 | "status": { 3784 | "parser": "string" 3785 | }, 3786 | "subject": { 3787 | "next": "ResourceReference" 3788 | }, 3789 | "text": { 3790 | "next": "Narrative" 3791 | } 3792 | } 3793 | }, 3794 | "Questionnaire.group": { 3795 | "edges": { 3796 | "group": { 3797 | "next": "Questionnaire.group" 3798 | }, 3799 | "header": { 3800 | "parser": "string" 3801 | }, 3802 | "name": { 3803 | "next": "CodeableConcept" 3804 | }, 3805 | "question": { 3806 | "next": "Questionnaire.question" 3807 | }, 3808 | "subject": { 3809 | "next": "ResourceReference" 3810 | }, 3811 | "text": { 3812 | "parser": "string" 3813 | } 3814 | } 3815 | }, 3816 | "Questionnaire.question": { 3817 | "edges": { 3818 | "answerBoolean": { 3819 | "parser": "boolean" 3820 | }, 3821 | "answerDate": { 3822 | "next": "date" 3823 | }, 3824 | "answerDateTime": { 3825 | "parser": "date" 3826 | }, 3827 | "answerDecimal": { 3828 | "parser": "float" 3829 | }, 3830 | "answerInstant": { 3831 | "parser": "date" 3832 | }, 3833 | "answerInteger": { 3834 | "parser": "integer" 3835 | }, 3836 | "answerString": { 3837 | "parser": "string" 3838 | }, 3839 | "choice": { 3840 | "next": "Coding" 3841 | }, 3842 | "data": { 3843 | "next": "Questionnaire.question.data" 3844 | }, 3845 | "name": { 3846 | "next": "CodeableConcept" 3847 | }, 3848 | "optionsResourceReference": { 3849 | "next": "ResourceReference" 3850 | }, 3851 | "optionsUri": { 3852 | "parser": "string" 3853 | }, 3854 | "remarks": { 3855 | "parser": "string" 3856 | }, 3857 | "text": { 3858 | "parser": "string" 3859 | } 3860 | } 3861 | }, 3862 | "Range": { 3863 | "edges": { 3864 | "high": { 3865 | "next": "Quantity" 3866 | }, 3867 | "low": { 3868 | "next": "Quantity" 3869 | } 3870 | } 3871 | }, 3872 | "Ratio": { 3873 | "edges": { 3874 | "denominator": { 3875 | "next": "Quantity" 3876 | }, 3877 | "numerator": { 3878 | "next": "Quantity" 3879 | } 3880 | } 3881 | }, 3882 | "RelatedPerson": { 3883 | "edges": { 3884 | "address": { 3885 | "next": "Address" 3886 | }, 3887 | "contained": { 3888 | "next": "Resource" 3889 | }, 3890 | "extension": { 3891 | "next": "Extension" 3892 | }, 3893 | "gender": { 3894 | "next": "CodeableConcept" 3895 | }, 3896 | "identifier": { 3897 | "next": "Identifier" 3898 | }, 3899 | "name": { 3900 | "next": "HumanName" 3901 | }, 3902 | "patient": { 3903 | "next": "ResourceReference" 3904 | }, 3905 | "photo": { 3906 | "next": "Attachment" 3907 | }, 3908 | "relationship": { 3909 | "next": "CodeableConcept" 3910 | }, 3911 | "telecom": { 3912 | "next": "Contact" 3913 | }, 3914 | "text": { 3915 | "next": "Narrative" 3916 | } 3917 | } 3918 | }, 3919 | "ResourceReference": { 3920 | "edges": { 3921 | "display": { 3922 | "parser": "string" 3923 | }, 3924 | "reference": { 3925 | "parser": "string" 3926 | }, 3927 | "type": { 3928 | "parser": "string" 3929 | } 3930 | } 3931 | }, 3932 | "SampledData": { 3933 | "edges": { 3934 | "data": { 3935 | "parser": "string" 3936 | }, 3937 | "dimensions": { 3938 | "parser": "integer" 3939 | }, 3940 | "factor": { 3941 | "parser": "float" 3942 | }, 3943 | "lowerLimit": { 3944 | "parser": "float" 3945 | }, 3946 | "origin": { 3947 | "next": "Quantity" 3948 | }, 3949 | "period": { 3950 | "parser": "float" 3951 | }, 3952 | "upperLimit": { 3953 | "parser": "float" 3954 | } 3955 | } 3956 | }, 3957 | "Schedule": { 3958 | "edges": { 3959 | "event": { 3960 | "next": "Period" 3961 | }, 3962 | "repeat": { 3963 | "next": "Schedule.repeat" 3964 | } 3965 | } 3966 | }, 3967 | "Schedule.repeat": { 3968 | "edges": { 3969 | "count": { 3970 | "parser": "integer" 3971 | }, 3972 | "duration": { 3973 | "parser": "float" 3974 | }, 3975 | "end": { 3976 | "parser": "date" 3977 | }, 3978 | "frequency": { 3979 | "parser": "integer" 3980 | }, 3981 | "units": { 3982 | "parser": "string" 3983 | }, 3984 | "when": { 3985 | "parser": "string" 3986 | } 3987 | } 3988 | }, 3989 | "SecurityEvent": { 3990 | "edges": { 3991 | "contained": { 3992 | "next": "Resource" 3993 | }, 3994 | "event": { 3995 | "next": "SecurityEvent.event" 3996 | }, 3997 | "extension": { 3998 | "next": "Extension" 3999 | }, 4000 | "object": { 4001 | "next": "SecurityEvent.object" 4002 | }, 4003 | "participant": { 4004 | "next": "SecurityEvent.participant" 4005 | }, 4006 | "source": { 4007 | "next": "SecurityEvent.source" 4008 | }, 4009 | "text": { 4010 | "next": "Narrative" 4011 | } 4012 | } 4013 | }, 4014 | "SecurityEvent.event": { 4015 | "edges": { 4016 | "action": { 4017 | "parser": "string" 4018 | }, 4019 | "dateTime": { 4020 | "parser": "date" 4021 | }, 4022 | "outcome": { 4023 | "parser": "string" 4024 | }, 4025 | "outcomeDesc": { 4026 | "parser": "string" 4027 | }, 4028 | "subtype": { 4029 | "next": "CodeableConcept" 4030 | }, 4031 | "type": { 4032 | "next": "CodeableConcept" 4033 | } 4034 | } 4035 | }, 4036 | "SecurityEvent.object": { 4037 | "edges": { 4038 | "detail": { 4039 | "next": "SecurityEvent.object.detail" 4040 | }, 4041 | "identifier": { 4042 | "next": "Identifier" 4043 | }, 4044 | "lifecycle": { 4045 | "parser": "string" 4046 | }, 4047 | "name": { 4048 | "parser": "string" 4049 | }, 4050 | "query": { 4051 | "parser": "string" 4052 | }, 4053 | "reference": { 4054 | "next": "ResourceReference" 4055 | }, 4056 | "role": { 4057 | "parser": "string" 4058 | }, 4059 | "sensitivity": { 4060 | "next": "CodeableConcept" 4061 | }, 4062 | "type": { 4063 | "parser": "string" 4064 | } 4065 | } 4066 | }, 4067 | "SecurityEvent.object.detail": { 4068 | "edges": { 4069 | "type": { 4070 | "parser": "string" 4071 | }, 4072 | "value": { 4073 | "parser": "string" 4074 | } 4075 | } 4076 | }, 4077 | "SecurityEvent.participant": { 4078 | "edges": { 4079 | "authId": { 4080 | "parser": "string" 4081 | }, 4082 | "media": { 4083 | "next": "Coding" 4084 | }, 4085 | "name": { 4086 | "parser": "string" 4087 | }, 4088 | "network": { 4089 | "next": "SecurityEvent.participant.network" 4090 | }, 4091 | "reference": { 4092 | "next": "ResourceReference" 4093 | }, 4094 | "requestor": { 4095 | "parser": "boolean" 4096 | }, 4097 | "role": { 4098 | "next": "CodeableConcept" 4099 | }, 4100 | "userId": { 4101 | "parser": "string" 4102 | } 4103 | } 4104 | }, 4105 | "SecurityEvent.participant.network": { 4106 | "edges": { 4107 | "identifier": { 4108 | "parser": "string" 4109 | }, 4110 | "type": { 4111 | "parser": "string" 4112 | } 4113 | } 4114 | }, 4115 | "SecurityEvent.source": { 4116 | "edges": { 4117 | "identifier": { 4118 | "parser": "string" 4119 | }, 4120 | "site": { 4121 | "parser": "string" 4122 | }, 4123 | "type": { 4124 | "next": "Coding" 4125 | } 4126 | } 4127 | }, 4128 | "Specimen": { 4129 | "edges": { 4130 | "accessionIdentifier": { 4131 | "next": "Identifier" 4132 | }, 4133 | "collection": { 4134 | "next": "Specimen.collection" 4135 | }, 4136 | "contained": { 4137 | "next": "Resource" 4138 | }, 4139 | "container": { 4140 | "next": "Specimen.container" 4141 | }, 4142 | "extension": { 4143 | "next": "Extension" 4144 | }, 4145 | "identifier": { 4146 | "next": "Identifier" 4147 | }, 4148 | "receivedTime": { 4149 | "parser": "date" 4150 | }, 4151 | "source": { 4152 | "next": "Specimen.source" 4153 | }, 4154 | "subject": { 4155 | "next": "ResourceReference" 4156 | }, 4157 | "text": { 4158 | "next": "Narrative" 4159 | }, 4160 | "treatment": { 4161 | "next": "Specimen.treatment" 4162 | }, 4163 | "type": { 4164 | "next": "CodeableConcept" 4165 | } 4166 | } 4167 | }, 4168 | "Specimen.collection": { 4169 | "edges": { 4170 | "collectedTime": { 4171 | "parser": "date" 4172 | }, 4173 | "collector": { 4174 | "next": "ResourceReference" 4175 | }, 4176 | "comment": { 4177 | "parser": "string" 4178 | }, 4179 | "method": { 4180 | "next": "CodeableConcept" 4181 | }, 4182 | "quantity": { 4183 | "next": "Quantity" 4184 | }, 4185 | "sourceSite": { 4186 | "next": "CodeableConcept" 4187 | } 4188 | } 4189 | }, 4190 | "Specimen.container": { 4191 | "edges": { 4192 | "additive": { 4193 | "next": "ResourceReference" 4194 | }, 4195 | "capacity": { 4196 | "next": "Quantity" 4197 | }, 4198 | "description": { 4199 | "parser": "string" 4200 | }, 4201 | "identifier": { 4202 | "next": "Identifier" 4203 | }, 4204 | "specimenQuantity": { 4205 | "next": "Quantity" 4206 | }, 4207 | "type": { 4208 | "next": "CodeableConcept" 4209 | } 4210 | } 4211 | }, 4212 | "Specimen.source": { 4213 | "edges": { 4214 | "relationship": { 4215 | "parser": "string" 4216 | }, 4217 | "target": { 4218 | "next": "ResourceReference" 4219 | } 4220 | } 4221 | }, 4222 | "Specimen.treatment": { 4223 | "edges": { 4224 | "additive": { 4225 | "next": "ResourceReference" 4226 | }, 4227 | "description": { 4228 | "parser": "string" 4229 | }, 4230 | "procedure": { 4231 | "next": "CodeableConcept" 4232 | } 4233 | } 4234 | }, 4235 | "Substance": { 4236 | "edges": { 4237 | "contained": { 4238 | "next": "Resource" 4239 | }, 4240 | "description": { 4241 | "parser": "string" 4242 | }, 4243 | "effectiveTime": { 4244 | "next": "Period" 4245 | }, 4246 | "extension": { 4247 | "next": "Extension" 4248 | }, 4249 | "identifier": { 4250 | "next": "Identifier" 4251 | }, 4252 | "ingredient": { 4253 | "next": "ResourceReference" 4254 | }, 4255 | "name": { 4256 | "parser": "string" 4257 | }, 4258 | "quantity": { 4259 | "next": "Quantity" 4260 | }, 4261 | "quantityMode": { 4262 | "next": "CodeableConcept" 4263 | }, 4264 | "status": { 4265 | "next": "CodeableConcept" 4266 | }, 4267 | "text": { 4268 | "next": "Narrative" 4269 | }, 4270 | "type": { 4271 | "next": "CodeableConcept" 4272 | } 4273 | } 4274 | }, 4275 | "Supply": { 4276 | "edges": { 4277 | "contained": { 4278 | "next": "Resource" 4279 | }, 4280 | "dispense": { 4281 | "next": "Supply.dispense" 4282 | }, 4283 | "extension": { 4284 | "next": "Extension" 4285 | }, 4286 | "identifier": { 4287 | "next": "Identifier" 4288 | }, 4289 | "name": { 4290 | "next": "CodeableConcept" 4291 | }, 4292 | "orderedItem": { 4293 | "next": "ResourceReference" 4294 | }, 4295 | "patient": { 4296 | "next": "ResourceReference" 4297 | }, 4298 | "status": { 4299 | "parser": "string" 4300 | }, 4301 | "text": { 4302 | "next": "Narrative" 4303 | } 4304 | } 4305 | }, 4306 | "Supply.dispense": { 4307 | "edges": { 4308 | "destination": { 4309 | "next": "ResourceReference" 4310 | }, 4311 | "identifier": { 4312 | "next": "Identifier" 4313 | }, 4314 | "quantity": { 4315 | "next": "Quantity" 4316 | }, 4317 | "receiver": { 4318 | "next": "ResourceReference" 4319 | }, 4320 | "status": { 4321 | "parser": "string" 4322 | }, 4323 | "suppliedItem": { 4324 | "next": "ResourceReference" 4325 | }, 4326 | "supplier": { 4327 | "next": "ResourceReference" 4328 | }, 4329 | "type": { 4330 | "next": "CodeableConcept" 4331 | }, 4332 | "whenHandedOver": { 4333 | "next": "Period" 4334 | }, 4335 | "whenPrepared": { 4336 | "next": "Period" 4337 | } 4338 | } 4339 | }, 4340 | "ValueSet": { 4341 | "edges": { 4342 | "compose": { 4343 | "next": "ValueSet.compose" 4344 | }, 4345 | "contained": { 4346 | "next": "Resource" 4347 | }, 4348 | "copyright": { 4349 | "parser": "string" 4350 | }, 4351 | "date": { 4352 | "parser": "date" 4353 | }, 4354 | "define": { 4355 | "next": "ValueSet.define" 4356 | }, 4357 | "description": { 4358 | "parser": "string" 4359 | }, 4360 | "expansion": { 4361 | "next": "ValueSet.expansion" 4362 | }, 4363 | "experimental": { 4364 | "parser": "boolean" 4365 | }, 4366 | "extension": { 4367 | "next": "Extension" 4368 | }, 4369 | "identifier": { 4370 | "parser": "string" 4371 | }, 4372 | "name": { 4373 | "parser": "string" 4374 | }, 4375 | "publisher": { 4376 | "parser": "string" 4377 | }, 4378 | "status": { 4379 | "parser": "string" 4380 | }, 4381 | "telecom": { 4382 | "next": "Contact" 4383 | }, 4384 | "text": { 4385 | "next": "Narrative" 4386 | }, 4387 | "version": { 4388 | "parser": "string" 4389 | } 4390 | } 4391 | }, 4392 | "ValueSet.compose": { 4393 | "edges": { 4394 | "exclude": { 4395 | "next": "ValueSet.compose.include" 4396 | }, 4397 | "import": { 4398 | "parser": "string" 4399 | }, 4400 | "include": { 4401 | "next": "ValueSet.compose.include" 4402 | } 4403 | } 4404 | }, 4405 | "ValueSet.compose.include": { 4406 | "edges": { 4407 | "code": { 4408 | "parser": "string" 4409 | }, 4410 | "filter": { 4411 | "next": "ValueSet.compose.include.filter" 4412 | }, 4413 | "system": { 4414 | "parser": "string" 4415 | }, 4416 | "version": { 4417 | "parser": "string" 4418 | } 4419 | } 4420 | }, 4421 | "ValueSet.compose.include.filter": { 4422 | "edges": { 4423 | "op": { 4424 | "parser": "string" 4425 | }, 4426 | "property": { 4427 | "parser": "string" 4428 | }, 4429 | "value": { 4430 | "parser": "string" 4431 | } 4432 | } 4433 | }, 4434 | "ValueSet.define": { 4435 | "edges": { 4436 | "caseSensitive": { 4437 | "parser": "boolean" 4438 | }, 4439 | "concept": { 4440 | "next": "ValueSet.define.concept" 4441 | }, 4442 | "system": { 4443 | "parser": "string" 4444 | } 4445 | } 4446 | }, 4447 | "ValueSet.define.concept": { 4448 | "edges": { 4449 | "abstract": { 4450 | "parser": "boolean" 4451 | }, 4452 | "code": { 4453 | "parser": "string" 4454 | }, 4455 | "concept": { 4456 | "next": "ValueSet.define.concept" 4457 | }, 4458 | "definition": { 4459 | "parser": "string" 4460 | }, 4461 | "display": { 4462 | "parser": "string" 4463 | } 4464 | } 4465 | }, 4466 | "ValueSet.expansion": { 4467 | "edges": { 4468 | "contains": { 4469 | "next": "ValueSet.expansion.contains" 4470 | }, 4471 | "timestamp": { 4472 | "parser": "date" 4473 | } 4474 | } 4475 | }, 4476 | "ValueSet.expansion.contains": { 4477 | "edges": { 4478 | "code": { 4479 | "parser": "string" 4480 | }, 4481 | "contains": { 4482 | "next": "ValueSet.expansion.contains" 4483 | }, 4484 | "display": { 4485 | "parser": "string" 4486 | }, 4487 | "system": { 4488 | "parser": "string" 4489 | } 4490 | } 4491 | } 4492 | } 4493 | -------------------------------------------------------------------------------- /client/entry.js: -------------------------------------------------------------------------------- 1 | window.FHIR = { 2 | client: require('./client'), 3 | query: require('./search-specification.js')(), 4 | jQuery: require('./jquery'), 5 | oauth2: require('./bb-client') 6 | }; 7 | -------------------------------------------------------------------------------- /client/guid.js: -------------------------------------------------------------------------------- 1 | var EMPTY = '00000000-0000-0000-0000-000000000000'; 2 | 3 | var _padLeft = function (paddingString, width, replacementChar) { 4 | return paddingString.length >= width ? paddingString : _padLeft(replacementChar + paddingString, width, replacementChar || ' '); 5 | }; 6 | 7 | var _s4 = function (number) { 8 | var hexadecimalResult = number.toString(16); 9 | return _padLeft(hexadecimalResult, 4, '0'); 10 | }; 11 | 12 | var _cryptoGuid = function () { 13 | var buffer = new window.Uint16Array(8); 14 | window.crypto.getRandomValues(buffer); 15 | return [_s4(buffer[0]) + _s4(buffer[1]), _s4(buffer[2]), _s4(buffer[3]), _s4(buffer[4]), _s4(buffer[5]) + _s4(buffer[6]) + _s4(buffer[7])].join('-'); 16 | }; 17 | 18 | var _guid = function () { 19 | var currentDateMilliseconds = new Date().getTime(); 20 | return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (currentChar) { 21 | var randomChar = (currentDateMilliseconds + Math.random() * 16) % 16 | 0; 22 | currentDateMilliseconds = Math.floor(currentDateMilliseconds / 16); 23 | return (currentChar === 'x' ? randomChar : (randomChar & 0x7 | 0x8)).toString(16); 24 | }); 25 | }; 26 | 27 | var create = function () { 28 | var hasCrypto = typeof (window.crypto) != 'undefined', 29 | hasRandomValues = hasCrypto && typeof (window.crypto.getRandomValues) != 'undefined'; 30 | return (hasCrypto && hasRandomValues) ? _cryptoGuid() : _guid(); 31 | }; 32 | 33 | module.exports = { 34 | newGuid: create, 35 | empty: EMPTY 36 | }; 37 | -------------------------------------------------------------------------------- /client/jquery.js: -------------------------------------------------------------------------------- 1 | var $ = require('jquery'); 2 | 3 | if (process.browser) { 4 | module.exports = $; 5 | } else { 6 | var window = require('jsdom').jsdom().createWindow(); 7 | module.exports = $(window); 8 | } 9 | -------------------------------------------------------------------------------- /client/namespace.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | any: 'special::any_namsace', 3 | none: 'special::no_namespace', 4 | loinc: 'http://loinc.org', 5 | ucum: 'http://unitsofmeasure.org', 6 | snomed: 'http://snomed.info/sct', 7 | rxnorm: 'http://rxnav.nlm.nih.gov/REST/rxcui' 8 | } 9 | -------------------------------------------------------------------------------- /client/search-specification.js: -------------------------------------------------------------------------------- 1 | module.exports = function(mixins) { 2 | mixins = mixins || {}; 3 | 4 | var specs = {}; 5 | var util = require('util'); 6 | var namespace = require('./namespace'); 7 | var definitions = require('./build-definitions'); 8 | 9 | function defineSearchParam(resourceSpec, searchParam) { 10 | Object.keys(searchParam.handlers).forEach(function(handlerName){ 11 | 12 | resourceSpec.prototype[handlerName] = function(){ 13 | 14 | var clause = searchParam.handlers[handlerName].apply( 15 | searchParam, arguments 16 | ); 17 | return this.__addClause(clause); 18 | 19 | } 20 | }); 21 | } 22 | 23 | 24 | function SearchSpecification(clauses){ 25 | 26 | if (clauses === undefined) { 27 | clauses = []; 28 | } 29 | 30 | this.resourceName = this.constructor.resourceName; 31 | 32 | this.__addClause = function(c){ 33 | var newClauses = JSON.parse(JSON.stringify(clauses)); 34 | if (!util.isArray(c)){ 35 | c = [c]; 36 | } 37 | 38 | [].push.apply(newClauses, c); 39 | return new (this.constructor)(newClauses); 40 | } 41 | 42 | this.__getClauses = function(){ 43 | return clauses; 44 | } 45 | 46 | this.__printClauses = function(){ 47 | console.log(clauses); 48 | } 49 | 50 | this.queryUrl = function(){ 51 | return '/'+this.resourceName+'/_search'; 52 | }; 53 | 54 | this.queryParams = function(){ 55 | var clauses = this.__getClauses(); 56 | var params = {}; 57 | clauses.forEach(function(c){ 58 | params[c.name] = params[c.name] || []; 59 | if (c.oneOf !== undefined) { 60 | var joined = c.oneOf.join(','); 61 | params[c.name].push(joined); 62 | } else { 63 | params[c.name].push(c.value); 64 | } 65 | }); 66 | return params; 67 | } 68 | 69 | } 70 | 71 | defineSearchParam(SearchSpecification, new ReferenceSearchParam('_id')); 72 | defineSearchParam(SearchSpecification, new SearchParam('_count', '_count', true)); 73 | defineSearchParam(SearchSpecification, new SearchParam('_sortAsc', '_sort:asc', true)); 74 | defineSearchParam(SearchSpecification, new SearchParam('_sortDesc', '_sort:desc', true)); 75 | defineSearchParam(SearchSpecification, new SearchParam('_include', '_include', true)); 76 | 77 | 78 | function SearchParam(name, wireName, onlyOneHandler){ 79 | this.name = name; 80 | this.wireName = wireName || name; 81 | this.handlers = { }; 82 | var that = this; 83 | 84 | this.handlers[name] = function(value){ 85 | 86 | if (util.isArray(value) || arguments.length > 1){ 87 | throw "only expected one argument to " + name; 88 | } 89 | 90 | return { 91 | name: this.wireName, 92 | value: value 93 | }; 94 | }; 95 | 96 | if (onlyOneHandler) { 97 | return; 98 | } 99 | 100 | var singleArgHandler = this.handlers[name]; 101 | 102 | this.handlers[name+'All'] = function(){ 103 | var values = flatten(arguments); 104 | return values.map(function(v){ 105 | return { 106 | name: this.wireName, 107 | value: v 108 | } 109 | }, this); 110 | }; 111 | 112 | this.handlers[name+'In'] = function(){ 113 | var values = flatten(arguments); 114 | return { 115 | name: this.wireName, 116 | oneOf: values 117 | }; 118 | }; 119 | 120 | this.handlers[name+'Missing'] = function(value){ 121 | return { 122 | name: this.wireName+':missing', 123 | value: value === 'false' ? false : Boolean(value) 124 | }; 125 | }; 126 | 127 | function flatten(args){ 128 | var values = []; 129 | Array.prototype.slice.call(args, 0).forEach(function(arg){ 130 | if (!util.isArray(arg)){ 131 | arg = [arg]; 132 | } 133 | arg.forEach(function(arg){ 134 | values.push(singleArgHandler.call(that, arg).value); 135 | }); 136 | }); 137 | return values; 138 | } 139 | 140 | } 141 | 142 | function ReferenceSearchParam(name){ 143 | SearchParam.apply(this, arguments); 144 | 145 | this.handlers[name] = function(subSpec){ 146 | var clauseName = this.wireName + ':' + subSpec.constructor.resourceName; 147 | 148 | if (typeof subSpec === 'string'){ 149 | return { 150 | name: this.wireName, 151 | value: subSpec 152 | }; 153 | } 154 | var clauses = subSpec.__getClauses(); 155 | 156 | var ret = clauses.map(function(clause){ 157 | 158 | var oneClause = { 159 | name: clauseName + '.' + clause.name 160 | }; 161 | 162 | if (clause.value) oneClause.value = clause.value; 163 | if (clause.oneOf) oneClause.oneOf = clause.oneOf; 164 | 165 | if (clause.name == '_id') { 166 | oneClause = { 167 | name: clauseName, 168 | value: clause.value 169 | } 170 | } 171 | return oneClause 172 | }); 173 | 174 | return ret; 175 | }; 176 | 177 | }; 178 | 179 | ReferenceSearchParam.prototype = new SearchParam(); 180 | ReferenceSearchParam.prototype.constructor = ReferenceSearchParam; 181 | 182 | function StringSearchParam(name){ 183 | SearchParam.apply(this, arguments); 184 | 185 | this.handlers[name+'Exact'] = function(value){ 186 | return { 187 | name: this.wireName+':exact', 188 | value: value 189 | }; 190 | }; 191 | 192 | }; 193 | StringSearchParam.prototype = new SearchParam(); 194 | StringSearchParam.prototype.constructor = StringSearchParam; 195 | 196 | function TokenSearchParam(name){ 197 | SearchParam.apply(this, arguments); 198 | 199 | this.handlers[name] = function(ns, value){ 200 | 201 | var ret = { 202 | name: this.wireName, 203 | value: ns + '|'+ value 204 | } 205 | 206 | if (value === undefined) { 207 | ret.value = ns; 208 | } 209 | 210 | if (ns === namespace.any) { 211 | ret.value = value; 212 | } 213 | 214 | if (ns === namespace.none) { 215 | ret.value = '|'+value; 216 | } 217 | 218 | return ret; 219 | 220 | }; 221 | 222 | this.handlers[name+'Text'] = function(value){ 223 | return { 224 | name: this.wireName, 225 | value: value 226 | }; 227 | }; 228 | 229 | 230 | 231 | } 232 | TokenSearchParam.prototype = new SearchParam(); 233 | TokenSearchParam.prototype.constructor = TokenSearchParam; 234 | 235 | function DateSearchParam(name){ 236 | SearchParam.apply(this, arguments); 237 | } 238 | DateSearchParam.prototype = new SearchParam(); 239 | DateSearchParam.prototype.constructor = DateSearchParam; 240 | 241 | function NumberSearchParam(name){ 242 | SearchParam.apply(this, arguments); 243 | } 244 | NumberSearchParam(); 245 | NumberSearchParam.prototype.constructor = NumberSearchParam; 246 | 247 | function QuantitySearchParam(name){ 248 | SearchParam.apply(this, arguments); 249 | } 250 | QuantitySearchParam.prototype = new SearchParam(); 251 | QuantitySearchParam.prototype.constructor = QuantitySearchParam; 252 | 253 | function CompositeSearchParam(name){ 254 | SearchParam.apply(this, arguments); 255 | } 256 | CompositeSearchParam.prototype = new SearchParam(); 257 | CompositeSearchParam.prototype.constructor = CompositeSearchParam; 258 | 259 | 260 | var paramTypes = { 261 | string: StringSearchParam, 262 | reference: ReferenceSearchParam, 263 | token: TokenSearchParam, 264 | number: NumberSearchParam, 265 | quantity: QuantitySearchParam, 266 | date: DateSearchParam, 267 | composite: CompositeSearchParam 268 | } 269 | 270 | Object.keys(definitions).forEach(function(tname){ 271 | var params = definitions[tname].params; 272 | 273 | // Create a subclass of 'SearchSpecification' 274 | // to track search parameters for each resource 275 | // e.g. Patient knows about given name, family name, etc. 276 | var resourceSpec = function(){ 277 | SearchSpecification.apply(this, arguments); 278 | }; 279 | 280 | resourceSpec.prototype = new SearchSpecification(); 281 | resourceSpec.prototype.constructor = resourceSpec; 282 | resourceSpec.resourceName = tname; 283 | 284 | params.forEach(function(p){ 285 | defineSearchParam(resourceSpec, new paramTypes[p.type](p.name, p.wireName)); 286 | }); 287 | 288 | specs[tname] = new resourceSpec(); 289 | 290 | }); 291 | 292 | 293 | Object.keys(mixins).forEach(function(m){ 294 | SearchSpecification.prototype[m] = function(){ 295 | var args = Array.prototype.slice.call(arguments, 0); 296 | args.unshift(this); 297 | return mixins[m][m].apply(mixins[m], args); 298 | }; 299 | }); 300 | 301 | 302 | return specs; 303 | 304 | }; 305 | -------------------------------------------------------------------------------- /client/search.js: -------------------------------------------------------------------------------- 1 | module.exports = Search; 2 | var $ = jQuery = require('./jquery'); 3 | 4 | function Search(p) { 5 | 6 | var search = {}; 7 | 8 | search.client = p.client; 9 | search.spec = p.spec; 10 | search.count = p.count || 50; 11 | 12 | var nextPageUrl = null; 13 | 14 | function gotFeed(d){ 15 | return function(data, status) { 16 | 17 | nextPageUrl = null; 18 | var feed = data.feed || data; 19 | 20 | if(feed.link) { 21 | var next = feed.link.filter(function(l){ 22 | return l.rel === "next"; 23 | }); 24 | if (next.length === 1) { 25 | nextPageUrl = next[0].href 26 | } 27 | } 28 | 29 | var results = search.client.indexFeed(data); 30 | d.resolve(results, search); 31 | } 32 | }; 33 | 34 | function failedFeed(d){ 35 | return function(failure){ 36 | d.reject("Search failed.", arguments); 37 | } 38 | }; 39 | 40 | search.hasNext = function(){ 41 | return nextPageUrl !== null; 42 | }; 43 | 44 | search.next = function() { 45 | 46 | if (nextPageUrl === null) { 47 | throw "Next page of search not available!"; 48 | } 49 | 50 | var searchParams = { 51 | type: 'GET', 52 | url: nextPageUrl, 53 | dataType: 'json', 54 | traditional: true 55 | }; 56 | 57 | var ret = new $.Deferred(); 58 | console.log("Nexting", searchParams); 59 | $.ajax(search.client.authenticated(searchParams)) 60 | .done(gotFeed(ret)) 61 | .fail(failedFeed(ret)); 62 | 63 | return ret; 64 | }; 65 | 66 | search.execute = function() { 67 | 68 | 69 | var searchParams = { 70 | type: 'GET', 71 | url: search.client.urlFor(search.spec), 72 | data: search.spec.queryParams(), 73 | dataType: "json", 74 | traditional: true 75 | }; 76 | 77 | var ret = new $.Deferred(); 78 | 79 | $.ajax(search.client.authenticated(searchParams)) 80 | .done(gotFeed(ret)) 81 | .fail(failedFeed(ret)); 82 | 83 | return ret; 84 | }; 85 | 86 | return search; 87 | } 88 | 89 | -------------------------------------------------------------------------------- /client/utils.js: -------------------------------------------------------------------------------- 1 | var utils = module.exports = {}; 2 | 3 | utils.byCodes = function(observations, property){ 4 | 5 | var bank = utils.byCode(observations, property); 6 | function byCodes(){ 7 | var ret = []; 8 | for (var i=0; i 2 | 18 | See JS console for results... 19 | -------------------------------------------------------------------------------- /example.js: -------------------------------------------------------------------------------- 1 | var FhirClient = require('./client/client'); 2 | 3 | var fhir = new FhirClient({ 4 | serviceUrl: 'http://hl7connect.healthintersections.com.au/svc/fhir', 5 | auth: { type: 'none' } 6 | }); 7 | 8 | fhir.search({ 9 | resource: 'patient', 10 | searchTerms: {}, 11 | count: 2 12 | }).done(function(resources, nextPage){ 13 | 14 | console.log(JSON.stringify(resources,null,2)); 15 | console.log("Getting more..."); 16 | 17 | nextPage().done(function(resources, nextPage){ 18 | console.log("More resources", resources, nextPage); 19 | }); 20 | 21 | }); 22 | -------------------------------------------------------------------------------- /example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 39 | 40 | 41 | 42 | 43 |

Hello ...!

44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /npm-shrinkwrap.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fhir-js-client", 3 | "version": "0.0.1", 4 | "dependencies": { 5 | "btoa": { 6 | "version": "1.1.2", 7 | "from": "https://registry.npmjs.org/btoa/-/btoa-1.1.2.tgz", 8 | "resolved": "https://registry.npmjs.org/btoa/-/btoa-1.1.2.tgz" 9 | }, 10 | "browserify": { 11 | "version": "3.46.1", 12 | "from": "browserify@3.46.1", 13 | "resolved": "https://registry.npmjs.org/browserify/-/browserify-3.46.1.tgz", 14 | "dependencies": { 15 | "JSONStream": { 16 | "version": "0.7.4", 17 | "from": "JSONStream@~0.7.1", 18 | "dependencies": { 19 | "jsonparse": { 20 | "version": "0.0.5", 21 | "from": "jsonparse@0.0.5", 22 | "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-0.0.5.tgz" 23 | }, 24 | "through": { 25 | "version": "2.3.4", 26 | "from": "through@>=2.2.7 <3" 27 | } 28 | } 29 | }, 30 | "assert": { 31 | "version": "1.1.1", 32 | "from": "assert@~1.1.0", 33 | "dependencies": { 34 | "util": { 35 | "version": "0.10.2", 36 | "from": "util@0.10.2", 37 | "resolved": "https://registry.npmjs.org/util/-/util-0.10.2.tgz" 38 | } 39 | } 40 | }, 41 | "browser-pack": { 42 | "version": "2.0.1", 43 | "from": "browser-pack@~2.0.0", 44 | "dependencies": { 45 | "JSONStream": { 46 | "version": "0.6.4", 47 | "from": "JSONStream@~0.6.4", 48 | "dependencies": { 49 | "jsonparse": { 50 | "version": "0.0.5", 51 | "from": "jsonparse@0.0.5", 52 | "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-0.0.5.tgz" 53 | }, 54 | "through": { 55 | "version": "2.2.7", 56 | "from": "through@~2.2.7" 57 | } 58 | } 59 | }, 60 | "through": { 61 | "version": "2.3.4", 62 | "from": "through@~2.3.4" 63 | }, 64 | "combine-source-map": { 65 | "version": "0.3.0", 66 | "from": "combine-source-map@~0.3.0", 67 | "dependencies": { 68 | "inline-source-map": { 69 | "version": "0.3.0", 70 | "from": "inline-source-map@~0.3.0" 71 | }, 72 | "convert-source-map": { 73 | "version": "0.3.4", 74 | "from": "convert-source-map@~0.3.0" 75 | }, 76 | "source-map": { 77 | "version": "0.1.33", 78 | "from": "source-map@~0.1.31", 79 | "dependencies": { 80 | "amdefine": { 81 | "version": "0.1.0", 82 | "from": "amdefine@>=0.0.4" 83 | } 84 | } 85 | } 86 | } 87 | } 88 | } 89 | }, 90 | "browser-resolve": { 91 | "version": "1.2.4", 92 | "from": "browser-resolve@~1.2.1" 93 | }, 94 | "browserify-zlib": { 95 | "version": "0.1.4", 96 | "from": "browserify-zlib@~0.1.2", 97 | "dependencies": { 98 | "pako": { 99 | "version": "0.2.3", 100 | "from": "pako@~0.2.0", 101 | "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.3.tgz" 102 | } 103 | } 104 | }, 105 | "buffer": { 106 | "version": "2.1.13", 107 | "from": "buffer@~2.1.4", 108 | "dependencies": { 109 | "base64-js": { 110 | "version": "0.0.7", 111 | "from": "base64-js@~0.0.4" 112 | }, 113 | "ieee754": { 114 | "version": "1.1.3", 115 | "from": "ieee754@~1.1.1" 116 | } 117 | } 118 | }, 119 | "builtins": { 120 | "version": "0.0.4", 121 | "from": "builtins@~0.0.3" 122 | }, 123 | "commondir": { 124 | "version": "0.0.1", 125 | "from": "commondir@0.0.1", 126 | "resolved": "https://registry.npmjs.org/commondir/-/commondir-0.0.1.tgz" 127 | }, 128 | "concat-stream": { 129 | "version": "1.4.6", 130 | "from": "concat-stream@~1.4.1", 131 | "dependencies": { 132 | "typedarray": { 133 | "version": "0.0.6", 134 | "from": "typedarray@~0.0.5" 135 | }, 136 | "readable-stream": { 137 | "version": "1.1.13-1", 138 | "from": "readable-stream@~1.1.9", 139 | "dependencies": { 140 | "core-util-is": { 141 | "version": "1.0.1", 142 | "from": "core-util-is@~1.0.0" 143 | }, 144 | "isarray": { 145 | "version": "0.0.1", 146 | "from": "isarray@0.0.1" 147 | }, 148 | "string_decoder": { 149 | "version": "0.10.25-1", 150 | "from": "string_decoder@~0.10.x" 151 | } 152 | } 153 | } 154 | } 155 | }, 156 | "console-browserify": { 157 | "version": "1.0.3", 158 | "from": "console-browserify@~1.0.1" 159 | }, 160 | "constants-browserify": { 161 | "version": "0.0.1", 162 | "from": "constants-browserify@~0.0.1" 163 | }, 164 | "crypto-browserify": { 165 | "version": "1.0.9", 166 | "from": "crypto-browserify@~1.0.9" 167 | }, 168 | "deep-equal": { 169 | "version": "0.1.2", 170 | "from": "deep-equal@~0.1.0" 171 | }, 172 | "defined": { 173 | "version": "0.0.0", 174 | "from": "defined@~0.0.0" 175 | }, 176 | "deps-sort": { 177 | "version": "0.1.2", 178 | "from": "deps-sort@~0.1.1", 179 | "dependencies": { 180 | "through": { 181 | "version": "2.3.4", 182 | "from": "through@~2.3.4" 183 | }, 184 | "JSONStream": { 185 | "version": "0.6.4", 186 | "from": "JSONStream@~0.6.4", 187 | "dependencies": { 188 | "jsonparse": { 189 | "version": "0.0.5", 190 | "from": "jsonparse@0.0.5", 191 | "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-0.0.5.tgz" 192 | }, 193 | "through": { 194 | "version": "2.2.7", 195 | "from": "through@~2.2.7" 196 | } 197 | } 198 | }, 199 | "minimist": { 200 | "version": "0.0.10", 201 | "from": "minimist@~0.0.1" 202 | } 203 | } 204 | }, 205 | "derequire": { 206 | "version": "0.8.0", 207 | "from": "derequire@~0.8.0", 208 | "dependencies": { 209 | "estraverse": { 210 | "version": "1.5.0", 211 | "from": "estraverse@~1.5.0" 212 | }, 213 | "esrefactor": { 214 | "version": "0.1.0", 215 | "from": "esrefactor@~0.1.0", 216 | "dependencies": { 217 | "esprima": { 218 | "version": "1.0.4", 219 | "from": "esprima@~1.0.4" 220 | }, 221 | "estraverse": { 222 | "version": "0.0.4", 223 | "from": "estraverse@~0.0.4" 224 | }, 225 | "escope": { 226 | "version": "0.0.16", 227 | "from": "escope@~0.0.13" 228 | } 229 | } 230 | }, 231 | "esprima-fb": { 232 | "version": "3001.1.0-dev-harmony-fb", 233 | "from": "esprima-fb@^3001.1.0-dev-harmony-fb", 234 | "resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-3001.0001.0000-dev-harmony-fb.tgz" 235 | } 236 | } 237 | }, 238 | "domain-browser": { 239 | "version": "1.1.2", 240 | "from": "domain-browser@~1.1.0", 241 | "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.2.tgz" 242 | }, 243 | "duplexer": { 244 | "version": "0.1.1", 245 | "from": "duplexer@~0.1.1" 246 | }, 247 | "events": { 248 | "version": "1.0.1", 249 | "from": "events@~1.0.0" 250 | }, 251 | "glob": { 252 | "version": "3.2.11", 253 | "from": "glob@~3.2.8", 254 | "dependencies": { 255 | "minimatch": { 256 | "version": "0.3.0", 257 | "from": "minimatch@0.3", 258 | "dependencies": { 259 | "lru-cache": { 260 | "version": "2.5.0", 261 | "from": "lru-cache@2" 262 | }, 263 | "sigmund": { 264 | "version": "1.0.0", 265 | "from": "sigmund@~1.0.0" 266 | } 267 | } 268 | } 269 | } 270 | }, 271 | "http-browserify": { 272 | "version": "1.3.2", 273 | "from": "http-browserify@~1.3.1", 274 | "dependencies": { 275 | "Base64": { 276 | "version": "0.2.1", 277 | "from": "Base64@~0.2.0" 278 | } 279 | } 280 | }, 281 | "https-browserify": { 282 | "version": "0.0.0", 283 | "from": "https-browserify@~0.0.0" 284 | }, 285 | "inherits": { 286 | "version": "2.0.1", 287 | "from": "inherits@~2.0.1" 288 | }, 289 | "insert-module-globals": { 290 | "version": "6.0.0", 291 | "from": "insert-module-globals@~6.0.0", 292 | "dependencies": { 293 | "lexical-scope": { 294 | "version": "1.1.0", 295 | "from": "lexical-scope@~1.1.0", 296 | "dependencies": { 297 | "astw": { 298 | "version": "1.1.0", 299 | "from": "astw@~1.1.0", 300 | "dependencies": { 301 | "esprima-fb": { 302 | "version": "3001.1.0-dev-harmony-fb", 303 | "from": "esprima-fb@^3001.1.0-dev-harmony-fb", 304 | "resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-3001.0001.0000-dev-harmony-fb.tgz" 305 | } 306 | } 307 | } 308 | } 309 | }, 310 | "process": { 311 | "version": "0.6.0", 312 | "from": "process@~0.6.0" 313 | }, 314 | "through": { 315 | "version": "2.3.4", 316 | "from": "through@~2.3.4" 317 | } 318 | } 319 | }, 320 | "module-deps": { 321 | "version": "2.0.6", 322 | "from": "module-deps@~2.0.0", 323 | "dependencies": { 324 | "detective": { 325 | "version": "3.1.0", 326 | "from": "detective@~3.1.0", 327 | "dependencies": { 328 | "escodegen": { 329 | "version": "1.1.0", 330 | "from": "escodegen@~1.1.0", 331 | "dependencies": { 332 | "esprima": { 333 | "version": "1.0.4", 334 | "from": "esprima@~1.0.4" 335 | }, 336 | "estraverse": { 337 | "version": "1.5.0", 338 | "from": "estraverse@~1.5.0" 339 | }, 340 | "esutils": { 341 | "version": "1.0.0", 342 | "from": "esutils@~1.0.0" 343 | }, 344 | "source-map": { 345 | "version": "0.1.33", 346 | "from": "source-map@~0.1.30", 347 | "dependencies": { 348 | "amdefine": { 349 | "version": "0.1.0", 350 | "from": "amdefine@>=0.0.4" 351 | } 352 | } 353 | } 354 | } 355 | }, 356 | "esprima-fb": { 357 | "version": "3001.1.0-dev-harmony-fb", 358 | "from": "esprima-fb@^3001.1.0-dev-harmony-fb", 359 | "resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-3001.0001.0000-dev-harmony-fb.tgz" 360 | } 361 | } 362 | }, 363 | "duplexer2": { 364 | "version": "0.0.2", 365 | "from": "duplexer2@0.0.2", 366 | "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz", 367 | "dependencies": { 368 | "readable-stream": { 369 | "version": "1.1.13-1", 370 | "from": "readable-stream@~1.1.9", 371 | "dependencies": { 372 | "core-util-is": { 373 | "version": "1.0.1", 374 | "from": "core-util-is@~1.0.0" 375 | }, 376 | "isarray": { 377 | "version": "0.0.1", 378 | "from": "isarray@0.0.1" 379 | }, 380 | "string_decoder": { 381 | "version": "0.10.25-1", 382 | "from": "string_decoder@~0.10.x" 383 | } 384 | } 385 | } 386 | } 387 | }, 388 | "minimist": { 389 | "version": "0.0.10", 390 | "from": "minimist@~0.0.9" 391 | }, 392 | "stream-combiner": { 393 | "version": "0.1.0", 394 | "from": "stream-combiner@~0.1.0", 395 | "dependencies": { 396 | "through": { 397 | "version": "2.3.4", 398 | "from": "through@~2.3.4" 399 | } 400 | } 401 | }, 402 | "readable-stream": { 403 | "version": "1.0.27-1", 404 | "from": "readable-stream@^1.0.27-1", 405 | "dependencies": { 406 | "core-util-is": { 407 | "version": "1.0.1", 408 | "from": "core-util-is@~1.0.0" 409 | }, 410 | "isarray": { 411 | "version": "0.0.1", 412 | "from": "isarray@0.0.1" 413 | }, 414 | "string_decoder": { 415 | "version": "0.10.25-1", 416 | "from": "string_decoder@~0.10.x" 417 | } 418 | } 419 | } 420 | } 421 | }, 422 | "os-browserify": { 423 | "version": "0.1.2", 424 | "from": "os-browserify@~0.1.1" 425 | }, 426 | "parents": { 427 | "version": "0.0.2", 428 | "from": "parents@~0.0.1" 429 | }, 430 | "path-browserify": { 431 | "version": "0.0.0", 432 | "from": "path-browserify@~0.0.0" 433 | }, 434 | "punycode": { 435 | "version": "1.2.4", 436 | "from": "punycode@>=0.2.0" 437 | }, 438 | "querystring-es3": { 439 | "version": "0.2.0", 440 | "from": "querystring-es3@0.2.0", 441 | "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.0.tgz" 442 | }, 443 | "resolve": { 444 | "version": "0.6.3", 445 | "from": "resolve@~0.6.1" 446 | }, 447 | "shallow-copy": { 448 | "version": "0.0.1", 449 | "from": "shallow-copy@0.0.1", 450 | "resolved": "https://registry.npmjs.org/shallow-copy/-/shallow-copy-0.0.1.tgz" 451 | }, 452 | "shell-quote": { 453 | "version": "0.0.1", 454 | "from": "shell-quote@~0.0.1" 455 | }, 456 | "stream-browserify": { 457 | "version": "0.1.3", 458 | "from": "stream-browserify@~0.1.0", 459 | "dependencies": { 460 | "process": { 461 | "version": "0.5.2", 462 | "from": "process@~0.5.1" 463 | } 464 | } 465 | }, 466 | "stream-combiner": { 467 | "version": "0.0.4", 468 | "from": "stream-combiner@~0.0.2" 469 | }, 470 | "string_decoder": { 471 | "version": "0.0.1", 472 | "from": "string_decoder@~0.0.0" 473 | }, 474 | "subarg": { 475 | "version": "0.0.1", 476 | "from": "subarg@0.0.1", 477 | "resolved": "https://registry.npmjs.org/subarg/-/subarg-0.0.1.tgz", 478 | "dependencies": { 479 | "minimist": { 480 | "version": "0.0.10", 481 | "from": "minimist@~0.0.7" 482 | } 483 | } 484 | }, 485 | "syntax-error": { 486 | "version": "1.1.0", 487 | "from": "syntax-error@~1.1.0", 488 | "dependencies": { 489 | "esprima-fb": { 490 | "version": "3001.1.0-dev-harmony-fb", 491 | "from": "esprima-fb@^3001.1.0-dev-harmony-fb", 492 | "resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-3001.0001.0000-dev-harmony-fb.tgz" 493 | } 494 | } 495 | }, 496 | "through2": { 497 | "version": "0.4.2", 498 | "from": "through2@~0.4.0", 499 | "dependencies": { 500 | "readable-stream": { 501 | "version": "1.0.27-1", 502 | "from": "readable-stream@~1.0.17", 503 | "dependencies": { 504 | "core-util-is": { 505 | "version": "1.0.1", 506 | "from": "core-util-is@~1.0.0" 507 | }, 508 | "isarray": { 509 | "version": "0.0.1", 510 | "from": "isarray@0.0.1" 511 | }, 512 | "string_decoder": { 513 | "version": "0.10.25-1", 514 | "from": "string_decoder@~0.10.x" 515 | } 516 | } 517 | }, 518 | "xtend": { 519 | "version": "2.1.2", 520 | "from": "xtend@~2.1.1", 521 | "dependencies": { 522 | "object-keys": { 523 | "version": "0.4.0", 524 | "from": "object-keys@~0.4.0" 525 | } 526 | } 527 | } 528 | } 529 | }, 530 | "timers-browserify": { 531 | "version": "1.0.1", 532 | "from": "timers-browserify@~1.0.1", 533 | "dependencies": { 534 | "process": { 535 | "version": "0.5.2", 536 | "from": "process@~0.5.1" 537 | } 538 | } 539 | }, 540 | "tty-browserify": { 541 | "version": "0.0.0", 542 | "from": "tty-browserify@~0.0.0" 543 | }, 544 | "umd": { 545 | "version": "2.0.0", 546 | "from": "umd@~2.0.0", 547 | "dependencies": { 548 | "rfile": { 549 | "version": "1.0.0", 550 | "from": "rfile@~1.0.0", 551 | "dependencies": { 552 | "callsite": { 553 | "version": "1.0.0", 554 | "from": "callsite@~1.0.0" 555 | }, 556 | "resolve": { 557 | "version": "0.3.1", 558 | "from": "resolve@~0.3.0" 559 | } 560 | } 561 | }, 562 | "ruglify": { 563 | "version": "1.0.0", 564 | "from": "ruglify@~1.0.0", 565 | "dependencies": { 566 | "uglify-js": { 567 | "version": "2.2.5", 568 | "from": "uglify-js@~2.2", 569 | "dependencies": { 570 | "source-map": { 571 | "version": "0.1.33", 572 | "from": "source-map@~0.1.7", 573 | "dependencies": { 574 | "amdefine": { 575 | "version": "0.1.0", 576 | "from": "amdefine@>=0.0.4" 577 | } 578 | } 579 | }, 580 | "optimist": { 581 | "version": "0.3.7", 582 | "from": "optimist@~0.3.5", 583 | "dependencies": { 584 | "wordwrap": { 585 | "version": "0.0.2", 586 | "from": "wordwrap@~0.0.2" 587 | } 588 | } 589 | } 590 | } 591 | } 592 | } 593 | }, 594 | "through": { 595 | "version": "2.3.4", 596 | "from": "through@~2.3.4" 597 | }, 598 | "uglify-js": { 599 | "version": "2.4.13", 600 | "from": "uglify-js@~2.4.0", 601 | "dependencies": { 602 | "async": { 603 | "version": "0.2.10", 604 | "from": "async@~0.2.6", 605 | "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz" 606 | }, 607 | "source-map": { 608 | "version": "0.1.33", 609 | "from": "source-map@~0.1.33", 610 | "dependencies": { 611 | "amdefine": { 612 | "version": "0.1.0", 613 | "from": "amdefine@>=0.0.4" 614 | } 615 | } 616 | }, 617 | "optimist": { 618 | "version": "0.3.7", 619 | "from": "optimist@~0.3.5", 620 | "dependencies": { 621 | "wordwrap": { 622 | "version": "0.0.2", 623 | "from": "wordwrap@~0.0.2" 624 | } 625 | } 626 | }, 627 | "uglify-to-browserify": { 628 | "version": "1.0.2", 629 | "from": "uglify-to-browserify@~1.0.0" 630 | } 631 | } 632 | } 633 | } 634 | }, 635 | "url": { 636 | "version": "0.10.1", 637 | "from": "url@~0.10.1" 638 | }, 639 | "util": { 640 | "version": "0.10.3", 641 | "from": "util@~0.10.1" 642 | }, 643 | "vm-browserify": { 644 | "version": "0.0.4", 645 | "from": "vm-browserify@~0.0.1", 646 | "dependencies": { 647 | "indexof": { 648 | "version": "0.0.1", 649 | "from": "indexof@0.0.1", 650 | "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz" 651 | } 652 | } 653 | }, 654 | "xtend": { 655 | "version": "3.0.0", 656 | "from": "xtend@^3.0.0" 657 | }, 658 | "process": { 659 | "version": "0.7.0", 660 | "from": "process@^0.7.0" 661 | } 662 | } 663 | }, 664 | "jquery": { 665 | "version": "2.1.1", 666 | "from": "https://registry.npmjs.org/jquery/-/jquery-2.1.1.tgz", 667 | "resolved": "https://registry.npmjs.org/jquery/-/jquery-2.1.1.tgz" 668 | } 669 | } 670 | } 671 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fhir-js-client", 3 | "version": "0.0.1", 4 | "description": "JavaScript client for Fast Healthcare Interoperability Resources", 5 | "author": "Josh Mandel ", 6 | "dependencies": { 7 | "btoa": "*", 8 | "browserify": "<4.0.0", 9 | "jquery": "*" 10 | }, 11 | "scripts": { 12 | "test": "mocha -c -R spec" 13 | }, 14 | "devDependencies": { 15 | "mocha": "*", 16 | "should": "*", 17 | "sinon": "*", 18 | "grunt": "~0.4.1", 19 | "grunt-browserify": "~2.0.8", 20 | "grunt-contrib-concat": "~0.3.0", 21 | "grunt-contrib-clean": "~0.5.0", 22 | "grunt-shell": "~0.3.1", 23 | "jsdom": "*", 24 | "grunt-curl": "~1.5.1", 25 | "browserify-shim": "~3.4.1", 26 | "grunt-contrib-uglify": "~0.4.0" 27 | }, 28 | "engine": "node >= 0.6.0" 29 | } 30 | -------------------------------------------------------------------------------- /tasks/generate_js_client.py: -------------------------------------------------------------------------------- 1 | from xml.etree import ElementTree 2 | from xml.dom.minidom import parseString 3 | import glob, json, re 4 | from huTools.structured import dict2xml, dict2et 5 | 6 | FHIR_DIR = "/home/jmandel/smart/fhir" 7 | 8 | jsonParsers = { 9 | 'decimal': 'float', 10 | 'integer': 'integer', 11 | 'dateTime': 'date', 12 | 'instant': 'date', 13 | 'string': 'string', 14 | 'id': 'string', 15 | 'uri': 'string', 16 | 'idref': 'string', 17 | 'oid': 'string', 18 | 'base64Binary': 'string', 19 | 'xhtml': 'string', 20 | 'boolean': 'boolean', 21 | 'code': 'string' 22 | } 23 | 24 | def capitalizeFirstLetter(s): 25 | if len(s) < 2: return s.upper() 26 | return s[0].upper() + s[1:] 27 | 28 | def tree(FILES): 29 | paths = {} 30 | def process(file): 31 | f = json.load(open(file)) 32 | for v in f['Profile']['structure'][0]['element']: 33 | 34 | #split a given property into multiple strands when it's like: 35 | # value[X] (dateTime|String) 36 | propertyName = v['path']['value'] 37 | 38 | if 'type' in v['definition']: types = v['definition']['type'] 39 | else: types = [None] 40 | 41 | for possibleValue in types: 42 | 43 | valueType = possibleValue['code']['value'] if possibleValue else "" 44 | valueType = valueType.replace("*", "").replace("@", "") 45 | if (valueType.startswith("Resource(")): valueType = "ResourceReference" 46 | p = propertyName.replace("[x]", capitalizeFirstLetter(valueType)) 47 | parent = ".".join(p.split(".")[:-1]) 48 | paths[p] = { 49 | 'edges': {} 50 | } 51 | 52 | if parent in paths: 53 | step = p.replace(parent+".", "") 54 | paths[parent]['edges'][step] = edge = {} 55 | if valueType in jsonParsers: edge['parser'] = jsonParsers[valueType] 56 | elif valueType != "": edge['next'] = valueType 57 | else: edge['next'] = p 58 | 59 | for f in FILES: process(f) 60 | oldpaths = paths 61 | paths = {} 62 | for k,v in oldpaths.iteritems(): 63 | if len(v['edges'].keys()) > 0: paths[k]=v 64 | return paths 65 | 66 | t = tree(glob.glob(FHIR_DIR + "/build/publish/*.profile.json")) 67 | print json.dumps(t, sort_keys=True,indent=2) 68 | -------------------------------------------------------------------------------- /test/fixtures/observation.json: -------------------------------------------------------------------------------- 1 | { 2 | "Observation": { 3 | "text": { 4 | "status": { 5 | "value": "generated" 6 | }, 7 | "div": "
2004-10-22: 137/85 mmHg
" 8 | }, 9 | "name": { 10 | "coding": [ 11 | { 12 | "system": { 13 | "value": "http://loinc.org" 14 | }, 15 | "code": { 16 | "value": "55284-4" 17 | }, 18 | "display": { 19 | "value": "Blood pressure systolic and diastolic" 20 | } 21 | } 22 | ] 23 | }, 24 | "appliesDateTime": { 25 | "value": "2004-10-22" 26 | }, 27 | "status": { 28 | "value": "final" 29 | }, 30 | "subject": { 31 | "type": { 32 | "value": "Patient" 33 | }, 34 | "reference": { 35 | "value": "server/fhir/patient/@5227b41ac25e6ac5061d69e1" 36 | } 37 | }, 38 | "component": [ 39 | { 40 | "name": { 41 | "coding": [ 42 | { 43 | "system": { 44 | "value": "http://loinc.org" 45 | }, 46 | "code": { 47 | "value": "8480-6" 48 | }, 49 | "display": { 50 | "value": "Systolic blood pressure" 51 | } 52 | } 53 | ] 54 | }, 55 | "valueQuantity": { 56 | "value": { 57 | "value": "137" 58 | }, 59 | "units": { 60 | "value": "mm[Hg]" 61 | } 62 | } 63 | }, 64 | { 65 | "name": { 66 | "coding": [ 67 | { 68 | "system": { 69 | "value": "http://loinc.org" 70 | }, 71 | "code": { 72 | "value": "8462-4" 73 | }, 74 | "display": { 75 | "value": "Diastolic blood pressure" 76 | } 77 | } 78 | ] 79 | }, 80 | "valueQuantity": { 81 | "value": { 82 | "value": "85" 83 | }, 84 | "units": { 85 | "value": "mm[Hg]" 86 | } 87 | } 88 | } 89 | ] 90 | } 91 | } 92 | 93 | -------------------------------------------------------------------------------- /test/fixtures/observation.simplified.json: -------------------------------------------------------------------------------- 1 | { 2 | "text": { 3 | "status": "generated", 4 | "div": "
2004-10-22: 137/85 mmHg
" 5 | }, 6 | "name": { 7 | "coding": [ 8 | { 9 | "system": "http://loinc.org", 10 | "code": "55284-4", 11 | "display": "Blood pressure systolic and diastolic" 12 | } 13 | ] 14 | }, 15 | "appliesDateTime": "2004-10-22T00:00:00.000Z", 16 | "status": "final", 17 | "subject": { 18 | "type": "Patient", 19 | "reference": "server/fhir/patient/@5227b41ac25e6ac5061d69e1" 20 | }, 21 | "component": [ 22 | { 23 | "name": { 24 | "coding": [ 25 | { 26 | "system": "http://loinc.org", 27 | "code": "8480-6", 28 | "display": "Systolic blood pressure" 29 | } 30 | ] 31 | }, 32 | "valueQuantity": { 33 | "value": 137, 34 | "units": "mm[Hg]" 35 | } 36 | }, 37 | { 38 | "name": { 39 | "coding": [ 40 | { 41 | "system": "http://loinc.org", 42 | "code": "8462-4", 43 | "display": "Diastolic blood pressure" 44 | } 45 | ] 46 | }, 47 | "valueQuantity": { 48 | "value": 85, 49 | "units": "mm[Hg]" 50 | } 51 | } 52 | ], 53 | "resourceType": "Observation" 54 | } 55 | -------------------------------------------------------------------------------- /test/fixtures/patient.json: -------------------------------------------------------------------------------- 1 | {"resourceType":"Patient","text":{"status":"generated","div":"
\n \n

Patient Donald DUCK @ Acme Healthcare, Inc. MR = 654321

\n \n
"},"identifier":[{"use":"usual","label":"MRN","system":"urn:oid:0.1.2.3.4.5.6.7","value":"654321"}],"name":[{"use":"official","family":["Donald"],"given":["Duck"]}],"gender":{"coding":[{"system":"http://hl7.org/fhir/v3/AdministrativeGender","code":"M","display":"Male"}]},"photo":[{"contentType":"image/gif","data":"R0lGODlhEwARAPcAAAAAAAAA/+9aAO+1AP/WAP/eAP/eCP/eEP/eGP/nAP/nCP/nEP/nIf/nKf/nUv/nWv/vAP/vCP/vEP/vGP/vIf/vKf/vMf/vOf/vWv/vY//va//vjP/3c//3lP/3nP//tf//vf///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH5BAEAAAEALAAAAAATABEAAAi+AAMIDDCgYMGBCBMSvMCQ4QCFCQcwDBGCA4cLDyEGECDxAoAQHjxwyKhQAMeGIUOSJJjRpIAGDS5wCDly4AALFlYOgHlBwwOSNydM0AmzwYGjBi8IHWoTgQYORg8QIGDAwAKhESI8HIDgwQaRDI1WXXAhK9MBBzZ8/XDxQoUFZC9IiCBh6wEHGz6IbNuwQoSpWxEgyLCXL8O/gAnylNlW6AUEBRIL7Og3KwQIiCXb9HsZQoIEUzUjNEiaNMKAAAA7"}],"contact":[{"relationship":[{"coding":[{"system":"http://hl7.org/fhir/patient-contact-relationship","code":"owner"}]}],"organization":{"reference":"Organization/1","display":"Walt Disney Corporation"}}],"managingOrganization":{"reference":"Organization/1","display":"ACME Healthcare, Inc"},"link":[{"other":{"reference":"Patient/pat2"},"type":"seealso"}],"active":true} 2 | -------------------------------------------------------------------------------- /test/fixtures/patient.search.json: -------------------------------------------------------------------------------- 1 | { 2 | "resourceType": "Bundle", 3 | "title": "FHIR Atom Feed", 4 | "id": "http://localhost/Patient?_format=json&_count=2", 5 | "link": [ 6 | { 7 | "rel": "self", 8 | "href": "http://localhost/Patient?_format=json&_count=2" 9 | }, 10 | { 11 | "rel": "next", 12 | "href": "http://localhost/Patient?_format=json&_count=2&_skip=2" 13 | } 14 | ], 15 | "totalResults": 59, 16 | "updated": "2014-04-28T12:34:19.742-07:00", 17 | "author": [ 18 | { 19 | "name": "groovy.config.atom.author-name", 20 | "uri": "groovy.config.atom.author-uri" 21 | } 22 | ], 23 | "entry": [ 24 | { 25 | "title": "Patient/1032702", 26 | "id": "http://localhost/Patient/1032702", 27 | "updated": "2014-04-28T12:34:19.742-07:00", 28 | "content": { 29 | "resourceType": "Patient", 30 | "text": { 31 | "status": "generated", 32 | "div": "
\n \n

Amy V. Shaw

\n \n
" 33 | }, 34 | "identifier": [ 35 | { 36 | "use": "usual", 37 | "label": "SMART Hospiptal MRN", 38 | "system": "urn:oid:0.1.2.3.4.5.6.7", 39 | "value": "1032702" 40 | } 41 | ], 42 | "name": [ 43 | { 44 | "use": "official", 45 | "family": [ 46 | "Shaw" 47 | ], 48 | "given": [ 49 | "Amy", 50 | "V." 51 | ] 52 | } 53 | ], 54 | "telecom": [ 55 | { 56 | "system": "phone", 57 | "use": "home" 58 | }, 59 | { 60 | "system": "phone", 61 | "value": "800-782-6765", 62 | "use": "mobile" 63 | }, 64 | { 65 | "system": "email", 66 | "value": "amy.shaw@example.com" 67 | } 68 | ], 69 | "gender": { 70 | "coding": [ 71 | { 72 | "system": "http://hl7.org/fhir/v3/AdministrativeGender", 73 | "code": "F", 74 | "display": "Female" 75 | } 76 | ] 77 | }, 78 | "birthDate": "2007-03-20", 79 | "address": [ 80 | { 81 | "use": "home", 82 | "line": [ 83 | "49 Meadow St" 84 | ], 85 | "city": "Mounds", 86 | "state": "OK", 87 | "zip": "74047", 88 | "country": "USA" 89 | } 90 | ], 91 | "active": true 92 | } 93 | }, 94 | { 95 | "title": "Patient/1081332", 96 | "id": "http://localhost/Patient/1081332", 97 | "updated": "2014-04-28T12:34:19.742-07:00", 98 | "content": { 99 | "resourceType": "Patient", 100 | "text": { 101 | "status": "generated", 102 | "div": "
\n \n

Joseph I. Ross

\n \n
" 103 | }, 104 | "identifier": [ 105 | { 106 | "use": "usual", 107 | "label": "SMART Hospiptal MRN", 108 | "system": "urn:oid:0.1.2.3.4.5.6.7", 109 | "value": "1081332" 110 | } 111 | ], 112 | "name": [ 113 | { 114 | "use": "official", 115 | "family": [ 116 | "Ross" 117 | ], 118 | "given": [ 119 | "Joseph", 120 | "I." 121 | ] 122 | } 123 | ], 124 | "telecom": [ 125 | { 126 | "system": "phone", 127 | "use": "home" 128 | }, 129 | { 130 | "system": "phone", 131 | "value": "800-960-9294", 132 | "use": "mobile" 133 | }, 134 | { 135 | "system": "email", 136 | "value": "joseph.ross@example.com" 137 | } 138 | ], 139 | "gender": { 140 | "coding": [ 141 | { 142 | "system": "http://hl7.org/fhir/v3/AdministrativeGender", 143 | "code": "M", 144 | "display": "Male" 145 | } 146 | ] 147 | }, 148 | "birthDate": "2003-10-02", 149 | "address": [ 150 | { 151 | "use": "home", 152 | "line": [ 153 | "19 Church StApt 29" 154 | ], 155 | "city": "Tulsa", 156 | "state": "OK", 157 | "zip": "74108", 158 | "country": "USA" 159 | } 160 | ], 161 | "active": true 162 | } 163 | } 164 | ] 165 | } 166 | -------------------------------------------------------------------------------- /test/fixtures/patient.simplified.json: -------------------------------------------------------------------------------- 1 | { 2 | "text": { 3 | "status": "generated", 4 | "div": "
\n \n

Amy E. Clark

\n \n
" 5 | }, 6 | "identifier": [ 7 | { 8 | "use": "usual", 9 | "label": "SMART Hospiptal MRN", 10 | "system": "urn:oid:0.1.2.3.4.5.6.7", 11 | "key": "1540505" 12 | } 13 | ], 14 | "name": [ 15 | { 16 | "use": "official", 17 | "family": [ 18 | "Clark" 19 | ], 20 | "given": [ 21 | "Amy", 22 | "E." 23 | ] 24 | } 25 | ], 26 | "telecom": [ 27 | { 28 | "system": "phone", 29 | "value": "800-661-3584", 30 | "use": "home" 31 | }, 32 | { 33 | "system": "phone", 34 | "use": "mobile" 35 | }, 36 | { 37 | "system": "email", 38 | "value": "amy.clark@example.com" 39 | } 40 | ], 41 | "gender": { 42 | "coding": [ 43 | { 44 | "system": "http://hl7.org/fhir/v3/AdministrativeGender", 45 | "code": "F", 46 | "display": "Female" 47 | } 48 | ] 49 | }, 50 | "birthDate": "1964-01-21T00:00:00.000Z", 51 | "address": [ 52 | { 53 | "use": "home", 54 | "line": [ 55 | "77 North St" 56 | ], 57 | "city": "Bixby", 58 | "state": "OK", 59 | "zip": "74008", 60 | "country": "USA" 61 | } 62 | ], 63 | "active": true, 64 | "resourceType": "Patient" 65 | } 66 | -------------------------------------------------------------------------------- /test/mocha.opts: -------------------------------------------------------------------------------- 1 | --require should 2 | --require sinon 3 | 4 | -------------------------------------------------------------------------------- /test/test.js: -------------------------------------------------------------------------------- 1 | var FhirClient = require('../client/client'); 2 | var SearchSpecification = require('../client/search-specification.js')(); 3 | var sinon = require('sinon'); 4 | var window = require('jsdom').jsdom().createWindow(); 5 | var ns = require('../client/namespace'); 6 | var assert = require('assert'); 7 | 8 | var $ = jQuery = require('../client/jquery'); 9 | var search = SearchSpecification; 10 | var Condition = search.Condition, 11 | Patient = search.Patient; 12 | 13 | 14 | describe('Search Specification', function(){ 15 | 16 | var partial = Patient.given('John'); 17 | 18 | it('should have one clause for each term', function(){ 19 | partial.__getClauses().should.have.lengthOf(1); 20 | }); 21 | 22 | it('should do camelCase function names and dash-erized wire calls', function(){ 23 | 24 | var q = search.Observation .relatedTarget(search.Observation._id("123")); 25 | q.__getClauses()[0].should.eql({ 26 | name: 'related-target:Observation', 27 | value: '123' 28 | }); 29 | 30 | }); 31 | 32 | 33 | it('should allow partial searches to be extended', function(){ 34 | var extended = partial.family('Smith'); 35 | extended.__getClauses().should.have.lengthOf(2); 36 | }); 37 | 38 | it('should represent clauses as name:value dictionaries', function(){ 39 | var first = partial.__getClauses()[0]; 40 | first.should.have.properties({ 41 | 'name': 'given', 42 | 'value': 'John' 43 | }) 44 | }); 45 | 46 | it('should support FHIR disjunction parameters', function(){ 47 | var first = Patient.givenIn('John', 'Bob', ['Paul', 'Fred']).__getClauses()[0]; 48 | first.should.have.properties({ 49 | 'name': 'given', 50 | 'oneOf': ['John', 'Bob', 'Paul', 'Fred'] 51 | }) 52 | }); 53 | 54 | it('should support FHIR conjunction parameters', function(){ 55 | var first = Patient.givenAll('John', 'Bob', ['Paul', 'Fred']).__getClauses(); 56 | first.should.eql([{ 57 | 'name': 'given', 58 | 'value': 'John' 59 | },{ 60 | 'name': 'given', 61 | 'value': 'Bob' 62 | },{ 63 | 'name': 'given', 64 | 'value': 'Paul' 65 | },{ 66 | 'name': 'given', 67 | 'value': 'Fred' 68 | }]) 69 | }); 70 | 71 | 72 | it('should support the :missing modifer universally', function(){ 73 | var q = Patient.familyMissing(true); 74 | q.__getClauses().should.eql([{ 75 | name: 'family:missing', 76 | value: true 77 | }]); 78 | }); 79 | 80 | describe('searching on token params', function(){ 81 | 82 | it('should work via exact string', function(){ 83 | var q = Patient.identifier('http://myhospital|123'); 84 | q.__getClauses().should.eql([{ 85 | name: 'identifier', 86 | value: 'http://myhospital|123' 87 | }]); 88 | }); 89 | 90 | it('should work via two-argument ns + code', function(){ 91 | var q = Patient.identifier(ns.rxnorm, '123'); 92 | q.__getClauses().should.eql([{ 93 | name: 'identifier', 94 | value: 'http://rxnav.nlm.nih.gov/REST/rxcui|123' 95 | }]); 96 | }); 97 | 98 | it('should allow searching with wildcard namespace', function(){ 99 | var q = Patient.identifier(ns.any, '123'); 100 | q.__getClauses().should.eql([{ 101 | name: 'identifier', 102 | value: '123' 103 | }]); 104 | }); 105 | 106 | it('should allow searching with null namespace specified', function(){ 107 | var q = Patient.identifier(ns.none, '123'); 108 | q.__getClauses().should.eql([{ 109 | name: 'identifier', 110 | value: '|123' 111 | }]); 112 | }); 113 | 114 | 115 | }); 116 | 117 | describe('Nesting search params', function(){ 118 | 119 | it('should produce chained queries', function(){ 120 | var q = Condition.onset('>=2010') 121 | .subject( 122 | Patient.given('John').family('Smith') 123 | ); 124 | 125 | 126 | var clauses = q.__getClauses(); 127 | clauses.should.eql([{ 128 | 'name': 'onset', 129 | 'value': '>=2010' 130 | },{ 131 | name:'subject:Patient.given', 132 | value:'John' 133 | },{ 134 | name:'subject:Patient.family', 135 | value:'Smith' 136 | }]); 137 | }); 138 | 139 | it('should optimize _id references to avoid unnecessary chaining', function(){ 140 | var q = Condition.subject( Patient._id("123") ); 141 | var clauses = q.__getClauses(); 142 | clauses.should.eql([{ 143 | 'name': 'subject:Patient', 144 | 'value': '123' 145 | }]); 146 | }); 147 | 148 | it('should work with "or clauses"', function(){ 149 | var q = Condition.subject( Patient._id("123").nameIn("john", "smith") ); 150 | var clauses = q.__getClauses(); 151 | clauses.should.eql([{ 152 | 'name': 'subject:Patient', 153 | 'value': '123' 154 | },{ 155 | 'name': 'subject:Patient.name', 156 | 'oneOf': ["john", "smith"] 157 | }]); 158 | }); 159 | 160 | }); 161 | 162 | 163 | }); 164 | 165 | 166 | describe('client', function(){ 167 | var sandbox; 168 | 169 | beforeEach(function(){ 170 | sandbox = sinon.sandbox.create(); 171 | }); 172 | 173 | afterEach(function(){ 174 | sandbox = sinon.sandbox.restore(); 175 | }); 176 | 177 | 178 | describe('Initialization', function(){ 179 | 180 | it('should require a well-formatted serviceUrl', function(){ 181 | 182 | (function(){ 183 | var client = FhirClient({serviceUrl: 'https://myservice.com/fhir'}); 184 | }).should.not.throw; 185 | 186 | (function(){ 187 | var client = FhirClient({}); 188 | }).should.throw; 189 | 190 | (function(){ 191 | var client = FhirClient({serviceUrl: 'myserver.com/badness'}); 192 | }).should.throw; 193 | 194 | (function(){ 195 | var client = FhirClient({serviceUrl: 'https://myservice.com/fhir/'}); 196 | }).should.throw; 197 | 198 | 199 | }); 200 | 201 | }) 202 | 203 | function stubAjax(req, doneArgs, failArgs) { 204 | sandbox.stub($, 'ajax', function(){ 205 | req.apply(this, arguments); 206 | return { 207 | done: function(cb){ 208 | process.nextTick(function(){ 209 | cb.apply(this, doneArgs); 210 | }); 211 | return this; 212 | }, 213 | fail: function(cb){ 214 | process.nextTick(function(){ 215 | cb.apply(this, failArgs); 216 | }); 217 | return this; 218 | } 219 | }; 220 | }); 221 | } 222 | describe('Search Operation', function(){ 223 | 224 | var client = FhirClient({serviceUrl: 'http://localhost'}); 225 | 226 | it('should issue a search command', function(done){ 227 | stubAjax(function(p){ 228 | p.type.should.equal('GET'); 229 | p.url.should.match(/\/_search$/); 230 | }, [ 231 | require('./fixtures/patient.search.json'), 200 232 | ]); 233 | 234 | client.search(Patient._idIn("123", "456")).done(function(results, s){ 235 | results.should.have.lengthOf(2); 236 | done() 237 | }); 238 | 239 | }) 240 | }); 241 | 242 | describe('A client with patient context', function(){ 243 | 244 | var client = FhirClient({serviceUrl: 'http://localhost', patientId:'123'}); 245 | 246 | it('should have a patient-specific Conditions api object', function(){ 247 | client.context.patient.Condition.should.be.ok; 248 | }); 249 | it('should not have a patient-specific Practitioner api object', function(){ 250 | assert(undefined === client.context.patient.Practitioner); 251 | }); 252 | it('should have generic Practitioner api object', function(){ 253 | client.api.Practitioner.should.be.ok; 254 | }); 255 | 256 | }); 257 | 258 | 259 | }); 260 | 261 | --------------------------------------------------------------------------------