@Test public void transformInternal() { final WritableProgram program = new WritableProgram(); program.setId( "x72638dsydu" ); program.setName( "Test Program" ); program.setDescription( "Test Description" ); program.setWithoutRegistration( false ); program.setTrackedEntityTypeId( "a1234567890" ); program.setStages( new ArrayList<>() ); final WritableProgramStage programStage = new WritableProgramStage(); programStage.setId( "x12638bsyda" ); programStage.setName( "Test Stage 1" ); programStage.setDescription( "Test Description 1" ); programStage.setRepeatable( false ); programStage.setDataElements( new ArrayList<>() ); WritableProgramStageDataElement programStageDataElement = new WritableProgramStageDataElement(); WritableDataElement dataElement = new WritableDataElement(); dataElement.setId( "d0123456789" ); dataElement.setName( "Value 1" ); dataElement.setValueType( ValueType.TEXT ); programStageDataElement.setElement( dataElement ); programStage.getDataElements().add( programStageDataElement ); programStageDataElement = new WritableProgramStageDataElement(); dataElement = new WritableDataElement(); dataElement.setId( "d7123456789" ); dataElement.setName( "Value 2" ); dataElement.setValueType( ValueType.TEXT ); programStageDataElement.setElement( dataElement ); programStage.getDataElements().add( programStageDataElement ); programStageDataElement = new WritableProgramStageDataElement(); dataElement = new WritableDataElement(); dataElement.setId( "f7123456789" ); dataElement.setName( "Value 3" ); dataElement.setValueType( ValueType.TEXT ); programStageDataElement.setElement( dataElement ); programStage.getDataElements().add( programStageDataElement ); final Patient patient = new Patient(); patient.setId( new IdDt( "Patient/lyau3syaixys" ) ); final ScriptedTrackedEntityInstance scriptedTrackedEntityInstance = new WritableScriptedTrackedEntityInstance( trackedEntityMetadataService, trackedEntityService, trackedEntityAttributes, trackedEntityType, "lyau3syaixys", scriptExecutionContext, valueConverter ); final ArrayList<WritableDataValue> dataValues = new ArrayList<>(); dataValues.add( new WritableDataValue( "d0123456789", "Test Value 1x" ) ); dataValues.add( new WritableDataValue( "d7123456789", "Test Value 2x" ) ); final Event event = new Event(); event.setDataValues( dataValues ); final QuestionnaireResponse fhirQuestionnaireResponse = new QuestionnaireResponse(); fhirQuestionnaireResponse.setAuthored( Date.from( ZonedDateTime.parse( "2011-12-03T10:15:30+01:00" ).toInstant() ) ); fhirQuestionnaireResponse.setQuestionnaire( "Questionnaire/x72638dsydu" ); fhirQuestionnaireResponse.addBasedOn().setReference( "CarePlan/a73dhsjxhs8" ); fhirQuestionnaireResponse.setStatus( QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED ); EventStatusExtensionUtils.setValue( fhirQuestionnaireResponse, EventStatus.OVERDUE, ResourceFactory::createType ); LocationExtensionUtils.setValue( fhirQuestionnaireResponse, new Reference( "Location/j82jdy28dusx" ) ); DueDateExtensionUtils.setValue( fhirQuestionnaireResponse, Date.from( ZonedDateTime.parse( "2011-12-08T10:11:30+01:00" ).toInstant() ), ResourceFactory::createType ); fhirQuestionnaireResponse.addItem().setLinkId( "d0123456789" ).addAnswer().setValue( new StringType( "New Value 1x" ) ); fhirQuestionnaireResponse.addItem().setLinkId( "f7123456789" ).addAnswer().setValue( new StringType( "Additional Value 3x" ) ); final Map<String, Object> scriptVariables = new HashMap<>(); scriptVariables.put( "assignmentUtils", assignmentUtils ); scriptVariables.put( "valueTypeUtils", new R4ValueTypeFhirToDhisTransformerUtils( scriptExecutionContext ) ); Mockito.doReturn( "a73dhsjxhs8" ).when( assignmentUtils ).getMappedDhisId( Mockito.same( transformerContext ), Mockito.any(), Mockito.any() ); Mockito.doReturn( orgUnitExecutableScript ).when( fhirResourceMapping ) .getImpEnrollmentOrgLookupScript(); Mockito.doReturn( org.dhis2.fhir.adapter.dhis.model.Reference.createIdReference( "j82jdy28dusx" ) ) .when( scriptExecutor ).execute( Mockito.same( orgUnitExecutableScript ), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any() ); transformer.transformInternal( transformerContext, new RuleInfo<>( new ProgramStageRule(), Collections.emptyList() ), scriptVariables, fhirResourceMapping, program, programStage, fhirQuestionnaireResponse, scriptedTrackedEntityInstance, new WritableScriptedEvent( program, programStage, event, scriptedTrackedEntityInstance, scriptExecutionContext, valueConverter ) ); Assert.assertEquals( "x72638dsydu", event.getProgramId() ); Assert.assertEquals( "j82jdy28dusx", event.getOrgUnitId() ); Assert.assertEquals( "lyau3syaixys", event.getTrackedEntityInstanceId() ); Assert.assertEquals( "a73dhsjxhs8", event.getEnrollmentId() ); Assert.assertEquals( EventStatus.OVERDUE, event.getStatus() ); Assert.assertEquals( ZonedDateTime.parse( "2011-12-03T10:15:30+01:00" ).toLocalDateTime(), event.getEventDate().toLocalDateTime() ); Assert.assertEquals( ZonedDateTime.parse( "2011-12-08T10:11:30+01:00" ).toLocalDateTime(), event.getDueDate().toLocalDateTime() ); Assert.assertEquals( 2, event.getDataValues().size() ); Assert.assertEquals( "d0123456789", event.getDataValues().get( 0 ).getDataElementId() ); Assert.assertEquals( "New Value 1x", event.getDataValues().get( 0 ).getValue() ); Assert.assertEquals( "f7123456789", event.getDataValues().get( 1 ).getDataElementId() ); Assert.assertEquals( "Additional Value 3x", event.getDataValues().get( 1 ).getValue() ); }
@Override protected void transformInternal( @Nonnull FhirToDhisTransformerContext context, @Nonnull RuleInfo<ProgramStageRule> ruleInfo, @Nonnull Map<String, Object> scriptVariables, @Nonnull FhirResourceMapping fhirResourceMapping, @Nonnull Program program, @Nonnull ProgramStage programStage, @Nonnull IBaseResource questionnaireResponse, @Nonnull ScriptedTrackedEntityInstance scriptedTrackedEntityInstance, @Nonnull WritableScriptedEvent scriptedEvent ) throws TransformerException { final QuestionnaireResponse fhirQuestionnaireResponse = (QuestionnaireResponse) questionnaireResponse; final Event event = (Event) scriptedEvent.getDhisResource(); final String enrollmentId = getAssignedDhisId( context, ruleInfo, scriptVariables, fhirQuestionnaireResponse.getBasedOnFirstRep().getReferenceElement() ); if ( enrollmentId == null ) { throw new TransformerDataException( "Enrollment could not be found: " + fhirQuestionnaireResponse.getPartOfFirstRep().getReferenceElement().getValue() ); } event.setEnrollmentId( enrollmentId ); event.setProgramId( program.getId() ); event.setProgramStageId( programStage.getId() ); event.setStatus( convertStatus( fhirQuestionnaireResponse ) ); event.setOrgUnitId( getOrgUnitId( context, ruleInfo, fhirResourceMapping.getImpEnrollmentOrgLookupScript(), scriptVariables ) .orElseThrow( () -> new TransformerMappingException( "Care plan contains location that cannot be mapped." ) ) ); event.setTrackedEntityInstanceId( scriptedTrackedEntityInstance.getId() ); event.setStatus( convertStatus( fhirQuestionnaireResponse ) ); final Date eventDate = fhirQuestionnaireResponse.hasAuthored() ? fhirQuestionnaireResponse.getAuthored() : null; event.setEventDate( eventDate == null ? null : ZonedDateTime.ofInstant( eventDate.toInstant(), zoneId ) ); final Date dueDate = DueDateExtensionUtils.getValue( fhirQuestionnaireResponse ); event.setDueDate( dueDate == null ? null : ZonedDateTime.ofInstant( dueDate.toInstant(), zoneId ) ); final AbstractValueTypeFhirToDhisTransformerUtils valueTypeUtils = TransformerUtils.getScriptVariable( scriptVariables, ScriptVariable.VALUE_TYPE_UTILS, AbstractValueTypeFhirToDhisTransformerUtils.class ); final Set<String> dataElementIds = new HashSet<>(); fhirQuestionnaireResponse.getItem().forEach( item -> { final ProgramStageDataElement dataElement = programStage.getOptionalDataElement( Reference.createIdReference( item.getLinkId() ) ) .orElseThrow( () -> new TransformerDataException( "Data element ID " + item.getLinkId() + " has not been defined for program stage ID " + programStage.getId() ) ); final WritableDataValue dataValue = event.getDataValue( dataElement.getElementId() ); dataValue.setValue( valueTypeUtils.convert( item.getAnswerFirstRep().getValue(), dataElement.getElement().getValueType() ) ); dataValue.setModified(); dataElementIds.add( item.getLinkId() ); } ); event.getDataValues().removeIf( dataValue -> !dataElementIds.contains( dataValue.getDataElementId() ) ); event.setModified(); }
R4FhirQuestionnaireResponseToProgramStageTransformer extends AbstractFhirQuestionnaireResponseToProgramStageTransformer { @Override protected void transformInternal( @Nonnull FhirToDhisTransformerContext context, @Nonnull RuleInfo<ProgramStageRule> ruleInfo, @Nonnull Map<String, Object> scriptVariables, @Nonnull FhirResourceMapping fhirResourceMapping, @Nonnull Program program, @Nonnull ProgramStage programStage, @Nonnull IBaseResource questionnaireResponse, @Nonnull ScriptedTrackedEntityInstance scriptedTrackedEntityInstance, @Nonnull WritableScriptedEvent scriptedEvent ) throws TransformerException { final QuestionnaireResponse fhirQuestionnaireResponse = (QuestionnaireResponse) questionnaireResponse; final Event event = (Event) scriptedEvent.getDhisResource(); final String enrollmentId = getAssignedDhisId( context, ruleInfo, scriptVariables, fhirQuestionnaireResponse.getBasedOnFirstRep().getReferenceElement() ); if ( enrollmentId == null ) { throw new TransformerDataException( "Enrollment could not be found: " + fhirQuestionnaireResponse.getPartOfFirstRep().getReferenceElement().getValue() ); } event.setEnrollmentId( enrollmentId ); event.setProgramId( program.getId() ); event.setProgramStageId( programStage.getId() ); event.setStatus( convertStatus( fhirQuestionnaireResponse ) ); event.setOrgUnitId( getOrgUnitId( context, ruleInfo, fhirResourceMapping.getImpEnrollmentOrgLookupScript(), scriptVariables ) .orElseThrow( () -> new TransformerMappingException( "Care plan contains location that cannot be mapped." ) ) ); event.setTrackedEntityInstanceId( scriptedTrackedEntityInstance.getId() ); event.setStatus( convertStatus( fhirQuestionnaireResponse ) ); final Date eventDate = fhirQuestionnaireResponse.hasAuthored() ? fhirQuestionnaireResponse.getAuthored() : null; event.setEventDate( eventDate == null ? null : ZonedDateTime.ofInstant( eventDate.toInstant(), zoneId ) ); final Date dueDate = DueDateExtensionUtils.getValue( fhirQuestionnaireResponse ); event.setDueDate( dueDate == null ? null : ZonedDateTime.ofInstant( dueDate.toInstant(), zoneId ) ); final AbstractValueTypeFhirToDhisTransformerUtils valueTypeUtils = TransformerUtils.getScriptVariable( scriptVariables, ScriptVariable.VALUE_TYPE_UTILS, AbstractValueTypeFhirToDhisTransformerUtils.class ); final Set<String> dataElementIds = new HashSet<>(); fhirQuestionnaireResponse.getItem().forEach( item -> { final ProgramStageDataElement dataElement = programStage.getOptionalDataElement( Reference.createIdReference( item.getLinkId() ) ) .orElseThrow( () -> new TransformerDataException( "Data element ID " + item.getLinkId() + " has not been defined for program stage ID " + programStage.getId() ) ); final WritableDataValue dataValue = event.getDataValue( dataElement.getElementId() ); dataValue.setValue( valueTypeUtils.convert( item.getAnswerFirstRep().getValue(), dataElement.getElement().getValueType() ) ); dataValue.setModified(); dataElementIds.add( item.getLinkId() ); } ); event.getDataValues().removeIf( dataValue -> !dataElementIds.contains( dataValue.getDataElementId() ) ); event.setModified(); } }
R4FhirQuestionnaireResponseToProgramStageTransformer extends AbstractFhirQuestionnaireResponseToProgramStageTransformer { @Override protected void transformInternal( @Nonnull FhirToDhisTransformerContext context, @Nonnull RuleInfo<ProgramStageRule> ruleInfo, @Nonnull Map<String, Object> scriptVariables, @Nonnull FhirResourceMapping fhirResourceMapping, @Nonnull Program program, @Nonnull ProgramStage programStage, @Nonnull IBaseResource questionnaireResponse, @Nonnull ScriptedTrackedEntityInstance scriptedTrackedEntityInstance, @Nonnull WritableScriptedEvent scriptedEvent ) throws TransformerException { final QuestionnaireResponse fhirQuestionnaireResponse = (QuestionnaireResponse) questionnaireResponse; final Event event = (Event) scriptedEvent.getDhisResource(); final String enrollmentId = getAssignedDhisId( context, ruleInfo, scriptVariables, fhirQuestionnaireResponse.getBasedOnFirstRep().getReferenceElement() ); if ( enrollmentId == null ) { throw new TransformerDataException( "Enrollment could not be found: " + fhirQuestionnaireResponse.getPartOfFirstRep().getReferenceElement().getValue() ); } event.setEnrollmentId( enrollmentId ); event.setProgramId( program.getId() ); event.setProgramStageId( programStage.getId() ); event.setStatus( convertStatus( fhirQuestionnaireResponse ) ); event.setOrgUnitId( getOrgUnitId( context, ruleInfo, fhirResourceMapping.getImpEnrollmentOrgLookupScript(), scriptVariables ) .orElseThrow( () -> new TransformerMappingException( "Care plan contains location that cannot be mapped." ) ) ); event.setTrackedEntityInstanceId( scriptedTrackedEntityInstance.getId() ); event.setStatus( convertStatus( fhirQuestionnaireResponse ) ); final Date eventDate = fhirQuestionnaireResponse.hasAuthored() ? fhirQuestionnaireResponse.getAuthored() : null; event.setEventDate( eventDate == null ? null : ZonedDateTime.ofInstant( eventDate.toInstant(), zoneId ) ); final Date dueDate = DueDateExtensionUtils.getValue( fhirQuestionnaireResponse ); event.setDueDate( dueDate == null ? null : ZonedDateTime.ofInstant( dueDate.toInstant(), zoneId ) ); final AbstractValueTypeFhirToDhisTransformerUtils valueTypeUtils = TransformerUtils.getScriptVariable( scriptVariables, ScriptVariable.VALUE_TYPE_UTILS, AbstractValueTypeFhirToDhisTransformerUtils.class ); final Set<String> dataElementIds = new HashSet<>(); fhirQuestionnaireResponse.getItem().forEach( item -> { final ProgramStageDataElement dataElement = programStage.getOptionalDataElement( Reference.createIdReference( item.getLinkId() ) ) .orElseThrow( () -> new TransformerDataException( "Data element ID " + item.getLinkId() + " has not been defined for program stage ID " + programStage.getId() ) ); final WritableDataValue dataValue = event.getDataValue( dataElement.getElementId() ); dataValue.setValue( valueTypeUtils.convert( item.getAnswerFirstRep().getValue(), dataElement.getElement().getValueType() ) ); dataValue.setModified(); dataElementIds.add( item.getLinkId() ); } ); event.getDataValues().removeIf( dataValue -> !dataElementIds.contains( dataValue.getDataElementId() ) ); event.setModified(); } R4FhirQuestionnaireResponseToProgramStageTransformer( @Nonnull ScriptExecutor scriptExecutor, @Nonnull TrackedEntityMetadataService trackedEntityMetadataService, @Nonnull TrackedEntityService trackedEntityService,
        @Nonnull TrackedEntityRuleRepository trackedEntityRuleRepository, @Nonnull OrganizationUnitService organizationUnitService, @Nonnull ProgramMetadataService programMetadataService, @Nonnull ProgramStageMetadataService programStageMetadataService,
        @Nonnull EventService eventService, @Nonnull FhirResourceMappingRepository resourceMappingRepository, @Nonnull FhirDhisAssignmentRepository fhirDhisAssignmentRepository, @Nonnull ScriptExecutionContext scriptExecutionContext,
        @Nonnull ValueConverter valueConverter ); }
