ng-fhir

FHIR API AngularJS module

Added by: Sam Deering

GitHub

Repository

fhirbase/ng-fhir

Stats

Stars: 3

Watchers: 3

Forks: 1

Author

Fhirbase
Fhirbase

Module Description

ng-fhir

Build Status

FHIR API AngularJS module.

ng-fhir provide $fhir service for interaction with FHIR-complaint servers from your AngularJS application.

Installation

Install ng-fhir with bower:

bower install ng-fhir

Add a <script> to your index.html:

<script src="/bower_components/ng-fhir/ng-fhir.js"></script>

Use ng-fhir as a dependency for your app:

angular.module('myApp', ['ng-fhir'])
.config(function ($provide, $fhirProvider) {
  $fhirProvider.cors = true
  $fhirProvider.baseUrl='http://fhir.healthintersections.com.au/open'
})
.controller('myController', function($scope, $fhir){
  //...

  $fhir.create('Patient', {name: [{family: ['Askold']}]})
  .then(function(resource){ ... })

  //...

  $fhir.search('Patient',{name: 'maud'})
  .then(function(bundle){ $scope.patients = bundle.entry })

  //...
})

Service

All premium services from developers of Fhirbase projects should be requested from Choice Hospital Systems (http://Choice-HS.com)

API

Conformance & Profiles

Resource's CRUD

Tags

Search

$fhir.search() function is used for FHIR resource's search

myController = function($scope, $fhir){
  queryObject = {name: 'maud', sort: {$desc: 'birthDate'}}
  $fhir.search('Patient', queryObject)
  .then(function(bundle){
     $scope.patients = bundle.entry
  })
}

For queryObject syntax ng-fhir adopts mongodb-like query syntax (see):

{name: 'maud'}
//=> name=maud
{name: {$exact: 'maud'}}
//=> name:exact=maud
{name: {$or: ['maud','dave']}}
//=> name=maud,dave
{name: {$and: ['maud',{$exact: 'dave'}]}}
//=> name=maud&name:exact=Dave
{birthDate: {$gt: '1970', $lte: '1980'}}
//=> birthDate=>1970&birthDate=<=1980

{subject: {$type: 'Patient', name: 'maud', birthDate: {$gt: '1970'}}}
//=> subject:Patient.name=maud&subject:Patient.birthDate=>1970
{'subject.name': {$exact: 'maud'}}
//=> subject.name:exact=maud

For more information see tests

Development

nodejs is required for build.

We recommend install it using nvm

Build & test:

git clone https://github.com/fhirbase/ng-fhir
cd ng-fhir
npm install
`npm bin`/grunt build
node_modules/karma/bin/karma start --single-run

Module stats last updated: 2015-05-28 10:24:18

Disclaimer: Some data on this page may have been gathered from the authors GitHub respository. If you see any mistakes or outdated information please let us know. Thanks!