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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@precisa-saude/fhir

v0.16.2

Published

Tipos FHIR R4, definições de biomarcadores, faixas de referência e conversores para o ecossistema de saúde brasileiro

Downloads

1,003

Readme

@precisa-saude/fhir

Tipos FHIR R4, 200+ definições de biomarcadores com códigos LOINC, faixas de referência (SBPC/ML, SBC, SBD), conversores e importadores para o contexto clínico brasileiro.

Instalação

npm install @precisa-saude/fhir

Uso rápido

Faixas de referência

import { getReferenceRange } from '@precisa-saude/fhir';

const range = getReferenceRange('Cholesterol');
// { min: 0, max: 190, optimalMax: 190, unit: 'mg/dL', ... }

const rangeForUser = getReferenceRange('HDL', { sex: 'F', age: 35 });
// Faixa ajustada por sexo e idade

Converter resultados laboratoriais para FHIR R4

import { labResultToFHIRBundle } from '@precisa-saude/fhir';

const bundle = labResultToFHIRBundle(report, observations, userProfile);
// Retorna um FHIR Bundle com DiagnosticReport, Observations e Patient

Normalizar códigos de biomarcadores

import { normalizeCode, codeToLoinc, loincToCode } from '@precisa-saude/fhir';

normalizeCode('CholHDL_Ratio'); // 'Cholesterol_HDL_Ratio'
codeToLoinc('HDL'); // '2085-9'
loincToCode('2085-9'); // 'HDL'

Consultar definições de biomarcadores

import { getDefinitionByCode, getAllDefinitions } from '@precisa-saude/fhir';

const def = getDefinitionByCode('HDL');
// { code: 'HDL', loinc: '2085-9', names: { pt: [...], en: [...] }, ... }

const all = getAllDefinitions(); // 200+ definições

Sub-path imports

Para tree-shaking otimizado, cada módulo pode ser importado individualmente:

import { BIOMARKER_DEFINITIONS } from '@precisa-saude/fhir/biomarkers';
import { getReferenceRange } from '@precisa-saude/fhir/reference-ranges';
import { labResultToFHIRBundle } from '@precisa-saude/fhir/converter';
import { processImportBundle } from '@precisa-saude/fhir/importer';
import { getCanonicalUnit, unitToUCUM } from '@precisa-saude/fhir/units';
import { validateFHIRObservation } from '@precisa-saude/fhir/validators';

Módulos

| Sub-path | Descrição | | ------------------- | --------------------------------------------------------------------- | | /biomarkers | 200+ definições com códigos LOINC, nomes pt/en, sub-categorias | | /category-groups | Agrupamento de 10 categorias clínicas top-level sobre as 20 sub | | /reference-ranges | Faixas de referência por sexo/idade/gestação (SBPC/ML, SBC, SBD, OMS) | | /converter | Converte dados laboratoriais para FHIR R4 Bundle | | /importer | Importa FHIR Bundle de volta para estruturas internas | | /units | Mapeamento de unidades, conversão para UCUM | | /validators | Validação de recursos FHIR (DiagnosticReport, Observation, Bundle) |

Escopo das faixas de referência

As faixas em /reference-ranges são validadas para adultos (≥18 anos). Variantes pediátricas não estão incluídas — consumidores que atendem populações pediátricas devem adicionar suas próprias faixas ou buscar fontes específicas (SBP, protocolos neonatais).

Variantes gestacionais estão disponíveis para TSH, Hgb, Ferritin, Creatinine e Glucose. Para usar, passe pregnant: true e, quando conhecido, pregnancyTrimester no ReferenceRangeContext:

const range = getReferenceRange('TSH', {
  biologicalSex: 'F',
  pregnant: true,
  pregnancyTrimester: 1,
});
// → { max: 2.5, min: 0.1, ... } (alvo ATA 2017 para 1º trimestre)

O metadado opcional fastingRequired em BiomarkerReferenceRange indica se a amostra exige jejum estrito (ex.: Glucose, Insulin, HOMA_IR) ou se o jejum é preferido mas não obrigatório (ex.: Triglycerides, que aceita dosagem não-jejum por SBC 2017/2025).

Aviso médico

Este pacote fornece ferramentas de software para padronização de dados clínicos. Não substitui orientação médica profissional. Consulte o DISCLAIMER.md na raiz do repositório para detalhes completos.

Licença

Apache-2.0