Skip to content

Commit

Permalink
Initial Setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahul Darade committed Sep 4, 2017
0 parents commit 3c8c820
Show file tree
Hide file tree
Showing 158 changed files with 1,059 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .classpath
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
40 changes: 40 additions & 0 deletions .project
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>hms</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.core.springbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.springframework.ide.eclipse.core.springnature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>
6 changes: 6 additions & 0 deletions .settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,6 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding//src/test/resources=UTF-8
encoding/<project>=UTF-8
5 changes: 5 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,5 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8
4 changes: 4 additions & 0 deletions .settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
4 changes: 4 additions & 0 deletions .settings/org.eclipse.wst.common.project.facet.core.xml
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="cloudfoundry.standalone.app" version="1.0"/>
</faceted-project>
22 changes: 22 additions & 0 deletions create_table.sql
@@ -0,0 +1,22 @@
use hms;

create table Hospital(name varchar(30) not null,address sql_variant,website varchar(25),contactNumber bigint)

create table Doctor(id int primary key identity,name varchar(30) not null,designation varchar(30),degree varchar(20),experience int,
address sql_variant,emailId sql_variant,contactNumber bigint);

create table Patient(id int primary key identity,name varchar(30) not null,address sql_variant,gender varchar(7),
disease sql_variant,emailId sql_variant,contactNumber bigint, doctorid int,
foreign key (doctorid) references Doctor(id));

create table Invoice(id int primary key identity,patientid int,doctorid int,particulars varchar(30),
quantity int,unitvalue int,totalamount int,
foreign key (patientid) references Patient(id),
foreign key (doctorid) references Doctor(id))

select * from Hospital
select * from Doctor
select * from Patient
select * from Invoice
/*select * from Patient
drop table Patient*/
13 changes: 13 additions & 0 deletions derby.log
@@ -0,0 +1,13 @@
----------------------------------------------------------------
Mon Sep 04 19:06:40 IST 2017:
Booting Derby version The Apache Software Foundation - Apache Derby - 10.13.1.1 - (1765088): instance a816c00e-015e-4d1b-7c7d-000005718ee0
on database directory C:\Users\rahuld\Documents\workspace-sts-3.8.3.RELEASE\hms\hms\hms_db with class loader sun.misc.Launcher$AppClassLoader@764c12b6
Loaded from file:/C:/Users/rahuld/.m2/repository/org/apache/derby/derby/10.13.1.1/derby-10.13.1.1.jar
java.vendor=Oracle Corporation
java.runtime.version=1.8.0_131-b11
user.dir=C:\Users\rahuld\Documents\workspace-sts-3.8.3.RELEASE\hms\hms
os.name=Windows 10
os.arch=amd64
os.version=10.0
derby.system.home=null
Database Class Loader started - derby.database.classpath=''
9 changes: 9 additions & 0 deletions hms_db/README_DO_NOT_TOUCH_FILES.txt
@@ -0,0 +1,9 @@

# *************************************************************************
# *** DO NOT TOUCH FILES IN THIS DIRECTORY! ***
# *** FILES IN THIS DIRECTORY AND SUBDIRECTORIES CONSTITUTE A DERBY ***
# *** DATABASE, WHICH INCLUDES THE DATA (USER AND SYSTEM) AND THE ***
# *** FILES NECESSARY FOR DATABASE RECOVERY. ***
# *** EDITING, ADDING, OR DELETING ANY OF THESE FILES MAY CAUSE DATA ***
# *** CORRUPTION AND LEAVE THE DATABASE IN A NON-RECOVERABLE STATE. ***
# *************************************************************************
Binary file added hms_db/db.lck
Binary file not shown.
8 changes: 8 additions & 0 deletions hms_db/log/README_DO_NOT_TOUCH_FILES.txt
@@ -0,0 +1,8 @@

