Data Export to DHIS in iHRIS F.A.S.T: Difference between revisions

From IHRIS Wiki
No edit summary
No edit summary
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Exporting The Data ==
== Exporting The Data ==


The home page of iHRIS F.A.S.T. has a new menu item "Data Export" to handle data export to the Dean's Dashboard/DHIS2. [[Image:Index.png|center]]  
The home page of iHRIS F.A.S.T. has a new menu item "Data Export" to handle data export to the Dean's Dashboard/DHIS2. [[Image:Index.png|center|Index.png]]  


Clicking on this link will take you to a page showing all of the available data exports. [[Image:Menu.png|center]]  
Clicking on this link will take you to a page showing all of the available data exports. [[Image:Menu.png|center|Menu.png]]  


Clicking on one of the data exports will take you to a page where the data is posted to DHIS2 and the response is shown. [[Image:Response.png|center]]  
Clicking on one of the data exports will take you to a page where the data is posted to DHIS2 and the response is shown. [[Image:Response.png|center|Response.png]]  


== Linking The Data ==
== Linking The Data ==


The data in iHRIS F.A.S.T. and DHIS2 need to be linked together in order to successfully share information.  
The data in iHRIS F.A.S.T. and DHIS2 need to be linked together in order to successfully share information.  


=== Training Program ===
=== Training Program ===


Each member of the Training Program database list should be linked to the DHIS2 data element as follows:
Each member of the Training Program database list should be linked to the DHIS2 data element as follows: [[Image:Training program.png|center|Training program.png]]  
[[Image:Training program.png|center]]  


=== Student Status ===
=== Student Status ===
Each member of the Student Status database list should be linked to the DHIS2 data element as follows:
[[Image:Student status.png|center]]


== DHIS2 Source Data ==
Each member of the Student Status database list should be linked to the DHIS2 data element as follows: [[Image:Student status.png|center|Student status.png]]  
The DHIS2 metadata on organisational units and data elements has been imported into iHRIS.  This is read only data which you can view by looking at the "Administer Database" page:
[[Image:Admin db.png|center]]  


Looking at the Organisational Units you will have something like:
== DHIS2 Source Data  ==
[[Image:Org units.png|center]]


Looking at the Data Elements you will have something like:
The DHIS2 metadata on organisational units and data elements has been imported into iHRIS. This is read only data which you can view by looking at the "Administer Database" page: [[Image:Admin db.png|center|Admin db.png]]  
[[Image:Data element.png|center]]


