datahoje=date()
@04,25 say 'Alta Paciente' get xalta
@05,02 say 'Paciente'get xpaciente pict '@!s25'
@05,37 say 'Sexo' get xsexo pict '@!'
@05,44 say 'Cor' get xcor pict '@!'
@05,50 say 'D.N.' get xdatan valid datahoje > xdatan
@05,66 say 'E.c.'get xec pict '@!'
@05,73 say 'Nac.'get xnac pict '@!'
@06,02 say 'Endereco' get xendereco pict '@!s25'
@06,37 say 'Local' get xlocal pict '@!'
@06,50 say 'Cidade' get xcidade pict '@!'
@07,02 say 'CEP' get xcep pict '99999-999'
@07,16 say 'UF'get xuf pict '@!'
@07,22 say 'Documento' get xdoc pict '@!s11'
@07,44 say 'Telefone' get xtelefone pict '@!s8'
@07,63 say 'Profissao' get xprofissao pict '@!s8'
@08,02 say 'Natural' get xnatural pict '@!'
@08,37 say 'Tipo ' get xgrupo pict '@!'
@08,50 say 'RH ' get xrh pict '@!'
@09,02 say 'Nome do Pai' get xpai pict '@!s25'
@09,41 say 'Nome da Mae' get xmae pict '@!s25'
@10,02 say 'Responsavel' get xresponsavel pict '@!'
@11,02 say 'Endereco' get xendereco1 pict '@!s25'
@11,37 say 'Local' get xlocal1 pict '@!'
@11,50 say 'Cidade' get xcidade1 pict '@!'
@12,02 say 'CEP' get xcep1 pict '99999-999'
@12,16 say 'UF' get xuf1 pict '@!'
@12,22 say 'Documento' get xdoc1 pict '@!s11'
@12,44 say 'Telefone' get xtelefone1 pict '@!s8'
@12,63 say 'D.Ad.' get xdataa
@13,02 say 'Hora' get xhora
@13,13 say 'Entidade' get xentidade pict '@!s25'
@13,48 say 'D. Laudo' get xdatal
@14,02 say 'No Matr.' get xmatricula pict '@!s10'
@14,23 say 'Empresa' get xcategoria pict '@!s10' valid categoria(xcategoria)
@14,43 say 'Cond.' get xcod pict '@!'
@14,56 say 'Vinc.' get xvinc pict '@!'
@14,68 say 'Carat' get xcarat pict '@!'
@15,02 say 'Titular' get xtitular pict '@!s25'
@15,41 say 'Medico' get xmedico pict '@!s25'
@16,02 say 'Centro C.' get xcentro pict '@!s25'
@16,38 say 'Quarto' get xquarto pict '@!'
@16,51 say 'Leito' get xleito pict '@!'
@16,63 say 'Espec.' get xespec pict '@!'
@17,02 say 'Diagnostico' get xdiag pict '@!'
@18,02 say 'Motivo da Alta : 'get xcausa pict '@!' valid altas(xcausa)
@18,50 say 'Carne Hosp.:' get xcarne pict '999999'
@19,02 say 'Funcionario:' get xfunciona pict '@!' valid usa(xfunciona)
read
@23,00 say space(79)
@23,20 say 'Confirma a Alta do Paciente (<S>im/<N>ao)?' get sn pict '!' valid sn $ "SN"
read
if sn='N'
close all
return
endif
if sn='S'
select 4
tempo(23,01)
setcolor(cor1)
replace proto with xproto
replace dataalta with xalta
replace senha with xsenha
replace datae with xdatae
replace paciente with xpaciente
replace sexo with xsexo
replace cor with xcor
replace datan with xdatan
replace ec with xec
replace nac with xnac
replace endereco with xendereco
replace local with xlocal
replace cidade with xcidade
replace cep with xcep
replace uf with xuf
replace documento with xdoc
replace telefone with xtelefone
replace profissao with xprofissao
replace pai with xpai
replace mae with xmae
replace resp with xresponsavel
replace endereco1 with xendereco1
replace local1 with xlocal1
replace cidade1 with xcidade1
replace cep1 with xcep1
replace uf1 with xuf1
replace documento1 with xdoc1
replace telefone1 with xtelefone1
replace dataa with xdataa
replace hora with xhora
replace entidade with xentidade
replace datal with xdatal
replace matricula with xmatricula
replace empresa with xcategoria
replace cod with xcod
replace vinc with xvinc
replace carat with xcarat
replace Titular with xTitular
replace medico with xmedico
replace centro with xcentro
replace quarto with xquarto
replace leito with xleito
replace espec with xespec
replace diag with xdiag
replace carne with xcarne
replace grupos with xgrupo
replace rh with xrh
replace natural with xnatural
replace internacao with "A"
replace funciona with xfunciona
commit
unlock
endif
endif
loop
enddo
OBS: No Alta ele abre um outro dbf, para pegar o que eu preciso ok, e valta para o mesmo dbf, com o select ok t+
function altas()
select 3
if netuse("altas",.t.,10)
else
endif
save screen to tela
set color to w+/r,n/w,,,w+r
@14,14 clear to 20,40
@15,15 to 20,40 double
dbedit(14,16,19,39)
xcausa=tipo
set color to
restore screen from tela
return .t.