Skip to content
Snippets Groups Projects
Commit ac40f1a9 authored by stroredi's avatar stroredi
Browse files

updated

parent fad5a848
Branches
No related tags found
1 merge request!4updated
Showing
with 423 additions and 120 deletions
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:allowBackup="true"
......@@ -19,13 +22,6 @@
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".CapacityStatus"
android:exported="false">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".BlutBildErstellen"
android:exported="false">
......
......@@ -26,6 +26,21 @@ public class Akte {
}
// constructor for the Auftraege
public Akte(int _id, boolean isactive ){
this.id= _id;
this.isActive=isactive;
}
// constructor used for printing out the auftrage in the Dienstleister Section
public Akte(boolean isactived){
isActive=isactived;
}
// to string is necessary for printing the content of a class object
@Override
......
......@@ -4,21 +4,52 @@ import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.Switch;
import android.widget.Toast;
public class Auftraege extends AppCompatActivity {
// Switch switch_auftraege;
Button viewbtn;
ListView listing;
ArrayAdapter patientArrayAdapter2;
DatabaseHelper databaseHelper;
Akte akte;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_auftraege);
Button fifthButton= (Button) findViewById(R.id.button5);
// switch_auftraege=findViewById(R.id.switch6);
viewbtn=findViewById(R.id.button5);
listing=findViewById(R.id.aufraegelist);
fifthButton.setOnClickListener(new View.OnClickListener() {
viewbtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
try {
// akte= new Akte(switch_auftraege.isChecked());
databaseHelper= new DatabaseHelper(Auftraege.this);
patientArrayAdapter2= new ArrayAdapter<Akte>(Auftraege.this, android.R.layout.simple_list_item_1,databaseHelper.search2(akte));
listing.setAdapter(patientArrayAdapter2);
}
catch(Exception e){
Toast.makeText(Auftraege.this,"Error viewing Aufraege", Toast.LENGTH_SHORT).show();
}
}
});
......@@ -26,5 +57,6 @@ public class Auftraege extends AppCompatActivity {
}
}
\ No newline at end of file
......@@ -4,23 +4,84 @@ import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.Switch;
import android.widget.Toast;
public class BlutbildAnordnen extends AppCompatActivity {
EditText id1;
Button viewbtn, anordnenbtn;
ListView plists;
Switch switching; // This will decide if the patinet will
DatabaseHelper databaseHelper;
Akte akte;
ArrayAdapter patientArrayAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_blutbild_anordnen);
Button thirteenthButton = (Button) findViewById(R.id.button13);
id1=findViewById(R.id.editTextTextPersonName3);
viewbtn=findViewById(R.id.button12);
anordnenbtn=findViewById(R.id.button13);
switching=findViewById(R.id.switch4);
plists=findViewById(R.id.anordnen1);
anordnenbtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
try {
databaseHelper=new DatabaseHelper(BlutbildAnordnen.this);
// Initializing the constructor with the id and switch typed in from the user
akte=new Akte(Integer.parseInt(id1.getText().toString()),switching.isChecked());
// Check function if the update was successful
boolean updating= databaseHelper.updateData2(akte);
if (updating==true){
Toast.makeText(BlutbildAnordnen.this,"succesfully assigned bloodtest", Toast.LENGTH_SHORT).show();
}
else{
Toast.makeText(BlutbildAnordnen.this,"blood test assignment failed", Toast.LENGTH_SHORT).show();
}
thirteenthButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});
catch (Exception e){
Toast.makeText(BlutbildAnordnen.this,"assignment failed", Toast.LENGTH_SHORT).show();
}
}
});
viewbtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
databaseHelper= new DatabaseHelper(BlutbildAnordnen.this);
patientArrayAdapter= new ArrayAdapter<Akte>(BlutbildAnordnen.this, android.R.layout.simple_list_item_1,databaseHelper.getEveryone());
plists.setAdapter(patientArrayAdapter);
}
});
}
......
package com.example.firstintent;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class CapacityStatus extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_capacity_status);
Button SecondButton= (Button) findViewById(R.id.buttonclose1);
SecondButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});
}
}
\ No newline at end of file
......@@ -182,6 +182,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
}
// This function is being used by the Dienstleister
public boolean updateData(Akte akte){
SQLiteDatabase db = this.getWritableDatabase();
......@@ -198,6 +199,74 @@ public class DatabaseHelper extends SQLiteOpenHelper {
return true;
}
// update function for the blutbild and mrt anordnen
public boolean updateData2(Akte akte){
SQLiteDatabase db=this.getWritableDatabase(); // use this when writing to the database
ContentValues cv= new ContentValues();
cv.put(COLUMN_ID,akte.getId());
cv.put(COLUMN_ACTIVE_PATIENT,akte.isActive());
db.update(PATIENT_TABLE,cv,"ID = ?", new String[]{String.valueOf(akte.getId())});
return true;
}
// get Auftraege function
public List<Akte> search2 (Akte akte){
List<Akte> returnList = new ArrayList<>();
// get Data from the database
String queryString = "SELECT * FROM " + PATIENT_TABLE +
" WHERE " + COLUMN_ACTIVE_PATIENT +
"=\"" + " 1 " + "\";"; // There does not exist true or false in sqlite . You have to use 0 or 1
SQLiteDatabase db = this.getReadableDatabase();
Cursor cursor = db.rawQuery(queryString, null);
if (cursor.moveToFirst()) {
// loop through the results and create a new patient object and put them into the return list
do {
int patientID = cursor.getInt(0);
String PatientName = cursor.getString(1);
int VersicherungsNumber = cursor.getInt(2);
int roomNumber = cursor.getInt(3);
boolean activePatients = cursor.getInt(4) == 1 ? true : false;
akte = new Akte(patientID, VersicherungsNumber, PatientName, roomNumber, activePatients);
returnList.add(akte);
}
while (cursor.moveToNext());
}
else {
// If there are no results from the database then we will not add anything to the list
}
cursor.close();
db.close();
return returnList;
}
......
......@@ -13,15 +13,5 @@ public class MRTErstellen extends AppCompatActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_mrterstellen);
Button twelfthButton = (Button) findViewById(R.id.button12);
twelfthButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});
}
}
\ No newline at end of file
}
......@@ -4,23 +4,79 @@ import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.Switch;
import android.widget.Toast;
public class MRTanordnen extends AppCompatActivity {
EditText a_id;
Switch switch_id;
Button vbuttoning,updatebtn;
ListView vlists;
DatabaseHelper databaseHelper;
Akte akte;
ArrayAdapter patientArrayAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_mrtanordnen);
Button fourteenthButton = (Button) findViewById(R.id.button14);
a_id=findViewById(R.id.editTextTextPersonName4);
switch_id=findViewById(R.id.switch5);
vbuttoning=findViewById(R.id.button14);
updatebtn=findViewById(R.id.button16);
vlists=findViewById(R.id.mrtlist);
updatebtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
try {
databaseHelper=new DatabaseHelper(MRTanordnen.this);
akte=new Akte(Integer.parseInt(a_id.getText().toString()),switch_id.isChecked());
boolean updating= databaseHelper.updateData2(akte);
if (updating==true){
Toast.makeText(MRTanordnen.this,"succesfully assigned MRI", Toast.LENGTH_SHORT).show();
}
else{
fourteenthButton.setOnClickListener(new View.OnClickListener() {
Toast.makeText(MRTanordnen.this,"MRI assignment failed", Toast.LENGTH_SHORT).show();
}
}
catch (Exception e){
Toast.makeText(MRTanordnen.this,"MRT failed", Toast.LENGTH_SHORT).show();
}
}
});
// View all button
vbuttoning.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
databaseHelper= new DatabaseHelper(MRTanordnen.this);
patientArrayAdapter= new ArrayAdapter<Akte>(MRTanordnen.this, android.R.layout.simple_list_item_1,databaseHelper.getEveryone());
vlists.setAdapter(patientArrayAdapter);
}
});
}
......
......@@ -59,7 +59,6 @@ public class PatientenSuche extends AppCompatActivity {
listings.setAdapter(patientArrayAdapter);
}
catch(Exception e){
Toast.makeText(PatientenSuche.this,"Error searching patient", Toast.LENGTH_SHORT).show();
......
......@@ -34,9 +34,5 @@ public class Verwaltung extends AppCompatActivity {
startActivity(i);
}
public void CapacityStatus(View view) {
Intent i = new Intent(this, CapacityStatus.class);
startActivity(i);
}
}
\ No newline at end of file
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M21,19V5c0,-1.1 -0.9,-2 -2,-2H5c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2zM8.5,13.5l2.5,3.01L14.5,12l4.5,6H5l3.5,-4.5z"/>
</vector>
......@@ -8,11 +8,28 @@
<Button
android:id="@+id/button5"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="297dp"
android:text="close"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:text="View"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ListView
android:id="@+id/aufraegelist"
android:layout_width="409dp"
android:layout_height="571dp"
android:layout_marginStart="8dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/button5" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -6,13 +6,61 @@
android:layout_height="match_parent"
tools:context=".BlutbildAnordnen">
<EditText
android:id="@+id/editTextTextPersonName3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:ems="10"
android:hint="ID"
android:inputType="textPersonName"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Switch
android:id="@+id/switch4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="Switch"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editTextTextPersonName3" />
<Button
android:id="@+id/button12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="8dp"
android:text="ViewAll"
app:layout_constraintEnd_toStartOf="@+id/button13"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/switch4" />
<Button
android:id="@+id/button13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="140dp"
android:layout_marginTop="264dp"
android:text="close"
android:layout_marginStart="8dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="8dp"
android:text="anordnen"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/button12"
app:layout_constraintTop_toBottomOf="@+id/switch4" />
<ListView
android:id="@+id/anordnen1"
android:layout_width="409dp"
android:layout_height="545dp"
android:layout_marginTop="32dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toBottomOf="@+id/button12" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".CapacityStatus">
<Button
android:id="@+id/buttonclose1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="308dp"
android:text="close"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -6,13 +6,64 @@
android:layout_height="match_parent"
tools:context=".MRTanordnen">
<EditText
android:id="@+id/editTextTextPersonName4"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:ems="10"
android:hint="ID"
android:inputType="textPersonName"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Switch
android:id="@+id/switch5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="8dp"
android:text="Switch"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editTextTextPersonName4" />
<Button
android:id="@+id/button14"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="279dp"
android:text="close"
android:layout_marginStart="8dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="8dp"
android:text="Viewall"
app:layout_constraintEnd_toStartOf="@+id/button16"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/switch5" />
<Button
android:id="@+id/button16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:layout_marginEnd="8dp"
android:text="anordnen"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/button14"
app:layout_constraintTop_toBottomOf="@+id/switch5" />
<ListView
android:id="@+id/mrtlist"
android:layout_width="409dp"
android:layout_height="545dp"
android:layout_marginStart="8dp"
android:layout_marginTop="64dp"
android:layout_marginEnd="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toBottomOf="@+id/button14" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -2,17 +2,38 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/constraintLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MRTErstellen">
<Button
android:id="@+id/button12"
<ImageView
android:id="@+id/imageView3"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:srcCompat="@drawable/ic_launcher_background"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:layout_editor_absoluteX="66dp"
tools:layout_editor_absoluteY="181dp" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/SelectImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="268dp"
android:text="close"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
android:src="@drawable/ic_baseline_image_24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginBottom="20dp"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
......@@ -8,47 +8,39 @@
<Button
android:id="@+id/button8"
android:layout_width="221dp"
android:layout_width="0dp"
android:layout_height="61dp"
android:layout_marginStart="4dp"
android:layout_marginTop="68dp"
android:layout_marginTop="100dp"
android:onClick="Patientaufnehmen"
android:text="Patientaufnehmen"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/button10"
android:layout_width="225dp"
android:layout_width="0dp"
android:layout_height="54dp"
android:layout_marginStart="4dp"
android:layout_marginTop="48dp"
android:layout_marginTop="100dp"
android:onClick="PatientEntlassen"
android:text="PatientEntlassen"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.532"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/button8" />
<Button
android:id="@+id/button11"
android:layout_width="238dp"
android:layout_width="0dp"
android:layout_height="56dp"
android:layout_marginStart="4dp"
android:layout_marginTop="28dp"
android:layout_marginTop="100dp"
android:onClick="PatientenVerlegen"
android:text="PatientenVerlegen"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/button10" />
<Button
android:id="@+id/button16"
android:layout_width="236dp"
android:layout_height="57dp"
android:layout_marginStart="4dp"
android:layout_marginBottom="152dp"
android:onClick="CapacityStatus"
android:text="KapazitätStatus"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.549"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/button11"
app:layout_constraintVertical_bias="0.07" />
app:layout_constraintTop_toBottomOf="@+id/button10"
app:layout_constraintVertical_bias="0.0" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment