Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
OTChET_PO_PRAKTIKE.docx
Скачиваний:
2
Добавлен:
01.05.2025
Размер:
961 Кб
Скачать
☆

Заключение

Результатом данной практической работы является готовый програмный продукт, готовый к использованию в медицинских сферах деятельности. В программе реализовано хранение данных о больных и диагнозах в файлах, вывод на экран таблицы, поиск больных по диагнозу, определение начала эпидемии. Как у любого программного продукта в данной программе имеются свои достоинства и недостатки.

1)Недостатком является тот факт, что при добавлении больного в список можно выбрать лишь 4 диагноза из списка, с которыми в полной мере будет работать программа, осуществлять поиск, строить диаграмму. Также недостатком является то, что в программе не предусмотрен тот факт, что больные могут выходить из состояния заболевания, в результате этого в реальной жизни начало эпидемии будет определяться неправильно. Также недостатком является тот факт, что хранение данных в файле реализованно так, что при считывании пользователем данных прямо из файла, например через блокнот, все больные записанны в одну строчку.

2)Достоинством данной программы считаю, то что она является низкотребовательной к аппаратной составляющей компьютера, а значит будет достаточно хорошо работать на старых клмпьютерах, которые часто используются в государственных структурах, диаграмма в программе автоматически обновляется при добавлении нового больного, без каких-либо дополнительных действий пользователя. Таблицы обновляются так же автоматически. Оформление программы является достаточно контрастным для того, чтобы пользователю было удобнее работать с программой, программа занимает очень мало памяти, программа создавалась с расчетом на то, что она должна быть простой и понятной для рядового пользователя компьютером. Благодаря возможности увеличения шрифта, с программой сможет работать человек с плохим зрением. Программа не является коммерческой и доступна для любого желающего.

Библиографический список

  1. ГОСТ 19.701 – 90.

  2. Гункин, Дэн, С для «чайников», 2 издание.: Перевод с английского –М.: ООО «И.Д. Вильямс», 2006 .-252 с

  3. Бруно Бабэ, Просто и ясно о Borland С++: Перевод с английского – М.: БИНОМ. 1995г – 400с

  4. ГОСТ 2.316-68 "ЕСКД. Правила нанесения на чертежах надписей, технических требований и таблиц"

  5. http://ru.wikipedia.org/wiki/C%2B%2И «Статья о потенциальных опасностях, недостатках и достоинствах языка C++»

  6. http://cppbuilder.ru/articles/0196.php «Обзор инспектора объектов, для начинающих»

Приложение

Unit1.cpp

//---------------------------------------------------------------------------

#include <vcl.h>

#include <stdio.h>

#pragma hdrstop

int i;

#include "Unit1.h"

#include "Unit2.h"

#include "Unit3.h"

#include "Unit4.h"

int E=2;

struct bolnoi {

char fam[20];

char name[20];

char otch[20];

char diag[6];

char date[8];

};

struct znacheniya{

int Z;

int V;

int G;

int S;

};

znacheniya B;

bolnoi A;

int Z=0;

int V=0;

int G=0;

int S=0;

int k=5;

//---------------------------------------------------------------------------

#pragma package(smart_init)

#pragma resource "*.dfm"

TForm1 *Form1;

//---------------------------------------------------------------------------

__fastcall TForm1::TForm1(TComponent* Owner)

: TForm(Owner)

