File tree Expand file tree Collapse file tree
core/src/main/java/org/hisp/dhis/android Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,7 +34,6 @@ import org.hisp.dhis.android.core.attribute.ProgramStageAttributeValueLink
3434import org.hisp.dhis.android.core.attribute.internal.ProgramStageAttributeValueLinkHandler
3535import org.hisp.dhis.android.core.common.ObjectWithUid
3636import org.hisp.dhis.android.core.program.ProgramStage
37- import org.hisp.dhis.android.core.program.ProgramStageSection
3837import org.koin.core.annotation.Singleton
3938
4039@Singleton
@@ -52,11 +51,7 @@ internal class ProgramStageHandler(
5251 programStageDataElementHandler.handleMany(o.programStageDataElements())
5352 programStageSectionHandler.handleMany(
5453 o.programStageSections(),
55- ) { programStageSection: ProgramStageSection ->
56- programStageSection.toBuilder()
57- .programStage(ObjectWithUid .create(o.uid()))
58- .build()
59- }
54+ )
6055
6156 if (action == = HandleAction .Update ) {
6257 programStageDataElementCleaner.deleteOrphan(o, o.programStageDataElements())
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ internal data class ProgramStageDTO(
113113 minDaysFromStart(minDaysFromStart)
114114 standardInterval(standardInterval)
115115 enableUserAssignment?.let { enableUserAssignment(it) }
116- programStageSections(programStageSections?.map { it.toDomain() })
116+ programStageSections(programStageSections?.map { it.toDomain(id ) })
117117 programStageDataElements(programStageDataElements?.map { it.toDomain() })
118118 periodType(periodType?.let { PeriodType .valueOf(it) })
119119 program(program?.toDomain())
Original file line number Diff line number Diff line change 2929package org.hisp.dhis.android.network.programstage
3030
3131import kotlinx.serialization.Serializable
32+ import org.hisp.dhis.android.core.common.ObjectWithUid
3233import org.hisp.dhis.android.core.program.ProgramStageSection
3334import org.hisp.dhis.android.network.common.dto.BaseIdentifiableObjectDTO
3435import org.hisp.dhis.android.network.common.dto.ObjectWithUidDTO
@@ -53,14 +54,14 @@ internal data class ProgramStageSectionDTO(
5354 val description : String? ,
5455 val displayDescription : String? ,
5556) : BaseIdentifiableObjectDTO {
56- fun toDomain (): ProgramStageSection {
57+ fun toDomain (programStageUid : String ): ProgramStageSection {
5758 return ProgramStageSection .builder()
5859 .applyBaseIdentifiableFields(this )
5960 .sortOrder(sortOrder)
6061 .programIndicators(programIndicators?.map { it.toDomain() })
6162 .dataElements(dataElements?.map { it.toDomain() })
6263 .renderType(renderType?.toDomain())
63- .programStage(programStage !! .toDomain( ))
64+ .programStage(ObjectWithUid .create(programStageUid ))
6465 .description(description)
6566 .displayDescription(displayDescription)
6667 .build()
You can’t perform that action at this time.
0 commit comments