diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 00000000..8f5007fa
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1,10 @@
+node_modules
+.eslintrc
+.nyc_output
+.vscode
+coverage
+build
+dist
+lib
+example
+trash
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 00000000..afe5579f
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,38 @@
+---
+name: Bug report
+about: Create a report to help us improve
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+**Describe the bug**
+A clear and concise description of what the bug is.
+
+**To Reproduce**
+Steps to reproduce the behavior. A few things to consider including:
+- Is the server an open server or closed?
+- What requests are you making, or what methods aren't working as expected.
+- What launch sequence are you using?
+
+**Expected behavior**
+A clear and concise description of what you expected to happen.
+
+**Screenshots**
+If applicable, add screenshots to help explain your problem.
+
+**Client-side (please complete the following information):**
+ - OS: [e.g. Windows, OS, iOS]
+ - Browser [e.g. chrome, safari]
+ - Version [e.g. 22]
+ - Front-end Framework(s) [e.g. React, jQuery]
+
+**Server-side (please complete the following information):**
+ - Node version: [e.g. v21.6.0]
+ - OS: [e.g. OS, Unix]
+ - Framework [e.g. Express, HAPI, none]
+ - Framework Version [e.g. 22]
+
+**Additional context**
+Add any other context about the problem here. If you have links to any deployed tools or webpages, they would be good to include.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 00000000..bbcbbe7d
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,20 @@
+---
+name: Feature request
+about: Suggest an idea for this project
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+**Is your feature request related to a problem? Please describe.**
+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+
+**Describe the solution you'd like**
+A clear and concise description of what you want to happen.
+
+**Describe alternatives you've considered**
+A clear and concise description of any alternative solutions or features you've considered.
+
+**Additional context**
+Add any other context or screenshots about the feature request here.
diff --git a/.github/workflows/browser.yml b/.github/workflows/browser.yml
new file mode 100644
index 00000000..644bd5d0
--- /dev/null
+++ b/.github/workflows/browser.yml
@@ -0,0 +1,32 @@
+
+name: Browser Tests
+
+on:
+ push:
+ branches: [ "*" ]
+ pull_request:
+ branches: [ "*" ]
+ workflow_dispatch:
+ branches: [ "*" ]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-20.04
+
+ steps:
+
+ - uses: actions/checkout@v3
+
+ - name: Setup Node.js 18.x
+ uses: actions/setup-node@v3
+ with:
+ node-version: 18.x
+ cache: npm
+
+ - run: npm ci --legacy-peer-deps
+
+ - run: npm run build --if-present
+
+ - run: npm run nightwatch
+
diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml
new file mode 100644
index 00000000..ef328a0c
--- /dev/null
+++ b/.github/workflows/node.yml
@@ -0,0 +1,41 @@
+
+name: NodeJS Tests
+
+on:
+ push:
+ branches: [ "*" ]
+ pull_request:
+ branches: [ "*" ]
+ workflow_dispatch:
+ branches: [ "*" ]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-20.04
+
+ strategy:
+ matrix:
+ node-version: [ 18.x, 20.x ]
+
+ steps:
+
+ - uses: actions/checkout@v3
+
+ - name: Setup Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v3
+ with:
+ node-version: ${{ matrix.node-version }}
+ cache: npm
+
+ - run: npm ci --legacy-peer-deps
+
+ - run: npm run build --if-present
+
+ - run: npm test
+
+ - name: Coveralls
+ uses: coverallsapp/github-action@master
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+
diff --git a/.gitignore b/.gitignore
index ad68e0f4..7da26980 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,11 @@
.#*
*.swp
node_modules
+.vscode
+# test.html
+trash
+post-launch/index.html
+.DS_Store
+coverage
+.nyc_output
+tests_output
diff --git a/.labrc.js b/.labrc.js
new file mode 100644
index 00000000..f9825a5e
--- /dev/null
+++ b/.labrc.js
@@ -0,0 +1,115 @@
+module.exports = {
+
+ // coverage ----------------------------------------------------------------
+
+ // enable code coverage analysis (-c, --coverage)
+ // coverage: false,
+
+ // set code coverage path (--coverage-path)
+ // coveragePath: "dist",
+
+ // set code coverage excludes (--coverage-exclude)
+ // coverageExclude: "lib/**.*",
+
+ // include all files in coveragePath in report (--coverage-all)
+ // coverageAll: true,
+
+ // --coverage-flat prevent recursive inclusion of all files in coveragePath in report
+ // coverageFlat: false,
+
+ // --coverage-module enable coverage on external module
+ // coverageModule: true,
+
+ // --coverage-pattern file pattern to use for locating files for coverage
+ // coveragePattern: "src/**.*",
+
+ // sourcemaps --------------------------------------------------------------
+
+ // enable support for sourcemaps (-S, --sourcemaps)
+ sourcemaps: true,
+
+ // transform ---------------------------------------------------------------
+ // javascript file that exports an array of objects ie.
+ // [ { ext: ".js", transform: function (content, filename) { ... } } ]
+ // (-T, --transform)
+ // transform: "node_modules/lab-transform-typescript",
+
+ // reporters ---------------------------------------------------------------
+ // reporter type [console, html, json, tap, lcov, clover, junit]
+ // Note that the order of entries corresponds to the `output` below
+ // (-r, --reporter)
+ reporter: ["console"],
+
+ // output ------------------------------------------------------------------
+ // file path to write test results
+ // Note that the order of entries corresponds to the `reporter` above
+ // (-o, --output)
+ // output: ["stdout"],
+
+ // Other -------------------------------------------------------------------
+ // ignore a list of globals for the leak detection (comma separated)
+ // (-I, --globals)
+ globals: "crypto,__coverage__", // "__core-js_shared__",
+
+ // --bail exit the process with a non zero exit code on the first test failure
+ bail: false,
+
+ // -p, --default-plan-threshold minimum plan threshold to apply to all tests that don't define any plan
+ defaultPlanThreshold: 90,
+
+ // -e, --environment value to set NODE_ENV before tests
+ environment: "test",
+
+ // -f, --flat prevent recursive collection of tests within the provided path
+ flat: false,
+
+ // -l, --leaks disable global variable leaks detection
+ leaks: true,
+
+ // --shuffle shuffle script execution order
+ shuffle: false,
+
+ // -s, --silence silence test output
+ silence: false,
+
+ // -k, --silent-skips don’t output skipped tests
+ silentSkips: false,
+
+ // -t, --threshold code coverage threshold percentage
+ // threshold: 90,
+
+ // -m, --timeout timeout for each test in milliseconds
+ timeout: 5000,
+
+ // -M, --context-timeout timeout for before, after, beforeEach, afterEach in milliseconds
+ contextTimeout: 1000,
+
+ // -Y, --types test types definitions
+ types: false,
+ // --types-test location of types definitions test file
+
+ // -v, --verbose verbose test output
+ verbose: true,
+
+ // -V, --version version information
+ // -h, --help display usage options
+ // -a, --assert specify an assertion library module path to require and
+ // make available under Lab.assertions
+ // -C, --colors enable color output (defaults to terminal capabilities)
+ // -d, --dry skip all tests (dry run)
+ // --inspect starts lab with the node.js native debugger
+ // --seed use this seed to randomize the order with `--shuffle`.
+ // This is useful to debug order dependent test failures
+ // -L, --lint enable linting
+ lint: false,
+ // -n, --linter linter path to use
+ // --lint-fix apply any fixes from the linter.
+ // --lint-options specify options to pass to linting program. It must be a
+ // string that is JSON.parse(able).
+ // --lint-errors-threshold linter errors threshold in absolute value
+ // --lint-warnings-threshold linter warnings threshold in absolute value
+ // -P, --pattern file pattern to use for locating tests
+ // -g, --grep only run tests matching the given pattern which is
+ // internally compiled to a RegExp
+ // -i, --id test identifier
+};
diff --git a/.npmignore b/.npmignore
new file mode 100644
index 00000000..2d9290c3
--- /dev/null
+++ b/.npmignore
@@ -0,0 +1,19 @@
+*.log
+*.pyc
+*.tmproj
+*~
+.project
+*#
+.#*
+*.swp
+node_modules
+.vscode
+old
+trash
+test
+docs
+.babelrc
+.eslintignore
+.eslintrc.js
+.labrc.js
+webpack.config.js
\ No newline at end of file
diff --git a/.nvmrc b/.nvmrc
new file mode 100644
index 00000000..3f430af8
--- /dev/null
+++ b/.nvmrc
@@ -0,0 +1 @@
+v18
diff --git a/Gruntfile.js b/Gruntfile.js
deleted file mode 100644
index 08ef5606..00000000
--- a/Gruntfile.js
+++ /dev/null
@@ -1,39 +0,0 @@
-module.exports = function (grunt) {
-
- grunt.loadNpmTasks('grunt-contrib-clean');
- grunt.loadNpmTasks('grunt-contrib-concat');
- grunt.loadNpmTasks('grunt-browserify');
- grunt.loadNpmTasks('grunt-shell');
- grunt.loadNpmTasks('grunt-curl');
- grunt.loadNpmTasks('grunt-contrib-uglify');
-
- grunt.initConfig({
- curl: {
- conformance: {
- dest: 'vendor/conformance.json',
- src: 'http://hl7-fhir.github.io/conformance-base.json'
- }
- },
- shell: {
- browserify: {
- command: "./node_modules/.bin/browserify -e client/entry.js -i './node_modules/jsdom/**' > dist/fhir-client.js",
- options: {
- failOnError: true,
- stderr: true
- }
- }
- },
- uglify: {
- minifiedLib: {
- files: {
- 'dist/fhir-client.min.js': ['dist/fhir-client.js']
- }
- }
- }
- });
-
- grunt.registerTask('browserify', 'Browserify to create window.FHIR', ['shell:browserify']);
- grunt.registerTask('conformance', 'Download conformance base', ['curl:conformance']);
- grunt.registerTask('default', ['browserify', 'uglify:minifiedLib']);
- grunt.registerTask('all', ['conformance', 'default']);
-};
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 00000000..2169c47b
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,13 @@
+Copyright 2015 Boston Children's Hospital
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this software except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/README.md b/README.md
new file mode 100644
index 00000000..eceafd61
--- /dev/null
+++ b/README.md
@@ -0,0 +1,47 @@
+SMART on FHIR JavaScript Library
+================================
+
+This is a JavaScript library for connecting SMART apps to Fhir servers.
+It works both in browsers (including IE11+) and on the server (NodeJS).
+
+## Installation
+
+Install from npm:
+```sh
+npm i fhirclient
+```
+
+
+
+## Documentation
+The documentation for the upcoming release is available at [http://docs.smarthealthit.org/client-js/](http://docs.smarthealthit.org/client-js/).
+
+Check out [what's new in v2](http://docs.smarthealthit.org/client-js/v2.html)!
+
+
+
+
+## Contributing and Development
+
+### NPM Scripts
+
+After you `cd` into to the project folder and run `npm i`, you can use npm scripts to handle any project-related task:
+
+```sh
+# run tests
+npm test
+
+# Build everything
+npm run build
+
+# Build all bundles (browser packages in dist/build)
+npm run pack
+
+# Build the CommonJS modules (for Node and bundlers)
+npm run build:module
+```
+
+## License
+Apache 2.0
+
+
diff --git a/babel.config.js b/babel.config.js
new file mode 100644
index 00000000..8916ad06
--- /dev/null
+++ b/babel.config.js
@@ -0,0 +1,40 @@
+module.exports = {
+ env: {
+ pure: {},
+ browser: {
+ plugins: ["@babel/plugin-transform-runtime"],
+ presets: [
+ ["@babel/preset-env", {
+ useBuiltIns: "usage",
+ modules: "commonjs",
+ corejs: {
+ version: 3,
+ proposals: true
+ },
+ targets: [
+ "last 2 Chrome versions",
+ "last 2 firefox versions",
+ "last 2 Edge versions",
+ "ie 11"
+ ],
+ debug: true,
+ // loose: true, // needed for IE 10
+ }]
+ ]
+ },
+ module: {
+ presets: [
+ ["@babel/preset-env", {
+ useBuiltIns: "usage",
+ modules: "commonjs",
+ corejs: {
+ version: 3
+ },
+ targets: [
+ "node 18"
+ ]
+ }]
+ ]
+ }
+ }
+};
diff --git a/client/bb-client.js b/client/bb-client.js
deleted file mode 100644
index 67ef3a96..00000000
--- a/client/bb-client.js
+++ /dev/null
@@ -1,185 +0,0 @@
-var $ = jQuery = require('./jquery');
-var FhirClient = require('./client');
-var Guid = require('./guid');
-
-var BBClient = module.exports = {debug: true}
-BBClient.jQuery = BBClient.$ = jQuery;
-
-BBClient.ready = function(hash, callback){
-
- var mustClearHash = false;
- if (arguments.length == 1){
- mustClearHash = true;
- callback = hash;
- hash = window.location.hash;
- }
-
- var oauthResult = hash.match(/#(.*)/);
- oauthResult = oauthResult ? oauthResult[1] : "";
- oauthResult = oauthResult.split(/&/);
-
- BBClient.authorization = null;
- BBClient.state = null;
-
- var authorization = {};
- for (var i = 0; i < oauthResult.length; i++){
- var kv = oauthResult[i].split(/=/);
- if (kv[0].length > 0) {
- authorization[decodeURIComponent(kv[0])] = decodeURIComponent(kv[1]);
- }
- }
-
- if (Object.keys(authorization).length > 0 && authorization.state){
- BBClient.authorization = authorization;
- BBClient.state = JSON.parse(localStorage[BBClient.authorization.state]);
- } else {
- return;
- }
-
- console.log(BBClient);
-
- // don't expose hash in the URL while in production mode
- if (mustClearHash && BBClient.debug !== true) {
- window.location.hash="";
- }
-
- var fhirClientParams = BBClient.fhirAuth = {
- serviceUrl: BBClient.state.provider.bb_api.fhir_service_uri,
- patientId: authorization.patient
- };
-
- if (BBClient.authorization.access_token !== undefined) {
- fhirClientParams.auth = {
- type: 'bearer',
- token: BBClient.authorization.access_token
- };
- }
- process.nextTick(function(){
- var ret = FhirClient(fhirClientParams);
- ret.state = JSON.parse(JSON.stringify(BBClient.state));
- callback && callback(ret);
- });
-}
-
-function providers(fhirServiceUrl, callback){
- jQuery.get(
- fhirServiceUrl+"/metadata",
- function(r){
- var res = {
- "name": "SMART on FHIR Testing Server",
- "description": "Dev server for SMART on FHIR",
- "url": null,
- "oauth2": {
- "registration_uri": null,
- "authorize_uri": null,
- "token_uri": null
- },
- "bb_api":{
- "fhir_service_uri": fhirServiceUrl,
- "search": fhirServiceUrl + "/DocumentReference"
- }
- };
-
- try {
- jQuery.each(r.rest[0].security.extension, function(responseNum, arg){
- if (arg.url === "http://fhir-registry.smartplatforms.org/Profile/oauth-uris#register") {
- res.oauth2.registration_uri = arg.valueUri;
- } else if (arg.url === "http://fhir-registry.smartplatforms.org/Profile/oauth-uris#authorize") {
- res.oauth2.authorize_uri = arg.valueUri;
- } else if (arg.url === "http://fhir-registry.smartplatforms.org/Profile/oauth-uris#token") {
- res.oauth2.token_uri = arg.valueUri;
- }
- });
- }
- catch (err) {
- }
-
- callback && callback(res);
- },
- "json"
- );
-};
-
-BBClient.noAuthFhirProvider = function(serviceUrl){
- return {
- "oauth2": null,
- "bb_api":{
- "fhir_service_uri": serviceUrl
- }
- }
-};
-
-function relative(url){
- return (window.location.protocol + "//" + window.location.host + window.location.pathname).match(/(.*\/)[^\/]*/)[1] + url;
-}
-
-function getParameterByName(name) {
- name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
- var regexS = "[\\?&]" + name + "=([^]*)";
- var regex = new RegExp(regexS);
- var results = regex.exec(window.location.search);
- if(results == null)
- return "";
- else
- return decodeURIComponent(results[1].replace(/\+/g, " "));
-}
-
-BBClient.authorize = function(params){
-
- if (!params.client){
- params = {
- client: params
- };
- }
-
- if (!params.client.redirect_uri){
- params.client.redirect_uri = relative("");
- }
-
- if (!params.client.redirect_uri.match(/:\/\//)){
- params.client.redirect_uri = relative(params.client.redirect_uri);
- }
-
- var launch = getParameterByName("launch");
- if (launch){
- if (!params.client.scope.match(/launch:/)){
- params.client.scope += " launch:"+launch;
- }
- }
-
- var server = getParameterByName("iss");
- if (server){
- if (!params.server){
- params.server = server;
- }
- }
-
- providers(params.server, function(provider){
-
- params.provider = provider;
-
- var state = Guid.newGuid();
- var client = params.client;
-
- if (params.provider.oauth2 == null) {
- localStorage[state] = JSON.stringify(params);
- window.location.href = client.redirect_uri + "#state="+state;
- return;
- }
-
- localStorage[state] = JSON.stringify(params);
-
- console.log("sending client reg", params.client);
-
- var redirect_to=params.provider.oauth2.authorize_uri + "?" +
- "client_id="+client.client_id+"&"+
- "response_type=token&"+
- "scope="+client.scope+"&"+
- "redirect_uri="+client.redirect_uri+"&"+
- "state="+state;
-
- window.location.href = redirect_to;
- });
-};
-
-
diff --git a/client/build-definitions.js b/client/build-definitions.js
deleted file mode 100644
index 69431a62..00000000
--- a/client/build-definitions.js
+++ /dev/null
@@ -1,22 +0,0 @@
-var c = require('../vendor/conformance.json');
-var definitions = {};
-var camelCased = function(s){
- return s.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });
-};
-
-c.rest[0].resource.forEach(function(r){
- var params = [];
- definitions[r.type] = {
- params: params
- };
-
- r.searchParam.forEach(function(sp){
- params.push({
- name: camelCased(sp.name),
- wireName: sp.name,
- type: sp.type
- });
- });
-});
-
-module.exports = definitions;
diff --git a/client/client.js b/client/client.js
deleted file mode 100644
index fc6615f0..00000000
--- a/client/client.js
+++ /dev/null
@@ -1,364 +0,0 @@
-var btoa = require('btoa');
-var Search = require('./search');
-var $ = jQuery = require('./jquery');
-
-module.exports = FhirClient;
-
-function absolute(id, server) {
- if (id.match(/^http/)) return id;
- if (id.match(/^urn/)) return id;
- return server.serviceUrl + '/' + id;
-}
-
-var regexpSpecialChars = /([\[\]\^\$\|\(\)\\\+\*\?\{\}\=\!])/gi;
-
-function relative(id, server) {
- if (!id.match(/^http/)) {
- id = server.serviceUrl + '/' + id
- }
- var quotedBase = ( server.serviceUrl + '/' ).replace(regexpSpecialChars, '\\$1');
- var matcher = new RegExp("^"+quotedBase + "([^/]+)/([^/]+)(?:/_history/(.*))?$");
- var match = id.match(matcher);
- if (match === null) {
- throw "Couldn't determine a relative URI for " + id;
- }
-
- var params = {
- resource: match[1],
- id: match[2],
- version: match[3]
- };
-
- return params;
-}
-
-function ClientPrototype(){};
-var clientUtils = require('./utils');
-Object.keys(clientUtils).forEach(function(k){
- ClientPrototype.prototype[k] = clientUtils[k];
-});
-
-function FhirClient(p) {
- // p.serviceUrl
- // p.auth {
- // type: 'none' | 'basic' | 'bearer'
- // basic --> username, password
- // bearer --> token
- // }
-
- var cache = {};
- var client = new ClientPrototype();
-
- var server = client.server = {
- serviceUrl: p.serviceUrl,
- auth: p.auth
- }
-
- client.patientId = p.patientId;
- client.practitionerId = p.practitionerId;
-
- client.cache = {
- get: function(p) {
- var url = absolute(typeof p === 'string' ? p : (p.resource + '/'+p.id), server);
- if (url in cache) {
- return getLocal(url);
- }
- return null;
- }
- };
-
-
- server.auth = server.auth || {
- type: 'none'
- };
-
- if (!client.server.serviceUrl || !client.server.serviceUrl.match(/https?:\/\/.+[^\/]$/)) {
- throw "Must supply a `server` propery whose `serviceUrl` begins with http(s) " +
- "and does NOT include a trailing slash. E.g. `https://fhir.aws.af.cm/fhir`";
- }
-
- client.indexResource = function(id, r) {
- r.resourceId = relative(id, server);
- var ret = [r];
- cache[absolute(id, server)] = r;
- return ret;
- };
-
- client.indexFeed = function(atomResult) {
- var ret = [];
- var feed = atomResult.feed || atomResult;
- (feed.entry || []).forEach(function(e){
- var more = client.indexResource(e.id, e.content);
- [].push.apply(ret, more);
- });
- return ret;
- };
-
- client.authenticated = function(p) {
- if (server.auth.type === 'none') {
- return p;
- }
-
- var h;
- if (server.auth.type === 'basic') {
- h = "Basic " + btoa(server.auth.username + ":" + server.auth.password);
- } else if (server.auth.type === 'bearer') {
- h = "Bearer " + server.auth.token;
- }
- if (!p.headers) {p.headers = {};}
- p.headers['Authorization'] = h
- //p.beforeSend = function (xhr) { xhr.setRequestHeader ("Authorization", h); }
-
- return p;
- };
-
- function handleReference(p){
- return function(from, to) {
-
- // Resolve any of the following:
- // 1. contained resource
- // 2. already-fetched resource
- // 3. not-yet-fetched resource
-
- if (to.reference === undefined) {
- throw "Can't follow a non-reference: " + to;
- }
-
- if (to.reference.match(/^#/)) {
- return p.contained(from, to.reference.slice(1));
- }
-
- var url = absolute(to.reference, server);
- if (url in cache) {
- return p.local(url);
- }
-
- if (!p.remote) {
- throw "Can't look up unfetched resource " + url;
- }
-
- return p.remote(url);
- }
- };
-
- client.cachedLink = handleReference({
- contained: getContained,
- local: getLocal
- });
-
- client.followLink = handleReference({
- contained: followContained,
- local: followLocal,
- remote: followRemote
- });
-
- function getContained(from, id) {
- var matches = from.contained.filter(function(c){
- return c.id === id;
- });
- if (matches.length !== 1) {
- return null;
- }
- return matches[0];
- }
-
- function getLocal(url) {
- return cache[url];
- }
-
- function followContained(from, id) {
- var ret = new $.Deferred();
- var val = getContained(from, id);
- setTimeout(function(){
- if (val === null) {
- return ret.reject("No contained resource matches #"+id);
- }
- return ret.resolve(val);
- }, 0);
- return ret;
- };
-
- function followLocal(url) {
- var ret = new $.Deferred();
- var val = getLocal(url);
- setTimeout(function(){
- if (val === null) {
- return ret.reject("No local resource matches #"+id);
- }
- return ret.resolve(val);
- }, 0);
- return ret;
- };
-
- function followRemote(url) {
- var getParams = relative(url, server);
- return client.get(getParams);
- };
-
- client.get = function(p) {
- // p.resource, p.id, ?p.version, p.include
-
- var ret = new $.Deferred();
- var url = server.serviceUrl + '/' + p.resource + '/' + p.id;
-
- $.ajax(client.authenticated({
- type: 'GET',
- url: url,
- dataType: 'json'
- }))
- .done(function(data, status){
- var ids = client.indexResource(url, data);
- if (ids.length !== 1) {
- ret.reject("Didn't get exactly one result for " + url);
- }
- ret.resolve(ids[0]);
- })
- .fail(function(){
- ret.reject("Could not fetch " + url, arguments);
- });
- return ret;
- };
-
- client.urlFor = function(searchSpec){
- return client.server.serviceUrl+searchSpec.queryUrl();
- }
-
- client.search = function(searchSpec){
- // p.resource, p.count, p.searchTerms
- var s = Search({
- client: client,
- spec: searchSpec
- });
-
- return s.execute();
- }
-
- client.drain = function(searchSpec, batch){
- var d = $.Deferred();
-
- if (batch === undefined){
- var db = [];
- batch = function(vs) {
- vs.forEach(function(v){
- db.push(v);
- });
- }
- }
-
- db = db || {};
- client.search(searchSpec)
- .done(function drain(vs, cursor){
- batch(vs);
- if (cursor.hasNext()){
- cursor.next().done(drain);
- } else {
- d.resolve();
- }
- });
- return d.promise();
- };
-
- var specs = require('./search-specification')({
- "search": client,
- "drain": client
- });
-
- function patientPropertyName(searchSpec){
- var propertyName = null;
- ['patient', 'subject'].forEach(function(pname){
- if (typeof searchSpec[pname] === 'function'){
- propertyName = pname;
- }
- });
- return propertyName;
- }
-
- function withDefaultPatient(searchSpec){
- var propertyName = patientPropertyName(searchSpec);
- if (propertyName !== null && client.patientId !== undefined){
- searchSpec = searchSpec[propertyName](specs.Patient._id(client.patientId));
- } else if (searchSpec.resourceName === 'Patient'){
- searchSpec = searchSpec._id(client.patientId);
- } else {
- searchSpec = null;
- }
-
- return searchSpec;
- }
-
- function getterFor(r){
- return function(id){
-
- if (r.resourceName === 'Patient' && id === undefined){
- id = client.patientId
- }
-
- return client.get({
- resource: r.resourceName,
- id: id
- });
- }
- };
-
- function writeTodo(){
- throw "Write functionality not implemented.";
- };
-
- client.context = {};
-
- client.context.practitioner = {
- 'read': function(){
- return client.api.Practitioner.read(client.practitionerId);
- }
- };
-
- client.context.patient = {
- 'read': function(){
- return client.api.Patient.read(client.practitionerId);
- }
- };
-
- client.api = {};
-
- // Create SearchSpec-specific handlers
- // as properties on some target object
- // e.g. target.Alert, target.Condition, etc.
- function decorateWithApi(target, tweaks){
-
- tweaks = tweaks || {filter:function(){return true;}};
-
- Object.keys(specs).forEach(function(r){
-
- if (!tweaks.filter(specs[r])){
- return;
- }
-
- target[r] = {
- read: getterFor(specs[r]),
- post: writeTodo,
- put: writeTodo,
- delete: writeTodo,
- drain: function(){
- return target[r].where.drain();
- },
- search: function(){
- return target[r].where.search();
- },
- where: specs[r]
- };
-
- if (tweaks.where){
- target[r].where = tweaks.where(target[r].where);
- }
-
- });
- }
-
- decorateWithApi(client.api);
- decorateWithApi(client.context.patient, {
- filter: withDefaultPatient,
- where: withDefaultPatient
- });
-
- return client;
-}
diff --git a/client/definitions.json b/client/definitions.json
deleted file mode 100644
index 92f324dd..00000000
--- a/client/definitions.json
+++ /dev/null
@@ -1,4492 +0,0 @@
-{
- "Address": {
- "edges": {
- "city": {
- "parser": "string"
- },
- "country": {
- "parser": "string"
- },
- "line": {
- "parser": "string"
- },
- "period": {
- "next": "Period"
- },
- "state": {
- "parser": "string"
- },
- "text": {
- "parser": "string"
- },
- "use": {
- "parser": "string"
- },
- "zip": {
- "parser": "string"
- }
- }
- },
- "AdverseReaction": {
- "edges": {
- "contained": {
- "next": "Resource"
- },
- "didNotOccurFlag": {
- "parser": "boolean"
- },
- "exposure": {
- "next": "AdverseReaction.exposure"
- },
- "extension": {
- "next": "Extension"
- },
- "reactionDate": {
- "parser": "date"
- },
- "recorder": {
- "next": "ResourceReference"
- },
- "subject": {
- "next": "ResourceReference"
- },
- "symptom": {
- "next": "AdverseReaction.symptom"
- },
- "text": {
- "next": "Narrative"
- }
- }
- },
- "AdverseReaction.exposure": {
- "edges": {
- "causalityExpectation": {
- "parser": "string"
- },
- "exposureDate": {
- "parser": "date"
- },
- "exposureType": {
- "parser": "string"
- },
- "substance": {
- "next": "ResourceReference"
- }
- }
- },
- "AdverseReaction.symptom": {
- "edges": {
- "code": {
- "next": "CodeableConcept"
- },
- "severity": {
- "parser": "string"
- }
- }
- },
- "Alert": {
- "edges": {
- "author": {
- "next": "ResourceReference"
- },
- "category": {
- "next": "CodeableConcept"
- },
- "contained": {
- "next": "Resource"
- },
- "extension": {
- "next": "Extension"
- },
- "note": {
- "parser": "string"
- },
- "status": {
- "parser": "string"
- },
- "subject": {
- "next": "ResourceReference"
- },
- "text": {
- "next": "Narrative"
- }
- }
- },
- "AllergyIntolerance": {
- "edges": {
- "contained": {
- "next": "Resource"
- },
- "criticality": {
- "parser": "string"
- },
- "extension": {
- "next": "Extension"
- },
- "identifier": {
- "next": "Identifier"
- },
- "reaction": {
- "next": "ResourceReference"
- },
- "recordedDate": {
- "parser": "date"
- },
- "recorder": {
- "next": "ResourceReference"
- },
- "sensitivityTest": {
- "next": "ResourceReference"
- },
- "sensitivityType": {
- "parser": "string"
- },
- "status": {
- "parser": "string"
- },
- "subject": {
- "next": "ResourceReference"
- },
- "substance": {
- "next": "ResourceReference"
- },
- "text": {
- "next": "Narrative"
- }
- }
- },
- "Attachment": {
- "edges": {
- "contentType": {
- "parser": "string"
- },
- "data": {
- "parser": "string"
- },
- "hash": {
- "parser": "string"
- },
- "language": {
- "parser": "string"
- },
- "size": {
- "parser": "integer"
- },
- "title": {
- "parser": "string"
- },
- "url": {
- "parser": "string"
- }
- }
- },
- "CarePlan": {
- "edges": {
- "activity": {
- "next": "CarePlan.activity"
- },
- "concern": {
- "next": "ResourceReference"
- },
- "contained": {
- "next": "Resource"
- },
- "extension": {
- "next": "Extension"
- },
- "goal": {
- "next": "CarePlan.goal"
- },
- "identifier": {
- "next": "Identifier"
- },
- "modified": {
- "parser": "date"
- },
- "notes": {
- "parser": "string"
- },
- "participant": {
- "next": "CarePlan.participant"
- },
- "patient": {
- "next": "ResourceReference"
- },
- "period": {
- "next": "Period"
- },
- "status": {
- "parser": "string"
- },
- "text": {
- "next": "Narrative"
- }
- }
- },
- "CarePlan.activity": {
- "edges": {
- "actionTaken": {
- "next": "ResourceReference"
- },
- "category": {
- "parser": "string"
- },
- "code": {
- "next": "CodeableConcept"
- },
- "dailyAmount": {
- "next": "Quantity"
- },
- "details": {
- "parser": "string"
- },
- "location": {
- "next": "ResourceReference"
- },
- "notes": {
- "parser": "string"
- },
- "performer": {
- "next": "ResourceReference"
- },
- "product": {
- "next": "ResourceReference"
- },
- "prohibited": {
- "parser": "boolean"
- },
- "quantity": {
- "next": "Quantity"
- },
- "status": {
- "parser": "string"
- },
- "timingPeriod": {
- "next": "Period"
- },
- "timingSchedule": {
- "next": "Schedule"
- },
- "timingString": {
- "parser": "string"
- }
- }
- },
- "CarePlan.goal": {
- "edges": {
- "description": {
- "parser": "string"
- },
- "notes": {
- "parser": "string"
- },
- "status": {
- "parser": "string"
- }
- }
- },
- "CarePlan.participant": {
- "edges": {
- "member": {
- "next": "ResourceReference"
- },
- "role": {
- "next": "CodeableConcept"
- }
- }
- },
- "Choice": {
- "edges": {
- "code": {
- "parser": "string"
- },
- "isOrdered": {
- "parser": "boolean"
- },
- "option": {
- "next": "Choice.option"
- }
- }
- },
- "Choice.option": {
- "edges": {
- "code": {
- "parser": "string"
- },
- "display": {
- "parser": "string"
- }
- }
- },
- "CodeableConcept": {
- "edges": {
- "coding": {
- "next": "Coding"
- },
- "primary": {
- "parser": "string"
- },
- "text": {
- "parser": "string"
- }
- }
- },
- "Coding": {
- "edges": {
- "code": {
- "parser": "string"
- },
- "display": {
- "parser": "string"
- },
- "system": {
- "parser": "string"
- }
- }
- },
- "Condition": {
- "edges": {
- "abatementAge": {
- "next": "Age"
- },
- "abatementBoolean": {
- "parser": "boolean"
- },
- "abatementDate": {
- "next": "date"
- },
- "asserter": {
- "next": "ResourceReference"
- },
- "category": {
- "next": "CodeableConcept"
- },
- "certainty": {
- "next": "CodeableConcept"
- },
- "code": {
- "next": "CodeableConcept"
- },
- "contained": {
- "next": "Resource"
- },
- "dateAsserted": {
- "next": "date"
- },
- "encounter": {
- "next": "ResourceReference"
- },
- "evidence": {
- "next": "Condition.evidence"
- },
- "extension": {
- "next": "Extension"
- },
- "location": {
- "next": "Condition.location"
- },
- "notes": {
- "parser": "string"
- },
- "onsetAge": {
- "next": "Age"
- },
- "onsetDate": {
- "next": "date"
- },
- "relatedItem": {
- "next": "Condition.relatedItem"
- },
- "severity": {
- "next": "CodeableConcept"
- },
- "stage": {
- "next": "Condition.stage"
- },
- "status": {
- "parser": "string"
- },
- "subject": {
- "next": "ResourceReference"
- },
- "text": {
- "next": "Narrative"
- }
- }
- },
- "Condition.evidence": {
- "edges": {
- "code": {
- "next": "CodeableConcept"
- },
- "detail": {
- "next": "ResourceReference"
- }
- }
- },
- "Condition.location": {
- "edges": {
- "code": {
- "next": "CodeableConcept"
- },
- "detail": {
- "parser": "string"
- }
- }
- },
- "Condition.relatedItem": {
- "edges": {
- "code": {
- "next": "CodeableConcept"
- },
- "target": {
- "next": "ResourceReference"
- },
- "type": {
- "parser": "string"
- }
- }
- },
- "Condition.stage": {
- "edges": {
- "assessment": {
- "next": "ResourceReference"
- },
- "summary": {
- "next": "CodeableConcept"
- }
- }
- },
- "Conformance": {
- "edges": {
- "acceptUnknown": {
- "parser": "boolean"
- },
- "contained": {
- "next": "Resource"
- },
- "date": {
- "parser": "date"
- },
- "description": {
- "parser": "string"
- },
- "document": {
- "next": "Conformance.document"
- },
- "experimental": {
- "parser": "boolean"
- },
- "extension": {
- "next": "Extension"
- },
- "fhirVersion": {
- "parser": "string"
- },
- "format": {
- "parser": "string"
- },
- "identifier": {
- "parser": "string"
- },
- "implementation": {
- "next": "Conformance.implementation"
- },
- "messaging": {
- "next": "Conformance.messaging"
- },
- "name": {
- "parser": "string"
- },
- "publisher": {
- "parser": "string"
- },
- "rest": {
- "next": "Conformance.rest"
- },
- "software": {
- "next": "Conformance.software"
- },
- "status": {
- "parser": "string"
- },
- "telecom": {
- "next": "Contact"
- },
- "text": {
- "next": "Narrative"
- },
- "version": {
- "parser": "string"
- }
- }
- },
- "Conformance.document": {
- "edges": {
- "documentation": {
- "parser": "string"
- },
- "mode": {
- "parser": "string"
- },
- "profile": {
- "next": "ResourceReference"
- }
- }
- },
- "Conformance.implementation": {
- "edges": {
- "description": {
- "parser": "string"
- },
- "url": {
- "parser": "string"
- }
- }
- },
- "Conformance.messaging": {
- "edges": {
- "documentation": {
- "parser": "string"
- },
- "endpoint": {
- "parser": "string"
- },
- "event": {
- "next": "Conformance.messaging.event"
- },
- "reliableCache": {
- "parser": "integer"
- }
- }
- },
- "Conformance.messaging.event": {
- "edges": {
- "code": {
- "parser": "string"
- },
- "documentation": {
- "parser": "string"
- },
- "focus": {
- "parser": "string"
- },
- "mode": {
- "parser": "string"
- },
- "protocol": {
- "next": "Coding"
- },
- "request": {
- "next": "ResourceReference"
- },
- "response": {
- "next": "ResourceReference"
- }
- }
- },
- "Conformance.rest": {
- "edges": {
- "batch": {
- "parser": "boolean"
- },
- "documentation": {
- "parser": "string"
- },
- "history": {
- "parser": "boolean"
- },
- "mode": {
- "parser": "string"
- },
- "query": {
- "next": "Conformance.rest.query"
- },
- "resource": {
- "next": "Conformance.rest.resource"
- },
- "security": {
- "next": "Conformance.rest.security"
- }
- }
- },
- "Conformance.rest.query": {
- "edges": {
- "documentation": {
- "parser": "string"
- },
- "name": {
- "parser": "string"
- },
- "parameter": {
- "next": "Conformance.rest.resource.searchParam"
- }
- }
- },
- "Conformance.rest.resource": {
- "edges": {
- "operation": {
- "next": "Conformance.rest.resource.operation"
- },
- "profile": {
- "next": "ResourceReference"
- },
- "readHistory": {
- "parser": "boolean"
- },
- "searchInclude": {
- "parser": "string"
- },
- "searchParam": {
- "next": "Conformance.rest.resource.searchParam"
- },
- "type": {
- "parser": "string"
- }
- }
- },
- "Conformance.rest.resource.operation": {
- "edges": {
- "code": {
- "parser": "string"
- },
- "documentation": {
- "parser": "string"
- }
- }
- },
- "Conformance.rest.resource.searchParam": {
- "edges": {
- "chain": {
- "parser": "string"
- },
- "documentation": {
- "parser": "string"
- },
- "name": {
- "parser": "string"
- },
- "source": {
- "parser": "string"
- },
- "target": {
- "parser": "string"
- },
- "type": {
- "parser": "string"
- },
- "xpath": {
- "parser": "string"
- }
- }
- },
- "Conformance.rest.security": {
- "edges": {
- "certificate": {
- "next": "Conformance.rest.security.certificate"
- },
- "description": {
- "parser": "string"
- },
- "service": {
- "next": "CodeableConcept"
- }
- }
- },
- "Conformance.rest.security.certificate": {
- "edges": {
- "blob": {
- "parser": "string"
- },
- "type": {
- "parser": "string"
- }
- }
- },
- "Conformance.software": {
- "edges": {
- "name": {
- "parser": "string"
- },
- "releaseDate": {
- "parser": "date"
- },
- "version": {
- "parser": "string"
- }
- }
- },
- "Contact": {
- "edges": {
- "period": {
- "next": "Period"
- },
- "system": {
- "parser": "string"
- },
- "use": {
- "parser": "string"
- },
- "value": {
- "parser": "string"
- }
- }
- },
- "Coverage": {
- "edges": {
- "contained": {
- "next": "Resource"
- },
- "dependent": {
- "parser": "integer"
- },
- "extension": {
- "next": "Extension"
- },
- "group": {
- "next": "Identifier"
- },
- "identifier": {
- "next": "Identifier"
- },
- "issuer": {
- "next": "ResourceReference"
- },
- "period": {
- "next": "Period"
- },
- "plan": {
- "next": "Identifier"
- },
- "sequence": {
- "parser": "integer"
- },
- "subplan": {
- "next": "Identifier"
- },
- "subscriber": {
- "next": "Coverage.subscriber"
- },
- "text": {
- "next": "Narrative"
- },
- "type": {
- "next": "Coding"
- }
- }
- },
- "Coverage.subscriber": {
- "edges": {
- "address": {
- "next": "Address"
- },
- "birthdate": {
- "next": "date"
- },
- "name": {
- "next": "HumanName"
- }
- }
- },
- "Device": {
- "edges": {
- "assignedId": {
- "next": "Identifier"
- },
- "contact": {
- "next": "Contact"
- },
- "contained": {
- "next": "Resource"
- },
- "expiry": {
- "next": "date"
- },
- "extension": {
- "next": "Extension"
- },
- "identity": {
- "next": "Device.identity"
- },
- "location": {
- "next": "ResourceReference"
- },
- "manufacturer": {
- "parser": "string"
- },
- "model": {
- "parser": "string"
- },
- "owner": {
- "next": "ResourceReference"
- },
- "patient": {
- "next": "ResourceReference"
- },
- "text": {
- "next": "Narrative"
- },
- "type": {
- "next": "CodeableConcept"
- },
- "url": {
- "parser": "string"
- },
- "version": {
- "parser": "string"
- }
- }
- },
- "Device.identity": {
- "edges": {
- "gtin": {
- "parser": "string"
- },
- "lot": {
- "parser": "string"
- },
- "serialNumber": {
- "parser": "string"
- }
- }
- },
- "DeviceCapabilities": {
- "edges": {
- "contained": {
- "next": "Resource"
- },
- "extension": {
- "next": "Extension"
- },
- "identity": {
- "next": "ResourceReference"
- },
- "manufacturer": {
- "parser": "string"
- },
- "name": {
- "parser": "string"
- },
- "text": {
- "next": "Narrative"
- },
- "type": {
- "next": "CodeableConcept"
- },
- "virtualDevice": {
- "next": "DeviceCapabilities.virtualDevice"
- }
- }
- },
- "DeviceCapabilities.virtualDevice": {
- "edges": {
- "channel": {
- "next": "DeviceCapabilities.virtualDevice.channel"
- },
- "code": {
- "next": "CodeableConcept"
- }
- }
- },
- "DeviceCapabilities.virtualDevice.channel": {
- "edges": {
- "code": {
- "next": "CodeableConcept"
- },
- "metric": {
- "next": "DeviceCapabilities.virtualDevice.channel.metric"
- }
- }
- },
- "DeviceCapabilities.virtualDevice.channel.metric": {
- "edges": {
- "code": {
- "next": "CodeableConcept"
- },
- "facet": {
- "next": "DeviceCapabilities.virtualDevice.channel.metric.facet"
- },
- "info": {
- "next": "DeviceCapabilities.virtualDevice.channel.metric.info"
- },
- "key": {
- "parser": "string"
- }
- }
- },
- "DeviceCapabilities.virtualDevice.channel.metric.facet": {
- "edges": {
- "code": {
- "next": "CodeableConcept"
- },
- "info": {
- "next": "DeviceCapabilities.virtualDevice.channel.metric.info"
- },
- "key": {
- "parser": "string"
- },
- "scale": {
- "parser": "float"
- }
- }
- },
- "DeviceCapabilities.virtualDevice.channel.metric.info": {
- "edges": {
- "system": {
- "parser": "string"
- },
- "template": {
- "next": "SampledData"
- },
- "type": {
- "parser": "string"
- },
- "ucum": {
- "parser": "string"
- },
- "units": {
- "parser": "string"
- }
- }
- },
- "DeviceLog": {
- "edges": {
- "capabilities": {
- "next": "ResourceReference"
- },
- "contained": {
- "next": "Resource"
- },
- "extension": {
- "next": "Extension"
- },
- "instant": {
- "parser": "date"
- },
- "item": {
- "next": "DeviceLog.item"
- },
- "subject": {
- "next": "ResourceReference"
- },
- "text": {
- "next": "Narrative"
- }
- }
- },
- "DeviceLog.item": {
- "edges": {
- "flag": {
- "parser": "string"
- },
- "key": {
- "parser": "string"
- },
- "value": {
- "parser": "string"
- }
- }
- },
- "DeviceObservation": {
- "edges": {
- "code": {
- "next": "CodeableConcept"
- },
- "contained": {
- "next": "Resource"
- },
- "device": {
- "next": "ResourceReference"
- },
- "extension": {
- "next": "Extension"
- },
- "identifier": {
- "next": "Identifier"
- },
- "issued": {
- "parser": "date"
- },
- "measurement": {
- "next": "ResourceReference"
- },
- "subject": {
- "next": "ResourceReference"
- },
- "text": {
- "next": "Narrative"
- }
- }
- },
- "DiagnosticOrder": {
- "edges": {
- "clinicalNotes": {
- "parser": "string"
- },
- "contained": {
- "next": "Resource"
- },
- "encounter": {
- "next": "ResourceReference"
- },
- "event": {
- "next": "DiagnosticOrder.event"
- },
- "extension": {
- "next": "Extension"
- },
- "identifier": {
- "next": "Identifier"
- },
- "item": {
- "next": "DiagnosticOrder.item"
- },
- "orderer": {
- "next": "ResourceReference"
- },
- "priority": {
- "parser": "string"
- },
- "specimen": {
- "next": "ResourceReference"
- },
- "status": {
- "parser": "string"
- },
- "subject": {
- "next": "ResourceReference"
- },
- "text": {
- "next": "Narrative"
- }
- }
- },
- "DiagnosticOrder.event": {
- "edges": {
- "actor": {
- "next": "ResourceReference"
- },
- "date": {
- "parser": "date"
- },
- "status": {
- "parser": "string"
- }
- }
- },
- "DiagnosticOrder.item": {
- "edges": {
- "bodySite": {
- "next": "CodeableConcept"
- },
- "code": {
- "next": "CodeableConcept"
- },
- "event": {
- "next": "DiagnosticOrder.event"
- },
- "specimen": {
- "next": "ResourceReference"
- },
- "status": {
- "parser": "string"
- }
- }
- },
- "DiagnosticReport": {
- "edges": {
- "codedDiagnosis": {
- "next": "CodeableConcept"
- },
- "conclusion": {
- "parser": "string"
- },
- "contained": {
- "next": "Resource"
- },
- "diagnosticTime": {
- "parser": "date"
- },
- "extension": {
- "next": "Extension"
- },
- "image": {
- "next": "ResourceReference"
- },
- "issued": {
- "parser": "date"
- },
- "performer": {
- "next": "ResourceReference"
- },
- "reportId": {
- "next": "Identifier"
- },
- "representation": {
- "next": "Attachment"
- },
- "requestDetail": {
- "next": "DiagnosticReport.requestDetail"
- },
- "results": {
- "next": "DiagnosticReport.results"
- },
- "serviceCategory": {
- "next": "CodeableConcept"
- },
- "status": {
- "parser": "string"
- },
- "subject": {
- "next": "ResourceReference"
- },
- "text": {
- "next": "Narrative"
- }
- }
- },
- "DiagnosticReport.requestDetail": {
- "edges": {
- "bodySite": {
- "next": "CodeableConcept"
- },
- "clinicalInfo": {
- "parser": "string"
- },
- "encounter": {
- "next": "ResourceReference"
- },
- "receiverOrderId": {
- "next": "Identifier"
- },
- "requestOrderId": {
- "next": "Identifier"
- },
- "requestTest": {
- "next": "CodeableConcept"
- },
- "requester": {
- "next": "ResourceReference"
- }
- }
- },
- "DiagnosticReport.results": {
- "edges": {
- "group": {
- "next": "DiagnosticReport.results"
- },
- "name": {
- "next": "CodeableConcept"
- },
- "result": {
- "next": "ResourceReference"
- },
- "specimen": {
- "next": "ResourceReference"
- }
- }
- },
- "Document": {
- "edges": {
- "attester": {
- "next": "Document.attester"
- },
- "author": {
- "next": "ResourceReference"
- },
- "confidentiality": {
- "next": "Coding"
- },
- "contained": {
- "next": "Resource"
- },
- "created": {
- "parser": "date"
- },
- "custodian": {
- "next": "ResourceReference"
- },
- "encounter": {
- "next": "ResourceReference"
- },
- "event": {
- "next": "Document.event"
- },
- "extension": {
- "next": "Extension"
- },
- "identifier": {
- "next": "Identifier"
- },
- "provenance": {
- "next": "ResourceReference"
- },
- "replaces": {
- "parser": "string"
- },
- "representation": {
- "next": "Attachment"
- },
- "section": {
- "next": "Document.section"
- },
- "status": {
- "parser": "string"
- },
- "stylesheet": {
- "next": "Attachment"
- },
- "subject": {
- "next": "ResourceReference"
- },
- "subtype": {
- "next": "CodeableConcept"
- },
- "text": {
- "next": "Narrative"
- },
- "title": {
- "parser": "string"
- },
- "type": {
- "next": "CodeableConcept"
- },
- "versionIdentifier": {
- "next": "Identifier"
- }
- }
- },
- "Document.attester": {
- "edges": {
- "mode": {
- "parser": "string"
- },
- "party": {
- "next": "ResourceReference"
- },
- "time": {
- "parser": "date"
- }
- }
- },
- "Document.event": {
- "edges": {
- "code": {
- "next": "CodeableConcept"
- },
- "detail": {
- "next": "ResourceReference"
- },
- "period": {
- "next": "Period"
- }
- }
- },
- "Document.section": {
- "edges": {
- "code": {
- "next": "CodeableConcept"
- },
- "content": {
- "next": "ResourceReference"
- },
- "section": {
- "next": "Document.section"
- },
- "subject": {
- "next": "ResourceReference"
- }
- }
- },
- "DocumentReference": {
- "edges": {
- "authenticator": {
- "next": "ResourceReference"
- },
- "author": {
- "next": "ResourceReference"
- },
- "confidentiality": {
- "next": "CodeableConcept"
- },
- "contained": {
- "next": "Resource"
- },
- "context": {
- "next": "DocumentReference.context"
- },
- "created": {
- "parser": "date"
- },
- "custodian": {
- "next": "ResourceReference"
- },
- "description": {
- "parser": "string"
- },
- "docStatus": {
- "next": "CodeableConcept"
- },
- "extension": {
- "next": "Extension"
- },
- "format": {
- "next": "CodeableConcept"
- },
- "hash": {
- "parser": "string"
- },
- "identifier": {
- "next": "Identifier"
- },
- "indexed": {
- "parser": "date"
- },
- "location": {
- "parser": "string"
- },
- "masterIdentifier": {
- "next": "Identifier"
- },
- "mimeType": {
- "parser": "string"
- },
- "primaryLanguage": {
- "parser": "string"
- },
- "service": {
- "next": "DocumentReference.service"
- },
- "size": {
- "parser": "integer"
- },
- "status": {
- "parser": "string"
- },
- "subject": {
- "next": "ResourceReference"
- },
- "subtype": {
- "next": "CodeableConcept"
- },
- "supercedes": {
- "next": "ResourceReference"
- },
- "text": {
- "next": "Narrative"
- },
- "type": {
- "next": "CodeableConcept"
- }
- }
- },
- "DocumentReference.context": {
- "edges": {
- "code": {
- "next": "CodeableConcept"
- },
- "facilityType": {
- "next": "CodeableConcept"
- },
- "period": {
- "next": "Period"
- }
- }
- },
- "DocumentReference.service": {
- "edges": {
- "address": {
- "parser": "string"
- },
- "parameter": {
- "next": "DocumentReference.service.parameter"
- },
- "type": {
- "next": "CodeableConcept"
- }
- }
- },
- "DocumentReference.service.parameter": {
- "edges": {
- "name": {
- "parser": "string"
- },
- "value": {
- "parser": "string"
- }
- }
- },
- "Encounter": {
- "edges": {
- "class": {
- "parser": "string"
- },
- "contained": {
- "next": "Resource"
- },
- "extension": {
- "next": "Extension"
- },
- "fulfills": {
- "next": "ResourceReference"
- },
- "hospitalization": {
- "next": "Encounter.hospitalization"
- },
- "identifier": {
- "next": "Identifier"
- },
- "indication": {
- "next": "ResourceReference"
- },
- "length": {
- "next": "Duration"
- },
- "location": {
- "next": "Encounter.location"
- },
- "partOf": {
- "next": "ResourceReference"
- },
- "participant": {
- "next": "Encounter.participant"
- },
- "priority": {
- "next": "CodeableConcept"
- },
- "reasonCodeableConcept": {
- "next": "CodeableConcept"
- },
- "reasonString": {
- "parser": "string"
- },
- "serviceProvider": {
- "next": "ResourceReference"
- },
- "start": {
- "parser": "date"
- },
- "status": {
- "parser": "string"
- },
- "subject": {
- "next": "ResourceReference"
- },
- "text": {
- "next": "Narrative"
- },
- "type": {
- "next": "CodeableConcept"
- }
- }
- },
- "Encounter.hospitalization": {
- "edges": {
- "accomodation": {
- "next": "Encounter.hospitalization.accomodation"
- },
- "admitSource": {
- "next": "CodeableConcept"
- },
- "destination": {
- "next": "ResourceReference"
- },
- "diet": {
- "next": "CodeableConcept"
- },
- "dischargeDisposition": {
- "next": "CodeableConcept"
- },
- "origin": {
- "next": "ResourceReference"
- },
- "period": {
- "next": "Period"
- },
- "preAdmissionIdentifier": {
- "next": "Identifier"
- },
- "reAdmission": {
- "parser": "boolean"
- },
- "specialArrangement": {
- "next": "CodeableConcept"
- },
- "specialCourtesy": {
- "next": "CodeableConcept"
- }
- }
- },
- "Encounter.hospitalization.accomodation": {
- "edges": {
- "bed": {
- "next": "ResourceReference"
- },
- "period": {
- "next": "Period"
- }
- }
- },
- "Encounter.location": {
- "edges": {
- "location": {
- "next": "ResourceReference"
- },
- "period": {
- "next": "Period"
- }
- }
- },
- "Encounter.participant": {
- "edges": {
- "practitioner": {
- "next": "ResourceReference"
- },
- "type": {
- "parser": "string"
- }
- }
- },
- "Extension": {
- "edges": {
- "isModifier": {
- "parser": "boolean"
- },
- "url": {
- "parser": "string"
- },
- "value": {
- "next": "Extension.value"
- }
- }
- },
- "FamilyHistory": {
- "edges": {
- "contained": {
- "next": "Resource"
- },
- "extension": {
- "next": "Extension"
- },
- "note": {
- "parser": "string"
- },
- "relation": {
- "next": "FamilyHistory.relation"
- },
- "subject": {
- "next": "ResourceReference"
- },
- "text": {
- "next": "Narrative"
- }
- }
- },
- "FamilyHistory.relation": {
- "edges": {
- "condition": {
- "next": "FamilyHistory.relation.condition"
- },
- "deceasedAge": {
- "next": "Age"
- },
- "deceasedBoolean": {
- "parser": "boolean"
- },
- "deceasedRange": {
- "next": "Range"
- },
- "deceasedString": {
- "parser": "string"
- },
- "name": {
- "parser": "string"
- },
- "note": {
- "parser": "string"
- },
- "relationship": {
- "next": "CodeableConcept"
- }
- }
- },
- "FamilyHistory.relation.condition": {
- "edges": {
- "note": {
- "parser": "string"
- },
- "onsetAge": {
- "next": "Age"
- },
- "onsetRange": {
- "next": "Range"
- },
- "onsetString": {
- "parser": "string"
- },
- "outcome": {
- "next": "CodeableConcept"
- },
- "type": {
- "next": "CodeableConcept"
- }
- }
- },
- "Group": {
- "edges": {
- "actual": {
- "parser": "boolean"
- },
- "characteristic": {
- "next": "Group.characteristic"
- },
- "code": {
- "next": "CodeableConcept"
- },
- "contained": {
- "next": "Resource"
- },
- "extension": {
- "next": "Extension"
- },
- "identifier": {
- "next": "Identifier"
- },
- "member": {
- "next": "ResourceReference"
- },
- "name": {
- "parser": "string"
- },
- "quantity": {
- "parser": "integer"
- },
- "text": {
- "next": "Narrative"
- },
- "type": {
- "parser": "string"
- }
- }
- },
- "Group.characteristic": {
- "edges": {
- "exclude": {
- "parser": "boolean"
- },
- "type": {
- "next": "CodeableConcept"
- },
- "valueBoolean": {
- "parser": "boolean"
- },
- "valueCodeableConcept": {
- "next": "CodeableConcept"
- },
- "valueQuantity": {
- "next": "Quantity"
- },
- "valueRange": {
- "next": "Range"
- },
- "valueString": {
- "parser": "string"
- }
- }
- },
- "HumanName": {
- "edges": {
- "family": {
- "parser": "string"
- },
- "given": {
- "parser": "string"
- },
- "period": {
- "next": "Period"
- },
- "prefix": {
- "parser": "string"
- },
- "suffix": {
- "parser": "string"
- },
- "text": {
- "parser": "string"
- },
- "use": {
- "parser": "string"
- }
- }
- },
- "Identifier": {
- "edges": {
- "assigner": {
- "next": "ResourceReference"
- },
- "key": {
- "parser": "string"
- },
- "label": {
- "parser": "string"
- },
- "period": {
- "next": "Period"
- },
- "system": {
- "parser": "string"
- },
- "use": {
- "parser": "string"
- }
- }
- },
- "ImagingStudy": {
- "edges": {
- "accessionNo": {
- "next": "Identifier"
- },
- "availability": {
- "parser": "string"
- },
- "clinicalInformation": {
- "parser": "string"
- },
- "contained": {
- "next": "Resource"
- },
- "dateTime": {
- "parser": "date"
- },
- "description": {
- "parser": "string"
- },
- "extension": {
- "next": "Extension"
- },
- "identifier": {
- "next": "Identifier"
- },
- "interpreter": {
- "next": "ResourceReference"
- },
- "modality": {
- "parser": "string"
- },
- "numberOfInstances": {
- "parser": "integer"
- },
- "numberOfSeries": {
- "parser": "integer"
- },
- "procedure": {
- "next": "Coding"
- },
- "referrer": {
- "next": "ResourceReference"
- },
- "series": {
- "next": "ImagingStudy.series"
- },
- "subject": {
- "next": "ResourceReference"
- },
- "text": {
- "next": "Narrative"
- },
- "uid": {
- "parser": "string"
- },
- "url": {
- "parser": "string"
- }
- }
- },
- "ImagingStudy.series": {
- "edges": {
- "availability": {
- "parser": "string"
- },
- "bodySite": {
- "next": "Coding"
- },
- "dateTime": {
- "parser": "date"
- },
- "description": {
- "parser": "string"
- },
- "instance": {
- "next": "ImagingStudy.series.instance"
- },
- "modality": {
- "parser": "string"
- },
- "number": {
- "parser": "integer"
- },
- "numberOfInstances": {
- "parser": "integer"
- },
- "uid": {
- "parser": "string"
- },
- "url": {
- "parser": "string"
- }
- }
- },
- "ImagingStudy.series.instance": {
- "edges": {
- "attachment": {
- "next": "ResourceReference"
- },
- "number": {
- "parser": "integer"
- },
- "sopclass": {
- "parser": "string"
- },
- "title": {
- "parser": "string"
- },
- "type": {
- "parser": "string"
- },
- "uid": {
- "parser": "string"
- },
- "url": {
- "parser": "string"
- }
- }
- },
- "Immunization": {
- "edges": {
- "contained": {
- "next": "Resource"
- },
- "date": {
- "parser": "date"
- },
- "doseQuantity": {
- "next": "Quantity"
- },
- "expirationDate": {
- "next": "date"
- },
- "explanation": {
- "next": "Immunization.explanation"
- },
- "extension": {
- "next": "Extension"
- },
- "location": {
- "next": "ResourceReference"
- },
- "lotNumber": {
- "parser": "string"
- },
- "manufacturer": {
- "next": "ResourceReference"
- },
- "performer": {
- "next": "ResourceReference"
- },
- "reaction": {
- "next": "Immunization.reaction"
- },
- "refusedIndicator": {
- "parser": "boolean"
- },
- "reported": {
- "parser": "boolean"
- },
- "requester": {
- "next": "ResourceReference"
- },
- "route": {
- "next": "CodeableConcept"
- },
- "site": {
- "next": "CodeableConcept"
- },
- "subject": {
- "next": "ResourceReference"
- },
- "text": {
- "next": "Narrative"
- },
- "vaccinationProtocol": {
- "next": "Immunization.vaccinationProtocol"
- },
- "vaccineType": {
- "next": "CodeableConcept"
- }
- }
- },
- "Immunization.explanation": {
- "edges": {
- "reason": {
- "next": "CodeableConcept"
- },
- "refusalReason": {
- "next": "CodeableConcept"
- }
- }
- },
- "Immunization.reaction": {
- "edges": {
- "date": {
- "parser": "date"
- },
- "detail": {
- "next": "ResourceReference"
- },
- "reported": {
- "parser": "boolean"
- }
- }
- },
- "Immunization.vaccinationProtocol": {
- "edges": {
- "authority": {
- "next": "ResourceReference"
- },
- "description": {
- "parser": "string"
- },
- "doseSequence": {
- "parser": "integer"
- },
- "doseStatus": {
- "next": "CodeableConcept"
- },
- "doseStatusReason": {
- "next": "CodeableConcept"
- },
- "doseTarget": {
- "next": "CodeableConcept"
- },
- "series": {
- "parser": "string"
- },
- "seriesDoses": {
- "parser": "integer"
- }
- }
- },
- "ImmunizationProfile": {
- "edges": {
- "contained": {
- "next": "Resource"
- },
- "extension": {
- "next": "Extension"
- },
- "recommendation": {
- "next": "ImmunizationProfile.recommendation"
- },
- "subject": {
- "next": "ResourceReference"
- },
- "text": {
- "next": "Narrative"
- }
- }
- },
- "ImmunizationProfile.recommendation": {
- "edges": {
- "dateCriterion": {
- "next": "ImmunizationProfile.recommendation.dateCriterion"
- },
- "doseNumber": {
- "parser": "integer"
- },
- "forecastStatus": {
- "parser": "string"
- },
- "protocol": {
- "next": "ImmunizationProfile.recommendation.protocol"
- },
- "recommendationDate": {
- "parser": "date"
- },
- "supportingAdverseEventReport": {
- "next": "ImmunizationProfile.recommendation.supportingAdverseEventReport"
- },
- "supportingImmunization": {
- "next": "ResourceReference"
- },
- "supportingPatientObservation": {
- "next": "ResourceReference"
- },
- "vaccineType": {
- "next": "CodeableConcept"
- }
- }
- },
- "ImmunizationProfile.recommendation.dateCriterion": {
- "edges": {
- "code": {
- "next": "CodeableConcept"
- },
- "value": {
- "parser": "date"
- }
- }
- },
- "ImmunizationProfile.recommendation.protocol": {
- "edges": {
- "authority": {
- "next": "ResourceReference"
- },
- "description": {
- "parser": "string"
- },
- "doseSequence": {
- "parser": "integer"
- },
- "series": {
- "parser": "string"
- }
- }
- },
- "ImmunizationProfile.recommendation.supportingAdverseEventReport": {
- "edges": {
- "identifier": {
- "parser": "string"
- },
- "reaction": {
- "next": "ResourceReference"
- },
- "reportDate": {
- "parser": "date"
- },
- "reportType": {
- "next": "CodeableConcept"
- },
- "text": {
- "parser": "string"
- }
- }
- },
- "List": {
- "edges": {
- "code": {
- "next": "CodeableConcept"
- },
- "contained": {
- "next": "Resource"
- },
- "date": {
- "parser": "date"
- },
- "emptyReason": {
- "next": "CodeableConcept"
- },
- "entry": {
- "next": "List.entry"
- },
- "extension": {
- "next": "Extension"
- },
- "mode": {
- "parser": "string"
- },
- "ordered": {
- "parser": "boolean"
- },
- "source": {
- "next": "ResourceReference"
- },
- "text": {
- "next": "Narrative"
- }
- }
- },
- "List.entry": {
- "edges": {
- "date": {
- "parser": "date"
- },
- "deleted": {
- "parser": "boolean"
- },
- "flag": {
- "next": "CodeableConcept"
- },
- "item": {
- "next": "ResourceReference"
- }
- }
- },
- "Location": {
- "edges": {
- "active": {
- "parser": "boolean"
- },
- "address": {
- "next": "Address"
- },
- "contained": {
- "next": "Resource"
- },
- "description": {
- "parser": "string"
- },
- "extension": {
- "next": "Extension"
- },
- "name": {
- "parser": "string"
- },
- "partOf": {
- "next": "ResourceReference"
- },
- "position": {
- "next": "Location.position"
- },
- "provider": {
- "next": "ResourceReference"
- },
- "telecom": {
- "next": "Contact"
- },
- "text": {
- "next": "Narrative"
- },
- "type": {
- "next": "CodeableConcept"
- }
- }
- },
- "Location.position": {
- "edges": {
- "altitude": {
- "parser": "float"
- },
- "latitude": {
- "parser": "float"
- },
- "longitude": {
- "parser": "float"
- }
- }
- },
- "Media": {
- "edges": {
- "contained": {
- "next": "Resource"
- },
- "content": {
- "next": "Attachment"
- },
- "dateTime": {
- "parser": "date"
- },
- "deviceName": {
- "parser": "string"
- },
- "extension": {
- "next": "Extension"
- },
- "frames": {
- "parser": "integer"
- },
- "height": {
- "parser": "integer"
- },
- "identifier": {
- "next": "Identifier"
- },
- "length": {
- "parser": "integer"
- },
- "operator": {
- "next": "ResourceReference"
- },
- "requester": {
- "next": "ResourceReference"
- },
- "subject": {
- "next": "ResourceReference"
- },
- "subtype": {
- "next": "CodeableConcept"
- },
- "text": {
- "next": "Narrative"
- },
- "type": {
- "parser": "string"
- },
- "view": {
- "next": "CodeableConcept"
- },
- "width": {
- "parser": "integer"
- }
- }
- },
- "Medication": {
- "edges": {
- "code": {
- "next": "CodeableConcept"
- },
- "contained": {
- "next": "Resource"
- },
- "extension": {
- "next": "Extension"
- },
- "isBrand": {
- "parser": "boolean"
- },
- "kind": {
- "parser": "string"
- },
- "manufacturer": {
- "next": "ResourceReference"
- },
- "name": {
- "parser": "string"
- },
- "package": {
- "next": "Medication.package"
- },
- "product": {
- "next": "Medication.product"
- },
- "text": {
- "next": "Narrative"
- }
- }
- },
- "Medication.package": {
- "edges": {
- "container": {
- "next": "CodeableConcept"
- },
- "content": {
- "next": "Medication.package.content"
- }
- }
- },
- "Medication.package.content": {
- "edges": {
- "amount": {
- "next": "Quantity"
- },
- "item": {
- "next": "ResourceReference"
- }
- }
- },
- "Medication.product": {
- "edges": {
- "form": {
- "next": "CodeableConcept"
- },
- "ingredient": {
- "next": "Medication.product.ingredient"
- }
- }
- },
- "Medication.product.ingredient": {
- "edges": {
- "amount": {
- "next": "Ratio"
- },
- "item": {
- "next": "ResourceReference"
- }
- }
- },
- "MedicationAdministration": {
- "edges": {
- "administrationDevice": {
- "next": "ResourceReference"
- },
- "contained": {
- "next": "Resource"
- },
- "dosage": {
- "next": "MedicationAdministration.dosage"
- },
- "encounter": {
- "next": "ResourceReference"
- },
- "extension": {
- "next": "Extension"
- },
- "identifier": {
- "next": "Identifier"
- },
- "medication": {
- "next": "ResourceReference"
- },
- "patient": {
- "next": "ResourceReference"
- },
- "practitioner": {
- "next": "ResourceReference"
- },
- "prescription": {
- "next": "ResourceReference"
- },
- "reasonNotGiven": {
- "next": "CodeableConcept"
- },
- "status": {
- "parser": "string"
- },
- "text": {
- "next": "Narrative"
- },
- "wasNotGiven": {
- "parser": "boolean"
- },
- "whenGiven": {
- "next": "Period"
- }
- }
- },
- "MedicationAdministration.dosage": {
- "edges": {
- "maxDosePerPeriod": {
- "next": "Ratio"
- },
- "method": {
- "next": "CodeableConcept"
- },
- "quantity": {
- "next": "Quantity"
- },
- "rate": {
- "next": "Ratio"
- },
- "route": {
- "next": "CodeableConcept"
- },
- "site": {
- "next": "CodeableConcept"
- },
- "timing": {
- "next": "Schedule"
- }
- }
- },
- "MedicationDispense": {
- "edges": {
- "authorizingPrescription": {
- "next": "ResourceReference"
- },
- "contained": {
- "next": "Resource"
- },
- "dispense": {
- "next": "MedicationDispense.dispense"
- },
- "dispenser": {
- "next": "ResourceReference"
- },
- "extension": {
- "next": "Extension"
- },
- "identifier": {
- "next": "Identifier"
- },
- "patient": {
- "next": "ResourceReference"
- },
- "status": {
- "parser": "string"
- },
- "substitution": {
- "next": "MedicationDispense.substitution"
- },
- "text": {
- "next": "Narrative"
- }
- }
- },
- "MedicationDispense.dispense": {
- "edges": {
- "destination": {
- "next": "ResourceReference"
- },
- "dosage": {
- "next": "MedicationDispense.dispense.dosage"
- },
- "identifier": {
- "next": "Identifier"
- },
- "medication": {
- "next": "ResourceReference"
- },
- "quantity": {
- "next": "Quantity"
- },
- "receiver": {
- "next": "ResourceReference"
- },
- "status": {
- "parser": "string"
- },
- "type": {
- "next": "CodeableConcept"
- },
- "whenHandedOver": {
- "next": "Period"
- },
- "whenPrepared": {
- "next": "Period"
- }
- }
- },
- "MedicationDispense.dispense.dosage": {
- "edges": {
- "additionalInstructionsCodeableConcept": {
- "next": "CodeableConcept"
- },
- "additionalInstructionsString": {
- "parser": "string"
- },
- "maxDosePerPeriod": {
- "next": "Ratio"
- },
- "method": {
- "next": "CodeableConcept"
- },
- "quantity": {
- "next": "Quantity"
- },
- "rate": {
- "next": "Ratio"
- },
- "route": {
- "next": "CodeableConcept"
- },
- "site": {
- "next": "CodeableConcept"
- },
- "timingDateTime": {
- "parser": "date"
- },
- "timingPeriod": {
- "next": "Period"
- },
- "timingSchedule": {
- "next": "Schedule"
- }
- }
- },
- "MedicationDispense.substitution": {
- "edges": {
- "reason": {
- "next": "CodeableConcept"
- },
- "responsibleParty": {
- "next": "ResourceReference"
- },
- "type": {
- "next": "CodeableConcept"
- }
- }
- },
- "MedicationPrescription": {
- "edges": {
- "contained": {
- "next": "Resource"
- },
- "dateWritten": {
- "parser": "date"
- },
- "dispense": {
- "next": "MedicationPrescription.dispense"
- },
- "dosageInstruction": {
- "next": "MedicationPrescription.dosageInstruction"
- },
- "encounter": {
- "next": "ResourceReference"
- },
- "extension": {
- "next": "Extension"
- },
- "identifier": {
- "next": "Identifier"
- },
- "medication": {
- "next": "ResourceReference"
- },
- "patient": {
- "next": "ResourceReference"
- },
- "prescriber": {
- "next": "ResourceReference"
- },
- "reasonForPrescribingCodeableConcept": {
- "next": "CodeableConcept"
- },
- "reasonForPrescribingString": {
- "parser": "string"
- },
- "status": {
- "parser": "string"
- },
- "substitution": {
- "next": "MedicationPrescription.substitution"
- },
- "text": {
- "next": "Narrative"
- }
- }
- },
- "MedicationPrescription.dispense": {
- "edges": {
- "expectedSupplyDuration": {
- "next": "Duration"
- },
- "medication": {
- "next": "ResourceReference"
- },
- "numberOfRepeatsAllowed": {
- "parser": "integer"
- },
- "quantity": {
- "next": "Quantity"
- },
- "validityPeriod": {
- "next": "Period"
- }
- }
- },
- "MedicationPrescription.dosageInstruction": {
- "edges": {
- "additionalInstructionsCodeableConcept": {
- "next": "CodeableConcept"
- },
- "additionalInstructionsString": {
- "parser": "string"
- },
- "dosageInstructionsText": {
- "parser": "string"
- },
- "doseQuantity": {
- "next": "Quantity"
- },
- "maxDosePerPeriod": {
- "next": "Ratio"
- },
- "method": {
- "next": "CodeableConcept"
- },
- "rate": {
- "next": "Ratio"
- },
- "route": {
- "next": "CodeableConcept"
- },
- "site": {
- "next": "CodeableConcept"
- },
- "timingDateTime": {
- "parser": "date"
- },
- "timingPeriod": {
- "next": "Period"
- },
- "timingSchedule": {
- "next": "Schedule"
- }
- }
- },
- "MedicationPrescription.substitution": {
- "edges": {
- "reason": {
- "next": "CodeableConcept"
- },
- "type": {
- "next": "CodeableConcept"
- }
- }
- },
- "MedicationStatement": {
- "edges": {
- "administrationDevice": {
- "next": "ResourceReference"
- },
- "contained": {
- "next": "Resource"
- },
- "dosage": {
- "next": "MedicationStatement.dosage"
- },
- "extension": {
- "next": "Extension"
- },
- "identifier": {
- "next": "Identifier"
- },
- "medication": {
- "next": "ResourceReference"
- },
- "patient": {
- "next": "ResourceReference"
- },
- "reasonNotGiven": {
- "next": "CodeableConcept"
- },
- "text": {
- "next": "Narrative"
- },
- "wasNotGiven": {
- "parser": "boolean"
- },
- "whenGiven": {
- "next": "Period"
- }
- }
- },
- "MedicationStatement.dosage": {
- "edges": {
- "maxDosePerPeriod": {
- "next": "Ratio"
- },
- "method": {
- "next": "CodeableConcept"
- },
- "quantity": {
- "next": "Quantity"
- },
- "rate": {
- "next": "Ratio"
- },
- "route": {
- "next": "CodeableConcept"
- },
- "site": {
- "next": "CodeableConcept"
- },
- "timing": {
- "next": "Schedule"
- }
- }
- },
- "Message": {
- "edges": {
- "author": {
- "next": "ResourceReference"
- },
- "contained": {
- "next": "Resource"
- },
- "data": {
- "next": "ResourceReference"
- },
- "destination": {
- "next": "Message.destination"
- },
- "effective": {
- "next": "Period"
- },
- "enterer": {
- "next": "ResourceReference"
- },
- "event": {
- "parser": "string"
- },
- "extension": {
- "next": "Extension"
- },
- "identifier": {
- "parser": "string"
- },
- "reason": {
- "next": "CodeableConcept"
- },
- "receiver": {
- "next": "ResourceReference"
- },
- "response": {
- "next": "Message.response"
- },
- "responsible": {
- "next": "ResourceReference"
- },
- "source": {
- "next": "Message.source"
- },
- "text": {
- "next": "Narrative"
- },
- "timestamp": {
- "parser": "date"
- }
- }
- },
- "Message.destination": {
- "edges": {
- "endpoint": {
- "parser": "string"
- },
- "name": {
- "parser": "string"
- },
- "target": {
- "next": "ResourceReference"
- }
- }
- },
- "Message.response": {
- "edges": {
- "code": {
- "parser": "string"
- },
- "details": {
- "next": "ResourceReference"
- },
- "identifier": {
- "parser": "string"
- }
- }
- },
- "Message.source": {
- "edges": {
- "contact": {
- "next": "Contact"
- },
- "endpoint": {
- "parser": "string"
- },
- "name": {
- "parser": "string"
- },
- "software": {
- "parser": "string"
- },
- "version": {
- "parser": "string"
- }
- }
- },
- "Narrative": {
- "edges": {
- "div": {
- "parser": "string"
- },
- "status": {
- "parser": "string"
- }
- }
- },
- "Observation": {
- "edges": {
- "appliesDateTime": {
- "parser": "date"
- },
- "appliesPeriod": {
- "next": "Period"
- },
- "bodySite": {
- "next": "CodeableConcept"
- },
- "comments": {
- "parser": "string"
- },
- "component": {
- "next": "Observation.component"
- },
- "contained": {
- "next": "Resource"
- },
- "extension": {
- "next": "Extension"
- },
- "identifier": {
- "next": "Identifier"
- },
- "interpretation": {
- "next": "CodeableConcept"
- },
- "issued": {
- "parser": "date"
- },
- "method": {
- "next": "CodeableConcept"
- },
- "name": {
- "next": "CodeableConcept"
- },
- "performer": {
- "next": "ResourceReference"
- },
- "referenceRange": {
- "next": "Observation.referenceRange"
- },
- "reliability": {
- "parser": "string"
- },
- "status": {
- "parser": "string"
- },
- "subject": {
- "next": "ResourceReference"
- },
- "text": {
- "next": "Narrative"
- },
- "valueAttachment": {
- "next": "Attachment"
- },
- "valueChoice": {
- "next": "Choice"
- },
- "valueCodeableConcept": {
- "next": "CodeableConcept"
- },
- "valuePeriod": {
- "next": "Period"
- },
- "valueQuantity": {
- "next": "Quantity"
- },
- "valueRatio": {
- "next": "Ratio"
- },
- "valueSampledData": {
- "next": "SampledData"
- },
- "valueString": {
- "parser": "string"
- }
- }
- },
- "Observation.component": {
- "edges": {
- "name": {
- "next": "CodeableConcept"
- },
- "valueAttachment": {
- "next": "Attachment"
- },
- "valueChoice": {
- "next": "Choice"
- },
- "valueCodeableConcept": {
- "next": "CodeableConcept"
- },
- "valuePeriod": {
- "next": "Period"
- },
- "valueQuantity": {
- "next": "Quantity"
- },
- "valueRatio": {
- "next": "Ratio"
- },
- "valueSampledData": {
- "next": "SampledData"
- },
- "valueString": {
- "parser": "string"
- }
- }
- },
- "Observation.referenceRange": {
- "edges": {
- "meaning": {
- "next": "CodeableConcept"
- },
- "rangeQuantity": {
- "next": "Quantity"
- },
- "rangeRange": {
- "next": "Range"
- },
- "rangeString": {
- "parser": "string"
- }
- }
- },
- "OperationOutcome": {
- "edges": {
- "contained": {
- "next": "Resource"
- },
- "extension": {
- "next": "Extension"
- },
- "issue": {
- "next": "OperationOutcome.issue"
- },
- "text": {
- "next": "Narrative"
- }
- }
- },
- "OperationOutcome.issue": {
- "edges": {
- "details": {
- "parser": "string"
- },
- "location": {
- "parser": "string"
- },
- "severity": {
- "parser": "string"
- },
- "type": {
- "next": "Coding"
- }
- }
- },
- "Order": {
- "edges": {
- "authority": {
- "next": "ResourceReference"
- },
- "contained": {
- "next": "Resource"
- },
- "date": {
- "parser": "date"
- },
- "detail": {
- "next": "ResourceReference"
- },
- "extension": {
- "next": "Extension"
- },
- "reason": {
- "parser": "string"
- },
- "source": {
- "next": "ResourceReference"
- },
- "subject": {
- "next": "ResourceReference"
- },
- "target": {
- "next": "ResourceReference"
- },
- "text": {
- "next": "Narrative"
- },
- "when": {
- "next": "Order.when"
- }
- }
- },
- "Order.when": {
- "edges": {
- "code": {
- "next": "CodeableConcept"
- },
- "schedule": {
- "next": "Schedule"
- }
- }
- },
- "OrderResponse": {
- "edges": {
- "authority": {
- "next": "ResourceReference"
- },
- "code": {
- "parser": "string"
- },
- "contained": {
- "next": "Resource"
- },
- "cost": {
- "next": "Money"
- },
- "date": {
- "parser": "date"
- },
- "description": {
- "parser": "string"
- },
- "extension": {
- "next": "Extension"
- },
- "fulfillment": {
- "next": "ResourceReference"
- },
- "request": {
- "next": "ResourceReference"
- },
- "text": {
- "next": "Narrative"
- },
- "who": {
- "next": "ResourceReference"
- }
- }
- },
- "Organization": {
- "edges": {
- "active": {
- "parser": "boolean"
- },
- "address": {
- "next": "Address"
- },
- "contact": {
- "next": "Organization.contact"
- },
- "contained": {
- "next": "Resource"
- },
- "extension": {
- "next": "Extension"
- },
- "identifier": {
- "next": "Identifier"
- },
- "name": {
- "parser": "string"
- },
- "partOf": {
- "next": "ResourceReference"
- },
- "telecom": {
- "next": "Contact"
- },
- "text": {
- "next": "Narrative"
- },
- "type": {
- "next": "CodeableConcept"
- }
- }
- },
- "Organization.contact": {
- "edges": {
- "address": {
- "next": "Address"
- },
- "gender": {
- "next": "CodeableConcept"
- },
- "name": {
- "next": "HumanName"
- },
- "purpose": {
- "next": "CodeableConcept"
- },
- "telecom": {
- "next": "Contact"
- }
- }
- },
- "Other": {
- "edges": {
- "author": {
- "next": "ResourceReference"
- },
- "code": {
- "next": "CodeableConcept"
- },
- "contained": {
- "next": "Resource"
- },
- "created": {
- "next": "date"
- },
- "extension": {
- "next": "Extension"
- },
- "subject": {
- "next": "ResourceReference"
- },
- "text": {
- "next": "Narrative"
- }
- }
- },
- "Patient": {
- "edges": {
- "active": {
- "parser": "boolean"
- },
- "address": {
- "next": "Address"
- },
- "animal": {
- "next": "Patient.animal"
- },
- "birthDate": {
- "parser": "date"
- },
- "communication": {
- "next": "CodeableConcept"
- },
- "contact": {
- "next": "Patient.contact"
- },
- "contained": {
- "next": "Resource"
- },
- "deceasedBoolean": {
- "parser": "boolean"
- },
- "deceasedDateTime": {
- "parser": "date"
- },
- "extension": {
- "next": "Extension"
- },
- "gender": {
- "next": "CodeableConcept"
- },
- "identifier": {
- "next": "Identifier"
- },
- "link": {
- "next": "ResourceReference"
- },
- "maritalStatus": {
- "next": "CodeableConcept"
- },
- "multipleBirthBoolean": {
- "parser": "boolean"
- },
- "multipleBirthInteger": {
- "parser": "integer"
- },
- "name": {
- "next": "HumanName"
- },
- "photo": {
- "next": "Attachment"
- },
- "provider": {
- "next": "ResourceReference"
- },
- "telecom": {
- "next": "Contact"
- },
- "text": {
- "next": "Narrative"
- }
- }
- },
- "Patient.animal": {
- "edges": {
- "breed": {
- "next": "CodeableConcept"
- },
- "genderStatus": {
- "next": "CodeableConcept"
- },
- "species": {
- "next": "CodeableConcept"
- }
- }
- },
- "Patient.contact": {
- "edges": {
- "address": {
- "next": "Address"
- },
- "gender": {
- "next": "CodeableConcept"
- },
- "name": {
- "next": "HumanName"
- },
- "organization": {
- "next": "ResourceReference"
- },
- "relationship": {
- "next": "CodeableConcept"
- },
- "telecom": {
- "next": "Contact"
- }
- }
- },
- "Period": {
- "edges": {
- "end": {
- "parser": "date"
- },
- "start": {
- "parser": "date"
- }
- }
- },
- "Practitioner": {
- "edges": {
- "address": {
- "next": "Address"
- },
- "birthDate": {
- "parser": "date"
- },
- "communication": {
- "next": "CodeableConcept"
- },
- "contained": {
- "next": "Resource"
- },
- "extension": {
- "next": "Extension"
- },
- "gender": {
- "next": "CodeableConcept"
- },
- "identifier": {
- "next": "Identifier"
- },
- "name": {
- "next": "HumanName"
- },
- "organization": {
- "next": "ResourceReference"
- },
- "period": {
- "next": "Period"
- },
- "photo": {
- "next": "Attachment"
- },
- "qualification": {
- "next": "Practitioner.qualification"
- },
- "role": {
- "next": "CodeableConcept"
- },
- "specialty": {
- "next": "CodeableConcept"
- },
- "telecom": {
- "next": "Contact"
- },
- "text": {
- "next": "Narrative"
- }
- }
- },
- "Practitioner.qualification": {
- "edges": {
- "code": {
- "next": "CodeableConcept"
- },
- "issuer": {
- "next": "ResourceReference"
- },
- "period": {
- "next": "Period"
- }
- }
- },
- "Procedure": {
- "edges": {
- "bodySite": {
- "next": "CodeableConcept"
- },
- "complication": {
- "parser": "string"
- },
- "contained": {
- "next": "Resource"
- },
- "date": {
- "next": "Period"
- },
- "encounter": {
- "next": "ResourceReference"
- },
- "extension": {
- "next": "Extension"
- },
- "followUp": {
- "parser": "string"
- },
- "indication": {
- "parser": "string"
- },
- "notes": {
- "parser": "string"
- },
- "outcome": {
- "parser": "string"
- },
- "performer": {
- "next": "Procedure.performer"
- },
- "relatedItem": {
- "next": "Procedure.relatedItem"
- },
- "report": {
- "next": "ResourceReference"
- },
- "subject": {
- "next": "ResourceReference"
- },
- "text": {
- "next": "Narrative"
- },
- "type": {
- "next": "CodeableConcept"
- }
- }
- },
- "Procedure.performer": {
- "edges": {
- "person": {
- "next": "ResourceReference"
- },
- "role": {
- "next": "CodeableConcept"
- }
- }
- },
- "Procedure.relatedItem": {
- "edges": {
- "target": {
- "next": "ResourceReference"
- },
- "type": {
- "parser": "string"
- }
- }
- },
- "Profile": {
- "edges": {
- "binding": {
- "next": "Profile.binding"
- },
- "code": {
- "next": "Coding"
- },
- "contained": {
- "next": "Resource"
- },
- "date": {
- "parser": "date"
- },
- "description": {
- "parser": "string"
- },
- "experimental": {
- "parser": "boolean"
- },
- "extension": {
- "next": "Extension"
- },
- "extensionDefn": {
- "next": "Profile.extensionDefn"
- },
- "fhirVersion": {
- "parser": "string"
- },
- "identifier": {
- "parser": "string"
- },
- "name": {
- "parser": "string"
- },
- "publisher": {
- "parser": "string"
- },
- "status": {
- "parser": "string"
- },
- "structure": {
- "next": "Profile.structure"
- },
- "telecom": {
- "next": "Contact"
- },
- "text": {
- "next": "Narrative"
- },
- "version": {
- "parser": "string"
- }
- }
- },
- "Profile.binding": {
- "edges": {
- "conformance": {
- "parser": "string"
- },
- "description": {
- "parser": "string"
- },
- "isExtensible": {
- "parser": "boolean"
- },
- "name": {
- "parser": "string"
- },
- "referenceResourceReference": {
- "next": "ResourceReference"
- },
- "referenceUri": {
- "parser": "string"
- }
- }
- },
- "Profile.extensionDefn": {
- "edges": {
- "code": {
- "parser": "string"
- },
- "context": {
- "parser": "string"
- },
- "contextType": {
- "parser": "string"
- },
- "definition": {
- "next": "Profile.structure.element.definition"
- }
- }
- },
- "Profile.structure": {
- "edges": {
- "element": {
- "next": "Profile.structure.element"
- },
- "name": {
- "parser": "string"
- },
- "publish": {
- "parser": "boolean"
- },
- "purpose": {
- "parser": "string"
- },
- "type": {
- "parser": "string"
- }
- }
- },
- "Profile.structure.element": {
- "edges": {
- "definition": {
- "next": "Profile.structure.element.definition"
- },
- "name": {
- "parser": "string"
- },
- "path": {
- "parser": "string"
- },
- "slicing": {
- "next": "Profile.structure.element.slicing"
- }
- }
- },
- "Profile.structure.element.definition": {
- "edges": {
- "binding": {
- "parser": "string"
- },
- "comments": {
- "parser": "string"
- },
- "condition": {
- "parser": "string"
- },
- "constraint": {
- "next": "Profile.structure.element.definition.constraint"
- },
- "example": {
- "next": "Profile.structure.element.definition.example"
- },
- "formal": {
- "parser": "string"
- },
- "isModifier": {
- "parser": "boolean"
- },
- "mapping": {
- "next": "Profile.structure.element.definition.mapping"
- },
- "max": {
- "parser": "string"
- },
- "maxLength": {
- "parser": "integer"
- },
- "min": {
- "parser": "integer"
- },
- "mustSupport": {
- "parser": "boolean"
- },
- "nameReference": {
- "parser": "string"
- },
- "requirements": {
- "parser": "string"
- },
- "short": {
- "parser": "string"
- },
- "synonym": {
- "parser": "string"
- },
- "type": {
- "next": "Profile.structure.element.definition.type"
- },
- "value": {
- "next": "Profile.structure.element.definition.value"
- }
- }
- },
- "Profile.structure.element.definition.constraint": {
- "edges": {
- "human": {
- "parser": "string"
- },
- "key": {
- "parser": "string"
- },
- "name": {
- "parser": "string"
- },
- "ocl": {
- "parser": "string"
- },
- "severity": {
- "parser": "string"
- },
- "xpath": {
- "parser": "string"
- }
- }
- },
- "Profile.structure.element.definition.mapping": {
- "edges": {
- "map": {
- "parser": "string"
- },
- "target": {
- "parser": "string"
- }
- }
- },
- "Profile.structure.element.definition.type": {
- "edges": {
- "bundled": {
- "parser": "boolean"
- },
- "code": {
- "parser": "string"
- },
- "profile": {
- "parser": "string"
- }
- }
- },
- "Profile.structure.element.slicing": {
- "edges": {
- "discriminator": {
- "parser": "string"
- },
- "ordered": {
- "parser": "boolean"
- },
- "rules": {
- "parser": "string"
- }
- }
- },
- "Provenance": {
- "edges": {
- "agent": {
- "next": "Provenance.agent"
- },
- "contained": {
- "next": "Resource"
- },
- "entity": {
- "next": "Provenance.entity"
- },
- "extension": {
- "next": "Extension"
- },
- "location": {
- "next": "ResourceReference"
- },
- "period": {
- "next": "Period"
- },
- "policy": {
- "parser": "string"
- },
- "reason": {
- "next": "CodeableConcept"
- },
- "recorded": {
- "parser": "date"
- },
- "signature": {
- "parser": "string"
- },
- "target": {
- "next": "ResourceReference"
- },
- "text": {
- "next": "Narrative"
- }
- }
- },
- "Provenance.agent": {
- "edges": {
- "display": {
- "parser": "string"
- },
- "reference": {
- "parser": "string"
- },
- "role": {
- "next": "Coding"
- },
- "type": {
- "next": "Coding"
- }
- }
- },
- "Provenance.entity": {
- "edges": {
- "agent": {
- "next": "Provenance.agent"
- },
- "display": {
- "parser": "string"
- },
- "reference": {
- "parser": "string"
- },
- "role": {
- "parser": "string"
- },
- "type": {
- "next": "Coding"
- }
- }
- },
- "Quantity": {
- "edges": {
- "code": {
- "parser": "string"
- },
- "comparator": {
- "parser": "string"
- },
- "system": {
- "parser": "string"
- },
- "units": {
- "parser": "string"
- },
- "value": {
- "parser": "float"
- }
- }
- },
- "Query": {
- "edges": {
- "contained": {
- "next": "Resource"
- },
- "extension": {
- "next": "Extension"
- },
- "identifier": {
- "parser": "string"
- },
- "parameter": {
- "next": "Extension"
- },
- "response": {
- "next": "Query.response"
- },
- "text": {
- "next": "Narrative"
- }
- }
- },
- "Query.response": {
- "edges": {
- "first": {
- "next": "Extension"
- },
- "identifier": {
- "parser": "string"
- },
- "last": {
- "next": "Extension"
- },
- "next": {
- "next": "Extension"
- },
- "outcome": {
- "parser": "string"
- },
- "parameter": {
- "next": "Extension"
- },
- "previous": {
- "next": "Extension"
- },
- "reference": {
- "next": "ResourceReference"
- },
- "total": {
- "parser": "integer"
- }
- }
- },
- "Questionnaire": {
- "edges": {
- "author": {
- "next": "ResourceReference"
- },
- "authored": {
- "parser": "date"
- },
- "contained": {
- "next": "Resource"
- },
- "encounter": {
- "next": "ResourceReference"
- },
- "extension": {
- "next": "Extension"
- },
- "group": {
- "next": "Questionnaire.group"
- },
- "identifier": {
- "next": "Identifier"
- },
- "name": {
- "next": "CodeableConcept"
- },
- "question": {
- "next": "Questionnaire.question"
- },
- "source": {
- "next": "ResourceReference"
- },
- "status": {
- "parser": "string"
- },
- "subject": {
- "next": "ResourceReference"
- },
- "text": {
- "next": "Narrative"
- }
- }
- },
- "Questionnaire.group": {
- "edges": {
- "group": {
- "next": "Questionnaire.group"
- },
- "header": {
- "parser": "string"
- },
- "name": {
- "next": "CodeableConcept"
- },
- "question": {
- "next": "Questionnaire.question"
- },
- "subject": {
- "next": "ResourceReference"
- },
- "text": {
- "parser": "string"
- }
- }
- },
- "Questionnaire.question": {
- "edges": {
- "answerBoolean": {
- "parser": "boolean"
- },
- "answerDate": {
- "next": "date"
- },
- "answerDateTime": {
- "parser": "date"
- },
- "answerDecimal": {
- "parser": "float"
- },
- "answerInstant": {
- "parser": "date"
- },
- "answerInteger": {
- "parser": "integer"
- },
- "answerString": {
- "parser": "string"
- },
- "choice": {
- "next": "Coding"
- },
- "data": {
- "next": "Questionnaire.question.data"
- },
- "name": {
- "next": "CodeableConcept"
- },
- "optionsResourceReference": {
- "next": "ResourceReference"
- },
- "optionsUri": {
- "parser": "string"
- },
- "remarks": {
- "parser": "string"
- },
- "text": {
- "parser": "string"
- }
- }
- },
- "Range": {
- "edges": {
- "high": {
- "next": "Quantity"
- },
- "low": {
- "next": "Quantity"
- }
- }
- },
- "Ratio": {
- "edges": {
- "denominator": {
- "next": "Quantity"
- },
- "numerator": {
- "next": "Quantity"
- }
- }
- },
- "RelatedPerson": {
- "edges": {
- "address": {
- "next": "Address"
- },
- "contained": {
- "next": "Resource"
- },
- "extension": {
- "next": "Extension"
- },
- "gender": {
- "next": "CodeableConcept"
- },
- "identifier": {
- "next": "Identifier"
- },
- "name": {
- "next": "HumanName"
- },
- "patient": {
- "next": "ResourceReference"
- },
- "photo": {
- "next": "Attachment"
- },
- "relationship": {
- "next": "CodeableConcept"
- },
- "telecom": {
- "next": "Contact"
- },
- "text": {
- "next": "Narrative"
- }
- }
- },
- "ResourceReference": {
- "edges": {
- "display": {
- "parser": "string"
- },
- "reference": {
- "parser": "string"
- },
- "type": {
- "parser": "string"
- }
- }
- },
- "SampledData": {
- "edges": {
- "data": {
- "parser": "string"
- },
- "dimensions": {
- "parser": "integer"
- },
- "factor": {
- "parser": "float"
- },
- "lowerLimit": {
- "parser": "float"
- },
- "origin": {
- "next": "Quantity"
- },
- "period": {
- "parser": "float"
- },
- "upperLimit": {
- "parser": "float"
- }
- }
- },
- "Schedule": {
- "edges": {
- "event": {
- "next": "Period"
- },
- "repeat": {
- "next": "Schedule.repeat"
- }
- }
- },
- "Schedule.repeat": {
- "edges": {
- "count": {
- "parser": "integer"
- },
- "duration": {
- "parser": "float"
- },
- "end": {
- "parser": "date"
- },
- "frequency": {
- "parser": "integer"
- },
- "units": {
- "parser": "string"
- },
- "when": {
- "parser": "string"
- }
- }
- },
- "SecurityEvent": {
- "edges": {
- "contained": {
- "next": "Resource"
- },
- "event": {
- "next": "SecurityEvent.event"
- },
- "extension": {
- "next": "Extension"
- },
- "object": {
- "next": "SecurityEvent.object"
- },
- "participant": {
- "next": "SecurityEvent.participant"
- },
- "source": {
- "next": "SecurityEvent.source"
- },
- "text": {
- "next": "Narrative"
- }
- }
- },
- "SecurityEvent.event": {
- "edges": {
- "action": {
- "parser": "string"
- },
- "dateTime": {
- "parser": "date"
- },
- "outcome": {
- "parser": "string"
- },
- "outcomeDesc": {
- "parser": "string"
- },
- "subtype": {
- "next": "CodeableConcept"
- },
- "type": {
- "next": "CodeableConcept"
- }
- }
- },
- "SecurityEvent.object": {
- "edges": {
- "detail": {
- "next": "SecurityEvent.object.detail"
- },
- "identifier": {
- "next": "Identifier"
- },
- "lifecycle": {
- "parser": "string"
- },
- "name": {
- "parser": "string"
- },
- "query": {
- "parser": "string"
- },
- "reference": {
- "next": "ResourceReference"
- },
- "role": {
- "parser": "string"
- },
- "sensitivity": {
- "next": "CodeableConcept"
- },
- "type": {
- "parser": "string"
- }
- }
- },
- "SecurityEvent.object.detail": {
- "edges": {
- "type": {
- "parser": "string"
- },
- "value": {
- "parser": "string"
- }
- }
- },
- "SecurityEvent.participant": {
- "edges": {
- "authId": {
- "parser": "string"
- },
- "media": {
- "next": "Coding"
- },
- "name": {
- "parser": "string"
- },
- "network": {
- "next": "SecurityEvent.participant.network"
- },
- "reference": {
- "next": "ResourceReference"
- },
- "requestor": {
- "parser": "boolean"
- },
- "role": {
- "next": "CodeableConcept"
- },
- "userId": {
- "parser": "string"
- }
- }
- },
- "SecurityEvent.participant.network": {
- "edges": {
- "identifier": {
- "parser": "string"
- },
- "type": {
- "parser": "string"
- }
- }
- },
- "SecurityEvent.source": {
- "edges": {
- "identifier": {
- "parser": "string"
- },
- "site": {
- "parser": "string"
- },
- "type": {
- "next": "Coding"
- }
- }
- },
- "Specimen": {
- "edges": {
- "accessionIdentifier": {
- "next": "Identifier"
- },
- "collection": {
- "next": "Specimen.collection"
- },
- "contained": {
- "next": "Resource"
- },
- "container": {
- "next": "Specimen.container"
- },
- "extension": {
- "next": "Extension"
- },
- "identifier": {
- "next": "Identifier"
- },
- "receivedTime": {
- "parser": "date"
- },
- "source": {
- "next": "Specimen.source"
- },
- "subject": {
- "next": "ResourceReference"
- },
- "text": {
- "next": "Narrative"
- },
- "treatment": {
- "next": "Specimen.treatment"
- },
- "type": {
- "next": "CodeableConcept"
- }
- }
- },
- "Specimen.collection": {
- "edges": {
- "collectedTime": {
- "parser": "date"
- },
- "collector": {
- "next": "ResourceReference"
- },
- "comment": {
- "parser": "string"
- },
- "method": {
- "next": "CodeableConcept"
- },
- "quantity": {
- "next": "Quantity"
- },
- "sourceSite": {
- "next": "CodeableConcept"
- }
- }
- },
- "Specimen.container": {
- "edges": {
- "additive": {
- "next": "ResourceReference"
- },
- "capacity": {
- "next": "Quantity"
- },
- "description": {
- "parser": "string"
- },
- "identifier": {
- "next": "Identifier"
- },
- "specimenQuantity": {
- "next": "Quantity"
- },
- "type": {
- "next": "CodeableConcept"
- }
- }
- },
- "Specimen.source": {
- "edges": {
- "relationship": {
- "parser": "string"
- },
- "target": {
- "next": "ResourceReference"
- }
- }
- },
- "Specimen.treatment": {
- "edges": {
- "additive": {
- "next": "ResourceReference"
- },
- "description": {
- "parser": "string"
- },
- "procedure": {
- "next": "CodeableConcept"
- }
- }
- },
- "Substance": {
- "edges": {
- "contained": {
- "next": "Resource"
- },
- "description": {
- "parser": "string"
- },
- "effectiveTime": {
- "next": "Period"
- },
- "extension": {
- "next": "Extension"
- },
- "identifier": {
- "next": "Identifier"
- },
- "ingredient": {
- "next": "ResourceReference"
- },
- "name": {
- "parser": "string"
- },
- "quantity": {
- "next": "Quantity"
- },
- "quantityMode": {
- "next": "CodeableConcept"
- },
- "status": {
- "next": "CodeableConcept"
- },
- "text": {
- "next": "Narrative"
- },
- "type": {
- "next": "CodeableConcept"
- }
- }
- },
- "Supply": {
- "edges": {
- "contained": {
- "next": "Resource"
- },
- "dispense": {
- "next": "Supply.dispense"
- },
- "extension": {
- "next": "Extension"
- },
- "identifier": {
- "next": "Identifier"
- },
- "name": {
- "next": "CodeableConcept"
- },
- "orderedItem": {
- "next": "ResourceReference"
- },
- "patient": {
- "next": "ResourceReference"
- },
- "status": {
- "parser": "string"
- },
- "text": {
- "next": "Narrative"
- }
- }
- },
- "Supply.dispense": {
- "edges": {
- "destination": {
- "next": "ResourceReference"
- },
- "identifier": {
- "next": "Identifier"
- },
- "quantity": {
- "next": "Quantity"
- },
- "receiver": {
- "next": "ResourceReference"
- },
- "status": {
- "parser": "string"
- },
- "suppliedItem": {
- "next": "ResourceReference"
- },
- "supplier": {
- "next": "ResourceReference"
- },
- "type": {
- "next": "CodeableConcept"
- },
- "whenHandedOver": {
- "next": "Period"
- },
- "whenPrepared": {
- "next": "Period"
- }
- }
- },
- "ValueSet": {
- "edges": {
- "compose": {
- "next": "ValueSet.compose"
- },
- "contained": {
- "next": "Resource"
- },
- "copyright": {
- "parser": "string"
- },
- "date": {
- "parser": "date"
- },
- "define": {
- "next": "ValueSet.define"
- },
- "description": {
- "parser": "string"
- },
- "expansion": {
- "next": "ValueSet.expansion"
- },
- "experimental": {
- "parser": "boolean"
- },
- "extension": {
- "next": "Extension"
- },
- "identifier": {
- "parser": "string"
- },
- "name": {
- "parser": "string"
- },
- "publisher": {
- "parser": "string"
- },
- "status": {
- "parser": "string"
- },
- "telecom": {
- "next": "Contact"
- },
- "text": {
- "next": "Narrative"
- },
- "version": {
- "parser": "string"
- }
- }
- },
- "ValueSet.compose": {
- "edges": {
- "exclude": {
- "next": "ValueSet.compose.include"
- },
- "import": {
- "parser": "string"
- },
- "include": {
- "next": "ValueSet.compose.include"
- }
- }
- },
- "ValueSet.compose.include": {
- "edges": {
- "code": {
- "parser": "string"
- },
- "filter": {
- "next": "ValueSet.compose.include.filter"
- },
- "system": {
- "parser": "string"
- },
- "version": {
- "parser": "string"
- }
- }
- },
- "ValueSet.compose.include.filter": {
- "edges": {
- "op": {
- "parser": "string"
- },
- "property": {
- "parser": "string"
- },
- "value": {
- "parser": "string"
- }
- }
- },
- "ValueSet.define": {
- "edges": {
- "caseSensitive": {
- "parser": "boolean"
- },
- "concept": {
- "next": "ValueSet.define.concept"
- },
- "system": {
- "parser": "string"
- }
- }
- },
- "ValueSet.define.concept": {
- "edges": {
- "abstract": {
- "parser": "boolean"
- },
- "code": {
- "parser": "string"
- },
- "concept": {
- "next": "ValueSet.define.concept"
- },
- "definition": {
- "parser": "string"
- },
- "display": {
- "parser": "string"
- }
- }
- },
- "ValueSet.expansion": {
- "edges": {
- "contains": {
- "next": "ValueSet.expansion.contains"
- },
- "timestamp": {
- "parser": "date"
- }
- }
- },
- "ValueSet.expansion.contains": {
- "edges": {
- "code": {
- "parser": "string"
- },
- "contains": {
- "next": "ValueSet.expansion.contains"
- },
- "display": {
- "parser": "string"
- },
- "system": {
- "parser": "string"
- }
- }
- }
-}
diff --git a/client/entry.js b/client/entry.js
deleted file mode 100644
index fda3a626..00000000
--- a/client/entry.js
+++ /dev/null
@@ -1,6 +0,0 @@
-window.FHIR = {
- client: require('./client'),
- query: require('./search-specification.js')(),
- jQuery: require('./jquery'),
- oauth2: require('./bb-client')
-};
diff --git a/client/guid.js b/client/guid.js
deleted file mode 100644
index f79049d6..00000000
--- a/client/guid.js
+++ /dev/null
@@ -1,36 +0,0 @@
-var EMPTY = '00000000-0000-0000-0000-000000000000';
-
-var _padLeft = function (paddingString, width, replacementChar) {
- return paddingString.length >= width ? paddingString : _padLeft(replacementChar + paddingString, width, replacementChar || ' ');
-};
-
-var _s4 = function (number) {
- var hexadecimalResult = number.toString(16);
- return _padLeft(hexadecimalResult, 4, '0');
-};
-
-var _cryptoGuid = function () {
- var buffer = new window.Uint16Array(8);
- window.crypto.getRandomValues(buffer);
- 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('-');
-};
-
-var _guid = function () {
- var currentDateMilliseconds = new Date().getTime();
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (currentChar) {
- var randomChar = (currentDateMilliseconds + Math.random() * 16) % 16 | 0;
- currentDateMilliseconds = Math.floor(currentDateMilliseconds / 16);
- return (currentChar === 'x' ? randomChar : (randomChar & 0x7 | 0x8)).toString(16);
- });
-};
-
-var create = function () {
- var hasCrypto = typeof (window.crypto) != 'undefined',
- hasRandomValues = hasCrypto && typeof (window.crypto.getRandomValues) != 'undefined';
- return (hasCrypto && hasRandomValues) ? _cryptoGuid() : _guid();
-};
-
-module.exports = {
- newGuid: create,
- empty: EMPTY
-};
diff --git a/client/jquery.js b/client/jquery.js
deleted file mode 100644
index 314f0f27..00000000
--- a/client/jquery.js
+++ /dev/null
@@ -1,8 +0,0 @@
-var $ = require('jquery');
-
-if (process.browser) {
- module.exports = $;
-} else {
- var window = require('jsdom').jsdom().createWindow();
- module.exports = $(window);
-}
diff --git a/client/namespace.js b/client/namespace.js
deleted file mode 100644
index 27b5c58b..00000000
--- a/client/namespace.js
+++ /dev/null
@@ -1,8 +0,0 @@
-module.exports = {
- any: 'special::any_namsace',
- none: 'special::no_namespace',
- loinc: 'http://loinc.org',
- ucum: 'http://unitsofmeasure.org',
- snomed: 'http://snomed.info/sct',
- rxnorm: 'http://rxnav.nlm.nih.gov/REST/rxcui'
-}
diff --git a/client/search-specification.js b/client/search-specification.js
deleted file mode 100644
index 64dd382c..00000000
--- a/client/search-specification.js
+++ /dev/null
@@ -1,304 +0,0 @@
-module.exports = function(mixins) {
- mixins = mixins || {};
-
- var specs = {};
- var util = require('util');
- var namespace = require('./namespace');
- var definitions = require('./build-definitions');
-
- function defineSearchParam(resourceSpec, searchParam) {
- Object.keys(searchParam.handlers).forEach(function(handlerName){
-
- resourceSpec.prototype[handlerName] = function(){
-
- var clause = searchParam.handlers[handlerName].apply(
- searchParam, arguments
- );
- return this.__addClause(clause);
-
- }
- });
- }
-
-
- function SearchSpecification(clauses){
-
- if (clauses === undefined) {
- clauses = [];
- }
-
- this.resourceName = this.constructor.resourceName;
-
- this.__addClause = function(c){
- var newClauses = JSON.parse(JSON.stringify(clauses));
- if (!util.isArray(c)){
- c = [c];
- }
-
- [].push.apply(newClauses, c);
- return new (this.constructor)(newClauses);
- }
-
- this.__getClauses = function(){
- return clauses;
- }
-
- this.__printClauses = function(){
- console.log(clauses);
- }
-
- this.queryUrl = function(){
- return '/'+this.resourceName+'/_search';
- };
-
- this.queryParams = function(){
- var clauses = this.__getClauses();
- var params = {};
- clauses.forEach(function(c){
- params[c.name] = params[c.name] || [];
- if (c.oneOf !== undefined) {
- var joined = c.oneOf.join(',');
- params[c.name].push(joined);
- } else {
- params[c.name].push(c.value);
- }
- });
- return params;
- }
-
- }
-
- defineSearchParam(SearchSpecification, new ReferenceSearchParam('_id'));
- defineSearchParam(SearchSpecification, new SearchParam('_count', '_count', true));
- defineSearchParam(SearchSpecification, new SearchParam('_sortAsc', '_sort:asc', true));
- defineSearchParam(SearchSpecification, new SearchParam('_sortDesc', '_sort:desc', true));
- defineSearchParam(SearchSpecification, new SearchParam('_include', '_include', true));
-
-
- function SearchParam(name, wireName, onlyOneHandler){
- this.name = name;
- this.wireName = wireName || name;
- this.handlers = { };
- var that = this;
-
- this.handlers[name] = function(value){
-
- if (util.isArray(value) || arguments.length > 1){
- throw "only expected one argument to " + name;
- }
-
- return {
- name: this.wireName,
- value: value
- };
- };
-
- if (onlyOneHandler) {
- return;
- }
-
- var singleArgHandler = this.handlers[name];
-
- this.handlers[name+'All'] = function(){
- var values = flatten(arguments);
- return values.map(function(v){
- return {
- name: this.wireName,
- value: v
- }
- }, this);
- };
-
- this.handlers[name+'In'] = function(){
- var values = flatten(arguments);
- return {
- name: this.wireName,
- oneOf: values
- };
- };
-
- this.handlers[name+'Missing'] = function(value){
- return {
- name: this.wireName+':missing',
- value: value === 'false' ? false : Boolean(value)
- };
- };
-
- function flatten(args){
- var values = [];
- Array.prototype.slice.call(args, 0).forEach(function(arg){
- if (!util.isArray(arg)){
- arg = [arg];
- }
- arg.forEach(function(arg){
- values.push(singleArgHandler.call(that, arg).value);
- });
- });
- return values;
- }
-
- }
-
- function ReferenceSearchParam(name){
- SearchParam.apply(this, arguments);
-
- this.handlers[name] = function(subSpec){
- var clauseName = this.wireName + ':' + subSpec.constructor.resourceName;
-
- if (typeof subSpec === 'string'){
- return {
- name: this.wireName,
- value: subSpec
- };
- }
- var clauses = subSpec.__getClauses();
-
- var ret = clauses.map(function(clause){
-
- var oneClause = {
- name: clauseName + '.' + clause.name
- };
-
- if (clause.value) oneClause.value = clause.value;
- if (clause.oneOf) oneClause.oneOf = clause.oneOf;
-
- if (clause.name == '_id') {
- oneClause = {
- name: clauseName,
- value: clause.value
- }
- }
- return oneClause
- });
-
- return ret;
- };
-
- };
-
- ReferenceSearchParam.prototype = new SearchParam();
- ReferenceSearchParam.prototype.constructor = ReferenceSearchParam;
-
- function StringSearchParam(name){
- SearchParam.apply(this, arguments);
-
- this.handlers[name+'Exact'] = function(value){
- return {
- name: this.wireName+':exact',
- value: value
- };
- };
-
- };
- StringSearchParam.prototype = new SearchParam();
- StringSearchParam.prototype.constructor = StringSearchParam;
-
- function TokenSearchParam(name){
- SearchParam.apply(this, arguments);
-
- this.handlers[name] = function(ns, value){
-
- var ret = {
- name: this.wireName,
- value: ns + '|'+ value
- }
-
- if (value === undefined) {
- ret.value = ns;
- }
-
- if (ns === namespace.any) {
- ret.value = value;
- }
-
- if (ns === namespace.none) {
- ret.value = '|'+value;
- }
-
- return ret;
-
- };
-
- this.handlers[name+'Text'] = function(value){
- return {
- name: this.wireName,
- value: value
- };
- };
-
-
-
- }
- TokenSearchParam.prototype = new SearchParam();
- TokenSearchParam.prototype.constructor = TokenSearchParam;
-
- function DateSearchParam(name){
- SearchParam.apply(this, arguments);
- }
- DateSearchParam.prototype = new SearchParam();
- DateSearchParam.prototype.constructor = DateSearchParam;
-
- function NumberSearchParam(name){
- SearchParam.apply(this, arguments);
- }
- NumberSearchParam();
- NumberSearchParam.prototype.constructor = NumberSearchParam;
-
- function QuantitySearchParam(name){
- SearchParam.apply(this, arguments);
- }
- QuantitySearchParam.prototype = new SearchParam();
- QuantitySearchParam.prototype.constructor = QuantitySearchParam;
-
- function CompositeSearchParam(name){
- SearchParam.apply(this, arguments);
- }
- CompositeSearchParam.prototype = new SearchParam();
- CompositeSearchParam.prototype.constructor = CompositeSearchParam;
-
-
- var paramTypes = {
- string: StringSearchParam,
- reference: ReferenceSearchParam,
- token: TokenSearchParam,
- number: NumberSearchParam,
- quantity: QuantitySearchParam,
- date: DateSearchParam,
- composite: CompositeSearchParam
- }
-
- Object.keys(definitions).forEach(function(tname){
- var params = definitions[tname].params;
-
- // Create a subclass of 'SearchSpecification'
- // to track search parameters for each resource
- // e.g. Patient knows about given name, family name, etc.
- var resourceSpec = function(){
- SearchSpecification.apply(this, arguments);
- };
-
- resourceSpec.prototype = new SearchSpecification();
- resourceSpec.prototype.constructor = resourceSpec;
- resourceSpec.resourceName = tname;
-
- params.forEach(function(p){
- defineSearchParam(resourceSpec, new paramTypes[p.type](p.name, p.wireName));
- });
-
- specs[tname] = new resourceSpec();
-
- });
-
-
- Object.keys(mixins).forEach(function(m){
- SearchSpecification.prototype[m] = function(){
- var args = Array.prototype.slice.call(arguments, 0);
- args.unshift(this);
- return mixins[m][m].apply(mixins[m], args);
- };
- });
-
-
- return specs;
-
-};
diff --git a/client/search.js b/client/search.js
deleted file mode 100644
index d37ab5f9..00000000
--- a/client/search.js
+++ /dev/null
@@ -1,88 +0,0 @@
-module.exports = Search;
-var $ = jQuery = require('./jquery');
-
-function Search(p) {
-
- var search = {};
-
- search.client = p.client;
- search.spec = p.spec;
- search.count = p.count || 50;
-
- var nextPageUrl = null;
-
- function gotFeed(d){
- return function(data, status) {
-
- nextPageUrl = null;
- var feed = data.feed || data;
-
- if(feed.link) {
- var next = feed.link.filter(function(l){
- return l.rel === "next";
- });
- if (next.length === 1) {
- nextPageUrl = next[0].href
- }
- }
-
- var results = search.client.indexFeed(data);
- d.resolve(results, search);
- }
- };
-
- function failedFeed(d){
- return function(failure){
- d.reject("Search failed.", arguments);
- }
- };
-
- search.hasNext = function(){
- return nextPageUrl !== null;
- };
-
- search.next = function() {
-
- if (nextPageUrl === null) {
- throw "Next page of search not available!";
- }
-
- var searchParams = {
- type: 'GET',
- url: nextPageUrl,
- dataType: 'json',
- traditional: true
- };
-
- var ret = new $.Deferred();
- console.log("Nexting", searchParams);
- $.ajax(search.client.authenticated(searchParams))
- .done(gotFeed(ret))
- .fail(failedFeed(ret));
-
- return ret;
- };
-
- search.execute = function() {
-
-
- var searchParams = {
- type: 'GET',
- url: search.client.urlFor(search.spec),
- data: search.spec.queryParams(),
- dataType: "json",
- traditional: true
- };
-
- var ret = new $.Deferred();
-
- $.ajax(search.client.authenticated(searchParams))
- .done(gotFeed(ret))
- .fail(failedFeed(ret));
-
- return ret;
- };
-
- return search;
-}
-
diff --git a/client/utils.js b/client/utils.js
deleted file mode 100644
index bf14beab..00000000
--- a/client/utils.js
+++ /dev/null
@@ -1,60 +0,0 @@
-var utils = module.exports = {};
-
-utils.byCodes = function(observations, property){
-
- var bank = utils.byCode(observations, property);
- function byCodes(){
- var ret = [];
- for (var i=0; i
+
+
+## Installation
+
+### From NPM
+```sh
+npm i fhirclient
+```
+### From CDN
+Include it with a `script` tag from one of the following locations:
+
+From NPM Release:
+- https://cdn.jsdelivr.net/npm/fhirclient/build/fhir-client.js
+- https://cdn.jsdelivr.net/npm/fhirclient/build/fhir-client.min.js
+
+Latest development builds from GitHub:
+- https://combinatronics.com/smart-on-fhir/client-js/master/dist/build/fhir-client.js
+- https://combinatronics.com/smart-on-fhir/client-js/master/dist/build/fhir-client.min.js
+
+
+## Browser Usage
+
+In the browser you typically have to create two separate pages that correspond to your
+`launch_uri` (Launch Page) and `redirect_uri` (Index Page).
+
+### As Library
+
+```html
+
+
+
+
+
+
+
+```
+
+### As Module
+```js
+import FHIR from "fhirclient"
+
+// Launch Page
+FHIR.oauth2.authorize({
+ "client_id": "my_web_app",
+ "scope": "patient/*.read"
+});
+
+// Index Page
+FHIR.oauth2.ready()
+ .then(client => client.request("Patient"))
+ .then(console.log)
+ .catch(console.error);
+```
+
+## Server Usage
+The server is fundamentally different environment than the browser but the
+API is very similar. Here is a simple Express example:
+```js
+const fhirClient = require("fhirclient");
+
+// This is what the EHR will call
+app.get("/launch", (req, res) => {
+ fhirClient(req, res).authorize({
+ "client_id": "my_web_app",
+ "scope": "patient/*.read"
+ });
+});
+
+// This is what the Auth server will redirect to
+app.get("/", (req, res) => {
+ fhirClient(req, res).ready()
+ .then(client => client.request("Patient"))
+ .then(res.json)
+ .catch(res.json);
+});
+```
+
+
+### [Read the full documentation](http://docs.smarthealthit.org/client-js/).
+
+
+
+## License
+Apache 2.0
+
+
diff --git a/dist/build/bundle.dev.html b/dist/build/bundle.dev.html
new file mode 100644
index 00000000..ee5ad7da
--- /dev/null
+++ b/dist/build/bundle.dev.html
@@ -0,0 +1,39 @@
+
+
+