Skip to content

Commit 22713af

Browse files
authored
Merge pull request #34 from EMResearch/gestaohospital
gestaohospital case study with embeddedcontroller
2 parents 62c33d6 + 9f3e719 commit 22713af

94 files changed

Lines changed: 16226 additions & 2 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ hs_err_pid*
140140
/jdk_8_maven/em/embedded/graphql/graphql-scs/target
141141
/jdk_8_maven/em/external/graphql/graphql-ncs/target
142142
/jdk_8_maven/em/external/graphql/graphql-scs/target
143+
/jdk_8_maven/cs/rest-gui/gestaohospital/target/
144+
/jdk_8_maven/em/external/rest/gestaohospital/target/
145+
/jdk_8_maven/em/embedded/rest/gestaohospital/target/
143146

144147
/jdk_11_maven/temp
145148
/jdk_11_maven/cs/rest/cwa-verification-server/target
@@ -152,8 +155,7 @@ hs_err_pid*
152155
/jdk_11_gradle/em/external/graphql/patio-api/build
153156

154157

155-
/jdk_8_maven/em/external/rest/restcountries/target/
156-
/jdk_8_maven/em/embedded/rest/restcountries/target/
158+
157159

158160
### JavaScript
159161
/venv/
@@ -209,3 +211,4 @@ dotnet_3/em/embedded/rest/SampleProjectDriver/logs/
209211

210212

211213

214+

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ We just re-implemented in different languages, and put them behind a web service
6969

7070
* CWA-Verification-Server (Apache), from [https://github.com/corona-warn-app/cwa-verification-server](https://github.com/corona-warn-app/cwa-verification-server)
7171

72+
* Gestao Hospital (not-known license), from [https://github.com/ValchanOficial/GestaoHospital](https://github.com/ValchanOficial/GestaoHospital)
73+
7274
* NCS (not-known license, artificial numerical examples coming from different sources)
7375

7476
* SCS (not-known license, artificial string examples coming from different sources)
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Sistema de Gestão Hospitalar
2+
3+
## Objetivo
4+
5+
O objetivo do projeto é criar uma API para organizar um sistema público de saúde.
6+
7+
## Contextualização
8+
9+
O Sistema Único de Saúde (SUS) é um dos maiores e mais complexos sistemas de saúde pública do mundo, abrangendo desde o simples atendimento para avaliação da pressão arterial, por meio da Atenção Básica, até o transplante de órgãos, garantindo acesso integral, universal e gratuito para toda a população do país. Com a sua criação, o SUS proporcionou o acesso universal ao sistema público de saúde, sem discriminação. A atenção integral à saúde, e não somente aos cuidados assistenciais, passou a ser um direito de todos os brasileiros, desde a gestação e por toda a vida, com foco na saúde com qualidade de vida, visando a prevenção e a promoção da saúde. O objetivo desse projeto é criar uma ferramenta para auxiliar o SUS, evitar desperdício e potencializar os recursos a partir dos pacientes.
10+
11+
Ao final do programa, além de apresentar a API criada, cada squad deverá expor quais são os pontos de melhoria e quais seriam os próximos passos no projeto, caso fossem seguir adiante.
12+
13+
## Requisitos técnicos obrigatórios
14+
15+
Para o projeto é necessário que as squads se utilizem dos aprendizados repassados pelo programa AceleraDev, portanto a solução deve ser construída de acordo com os seguintes requisitos:
16+
17+
- Banco de dados;
18+
- Desenvolvimento do backend e APIs com Java Spring Boot;
19+
- Testes unitários são obrigatórios
20+
21+
## Definições do Sistema
22+
23+
- Todo hospital tem um estoque contendo diversos produtos.
24+
- Um estoque tem produtos e suas respectivas quantidades.
25+
- Dentro do estoque também tem banco de sangue
26+
- O hospital também possui leitos.
27+
- Ao encontrar um paciente é importante o recomendar para um hospital mais próximo e que tenha vaga disponível.
28+
- Caso o hospital precise de um produto, por exemplo, um banco de sangue, é importante fazer o envio do hospital mais próximo ao local.
29+
- Caso o hospital tenha apenas 4 itens ou 4 litros ele terá apenas o suficiente para o próprio hospital.
30+
31+
## Exemplos de chamadas:
32+
33+
A partir da API que gerencia os hospitais dentro do SUS o usuário conseguirá, por exemplo:
34+
35+
- Cadastrar o hospital
36+
- A partir da localização do paciente indicar o hospital mais próximo.
37+
- Realizar check-in/ check-out do paciente no hospital
38+
- Verificar quantos leitos disponíveis no hospital
39+
- Cadastrar produtos e suas respectivas quantidades
40+
- Cadastrar e gerenciar banco de sangue
41+
42+
### /v1/hospitais/{id}
43+
44+
Método: GET
45+
Retorna as informações do hospital, por exemplo:
46+
47+
- Nome
48+
- Endereço
49+
- Número de leitos
50+
- Números de leitos disponíveis
51+
52+
### /v1/hospitais/{id}/estoque
53+
54+
Método: GET
55+
Retorna as informações dos produtos existentes estoque, por exemplo.
56+
57+
### /v1/hospitais/{id}/estoque/{produto}
58+
59+
Método: GET
60+
Retorna mais detalhes de um produto.
61+
62+
- Nome
63+
- Descrição
64+
- Quantidade
65+
66+
### /v1/hospitais/{id}/pacientes
67+
68+
Método: GET
69+
Retorna o nome dos pacientes dentro do hospital.
70+
71+
### /v1/hospitais/{id}/pacientes/{paciente}
72+
73+
Método: GET
74+
Retorna todas as informações do paciente cadastrado, por exemplo:
75+
76+
- Nome completo
77+
- CPF
78+
- Data de nascimento
79+
- Sexo
80+
- Data de entrada no hospital.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
# Only exists if Bazel was run
8+
/bazel-out
9+
10+
# dependencies
11+
/node_modules
12+
13+
# profiling files
14+
chrome-profiler-events.json
15+
speed-measure-plugin.json
16+
17+
# IDEs and editors
18+
/.idea
19+
.project
20+
.classpath
21+
.c9/
22+
*.launch
23+
.settings/
24+
*.sublime-workspace
25+
26+
# IDE - VSCode
27+
.vscode/*
28+
!.vscode/settings.json
29+
!.vscode/tasks.json
30+
!.vscode/launch.json
31+
!.vscode/extensions.json
32+
.history/*
33+
34+
# misc
35+
/.sass-cache
36+
/connect.lock
37+
/coverage
38+
/libpeerconnection.log
39+
npm-debug.log
40+
yarn-error.log
41+
testem.log
42+
/typings
43+
44+
# System Files
45+
.DS_Store
46+
Thumbs.db
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# HospitalUi
2+
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.3.7.
4+
5+
## Development server
6+
7+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
8+
9+
## Code scaffolding
10+
11+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
12+
13+
## Build
14+
15+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
16+
17+
## Running unit tests
18+
19+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20+
21+
## Running end-to-end tests
22+
23+
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24+
25+
## Further help
26+
27+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"hospital-ui": {
7+
"root": "",
8+
"sourceRoot": "src",
9+
"projectType": "application",
10+
"prefix": "app",
11+
"schematics": {},
12+
"architect": {
13+
"build": {
14+
"builder": "@angular-devkit/build-angular:browser",
15+
"options": {
16+
"outputPath": "dist/hospital-ui",
17+
"index": "src/index.html",
18+
"main": "src/main.ts",
19+
"polyfills": "src/polyfills.ts",
20+
"tsConfig": "src/tsconfig.app.json",
21+
"assets": [
22+
"src/favicon.ico",
23+
"src/assets"
24+
],
25+
"styles": [
26+
"node_modules/primeflex/primeflex.css",
27+
"node_modules/primeicons/primeicons.css",
28+
"node_modules/primeng/resources/themes/nova-light/theme.css",
29+
"node_modules/primeng/resources/primeng.min.css",
30+
"src/styles.css"
31+
],
32+
"scripts": [],
33+
"es5BrowserSupport": true
34+
},
35+
"configurations": {
36+
"production": {
37+
"fileReplacements": [
38+
{
39+
"replace": "src/environments/environment.ts",
40+
"with": "src/environments/environment.prod.ts"
41+
}
42+
],
43+
"optimization": true,
44+
"outputHashing": "all",
45+
"sourceMap": false,
46+
"extractCss": true,
47+
"namedChunks": false,
48+
"aot": true,
49+
"extractLicenses": true,
50+
"vendorChunk": false,
51+
"buildOptimizer": true,
52+
"budgets": [
53+
{
54+
"type": "initial",
55+
"maximumWarning": "2mb",
56+
"maximumError": "5mb"
57+
}
58+
]
59+
}
60+
}
61+
},
62+
"serve": {
63+
"builder": "@angular-devkit/build-angular:dev-server",
64+
"options": {
65+
"browserTarget": "hospital-ui:build"
66+
},
67+
"configurations": {
68+
"production": {
69+
"browserTarget": "hospital-ui:build:production"
70+
}
71+
}
72+
},
73+
"extract-i18n": {
74+
"builder": "@angular-devkit/build-angular:extract-i18n",
75+
"options": {
76+
"browserTarget": "hospital-ui:build"
77+
}
78+
},
79+
"test": {
80+
"builder": "@angular-devkit/build-angular:karma",
81+
"options": {
82+
"main": "src/test.ts",
83+
"polyfills": "src/polyfills.ts",
84+
"tsConfig": "src/tsconfig.spec.json",
85+
"karmaConfig": "src/karma.conf.js",
86+
"styles": [
87+
"src/styles.css"
88+
],
89+
"scripts": [],
90+
"assets": [
91+
"src/favicon.ico",
92+
"src/assets"
93+
]
94+
}
95+
},
96+
"lint": {
97+
"builder": "@angular-devkit/build-angular:tslint",
98+
"options": {
99+
"tsConfig": [
100+
"src/tsconfig.app.json",
101+
"src/tsconfig.spec.json"
102+
],
103+
"exclude": [
104+
"**/node_modules/**"
105+
]
106+
}
107+
}
108+
}
109+
},
110+
"hospital-ui-e2e": {
111+
"root": "e2e/",
112+
"projectType": "application",
113+
"prefix": "",
114+
"architect": {
115+
"e2e": {
116+
"builder": "@angular-devkit/build-angular:protractor",
117+
"options": {
118+
"protractorConfig": "e2e/protractor.conf.js",
119+
"devServerTarget": "hospital-ui:serve"
120+
},
121+
"configurations": {
122+
"production": {
123+
"devServerTarget": "hospital-ui:serve:production"
124+
}
125+
}
126+
},
127+
"lint": {
128+
"builder": "@angular-devkit/build-angular:tslint",
129+
"options": {
130+
"tsConfig": "e2e/tsconfig.e2e.json",
131+
"exclude": [
132+
"**/node_modules/**"
133+
]
134+
}
135+
}
136+
}
137+
}
138+
},
139+
"defaultProject": "hospital-ui"
140+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Protractor configuration file, see link for more information
2+
// https://github.com/angular/protractor/blob/master/lib/config.ts
3+
4+
const { SpecReporter } = require('jasmine-spec-reporter');
5+
6+
exports.config = {
7+
allScriptsTimeout: 11000,
8+
specs: [
9+
'./src/**/*.e2e-spec.ts'
10+
],
11+
capabilities: {
12+
'browserName': 'chrome'
13+
},
14+
directConnect: true,
15+
baseUrl: 'http://localhost:4200/',
16+
framework: 'jasmine',
17+
jasmineNodeOpts: {
18+
showColors: true,
19+
defaultTimeoutInterval: 30000,
20+
print: function() {}
21+
},
22+
onPrepare() {
23+
require('ts-node').register({
24+
project: require('path').join(__dirname, './tsconfig.e2e.json')
25+
});
26+
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
27+
}
28+
};
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { AppPage } from './app.po';
2+
import { browser, logging } from 'protractor';
3+
4+
describe('workspace-project App', () => {
5+
let page: AppPage;
6+
7+
beforeEach(() => {
8+
page = new AppPage();
9+
});
10+
11+
it('should display welcome message', () => {
12+
page.navigateTo();
13+
expect(page.getTitleText()).toEqual('Welcome to hospital-ui!');
14+
});
15+
16+
afterEach(async () => {
17+
// Assert that there are no errors emitted from the browser
18+
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
19+
expect(logs).not.toContain(jasmine.objectContaining({
20+
level: logging.Level.SEVERE,
21+
} as logging.Entry));
22+
});
23+
});

0 commit comments

Comments
 (0)