TypeError Issue During Metadata Import on DHIS2

Hi DHIS2 Support Team,

I am encountering an issue while attempting to import metadata for the HIV Case Surveillance program into our DHIS2 instance (version: 2.38).

Problem Description:

  • I tested the import of my JSON metadata file for the HIV Case Surveillance program in “Test” mode, and no errors were reported.
  • However, when I try to initiate the actual import, I receive the following error:
    TypeError: Cannot read properties of undefined (reading 'imported')
    
  • This error appears in the user interface, even though the test import completed successfully without any conflicts or errors.

Actions Already Taken:

  1. Cleared the browser cache and tried using a different browser.
  2. Checked compatibility between the DHIS2 version and the metadata JSON file.
    Could you please advise on steps to resolve this error or suggest any additional checks I should perform?

Thank you in advance for your assistance. I am available to provide further information if needed.

Best regards,

Importation erreur
Import vih

Hi @elmoujarrade. I don’t know if you are able to share the json (in order to see in detail). Do you have optionSets in the metadata? Could you review the sort of the options?

2 Likes

Hi @ctejo ,

Thank you for your help and previous advice. As mentioned, I reviewed the OptionSets and other elements of the metadata. I’m sharing the complete JSON file so you can take a closer look and help me identify any potential issues.
https://packages.dhis2.org/en/HIV_CS/1.0.0/DHIS2.38/HIV_CS_1.0.0_DHIS2.38.zip

Please let me know if you find anything that needs adjustments or modifications.

Thanks again for your support!

Best regards,
HIV_CS_COMPLETE_1.0.0_DHIS2.38.json (901.5 KB)

Hi @elmoujarrade ,

Sorry to hear youre having issues.

Can you confirm that youve seen the HIV CS installation guide and taken all necessary steps?

When importing a package into an existing instance, there are some changes to the metadata file that need to be done manually. For example, the UID of the default category combination is not the same across all dhis2 instances; if you import a package with a different default catcombo UID, you will get an error.

The same should be done for Tracked Entity Type and Indicator Type

This is usually not an issue with importing into a blank instance.

2 Likes

Hi @brian ,

Thank you for your support and guidance. I wanted to inform you that I am starting to develop the HIV Case Surveillance program from scratch on my DHIS2 instance (version 2.38). I am aiming to implement the components of the Package version 2.0.1.

To facilitate this setup, I would like to ask if there is any possibility of accessing a demo version with full access to the metadata and configuration settings for this package. Having a demo reference would greatly help in implementing it accurately on my instance.

Thank you again for your assistance!

Best regards,

We have not released a version 2.0.1 of the HIV CS package that is compatible with DHIS2 version 2.38. We also don’t have a demo of this system available on 2.38.

I can however suggest the following:

  • Download the 2.0.1 package. Within the zip file, you will find a excel sheet with a “flat file” of the metadata. This is not an installable file, but rather lists all metadata objects of the package (data elements, indicators, program rules, etc) in different tabs to give an overview of its contents.
  • The HIV CS 2.0.1 metadata is available on the hmis demo . If you log in as a demo user, you will be able to view the program in Capture and dashboards. To view the metadata in more detail, I recommend you use the API, for example: DHIS 2 gives you the parameters for the HIV CS program.
  • Lastly, you may want to download the metadata for 2.40 and install it in a blank version 40 local instance, to explore the metadata with the maintenance app. For that, please see again the Installation guide.
1 Like

Hi @brian ,

Thank you for your response and suggestions. I followed the option you proposed, specifically downloading the metadata for version 2.40 and installing it in a local blank instance of version 40 to explore the metadata with the maintenance app. This is working perfectly, and I’ve been able to view the metadata in detail. I am now in the process of adapting the model to our context.

I do have a few questions regarding the model, particularly about the “Visit” stage. I’m curious why, under “patient status,” the options include “Death” or “lost to follow-up,” even though the stage is “Visit,” which implies an actual encounter with the patient. Could you explain the logic behind these options?

Thanks again for your support!

Best regards,

Hi @elmoujarrade ,

Glad to hear you are able to view the metadata now!

For design clarification, I really recommend you also explore the toolkit System Design Guide, which describes such decisions in detail.

To your question, the repeatable “Visit” Stage is the main stage that collects all longitudinal data required on patient services and patient status in the same place. It is very important for calculating the core program indicators to keep those data elements within the same stage.
.

As described in this section of the guide, when the patient is reported as PLHIV in a visit stage, program rules also open up other sections related to service provision; if the patient has died or is LTFU, then those are hidden.

The follow up stage is to document facility attempts at outreach (like phone calls) if the patient is LTFU, rather than to document patient status or visits.

1 Like

Hi @brian ,

Thank you for the clarification and for recommending the System Design Guide. After reviewing your explanation, the logic behind the design is much clearer now, especially the importance of keeping all core program indicators in the same ‘Visit’ stage for longitudinal data collection. I also appreciate the detailed breakdown of how program rules manage visibility based on patient status.

Thanks again for the guidance; it’s been really helpful!

1 Like