forked from FEMR/femr
-
Notifications
You must be signed in to change notification settings - Fork 0
admin ui MVC set up #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
siriwans
wants to merge
6
commits into
master
Choose a base branch
from
siri_405
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a7d8fcd
admin ui MVC set up
siriwans b63e4f0
i dont want to break this
mmachiya 6254ba4
deleted unecessary file
siriwans 97ee7f8
pr comments
siriwans 93fd02e
Merge branch 'siri_405' of https://github.com/CPSECapstone/femr into …
siriwans 23543a5
more pr comments
siriwans File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
fEMR - fast Electronic Medical Records | ||
Copyright (C) 2014 Team fEMR | ||
|
||
fEMR is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
fEMR is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
|
||
You should have received a copy of the GNU General Public License | ||
along with fEMR. If not, see <http://www.gnu.org/licenses/>. If | ||
you have any questions, contact <[email protected]>. | ||
*/ | ||
package femr.business.services.core; | ||
|
||
import femr.common.dtos.ServiceResponse; | ||
import femr.data.models.core.IKitStatus; | ||
import femr.data.models.core.INetworkStatus; | ||
import femr.data.models.core.IDatabaseStatus; | ||
|
||
import java.util.List; | ||
|
||
public interface IUpdatesService { | ||
|
||
/** | ||
* Retrieve network statuses. | ||
* | ||
* @return a list of current network statues. | ||
*/ | ||
ServiceResponse<List<? extends INetworkStatus>> retrieveNetworkStatuses(); | ||
|
||
/** | ||
* Update network statuses. | ||
* | ||
* @return a list of network statues after the update (update by running a script). | ||
*/ | ||
ServiceResponse<List<? extends INetworkStatus>> updateNetworkStatuses(); | ||
|
||
/** | ||
* Retrieve network statuses. | ||
* | ||
* @return a list of current network statues. | ||
*/ | ||
ServiceResponse<List<? extends IKitStatus>> retrieveKitStatuses(); | ||
|
||
/** | ||
* Update kit statuses. | ||
* | ||
* @return a list of kit statuses after the update (update by running a script?). | ||
*/ | ||
ServiceResponse<List<? extends IKitStatus>> updateKitStatuses(); | ||
|
||
/** | ||
* Retrieve database last update. | ||
* | ||
* @return a list of current database status. | ||
*/ | ||
ServiceResponse<List<? extends IDatabaseStatus>> retrieveDatabaseStatuses(); | ||
|
||
/** | ||
* Update database last update and do the backup via script. | ||
* | ||
* @return a list of kit database status. | ||
*/ | ||
ServiceResponse<List<? extends IDatabaseStatus>> updateDatabaseStatuses(); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
/* | ||
fEMR - fast Electronic Medical Records | ||
Copyright (C) 2014 Team fEMR | ||
|
||
fEMR is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
fEMR is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
|
||
You should have received a copy of the GNU General Public License | ||
along with fEMR. If not, see <http://www.gnu.org/licenses/>. If | ||
you have any questions, contact <[email protected]>. | ||
*/ | ||
package femr.business.services.system; | ||
|
||
import com.google.inject.Inject; | ||
import femr.business.services.core.IUpdatesService; | ||
import femr.common.dtos.ServiceResponse; | ||
import femr.data.daos.IRepository; | ||
import femr.data.models.core.IKitStatus; | ||
import femr.data.models.core.INetworkStatus; | ||
import femr.data.models.core.IDatabaseStatus; | ||
import femr.data.models.mysql.KitStatus; | ||
import femr.data.models.mysql.NetworkStatus; | ||
import femr.data.models.mysql.DatabaseStatus; | ||
|
||
import java.util.List; | ||
|
||
public class UpdatesService implements IUpdatesService { | ||
|
||
private final IRepository<INetworkStatus> networkStatusRepository; | ||
private final IRepository<IKitStatus> kitStatusRepository; | ||
private final IRepository<IDatabaseStatus> databaseStatusRepository; | ||
|
||
@Inject | ||
public UpdatesService(IRepository<INetworkStatus> networkStatusRepository, | ||
IRepository<IKitStatus> kitStatusRepository, | ||
IRepository<IDatabaseStatus> databaseStatusRepository) { | ||
this.networkStatusRepository = networkStatusRepository; | ||
this.kitStatusRepository = kitStatusRepository; | ||
this.databaseStatusRepository = databaseStatusRepository; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public ServiceResponse<List<? extends INetworkStatus>> retrieveNetworkStatuses() { | ||
ServiceResponse<List<? extends INetworkStatus>> response = new ServiceResponse<>(); | ||
try { | ||
List<? extends INetworkStatus> networkStatuses = networkStatusRepository.findAll(NetworkStatus.class); | ||
response.setResponseObject(networkStatuses); | ||
|
||
} catch (Exception ex) { | ||
response.addError("", ex.getMessage()); | ||
} | ||
return response; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public ServiceResponse<List<? extends INetworkStatus>> updateNetworkStatuses() { | ||
ServiceResponse<List<? extends INetworkStatus>> response = new ServiceResponse<>(); | ||
//TODO: Lemur Team update the database with the right values | ||
return response; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public ServiceResponse<List<? extends IKitStatus>> retrieveKitStatuses() { | ||
ServiceResponse<List<? extends IKitStatus>> response = new ServiceResponse<>(); | ||
try { | ||
List<? extends IKitStatus> kitStatuses = kitStatusRepository.findAll(KitStatus.class); | ||
response.setResponseObject(kitStatuses); | ||
|
||
} catch (Exception ex) { | ||
response.addError("", ex.getMessage()); | ||
} | ||
return response; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public ServiceResponse<List<? extends IKitStatus>> updateKitStatuses() { | ||
ServiceResponse<List<? extends IKitStatus>> response = new ServiceResponse<>(); | ||
//TODO: Lemur Team update the database with the right values | ||
return response; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public ServiceResponse<List<? extends IDatabaseStatus>> retrieveDatabaseStatuses() { | ||
ServiceResponse<List<? extends IDatabaseStatus>> response = new ServiceResponse<>(); | ||
try { | ||
List<? extends IDatabaseStatus> databaseStatuses = databaseStatusRepository.findAll(DatabaseStatus.class); | ||
response.setResponseObject(databaseStatuses); | ||
|
||
} catch (Exception ex) { | ||
response.addError("", ex.getMessage()); | ||
} | ||
return response; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public ServiceResponse<List<? extends IDatabaseStatus>> updateDatabaseStatuses() { | ||
ServiceResponse<List<? extends IDatabaseStatus>> response = new ServiceResponse<>(); | ||
//TODO: Feather Team backup database ---> run script to see if it successsfully return if it succeeds or not | ||
|
||
String updated_date = java.time.LocalDate.now().toString().replace("-", "."); | ||
DatabaseStatus databaseStatus = new DatabaseStatus(); | ||
databaseStatus.setName("Last Backup"); | ||
databaseStatus.setValue(updated_date); | ||
databaseStatusRepository.update(databaseStatus); | ||
|
||
return response; | ||
} | ||
|
||
|
||
} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
fEMR - fast Electronic Medical Records | ||
Copyright (C) 2014 Team fEMR | ||
|
||
fEMR is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
fEMR is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
|
||
You should have received a copy of the GNU General Public License | ||
along with fEMR. If not, see <http://www.gnu.org/licenses/>. If | ||
you have any questions, contact <[email protected]>. | ||
*/ | ||
package femr.data.models.core; | ||
|
||
public interface IDatabaseStatus { | ||
int getId(); | ||
|
||
void setId(int id); | ||
|
||
String getName(); | ||
|
||
void setName(String name); | ||
|
||
String getValue(); | ||
|
||
void setValue(String value); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
fEMR - fast Electronic Medical Records | ||
Copyright (C) 2014 Team fEMR | ||
|
||
fEMR is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
fEMR is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
|
||
You should have received a copy of the GNU General Public License | ||
along with fEMR. If not, see <http://www.gnu.org/licenses/>. If | ||
you have any questions, contact <[email protected]>. | ||
*/ | ||
package femr.data.models.core; | ||
|
||
|
||
public interface IKitStatus { | ||
int getId(); | ||
|
||
void setId(int id); | ||
|
||
String getName(); | ||
|
||
void setName(String name); | ||
|
||
String getValue(); | ||
|
||
void setValue(String value); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
fEMR - fast Electronic Medical Records | ||
Copyright (C) 2014 Team fEMR | ||
|
||
fEMR is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
fEMR is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
|
||
You should have received a copy of the GNU General Public License | ||
along with fEMR. If not, see <http://www.gnu.org/licenses/>. If | ||
you have any questions, contact <[email protected]>. | ||
*/ | ||
package femr.data.models.core; | ||
|
||
public interface IKitUpdate { | ||
int getId(); | ||
|
||
void setId(int id); | ||
|
||
String getName(); | ||
|
||
void setName(String name); | ||
|
||
String getValue(); | ||
|
||
void setValue(String value); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
fEMR - fast Electronic Medical Records | ||
Copyright (C) 2014 Team fEMR | ||
|
||
fEMR is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
fEMR is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
|
||
You should have received a copy of the GNU General Public License | ||
along with fEMR. If not, see <http://www.gnu.org/licenses/>. If | ||
you have any questions, contact <[email protected]>. | ||
*/ | ||
package femr.data.models.core; | ||
|
||
public interface INetworkStatus { | ||
int getId(); | ||
|
||
void setId(int id); | ||
|
||
String getName(); | ||
|
||
void setName(String name); | ||
|
||
String getValue(); | ||
|
||
void setValue(String value); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think adding the date in two places was a backup thing?