Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Avni Integration Service:

Code Changes made on top of Avni Integration service can be seen from this link: https://github.com/avniproject/integration-service/compare/main...Bahmni-HWC:integration-service:main

Feature / Domain

Current Behaviour in Bahmni HWC

Code Change / Config Change

How should this be on product

Comments

Address Hierarchy

State --> District --> SubDistrict --> City/Village hierarchy is used in Avni and catchements are defined with villages.

StateProvince --> CountryDistrict --> Address4 --> CityVillage hierachy is setup

List of states, districts, subdistricts, villages to be synced from avni to bahmni should be defined in environment variables

Needs code change to make it generic

Use Bahmni as base

Maintain a metadata mapping for individual address fields

Multiple address (current/permanent) is possible for a patient/subject both on Bahmni and Avni side

Code reference on where the address hierarchy is harcoded:

https://github.com/Bahmni-HWC/integration-service/blob/main/bahmni/src/main/java/org/avni_integration_service/bahmni/service/PatientService.java#L110

https://github.com/Bahmni-HWC/integration-service/blob/main/bahmni/src/main/java/org/avni_integration_service/bahmni/service/SubjectService.java#L120

Location and Catchments

Locations and catchments are created in Bahmni and Avni with config

Mapping to be added with Catchemnt name and location uuid

Note: Catchemnts should be defined in a way that the subjects will be assigned to a single catchement

Config change

Documentation on creating catchments and mapping to locations

Q to Avni:
Is there a possibility for multiple catchements for a user ?

How to allow address outside of catchment for registration ?

Identifiers

Preferred Identifier between Bahmni and Avni

Bahmni identifier is advanced to start from 500000
In avni, identifiers are pre-allocated to individual users

Bahmni identifier UUID to be added in mapping and as well as constants table for key IntegrationBahmniIdentifierType

Can we use a different identifier prefix for identifiers in Avni ?

Documentation on assigning identifiers to avni users

Needs some more investigation

Additional Identifiers (RCH ID, NIKSHAY ID, ABHA Number, ABHA Address)

In Avni added as Concepts and added to Registration Second page
In Bahmni added from config

UUID and concept names are hardcoded in code

Needs code change

Allow implementers to define mappings for additional identifiers to be synced

Note: Update of identifiers from both ways should be developed

https://github.com/Bahmni-HWC/integration-service/blob/main/bahmni/src/main/java/org/avni_integration_service/bahmni/service/SubjectService.java#L120

https://github.com/Bahmni-HWC/integration-service/blob/main/bahmni/src/main/java/org/avni_integration_service/bahmni/service/PatientService.java#L155

Person Attributes

father/mother name, phoneNumber

In Bahmni added via config, in avni added as concept and in second registration page details

UUID comes from mapping, whereas Avni concept name is hardcoded in code

Needs code change

Person attributes should be dynamically synced based on the list of mapping defined in mappings

Note: Update of identifiers from both ways should be developed

https://github.com/Bahmni-HWC/integration-service/blob/main/bahmni/src/main/java/org/avni_integration_service/bahmni/service/PatientService.java#L155

https://github.com/Bahmni-HWC/integration-service/blob/main/bahmni/src/main/java/org/avni_integration_service/bahmni/service/SubjectService.java#L176

Gender mapping
Bahmni allows config, in avni only Male, Female, Others is possible
So, male -> male , female -> female and rest other gender types in Bahmni maps to Other in Avni

-

Should be okay.

https://github.com/Bahmni-HWC/integration-service/blob/main/bahmni/src/main/java/org/avni_integration_service/bahmni/service/SubjectService.java#L30

Avni User --> Bahmni Provider

Currently different user base for Avni and Bahmni

For any user created in avni, provider to be added in Bahmni and mapping for avni username and Bahmni provider uuid to be defined in mappings

Config change

Default provider with name offline sync will be used if mapping for a user is not defined

Documentation on creating users in Avni , providers in Bahmni and defining mappings

Visits

Visit type: Community Visit created via config in Bahmni with a fixed UUID and needs to added to Constants table

Config change, update value in Constant table of IntegrationBahmniVisitType

Should be okay to have a single visit type

Visits creation: Integration check for visit in a given day, if yes adds encounter to the same or creates a new visit, adds encounter and closes visit

Sync of Consultation information from Avni to Bahmni

Whenever a form is filled in Avni, it syncs as new encounter to Bahmni.
Mapping for the individual form element to be addded.
A concept set to be created for each form which contain all the individual concepts of the form.
An encounter type is needed which is created from Bahmni config and added the UUID in mapping

Currently Vitals , History and Examination, Referral are synced

Config Change

Currently works for text, numeric, coded based concepts and concept group members with a single hierarchy

Documentation on how to configure new forms in Avni and define mappings in integration service

Need to implement forms-2 based approach.

Sync of Prescriptions from Bahmni to Avni

Drug orders from Bahmni are added as bulleted list to Avni.

A form to be added with a text concept

Configuration

Documentation

https://github.com/Bahmni-HWC/integration-service/blob/main/bahmni/src/main/java/org/avni_integration_service/bahmni/worker/bahmni/atomfeedworker/PatientEncounterEventWorker.java#L131

Sync of Diagnosis from Bahmni to Avni

Encounters with dignoses answers filled from Bahmni are added as bulleted list to Avni.

A form to be added with a text concept

Configuration

Documentation

https://github.com/Bahmni-HWC/integration-service/blob/main/bahmni/src/main/java/org/avni_integration_service/bahmni/worker/bahmni/atomfeedworker/PatientEncounterEventWorker.java#L116

Sync of Bahmni Forms to Avni

A mapping to be defined for the form name in Bahmni to the form in Avni . The concepts to be mapped in mapping service. The form in Avni to be made readonly by access privileges

Configuration.

Supports only simple concepts sync. Would need code change for complex concepts

ABHA Offline

ABHA Module captures Aadhaar and demographics information, and when aadhar number is found in patient registration details call hip demographic api and creates abha and patches subject's identifier

Not needed for product, needed for Bahmni indiadistro and applicable only to government integrators

Enable this with a configuration (based on environment variable)

https://github.com/Bahmni-HWC/integration-service/blob/main/bahmni/src/main/java/org/avni_integration_service/bahmni/worker/avni/SubjectWorker.java#L92

Sync of Medication Dispense from Avni

Medication items are created as concepts in Avni with the same UUID. When Dispense Medication form is filled, the concept UUID is used as item UUID and Stock Distribution Inventory operation API is called from integration service

Code Change

May not be required for product. Uses openhmis inventory module APIs.

https://github.com/Bahmni-HWC/integration-service/blob/main/bahmni/src/main/java/org/avni_integration_service/bahmni/worker/avni/GeneralEncounterWorker.java#L128

  • No labels