==Data Relationship==
Looking at the Organisational Units you will have something like: [[Image:Org units.png|center|Org units.png]]
The data used to generate the report (# of students by student status and program) is based on a relationship built on the forms illustrated here: Note that the primary form in the relationship is student_app and that the person form is only included in the diagram for illustrative purposes as it is not needed in the actual relationship.


[[File:fast_student_app.gif|center]]
Looking at the Data Elements you will have something like: [[Image:Data element.png|center|Data element.png]]  


== Data Relationship  ==


==iHRIS Programming Details==
The data used to generate the report (# of students by student status and program) is based on a relationship built on the forms illustrated here: Note that the primary form in the relationship is student_app and that the person form is only included in the diagram for illustrative purposes as it is not needed in the actual relationship.


You can see some screen shots of the process here:
[[Image:Fast student app.gif|center|1000px|Fast student app.gif]]
  http://wiki.ihris.org/wiki/Data_Export_to_DHIS_in_iHRIS_F.A.S.T


What we have done is to export the metadata from DHIS2 as an .xml file and setup two forms in iHRIS, data_element and unit, that read the metadata file and populate the forms from the dataElements and organisationUnits.   
<br>
Here is the code that does that:
  http://bazaar.launchpad.net/~intrahealth+informatics/ihris-student-tracking/trunk/view/head:/modules/OrgUnits/OrgUnits.xml
and here is the metadata file that it is reading from:
  http://bazaar.launchpad.net/~intrahealth+informatics/ihris-student-tracking/trunk/view/head:/modules/OrgUnits/dashboard_metadata/Export.xml
I have used the XML form storage mechanism:
  http://wiki.ihris.org/wiki/Technical_Overview:_Form_Storage_--_XML
which let's you populate the form data using XPATH queries on an XML document.


The report which contains the data (# of students disaggregated by application status and training program ) is defined here:
== iHRIS Programming Details  ==
  http://bazaar.launchpad.net/~intrahealth+informatics/ihris-student-tracking/trunk/view/head:/modules/DHIS2_StudentStatus/CustomReports-full-student_status.xml
and you can see how the data is linked together more clearly here:
  http://wiki.ihris.org/wiki/Data_Export_to_DHIS_in_iHRIS_F.A.S.T#Data_Relationship


The needed .dxf file with the dataValueSets is produced using an xslt. This XSLT is contained in the report view itself (see starting on line 274 of the CustomReports-full-student_status.xml) above. A copy of  XSL also is here so we can edit/copy it easier:
What we have done is to export the metadata from DHIS2 as an .xml file and setup two forms in iHRIS, data_element and unit, that read the metadata file and populate the forms from the dataElements and organisationUnits. Here is the [http://bazaar.launchpad.net/~intrahealth+informatics/ihris-student-tracking/trunk/view/head:/modules/OrgUnits/OrgUnits.xml code] that does that. Specifically look at at lines 95-223.  
    http://bazaar.launchpad.net/~intrahealth+informatics/ihris-student-tracking/trunk/view/head:/modules/DHIS2_StudentStatus/sources/student_status.xsl


The DHIS2 metadata file that it is reading from can be seen [http://bazaar.launchpad.net/~intrahealth+informatics/ihris-student-tracking/trunk/view/head:/modules/OrgUnits/dashboard_metadata/Export.xml here]. Where we have used the [[Technical Overview: Form Storage -- XML|XML form storage mechanism]] which let's you populate the form data using XPATH queries on an XML document.


There is also a page that I setup that will handle multiple exports of iHRIS to DHIS. Here you can see where curl is used to connect to dhis2 and submit the data. The response from DHIS2 is processed and displayed on the web page.
The report which contains the data (# of students disaggregated by application status and training program ) is defined [http://bazaar.launchpad.net/~intrahealth+informatics/ihris-student-tracking/trunk/view/head:/modules/DHIS2_StudentStatus/CustomReports-full-student_status.xml here] and you can see how the data is linked together more clearly [http://wiki.ihris.org/wiki/Data_Export_to_DHIS_in_iHRIS_F.A.S.T#Data_Relationship here].
  http://bazaar.launchpad.net/~intrahealth+informatics/ihris-student-tracking/trunk/view/head:/modules/OrgUnits/lib/iHRIS_DHIS_DashboardSubmit.php
 
It reads in magic data to get the connection details to DHIS2 as well as define the report view and transform to use. You can see the magic data defined on lines 33-63 in the OrgUnits.xml file referenced above. A link to the page has been added to the index.html page:
The needed .dxf file with the dataValueSets is produced using an xslt. This XSLT is contained in the report view itself (see starting on line 274 of the CustomReports-full-student_status.xml) above. A [http://bazaar.launchpad.net/~intrahealth+informatics/ihris-student-tracking/trunk/view/head:/modules/DHIS2_StudentStatus/sources/student_status.xsl copy of the XSL is here] so we can view/copy it easier,
  http://bazaar.launchpad.net/~intrahealth+informatics/ihris-student-tracking/trunk/view/head:/templates/en_US/index.html
 
<br> There is also a page that I setup that will handle multiple exports of iHRIS to DHIS. Here you can see where curl is used to connect to dhis2 and submit the data. The response from DHIS2 is processed and displayed on the web page. The PHP code is [http://bazaar.launchpad.net/~intrahealth+informatics/ihris-student-tracking/trunk/view/head:/modules/OrgUnits/lib/iHRIS_DHIS_DashboardSubmit.php here]. It reads in magic data to get the connection details to DHIS2 as well as define the report view and transform to use. You can see the magic data defined on lines 33-63 in the OrgUnits.xml file referenced above. A link to the page has been added to the [http://bazaar.launchpad.net/~intrahealth+informatics/ihris-student-tracking/trunk/view/head:/templates/en_US/index.html index.html page].
 
[[Category:Archived Pages]]

Latest revision as of 12:54, 20 November 2013

Exporting The Data

The home page of iHRIS F.A.S.T. has a new menu item "Data Export" to handle data export to the Dean's Dashboard/DHIS2.

Index.png
Index.png

Clicking on this link will take you to a page showing all of the available data exports.

Menu.png
Menu.png

Clicking on one of the data exports will take you to a page where the data is posted to DHIS2 and the response is shown.

Response.png
Response.png

Linking The Data

The data in iHRIS F.A.S.T. and DHIS2 need to be linked together in order to successfully share information.

Training Program

Each member of the Training Program database list should be linked to the DHIS2 data element as follows:

Training program.png
Training program.png

Student Status

Each member of the Student Status database list should be linked to the DHIS2 data element as follows:

Student status.png
Student status.png

DHIS2 Source Data

The DHIS2 metadata on organisational units and data elements has been imported into iHRIS. This is read only data which you can view by looking at the "Administer Database" page:

Admin db.png
Admin db.png

Looking at the Organisational Units you will have something like:

Org units.png
Org units.png

Looking at the Data Elements you will have something like:

Data element.png
Data element.png

Data Relationship

The data used to generate the report (# of students by student status and program) is based on a relationship built on the forms illustrated here: Note that the primary form in the relationship is student_app and that the person form is only included in the diagram for illustrative purposes as it is not needed in the actual relationship.

Fast student app.gif
Fast student app.gif


iHRIS Programming Details

What we have done is to export the metadata from DHIS2 as an .xml file and setup two forms in iHRIS, data_element and unit, that read the metadata file and populate the forms from the dataElements and organisationUnits. Here is the code that does that. Specifically look at at lines 95-223.

The DHIS2 metadata file that it is reading from can be seen here. Where we have used the XML form storage mechanism which let's you populate the form data using XPATH queries on an XML document.

The report which contains the data (# of students disaggregated by application status and training program ) is defined here and you can see how the data is linked together more clearly here.

The needed .dxf file with the dataValueSets is produced using an xslt. This XSLT is contained in the report view itself (see starting on line 274 of the CustomReports-full-student_status.xml) above. A copy of the XSL is here so we can view/copy it easier,


There is also a page that I setup that will handle multiple exports of iHRIS to DHIS. Here you can see where curl is used to connect to dhis2 and submit the data. The response from DHIS2 is processed and displayed on the web page. The PHP code is here. It reads in magic data to get the connection details to DHIS2 as well as define the report view and transform to use. You can see the magic data defined on lines 33-63 in the OrgUnits.xml file referenced above. A link to the page has been added to the index.html page.