Смекни!
smekni.com

Разработка подсистемы учета гематологических анализов для КДЛ ГБСМП-2 (стр. 10 из 12)

Рисунок Д.1- Реализация запроса «Заявка- анализ»

Рисунок Д.2- Реализация запроса «Отдел-исследование-анализ»


Рисунок Д.3- Реализация запроса «Отдел-анализ»

Приложение Е – Тексты программ

Константы ресурсов

#define IDP_OLE_INIT_FAILED 100

#define IDD_ABOUT 100

#define IDD_FORM 101

#define IDR_MAINFRAME 128

#define IDR_Hematology_CounTYPE 129

#define IDD_FORM_LEIKOFORMULA 132

#define IDD_FORM_TROMBOCITY 133

#define IDD_FORM_MIELOGRAMMA 134

#define IDR_LEIKOFORMULA 136

#define IDR_TROMBOCITY 137

#define IDR_MIELOGRAMMA 138

#define IDR_MIELOGRAMM 138

#define IDC_BUTTON_PERCENT 1004

#define IDC_BUTTON_RESTART 1009

#define IDC_STATIC_PALOCHKOYADERN 1010

#define IDC_STATIC_SEGMEHTARN 1011

#define IDC_STATIC_MONOCIT 1012

#define IDC_STATIC_LIMFOCIT 1013

#define IDC_STATIC_MIELOCIT 1014

#define IDC_STATIC_METAMELOCIT 1015

#define IDC_STATIC_EOZILOFIL 1016

#define IDC_STATIC_BAZOFIL 1017

#define IDC_STATIC_SUM 1018

#define IDC_STATIC_NORMOBLAST 1021

#define IDC_STATIC_9 1022

#define IDC_STATIC_10 1023

#define IDC_STATIC_11 1024

#define IDC_STATIC_12 1025

#define IDC_STATIC_13 1026

#define IDC_STATIC_14 1027

#define IDC_STATIC_15 1028

#define IDC_STATIC_16 1029

#define IDC_STATIC_17 1030

#define IDC_STATIC_18 1031

#define IDC_STATIC_19 1032

#define IDC_STATIC_20 1033

#define IDC_STATIC_21 1034

#define IDC_STATIC_22 1035

#define IDC_STATIC_23 1036

#define IDC_STATIC_24 1037

#define IDC_BUTTON1 1038

#define IDC_EDIT1 1039

#define ID_LEIKOFORMULA_NORMOBLAST 3201

#define ID_LEIKOFORMULA_PALOCHKOYADERN 3202

#define ID_LEIKOFORMULA_SEGMEHTARN 3203

#define ID_LEIKOFORMULA_MONOCIT 3204

#define ID_LEIKOFORMULA_LIMFOCIT 3205

#define ID_LEIKOFORMULA_MIELOCIT 3206

#define ID_LEIKOFORMULA_METAMELOCIT 3207

#define ID_LEIKOFORMULA_EOZILOFIL 3208

#define ID_LEIKOFORMULA_BAZOFIL 3209

#define ID_MIELOGRAMMA_PALOCHKOYADERN 32012

#define ID_MIELOGRAMMA_SEGMEHTARN 32013

#define ID_MIELOGRAMMA_MONOCIT 32014

#define ID_MIELOGRAMMA_LIMFOCIT 32015

#define ID_MIELOGRAMMA_MIELOCIT 32016

#define ID_MIELOGRAMMA_METAMELOCIT 32017

#define ID_MIELOGRAMMA_EOZILOFIL 32018

#define ID_MIELOGRAMMA_BAZOFIL 32019

#define ID_MIELOGRAMMA_9 32020

#define ID_MIELOGRAMMA_10 32021

#define ID_MIELOGRAMMA_11 32022

#define ID_MIELOGRAMMA_12 32023

#define ID_MIELOGRAMMA_13 32024

#define ID_MIELOGRAMMA_14 32025

#define ID_MIELOGRAMMA_15 32026

#define ID_MIELOGRAMMA_16 32027

#define ID_MIELOGRAMMA_17 32028

#define ID_MIELOGRAMMA_18 32029

#define ID_MIELOGRAMMA_19 32030

#define ID_MIELOGRAMMA_20 32031

#define ID_MIELOGRAMMA_21 32032

#define ID_MIELOGRAMMA_22 32033

#define ID_MIELOGRAMMA_23 32034

#define ID_MIELOGRAMMA_24 32035

#define ID_LEIKOFORMULA 32786

#define ID_TROMBOCITY 32787

#define ID_MIELOGRAMMA 32788

#define ID_BUTTON32871 32871

#define ID_PARAMETR 32880

#define ID_PARAMETRES 32881

#define ID_BUTTON32883 32883

#ifdef APSTUDIO_INVOKED

#ifndef APSTUDIO_READONLY_SYMBOLS

#define _APS_NEXT_RESOURCE_VALUE 167

#define _APS_NEXT_COMMAND_VALUE 32884

#define _APS_NEXT_CONTROL_VALUE 1032

#define _APS_NEXT_SYMED_VALUE 101

#endif

#endif

Представление и определение класса CHematology_CounterDoc

#pragma once

#include "Leikoformula.h"

#include "Mielogramma.h"

#include "Trombocity.h"

class CHematology_CounterDoc : public CDocument

{

protected:

CHematology_CounterDoc();

DECLARE_DYNCREATE(CHematology_CounterDoc)

public:

virtual BOOL OnNewDocument();

virtual ~CHematology_CounterDoc();

#ifdef _DEBUG

virtual void AssertValid() const;

virtual void Dump(CDumpContext& dc) const;

#endif

protected:

DECLARE_MESSAGE_MAP()

private:

CView* Get_View() const;

public:

afx_msg void UpdateLeikoformula(UINT ID);

afx_msg void UpdateMielogramma(UINT ID);

afx_msg void OnNormoblast();

afx_msg void OnBnClickedButtonRestart();

afx_msg void OnBnClickedButtonPercent();

afx_msg void OnUndo();

afx_msg void OnFileSave();

CList<int*> Undo;

Data* DATA;

};

