Code Monkey home page Code Monkey logo

fhir-facade-starter's Introduction

Intro

This project is a FHIR facade server built on @asymmetrik/node-fhir-server-core. The facade server is meant to be used with your existing (or new) patient database. All you need to do is set up the database connection and fill in the queries and you will have a FHIR server!

Getting Started with Docker

  1. Install the latest Docker Community Edition for your OS if you do not already have it installed.
  2. Run docker-compose up.
  3. Visit localhost:3000/3_0_1/metadata to view the conformance statement.

Getting Started with Node

  1. Install the latest LTS for Node.js if you do not already have it installed.
  2. Make sure the default values defined in env.json are valid.
  3. Run yarn or npm install.
  4. Run yarn start or npm run start.
  5. Visit localhost:3000/3_0_1/metadata to view the conformance statement.

Next steps

At this point you can now start testing the endpoints. Depending what profiles you opt into, certain routes will be available. You can view the routes enabled based on which service methods you provide over at @asymmetrik/node-fhir-server-core.

  1. Setup the database connection (Mongo/Sequelize) in ./src/index.js.
  2. Look through ./src/config.js to set up the server and decide which profile you want to support. Comment out ones you don't want to support.
  3. Look at the corresponding service templates for the resources you want to enable. You can remove any interaction you don't want to support. For instance, if you don't want write capability for the Patient resource, you would delete the create and update functions in ./src/services/patient/patient.service.js. This will disable their routes.
  4. Write your queries and test!

Authorization

The facade server uses passportjs for authentication. This server comes with a bearer strategy template. You can implement your own passport strategy and reference it in ./src/config.js to conforms to your AuthZ server. For more information on authorization please visit http://docs.smarthealthit.org/authorization/.

Having trouble with something?

If you have questions specific to Docker or Node, please consider asking on Stack Overflow. They already have a lot of support on these topics. If your questions is related to the FHIR specification, please review that documentation at https://www.hl7.org/fhir/. Any questions related to this specific package, please ask in the issues section. Also, if you think you are experiencing a bug or see something incorrect with the spec, please file an issue so we can help you as soon as we can.

License

This project is MIT licensed.

fhir-facade-starter's People

Contributors

jonterrylee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

fhir-facade-starter's Issues

Missing search params: _count is undefined

Hello, I'm trying to get the _count value from the search params however after some search on the source code, I found that only part of the following params are implemented

let { _INCLUDE, _REVINCLUDE, _SORT, _COUNT, _SUMMARY, _ELEMENTS, _CONTAINED, _CONTAINEDTYPED } = args;

According to your file common.arguments.js, only some of them are implemented and I want to use the _count. how should I do without changing the source code?

MacOS/ Amazon Linux?

I tried installing in Docker for Mac but ran into build problems. I expect I can ignore the warning but not the error.

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/InRelease Unable to find expected entry 'main/binary-amd64/Packages' in Release file (Wrong sources.list entry or malformed file)

E: Some index files failed to download. They have been ignored, or old ones used instead.
ERROR: Service 'fhir' failed to build: The command '/bin/sh -c apt-get -y update' returned a non-zero code: 100

I am considering AWS Docker. Has anyone had success there?

Error in bundle Creation

Are you supporting create bundle feature? I'm getting the following message in error response "diagnostics": "'resourceType' expected to have value of 'Bundle', received 'undefined'"",
I'm looking to create a composition bundle but didn't see any redirection for those type of resources in the ""create bundle method.

Build ERROR : Cannot read property 'ACCOUNT' of undefined

yarn run v1.3.2
$ cross-env NODE_ENV=development; node scripts/nodemon;
/srv/src/src/config.js:70
[RESOURCES.ACCOUNT]: {
^

TypeError: Cannot read property 'ACCOUNT' of undefined
at Object. (/srv/src/src/config.js:70:14)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object. (/srv/src/src/index.js:5:5)
at Module._compile (module.js:643:30)
Nodemon crashed. Waiting for changes to restart.

We are getting this error while trying to build the fhir facade .
Please help on this.

documentReference resource

"category": [ { "coding": [ { "system": "http://ihe.net/xds/connectathon/classCodes", "code": "History and Physical", "display": "History and Physical" } ] } ],

While trying to map category on search API result we are not able to map category like shown in the above example. We are able to map all other fields.

Tried to map using = documentreference_resource.category={} . Please help on this.

FHIR resource : create composition is not working

It was working fine early with the below mentioned fix.

#5

suddenly it is getting issue with node version 8.15 .

I have tried to POST with https://zzzzzabc.com/3_0_1/composition with content type application/fhir+json and body as data from https://www.hl7.org/fhir/composition-example.json.html

We are getting the following error

{
"resourceType": "OperationOutcome",
"text": {
"status": "generated",
"div": "<div xmlns="http://www.w3.org/1999/xhtml\">

Operation Outcome

<table border="0"><table border="0"><td style="font-weight: bold;">error
'resourceType' expected to have value of 'undefined', received 'Composition'
"
},
"issue": [
{
"severity": "error",
"code": "invalid",
"diagnostics": "'resourceType' expected to have value of 'undefined', received 'Composition'"
}
]
}

Not getting http status code while creating a patient

I have tested create patient and patient created in my end but not getting proper HTTP status code.The case is same even if we didn't edit anything in the source code. I'm expecting status code 201 here.
Do we need to custom handle success codes?

Path must be a string. Received undefined

After setting up this project we have accessed end-point https://zzzzzabc.com/3_0_1/patient with content type application/fhir+json and body as data from https://www.hl7.org/fhir/patient-examples.html

We are getting the below error
" {
"resourceType": "OperationOutcome",
"text": {
"status": "generated",
"div": "<div xmlns="http://www.w3.org/1999/xhtml\">

Operation Outcome

<table border="0"><table border="0"><td style="font-weight: bold;">error
Path must be a string. Received undefined
"
},
"issue": [
{
"severity": "error",
"code": "exception",
"diagnostics": "Path must be a string. Received undefined"
}
]
}"

