@Override public void deleteProgramStage( ProgramStage programStage ) { List<ProgramStageSection> programStageSections = new ArrayList<>( programStage.getProgramStageSections() ); for ( ProgramStageSection programStageSection : programStageSections ) { programStage.getProgramStageSections().remove( programStageSection ); programStageSectionService.deleteProgramStageSection( programStageSection ); } } }
private void insertTable_ProgramStage( PdfPTable mainTable, PdfWriter writer, ProgramStage programStage ) throws IOException, DocumentException { Rectangle rectangle = new Rectangle( TEXTBOXWIDTH, PdfDataEntryFormUtil.CONTENT_HEIGHT_DEFAULT ); // Add Program Stage Sections if ( programStage.getProgramStageSections().size() > 0 ) { // Sectioned Ones for ( ProgramStageSection section : programStage.getProgramStageSections() ) { insertTable_ProgramStageSections( mainTable, rectangle, writer, section.getDataElements() ); } } else { // Default one insertTable_ProgramStageSections( mainTable, rectangle, writer, programStage.getAllDataElements() ); } }
private SetMap<Class<? extends IdentifiableObject>, IdentifiableObject> handleProgramStage( SetMap<Class<? extends IdentifiableObject>, IdentifiableObject> metadata, ProgramStage programStage ) { if ( programStage == null ) return metadata; metadata.putValue( ProgramStage.class, programStage ); handleAttributes( metadata, programStage ); programStage.getNotificationTemplates().forEach( template -> handleNotificationTemplate( metadata, template ) ); programStage.getProgramStageDataElements().forEach( programStageDataElement -> handleProgramStageDataElement( metadata, programStageDataElement ) ); programStage.getProgramStageSections().forEach( programStageSection -> handleProgramStageSection( metadata, programStageSection ) ); handleDataEntryForm( metadata, programStage.getDataEntryForm() ); return metadata; }