clinical:hl7-resource-research-subject

v3.0.11Published 7 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-research-subject

HL7 FHIR Resource - Patient


Schema Version

The resource in this package implements the FHIR 1.6.0 - STU3 Ballot version of the Patient resource schema, specified at http://hl7.org/fhir/2016Sep/researchsubject.html.


Installation

meteor add clinical:hl7-resource-research-subject

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

meteor add clinical:autopublish  

Example

1var newResearchSubject = {
2  'name' : [
3    {
4      'text' : 'Jane Doe',
5      'given' : 'Jane',
6      'family' : 'Doe',
7      'resourceType' : 'HumanName'
8    }
9  ],
10  'active' : true,
11  'gender' : 'female',
12  'identifier' : [{
13      'use' : 'usual',
14      'type' : {
15        text: 'Medical record number',
16        'coding' : [
17          {
18            'system' : 'http://hl7.org/fhir/v2/0203',
19            'code' : 'MR'
20          }
21        ]
22      },
23      'system' : 'urn:oid:1.2.36.146.595.217.0.1',
24      'value' : '123',
25      'period' : {}
26   }],
27  'birthdate' : new Date(1970, 1, 25),
28  'resourceType' : 'ResearchSubject'
29};
30ResearchSubjects.insert(newResearchSubject);

Extending the Schema

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

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

Initialize a Sample ResearchSubject

Call the initializeResearchSubject method to create a sample research-subject in the ResearchSubjects collection.

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

Server Methods

This package supports createResearchSubject, initializeResearchSubject, and dropResearchSubject methods.


REST API Points

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

GET    /fhir-1.6.0/ResearchSubject/:id    
GET    /fhir-1.6.0/ResearchSubject/:id/_history  
PUT    /fhir-1.6.0/ResearchSubject/:id  
GET    /fhir-1.6.0/ResearchSubject  
POST   /fhir-1.6.0/Patient/:param  
POST   /fhir-1.6.0/Patient  
DELETE /fhir-1.6.0/Patient/: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

Licensing

MIT License