npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fhir-helpers

v1.0.4

Published

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

Downloads

12

Readme

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.