Skip to main content

Ayuda sobre productos BOLD:

Autocontroles intercambios

Página:
< Volver

En este artículo se describen controles diversos que se pueden incorporar a la herramienta a la hora de realizar solicitudes de intercambio / cambios de turno.

Los autocontroles se deben incluir en el QueryCustom.xml dentro de la sección <AutoControlObjectValues>.

A continuación, algunos ejemplos:

  • Autocontrol especificar día de retorno. Cuando el profesional rellena el formulario de intercambio debe especificar el día de retorno, es decir, el día de devolución del turno.
<AutoControlObject EventName="OnCreateObject" Class="BOLDForm" Name="ControlRetorno_Int" UserAccess="u_Administrador,u_Parametrizador,u_Planificador,u_Supervisor,u_Consultor,u_Employee"> 
<![CDATA[
	If(LogMessage("ControlRetorno_Int")==1, 
		IfElse(Obj2.SubClassType==5, 
		  IfElse(Obj2.CustomProps.SubType==2,
			IfElse(Enfermeria(Obj2.CustomProps.M32DatosEmpleado.IdCW.PlanArea.ID),
				IfElse(Obj2.CustomProps.M32DatosPermiso.ReciprocalInterchange,
					"",
					Translate("ErrorRetorno_Int")
				),
			""),
		  ""),
		"")
	)
]]>
</AutoControlObject>
  • Autocontrol antelación mínima. La solicitud de intercambio se debe realizar con una antelación mínima de X horas (en el ejemplo 48h = 2 días). Se tiene en cuenta tanto el día que se solicita intercambiar como el día de la devolución.
"u_Administrador,u_Parametrizador,u_Planificador,u_Supervisor,u_Consultor,u_Employee"> 
<![CDATA[
	If(LogMessage("ControlAntelacion_Int")==1, 
		IfElse(Obj2.SubClassType==5, 
			IfElse(Obj2.CustomProps.SubType==2,
				IfElse(Enfermeria(Obj2.CustomProps.M32DatosEmpleado.IdCW.PlanArea.ID),
					IfElse(MinDate(Obj2.CustomProps.IniDirect, Obj2.CustomProps.EndDirect) <= (Obj2.O_CREATEDATE + 2.0) OR 
					  MinDate(Obj2.CustomProps.IniInvers, Obj2.CustomProps.EndInvers) <= (Obj2.O_CREATEDATE + 2.0),
						Translate("ErrorAntelacion_Int"),
						""
					),
				""),
			""),
		"")
	)
]]>
</AutoControlObject>
  • Autocontrol entre personas del mismo grupo y subgrupo profesional. El grupo y subgrupo profesional son unos campos del contrato y se pide que las dos personas que se intercambian el turno pertenezcan al mismo grupo y subgrupo profesional. Este autocontrol puede servir de ejemplo para comparar cualquier otro campo a nivel de contrato.
"u_Administrador,u_Parametrizador,u_Planificador,u_Supervisor,u_Consultor,u_Employee"> 
<![CDATA[
	If(LogMessage("ControlGrupoSubgrupoProfesional_Int")==1, 
		IfElse(Obj2.SubClassType==5, 
		  IfElse(Obj2.CustomProps.SubType==2,
			IfElse(Enfermeria(Obj2.CustomProps.M32DatosEmpleado.IdCW.PlanArea.ID),
				IfElse((Obj2.CustomProps.M32DatosEmpleado.IdCW.CustomProperties.Grupo != Obj2.CustomProps.CWID.CustomProperties.Grupo) OR (Obj2.CustomProps.M32DatosEmpleado.IdCW.CustomProperties.SubGrupo != Obj2.CustomProps.CWID.CustomProperties.SubGrupo),
					Translate("ErrorGrupoSubgrupoProfesional_Int"),
					""
				),
			""),
		  ""),
		"")
	)
]]>
</AutoControlObject>
  • Autocontrol duración jornadas. Los horarios de las jornadas que se intercambian deben tener el mismo número de horas (misma duración).
<AutoControlObject EventName="OnCreateObject" Class="BOLDForm" Name="ControlDuracion_Int" UserAccess="u_Administrador,u_Parametrizador,u_Planificador,u_Supervisor,u_Consultor,u_Employee"> 
<![CDATA[
	If(LogMessage("ControlDuracion_Int")==1, 
		IfElse(Obj2.SubClassType==5, 
		  IfElse(Obj2.CustomProps.SubType==2,
			IfElse(Enfermeria(Obj2.CustomProps.M32DatosEmpleado.IdCW.PlanArea.ID),
				IfElse(PL_DurationH(GetPlanAsPL(Obj2.CustomProps.CaseID,Obj2.CustomProps.M32DatosEmpleado.IdWorker.ID,Obj2.CustomProps.IniDirect,Obj2.CustomProps.IniDirect)) - 
					PL_DurationH(GetPlanAsPL(Obj2.CustomProps.CaseID,Obj2.CustomProps.EmployeeID.ID,Obj2.CustomProps.IniInvers,Obj2.CustomProps.IniInvers)) > 0.01,
					Translate("ErrorDuracion_Int"),
					""
				),
			""),
		  ""),
		"")
	)
]]>
</AutoControlObject>	
  • Autocontrol intercambios de diferentes años. No se puede pedir un intercambio que afecte a distintos años, como por ejemplo cambiar un horario del año X y devolverlo el año X+1. El día que se solicita intercambiar y su devolución deben pertenecer al mismo año.
