Mavzu: Klinika tizimini avtomatlashtirish



Download 221,88 Kb.
bet5/5
Sana28.06.2022
Hajmi221,88 Kb.
#717214
1   2   3   4   5
Bog'liq
2 5208909424323729574

II. Loyiha qism
Bazani shakllantirish:

1.Begona doktor:



id

int

11

fish

varchar

50

tel

varchar

20

ish_joyi

varchar

50

2.Bemor:


id

int

11

sana

date




fish

varchar

50

tel

varchar

50

manzil

varchar

100

p_seria

varchar

30

izoh

varchar

300

3.Bemor jarayon:



id

int

11

bem_id

int

11

xiz_id

int

11

hodim_id

int

11

beg_id

int

11

sana

date




narx

double




soni

int

11

summa

double




navbat

int

11

holat

int

11

4.Bolim:


id

int

11

nomi

varchar

50

holat

int

11

chegirma_holati

int

11

5.Chiqim:

id

int

11

kassa_id

int

11

hodim_id

int

11

sana

date




summa

double



6.Hodim:


id

int

11

bol_id

int

11

fish

varchar

50

tel

varchar

20

lavozim

varchar

20

manzil

varchar

50

delete_sana

date




vrach

int

11

ulush

int

11

7.Kassa:

id

int

11

nomi

varchar

50

miqdori

double




iscash

int

11

8.Kirim:


id

int

11

kassa_id

int

11

bem_id

int

11

sana

date




summa

double




9.Kirim tarkib:

id

int

11

kirim_id

int

11

bem_jar_id

int

11

summa

double




10.Muolaja:

id

int

11

bemor_id

int

11

begona_id

int

11

sana

date




summa

double




izoh

vrchar

50

11.Muolaja tarkib:

id

int

11

muolaja_id

int

11

hodim_id

int

11

narx

double




soni

int

11

xizmat_id

int

11

summa

double




skidka

int

11

12.Navbat:

id

int

11

bemor_id

int

11

bolim_id

int

11

xodim_id

int

11

navbat

int

11

sana

date




13.User:

id

int

11

fish

varchar

50

tel

varchar

50

log

varchar

10

par

varchar

10

huquq

varchar

10

14.Xizmatlar:

id

int

11

bol_id

int

11

nomi

varchar

50

narxi

double




2-Laboratoria:
Dasturga kirish oynasi. Xodimlar o`zlari uchun berilgan login va parollar bilan dasturga kirishu mumkin.


2.1. loyihani yaratish bosqichi







Registratura oynasi . Bu yerda administrator kelgan mijozlarni ro`yhatga oladi va unga kerakli xizmatlarni ko`rsatadi,Masalan ularning narxi, davolovchi shifokorlar va shu kabilar bilan mijozlarni tanishtiradi.



Bemorni ro`yhatga olish oynasi

Mijoz uchun kerakli xizmatlar o`ng tomondagi oynaga qo`shiladi



2.2 loyihadan foydalanish


Mijozga xizmat ko`rsatilgandan so`ng xizmatni yakunlash oynasi. Mijozdan olinadigan pul kerakli kassalarga tushiriladi va chegirma qilinish kerak bolsa chegirma qilish mumkin. Saqlash tugmasi orqali xizmat yakunlanadi va Mijoz uchun chek chiqarib beriladi.
Bu ADMIN tomonidan berilgan ruxsat asosida kassadan turli ehtiyojlar uchun hodimlarga pul chiqariladi.

