"localhost:/firebird/data/ILICHEVSK2.FDB". Процедуры Previous topic Chapter index Next topic

INFECTION_CALC_DEGREE

 

Входные параметры

Параметр

Тип

Описание

INFECTIONID

INTEGER

 

SPECIMENT_COUNT

INTEGER

 

ACCUMULATION

INTEGER

 

USEFULLNAME

INTEGER

 

 

Выходные параметры

Параметр

Тип

Описание

DEGREE

VARCHAR(30)

 

 

Описание

Определение степени зараженности

 

Определение

CREATE PROCEDURE INFECTION_CALC_DEGREE(
    INFECTIONID INTEGER,
    SPECIMENT_COUNT INTEGER,
    ACCUMULATION INTEGER,
    USEFULLNAME INTEGER)
RETURNS (
    DEGREE VARCHAR(30))
AS
begin
  DEGREE = null;
  if (:SPECIMENT_COUNT > 0) then begin
    if (:INFECTIONID in (1, 3, 4, 5)) then begin
      if (:SPECIMENT_COUNT <= 5) then begin
        if (:USEFULLNAME = 1) then DEGREE = '1 степень';
        else DEGREE = '1 ст.';
      end
      else if (:SPECIMENT_COUNT <= 10) then begin
        if (:USEFULLNAME = 1) then DEGREE = '2 степень';
        else DEGREE = '2 ст.';
      end
      else begin
        if (:USEFULLNAME = 1) then DEGREE = '3 степень';
        else DEGREE = '3 ст.';
      end
    end
    if (:INFECTIONID in (2)) then begin
      if (:SPECIMENT_COUNT <= 20) then begin
        if (:USEFULLNAME = 1) then DEGREE = '1 степень';
        else DEGREE = '1 ст.';
      end
      else if (:ACCUMULATION = 2) then begin
        if (:USEFULLNAME = 1) then DEGREE = '3 степень';
        else DEGREE = '3 ст.';
      end
      else begin
        if (:USEFULLNAME = 1) then DEGREE = '2 степень';
        else DEGREE = '2 ст.';
      end
    end
  end
  suspend;
end

 

     Previous topic Chapter index Next topic