<AutoControlObject EventName="OnCreateObject" Class="BOLDForm" Name="ControlEntreAnyos_Int" UserAccess="u_Administrador,u_Parametrizador,u_Planificador,u_Supervisor,u_Consultor,u_Employee"> 
<![CDATA[
	If(LogMessage("ControlEntreAnyos_Int")==1, 
		IfElse(Obj2.SubClassType==5, 
		  IfElse(Obj2.CustomProps.SubType==2,
			IfElse(Enfermeria(Obj2.CustomProps.M32DatosEmpleado.IdCW.PlanArea.ID),
				IfElse(Year(Obj2.CustomProps.IniDirect) != Year(Obj2.CustomProps.IniInvers),
					Translate("ErrorEntreAnyos_Int"),
					""
				),
			""),
		  ""),
		"")
	)
]]>
</AutoControlObject>
  • Autocontrol sobre jornadas con guardia. No se puede intercambiar una jornada con guardia.
<AutoControlObject EventName="OnCreateObject" Class="BOLDForm" Name="ControlGuardias_Int" UserAccess="u_Administrador,u_Parametrizador,u_Planificador,u_Supervisor,u_Consultor,u_Employee"> 
<![CDATA[
	If(LogMessage("ControlGuardias_Int")==1, 
		IfElse(Obj2.SubClassType==5, 
		  IfElse(Obj2.CustomProps.SubType==2,
			IfElse(Enfermeria(Obj2.CustomProps.M32DatosEmpleado.IdCW.PlanArea.ID),
				IfElse(PL_NumPeriods(PL_FilterByIsDuty(GetPlanAsPL(Obj2.CustomProps.CaseID,Obj2.CustomProps.M32DatosEmpleado.IdWorker.ID,Obj2.CustomProps.IniDirect,Obj2.CustomProps.IniDirect), true))>0 OR PL_NumPeriods(PL_FilterByIsDuty(GetPlanAsPL(Obj2.CustomProps.CaseID,Obj2.CustomProps.EmployeeID.ID,Obj2.CustomProps.IniInvers,Obj2.CustomProps.IniInvers), true))>0,
					Translate("ErrorGuardias_Int"),
					""
				),
			""),
		  ""),
		"")
	)
]]>
</AutoControlObject>
  • Autocontrol sobre jornadas con actividad extra. No se puede intercambiar una jornada con actividad extra.
<AutoControlObject EventName="OnCreateObject" Class="BOLDForm" Name="ControlActividadExtra_Int" UserAccess="u_Administrador,u_Parametrizador,u_Planificador,u_Supervisor,u_Consultor,u_Employee"> 
<![CDATA[
	If(LogMessage("ControlActividadExtra_Int")==1, 
		IfElse(Obj2.SubClassType==5, 
		  IfElse(Obj2.CustomProps.SubType==2,
			IfElse(Enfermeria(Obj2.CustomProps.M32DatosEmpleado.IdCW.PlanArea.ID),
				IfElse(PL_NumPeriods(PL_Filter(PL_Interval(W_GetIncidencesAsPL(Obj2.CustomProps.M32DatosEmpleado.IdWorker.ID), Obj2.CustomProps.IniDirect, Obj2.CustomProps.EndDirect, true, true), "Obj1.Incidence.GroupCode=\"AnexosPago\" "))>0 OR PL_NumPeriods(PL_Filter(PL_Interval(W_GetIncidencesAsPL(Obj2.CustomProps.EmployeeID.ID), Obj2.CustomProps.IniInvers, Obj2.CustomProps.EndInvers, true, true), "Obj1.Incidence.GroupCode=\"AnexosPago\" "))>0,
					Translate("ErrorActividadExtra_Int"),
					""
				),
			""),
		  ""),
		"")
	)
]]>
</AutoControlObject>
  • Autocontrol turnos de noche. Los turnos de noche solo se pueden intercambiar con turnos de noche, no se permite intercambiarlos con mañanas ni tardes.
