iCure. eHealth Solutions
  • Developer Documentation
  • iCure Software Modules
  • Get Started
    • Create your own Database
      • Receive an invitation
      • Create new User
      • Create a new Healthcare Party
    • Structure your Database
    • Access your database
    • Use the Console
  • Data Stack Module
    • The Data Stack
      • Install iCure
      • Get Started with a Database
    • iCure Data Model
      • Overview
      • User
        • Permission
      • Healthcare Party
      • Patient
        • Insurability
        • Relationship
        • Patient Hcp care period
          • Referral period
      • Contact
        • Service
          • Content
            • Medication
              • Regimen item
            • Measure
        • SubContact
      • Healthcare Element
        • Care team member
        • Healthcare approach
      • Form
      • Additional Classes
        • AccessLog
        • Address
          • Telecom
        • Message
        • Document
        • FilterChain
          • Filter
          • Predicate
        • Group
        • Insurance
        • Invoice
          • Invoicing code
        • Tarification
          • Valorisation
    • Hybrid Cloud Storage
    • Mobile/Web SDKs
      • JavaScript/Typescript
        • Setting up your environment
        • Logging in
        • Managing patients
        • iCure for MedTech: Getting Started
          • Exchange data using FHIR model
          • Exchange data using iCure SDK
      • Java/Kotlin
      • Swift/Objective C
    • REST API calls
      • User
      • Patient
      • HealthcareParty
      • Contact
      • HealthcareElement
      • Form
      • Document
      • Message
      • Invoice
      • Additional endpoints
        • AccessLog
        • Authentication
        • Codification
        • Document template
        • Entity reference
        • Entity template
        • Insurance
        • Receipt
        • Tarification
    • Access Rights management
    • End-to-End-Encryption
    • ATNA Audit Records
  • Interoperability Module
    • IHE XDS calls
      • The XDS Concept
      • ITI-18 get associations api call
      • ITI-41 provide and register document set api call
      • Iti-42 register document set api call
    • IHE IPS call
      • The IPS Concept
    • FHIR API Data Exchange
      • The FHIR Concept
    • Freehealth Connector 🇧🇪
    • Encrypted Data Exchange
      • Internal
      • External
  • Customizable Features Module
    • Input Forms
    • Medical Records
    • Data Dashboards
    • Custom Connectors
    • Secure Log-in App
  • Support
    • Download
    • Contact Us
  • Advanced topics
    • Healthcare Data
      • Business intelligence
      • Anonymized Data
    • Encryption Key Creation and Storage
    • Multi-Master database replication
    • Cross Databases Sharing
    • Complex queries
Powered by GitBook
On this page

Was this helpful?

  1. Data Stack Module
  2. The Data Stack

Get Started with a Database

PreviousInstall iCureNextiCure Data Model

Last updated 3 years ago

Was this helpful?

iCure Data Stack helps developers create connected apps for healthcare in no time. Let's give it a quick try by creating a node application that lets you store and access encrypted patients in a cloud data store.

First head to and create a database and a user. You will need the username and password below.

and are needed for this example.

mkdir patient-manager
cd patient-manager
yarn init -y
yarn add @icure/api

#if you are using node two other dependencies are needed
yarn add node-fetch node-localstorage

The @icure/apiis the JS library used to simplify access to the iCure application server and to abstract the complexity of the cryptographic layer.

Node 15 is required because it includes the crypto compatibility layer

Now create a file name index.mjs

How to use
import {Api, hex2ua, Patient} from '@icure/api'
import {crypto} from '@icure/api/node-compat.js'

const host = 'https://kraken.icure.dev/rest/v1';
const {
	patientApi,
	userApi,
	healthcarePartyApi,
	cryptoApi
} = Api(host, 'esmith', 'mypassword', crypto)

const loggedUser = await userApi.getCurrentUser();
const loggedHcp = await healthcarePartyApi.getCurrentHealthcareParty()

await cryptoApi.loadKeyPairsAsTextInBrowserLocalStorage(
	loggedUser.healthcarePartyId,
	hex2ua("308204bc02...473a613059")
)

const patient = await patientApi.createPatientWithUser(loggedUser,
	await patientApi.newInstance(
		loggedUser,
		new Patient({
			firstName: 'Gustave',
			lastName: 'Eiffel',
			profession: 'Architect & Engineer',
			dateOfBirth: 19731012,
			note: 'A very private information'
		}))
)
const fetchedPatient = await patientApi.getPatientWithUser(loggedUser, patient.id)
console.log(JSON.stringify(fetchedPatient, null, ' '))

Replace 'demo' / 'demo' by your username and password. If you are writing code for the browser, omit to importcrypto and callApiwith just 3 arguments.

$ node index.mjs

Register on our cloud platform
Node 15
Yarn