/*
DESCRIPTION:
Any functions that are used internally by the use-case
*/
package therapy_protocol

import (
	e "simrs-vx/internal/domain/main-entities/therapy-protocol"
)

func setData[T *e.CreateDto | *e.UpdateDto](input T, data *e.TherapyProtocol) {
	var inputSrc *e.CreateDto
	if inputT, ok := any(input).(*e.CreateDto); ok {
		inputSrc = inputT
	} else {
		inputTemp := any(input).(*e.UpdateDto)
		inputSrc = &inputTemp.CreateDto
	}

	data.Encounter_Id = inputSrc.Encounter_Id
	data.Doctor_Code = inputSrc.Doctor_Code
	data.Anamnesis = inputSrc.Anamnesis
	data.MedicalDiagnoses = inputSrc.MedicalDiagnoses
	data.FunctionDiagnoses = inputSrc.FunctionDiagnoses
	data.Procedures = inputSrc.Procedures
	data.SupportingExams = inputSrc.SupportingExams
	data.Instruction = inputSrc.Instruction
	data.Evaluation = inputSrc.Evaluation
	data.WorkCauseStatus = inputSrc.WorkCauseStatus
	data.Frequency = inputSrc.Frequency
	data.IntervalUnit_Code = inputSrc.IntervalUnit_Code
	data.Duration = inputSrc.Duration
	data.DurationUnit_Code = inputSrc.DurationUnit_Code
}
