Skip to content

Commit 0b60878

Browse files
authored
Merge pull request #5 from dhis2/D2INT-43
Adds support for DHIS2 Program to FHIR Plan Definition
2 parents 5a22b4c + a884e1b commit 0b60878

File tree

162 files changed

+3877
-914
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+3877
-914
lines changed

app/src/test/java/org/dhis2/fhir/adapter/fhir/server/AbstractProgramStageFhirRestAppTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,14 @@ protected void expectProgramStageMetadataRequests() throws Exception
6767
.andRespond( withSuccess( IOUtils.resourceToString( "/org/dhis2/fhir/adapter/dhis/test/single-org-unit-OU_1234.json", StandardCharsets.UTF_8 ), MediaType.APPLICATION_JSON ) );
6868
systemDhis2Server.expect( ExpectedCount.between( 0, 1 ), method( HttpMethod.GET ) ).andExpect( header( "Authorization", testConfiguration.getDhis2SystemAuthorization() ) )
6969
.andExpect( requestTo( dhis2BaseUrl + "/api/" + dhis2ApiVersion + "/programs/EPDyQuoRnXk.json?" +
70-
"fields=id,name,code,selectIncidentDatesInFuture,selectEnrollmentDatesInFuture,displayIncidentDate,registration,withoutRegistration,captureCoordinates,trackedEntityType%5Bid%5D,programTrackedEntityAttributes%5Bid,name,valueType,mandatory," +
71-
"allowFutureDate,trackedEntityAttribute%5Bid,name,code,valueType,generated%5D%5D,programStages%5Bid,name,repeatable,captureCoordinates,generatedByEnrollmentDate,minDaysFromStart,programStageDataElements%5Bid,compulsory," +
70+
"fields=id,name,code,description,selectIncidentDatesInFuture,selectEnrollmentDatesInFuture,displayIncidentDate,registration,withoutRegistration,captureCoordinates,trackedEntityType%5Bid%5D,programTrackedEntityAttributes%5Bid,name,valueType," +
71+
"mandatory,allowFutureDate,trackedEntityAttribute%5Bid,name,code,valueType,generated%5D%5D,programStages%5Bid,name,description,repeatable,captureCoordinates,generatedByEnrollmentDate,minDaysFromStart,programStageDataElements%5Bid,compulsory," +
7272
"allowProvidedElsewhere,dataElement%5Bid,name,code,formName,valueType,optionSetValue,optionSet%5Bid,name,options%5Bcode,name%5D%5D%5D%5D%5D" ) )
7373
.andRespond( withSuccess( IOUtils.resourceToString( "/org/dhis2/fhir/adapter/dhis/test/single-program.json", StandardCharsets.UTF_8 ), MediaType.APPLICATION_JSON ) );
7474
systemDhis2Server.expect( ExpectedCount.between( 0, 1 ), method( HttpMethod.GET ) ).andExpect( header( "Authorization", testConfiguration.getDhis2SystemAuthorization() ) )
75-
.andExpect( requestTo( dhis2BaseUrl + "/api/" + dhis2ApiVersion + "/programs.json?paging=false&fields=id,name,code,selectIncidentDatesInFuture,selectEnrollmentDatesInFuture,displayIncidentDate,registration," +
75+
.andExpect( requestTo( dhis2BaseUrl + "/api/" + dhis2ApiVersion + "/programs.json?paging=false&fields=id,name,code,description,selectIncidentDatesInFuture,selectEnrollmentDatesInFuture,displayIncidentDate,registration," +
7676
"withoutRegistration,captureCoordinates,trackedEntityType%5Bid%5D,programTrackedEntityAttributes%5Bid,name,valueType,mandatory,allowFutureDate,trackedEntityAttribute%5Bid,name,code,valueType,generated%5D%5D,programStages%5Bid,name," +
77+
"description," +
7778
"repeatable,captureCoordinates,generatedByEnrollmentDate,minDaysFromStart,programStageDataElements%5Bid,compulsory,allowProvidedElsewhere,dataElement%5Bid,name,code,formName,valueType,optionSetValue,optionSet%5Bid,name,options%5Bcode," +
7879
"name%5D%5D%5D%5D%5D&filter=name:eq:Child%20Programme" ) )
7980
.andRespond( withSuccess( IOUtils.resourceToString( "/org/dhis2/fhir/adapter/dhis/test/default-program.json", StandardCharsets.UTF_8 ), MediaType.APPLICATION_JSON ) );

app/src/test/java/org/dhis2/fhir/adapter/fhir/server/dstu3/Dstu3OrgUnitFhirRestAppTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
/**
5656
* DSTU3 tests for rest interfaces that access
57-
* DHIS 2 organization units.
57+
* DHIS2 organization units.
5858
*
5959
* @author volsch
6060
*/
@@ -87,7 +87,7 @@ public void getLocationWithInvalidAuthorization()
8787
}
8888

8989
@Test( expected = ResourceNotFoundException.class )
90-
public void getLocationNotExistsRepeated() throws Exception
90+
public void getLocationNotExistsRepeated()
9191
{
9292
try
9393
{
@@ -100,7 +100,7 @@ public void getLocationNotExistsRepeated() throws Exception
100100
}
101101
}
102102

103-
private void getLocationNotExists() throws Exception
103+
private void getLocationNotExists()
104104
{
105105
systemDhis2Server.reset();
106106
userDhis2Server.reset();
@@ -124,7 +124,7 @@ private void getLocationNotExists() throws Exception
124124
}
125125

126126
@Test( expected = ResourceNotFoundException.class )
127-
public void getLocationRuleNotFoundRepeated() throws Exception
127+
public void getLocationRuleNotFoundRepeated()
128128
{
129129
try
130130
{
@@ -137,7 +137,7 @@ public void getLocationRuleNotFoundRepeated() throws Exception
137137
}
138138
}
139139

140-
private void getLocationRuleNotFound() throws Exception
140+
private void getLocationRuleNotFound()
141141
{
142142
systemDhis2Server.reset();
143143
userDhis2Server.reset();

app/src/test/java/org/dhis2/fhir/adapter/fhir/server/dstu3/Dstu3ProgramStageFhirRestAppTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858

5959
/**
6060
* DSTU3 tests for rest interfaces that access
61-
* DHIS 2 program stages. <b>Some methods are executed twice in order to
61+
* DHIS2 program stages. <b>Some methods are executed twice in order to
6262
* verify that no cached data is used without authentication.</b>
6363
*
6464
* @author volsch

app/src/test/java/org/dhis2/fhir/adapter/fhir/server/dstu3/Dstu3TrackedEntityInstanceFhirRestAppTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
/**
5959
* DSTU3 tests for rest interfaces that access
60-
* DHIS 2 tracked entity instances. <b>Some methods are executed twice in order to
60+
* DHIS2 tracked entity instances. <b>Some methods are executed twice in order to
6161
* verify that no cached data is used without authentication.</b>
6262
*
6363
* @author volsch

app/src/test/java/org/dhis2/fhir/adapter/fhir/server/r4/R4OrgUnitFhirRestAppTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
/**
5656
* R4 tests for rest interfaces that access
57-
* DHIS 2 organization units.
57+
* DHIS2 organization units.
5858
*
5959
* @author volsch
6060
*/
@@ -118,7 +118,7 @@ private void getLocation() throws Exception
118118
}
119119

120120
@Test( expected = ResourceNotFoundException.class )
121-
public void getLocationNotExistsRepeated() throws Exception
121+
public void getLocationNotExistsRepeated()
122122
{
123123
try
124124
{
@@ -131,7 +131,7 @@ public void getLocationNotExistsRepeated() throws Exception
131131
}
132132
}
133133

134-
private void getLocationNotExists() throws Exception
134+
private void getLocationNotExists()
135135
{
136136
systemDhis2Server.reset();
137137
userDhis2Server.reset();
@@ -155,7 +155,7 @@ private void getLocationNotExists() throws Exception
155155
}
156156

157157
@Test( expected = ResourceNotFoundException.class )
158-
public void getLocationRuleNotFoundRepeated() throws Exception
158+
public void getLocationRuleNotFoundRepeated()
159159
{
160160
try
161161
{
@@ -168,7 +168,7 @@ public void getLocationRuleNotFoundRepeated() throws Exception
168168
}
169169
}
170170

171-
private void getLocationRuleNotFound() throws Exception
171+
private void getLocationRuleNotFound()
172172
{
173173
systemDhis2Server.reset();
174174
userDhis2Server.reset();

app/src/test/java/org/dhis2/fhir/adapter/fhir/server/r4/R4ProgramStageFhirRestAppTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858

5959
/**
6060
* R4 tests for rest interfaces that access
61-
* DHIS 2 program stages. <b>Some methods are executed twice in order to
61+
* DHIS2 program stages. <b>Some methods are executed twice in order to
6262
* verify that no cached data is used without authentication.</b>
6363
*
6464
* @author volsch
@@ -129,7 +129,7 @@ private void getObservation( boolean skipCached ) throws Exception
129129
Assert.assertEquals( 0, observation.getIdentifier().size() );
130130
Assert.assertEquals( "Patient/JeR2Ul4mZfx", observation.getSubject().getReference() );
131131
Assert.assertEquals( "Organization/ldXIdLNUNEp", observation.getPerformerFirstRep().getReference() );
132-
Assert.assertEquals( "Encounter/ps-deR4kl4mnf7-9d342f13aec146299d654f03fd0e848c", observation.getEncounter().getReference() );
132+
Assert.assertEquals( "Encounter/deR4kl4mnf7", observation.getEncounter().getReference() );
133133

134134
systemDhis2Server.verify();
135135
userDhis2Server.verify();

app/src/test/java/org/dhis2/fhir/adapter/fhir/server/r4/R4TrackedEntityInstanceFhirRestAppTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
/**
5959
* R4 tests for rest interfaces that access
60-
* DHIS 2 tracked entity instances. <b>Some methods are executed twice in order to
60+
* DHIS2 tracked entity instances. <b>Some methods are executed twice in order to
6161
* verify that no cached data is used without authentication.</b>
6262
*
6363
* @author volsch

app/src/test/java/org/dhis2/fhir/adapter/fhir/transform/fhir/impl/enrollment/AbstractCarePlanToEnrollmentTransformationAppTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess;
4646

4747
/**
48-
* Tests the transformation of a FHIR CarePlan to a DHIS 2 Program Instance.
48+
* Tests the transformation of a FHIR CarePlan to a DHIS2 Program Instance.
4949
*
5050
* @author volsch
5151
*/

app/src/test/java/org/dhis2/fhir/adapter/fhir/transform/fhir/impl/enrollment/AbstractEnrollmentTransformationAppTest.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,16 @@ public abstract class AbstractEnrollmentTransformationAppTest extends AbstractAp
4949
protected void expectMetadataRequests() throws Exception
5050
{
5151
systemDhis2Server.expect( ExpectedCount.between( 0, 1 ), method( HttpMethod.GET ) ).andExpect( header( "Authorization", testConfiguration.getDhis2SystemAuthorization() ) )
52-
.andExpect( requestTo( dhis2BaseUrl + "/api/" + dhis2ApiVersion + "/programs/EPDyQuoRnXk.json?fields=id,name,code,selectIncidentDatesInFuture,selectEnrollmentDatesInFuture,displayIncidentDate,registration," +
52+
.andExpect( requestTo( dhis2BaseUrl + "/api/" + dhis2ApiVersion + "/programs/EPDyQuoRnXk.json?fields=id,name,code,description,selectIncidentDatesInFuture,selectEnrollmentDatesInFuture,displayIncidentDate,registration," +
5353
"withoutRegistration,captureCoordinates,trackedEntityType%5Bid%5D,programTrackedEntityAttributes%5Bid,name,valueType,mandatory,allowFutureDate,trackedEntityAttribute%5Bid,name,code,valueType,generated%5D%5D,programStages%5Bid,name," +
54-
"repeatable,captureCoordinates,generatedByEnrollmentDate,minDaysFromStart,programStageDataElements%5Bid,compulsory,allowProvidedElsewhere,dataElement%5Bid,name,code,formName,valueType,optionSetValue,optionSet%5Bid,name,options%5Bcode," +
55-
"name%5D%5D%5D%5D%5D" ) )
54+
"description,repeatable,captureCoordinates,generatedByEnrollmentDate,minDaysFromStart,programStageDataElements%5Bid,compulsory,allowProvidedElsewhere,dataElement%5Bid,name,code,formName,valueType,optionSetValue,optionSet%5Bid,name," +
55+
"options%5Bcode,name%5D%5D%5D%5D%5D" ) )
5656
.andRespond( withSuccess( IOUtils.resourceToString( "/org/dhis2/fhir/adapter/dhis/test/single-program.json", StandardCharsets.UTF_8 ), MediaType.APPLICATION_JSON ) );
5757
systemDhis2Server.expect( ExpectedCount.between( 0, 1 ), method( HttpMethod.GET ) ).andExpect( header( "Authorization", testConfiguration.getDhis2SystemAuthorization() ) )
58-
.andExpect( requestTo( dhis2BaseUrl + "/api/" + dhis2ApiVersion + "/programs.json?paging=false&fields=id,name,code,selectIncidentDatesInFuture,selectEnrollmentDatesInFuture,displayIncidentDate,registration,withoutRegistration,captureCoordinates," +
59-
"trackedEntityType%5Bid%5D,programTrackedEntityAttributes%5Bid,name,valueType,mandatory,allowFutureDate,trackedEntityAttribute%5Bid,name,code,valueType,generated%5D%5D,programStages%5Bid,name,repeatable,captureCoordinates," +
60-
"generatedByEnrollmentDate,minDaysFromStart,programStageDataElements%5Bid,compulsory,allowProvidedElsewhere,dataElement%5Bid,name,code,formName,valueType,optionSetValue,optionSet%5Bid,name,options%5Bcode," +
58+
.andExpect( requestTo( dhis2BaseUrl + "/api/" + dhis2ApiVersion + "/programs.json?paging=false&fields=id,name,code,description,selectIncidentDatesInFuture,selectEnrollmentDatesInFuture,displayIncidentDate,registration,withoutRegistration," +
59+
"captureCoordinates," +
60+
"trackedEntityType%5Bid%5D,programTrackedEntityAttributes%5Bid,name,valueType,mandatory,allowFutureDate,trackedEntityAttribute%5Bid,name,code,valueType,generated%5D%5D,programStages%5Bid,name,description,repeatable,captureCoordinates," +
61+
"generatedByEnrollmentDate,minDaysFromStart,programStageDataElements%5Bid,compulsory,allowProvidedElsewhere,dataElement%5Bid,name,code,description,formName,valueType,optionSetValue,optionSet%5Bid,name,options%5Bcode," +
6162
"name%5D%5D%5D%5D%5D&filter=name:eq:Child%20Programme" ) )
6263
.andRespond( withSuccess( IOUtils.resourceToString( "/org/dhis2/fhir/adapter/dhis/test/all-programs.json", StandardCharsets.UTF_8 ), MediaType.APPLICATION_JSON ) );
6364
systemDhis2Server.expect( ExpectedCount.between( 0, 1 ), method( HttpMethod.GET ) ).andExpect( header( "Authorization", testConfiguration.getDhis2SystemAuthorization() ) )
@@ -73,9 +74,9 @@ protected void expectMetadataRequests() throws Exception
7374
.andRespond( withSuccess( IOUtils.resourceToString( "/org/dhis2/fhir/adapter/dhis/test/default-tracked-entity-type.json", StandardCharsets.UTF_8 ), MediaType.APPLICATION_JSON ) );
7475
systemDhis2Server.expect( ExpectedCount.between( 0, 1 ), method( HttpMethod.GET ) ).andExpect( header( "Authorization", testConfiguration.getDhis2SystemAuthorization() ) )
7576
.andExpect( requestTo( dhis2BaseUrl + "/api/" + dhis2ApiVersion + "/programs.json?paging=false&" +
76-
"fields=id,name,code,selectIncidentDatesInFuture,selectEnrollmentDatesInFuture,displayIncidentDate,registration,withoutRegistration,captureCoordinates,trackedEntityType%5Bid%5D,programTrackedEntityAttributes%5Bid,name,valueType," +
77-
"mandatory,allowFutureDate,trackedEntityAttribute%5Bid,name,code,valueType,generated%5D%5D,programStages%5Bid,name,repeatable,captureCoordinates,generatedByEnrollmentDate,minDaysFromStart,programStageDataElements%5Bid,compulsory," +
78-
"allowProvidedElsewhere,dataElement%5Bid,name,code,formName,valueType,optionSetValue,optionSet%5Bid,name,options%5Bcode,name%5D%5D%5D%5D%5D&filter=name:eq:Child%20Programme" ) )
77+
"fields=id,name,code,description,selectIncidentDatesInFuture,selectEnrollmentDatesInFuture,displayIncidentDate,registration,withoutRegistration,captureCoordinates,trackedEntityType%5Bid%5D,programTrackedEntityAttributes%5Bid,name,valueType," +
78+
"mandatory,allowFutureDate,trackedEntityAttribute%5Bid,name,code,valueType,generated%5D%5D,programStages%5Bid,name,description,repeatable,captureCoordinates,generatedByEnrollmentDate,minDaysFromStart,programStageDataElements%5Bid,compulsory," +
79+
"allowProvidedElsewhere,dataElement%5Bid,name,code,description,formName,valueType,optionSetValue,optionSet%5Bid,name,options%5Bcode,name%5D%5D%5D%5D%5D&filter=name:eq:Child%20Programme" ) )
7980
.andRespond( withSuccess( IOUtils.resourceToString( "/org/dhis2/fhir/adapter/dhis/test/single-program.json", StandardCharsets.UTF_8 ), MediaType.APPLICATION_JSON ) );
8081
}
8182
}

app/src/test/java/org/dhis2/fhir/adapter/fhir/transform/fhir/impl/enrollment/r4/R4CarePlanToEnrollmentTransformationAppTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import javax.annotation.Nonnull;
3535

3636
/**
37-
* Tests the transformation of a FHIR Care Plan to a DHIS 2 Program Instance.
37+
* Tests the transformation of a FHIR Care Plan to a DHIS2 Program Instance.
3838
*
3939
* @author volsch
4040
*/

0 commit comments

Comments
 (0)