R4FhirQuestionnaireResponseToProgramStageTransformer extends AbstractFhirQuestionnaireResponseToProgramStageTransformer { @Override protected void transformInternal( @Nonnull FhirToDhisTransformerContext context, @Nonnull RuleInfo<ProgramStageRule> ruleInfo, @Nonnull Map<String, Object> scriptVariables, @Nonnull FhirResourceMapping fhirResourceMapping, @Nonnull Program program, @Nonnull ProgramStage programStage, @Nonnull IBaseResource questionnaireResponse, @Nonnull ScriptedTrackedEntityInstance scriptedTrackedEntityInstance, @Nonnull WritableScriptedEvent scriptedEvent ) throws TransformerException { final QuestionnaireResponse fhirQuestionnaireResponse = (QuestionnaireResponse) questionnaireResponse; final Event event = (Event) scriptedEvent.getDhisResource(); final String enrollmentId = getAssignedDhisId( context, ruleInfo, scriptVariables, fhirQuestionnaireResponse.getBasedOnFirstRep().getReferenceElement() ); if ( enrollmentId == null ) { throw new TransformerDataException( "Enrollment could not be found: " + fhirQuestionnaireResponse.getPartOfFirstRep().getReferenceElement().getValue() ); } event.setEnrollmentId( enrollmentId ); event.setProgramId( program.getId() ); event.setProgramStageId( programStage.getId() ); event.setStatus( convertStatus( fhirQuestionnaireResponse ) ); event.setOrgUnitId( getOrgUnitId( context, ruleInfo, fhirResourceMapping.getImpEnrollmentOrgLookupScript(), scriptVariables ) .orElseThrow( () -> new TransformerMappingException( "Care plan contains location that cannot be mapped." ) ) ); event.setTrackedEntityInstanceId( scriptedTrackedEntityInstance.getId() ); event.setStatus( convertStatus( fhirQuestionnaireResponse ) ); final Date eventDate = fhirQuestionnaireResponse.hasAuthored() ? fhirQuestionnaireResponse.getAuthored() : null; event.setEventDate( eventDate == null ? null : ZonedDateTime.ofInstant( eventDate.toInstant(), zoneId ) ); final Date dueDate = DueDateExtensionUtils.getValue( fhirQuestionnaireResponse ); event.setDueDate( dueDate == null ? null : ZonedDateTime.ofInstant( dueDate.toInstant(), zoneId ) ); final AbstractValueTypeFhirToDhisTransformerUtils valueTypeUtils = TransformerUtils.getScriptVariable( scriptVariables, ScriptVariable.VALUE_TYPE_UTILS, AbstractValueTypeFhirToDhisTransformerUtils.class ); final Set<String> dataElementIds = new HashSet<>(); fhirQuestionnaireResponse.getItem().forEach( item -> { final ProgramStageDataElement dataElement = programStage.getOptionalDataElement( Reference.createIdReference( item.getLinkId() ) ) .orElseThrow( () -> new TransformerDataException( "Data element ID " + item.getLinkId() + " has not been defined for program stage ID " + programStage.getId() ) ); final WritableDataValue dataValue = event.getDataValue( dataElement.getElementId() ); dataValue.setValue( valueTypeUtils.convert( item.getAnswerFirstRep().getValue(), dataElement.getElement().getValueType() ) ); dataValue.setModified(); dataElementIds.add( item.getLinkId() ); } ); event.getDataValues().removeIf( dataValue -> !dataElementIds.contains( dataValue.getDataElementId() ) ); event.setModified(); } R4FhirQuestionnaireResponseToProgramStageTransformer( @Nonnull ScriptExecutor scriptExecutor, @Nonnull TrackedEntityMetadataService trackedEntityMetadataService, @Nonnull TrackedEntityService trackedEntityService,
        @Nonnull TrackedEntityRuleRepository trackedEntityRuleRepository, @Nonnull OrganizationUnitService organizationUnitService, @Nonnull ProgramMetadataService programMetadataService, @Nonnull ProgramStageMetadataService programStageMetadataService,
        @Nonnull EventService eventService, @Nonnull FhirResourceMappingRepository resourceMappingRepository, @Nonnull FhirDhisAssignmentRepository fhirDhisAssignmentRepository, @Nonnull ScriptExecutionContext scriptExecutionContext,
        @Nonnull ValueConverter valueConverter ); @Nonnull @Override Set<FhirVersion> getFhirVersions(); }
