Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/main/java/org/hisp/dhis/api/ApiFields.java
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,9 @@ public class ApiFields {
PROGRAM_STAGE_DATA_ELEMENT_FIELDS,
PROGRAM_STAGE_SECTION_FIELDS);

public static final String PROGRAM_STAGE_EXT_FIELDS =
String.format("%1$s,dataEntryForm[%2$s]", PROGRAM_STAGE_FIELDS, ID_FIELDS);

public static final String PROGRAM_TRACKED_ENTITY_ATTRIBUTES_FIELDS =
String.format(
"""
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/hisp/dhis/model/ProgramStage.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ public class ProgramStage extends NameableObject {

@JsonProperty private FeatureType featureType;

@JsonProperty private DataEntryForm dataEntryForm;

/**
* Constructor.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
import static org.hisp.dhis.api.ApiFields.PROGRAM_RULE_FIELDS;
import static org.hisp.dhis.api.ApiFields.PROGRAM_RULE_VARIABLE_FIELDS;
import static org.hisp.dhis.api.ApiFields.PROGRAM_SECTION_FIELDS;
import static org.hisp.dhis.api.ApiFields.PROGRAM_STAGE_EXT_FIELDS;
import static org.hisp.dhis.api.ApiFields.PROGRAM_STAGE_FIELDS;
import static org.hisp.dhis.api.ApiFields.PROGRAM_STAGE_SECTION_FIELDS;
import static org.hisp.dhis.api.ApiFields.RELATIONSHIP_TYPE_FIELDS;
Expand Down Expand Up @@ -343,7 +344,7 @@ public enum MetadataEntity {
PROGRAM_STAGE(
ProgramStage.class,
PROGRAM_STAGE_FIELDS,
PROGRAM_STAGE_FIELDS,
PROGRAM_STAGE_EXT_FIELDS,
"programStages",
Dhis2Objects::getProgramStages),
PROGRAM_STAGE_SECTION(
Expand Down
10 changes: 10 additions & 0 deletions src/test/java/org/hisp/dhis/ProgramStageApiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ void getGetProgramStage() {
assertNotNull(programStage.getReferral());
}

@Test
void getGetProgramStageWithDataEntryForm() {
Dhis2 dhis2 = new Dhis2(TestFixture.DEFAULT_CONFIG);

ProgramStage programStage = dhis2.getProgramStage("pSllsjpfLH2");
assertNotNull(programStage);
assertEquals("pSllsjpfLH2", programStage.getId());
assertNotNull(programStage.getDataEntryForm());
}

@Test
void getProgramStages() {
Dhis2 dhis2 = new Dhis2(TestFixture.DEFAULT_CONFIG);
Expand Down
Loading