Socket
Book a DemoInstallSign in
Socket

fhir-helpers

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fhir-helpers

FHIR helpers to assist in the building and formatting of FHIR bundles

1.0.4
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
3
Weekly downloads
 
Created
Source

FHIR-helpers

This library is intended to deliver helper methods for forming FHIR resources that follow the hl7 FHIR standard.

Helpers

Allergy

var fhir = require('fhir-helpers')

var obj = {
  emr: 'FooBar',
  value: 'medication',
  onset: '2010-03-01',
  recordedDate: '2010-03-01',
  codingSystem: 'http:\/\/www.nlm.nih.gov\/research\/umls\/rxnorm',
  code: '314422',
  codingDisplay: 'ALLERGENIC EXTRACT, PENICILLIN',
  status: 'unconfirmed',
  criticality: 'CRITU',
  category: 'medication'
}

var allergyResource = fhir.createAllergy(obj)

/* → {
      resource: {
        resourceType: 'AllergyIntolerance',
        identifier: [{
          system: 'FooBar',
          value: 'medication'
        }],
        onset: '2010-03-01',
        recordedDate: '2010-03-01',
        substance: {
          coding: [{
            system: 'http:\/\/www.nlm.nih.gov\/research\/umls\/rxnorm',
            code: '314422',
            display: 'ALLERGENIC EXTRACT, PENICILLIN'
          }]
        },
        status: 'unconfirmed',
        criticality: 'CRITU',
        category: 'medication'
      }
    }
*/

Medication-order

var fhir = require('fhir-helpers')

var obj = {
  emr: 'EMRNAME',
  value: '1234',
  dateWritten: '2014-01-21',
  status: 'active',
  medicationName: 'Phentermine 37.5 mg Oral Capsule',
  code: '803348',
  codingSystem: 'urn:oid:2.16.840.1.113883.6.88',
  codingDisplay: 'Phentermine 37.5 mg Oral Capsule',
  codingPrimary: true,
  codingText: 'RxNorm',
  medicationIsBrand: false,
  medicationKind: 'product',
  dosageFrequency: '2',
  dosageDuration: '1',
  dosageUnits: 'd',
  dosageAsNeeded: false
}

var medicationOrderResource = fhir.createMedicationOrder(obj)

/* → {
      resource: {
        resourceType: 'medicationOrder',
        identifier: [{
          system: 'EMRNAME',
          value: '1234'
        }],
        dateWritten: '2014-01-21',
        status: 'active',
        medication: {
          name: 'Phentermine 37.5 mg Oral Capsule',
          code: {
            coding: [{
              code: '803348',
              system: 'urn:oid:2.16.840.1.113883.6.88',
              display: 'Phentermine 37.5 mg Oral Capsule',
              primary: true
            }],
            text: 'RxNorm'
          },
          isBrand: false,
          kind: 'product'
        },
        dosageInstruction: [{
          timing: {
            repeat: {
              frequency: '2',
              duration: '1',
              units: 'd'
            }
          },
          asNeeded: false
        }]
      }
    }
*/

Medication-statement

var fhir = require('fhir-helpers')

var obj = {
  emr: 'EMRNAME',
  value: '1222',
  medicationName: 'Diazepam 5MG Tablet',
  code: '197591',
  codingSystem: 'urn:oid:2.16.840.1.113883.6.88',
  codingDisplay: 'Diazepam 5MG Tablet',
  codingPrimary: true,
  codingText: 'RxNorm',
  medicationIsBrand: false,
  medicationKind: 'product',
  frequency: '2',
  duration: '1',
  units: 'd',
  dosageAsNeeded: false
}

var medicationStatementResource = fhir.createMedicationStatement(obj)

/* → {
      resource: {
        resourceType: 'medicationStatement',
        identifier: [{
          system: 'EMRNAME',
          value: '1222'
        }],
        medication: {
          name: 'Diazepam 5MG Tablet',
          code: {
            coding: [{
              code: '197591',
              system: 'urn:oid:2.16.840.1.113883.6.88',
              display: 'Diazepam 5MG Tablet',
              primary: true
            }],
            text: 'RxNorm'
          },
          isBrand: false,
          kind: 'product'
        },
        dosage: [{
          timing: {
            repeat: {
              frequency: '2',
              duration: '1',
              units: 'd'
            }
          },
          asNeeded: false
        }]
      }
    }
*/

Organization

var fhir = require('fhir-helpers')

var obj = {
  system: 'orgSystem',
  value: '123456',
  name: 'testOrg'
}

var organizationResource = fhir.createOrganization(obj)

/* → {
      resource:
        {
          resourceType: 'organization',
          identifier: {
            system: 'orgSystem',
            value: '123456'
          },
          name: 'testOrg'
        }
    }
*/

Patient

var fhir = require('fhir-helpers')

var obj = {
  emr: 'testName',
  id: '1234',
  ssn: '123-45-6789',
  familyName: 'smith',
  givenName: 'Taylor',
  phone: '123-456-7890',
  gender: 'male',
  birthDate: '05-04-1989'
}

var patientResource = fhir.createPatient(obj)

/* → {
      resource:
        {
          resourceType: 'patient',
          identifier: [{
            system: 'testName',
            value: '1234'
          }, {
            system: 'SSN',
            value: '123-45-6789'
          }],
          name: {
            family: ['smith'],
            given: ['Taylor']
          },
          gender: 'male',
          birthDate: '05-04-1989',
          telecom: {}
        }
    }
*/

Practitioner

var fhir = require('fhir-helpers')

var obj = {
  emr: 'testName',
  id: '1234',
  npi: '123456789',
  familyName: 'smith',
  givenName: 'Taylor',
  birthDate: '05-04-1989',
  gender: 'male'
}

var practitionerResource = fhir.createPractitioner(obj)

/* → {
      resource:
        {
          resourceType: 'practitioner',
          identifier: [{
            system: 'testName',
            value: '1234'
          }, {
            system: 'NPI',
            value: '123456789'
          }],
          name: {
            family: ['smith'],
            given: ['Taylor']
          },
          gender: 'male',
          birthDate: '05-04-1989'
        }
    }
*/

Contributions

For feature requests or suggestions, please post an issue.

All developers are encourage to provide feedback, comments, update the readme, etc.

This Project follows the StandardJS style guide.

js-standard-style

To Contribute:

  • Clone Repo
  • npm install
  • Write Code
  • Write/Update Test(s)
  • Update README (if necessary)
  • Submit Pull Request

Contributors

twitter/kevco54
Kevin Collins
twitter/twilson63
Tom Wilson

License

FHIR-helpers is available under the MIT license.

Keywords

FHIR

FAQs

Package last updated on 12 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.