Реализация класса CHematology_CounterDoc

#include "stdafx.h"

#include "Hematology_Counter.h"

#include "Hematology_CounterDoc.h"

#ifdef _DEBUG

#define new DEBUG_NEW

#endif

IMPLEMENT_DYNCREATE(CHematology_CounterDoc, CDocument)

BEGIN_MESSAGE_MAP(CHematology_CounterDoc, CDocument)

ON_COMMAND_RANGE(ID_LEIKOFORMULA_PALOCHKOYADERN,ID_LEIKOFORMULA_BAZOFIL,&CHematology_CounterDoc::UpdateLeikoformula)

ON_COMMAND_RANGE(ID_MIELOGRAMMA_PALOCHKOYADERN,ID_MIELOGRAMMA_24 ,&CHematology_CounterDoc::UpdateMielogramma)

ON_COMMAND(ID_LEIKOFORMULA_NORMOBLAST, &CHematology_CounterDoc::OnNormoblast)

ON_COMMAND(ID_EDIT_UNDO, &CHematology_CounterDoc::OnUndo)

ON_BN_CLICKED(IDC_BUTTON_RESTART, &CHematology_CounterDoc::OnBnClickedButtonRestart)

ON_BN_CLICKED(IDC_BUTTON_PERCENT, &CHematology_CounterDoc::OnBnClickedButtonPercent)

ON_COMMAND(ID_FILE_SAVE, &CHematology_CounterDoc::OnFileSave)

END_MESSAGE_MAP()

CHematology_CounterDoc::CHematology_CounterDoc():DATA(new Leikoformula())

{}

CHematology_CounterDoc::~CHematology_CounterDoc()

{

if(DATA){delete DATA; DATA=0;}

}

BOOL CHematology_CounterDoc::OnNewDocument()

{

if (!CDocument::OnNewDocument())

return FALSE;

DATA->RemoveAll();

Undo.RemoveAll();

return TRUE;

}

#ifdef _DEBUG

void CHematology_CounterDoc::AssertValid() const

{

CDocument::AssertValid();

}

void CHematology_CounterDoc::Dump(CDumpContext& dc) const

{

CDocument::Dump(dc);

}

#endif

CView* CHematology_CounterDoc::Get_View() const

{

POSITION Position=NULL;

Position=this->GetFirstViewPosition();

return this->GetNextView(Position);

}

void CHematology_CounterDoc::UpdateLeikoformula(UINT ID)

{

int * pLeikoformula=&((Leikoformula*)DATA)->PALOCHKOYADERN+(ID-ID_LEIKOFORMULA_PALOCHKOYADERN);

if(DATA->Add(pLeikoformula))

{

Undo.AddTail(pLeikoformula);

Get_View()->UpdateData(0);

}

}

void CHematology_CounterDoc::UpdateMielogramma(UINT ID)

{

int * pMielogramma=&((Mielogramma*)DATA)->PALOCHKOYADERN+(ID-ID_MIELOGRAMMA_PALOCHKOYADERN);

if(DATA->Add(pMielogramma))

{

Undo.AddTail(pMielogramma);

Get_View()->UpdateData(0);

}

}

void CHematology_CounterDoc::OnNormoblast()

{

if(100>((Leikoformula*)DATA)->GetSum())

{

((Leikoformula*)DATA)->NORMOBLAST++;

Undo.AddTail(&((Leikoformula*)DATA)->NORMOBLAST);

Get_View()->UpdateData(0);

}

}

void CHematology_CounterDoc::OnBnClickedButtonRestart()

{

DATA->RemoveAll();

Get_View()->UpdateData(0);

Undo.RemoveAll();

}

void CHematology_CounterDoc::OnBnClickedButtonPercent()

{

}

void CHematology_CounterDoc::OnUndo()

{

if(Undo.GetTailPosition())

{

(*(Undo.GetTail()))--;

Undo.RemoveTail();

DATA->Remove();

Get_View()->UpdateData(0);

}

}

void CHematology_CounterDoc::OnFileSave()

{

}

Представление и определение класса CHematology_CounterView

#pragma once

class Form_Leikoformula;

class CHematology_CounterView : public CFormView

{

protected: CHematology_CounterView();

DECLARE_DYNCREATE(CHematology_CounterView)

public:

enum{ IDD = IDD_FORM };

CHematology_CounterDoc* GetDocument() const;

virtual BOOL PreCreateWindow(CREATESTRUCT& cs);

protected:

virtual void DoDataExchange(CDataExchange* pDX);

virtual void OnInitialUpdate();

public:

virtual ~CHematology_CounterView();

#ifdef _DEBUG

virtual void AssertValid() const;

virtual void Dump(CDumpContext& dc) const;

#endif

private:

CDialog * dForm;

protected:

DECLARE_MESSAGE_MAP()

public:

void OnDATA(UINT id);

afx_msg void OnDestroy();

afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);

afx_msg void OnLeikoformula();

afx_msg void OnTrombocity();

afx_msg void OnMielogramma();

void CreateMenuParametre(UINT ID);

};

#ifndef _DEBUG

inline CHematology_CounterDoc* CHematology_CounterView::GetDocument() const

{ return reinterpret_cast<CHematology_CounterDoc*>(m_pDocument); }

#endif

Реализация класса CHematology_CounterView

#include "stdafx.h"

#include "Hematology_Counter.h"