# *************************************************************************
# *** DO NOT TOUCH FILES IN THIS DIRECTORY! ***
# *** FILES IN THIS DIRECTORY ARE USED BY THE DERBY DATABASE RECOVERY ***
# *** SYSTEM. EDITING, ADDING, OR DELETING FILES IN THIS DIRECTORY ***
# *** WILL CAUSE THE DERBY RECOVERY SYSTEM TO FAIL, LEADING TO ***
# *** NON-RECOVERABLE CORRUPT DATABASES. ***
# *************************************************************************
Binary file added hms_db/log/log.ctrl
Binary file not shown.
Binary file added hms_db/log/log1.dat
Binary file not shown.
Binary file added hms_db/log/logmirror.ctrl
Binary file not shown.
8 changes: 8 additions & 0 deletions hms_db/seg0/README_DO_NOT_TOUCH_FILES.txt
@@ -0,0 +1,8 @@

# *************************************************************************
# *** DO NOT TOUCH FILES IN THIS DIRECTORY! ***
# *** FILES IN THIS DIRECTORY ARE USED BY THE DERBY DATABASE TO STORE ***
# *** USER AND SYSTEM DATA. EDITING, ADDING, OR DELETING FILES IN THIS ***
# *** DIRECTORY WILL CORRUPT THE ASSOCIATED DERBY DATABASE AND MAKE ***
# *** IT NON-RECOVERABLE. ***
# *************************************************************************
Binary file added hms_db/seg0/c10.dat
Binary file not shown.
Binary file added hms_db/seg0/c101.dat
Binary file not shown.
Binary file added hms_db/seg0/c111.dat
Binary file not shown.
Binary file added hms_db/seg0/c121.dat
Binary file not shown.
Binary file added hms_db/seg0/c130.dat
Binary file not shown.
Binary file added hms_db/seg0/c141.dat
Binary file not shown.
Binary file added hms_db/seg0/c150.dat
Binary file not shown.
Binary file added hms_db/seg0/c161.dat
Binary file not shown.
Binary file added hms_db/seg0/c171.dat
Binary file not shown.
Binary file added hms_db/seg0/c180.dat
Binary file not shown.
Binary file added hms_db/seg0/c191.dat
Binary file not shown.
Binary file added hms_db/seg0/c1a1.dat
Binary file not shown.
Binary file added hms_db/seg0/c1b1.dat
Binary file not shown.
Binary file added hms_db/seg0/c1c0.dat
Binary file not shown.
Binary file added hms_db/seg0/c1d1.dat
Binary file not shown.
Binary file added hms_db/seg0/c1e0.dat
Binary file not shown.
Binary file added hms_db/seg0/c1f1.dat
Binary file not shown.
Binary file added hms_db/seg0/c20.dat
Binary file not shown.
Binary file added hms_db/seg0/c200.dat
Binary file not shown.
Binary file added hms_db/seg0/c211.dat
Binary file not shown.
Binary file added hms_db/seg0/c221.dat
Binary file not shown.
Binary file added hms_db/seg0/c230.dat
Binary file not shown.
Binary file added hms_db/seg0/c241.dat
Binary file not shown.
Binary file added hms_db/seg0/c251.dat
Binary file not shown.
Binary file added hms_db/seg0/c260.dat
Binary file not shown.
Binary file added hms_db/seg0/c271.dat
Binary file not shown.
Binary file added hms_db/seg0/c281.dat
Binary file not shown.
Binary file added hms_db/seg0/c290.dat
Binary file not shown.
Binary file added hms_db/seg0/c2a1.dat
Binary file not shown.
Binary file added hms_db/seg0/c2b1.dat
Binary file not shown.
Binary file added hms_db/seg0/c2c1.dat
Binary file not shown.
Binary file added hms_db/seg0/c2d0.dat
Binary file not shown.
Binary file added hms_db/seg0/c2e1.dat
Binary file not shown.
Binary file added hms_db/seg0/c2f0.dat
Binary file not shown.
Binary file added hms_db/seg0/c300.dat
Binary file not shown.
Binary file added hms_db/seg0/c31.dat
Binary file not shown.
Binary file added hms_db/seg0/c311.dat
Binary file not shown.
Binary file added hms_db/seg0/c321.dat
Binary file not shown.
Binary file added hms_db/seg0/c331.dat
Binary file not shown.
Binary file added hms_db/seg0/c340.dat
Binary file not shown.
Binary file added hms_db/seg0/c351.dat
Binary file not shown.
Binary file added hms_db/seg0/c361.dat
Binary file not shown.
Binary file added hms_db/seg0/c371.dat
Binary file not shown.
Binary file added hms_db/seg0/c380.dat
Binary file not shown.
Binary file added hms_db/seg0/c391.dat
Binary file not shown.
Binary file added hms_db/seg0/c3a1.dat
Binary file not shown.
Binary file added hms_db/seg0/c3b1.dat
Binary file not shown.
Binary file added hms_db/seg0/c3c0.dat
Binary file not shown.
Binary file added hms_db/seg0/c3d1.dat
Binary file not shown.
Binary file added hms_db/seg0/c3e1.dat
Binary file not shown.
Binary file added hms_db/seg0/c3f1.dat
Binary file not shown.
Binary file added hms_db/seg0/c400.dat
Binary file not shown.
Binary file added hms_db/seg0/c41.dat
Binary file not shown.
Binary file added hms_db/seg0/c411.dat
Binary file not shown.
Binary file added hms_db/seg0/c421.dat
Binary file not shown.
Binary file added hms_db/seg0/c430.dat
Binary file not shown.
Binary file added hms_db/seg0/c441.dat
Binary file not shown.
Binary file added hms_db/seg0/c451.dat
Binary file not shown.
Binary file added hms_db/seg0/c461.dat
Binary file not shown.
Binary file added hms_db/seg0/c470.dat
Binary file not shown.
Binary file added hms_db/seg0/c481.dat
Binary file not shown.
Binary file added hms_db/seg0/c51.dat
Binary file not shown.
Binary file added hms_db/seg0/c60.dat
Binary file not shown.
Binary file added hms_db/seg0/c71.dat
Binary file not shown.
Binary file added hms_db/seg0/c710.dat
Binary file not shown.
Binary file added hms_db/seg0/c721.dat
Binary file not shown.
Binary file added hms_db/seg0/c730.dat
Binary file not shown.
Binary file added hms_db/seg0/c741.dat
Binary file not shown.
Binary file added hms_db/seg0/c750.dat
Binary file not shown.
Binary file added hms_db/seg0/c761.dat
Binary file not shown.
Binary file added hms_db/seg0/c770.dat
Binary file not shown.
Binary file added hms_db/seg0/c781.dat
Binary file not shown.
Binary file added hms_db/seg0/c790.dat
Binary file not shown.
Binary file added hms_db/seg0/c7a1.dat
Binary file not shown.
Binary file added hms_db/seg0/c81.dat
Binary file not shown.
Binary file added hms_db/seg0/c90.dat
Binary file not shown.
Binary file added hms_db/seg0/ca1.dat
Binary file not shown.
Binary file added hms_db/seg0/cb1.dat
Binary file not shown.
Binary file added hms_db/seg0/cc0.dat
Binary file not shown.
Binary file added hms_db/seg0/cd1.dat
Binary file not shown.
Binary file added hms_db/seg0/ce1.dat
Binary file not shown.
Binary file added hms_db/seg0/cf0.dat
Binary file not shown.
Binary file added hms_db/seg0/d670.dat
Binary file not shown.
Binary file added hms_db/seg0/d681.dat
Binary file not shown.
Binary file added hms_db/seg0/d690.dat
Binary file not shown.
Binary file added hms_db/seg0/d6a1.dat
Binary file not shown.
Binary file added hms_db/seg0/d6b0.dat
Binary file not shown.
Binary file added hms_db/seg0/d6c1.dat
Binary file not shown.
Binary file added hms_db/seg0/d6d0.dat
Binary file not shown.
Binary file added hms_db/seg0/d6e1.dat
Binary file not shown.
Binary file added hms_db/seg0/d6f0.dat
Binary file not shown.
Binary file added hms_db/seg0/d701.dat
Binary file not shown.
23 changes: 23 additions & 0 deletions hms_db/service.properties
@@ -0,0 +1,23 @@
#C:\Users\rahuld\Documents\workspace-sts-3.8.3.RELEASE\hms\hms\hms_db
# ********************************************************************
# *** Please do NOT edit this file. ***
# *** CHANGING THE CONTENT OF THIS FILE MAY CAUSE DATA CORRUPTION. ***
# ********************************************************************
#Mon Sep 04 19:01:50 IST 2017
SysschemasIndex2Identifier=225
SyscolumnsIdentifier=144
SysconglomeratesIndex1Identifier=49
SysconglomeratesIdentifier=32
SyscolumnsIndex2Identifier=177
SysschemasIndex1Identifier=209
SysconglomeratesIndex3Identifier=81
SystablesIndex2Identifier=129
SyscolumnsIndex1Identifier=161
derby.serviceProtocol=org.apache.derby.database.Database
SysschemasIdentifier=192
derby.storage.propertiesId=16
SysconglomeratesIndex2Identifier=65
derby.serviceLocale=en_US
SystablesIdentifier=96
SystablesIndex1Identifier=113
#--- last line, don't put anything after this line ---
45 changes: 45 additions & 0 deletions pom.xml
@@ -0,0 +1,45 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.hms</groupId>
<artifactId>hms</artifactId>
<version>0.0.1-SNAPSHOT</version>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.6.RELEASE</version>
</parent>