{

FILE *fp1;

fp1=fopen("BAZA.dat","r");

i=0;

if((fp1=fopen("BAZA.dat","r"))==NULL)

{

ShowMessage("He могу открыть файл БАЗЫ");

return;

}

while(!feof(fp1))

{fread(&A, sizeof(bolnoi),1,fp1);

StringGrid1->RowCount=i;

StringGrid1->Cells[0][i]=A.fam;

StringGrid1->Cells[1][i]=A.name;

StringGrid1->Cells[2][i]=A.otch;

StringGrid1->Cells[3][i]=A.date;

StringGrid1->Cells[4][i]=A.diag;

i++;

}

i=i-1;

fclose(fp1);

FILE *fp2;

fp2=fopen("ZNACH.dat","a");

if((fp2=fopen("ZNACH.dat","r"))==NULL)

{

ShowMessage("He могу открыть файл с ZNACH.dat");

return;

}

fread(&B, sizeof(znacheniya),1,fp2);

Z=B.Z;

V=B.V;

G=B.G;

S=B.S;

if(Z>=E){ShowMessage("ИДЕТ ЭПИДЕМИЯ ОРЗ !");}

if(V>=E){ShowMessage("ИДЕТ ЭПИДЕМИЯ ОРВ !");}

if(G>=E){ShowMessage("ИДЕТ ЭПИДЕМИЯ ГРИППА !");}

if(S>=E){ShowMessage("ИДЕТ ЭПИДЕМИЯ СПИДА !");}

fclose(fp2);

Image1->Canvas->MoveTo(10,0);

Image1->Canvas->LineTo(10,450);

Image1->Canvas->MoveTo(0,150);

Image1->Canvas->LineTo(450,150);

Image1->Canvas->Rectangle(20,150-5*Z,80,150);

Image1->Canvas->Rectangle(140,150-5*V,200,150);

Image1->Canvas->Rectangle(260,150-5*G,320,150);

Image1->Canvas->Rectangle(380,150-5*S,440,150);

Image1->Canvas->MoveTo(10,125);

Image1->Canvas->LineTo(15,125);

Image1->Canvas->MoveTo(10,100);

Image1->Canvas->LineTo(15,100);

Image1->Canvas->MoveTo(10,75);

Image1->Canvas->LineTo(15,75);

Image1->Canvas->MoveTo(10,50);

Image1->Canvas->LineTo(15,50);

Image1->Canvas->MoveTo(10,25);

Image1->Canvas->LineTo(15,25);

}

//---------------------------------------------------------------------------

void __fastcall TForm1::Button2Click(TObject *Sender)

{

int k=0;

for (int j=0; j<i+1; j++){

StringGrid2->RowCount=k;

if(StringGrid1->Cells[4][j]==ComboBox2->Text.c_str())

{StringGrid2->Cells[0][k]=StringGrid1->Cells[0][j];

StringGrid2->Cells[1][k]=StringGrid1->Cells[1][j];

StringGrid2->Cells[2][k]=StringGrid1->Cells[2][j];

StringGrid2->Cells[3][k]=StringGrid1->Cells[3][j];

StringGrid2->Cells[4][k]=StringGrid1->Cells[4][j];

StringGrid2->Visible=true;

Label10->Visible=true;

StringGrid2->Enabled=true;

Label10->Enabled=true;

k++;}

if(j==i&&k==0)

{StringGrid2->Visible=false;

Label10->Visible=false;

StringGrid2->Enabled=false;

Label10->Enabled=false;

ShowMessage("Больной с таким диагнозом не найден");

}}

}

//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)

{

strcpy(A.fam,Edit1->Text.c_str());

strcpy(A.name,Edit2->Text.c_str());

strcpy(A.otch,Edit3->Text.c_str());

strcpy(A.date,Edit4->Text.c_str());

strcpy(A.diag,ComboBox1->Text.c_str());

StringGrid1->Cells[0][i]=A.fam;

StringGrid1->Cells[1][i]=A.name;

StringGrid1->Cells[2][i]=A.otch;

StringGrid1->Cells[3][i]=A.date;

StringGrid1->Cells[4][i]=A.diag;

if (ComboBox1->Text=="ОРЗ"){Z=Z+1;if(Z==E){ShowMessage("Начинается эпидемия ОРЗ");}}

if (ComboBox1->Text=="ОРВ"){V=V+1;if(V==E){ShowMessage("Начинается эпидемия ОРВ");}}

if (ComboBox1->Text=="ГРИПП"){G=G+1;if(G==E){ShowMessage("Начинается эпидемия ГРИПА");}}

if (ComboBox1->Text=="СПИД"){S=S+1;if(S==E){ShowMessage("Начинается эпидемия СПИДА");}}

B.Z=Z; B.V=V; B.G=G; B.S=S;

FILE *fp1;

fp1=fopen("BAZA.dat","a");

fwrite(&A,sizeof(bolnoi),1,fp1);

fclose(fp1);

i=i+1;

FILE *fp2;

fp2=fopen("ZNACH.dat","w");

fwrite(&B,sizeof(znacheniya),1,fp2);

fclose(fp2);

StringGrid1->RowCount=i;

Image1->Canvas->Rectangle(20,150-5*Z,80,150);

Image1->Canvas->Rectangle(140,150-5*V,200,150);

Image1->Canvas->Rectangle(260,150-5*G,320,150);

Image1->Canvas->Rectangle(380,150-5*S,440,150);

}

//---------------------------------------------------------------------------

void __fastcall TForm1::N6Click(TObject *Sender)

{

Form2->Show();

Form2->Memo1->ReadOnly=true;

}

//---------------------------------------------------------------------------