While debugging we found it the issue is in https://github.com/Asymmetrik/fhir-facade-starter/blob/master/src/services/patient/patient.service.js line no:90 , base_version is empty. please provide some help to resolve this.

NB: We tried with Docker and Node.js

New extension to an existing resource.

Can you please guide us on how can we add a new custom extension to an d existing resource

example : like "gender" for a patient resource. i need to add "custom" extension to a resource.

Error in patient search with organization as parameter.

While trying to search with organization as search parameter. it showing following error. Please help on this.

{ "resourceType": "OperationOutcome", "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><table border=\"0\"><tr><td style=\"font-weight: bold;\">error</td><td><pre>Invalid parameter: organization</pre></td></tr></table></div>" }, "issue": [ { "severity": "error", "code": "invalid", "diagnostics": "Invalid parameter: organization" } ] }

Giving success message as response with 201 success status code.

Hi
i want to give success message as return along with status code.

For returning an error we are using

reject(new Error(message));

{ "resourceType": "OperationOutcome", "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><table border=\"0\"><tr><td style=\"font-weight: bold;\">error</td><td><pre>Email Already Exists</pre></td></tr></table></div>" }, "issue": [ { "severity": "error", "code": "exception", "diagnostics": "Email Already Exists" } ] }

and its working fine.

please help us to return a success message like below mentioned. while we resolve a resource like

resolve(composition_resource);

{ "resourceType": "OperationOutcome", "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><table border=\"0\"><tr><td style=\"font-weight: bold;\">error</td><td><pre>Resource Created</pre></td></tr></table></div>" }, "issue": [ { "severity": "information", "code": "exception", "diagnostics": "Resource Created" } ] }

composition: searchById is not working

We are trying to get composition resource data using searchById method. But it is showing some error like "Cannot read property 'versionId' of undefined"

While trying to resolve composition_resource using resolve like below.
resolve(composition_resource);
But It is not showing response for test value for resource "composition_resource.id = 'test id';".

we are getting following error response.

{ "resourceType": "OperationOutcome", "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><table border=\"0\"><tr><td style=\"font-weight: bold;\">error</td><td><pre>Cannot read property 'versionId' of undefined</pre></td></tr></table></div>" }, "issue": [ { "severity": "error", "code": "exception", "diagnostics": "Cannot read property 'versionId' of undefined" } ] }

Please guide on this.

Issue with passport BasicStrategy

I need to authenticate my request with some predefined credential.
So that I have tried to implement with BasicStrategy , but I am getting permission denied issue.

Please see sample code

config.js

	auth: {
		
		
		strategy: {
		 	name: 'basic',
			 useSession: false,
		 	service: './src/strategies/basic.strategy.js'
		 },
	},

basic.strategy.js

module.exports.strategy = new BasicStrategy(	
	function(username, password, done) {		
		User.findOne({ username: username }, function (err, user) {			
			return done(null, true);
		});
		return done(null, false);
	  }
);

providing different status codes.

We are using fhir-facade-starter and we want to provide separate status codes along with status messages for success, error, warning conditions, etc.

Now we are getting only two statuses, one while resolving the promise ie 201 and the other is 500 while rejecting the promise.

can you please guide us on how we can use other status codes like 401, 503, etc with appropriate messages

Create composition is not working

I have tried to POST with https://zzzzzabc.com/3_0_1/composition with content type application/fhir+json and body as data from https://www.hl7.org/fhir/composition-example.json.html

We are getting the following error

{
"resourceType": "OperationOutcome",
"text": {
"status": "generated",
"div": "<div xmlns="http://www.w3.org/1999/xhtml\">

Operation Outcome

<table border="0"><table border="0"><td style="font-weight: bold;">error
'resourceType' expected to have value of 'Composition', received 'undefined'
"
},
"issue": [
{
"severity": "error",
"code": "invalid",
"diagnostics": "'resourceType' expected to have value of 'Composition', received 'undefined'"
}
]
}

It is working fine for search composition

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.