Skip to content

Commit

Permalink
Updated NPM entry point
Browse files Browse the repository at this point in the history
  • Loading branch information
jmandel committed Sep 14, 2014
1 parent 9c68bac commit aa475e3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,20 @@ fhir.search('Patient', {name: 'maud'})

## Node.js adapter:

Build the js source by doing `npm install`, and then:
Via NPM you can `npm install fhir.js`. (If you want to work on the source code,
you can compile coffee to js via `npm install`, and use `./lib/adapters/node`
as an entrypoint.)

```
var mkFhir = require('./lib/adapters/node');
var mkFhir = require('fhir.js');
var fhirClient = mkFhir({
var client = mkFhir({
baseUrl: 'http://try-fhirplace.hospital-systems.com'
});
fhirClient.search('Patient', {birthdate: '1974'}, function(err, bundle) {
console.log("# patients born in 1974: ", bundle.entry.length);
client.search( 'Patient', { 'birthdate': '1974' }, function(err, bundle) {
var count = (bundle.entry && bundle.entry.length) || 0;
console.log("# Patients born in 1974: ", count);
});
```
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"request": "~2.42.0"
},
"description": "FHIR javascript client",
"main": "lib/adapters/node",
"repository": {
"type": "git",
"url": "[email protected]:FHIR/fhir.js.git"
Expand Down

0 comments on commit aa475e3

Please sign in to comment.