Jump to content
Seja Membro VIP - Remova Banners de Propagandas, Tenha Liberado Qualquer Download, Além de Acessos em Áreas Exclusivas!! ×

Planilha exames de audiometria


meurehelp

Recommended Posts


  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  9
  • Content Per Day:  0.00
  • Reputation:   1
  • Achievement Points:  76
  • Solved Content:  0
  • Days Won:  1
  • Status:  Offline
  • Age:  48
  • Device:  Android

Boa tarde, alguém possui planilha do RM (OU SQL) que traga os dados de exame de audiometria do RM VITAE, não conseguir buscar a tela anexa

audiometria.jpg

Link to comment
Share on other sites


  • Topic Count:  6
  • Topics Per Day:  0.02
  • Content Count:  31
  • Content Per Day:  0.08
  • Reputation:   14
  • Achievement Points:  208
  • Solved Content:  0
  • Days Won:  2
  • Status:  Offline
  • Age:  32
  • Device:  Windows

5 horas atrás, meurehelp disse:

Boa tarde, alguém possui planilha do RM (OU SQL) que traga os dados de exame de audiometria do RM VIATAE, não conseguir buscar a tela anexa

audiometria.jpg

Tenta nessa tela usar o atalho control + alt + F9 para ver se lhe apresenta as tabelas envolvidas nesse DataServer.

  • Like 1
Link to comment
Share on other sites


  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  489
  • Content Per Day:  0.20
  • Reputation:   137
  • Achievement Points:  3,252
  • Solved Content:  0
  • Days Won:  65
  • Status:  Offline
  • Age:  35
  • Device:  Windows

@meurehelp,Boa noite! 

 

Normalmente, a dica @Guilherme José Silva funciona nestes casos, porém, neste caso a informação é pelo trace/profile.

SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SET NOCOUNT ON;


SELECT
       EP.CODCOLIGADA 
       ,EP.IDCONSULTA
       ,EP.DATAEXAME 
	   ,YEAR(EP.DATAEXAME ) AS 'ANO'
	   ,MONTH(EP.DATAEXAME) AS 'MÊS'
       ,CP.CODPESSOA
       ,CP.CHAPA
       ,P.NOME 
       ,HF.CODFUNCAO_HIST
       ,HF.NOME_FUNCAO_HIST
       ,HS.CODSECAO_HIST
       ,HS.DESC_SECAO_HIST
       ,CASE 
             WHEN ICC.NOMETPINFCLINICA LIKE '%OE/VA' THEN 'AEREA_ESQUERDO'
             WHEN ICC.NOMETPINFCLINICA LIKE '%OD/VA' THEN 'AEREA_DIREITO'
             WHEN ICC.NOMETPINFCLINICA LIKE '%OE/VO' THEN 'OSSEA_ESQUERDO'
             WHEN ICC.NOMETPINFCLINICA LIKE '%OD/VO' THEN 'OSSEA_DIREITO'
             WHEN ICC.NOMETPINFCLINICA LIKE 'WEBER%' THEN 'WEBER'
       ELSE NULL
       END AS 'TIPO'
       ,ICC.NOMETPINFCLINICA AS 'FREQUENCIA'
       ,TRY_CAST(SUBSTRING(ICC.NOMETPINFCLINICA, 1,CHARINDEX(' ',ICC.NOMETPINFCLINICA)-1) AS INT) AS 'NROFREQUENCIA'
       ,V.VALOR
FROM DBO.VEXAMESPRONT EP
JOIN DBO.VCONSULTASPRONT CP ON (EP.CODCOLIGADA = CP.CODCOLIGADA AND EP.IDCONSULTA = CP.IDCONSULTA)
LEFT JOIN DBO.PFUNC P ON (CP.CODCOLIGADA = P.CODCOLIGADA AND CP.CHAPA = P.CHAPA)
OUTER APPLY [dbo].[FOP_GET_HSTFUNCAO] (P.CODCOLIGADA , P.CHAPA, IIF(EP.DATAEXAME < P.DATAADMISSAO ,P.DATAADMISSAO ,EP.DATAEXAME)) HF
OUTER APPLY [dbo].[FOP_GET_HSTSECAO] (P.CODCOLIGADA , P.CHAPA, IIF(EP.DATAEXAME < P.DATAADMISSAO ,P.DATAADMISSAO ,EP.DATAEXAME)) HS
JOIN DBO.VEXAMESPRONTINFCLINICA IC ON (IC.CODCOLIGADA = EP.CODCOLIGADA AND IC.CODPESSOA = EP.CODPESSOA AND IC.IDCONSULTA = EP.IDCONSULTA AND IC.CODEXAME = EP.CODEXAME AND IC.DATAEXAME = EP.DATAEXAME )
JOIN DBO.VINFCLINICA ICC ON (ICC.CODCOLIGADA = IC.CODCOLIGADA AND ICC.CODTPINFCLINICA = IC.CODTPINFCLINICA) 
CROSS APPLY 
(
       SELECT TRY_CAST(G1.DESCRICAO AS INT) AS 'VALOR' 
       FROM DBO.GCONSIST G1
       WHERE G1.CODTABELA = IC.CODTABELA
       AND G1.CODCLIENTE  = IC.CODCLIENTE

) V
WHERE EP.CODCOLIGADA = 1 
AND EP.CODEXAME = '00002'
AND 
       (
                    ICC.NOMETPINFCLINICA LIKE '%OE/VA'
             OR     ICC.NOMETPINFCLINICA LIKE '%OD/VA'
             OR     ICC.NOMETPINFCLINICA LIKE '%OE/VO'
             OR     ICC.NOMETPINFCLINICA LIKE '%OD/VO'
             OR     ICC.NOMETPINFCLINICA LIKE 'WEBER%'
       )
ORDER BY TIPO, NROFREQUENCIA

 

Funções 

TOTVS-RM/RH/FOP_GET_HSTFUNCAO.sql at master · luisgustavogomes/TOTVS-RM · GitHub

TOTVS-RM/RH/FOP_GET_HSTSECAO.sql at master · luisgustavogomes/TOTVS-RM · GitHub

 

Espero lhe ajudar! 

Abraços.

 

 

  • Like 1
Link to comment
Share on other sites


  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  9
  • Content Per Day:  0.00
  • Reputation:   1
  • Achievement Points:  76
  • Solved Content:  0
  • Days Won:  1
  • Status:  Offline
  • Age:  48
  • Device:  Android

Luiz boa tarde.

 

 

obrigado valeu demais

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.