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

prescriber-tisaudev2

v1.0.7

Published

## Sobre a integração

Downloads

25

Readme

Receituário digital Ti.saúde

Sobre a integração

O objetivo desse SDK é disponibilizar uma API para permitir a integração do Receituário digital da ti.saúde em outros softwares médicos que desejem incorporar o receituário.

A integração é feita atráves de um sdk construído em Typescript, que pode ser instalado em qualquer front-end atráves de cdn ou adicionando o pacote via yarn/npm.

Para conseguir se integrar é necessário obter um keyId de acesso a funcionalidade e o JWT do usuário que vai utilizar o prescritor, que pode ser obtida através de API.

  • proteja sua keyId, armazene em uma local seguro.

Para obter o keyId entre contato com o nosso suporte https://api.whatsapp.com/send?phone=558141011751&text=Olá,preciso%20de%20acessso%20ao%20SDK%20do%20prescritor.

Compatibilidade

O sdk é compatível com os seguintes navegadores.

Chrome >=87 Firefox >=78 Safari >=14 Edge >=88

Ambiente de dev

  • API DEV: https://api.dev.cloud.tisaude.com/
  • API PROD: https://api.tisaude.com/
  • SDK CDN: https://frontend-js.s3.amazonaws.com/prescriber-sdk/prescriber-tisaudev2.umd.js
  • SDK package yarn/npm: *https://www.npmjs.com/package/prescriber-tisaudev2

Instalação do pacote

yarn

yarn  add  prescriber-tisaudev2

npm

npm install  prescriber-tisaudev2

ou

cdn

<script  src="https://frontend-js.s3.amazonaws.com/prescriber-sdk/prescriber-tisaudev2.umd.js">
</script>

build do pacote

build


//build cdn package
yarn build:cdn

//build npm/yarn package
yarn build:pkg:

installar local

yarn add prescriber-tisaudev2@file:/home/${USER}/prescriptor-tisaudev2
yarn add prescriber-tisaudev2@file:/home/diogo/Documentos/projetos-tisaude/prescritor/prescriber-sdk

Obtendo JWT do usuário

Neste endpoint vai retornar o jwt do usuário logado

curl --request POST \
  --url https://api.dev.cloud.tisaude.com/api/login \
  --header 'Content-Type: application/json' \
  --data '{
	"login": "meuusuario",
	"senha": "usuarioSenha123#"
}' | jq .access_token

deverá retornar algo semelhante a este token:

eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvYXBpLmRldi5jbG91ZC50aXNhdWRlLmNvbSIsImlhdCI6MTY5NTczNzI5NiwiZXhwIjoxNjk4MzI5Mjk2LCJuYmYiOjE2OTU3MzcyOTYsImp0aSI6IldZdGxCWktxcjJGZVd6REEiLCJzdWIiOjc5NTAsInBydiI6IjU4NzA4NjNkNGE2MmQ3OTE0NDNmYWY5MzZmYzM2ODAzMWQxMTBjNGYifQ.GqGNAsdtksCDgYMxZmVZ_5CAyGjuFoWTRlLnMJCNleM

Configurando o pacote

Instalação via cdn

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta  charset="UTF-8">
		<meta  name="viewport"  content="width=device-width, initial-scale=1.0">
		<title>Prescritor cdn</title>
	</head>
<body>
	<div  id="prescriptor"  class="col-12"></div>
	<script  src="https://frontend-js.s3.amazonaws.com/prescriber-sdk/prescriber-tisaudev2.umd.js">
	</script>
	<script>
		const  Prescriber  =  window['prescriptor-tisaudev2'];

		this.prescriptor  =  new  Prescriber.Prescriber({
					element: "prescriptor",
					height: "70vh",
					keyId: ${keyId},
					token: ${access_token}
				});

		this.prescriptor.loadPrescriber().handlerEvents();

		const  APP  =  this;

		this.prescriptor.on(Prescriber.EVENTS.EVENT_PRESCRIBER_LOADED, () => {
				APP.prescriptor.auth().setColor({
					primary: 'red'
				});
		});
	</script>
</body>
</html>

Instalação via pacote yarn/npm este exemplo foi feito com vue mas se aplica a qualquer outro framework/lib

<template>
	<div class="row">
		<div  id="prescriptor"  class="col-12"></div>
	</div>
</template>
<script>
import { EVENTS, FEATURES, Prescriber } from  "prescriber-tisaudev2";
import { mapState } from  "vuex";

export  default {
	name: "Prescritor",
	data() {
		return {
			prescriptor: null
		};
	},
	mounted() {
		this.prescriptor  =  new  Prescriber({
					element: "prescriptor",
					height: "70vh",
					keyId: ${keyId},
					token: ${access_token}
				});

		this.prescriptor.loadPrescriber().handlerEvents();

		const  APP  =  this;

		this.prescriptor.on(EVENTS.EVENT_PRESCRIBER_LOADED, () => {
				APP.prescriptor.auth().setColor({
					primary: 'red'
				});
		});

	}

};
</script>

APIS DO SDK

  • Prescriber | Class:
    Cria a instância do prescritor argumentos:
{
	element: string;
	height: string | null;
	token?: string;
	keyId?: string;
};
  • Methods | Functions: apis disponíveis para interagir com o componente
	loadPrescriber(): Prescriber;
	setPatient(data: Patient): void;
	setTools(tools: Array<string>): Prescriber;
	auth(): Prescriber;
	setColor(colors: IColor): Prescriber;
	removePatient(): Prescriber;
	handlerEvents(): Prescriber;
	on(handler: string, callback: (data?: unknown) =>  void): Prescriber;
  • Events | const: permite a escuta de eventos do prescritor
EVENT_PATIENT_FORM
EVENT_PATIENT_FORM_REMOVE
EVENT_PATIENT_SAVED
	{
		id: 12312
		exemplo: "exemplo"
	}
EVENT_THEME_COLOR
EVENT_PRESCRIBER_LOADED
EVENT_PRESCRIBER_FORM_LOADED
EVENT_AUTH_LOAD
EVENT_CORE_TOOLS
EVENT_MEDICATION_PRESCRIPTION_SAVED
	{
		exemplo: "string"
	}
EVENT_MEDICATION_PRESCRIPTION_EMITED
EVENT_GENERATED_SIGNED_PDF_MEDICATION_PRESCRIPTION
  • Functions | const: permite a ativação/desativação de componentes/funcionalidades do prescritor
FUNC_PRESCRIBER_MEDICATION
 - Prescrição de medicamentos
FUNC_PRESCRIPTION_HISTORIC
 - Mostra o histórico de prescrição
FUNC_PRESCRIPTION_MODEL
 - Salva modelos de prescrição
 - Mostra os modelos de prescrição salvos
FUNC_IMPUT_OUTLINED
 - Formulários de prescrições do tipo outlined
# FUNC_PATIENT_DATA
# FUNC_PATIENT_ALLERGIES
# FUNC_PATIENT_MEDICATIONSINUSE