void __fastcall TForm1::N4Click(TObject *Sender)

{

Form3->Show();

}

//---------------------------------------------------------------------------

void __fastcall TForm1::N7Click(TObject *Sender)

{

Form4->Show();

}

//---------------------------------------------------------------------------

void __fastcall TForm1::N8Click(TObject *Sender)

{

Form1->Close();

}

//---------------------------------------------------------------------------

void __fastcall TForm1::FormCreate(TObject *Sender)

{

}

//---------------------------------------------------------------------------

Unit1.h

//---------------------------------------------------------------------------

#ifndef Unit1H

#define Unit1H

//---------------------------------------------------------------------------

#include <Classes.hpp>

#include <Controls.hpp>

#include <StdCtrls.hpp>

#include <Forms.hpp>

#include <Grids.hpp>

#include <ExtCtrls.hpp>

#include <ActnCtrls.hpp>

#include <ActnMan.hpp>

#include <ActnMenus.hpp>

#include <ToolWin.hpp>

#include <Menus.hpp>

//---------------------------------------------------------------------------

class TForm1 : public TForm

{

__published: // IDE-managed Components

TComboBox *ComboBox1;

TEdit *Edit1;

TLabel *Label1;

TLabel *Label3;

TLabel *Label4;

TEdit *Edit2;

TLabel *Label5;

TEdit *Edit3;

TLabel *Label6;

TStringGrid *StringGrid1;

TButton *Button1;

TButton *Button2;

TLabel *Label7;

TLabel *Label8;

TLabel *Label9;

TComboBox *ComboBox2;

TStringGrid *StringGrid2;

TLabel *Label10;

TLabel *Label11;

TLabel *Label12;

TImage *Image1;

TLabel *Label13;

TEdit *Edit4;

TLabel *Label14;

TLabel *Label15;

TLabel *Label16;

TLabel *Label17;

TMainMenu *MainMenu1;

TMenuItem *N1;

TMenuItem *N2;

TMenuItem *N3;

TMenuItem *N4;

TMenuItem *N5;

TMenuItem *N6;

TLabel *Label2;

TLabel *Label18;

TLabel *Label19;

TLabel *Label20;

TLabel *Label21;

TLabel *Label22;

TMenuItem *N7;

TMenuItem *N8;

void __fastcall Button2Click(TObject *Sender);

void __fastcall Button1Click(TObject *Sender);

void __fastcall N6Click(TObject *Sender);

void __fastcall N4Click(TObject *Sender);

void __fastcall N7Click(TObject *Sender);

void __fastcall N8Click(TObject *Sender);

void __fastcall FormCreate(TObject *Sender);

private: // User declarations

public: // User declarations

__fastcall TForm1(TComponent* Owner);

};

//---------------------------------------------------------------------------

extern PACKAGE TForm1 *Form1;

//---------------------------------------------------------------------------

#endif

Unit2.cpp

//---------------------------------------------------------------------------

#include <vcl.h>

#pragma hdrstop

#include "Unit2.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)

#pragma resource "*.dfm"

TForm2 *Form2;

//---------------------------------------------------------------------------

__fastcall TForm2::TForm2(TComponent* Owner)

: TForm(Owner)

{

}

//---------------------------------------------------------------------------

Unit2.h

//---------------------------------------------------------------------------

#ifndef Unit2H

#define Unit2H

//---------------------------------------------------------------------------

#include <Classes.hpp>

#include <Controls.hpp>

#include <StdCtrls.hpp>

#include <Forms.hpp>

//---------------------------------------------------------------------------

class TForm2 : public TForm

{

__published: // IDE-managed Components

TMemo *Memo1;

private: // User declarations

public: // User declarations

__fastcall TForm2(TComponent* Owner);

};

//---------------------------------------------------------------------------

extern PACKAGE TForm2 *Form2;

//---------------------------------------------------------------------------

#endif

Unit3.cpp

//---------------------------------------------------------------------------

#include <vcl.h>

#pragma hdrstop

#include "Unit3.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)

#pragma resource "*.dfm"

TForm3 *Form3;

//---------------------------------------------------------------------------

__fastcall TForm3::TForm3(TComponent* Owner)

: TForm(Owner)

{

}

//---------------------------------------------------------------------------

void __fastcall TForm3::N1Click(TObject *Sender)

{

Memo1->Visible=true;

Memo2->Visible=false;

Memo3->Visible=false;

Memo4->Visible=false;

}

//---------------------------------------------------------------------------

void __fastcall TForm3::N2Click(TObject *Sender)