<properties>
<java.version>1.8</java.version>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.13.1.1</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
13 changes: 13 additions & 0 deletions src/main/java/com/hms/HMSApplication.java
@@ -0,0 +1,13 @@
package com.hms;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class HMSApplication {

public static void main(String[] args) {
SpringApplication.run(HMSApplication.class, args);
}

}
12 changes: 12 additions & 0 deletions src/main/java/com/hms/constants/Bill_Constant.java
@@ -0,0 +1,12 @@
package com.hms.constants;

public class Bill_Constant {
public static final String FETCH_SQL_BY_ID = "select * from Bill where id = :id";
public static final String FETCH_SQL = "select * from Bill";
public static final String INSERT_SQL = "insert into Bill( particular,quantity,unitValue)"
+ " values(:particular, :quantity, :unitValue)";
public static final String UPDATE_SQL = "update Bill set particular=:particular, quantity=:quantity, "
+ "unitValue=:unitValue where id=:id";
public static final String DELETE_SQL = "delete from Bill where id=:id";

}
13 changes: 13 additions & 0 deletions src/main/java/com/hms/constants/Doctor_Constant.java
@@ -0,0 +1,13 @@
package com.hms.constants;

public class Doctor_Constant {

public static final String FETCH_SQL_BY_ID = "select * from Doctor where id = :id";
public static final String FETCH_SQL_BY_NAME = "select * from Doctor where name = :name";
public static final String FETCH_SQL = "select * from Doctor";
public static final String INSERT_SQL = "insert into Doctor( name,designation,degree,experience,address,emailId,contactNumber)"
+ " values(:name,:designation,:degree,:experience, :address, :emailId, :contactNumber)";
public static final String UPDATE_SQL = "update Doctor set name=:name, designation=:designation,degree=:degree,experience=:experience,"
+ "address=:address, emailId=:emailId, contactNumber=:contactNumber where id=:id";
public static final String DELETE_SQL = "delete from Doctor where id=:id";
}
10 changes: 10 additions & 0 deletions src/main/java/com/hms/constants/Hospital_Constant.java
@@ -0,0 +1,10 @@
package com.hms.constants;