Bu kunlik hisobotni ko`rish oynasi


package sample.Controllers;

import com.jfoenix.controls.JFXDatePicker;


import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.collections.transformation.FilteredList;
import javafx.collections.transformation.SortedList;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.chart.BarChart;
import javafx.scene.chart.CategoryAxis;
import javafx.scene.chart.NumberAxis;
import javafx.scene.chart.XYChart;
import javafx.scene.control.Alert;
import javafx.scene.control.Label;
import javafx.scene.input.KeyCode;
import sample.DataAccsesObject.DataAccsessObject;
import sample.Modellar.Bemorlar;
import sample.Modellar.Xodimlar;
import sample.utils.Util;
import sun.util.resources.LocaleData;

import java.io.IOException;


import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class MenuAsosiyOyna {

LocalDate newLocalData_dan = LocalDate.now().withDayOfMonth(1);
LocalDate newLocalData_gacha = LocalDate.now();
@FXML
private JFXDatePicker dan;

@FXML
private JFXDatePicker gacha;

@FXML
private Label hodim_soni;

@FXML
private Label bemor_soni;

@FXML
private BarChart barchart;

@FXML
private CategoryAxis axis_x;

@FXML
private NumberAxis axis_y;

String sql;


DataAccsessObject dao;
int hodimSoni;
int bemorSoni;
ObservableList listBemorlar = FXCollections.observableArrayList();

@FXML
void initialize() throws IOException {


dan.setValue(LocalDate.now().minusDays(30));
gacha.setValue(LocalDate.now());
dao = new DataAccsessObject();
getHodimlarSoni();
refreshChart();
getBemorlarSoni();
hodim_soni.setText(String.valueOf(hodimSoni) + " ta");
bemor_soni.setText(String.valueOf(bemorSoni) + " ta");

dan.setOnAction(event -> {


if (dan.getValue().compareTo(gacha.getValue()) > 0) {


dan.setValue(newLocalData_dan);
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setHeaderText(null);
alert.setContentText("Boshlanish sana tugash sanadan o'tib ketmaydi");
alert.show();
} else {
long numOfDaysBetween = ChronoUnit.DAYS.between(dan.getValue(), gacha.getValue());
List newLocal = IntStream.iterate(0, i -> i + 1)
.limit(numOfDaysBetween)
.mapToObj(i -> dan.getValue().plusDays(i))
.collect(Collectors.toList());
newLocal.add(gacha.getValue());
if (newLocal.size() > 40) {
dan.setValue(newLocalData_dan);
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setHeaderText(null);
alert.setContentText("Siz 40 kundan kop kunning malumotlarini kora olmaysiz");
alert.show();
}
else {
newLocalData_dan = dan.getValue();
refreshChart();
getBemorlarSoni();
}

}


bemor_soni.setText(String.valueOf(bemorSoni) + " ta");
});

dan.setOnKeyReleased(event -> {


if (event.getCode() == KeyCode.ENTER) {
getBemorlarSoni();
}
});
gacha.setOnAction(event -> {

if (gacha.getValue().compareTo(dan.getValue()) < 0) {


gacha.setValue(newLocalData_gacha);
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setHeaderText(null);
alert.setContentText("Tugash sana boshlang'ich sanadan tushib ketmaydi");
alert.show();
} else {

long numOfDaysBetween = ChronoUnit.DAYS.between(dan.getValue(), gacha.getValue());


List newLocal = IntStream.iterate(0, i -> i + 1)
.limit(numOfDaysBetween)
.mapToObj(i -> dan.getValue().plusDays(i))
.collect(Collectors.toList());

newLocal.add(gacha.getValue());


if (newLocal.size() > 40) {
gacha.setValue(newLocalData_gacha);
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setHeaderText(null);
alert.setContentText("Siz 40 kundan kop kunning malumotlarini kora olmaysiz");
alert.show();

}
else {


newLocalData_gacha = gacha.getValue();
getBemorlarSoni();
refreshChart();
}

}

bemor_soni.setText(String.valueOf(bemorSoni) + " ta");


});

// gacha.setOnKeyReleased(event -> {


// if (event.getCode() == KeyCode.ENTER) {
// getBemorlarSoni();
// }
// });

}


public void getHodimlarSoni() {
sql = "SELECT COUNT(hodim.id) as soni FROM `hodim`";
hodimSoni = dao.getHodimSoni(sql);

}

public void getBemorlarSoni() {


sql = "SELECT COUNT(bemor.id) as soni FROM `bemor` where " + getSana();
bemorSoni = dao.getBemorlarSoni(sql);

}


private String getSana() {
String sql = "";

if (dan.getValue() == null && gacha.getValue() == null) {


sql = "1";

} else {
if (dan.getValue() != null && gacha.getValue() == null) {


sql = "DATE(sana) >= '" + dan.getValue().toString() + "'";
} else {
if (dan.getValue() == null && gacha.getValue() != null) {

sql = "DATE(sana) <= '" + gacha.getValue().toString() + "'";


} else {
sql = "DATE(sana) >= '" + dan.getValue().toString() + "' and DATE(sana) <= '" + gacha.getValue().toString() + "'";
}
}
}
return sql;
}

ObservableList categoryAxisList = FXCollections.observableArrayList();


ObservableList qiyamatAxisList = FXCollections.observableArrayList();

private void refreshChart() {


sql = "SELECT * FROM `bemor` where " + getSana();
listBemorlar = dao.getBemorlar(sql);

long numOfDaysBetween = ChronoUnit.DAYS.between(dan.getValue(), gacha.getValue());


List newLocal = IntStream.iterate(0, i -> i + 1)
.limit(numOfDaysBetween)
.mapToObj(i -> dan.getValue().plusDays(i))
.collect(Collectors.toList());
newLocal.add(gacha.getValue());

categoryAxisList.clear();


qiyamatAxisList.clear();
for (int a = 0; a < newLocal.size(); a++) {
categoryAxisList.add(newLocal.get(a).toString());
int sonaq = 0;
for (int b = 0; b < listBemorlar.size(); b++) {
if (newLocal.get(a).toString().equals(listBemorlar.get(b).getSana().split(" ")[0])) {
sonaq++;
}
}
qiyamatAxisList.add(Double.parseDouble(String.valueOf(sonaq)));
}

axis_x.setCategories(categoryAxisList);

XYChart.Series series1 = new XYChart.Series<>();

for (int i = 0; i < newLocal.size(); i++) {


series1.getData().add(new XYChart.Data<>(categoryAxisList.get(i), qiyamatAxisList.get(i)));
}

barchart.getData().clear();


barchart.getData().add(series1);

//Defining the y axis


NumberAxis yAxis = new NumberAxis();
yAxis.setLabel("score");
}

}
package sample.Controllers;

import com.jfoenix.controls.JFXCheckBox;
import com.jfoenix.controls.JFXComboBox;
import com.jfoenix.controls.JFXDatePicker;
import com.jfoenix.controls.JFXTextField;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.control.*;
import javafx.scene.input.MouseEvent;
import javafx.stage.Stage;
import javafx.stage.Window;
import javafx.stage.WindowEvent;
import javafx.util.Callback;
import sample.Connections.DBTransaction;
import sample.DataAccsesObject.DataAccsessObject;
import sample.DataAccsesObject.DataAccsessTransaction;
import sample.Funksiyalar.Belgilar;
import sample.Funksiyalar.NumericChangeListenerDecimal;
import sample.Modellar.Bolimlar;
import sample.utils.Util;

import java.io.IOException;


import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Calendar;

public class AddHodimController {

DataAccsessObject dao;
String sql;
Boolean check = false;
String id;
String fish;
String lavozimi;
String manzili;
String tel;
String ulush;
String sana;

public String getSana() {


return sana;
}

public void setSana(String sana) {


this.sana = sana;
}

@FXML
private JFXTextField edt_fish;

@FXML
private JFXComboBox com_lavozimi;

@FXML
private JFXTextField edt_manzili;

@FXML
private JFXTextField edt_tel;

@FXML
private JFXTextField edt_ulush;


@FXML
private JFXTextField edt_data;

@FXML
private JFXTextField edt_lavozim;


@FXML
private JFXTextField edt_oylik;

@FXML
private JFXDatePicker date_picker;


@FXML
private Label txt_ulush_date;
@FXML
private JFXCheckBox id_checkbox;

@FXML
void handle_checkbox(ActionEvent event) {


if (id_checkbox.isSelected()) {
vrach = "0";
} else {
vrach = "1";
}
System.out.println(id_checkbox.isSelected());
}

String vrach = "1";


String date;

@FXML
void handleDatePicker(ActionEvent event) {

// date = date_picker.getValue().minusDays(date_picker.getValue().getDayOfMonth()-1).toString();

}


public Boolean getCheck() {
return check;
}

public void setCheck(Boolean check) {


this.check = check;
}

public String getId() {


return id;
}

public void setId(String id) {


this.id = id;
}

public String getFish() {


return fish;
}

public void setFish(String fish) {


this.fish = fish;
}

public String getLavozimi() {


return lavozimi;
}

public void setLavozimi(String lavozimi) {


this.lavozimi = lavozimi;
}

public String getManzili() {


return manzili;
}

public void setManzili(String manzili) {


this.manzili = manzili;
}

public String getTel() {


return tel;
}

public void setTel(String tel) {


this.tel = tel;
}

public String getUlush() {


return ulush;
}

public void setUlush(String ulush) {


this.ulush = ulush;
}

ObservableList listBemorlar = FXCollections.observableArrayList();

protected DataAccsessTransaction dat;

@FXML
void handle_Bekor(ActionEvent event) {


Node node = (Node) event.getSource();
Stage stage = (Stage) node.getScene().getWindow();
stage.close();
}

@FXML
void handle_Saqlash(ActionEvent event) throws IOException {

date = LocalDate.now().minusDays(LocalDateTime.now().getDayOfMonth()-1).toString();

if (!edt_fish.getText().isEmpty()) {


if (!edt_tel.getText().isEmpty()) {
if (!com_lavozimi.getSelectionModel().isEmpty()) {
if (!edt_manzili.getText().isEmpty()) {
if (!edt_ulush.getText().isEmpty()) {
if (!edt_oylik.getText().isEmpty()) {

DBTransaction transaction = new DBTransaction() {


@Override
public void doDBTransaction() throws Exception {

sql =
"insert into `hodim` (`bol_id`, `fish`, `tel`, `lavozim`,`manzil`, `vrach` , `ulush`) values " +


" ('" + com_lavozimi.getSelectionModel().getSelectedItem().getId() + "','" + edt_fish.getText().replace("'", "\\'") + "','" + edt_tel.getText().replace("'", "\\'") + "','" + edt_lavozim.getText().replace("'", "\\'") + "','" + edt_manzili.getText().replace("'", "\\'") + "','" + vrach + "','" + edt_ulush.getText() + "')";
int x_id = dat.insertReturnId(sql);

sql = "INSERT INTO `xodim_ulush`(`xodim_id`, `ulush`, `oylik` , `sana`) VALUES ('" + x_id + "','" + edt_ulush.getText() + "','" + Util.decimalFormatterToDouble(edt_oylik.getText()) + "','" + date + "')";

int u_id = dat.insertReturnId(sql);

sql = "UPDATE `hodim` SET `ulush` = '" + u_id + "' WHERE (`id` = '" + x_id + "');";

dat.umumiySorov(sql);

}
};

if (transaction.isSaved()) {
Util.getNotification("Amaliyot muvaffaqiyatli amalga oshirildi");
Node node = (Node) event.getSource();
Stage stage = (Stage) node.getScene().getWindow();
Window window = stage.getScene().getWindow();
window.fireEvent(new WindowEvent(window, WindowEvent.WINDOW_CLOSE_REQUEST));
} else {
showAlert("Iltimos qaytadan urinib ko`ring");
}

} else {
showAlert("Oylik maydoni bo`sh");


}
} else {

setText(item.getNomi());








Hulosa


Bu loyiha yaratish orqali mamlakatimizdagi klinika tizimini yaratib klinika hodimlariga yengillik yaratdik hamda xo’zimizga kerakli bilimlarni oldik.Va bu loyihani tuzish davomida texnik topshiriqlarni o’z vaqtida bajarishni o’rgandik va qo’shimcha bilimlarni o’zlashtirdik.

Foydalanilgan adabiyotlar.




https://www.coursera.org/articles/what-is-python-used-for-a-beginners-guide-to-using-python
https://www.mohirdev.uz
https://www.aiogram.org
King D. Samarali dasturiy ta'minotni yaratish: Per. ingliz tilidan. - M.: Mir, 2003 yil.
Kouts R.I. Vleymink. Inson-kompyuter interfeysi. - M.: Mir, 2000 yil.
Delphi rasmiy sayti // www.delphiworld.ru
Strukturaviy dasturlash nazariyasi va amaliyoti / R. Linger, X. Mills, B. Vitt, - M.: Mir, 2005 y. Faronov V.V. Delphi 4. Trening kursi. - M.: Bilim, 1998 yil.

Download 221,88 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish