New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dhis2-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dhis2-wrapper

DHIS2 API wrapper

  • 0.2.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

DHIS2-API-Wrapper

Javascript API wrapper around DHIS2. It handles authentication automatically given user credentials.

Installation

This package is not currently in the npm ecosystem, so in order to install it in a project, it should be added as a git repository.

  {
    "dependencies": {
      "dhis2-api-wrapper": "git+ssh://git@github.com/WISCENTD-UPC/dhis2-api-wrapper.git#develop"
    }
  }

After configuring the package.json npm install should be executed

Usage

Creation of the api wrapper:

  const API = require('dhis2-api-wrapper')
  const api = new API({
    baseURL: '',
    credentials: {
      user: 'username',
      password: 'password'
    },
    debug: true // Log requests
  })

API Doc

  • api.getResources(): Get a list of all the resources avaliable.

  • api.resourcesSummary(): Print a list with all the resources avaliable and their URLs.

  • api.getOrganisationUnits(): Get all organisation units.

  • api.getOrganisationUnit(id): Get additional information of an organisation unit given its ID.

  • api.getOrganisationUnitsFromParent(id): Get an organisation unit by its ID and all its descendants.

  • api.getTrackedEntityTypes(): Get the different types of tracked entities defined.

  • api.getTrackedEntityInstances(organisationUnitID, filters = {}): Get tracked entity instances asociated with an organisation unit. Additional query filters can be added, if needed, as a second argument

  • api.getTrackedEntityInstance(id): Get additional information of a tracked entity instance.

  • api.getTrackedEntitiesAttributes(): Get all attributes defined for tracked entity instances.

  • api.getEventsReports(): Get events reports

  • api.programsSummary(): Print a list with all avaliable programs and their URLs.

  • api.getPrograms(): Get all the programs

  • api.getProgram(id): Get additional information of a program given its ID.

  • api.getProgramStages(): Get all program stages

  • api.getProgramStage(id): Get additional information of a program stage given its ID

  • api.getProgramIndicator(id): Get additional information of a program indeicator given its ID

  • api.getTrackedEntityEvents(id): Get events of a tracked entity instance given its ID.

  • api.getDataElements(): Get all data elements avaliable.

Testing

npm test

FAQs

Package last updated on 12 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc