-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3ce2733
commit 8901ca2
Showing
44 changed files
with
4,102 additions
and
54 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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 @@ | ||
node_modules |
This file contains 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,4 @@ | ||
DATABASE_URL='postgresql://admin:password@postgres:5432/ehr_db?schema=public' | ||
RABBITMQ_URL='amqp://guest:guest@rabbitmq:5672' | ||
REDIS_HOST='redis-stack' | ||
REDIS_PORT='6379' |
This file contains 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,130 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
.pnpm-debug.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
*.lcov | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Snowpack dependency directory (https://snowpack.dev/) | ||
web_modules/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional stylelint cache | ||
.stylelintcache | ||
|
||
# Microbundle cache | ||
.rpt2_cache/ | ||
.rts2_cache_cjs/ | ||
.rts2_cache_es/ | ||
.rts2_cache_umd/ | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variable files | ||
.env | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
.env.local | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
.parcel-cache | ||
|
||
# Next.js build output | ||
.next | ||
out | ||
|
||
# Nuxt.js build / generate output | ||
.nuxt | ||
dist | ||
|
||
# Gatsby files | ||
.cache/ | ||
# Comment in the public line in if your project uses Gatsby and not Next.js | ||
# https://nextjs.org/blog/next-9-1#public-directory-support | ||
# public | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# vuepress v2.x temp and cache directory | ||
.temp | ||
.cache | ||
|
||
# Docusaurus cache and generated files | ||
.docusaurus | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
# TernJS port file | ||
.tern-port | ||
|
||
# Stores VSCode versions used for testing VSCode extensions | ||
.vscode-test | ||
|
||
# yarn v2 | ||
.yarn/cache | ||
.yarn/unplugged | ||
.yarn/build-state.yml | ||
.yarn/install-state.gz | ||
.pnp.* |
This file contains 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,20 @@ | ||
FROM node:18-alpine | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json yarn.lock ./ | ||
|
||
RUN yarn install --frozen-lockfile | ||
|
||
COPY . . | ||
|
||
RUN npx prisma generate | ||
|
||
ENV PORT 8080 | ||
|
||
EXPOSE 8080 | ||
|
||
CMD ["yarn", "dev"] | ||
|
||
|
||
|
This file contains 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,40 @@ | ||
{ | ||
"name": "user", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"scripts": { | ||
"dev": "ts-node-dev -r tsconfig-paths/register ./src/index.ts", | ||
"test": "npx jest", | ||
"build": "tsc && tsc-alias", | ||
"migrate:dev": "prisma migrate dev", | ||
"migrate:prod": "prisma migrate deploy" | ||
}, | ||
"dependencies": { | ||
"@prisma/client": "^5.12.1", | ||
"amqplib": "^0.10.4", | ||
"cors": "^2.8.5", | ||
"dotenv": "^16.4.5", | ||
"express": "^4.19.2", | ||
"ioredis": "^5.4.1", | ||
"morgan": "^1.10.0", | ||
"zod": "^3.22.4" | ||
}, | ||
"devDependencies": { | ||
"@types/amqplib": "^0.10.5", | ||
"@types/cors": "^2.8.17", | ||
"@types/express": "^4.17.21", | ||
"@types/ioredis": "^5.0.0", | ||
"@types/jest": "^29.5.12", | ||
"@types/morgan": "^1.9.9", | ||
"@types/node": "^20.12.6", | ||
"jest": "^29.7.0", | ||
"prisma": "^5.12.1", | ||
"ts-jest": "^29.1.2", | ||
"ts-node-dev": "^2.0.0", | ||
"tsc": "^2.0.4", | ||
"tsc-alias": "^1.8.8", | ||
"tsconfig-paths": "^4.2.0", | ||
"typescript": "^5.4.4" | ||
} | ||
} |
90 changes: 90 additions & 0 deletions
90
services/EHR/prisma/migrations/20240501120311_init/migration.sql
This file contains 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,90 @@ | ||
-- CreateEnum | ||
CREATE TYPE "Gender" AS ENUM ('MALE', 'FEMALE', 'OTHER'); | ||
|
||
-- CreateTable | ||
CREATE TABLE "EHR" ( | ||
"id" TEXT NOT NULL, | ||
"patientId" TEXT NOT NULL, | ||
"medicalHistories" TEXT[], | ||
"allergies" TEXT[], | ||
|
||
CONSTRAINT "EHR_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Patient" ( | ||
"id" TEXT NOT NULL, | ||
"userId" TEXT NOT NULL, | ||
"patientName" TEXT NOT NULL, | ||
"dateOfBirth" TIMESTAMP(3) NOT NULL, | ||
"gender" "Gender" NOT NULL DEFAULT 'MALE', | ||
"medicalHistory" TEXT NOT NULL, | ||
"insuranceInformation" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL, | ||
|
||
CONSTRAINT "Patient_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Medication" ( | ||
"id" TEXT NOT NULL, | ||
"name" TEXT NOT NULL, | ||
"dosage" TEXT NOT NULL, | ||
"start_date" TIMESTAMP(3) NOT NULL, | ||
"end_date" TIMESTAMP(3) NOT NULL, | ||
|
||
CONSTRAINT "Medication_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "DiagnosticReport" ( | ||
"id" TEXT NOT NULL, | ||
"title" TEXT NOT NULL, | ||
"date" TIMESTAMP(3) NOT NULL, | ||
"findings" TEXT NOT NULL, | ||
|
||
CONSTRAINT "DiagnosticReport_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "_EHRToMedication" ( | ||
"A" TEXT NOT NULL, | ||
"B" TEXT NOT NULL | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "_DiagnosticReportToEHR" ( | ||
"A" TEXT NOT NULL, | ||
"B" TEXT NOT NULL | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Patient_userId_key" ON "Patient"("userId"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "_EHRToMedication_AB_unique" ON "_EHRToMedication"("A", "B"); | ||
|
||
-- CreateIndex | ||
CREATE INDEX "_EHRToMedication_B_index" ON "_EHRToMedication"("B"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "_DiagnosticReportToEHR_AB_unique" ON "_DiagnosticReportToEHR"("A", "B"); | ||
|
||
-- CreateIndex | ||
CREATE INDEX "_DiagnosticReportToEHR_B_index" ON "_DiagnosticReportToEHR"("B"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "EHR" ADD CONSTRAINT "EHR_patientId_fkey" FOREIGN KEY ("patientId") REFERENCES "Patient"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "_EHRToMedication" ADD CONSTRAINT "_EHRToMedication_A_fkey" FOREIGN KEY ("A") REFERENCES "EHR"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "_EHRToMedication" ADD CONSTRAINT "_EHRToMedication_B_fkey" FOREIGN KEY ("B") REFERENCES "Medication"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "_DiagnosticReportToEHR" ADD CONSTRAINT "_DiagnosticReportToEHR_A_fkey" FOREIGN KEY ("A") REFERENCES "DiagnosticReport"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "_DiagnosticReportToEHR" ADD CONSTRAINT "_DiagnosticReportToEHR_B_fkey" FOREIGN KEY ("B") REFERENCES "EHR"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
8 changes: 8 additions & 0 deletions
8
services/EHR/prisma/migrations/20240501164038_added_patient_email/migration.sql
This file contains 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,8 @@ | ||
/* | ||
Warnings: | ||
- Added the required column `patientEmail` to the `EHR` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "EHR" ADD COLUMN "patientEmail" TEXT NOT NULL; |
This file contains 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,3 @@ | ||
# Please do not edit this file manually | ||
# It should be added in your version-control system (i.e. Git) | ||
provider = "postgresql" |
Oops, something went wrong.