public class Hospital_Constant {
public static final String FETCH_SQL = "select * from Hospital";
public static final String INSERT_SQL = "insert into Hospital( name,address,website,contactNumber)"
+ " values(:name, :address, :website, :contactNumber)";
public static final String UPDATE_SQL = "update Hospital set name=:name, address=:address, "
+ "website=:website, contactNumber=:contactNumber where id=:id";
public static final String DELETE_SQL = "delete from Hospital where id=:id";
}
11 changes: 11 additions & 0 deletions src/main/java/com/hms/constants/Invoice_Constant.java
@@ -0,0 +1,11 @@
package com.hms.constants;

public class Invoice_Constant {
public static final String FETCH_SQL_BY_ID = "select * from Invoice where id = :id";
public static final String FETCH_SQL = "select * from Invoice";
public static final String INSERT_SQL = "insert into Invoice( patientId,doctorId,billId,totalAmount)"
+ " values(:patientId, :doctorId, :billId, :totalAmount)";
public static final String UPDATE_SQL = "update Invoice set patientId=:patientId, doctorId=:doctorId, "
+ "billId=:billId, totalAmount=:totalAmount where id=:id";
public static final String DELETE_SQL = "delete from Invoice where id=:id";
}
12 changes: 12 additions & 0 deletions src/main/java/com/hms/constants/Patient_Constant.java
@@ -0,0 +1,12 @@
package com.hms.constants;

