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

uma-healthcare-api

v0.2.6

Published

Librería para interactuar con Google Healthcare API utilizando NestJS.

Readme

NestJS GCP Healthcare API Module 🏥⚡

Módulo NestJS para integración con Google Cloud Healthcare API (FHIR) que simplifica las operaciones CRUD y manejo de recursos FHIR.

Características Clave ✨

  • ✅ Operaciones CRUD de los recursos FHIR
  • ✅ Tipado seguro para recursos y operaciones
  • ✅ Manejo automático de autenticación con GCP
  • ✅ Configuración dinámica mediante variables de entorno
  • ✅ Sistema de logging integrado
  • ✅ Compatible con JSON Patch para actualizaciones
  • ✅ Manejo centralizado de errores de la API

Instalación 📦

npm install uma-healthcare-api
# o
yarn add uma-healthcare-api

Configuración Requerida ⚙️

  1. Variables de entorno (en tu .env):
PROJECT_ID=tu-project-id
HEALTHCARE_FHIR_STORE=projects/{project-id}/locations/{region}/datasets/{dataset-id}/fhirStores/{fhir-store-id}
  1. Importar módulo (en tu app.module.ts):
import { HealthcareModule } from 'uma-healthcare-api';

@Module({
  imports: [
    HealthcareModule.forRoot({
      fhirStore: process.env.HEALTHCARE_FHIR_STORE,
      projectId: process.env.PROJECT_ID
    }),
  ],
})
export class AppModule {}

Uso Básico 🚀

Crear Recurso

const newPatient: FhirPatient = {
  resourceType: 'Patient',
  name: [{ given: ['John'], family: 'Doe' }],
  // ...otros campos
};

await this.healthcareService.create(newPatient);

Obtener Recurso

// Obtener por ID
const patient = await this.healthcareService.findOne<Patient>('123', 'Patient');

// Buscar con filtros
const results = await this.healthcareService.findAll<Patient>(
  'Patient',
  'name=Doe'
);

Actualizar Recurso (JSON Patch)

const updates: OpPatch[] = [
  { op: 'replace', path: '/name/0/family', value: 'Smith' }
];

await this.healthcareService.update('123', 'Patient', updates);

Estructura del Módulo 📂

healthcare-api/
├── src/
│   ├── interfaces/       # Interfaces
│   ├── types/       # Tipos
│   ├── utils/            # Herramientas de conversión
│   ├── healthcare.module.ts
│   └── healthcare.service.ts

Manejo de Errores ⚠️

El módulo incluye:

  • Logs detallados de operaciones
  • Tipado específico para errores de GCP
  • Reconocimiento automático de errores 404
  • Transformación de respuestas binarias a JSON

Ejemplo de manejo:

try {
  await this.healthcareService.create(resource);
} catch (error) {
  if (error instanceof HealthcareErrorResponse) {
    console.error('Error específico de GCP:', error.response.data);
  }
  // Manejo personalizado
}

Requisitos del Sistema 📋

  • Node.js 16+
  • NestJS 8+
  • Cuenta de Google Cloud Platform
  • Permisos de Cloud Healthcare API habilitados
  • Credenciales de GCP configuradas (GOOGLE_APPLICATION_CREDENTIALS)

Mejores Prácticas 🛡️

  1. Usar tipos FHIR validados
  2. Implementar paginación para resultados grandes
  3. Utilizar transacciones para operaciones en lote
  4. Monitorear quotas de GCP Healthcare API
  5. Cachear respuestas para recursos estáticos

Documentación Adicional 📚