{

Memo1->Visible=false;

Memo2->Visible=true;

Memo3->Visible=false;

Memo4->Visible=false;

}

//---------------------------------------------------------------------------

void __fastcall TForm3::N3Click(TObject *Sender)

{

Memo1->Visible=false;

Memo2->Visible=false;

Memo3->Visible=true;

Memo4->Visible=false;

}

//---------------------------------------------------------------------------

void __fastcall TForm3::N4Click(TObject *Sender)

{

Memo1->Visible=false;

Memo2->Visible=false;

Memo3->Visible=false;

Memo4->Visible=true;

}

//---------------------------------------------------------------------------

void __fastcall TForm3::Memo4Change(TObject *Sender)

{

}

//---------------------------------------------------------------------------

Unit3.h

//---------------------------------------------------------------------------

#ifndef Unit3H

#define Unit3H

//---------------------------------------------------------------------------

#include <Classes.hpp>

#include <Controls.hpp>

#include <StdCtrls.hpp>

#include <Forms.hpp>

#include <Menus.hpp>

//---------------------------------------------------------------------------

class TForm3 : public TForm

{

__published: // IDE-managed Components

TMemo *Memo1;

TMainMenu *MainMenu1;

TMenuItem *N1;

TMenuItem *N2;

TMenuItem *N3;

TMemo *Memo2;

TMemo *Memo3;

TMenuItem *N4;

TMemo *Memo4;

void __fastcall N1Click(TObject *Sender);

void __fastcall N2Click(TObject *Sender);

void __fastcall N3Click(TObject *Sender);

void __fastcall N4Click(TObject *Sender);

void __fastcall Memo4Change(TObject *Sender);

private: // User declarations

public: // User declarations

__fastcall TForm3(TComponent* Owner);

};

//---------------------------------------------------------------------------

extern PACKAGE TForm3 *Form3;

//---------------------------------------------------------------------------

#endif

Unit4.cpp

//---------------------------------------------------------------------------

#include <vcl.h>

#pragma hdrstop

#include "Unit4.h"

#include "Unit1.h"

#include "Unit2.h"

#include "Unit3.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)

#pragma resource "*.dfm"

TForm4 *Form4;

//---------------------------------------------------------------------------

__fastcall TForm4::TForm4(TComponent* Owner)

: TForm(Owner)

{

}

//---------------------------------------------------------------------------

void __fastcall TForm4::Button1Click(TObject *Sender)

{

Form1->Font->Size=StrToInt(Form4->Edit1->Text);

if(Form4->ComboBox1->ItemIndex==0)Form1->Color=clWhite;

if(Form4->ComboBox1->ItemIndex==1)Form1->Color=clRed;

if(Form4->ComboBox1->ItemIndex==2)Form1->Color=clBlue;

if(Form4->ComboBox1->ItemIndex==3)Form1->Color=clYellow;

Form4->Close();

}

//---------------------------------------------------------------------------

void __fastcall TForm4::Button2Click(TObject *Sender)

{

Form1->Font->Size=StrToInt(Form4->Edit1->Text);

if(Form4->ComboBox1->ItemIndex==0)Form1->Color=clWhite;

if(Form4->ComboBox1->ItemIndex==1)Form1->Color=clRed;

if(Form4->ComboBox1->ItemIndex==2)Form1->Color=clBlue;

if(Form4->ComboBox1->ItemIndex==3)Form1->Color=clYellow;

}

//---------------------------------------------------------------------------

void __fastcall TForm4::FormCreate(TObject *Sender)

{

}

//---------------------------------------------------------------------------

Unit4.h

//---------------------------------------------------------------------------

#ifndef Unit4H

#define Unit4H

//---------------------------------------------------------------------------

#include <Classes.hpp>

#include <Controls.hpp>

#include <StdCtrls.hpp>

#include <Forms.hpp>

//---------------------------------------------------------------------------

class TForm4 : public TForm

{

__published: // IDE-managed Components

TLabel *Label1;

TLabel *Label2;

TEdit *Edit1;

TButton *Button1;

TComboBox *ComboBox1;

TButton *Button2;

void __fastcall Button1Click(TObject *Sender);

void __fastcall Button2Click(TObject *Sender);

void __fastcall FormCreate(TObject *Sender);

private: // User declarations

public: // User declarations

__fastcall TForm4(TComponent* Owner);

};

//---------------------------------------------------------------------------

extern PACKAGE TForm4 *Form4;

//---------------------------------------------------------------------------

#endif

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]