<AutoControlObject EventName="OnCreateObject" Class="BOLDForm" Name="ControlTurnoNoche_Int" UserAccess="u_Administrador,u_Parametrizador,u_Planificador,u_Supervisor,u_Consultor,u_Employee"> 
<![CDATA[
	If(LogMessage("ControlTurnoNoche_Int")==1, 
		IfElse(Obj2.SubClassType==5, 
		  IfElse(Obj2.CustomProps.SubType==2,
			IfElse(Enfermeria(Obj2.CustomProps.M32DatosEmpleado.IdCW.PlanArea.ID),
				IfElse(TengoHorarioDeNoche(Obj2.CustomProps.CaseID,Obj2.CustomProps.M32DatosEmpleado.IdWorker.ID,Obj2.CustomProps.IniDirect) == TengoHorarioDeNoche(Obj2.CustomProps.CaseID,Obj2.CustomProps.EmployeeID.ID,Obj2.CustomProps.IniInvers),
					"",
					Translate("ErrorTurnoNoche_Int")
				),
			""),
		  ""),
		"")
	)
]]>
</AutoControlObject>
  • Autocontrol solape jornadas. No se puede pedir un intercambio sobre jornadas con horarios que solapan más de X minutos (en el ejemplo 30min = 0.5h).
<AutoControlObject EventName="OnCreateObject" Class="BOLDForm" Name="ControlSolape_Int" UserAccess="u_Administrador,u_Parametrizador,u_Planificador,u_Supervisor,u_Consultor,u_Employee"> 
<![CDATA[
	If(LogMessage("ControlSolape_Int")==1, 
		IfElse(Obj2.SubClassType==5, 
		  IfElse(Obj2.CustomProps.SubType==2,
			IfElse(Enfermeria(Obj2.CustomProps.M32DatosEmpleado.IdCW.PlanArea.ID) AND (DateOf(Obj2.CustomProps.IniDirect) != DateOf(Obj2.CustomProps.IniInvers)),
				IfElse(PL_DurationH(PL_Intersection(
						GetPlanAsPL(Obj2.CustomProps.CaseID,Obj2.CustomProps.M32DatosEmpleado.IdWorker.ID,DateOf(Obj2.CustomProps.IniDirect),DateOf(Obj2.CustomProps.IniDirect)), 
						GetPlanAsPL(Obj2.CustomProps.CaseID,Obj2.CustomProps.EmployeeID.ID,DateOf(Obj2.CustomProps.IniDirect),DateOf(Obj2.CustomProps.IniDirect))
					   )) <= 0.5 AND
					   PL_DurationH(PL_Intersection(
						GetPlanAsPL(Obj2.CustomProps.CaseID,Obj2.CustomProps.M32DatosEmpleado.IdWorker.ID,DateOf(Obj2.CustomProps.IniInvers),DateOf(Obj2.CustomProps.IniInvers)), 
						GetPlanAsPL(Obj2.CustomProps.CaseID,Obj2.CustomProps.EmployeeID.ID,DateOf(Obj2.CustomProps.IniInvers),DateOf(Obj2.CustomProps.IniInvers))
					   )) <= 0.5,
					"",
					Translate("ErrorSolape_Int")
				),
			""),
		  ""),
		"")
	)
]]>
</AutoControlObject>

Todos los autocontroles anteriores hacen referencia a un error que se traduce en otra parte del QueryCustom justo en la sección <TranslationLabels>. Estos son los textos de los autocontroles definidos previamente:

<TranslationLabels>
	<TranslationLabel Label="ErrorRetorno_Int" TextToTranslate="ERROR: S'ha d'especificar el dia de retorn de l'intercanvi." />
	<TranslationLabel Label="ErrorAntelacion_Int" TextToTranslate="ERROR: No es pot demanar ni retornar un intercanvi amb menys de 48h d'antelació." />
	<TranslationLabel Label="ErrorGrupoSubgrupoProfesional_Int" TextToTranslate="ERROR: Per a demanar un intercanvi les dues persones heu de pertànyer al mateix grup i subgrup professional." />
	<TranslationLabel Label="ErrorDuracion_Int" TextToTranslate="ERROR: No es pot demanar un intercanvi entre jornades de diferent durada." />
	<TranslationLabel Label="ErrorEntreAnyos_Int" TextToTranslate="ERROR: No es pot demanar un intercanvi que afecti a diferents anys (interanual)." />
	<TranslationLabel Label="ErrorGuardias_Int" TextToTranslate="ERROR: No es pot demanar un intercanvi sobre jornades amb guàrdia." />
	<TranslationLabel Label="ErrorActividadExtra_Int" TextToTranslate="ERROR: No es pot demanar un intercanvi sobre jornades amb activitat extra." />
	<TranslationLabel Label="ErrorTurnoNoche_Int" TextToTranslate="ERROR: El torn de nit només es pot intercanviar amb un altre torn de nit." />
	<TranslationLabel Label="ErrorSolape_Int" TextToTranslate="ERROR: No es pot demanar un intercanvi sobre jornades amb horaris que solapen més de 30 minuts." />
</TranslationLabels>

Was this article helpful?
0 out Of 5 Stars
5 Estrellas 0%
4 Estrellas 0%
3 Estrellas 0%
2 Estrellas 0%
1 Estrellas 0%
5
How can we improve this article?
How Can We Improve This Article?

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Contenido

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny