DHIS2 Core Nepali Calendar B.S settings and analytics execute and run

Dear DHIS2 Development Team,
I’m currently working with the DHIS2 core Java code for Amakomaya and encountering compatibility across versions, which have been discussed in past threads.

Issue Summary:
I encountered an error while setting up the DHIS2 core application with the Nepali calendar configuration.

Development setup
Code: GitHub - dhis2/dhis2-core: DHIS 2 Core. Written in Java. Contains the service layer and Web API.
Branch: Master(2.42-SNAPSHOT) or patch/2.41.1

Step to Reproduce Error:
1.Fetch code
2. Build using → ./dhis-2/build-dev.sh
3. docker compose up
Open browser → http://127.0.0.1:8080/
4. Change settings to nepali Calendar
5. Resource table run or analytics run
Observed Issue:
- Cannot load from int array because the return value of “java.util.Map.get(Object)” is null
- skipped stage. 0 successful and 1 failed items

Screenshot :

Log File:

nepalicalender-log.doc (26.7 KB)

Following @rcpoudel recommendation, I encountered a null pointer exception while generating PeriodType.java, DatePeriodResourceTable.java. The main challenges include generating resource tables and storing Nepali dates in the enrollment, incident, and report date fields within the database. Amakomaya has emphasized that the solution should be permanent and directly integrated into the core code. Any guidance on implementing this effectively and resolving the null pointer exception would be greatly appreciated!

Hi @rabin

Modifying the core code has quite a number of challenges that will cause issues with updates/upgrades and isn’t the recommended approach. However, the better option instead of modifying the core code is building an app.

That being said please know that the DHIS2 core team are working on calendar support for Nepali dates:

Dear @Gassim,

Our team at Amakomaya has been investigating a NullPointerException issue found in the core DHIS2 code, specifically in the NepaliCalendar.java file. We’ve identified some challenges related to date mapping that are affecting our implementation.

Key Findings:

  • NullPointerException: This issue arises in the mapping function of the calendar, particularly related to the date handling for the year 2080. We have a mapping for 100 years, but discrepancies in this mapping are causing errors.
  • Current Mapping:

java

Copy code

CONVERSION_MAP.put(2081, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31});
CONVERSION_MAP.put(2082, new int[] {0, 31, 31, 32, 32, 31, 30, 30, 30, 29, 30, 30, 30});
  • Suggested Change:

java

Copy code

CONVERSION_MAP.put(2081, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31});
CONVERSION_MAP.put(2082, new int[] {0, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31});

Background:

We have thoroughly set up our environment, following the documentation to meet all Java and Tomcat requirements. The system works well with ISO 8601 (AD English calendar) configurations. However, our findings reveal inconsistencies when dealing with the Nepali calendar.

Please check also on the following video :

We have consulted additional resources to cross-verify the calendar mappings:

These resources indicate unpredictable behavior in the Nepali calendar, suggesting potential further issues in date mapping and storage within our date datatype.

Next Steps:

While we do not face any issues with the frontend code, the backend problems in the mapping function hinder our progress. We will continue checking the Java code for additional issues and plan to merge any fixes into our master branch of the DHIS2 core once we find a viable solution.

Hi @rabin

Thank you for sharing all this. The best approach I could suggest is if you’re creating a pull request in the repository, the platform team will reply with their feedback. It’d be greatly appreciated if you share both the PR and if there’s any update here.

Thanks!