open-index/open-npm huggingface dataset:
npm package: @imaware/fhir-gen
Description: Module for generating realistic FHIR test data.
Author: Christopher Manzi
Latest version: 0.11.0

# fhir-gen

Node/Typescript module for generating random test FHIR data.

## Purpose

This library provides a set of factory functions for generating test FHIR data. Its purpose is to allow for easy on-the-fly generation of FHIR resources for writing unit tests. The factory functions use the [fishery](https://www.npmjs.com/package/fishery) module for factory generation.

### Required fields

Due to how this module uses DeepPartial\<T> objects to allow for overriding resource properties during generation, the factory functions _do not check_ for required FHIR properties. FHIR resources returned from these factory
functions are not guaranteed to be

### References

Randomly generated resources will not pass back any References in any properties. Due to the relational nature of these fields, it would not make sense to randomly generate a reference to a resource that doesn't exist.

## FHIR Specifications Implemented

- [ ] STU3
- [x] R4 (Partial)

## API Documentation

Auto-generated docs can found in `./docs.md`.

## Contributing

Read the guide for contributing in CONTRIBUTING.md.
npm package: @imaware/healthcheck
Description: Imaware Healthcheck
Author: Dan Castillo
Latest version: 1.0.0

# imaware Healthcheck

Reuseable healthcheck package to be used by fastify servers and express servers.

## Default endpoints

- GET `/healthcheck` - default healthcheck is API up
- GET `/healthcheck/startz` - default healthcheck is API up
- GET `/healthcheck/readyz` - healthcheck is API up and are dependencies up

## Usage

### Installation

```bash
yarn add @imaware/healthcheck
```

#### API Dependencies

  ```typescript
  const options = {
    dependencies: {
      serviceHealthcheck: 'http://service.healthcheck',
      serviceStart: 'http://service.start',
      serviceReady: 'http://service.ready',
    },
  };
  ```

#### Fastify Usage

  ```typescript
  import { healthcheck }  from '@imaware/healthcheck';

  const RouteHandlers = [HealthCheckHandler];

  export default fp(async (app: FastifyInstance) => {
    /* Pass in app and name of service or API
    * app: FastifyInstance
    * opts: { name: string }
    */
    healthcheck(app, dependencies);
  });
  ```

#### Express Usage

  ```typescript
  import { healthcheck }  from '@imaware/healthcheck';

  /* Pass in app and name of service or API
  * app: express.Application
  * opts: { name: string }
  */
  healthcheck(app, dependencies);
  ```

#### API has no additional dependencies

  ```typescript
  import { healthcheck }  from '@imaware/healthcheck';

  healthcheck(app);
  ```

#### Example responses

Response for `/healthcheck`

  ```json
  { "ok": true }
  ```

Response for `/healthcheck/readyz`

  ```json
  { "ok": true }
  ```

Response for `/healthcheck/startz` with dependencies

  ```json
  { "ok": true, "message": "Healthcheck success for service" }
  ```

Response for `/healthcheck/startz` without dependencies

  ```json
  { "ok": true, "message": "Healthcheck success" }
  ```

### Options

`dependencies`

By default this is not required. You can pass in JSON object as API name (key) and API URI (value).
Healthcheck will check each dependency to check if service is up.

```typescript
  const options = {
    dependencies: {
      serviceHealthcheck: 'http://service.healthcheck',
      serviceStart: 'http://service.start',
      serviceReady: 'http://service.ready',
    },
  };
  ```
npm package: @imaware/secretenv
Description: NodeJS utility for automatically resolving environment variables to secret values.
Author: Christopher Manzi
Latest version: 1.2.57

# secretenv

NodeJS utility for automatically resolving environment variables to secret values.

## Docs

Automatically generated docs located in `./docs.md`.

## Supported Secret Providers

- [x] GCP Secrets
- [x] AWS SSM Parameter Store
- [x] AWS Secrets Manager (SecretString only)
- [ ] Vault
- [ ] Azure Key Vault

## Usage

In your code's initialization logic, simply call:

```javascript
await resolveEnv()
```

The function `resolveEnv` returns a Promise which resolves once all environment variables have been processed (and resolved if necessary).

Environment variables that should be resolved from remote secret storage sources follow a given pattern for each source type (see `src/secretenv/resolvers/<provider>.ts` for patterns). If any environment variables match these patterns, secretenv will attempt to resolve them from their respective providers, and replace them in the environment with their resolved values.

The `resolveEnv` function presumes that valid credentials for the target provider are available. If they are not, it will throw authentication errors.

secretenv will throw errors if:

- No authentication is present for a provider
- Credentials do not have permissions to access the secret resource from the provider
- The secret resource does not exist

secretenv will not throw errors if:

- The value of the resolved secret is `undefined` or an empty string

### GCP Secrets

GCP secrets should be referenced by this pattern:

```javascript
/^gcp-secrets:\/\/projects\/(?<gcp_project>[^/]+)\/secrets\/(?<secret_name>[^/]+)\/versions\/(?<version>[^/]+)$/
```

### AWS SSM Parameter Store

AWS SSM Parameters should be referenced by this pattern:

```javascript
/^aws-ssm:\/\/arn:aws:ssm:(?<region>[^/]+):(?<account_id>[^/]+):parameter\/(?<parameter_id>[^:]+)(?<encrypted>:encrypted)?$/
```

The `:encrypted` suffix specifies whether the SSM Parameter is KMS encrypted or not.

### AWS Secrets Manager

AWS Secrets Manager SecretStrings should be referenced by this pattern:

```javascript
/^aws-secrets:\/\/arn:aws:secretsmanager:(?<region>[^/]+):(?<account_id>[^/]+):secret:(?<secret_id>[a-zA-Z0-9/_+=.@-]+)(?<stage>:stage:(?<version_stage>[a-zA-Z0-9]+))?(?<version>:version:(?<version_id>[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}))?$/
```

*Only AWS Secrets of type `SecretString` are supported.
npm package: @imaware/simple-hl7
Description: simple library for creating and parsing hl7 messages
Author: Bob Rupp
Latest version: 2.1.2

# simple-hl7
![Image Build Status](https://travis-ci.org/hitgeek/simple-hl7.svg?branch=master)

A simple library for creating HL7 middleware, based on connect & express.


```js
var hl7 = require('simple-hl7');

///////////////////SERVER/////////////////////
var app = hl7.tcp();

app.use(function(req, res, next) {
  //req.msg is the HL7 message
  console.log('******message received*****')
  console.log(req.msg.log());
  next();
})

app.use(function(req, res, next){
  //res.ack is the ACK
  //acks are created automatically

  //send the res.ack back
  console.log('******sending ack*****')
  res.end()
})

app.use(function(err, req, res, next) {
  //error handler
  //standard error middleware would be
  console.log('******ERROR*****')
  console.log(err);
  var msa = res.ack.getSegment('MSA');
  msa.setField(1, 'AR');
  res.ack.addSegment('ERR', err.message);
  res.end();
});

//Listen on port 7777
app.start(7777);
///////////////////SERVER/////////////////////

///////////////////CLIENT/////////////////////
var client = hl7.Server.createTcpClient('localhost', 7777);

//create a message
var msg = new hl7.Message(
                    "EPIC",
                    "EPICADT",
                    "SMS",
                    "199912271408",
                    "CHARRIS",
                    ["ADT", "A04"], //This field has 2 components
                    "1817457",
                    "D",
                    "2.5"
                );

console.log('******sending message*****')
client.send(msg, function(err, ack) {
  console.log('******ack received*****')
  console.log(ack.log());
});
///////////////////CLIENT/////////////////////
```

## Installation

```bash
$ npm install simple-hl7
```

## Features

  * Parser
  * Message Builder/Editor API
  * Server/Client components for TCP and File System Based Interfaces

## Philosophy
Make HL7 interfaces and middleware as easy as express web servers.

## Examples
See examples & tests folder on github.

## People
Author: Bob Rupp bob@rupp.io

## License
MIT
npm package: @imaware/ts-fhir-types
Description: Typescript / Javascript object model for FHIR standard Model follows FHIR R4 specifications.
Latest version: 1.1.0


# typescript-fhir-types

Typescript / Javascript object model for FHIR standard
Model follows FHIR R4 specifications.

Definitions are io-ts based interfaces. See [io-ts github project](https://github.com/gcanti/io-ts) for further details. This means you can check your types at runtime.
  
## Installation

```bash
npm i -S @imaware/ts-fhir-types
```

or

```bash
yarn install @imaware/ts-fhir-types
```

## articles

[A medium article: Handle FHIR objects with Typescript](https://medium.com/@imaware.gb/handle-fhir-objects-in-typescript-and-javascript-7110f5a0686f)

## Examples

let imagine you server or your application is receiving a FHIR Resource like an observation from a server or any external system

```json

{
   "resourceType":"Observation",
   "id":"f001",
   "text":{
      "status":"generated"
   },
   "identifier":[
      {
         "use":"official",
         "system":"http://www.bmc.nl/zorgportal/identifiers/observations",
         "value":"6323"
      }
   ],
   "status":"final",
   "code":{
      "coding":[
         {
            "system":"http://loinc.org",
            "code":"15074-8",
            "display":"Glucose [Moles/volume] in Blood"
         }
      ]
   },
   "subject":{
      "reference":"Patient/f001",
      "display":"P. van de Heuvel"
   },
   "valueQuantity":{
      "value":6.3,
      "unit":"mmol/l",
      "system":"http://unitsofmeasure.org",
      "code":"mmol/L"
   },
   "interpretation":[
      {
         "coding":[
            {
               "system":"http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation",
               "code":"H",
               "display":"High"
            }
         ]
      }
   ],
   "referenceRange":[
      {
         "low":{
            "value":3.1,
            "unit":"mmol/l",
            "system":"http://unitsofmeasure.org",
            "code":"mmol/L"
         },
         "high":{
            "value":6.2,
            "unit":"mmol/l",
            "system":"http://unitsofmeasure.org",
            "code":"mmol/L"
         }
      }
   ]
}
```

There is 2 points:

* You would like to have strongly typed types (__typescript__)
* You would validate data returned from server and test their validity against FHIR standard
  
```javascript
// Import requested objects
import { R4 } from  '@imaware/ts-fhir-types';
import * as E from "fp-ts/lib/Either";

// validation succeeded
const  validationResult = R4.RTTI_Observation.decode(/*json response*/) // => Right if good, Left if not
const  obs: R4.IObservation = E.isRight(validationResult);
```

FHIR resources are also provided as interface, so you can inherit and implement your own object implementation.

Please don't hesitate to give me advice and feedback !