R4FhirQuestionnaireResponseToProgramStageTransformer extends AbstractFhirQuestionnaireResponseToProgramStageTransformer { @Override protected void transformInternal( @Nonnull FhirToDhisTransformerContext context, @Nonnull RuleInfo<ProgramStageRule> ruleInfo, @Nonnull Map<String, Object> scriptVariables, @Nonnull FhirResourceMapping fhirResourceMapping, @Nonnull Program program, @Nonnull ProgramStage programStage, @Nonnull IBaseResource questionnaireResponse, @Nonnull ScriptedTrackedEntityInstance scriptedTrackedEntityInstance, @Nonnull WritableScriptedEvent scriptedEvent ) throws TransformerException { final QuestionnaireResponse fhirQuestionnaireResponse = (QuestionnaireResponse) questionnaireResponse; final Event event = (Event) scriptedEvent.getDhisResource(); final String enrollmentId = getAssignedDhisId( context, ruleInfo, scriptVariables, fhirQuestionnaireResponse.getBasedOnFirstRep().getReferenceElement() ); if ( enrollmentId == null ) { throw new TransformerDataException( "Enrollment could not be found: " + fhirQuestionnaireResponse.getPartOfFirstRep().getReferenceElement().getValue() ); } event.setEnrollmentId( enrollmentId ); event.setProgramId( program.getId() ); event.setProgramStageId( programStage.getId() ); event.setStatus( convertStatus( fhirQuestionnaireResponse ) ); event.setOrgUnitId( getOrgUnitId( context, ruleInfo, fhirResourceMapping.getImpEnrollmentOrgLookupScript(), scriptVariables ) .orElseThrow( () -> new TransformerMappingException( "Care plan contains location that cannot be mapped." ) ) ); event.setTrackedEntityInstanceId( scriptedTrackedEntityInstance.getId() ); event.setStatus( convertStatus( fhirQuestionnaireResponse ) ); final Date eventDate = fhirQuestionnaireResponse.hasAuthored() ? fhirQuestionnaireResponse.getAuthored() : null; event.setEventDate( eventDate == null ? null : ZonedDateTime.ofInstant( eventDate.toInstant(), zoneId ) ); final Date dueDate = DueDateExtensionUtils.getValue( fhirQuestionnaireResponse ); event.setDueDate( dueDate == null ? null : ZonedDateTime.ofInstant( dueDate.toInstant(), zoneId ) ); final AbstractValueTypeFhirToDhisTransformerUtils valueTypeUtils = TransformerUtils.getScriptVariable( scriptVariables, ScriptVariable.VALUE_TYPE_UTILS, AbstractValueTypeFhirToDhisTransformerUtils.class ); final Set<String> dataElementIds = new HashSet<>(); fhirQuestionnaireResponse.getItem().forEach( item -> { final ProgramStageDataElement dataElement = programStage.getOptionalDataElement( Reference.createIdReference( item.getLinkId() ) ) .orElseThrow( () -> new TransformerDataException( "Data element ID " + item.getLinkId() + " has not been defined for program stage ID " + programStage.getId() ) ); final WritableDataValue dataValue = event.getDataValue( dataElement.getElementId() ); dataValue.setValue( valueTypeUtils.convert( item.getAnswerFirstRep().getValue(), dataElement.getElement().getValueType() ) ); dataValue.setModified(); dataElementIds.add( item.getLinkId() ); } ); event.getDataValues().removeIf( dataValue -> !dataElementIds.contains( dataValue.getDataElementId() ) ); event.setModified(); } R4FhirQuestionnaireResponseToProgramStageTransformer( @Nonnull ScriptExecutor scriptExecutor, @Nonnull TrackedEntityMetadataService trackedEntityMetadataService, @Nonnull TrackedEntityService trackedEntityService,
        @Nonnull TrackedEntityRuleRepository trackedEntityRuleRepository, @Nonnull OrganizationUnitService organizationUnitService, @Nonnull ProgramMetadataService programMetadataService, @Nonnull ProgramStageMetadataService programStageMetadataService,
        @Nonnull EventService eventService, @Nonnull FhirResourceMappingRepository resourceMappingRepository, @Nonnull FhirDhisAssignmentRepository fhirDhisAssignmentRepository, @Nonnull ScriptExecutionContext scriptExecutionContext,
        @Nonnull ValueConverter valueConverter ); @Nonnull @Override Set<FhirVersion> getFhirVersions();  }