public class Patient_Constant {
public static final String FETCH_SQL_BY_ID = "select * from Patient where id = :id";
public static final String FETCH_SQL_BY_NAME = "select * from Patient where name = :name";
public static final String FETCH_SQL = "select * from Patient";
public static final String INSERT_SQL = "insert into Patient( name,address,gender,disease,emailId,contactNumber)"
+ " values(:name, :address,:gender,:disease, :emailId, :contactNumber)";
public static final String UPDATE_SQL = "update Patient set name=:name, address=:address,gender=:gender, "
+ "disease=:disease, emailId=:emailId, contactNumber=:contactNumber where id=:id";
public static final String DELETE_SQL = "delete from Patient where id=:id";
}
64 changes: 64 additions & 0 deletions src/main/java/com/hms/controller/HMSController.java
@@ -0,0 +1,64 @@
package com.hms.controller;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.hms.model.Doctor;
import com.hms.model.Invoice;
import com.hms.model.Patient;
import com.hms.service.HMSService;

@RestController
@RequestMapping("/hms")
@CrossOrigin("localhost:8080")
public class HMSController {

@Autowired
HMSService service;

@RequestMapping("/")
String home() {
return "<h1>Welcome to Hospital Management System</h1>";
}

//Doctors

@RequestMapping("/doctorInfo")
List<Doctor> showAllDoctors(){
List<Doctor> listAllDoctors= new ArrayList<>();
listAllDoctors=service.showAllDoctors();
return listAllDoctors;
}

@RequestMapping("/doctorInfo/viewByName/{name}")
Doctor doctorViewByName(@PathVariable("name") String name ) {
return service.searchDoctorByName(name);
}

//Patients

@RequestMapping("/patientInfo")
List<Patient> showAllPatients(){
List<Patient> listAllPatients= new ArrayList<Patient>();
listAllPatients=service.showAllPatients();
return listAllPatients;
}

@RequestMapping("/patientInfo/viewByName/{name}")
Patient patientViewByName(@PathVariable("name") String name ) {
return service.searchPatientByName(name);
}

//Invoice
@RequestMapping("/invoice")
List<Invoice> showinvoice(){
return service.showInvoice();
}

}
9 changes: 9 additions & 0 deletions src/main/java/com/hms/dao/BillDAO.java
@@ -0,0 +1,9 @@
package com.hms.dao;

import org.springframework.stereotype.Repository;

@Repository
public class BillDAO {


}

0 comments on commit 3c8c820

Please sign in to comment.