clinical:hl7-resource-contract

v3.4.2Published 6 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

clinical:hl7-resource-contract

Licensing

MIT License

Integration & Verification Tests

CircleCI

API Reference

The resource in this package implements the FHIR 1.6.0 - STU3 Ballot version of the Contract resource schema, specified at https://www.hl7.org/fhir/DSTU2/contract.html.


Installation

meteor add clinical:hl7-resource-contract

You may also wish to install the autopublish package, which will set up a default publication/subscription of the Contracts collection for logged in users. You will need to remove the package before going into production, however.

meteor add clinical:autopublish  

Example

1var newContract = {
2
3};
4Contracts.insert(newContract);

Extending the Schema

If you have extra fields that you would like to attach to the schema, extend the schema like so:

1ExtendedContractSchema = new SimpleSchema([
2  ContractSchema,
3  {
4    "createdAt": {
5      "type": Date,
6      "optional": true
7    }
8  }
9]);
10Contracts.attachSchema( ExtendedContractSchema );

Initialize a Sample Contract

Call the initializeContract method to create a sample contract in the Contracts collection.

1Meteor.startup(function(){
2  Meteor.call('initializeContract');
3})

Server Methods

This package supports createContract, initializeContract, and dropContract methods.


REST API Points

This package supports the following REST API endpoints. All endpoints require an OAuth token.

GET    /fhir-1.6.0/Contract/:id    
GET    /fhir-1.6.0/Contract/:id/_history  
PUT    /fhir-1.6.0/Contract/:id  
GET    /fhir-1.6.0/Contract  
POST   /fhir-1.6.0/Contract/:param  
POST   /fhir-1.6.0/Contract  
DELETE /fhir-1.6.0/Contract/:id

If you would like to test the REST API without the OAuth infrastructure, launch the app with the NOAUTH environment variable, or set Meteor.settings.private.disableOauth to true in you settings file.

NOAUTH=true meteor

Acknowledgements

Many thanks to UPenn Medical and the FhirBlocks Project for their generous support in sponsoring this package.