0.0.17 • Published 1 year ago

@iwanglang/observation-visual-acuity v0.0.17

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

IWangLang: Observation Visual Acuity

🚀 Quick Start

Install:

# npm
npm i @iwanglang/observation-visual-acuity

# yarn
yarn add @iwanglang/observation-visual-acuity

Import:

// ESM / Typescript
import { ObservationVisualAcuity } from "@iwanglang/observation-visual-acuity";

// CommonJS
const {
  ObservationVisualAcuity,
} = require("@iwanglang/observation-visual-acuity");

🥸 Get Snellen Scale for create Chart

import { ObservationVisualAcuity } from "@iwanglang/observation-visual-acuity";

const visualAcuity = new ObservationVisualAcuity();
const snellenChartScaleFoot = visualAcuity.getSnellenChartScales("foot");
const snellenChartScaleMetre = visualAcuity.getSnellenChartScales("metre");

console.log(snellenChartScaleFoot[0]);
// { "display": "20/200", "numerator": 20, "denominator": 200, "LogMAR": 1.00 }

console.log(snellenChartScaleMetre[0]);
// { "display": "6/60", "numerator": 6, "denominator": 60, "LogMAR": 1.00 }

use getSnellenChartScales function to get list of snellen scales for prepare data of Visual Acuity that will save into server

Example for Snellen Chart

FootMetreLogMAR
20/2006/601.00
20/1606/480.90
20/1256/380.80
20/1006/300.70
20/806/240.60
20/636/180.50
20/506/150.40
20/406/120.30
20/326/9.50.20
20/256/7.50.10
20/206/60.00
20/166/4.8−0.10
20/12.56/3.8−0.20
20/106/3−0.30

🥸 Convert Snellen to LogMAR

import { ObservationVisualAcuity } from "@iwanglang/observation-visual-acuity";

const visualAcuity = new ObservationVisualAcuity();
const snellenChartScaleMetre = visualAcuity.getSnellenChartScales("metre");

console.log(snellenChartScaleMetre[0]);
// { "display": "6/60", "numerator": 6, "denominator": 60, "LogMAR": 1.00 }

// LogMAR VA = 0.1 + LogMAR value of the best line read – 0.02 X (number of optotypes read)
// default optotypesRead is -2
console.log(`LogMAR is ${visualAcuity.convertSnellenToLogMAR(snellenChartScaleMetre[0].numerator, snellenChartScaleMetre[0].denominator)}`);
// LogMAR is 1

🥸 Create Visual Acuity to Fhir Server

import { ObservationVisualAcuity, SnomedCodeBodySite } from "@iwanglang/observation-visual-acuity";

const visualAcuity = new ObservationVisualAcuity('https://hapi.fhir.org/baseR4');

// Set Authorization for Fhir Server that require authentication
visualAcuity.setToken('Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c');

// Create VisualAcuity value 0.60 LogMAR with bodySite left eye structure to Fhir Server
visualAcuity.createLogMARVisualAcuity('Patient/1', SnomedCodeBodySite.LeftEyeStructure, 0.60);
0.0.12

1 year ago

0.0.13

1 year ago

0.0.14

1 year ago

0.0.15

1 year ago

0.0.16

1 year ago

0.0.17

1 year ago

0.0.10

1 year ago

0.0.11

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.3

1 year ago