- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
cs_zagl.Edit;
cs_zagl.fieldbyname('count_z').asinteger:=cs_tab.RecordCount;
cs_zagl.Post;
cs_mk.Edit;
cs_mk.FieldByName('med_kart_id').Asinteger:=select_row_Form.ClientDataSet1.FieldByName('id_kart').asinteger;
cs_mk.FieldByName('id_kart_public').Asinteger:=select_row_Form.ClientDataSet1.FieldByName('id_kart_public').asinteger;
cs_mk.FieldByName('id_pac').Asinteger:=select_row_Form.ClientDataSet1.FieldByName('id_pac').asinteger;
cs_mk.FieldByName('type_kart').asinteger:=select_row_Form.ClientDataSet1.FieldByName('type_kart').asinteger;
cs_mk.post;
IF (cs_mk.FieldByName('med_kart_id').Value=0) or (cs_mk.FieldByName('type_kart').asinteger<>27) then begin
cmd := VarArrayCreate([0,20],varVariant);
cmd[1] := 6832;
cmd[2] := 17;
cmd[5] := 1;
cmd[6] := 0;
ProvOptions := [grMetadata, grReset];
cmd[7] := dsp_mk.GetRecords(-1, RecsOut, Byte(ProvOptions));
try
rez := MainFormInterface.EXT_call_server('spr_read', cmd);
cs_tab.Edit;
cs_tab.FieldByName('med_kart_id').Asinteger:=rez[3];
cs_tab.Post;
if rez[1] < 0 then begin
debug_sql('Ошибка: ' + varastype(rez[1], varstring), 2);
MessageDlg('Ошибка: '+ #10 + #13 +
varastype(rez[1],varstring),mtError,[mbok],0);
Exit;
end;
except
on e:exception do
begin
MessageDlg(ERROR_MESS_5 + 'Исключение:' + E.ClassName + 'Mess:' + E.Message, mterror, [mbok], 0);
debug_sql('Ошибка записи документа!', 2);
debug_all('Err при записи документа тип=' + varastype(cmd[1], varstring)+
' id=' + inttostr(id_doc) + 'Исключение:' + E.ClassName + 'Mess:' + E.Message,2);
end;
end;
end;
end else begin
end;
end
else exit;
end else
begin
id_pac:=rez[3];
id_med_kart:=rez[2];
Application.MessageBox(pchar('Ошибка: '+#10+#13+
'Даный пациент не найден!!!'),pchar(application_title_short),MB_OK+MB_ICONERROR);
exit;
end;
end;