Compare commits

..
1 Commits
Author SHA1 Message Date
munawwirul_jamal 84d0efecfb Initial commit 2025-12-15 02:44:14 +00:00
1518 changed files with 3 additions and 120633 deletions

No files matched your search

+2 -10
View File
@@ -1,3 +1,4 @@
# ---> Go
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
@@ -11,11 +12,8 @@
# Test binary, built with `go test -c`
*.test
# Code coverage profiles and other test artifacts
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
coverage.*
*.coverprofile
profile.cov
# Dependency directories (remove the comment below to include it)
# vendor/
@@ -26,10 +24,4 @@ go.work.sum
# env file
.env
config.yml
**/atlas.hcl
!**/atlas.hcl.example
# Editor/IDE
.idea/
.vscode/*
-39
View File
@@ -1,39 +0,0 @@
{
"configurations": [
{
"name": "Launch Package main API",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/main-api"
},
{
"name": "Launch Package bpjs API",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/bpjs-api"
},
{
"name": "Launch Package simgos sync API",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/simgos-sync-api"
},
{
"name": "Launch Package main sync API",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/main-sync-api"
},
{
"name": "Launch Package migratioon",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/migration"
}
]
}
-14
View File
@@ -1,14 +0,0 @@
FROM golang:1.24.10 AS builder
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o ./cmd/main-api/main-api ./cmd/main-api/main.go
FROM alpine:latest
WORKDIR /app
COPY --from=builder /src/assets ./assets
COPY --from=builder /src/cmd/main-api/main-api .
COPY --from=builder /src/cmd/main-api/config.yml .
EXPOSE 8010
CMD ["./main-api"]
-14
View File
@@ -1,14 +0,0 @@
FROM golang:1.24.10 AS builder
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o ./cmd/sync-api/sync-api ./cmd/sync-api/main.go
FROM alpine:latest
WORKDIR /app
COPY --from=builder /src/assets ./assets
COPY --from=builder /src/cmd/sync-api/sync-api .
COPY --from=builder /src/cmd/sync-api/config.yml .
EXPOSE 8011
CMD ["./sync-api"]
-50
View File
@@ -1,50 +0,0 @@
# APP DESIGN CONVENTION
## Intro
Uses Go Programming Language, with no framework.
- Why no framework? Go's std libs are already powerfull which aligns with the philosophy of "do one thing well"
- It's common in the Go community that "No framework is the best framework"
Uses community standard layout for the project layout, can be viewed here:<br />
https://github.com/golang-standards/project-layout
Uses Clean Architecture (later writen as CA) approach, can be viewed here:<br />
https://www.freecodecamp.org/news/a-quick-introduction-to-clean-architecture-990c014448d2
Uses kebab-case for the directory naming
## Implementing Clean Architecture (later called CA) in the layout
1. The CA can be implemented simply by using directory structures to represent the layers
2. The CA directories will be inside the "internal" directory due to its nature that the codes inside it is basically intended for the business model
3. The CA will have the following directories:
1. `domain`, with sub-directories:
1. `references`, for common type, const, variabel
2. `main-entities`, for the main models
3. `bpjs-entities`, for the bpjs models. Good to know that this was intitially added but later being stripped for its busines model. This still can be unstriped later.
4. `satusehat-entities`, for the satusehat models
5. ...
2. `application`, with sub-directories:
1. `helpers`, some general helper
2. `main-cases`, for the main flows
3. `bpjs-cases`, the expansion flows for the bpjs
4. `satusehat-cases`, the expansion flows for the satusehat
5. ...
3. `interface`, with sub-directories:
1. `main-handler`
2. `jkn-handler`
3. `main-migration`
4. `satusehat-migration`
5. ....
4. `infra` has no specific-grouping directories, instead, it will have several directories related to each purpose directly like:
1. `jkn`, to connect with jkn service
2. `satusehat`, to connect with satusehat service and satusehat local db
3. `minio`, to connect with minio service
4. ....
4. Several used libraries might have their own infra-purposed feature which will be outside the infra directory.
## ERD to Entity
All of the MainERD, SSERD, and ExtRefERD will be the entities in the implementation. There will be at least 2 databases: main and satusehat. bpjs is still in the consideration.
## Middlewared Use-Case
1. To make the applcation have more dynamic flows, each use-case can implement the midlewared model
2. The idea is to make its basic process of use case clean, adding more flows can be done outside it
3. This method relatively makes the code easier to maintain in the future
-37
View File
@@ -1,37 +0,0 @@
# DATABASE MODELING CONVETION
## Naming
1. Table names are written in combination, with the following rules:
1. Basically uses `PascalCase`
2. An underscore is used in `derived-table`, separating the original name and the derived name.
3. A derived table is a table derived from another table but not used in the main flow of the business process.
4. Examples of derived table implementations include:
1. Archiving, for example: `Transaction_2019`, is an archive of the `Transaction` table for the year `2019`.
2. Trashing for deleted data, for example: `Transaction_deleted`, stores data from the deleted `transaction` table.
3. History for storing historical information, for example: `ProductStock_History`, stores historical data from the `ProductStock` table.
2. Columns are written in combination, with the following rules:
1. Basically, uses `PascalCase`
2. Use underscores to represent relationships <span>`object`-`attribute`</span> or <span>`table`-`column`</span>
<br />Example:
1. `User_Id` represents the `User` object and the `Id` attribute
2. `BestProduct_Code` represents the `BestProduct` object and the `Code` attribute
3. When more than one column has a similar definition, a `prefix` can be added to indicate the column's purpose.
<br />Example:
1. `Admin_User_Id` represents the `Admin` of the `User` object and the `Id` attribute
2. `Operator_User_Id` refers to the `Operator` of the `User` object and the `Id` column.
3. Attributes/properties in JSON (for output purpose) are written in combination, with the following rules:
1. Basically uses `camelCase`
2. Using underscores to represent relationships <span>`object`-`attribute`</span> or <span>`table`-`column`</span>
<br />Example:
1. `user_id` represents the `User` object and the `Id` attribute.
2. `bestProduct_code` represents the `bestProduct` object and the `code` attribute.
3. When more than one column has a similar definition, a `prefix` can be added to indicate the column's purpose.
<br />Example:
1. `admin_user_id` refers to the `admin` of the `user` object and `id` attribute
2. `operator_user_id` refers to the `operator` of the `user` object, column `id`
3. `newArrival_bestProduct_code` refers to the `newArrival` of the `bestProduct` object, column `code`
4. `favorite_bestProduct_code` refers to the `favorite` of the `bestProduct` object, column `code`
## Avoiding Circular Dependency
1. Prioritize the child due to it's nature to define the foreign key. This means the child is allowed to import main entities that define the table, not the base.
2. Parent imports the child's non main entities, can be the base or others depending on the needs.
+1 -54
View File
@@ -1,55 +1,2 @@
# RSSA SIMRS-VX BACKEND
Or in english Hospital Information Management System (HIMS), is a system that
manages the information of the hospitals and the patients.
## Stacks
- Language : Golang<br />
Link: https://go.dev
- Framework : No Framework<br />
Why? Go (Golang) applications often do not require full-fledged frameworks
due to several key aspects of the language and its ecosystem:
- Comprehensive Standard Library: Go's standard library is exceptionally
robust and provides much of the functionality that would typically be found
in frameworks in other languages.
- Simplicity and Explicit Design: Go emphasizes simplicity and clarity.
Frameworks often introduce a degree of "magic" or hidden complexity
through inversion of control, where the framework dictates the
application's flow
- Modular Libraries: Instead of a single, all-encompassing framework, the Go
community favors small, modular libraries that perform specific tasks well.
- Performance and Efficiency: Go is designed for performance and efficiency.
Frameworks can sometimes introduce performance overhead due to their layers
of abstraction.
So? No framewok is the best framework.
- Database : PostgreSQL<br />
Link: https://www.postgresql.org
- Cache : Redis<br />
Link: https://redis.io
- File Server : Minio<br />
Link: https://www.min.io
## Libraries
- Routing Helper: Apem<br />
Link: https://github.com/karincake/apem
- ORM: GORM<br />
Link: https://gorm.io
- Database Migration: Atlas<br />
Link: https://atlasgo.io/guides/orms/gorm/program
## Others
- Project Layout: Golang Standards Project Layout<br />
Link: https://github.com/golang-standards/project-layout
- Architecture: Clean Architecture<br />
Link: https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html
## Commands
- Main api:
- go to the ./cmd/main-api
- run `go run .` to run in debug mode
- run `go build` to build the binary
- Main migration:
- go to the ./cmd/main-migration
- run `go run .` to run in debug mode
- run `go build` to build the binary
# simrsx-be
View File
-147
View File
@@ -1,147 +0,0 @@
<html>
<head>
<meta charset="UTF-8" />
<style>
body {
padding: 10px 30px;
}
table {
width: 100%;
border-collapse: collapse
}
.border-table,
.border-table td,
.border-table th {
border: 1px solid black;
}
.section-title {
margin-top: 1rem;
margin-bottom: 0rem;
}
td {
vertical-align: top;
}
@page {
size: 148mm 210mm;
}
</style>
</head>
<body style="font-family: Arial, sans-serif; line-height: 1.4">
<table style="margin-top: 1rem;">
<tr>
<td>
<img src="logo-1.png" alt="logo" style="height: 70px; margin-bottom: 20px;" />
</td>
<td>
<div>
SURAT RENCANA KONTROL
</div>
<div>
RSUD dr. Saiful Anwar
</div>
</td>
<td style="text-align: right;">
No. : {{ .Number }}
</td>
</tr>
<tr>
<td>
<div>
Kepada Yth
</div>
</td>
<td>
<div>
{{ .Doctor_Name }}
</div>
<div>
Sp./Sub. {{ .DstUnit_Name }}
</div>
</td>
</tr>
</table>
<div style="margin-top: 1rem;">
Mohon Pemeriksaan dan Penanganan Lebih Lanjut:
</div>
<table style="margin-top: 1rem;">
<tr>
<td style="width: 9rem;">
No.Kartu
</td>
<td style="width: 10px;">:</td>
<td>
{{ .CardNumber }}
</td>
</tr>
<tr>
<td>
Nama Peserta
</td>
<td>: </td>
<td>
{{ .Name }}
</td>
</tr>
<tr>
<td>
Tgl.Lahir
</td>
<td>: </td>
<td>
{{ .BirthDate }}
</td>
</tr>
<tr>
<td>
Diagnosa
</td>
<td>: </td>
<td>
{{ .Diagnose }}
</td>
</tr>
<tr>
<td>
Rencana Kontrol
</td>
<td>: </td>
<td>
{{ .PlanDate }}
</td>
</tr>
</table>
<div style="margin: 1rem 0;">
Demikian atas bantuannya, diucapkan banyak terima kasih.
</div>
<table style="width:100%">
<tbody>
<tr>
<td style="width:20%"></td>
<td></td>
<td style="width:20%; text-align: center;">Mengetahui:</td>
</tr>
<tr>
<td style="height:100px"></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Tgl. Cetak: {{ .PrintDate }}</td>
<td></td>
<td style="text-align: center;">{{ .ResponsibleDoctor_Name }}</td>
</tr>
</tbody>
</table>
<div style="height: 3rem;"></div>
</body>
</html>
-325
View File
@@ -1,325 +0,0 @@
<html>
<head>
<meta charset="UTF-8" />
<title>General Consent</title>
</head>
<body
style="font-family: Arial, sans-serif; font-size: 12px; line-height: 1.4"
>
<table style="width: 100%; border-collapse: collapse">
<tr>
<td style="text-align: center">
<img src="logo-1.png" alt="logo" style="height: 70px" />
</td>
<td style="text-align: center">
<div style="font-size: 14px; font-weight: bold">
PEMERINTAH PROVINSI JAWA TIMUR
</div>
<div style="font-size: 14px; font-weight: bold">
RUMAH SAKIT UMUM DAERAH Dr. SAIFUL ANWAR
</div>
<div style="font-size: 13px">
TERAKREDITASI KARS VERSI 2012 TINGKAT PARIPURNA
</div>
<div style="margin-top: 8px">
Jl. Jaksa Agung Suprapto No. 2 MALANG 65111
</div>
<div>Telp. (0341) 362101, Fax. (0341) 362110</div>
<div>Email: [email protected]</div>
<div>Website: www.rsudsaifulanwar.jatimprov.go.id</div>
</td>
<td style="text-align: center">
<img src="logo-rssa.png" alt="logo" style="height: 70px" />
</td>
</tr>
</table>
<hr style="margin: 20px 0" />
<div
style="
text-align: center;
font-weight: bold;
font-size: 14px;
margin-bottom: 5px;
"
>
FORMULIR PEMBERIAN INFORMASI DAN PERSETUJUAN UMUM
</div>
<div style="text-align: center; font-size: 12px; margin-bottom: 20px">
(GENERAL CONSENT)
</div>
<table style="width: 100%; border-collapse: collapse">
<tr>
<td style="width: 3%; vertical-align: top; padding: 6px 4px">1.</td>
<td style="vertical-align: top; padding: 6px 4px">
<b>Hak dan Kewajiban sebagai pasien :</b>
Dengan menandatangani dokumen ini saya mengakui bahwa pada proses
pendaftaran untuk mendapatkan perawatan di RSUD Dr. Saiful Anwar telah
mendapatkan informasi tentang hak dan kewajiban saya sebagai pasien
(melalui leaflet/banner dan atau petugas). Saya berhak mendapatkan
pelayanan kesehatan sesuai standar, mendapatkan informasi yang cukup
tentang keadaan kesehatan, rencana tindakan, manfaat, risiko,
alternatif tindakan, serta biaya yang akan timbul. Saya berkewajiban
memberikan informasi kesehatan yang jujur dan lengkap kepada tenaga
kesehatan, mematuhi aturan rumah sakit, serta memenuhi kewajiban
pembayaran sesuai ketentuan yang berlaku.
</td>
</tr>
<tr>
<td style="vertical-align: top; padding: 6px 4px">2.</td>
<td style="vertical-align: top; padding: 6px 4px">
<b>Persetujuan Pelayanan :</b>
Saya menyetujui dan memberikan persetujuan untuk dirawat di RSUD Dr.
Saiful Anwar dan dengan ini saya meminta dan memberikan kuasa kepada
RSUD Dr. Saiful Anwar, dokter dan perawat serta tenaga kesehatan
lainnya untuk memberikan asuhan keperawatan, pemeriksaan fisik yang
dilakukan oleh dokter dan perawat dan melakukan prosedur diagnostik
radiologi dan/atau terapi dan tata laksana sesuai pertimbangan dokter
yang diperlukan atau disarankan pada perawatan saya. Hal ini mencakup
seluruh pemeriksaan dan prosedur diagnostik rutin termasuk X-ray,
pemberian dan/atau tindakan medis serta penyuntikan (intramuskular,
intravena dan prosedur invasif lainnya), produk farmasi dan
obat-obatan, pemasangan alat kesehatan (kecuali yang membutuhkan
persetujuan khusus/tertulis) dan pengambilan darah untuk pemeriksaan
laboratorium atau pemeriksaan patologi.
</td>
</tr>
<tr>
<td style="vertical-align: top; padding: 6px 4px">3.</td>
<td style="vertical-align: top; padding: 6px 4px">
<b>Akses Informasi Kesehatan :</b>
Saya memberi kuasa kepada setiap dan seluruh orang yang merawat saya
untuk memeriksa dan/atau memberitahukan informasi kesehatan saya
kepada pemberi kesehatan lain yang turut merawat saya selama di rumah
sakit ini, sesuai kebutuhan pelayanan.
</td>
</tr>
<tr>
<td style="vertical-align: top; padding: 6px 4px">4.</td>
<td style="vertical-align: top; padding: 6px 4px">
<b>Rahasia Kedokteran :</b>
Saya setuju RSUD Dr. Saiful Anwar Malang wajib menjamin kerahasiaan
informasi medis saya baik untuk kepentingan perawatan dan pengobatan,
pendidikan maupun penelitian, sesuai ketentuan yang berlaku.
</td>
</tr>
<tr>
<td style="vertical-align: top; padding: 6px 4px">5.</td>
<td style="vertical-align: top; padding: 6px 4px">
<b>Membuka Rahasia Kedokteran :</b>
Saya setuju untuk membuka rahasia kedokteran terkait dengan kondisi
kesehatan, asuhan dan pengobatan yang saya terima kepada:
<br /><span style="margin-left: 10px"
>a) Dokter dan tenaga kesehatan lain yang turut merawat/memberikan
asuhan kepada saya;</span
>
<br /><span style="margin-left: 10px"
>b) Perusahaan asuransi kesehatan atau perusahaan lainnya atau pihak
lain yang menjamin pembiayaan saya;</span
>
<br /><span style="margin-left: 10px"
>c) Anggota keluarga saya :
{{ if eq (len .Relatives) 0 }}
..........................................
{{ else }}
<ul style="margin:0; padding-left:40px;">
{{ range $i, $name := .Relatives }}
{{ if lt $i 2 }}
<li>{{ $name }}</li>
{{ end }}
{{ end }}
</ul>
{{ end }}</span
>
<br />Saya memahami bahwa pembukaan rahasia ini hanya sejauh yang
diperlukan untuk tujuan perawatan, pembiayaan atau administrasi yang
terkait.
</td>
</tr>
<tr>
<td style="vertical-align: top; padding: 6px 4px">6.</td>
<td style="vertical-align: top; padding: 6px 4px">
<b>Privasi :</b>
Saya memberi kuasa kepada RSUD Dr. Saiful Anwar Malang untuk menjaga
privasi dan kerahasiaan penyakit saya selama dalam perawatan, serta
membatasi akses terhadap informasi yang tidak berkepentingan.
</td>
</tr>
<tr>
<td style="vertical-align: top; padding: 6px 4px">7.</td>
<td style="vertical-align: top; padding: 6px 4px">
<b>Barang Pribadi :</b>
Saya setuju untuk tidak membawa barang-barang berharga yang tidak
diperlukan (seperti perhiasan, elektronik, dll) selama dalam perawatan
di RSUD Dr. Saiful Anwar. Jika saya tetap membawa dan terjadi
kehilangan, kerusakan atau pencurian, maka RSUD Dr. Saiful Anwar tidak
bertanggung jawab atas hal tersebut, kecuali bila ada perjanjian
tertulis yang menyatakan lain.
</td>
</tr>
<tr>
<td style="vertical-align: top; padding: 6px 4px">8.</td>
<td style="vertical-align: top; padding: 6px 4px">
<b>Pengajuan Keluhan :</b>
Saya menyatakan bahwa saya telah menerima informasi tentang adanya
tata cara mengajukan dan mengatasi keluhan terkait pelayanan medik
yang diberikan terhadap diri saya. Saya setuju untuk mengikuti tata
cara pengajuan keluhan sesuai prosedur yang ada di rumah sakit.
</td>
</tr>
<tr>
<td style="vertical-align: top; padding: 6px 4px">9.</td>
<td style="vertical-align: top; padding: 6px 4px">
<b>Kewajiban Pembayaran :</b>
Saya menyatakan setuju, baik sebagai wali ataupun sebagai pasien,
bahwa sesuai pertimbangan pelayanan yang diberikan kepada pasien, maka
saya wajib untuk membayar total biaya pelayanan sesuai acuan biaya dan
ketentuan RSUD Dr. Saiful Anwar Malang dengan jaminan atau pribadi.
Apabila asuransi kesehatan swasta atau program pemerintah menanggung
pembiayaan saya, saya memberi wewenang kepada rumah sakit untuk
memberi tagihan dari semua pelayanan dan tindakan medis yang
diberikan. Tanggungan Asuransi saya mungkin menyatakan bahwa sebagian
pembayaran tetap menjadi tanggung jawab pribadi saya atau tidak
ditanggung oleh asuransi, maka rumah sakit berwenang memberi tagihan
untuk biaya yang tidak ditanggung oleh asuransi dan saya bertanggung
jawab untuk membayarnya. Apabila saya tidak memberikan persetujuan,
atau dikemudian hari mencabut persetujuan saya untuk melepaskan
rahasia kedokteran saya kepada perusahaan asuransi yang saya tentukan,
maka saya pribadi bertanggung jawab untuk membayar semua pelayanan dan
tindakan medis dari RSUD Dr. Saiful Anwar Malang.
</td>
</tr>
<tr>
<td style="vertical-align: top; padding: 6px 4px">10.</td>
<td style="vertical-align: top; padding: 6px 4px">
<b>Rumah Sakit Pendidikan :</b>
Saya mengetahui bahwa RSUD Dr. Saiful Anwar merupakan rumah sakit
pendidikan yang menjadi tempat praktik klinik bagi mahasiswa
kedokteran dan profesi-profesi kesehatan lainnya, karena itu mereka
mungkin berpartisipasi dan atau terlibat dalam perawatan saya dan saya
menyetujui bahwa mereka berpartisipasi dalam perawatan saya sepanjang
di bawah supervisi dokter penanggung jawab pasien (DPJP).
</td>
</tr>
<tr>
<td style="vertical-align: top; padding: 6px 4px">11.</td>
<td style="vertical-align: top; padding: 6px 4px">
<b>Selama Dalam Perawatan :</b>
Selama dalam perawatan saya dan keluarga saya akan mematuhi ketentuan
untuk tidak mengambil, menyimpan, mengedarkan gambar/video dokumen dan
aktivitas pelayanan selama di RS tanpa seizin rumah sakit.
</td>
</tr>
<tr>
<td style="vertical-align: top; padding: 6px 4px">12.</td>
<td style="vertical-align: top; padding: 6px 4px">
<b>Penegasan Kepercayaan :</b>
Melalui dokumen ini, saya menegaskan kembali bahwa saya mempercayakan
kepada semua tenaga kesehatan rumah sakit untuk memberikan perawatan,
diagnostik dan terapi kepada saya sebagai pasien rawat inap atau rawat
jalan atau Instalasi Gawat Darurat (IGD), termasuk semua pemeriksaan
penunjang yang dibutuhkan untuk pengobatan dan tindakan yang
diperlukan.
</td>
</tr>
</table>
<br /><br />
<div style="margin-top: 20px">
Saya menyetujui setiap pernyataan dalam formulir ini dan menandatangani
tanpa paksaan.
</div>
<table style="width: 100%; margin-top: 40px; text-align: center">
<tr>
<td>
Malang, {{ .Date }}
</td>
</tr>
</table>
<table
style="
width: 100%;
margin-top: 40px;
text-align: center;
border-collapse: collapse;
"
>
<tr style="height:160px; vertical-align:top;">
<td style="text-align:center; padding:0 10px;">
<div style="margin-top:10px; height:45px;">
Pasien/keluarga/<br>penanggung jawab
</div>
<div style="margin-top:20px; margin-bottom:20px;">
.......................................
</div>
<div style="height:20px;">
{{ .Responsible }}
</div>
</td>
<td style="text-align:center; padding:0 10px;">
<div style="margin-top:10px; height:45px;">
Pemberi Informasi
</div>
<div style="margin-top:20px; margin-bottom:20px;">
.......................................
</div>
<div style="height:20px;">
{{ .Informant }}
</div>
</td>
<td style="text-align:center; padding:0 10px;">
<div style="margin-top:10px; height:45px;">
Saksi I
</div>
<div style="margin-top:20px; margin-bottom:20px;">
.......................................
</div>
<div style="height:20px;">
{{ .Witness1 }}
</div>
</td>
<td style="text-align:center; padding:0 10px;">
<div style="margin-top:10px; height:45px;">
Saksi II
</div>
<div style="margin-top:20px; margin-bottom:20px;">
.......................................
</div>
<div style="height:20px;">
{{ .Witness2 }}
</div>
</td>
</tr>
</table>
</body>
</html>
-707
View File
@@ -1,707 +0,0 @@
<html>
<head>
<meta charset="UTF-8" />
<title>General Consent</title>
<style>
body {
padding: 2rem 3rem;
}
table {
width: 100%;
border-collapse: collapse
}
td {
vertical-align: top;
}
.border-table,
.border-table td,
.border-table th {
border: 1px solid black;
}
.section-title {
margin-top: 1rem;
margin-bottom: 0rem;
}
.data-label {
width: 9rem;
}
.data-colon {
width: 15px; padding-left: 10px;
}
.description-label {
font-size: 0.7rem;
margin: 0;
}
</style>
</head>
<body style="font-family: Arial, sans-serif; line-height: 1.4">
<table style="width: 100%; border-collapse: collapse">
<tr>
<td style="text-align: center">
<img src="logo-1.png" alt="logo" style="height: 70px" />
</td>
<td style="text-align: center">
<div style="font-size: 14px; font-weight: bold">
PEMERINTAH PROVINSI JAWA TIMUR
</div>
<div style="font-size: 14px; font-weight: bold">
RUMAH SAKIT UMUM DAERAH Dr. SAIFUL ANWAR
</div>
<div style="font-size: 13px">
TERAKREDITASI KARS VERSI 2012 TINGKAT PARIPURNA
</div>
<div style="margin-top: 8px">
Jl. Jaksa Agung Suprapto No. 2 MALANG 65111
</div>
<div>Telp. (0341) 362101, Fax. (0341) 362110</div>
<div>Email: [email protected]</div>
<div>Website: www.rsudsaifulanwar.jatimprov.go.id</div>
</td>
<td style="text-align: center">
<img src="logo-rssa.png" alt="logo" style="height: 70px" />
</td>
</tr>
</table>
<hr style="margin: 20px 0" />
<div style="
text-align: center;
font-weight: bold;
font-size: 1rem;
">
IDENTITAS PASIEN
</div>
<table style="
width: 100%;
margin-top: 20px;
border-collapse: collapse;
">
<tr>
<td style="width: 10rem;">
No. RM
</td>
<td class="data-colon">: </td>
<td>{{ .MedicalRecord }}</td>
<td style="width: 7rem;">
Ruang/Klinik
</td>
<td class="data-colon">: </td>
<td>{{ .Unit }}</td>
</tr>
<tr>
<td>
NIK
</td>
<td class="data-colon">: </td>
<td>{{ .NIK }}</td>
<td>
Kelas
</td>
<td class="data-colon">: </td>
<td>{{ .Class }}</td>
</tr>
<tr>
<td>
Nama
</td>
<td class="data-colon">: </td>
<td>{{ .Name }}</td>
<td>
DPJP
</td>
<td class="data-colon">: </td>
<td>{{ .Doctor_Name }}</td>
</tr>
</tr>
<td style="padding: 5px 0"></td>
</tr>
<tr>
<td>
Tempat/Tanggal Lahir
</td>
<td class="data-colon">: </td>
<td>{{ .BirthPlaceDate }}</td>
</tr>
<tr>
<td>
Jenis Kelamin
</td>
<td class="data-colon">: </td>
<td>{{ .Gender }}</td>
</tr>
<tr>
<td>
No. Telepon
</td>
<td class="data-colon">: </td>
<td>{{ .Phone }}</td>
</tr>
</table>
<hr style="margin: 20px 0" />
<h1 style="
text-align: center;
font-weight: bold;
font-size: 1rem;
margin: 0;
">
RESUME MEDIS
</h1>
<p style="
font-size: 0.7rem;
margin: 0;
text-align: center;
"><i>Medical Discharge Summary</i></p>
<p style="
font-size: 0.7rem;
margin-top: 1rem;
"><i>(Diisi oleh Dokter Penanggung Jawab Pelayanan)</i></p>
<table>
<tr>
<td class="data-label">
Tanggal Masuk
</td>
<td class="data-colon">: </td>
<td>{{ .StartedAt }}</td>
</tr>
<tr>
<td class="data-label">
Tanggal Keluar
</td>
<td class="data-colon">: </td>
<td>{{ .FinishedAt }}</td>
</tr>
<tr>
<td class="data-label">
Diagnosis Masuk
</td>
<td class="data-colon">: </td>
<td>{{ .DiagnosisIn }}</td>
</tr>
<tr>
<td class="data-label">
Diagnosis Keluar
</td>
<td class="data-colon">: </td>
<td>{{ .DiagnosisOut }}</td>
</tr>
</table>
<table class="border-table" style="margin-top: 0.7rem; page-break-inside: avoid !important;">
<thead>
<tr>
<th style="width: 1rem;">
No
</th>
<th>
Diagnosa
</th>
<th>
Dasar Diagnosa
</th>
<th>
Kode ICD-10
</th>
</tr>
</thead>
<tbody>
{{ $dataLen := len .Diagnosis }}
{{ if gt $dataLen 0 }}
<!-- If we have data, show all of it -->
{{ range $index, $diagnosis := .Diagnosis }}
<tr>
<td>{{ if eq $index 0 }}1{{ else if eq $index 1 }}2{{ else if eq $index 2 }}3{{ else if eq $index 3 }}4{{ else if eq $index 4 }}5{{ else }}{{ $index }}{{ end }}</td>
<td>{{ $diagnosis.DiagnosisName }}</td>
<td>{{ $diagnosis.Basis }}</td>
<td>{{ $diagnosis.ICD10 }}</td>
</tr>
{{ end }}
<!-- If data is less than 2, fill remaining rows -->
{{ if eq $dataLen 1 }}
<tr>
<td>2</td>
<td></td>
<td></td>
<td></td>
</tr>
{{ end }}
{{ else }}
<!-- If no data, show 2 empty rows -->
<tr>
<td>1</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>2</td>
<td></td>
<td></td>
<td></td>
</tr>
{{ end }}
</tbody>
</table>
<h4 class="section-title">Kajian Awal Medis</i></h4>
<p style="
font-size: 0.7rem;
margin-top: 0rem;
margin-bottom: 0.4rem;
"><i>(Diisi oleh Dokter Penanggung Jawab Pelayanan)</i></p>
<table>
<tr>
<td class="data-label">
Keluhan Utama
</td>
<td class="data-colon">: </td>
<td>{{ .MainComplaint }}</td>
</tr>
<tr>
<td class="data-label">
Riwayat Penyakit
</td>
<td class="data-colon">: </td>
<td>{{ .MedicalHistory }}</td>
</tr>
<tr>
<td class="data-label">
Pemeriksaan Fisik & Keadaan Umum
</td>
<td class="data-colon">: </td>
<td>{{ .PhysicalExamination }}</td>
</tr>
</table>
<h4 class="section-title">Pemeriksaan Penunjang</i></h4>
<table>
<tr>
<td class="data-label">
Pemeriksaan
</td>
<td class="data-colon">: </td>
<td>{{ .SupportingExamination }}</td>
</tr>
</table>
<table style="page-break-inside: avoid !important;"></table>
<tr>
<td>
<h4 class="section-title">Tindakan Medis</i></h4>
<table class="border-table" style="margin-top: 0.4rem;">
<thead>
<tr>
<th style="width: 1rem;">
No
</th>
<th>
Tindakan
</th>
<th>
Dasar Tindakan
</th>
<th>
Kode ICD 9-CM
</th>
</tr>
</thead>
<tbody>
{{ $dataLen := len .MedicalActions }}
{{ if gt $dataLen 0 }}
<!-- If we have data, show all of it -->
{{ range $index, $action := .MedicalActions }}
<tr>
<td>{{ if eq $index 0 }}1{{ else if eq $index 1 }}2{{ else if eq $index 2 }}3{{ else if eq $index 3 }}4{{ else if eq $index 4 }}5{{ else }}{{ $index }}{{ end }}</td>
<td>{{ $action.Action }}</td>
<td>{{ $action.Basis }}</td>
<td>{{ $action.ICD9 }}</td>
</tr>
{{ end }}
<!-- If data is less than 2, fill remaining rows -->
{{ if eq $dataLen 1 }}
<tr>
<td>2</td>
<td></td>
<td></td>
<td></td>
</tr>
{{ end }}
{{ else }}
<!-- If no data, show 2 empty rows -->
<tr>
<td>1</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>2</td>
<td></td>
<td></td>
<td></td>
</tr>
{{ end }}
</tbody>
</table>
<table style="margin: 0.7rem 0;">
<tr>
<td class="data-label">
Tindakan Medis
</td>
<td class="data-colon">: </td>
<td>{{ .MedicalAction }}</td>
</tr>
</table>
<table style="page-break-inside: avoid !important;">
<tr>
<td>
<h4 class="section-title">Konsultasi</i></h4>
</table>
<table class="border-table" style="margin-top: 0.4rem;">
<thead>
<tr>
<th style="width: 1rem;">No</th>
<th>Konsultasi</th>
<th>Jawaban Konsultasi</th>
</tr>
</thead>
<tbody>
{{ $dataLen := len .Consultations }}
{{ if gt $dataLen 0 }}
<!-- If we have data, show all of it -->
{{ range $index, $consultation := .Consultations }}
<tr>
<td>{{ if eq $index 0 }}1{{ else if eq $index 1 }}2{{ else if eq $index 2 }}3{{ else if eq $index 3 }}4{{ else if eq $index 4 }}5{{ else }}{{ $index }}{{ end }}</td>
<td>{{ $consultation.Consultation }}</td>
<td>{{ $consultation.ConsultationAnswer }}</td>
</tr>
{{ end }}
<!-- If data is less than 2, fill remaining rows -->
{{ if eq $dataLen 1 }}
<tr><td>2</td><td></td><td></td></tr>
{{ end }}
{{ else }}
<!-- If no data, show 2 empty rows -->
<tr><td>1</td><td></td><td></td></tr>
<tr><td>2</td><td></td><td></td></tr>
{{ end }}
</tbody>
</table>
</td>
</tr>
<h4 class="section-title">Terapi</i></h4>
<table>
<tr>
<td class="data-label">
Alergi
</td>
<td class="data-colon">: </td>
<td>
{{ .Allergy}}
</td>
</tr>
</table>
<table style="page-break-inside: avoid !important;">
<tr>
<td>
<h4 class="section-title" style="margin-top: 3rem;">Obat yang diberikan</h4>
<table class="border-table" style="margin-top: 0.4rem;">
<thead>
<tr>
<th>
Terapi (Farmakologi & Non Farmakologi) Selama Perawatan
</th>
<th>
Terapi (Farmakologi & Non Farmakologi) Waktu Pulang
</th>
</tr>
</thead>
<tbody>
{{ $dataLen := len .Medications }}
{{ if gt $dataLen 0 }}
<!-- If we have data, show all of it -->
{{ range .Medications }}
<tr>
<td>{{ .DuringTreatment }}</td>
<td>{{ .AtDischarge }}</td>
</tr>
{{ end }}
<!-- If data is less than 2, fill remaining rows -->
{{ if eq $dataLen 1 }}
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
{{ end }}
{{ else }}
<!-- If no data, show 2 empty rows -->
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
{{ end }}
</tbody>
</table>
</td>
</tr>
</table>
<h4 class="section-title">Kondisi saat Pulang</i></h4>
<table>
<tr>
<td class="data-label">Kesadaran</td>
<td class="data-colon">: </td>
<td>{{ .ConsciousnessLevel }}</td>
</tr>
<tr>
<td class="data-label">
Tanda Vital
<p class="description-label"><i>Vital sign</i></p>
</td>
<td class="data-colon">:</td>
</tr>
<tr>
<td colspan="3">
<table>
<tr>
<td style="width: 50%;">
<table cellspacing="0" cellpadding="0">
<tr>
<td>
<td class="data-label" style="text-align: right;"> Tekanan Darah
<p class="description-label"><i>Blood Pressure</i></p>
</td>
<td class="data-colon">: </td>
{{ if and .BloodPressure (ne .BloodPressure "0/0") (ne .BloodPressure "") }}
<td>{{ .BloodPressure }} mmHg</td>
{{ else }}
<td></td>
{{ end }}
<td>
</tr>
<tr>
<td>
<td class="data-label" style="text-align: right;">Suhu
<p class="description-label"><i>Temperatur</i></p>
</td>
</td>
<td class="data-colon">: </td>
{{ if ne .BodyTemperature 0.0 }}
<td>{{ .BodyTemperature }} C</td>
{{ else }}
<td></td>
{{ end }}
<td>
</tr>
<tr>
<td>
<td class="data-label" style="text-align: right;">Nadi
<p class="description-label"><i>Pulse</i></p>
</td>
<td class="data-colon">: </td>
{{ if ne .HeartRate 0.0 }}
<td>{{ .HeartRate }} x/Menit</td>
{{ else }}
<td></td>
{{ end }}
</td>
</tr>
</table>
</td>
<td>
<table cellspacing="0" cellpadding="0">
<tr>
<td>
<td class="data-label" style="text-align: right;">Frekuensi Nafas
<p class="description-label"><i>Respiratory rate</i></p>
</td>
</td>
<td class="data-colon">: </td>
{{ if ne .RespirationRate 0.0 }}
<td>{{ .RespirationRate }} x/Menit</td>
{{ else }}
<td></td>
{{ end }}
</td>
</tr>
<tr>
<td>
<td class="data-label" style="text-align: right;">Skala Nyeri
<p class="description-label"><i>Pain Scale</i></p>
</td>
</td>
<td class="data-colon">: </td>
<td>{{ .PainScale }}</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="data-label">Keadaan Keluar</td>
<td class="data-colon">: </td>
<td>{{ .ConditionOnDischarge }}</td>
</tr>
<tr>
<td class="data-label">Cara Keluar
<p class="description-label"><i>Patient discharge of hospital</i></p>
</td>
<td class="data-colon">:</td>
<td>{{ .DischargeMethod }}</td>
</tr>
</table>
<table style="
margin-top: 1rem;
">
<tr>
<td>
<h4 class="description-label">INSTRUKSI UNTUK TINDAK LANJUT</h4>
<p class="description-label"><i>Follow up Consultation to</i></p>
</td>
<td class="">
<h4 class="description-label">Kontrol Ke</h4>
<p class="description-label"><i>Follow up Consultation to</i></p>
</td>
<td class="">
<table>
<tr>
<td style="width: 4rem;">Fasyankes</td>
<td class="data-colon">: </td>
<td>{{ .NIK }}</td>
</tr>
<tr>
<td>Tanggal</td>
<td>: </td>
<td>{{ .NIK }}</td>
</tr>
<tr>
<td>Klinik</td>
<td>: </td>
<td>{{ .NIK }}</td>
</tr>
</table>
</td>
</tr>
<tr><td style="height: 1rem;"></td></tr>
<tr>
<td class="">
<h4 class="description-label">Dalam keadaan darurat dapat menghubungi</h4>
<p class="description-label"><i>In case of emergencycontact</i></p>
</td>
<td class="">
<h4 class="description-label">IGD</h4>
<p class="description-label"><i>(Accident & Emergency Instalation)</i></p>
</td>
<td class="">
<table>
<tr>
<td style="width: 4rem;">Telepon
<p class="description-label"><i>Phone</i></p>
</td>
<td class="data-colon">: </td>
<td>(0341) 362101</td>
</tr>
</table>
</td>
</tr>
<tr><td style="height: 1rem;"></td></tr>
<tr>
<td class="">
<h4 class="description-label">EDUKASI & RENCANA TINDAK LANJUT</h4>
<p class="description-label"><i>Follow up plan (if necessary)</i></p>
</td>
<td class="">
<h4 class="description-label"></h4>
<p class="description-label"><i>(bila diperlukan)</i></p>
</td>
</tr>
</table>
<table style="margin-top: 3rem;">
<tr>
<td></td>
<td style="width: 15rem;">
Malang, {{ .Date }}<br>
Dokter Penanggung Jawab Pelayanan
</td>
</tr>
<tr><td style="height: 7rem;"></td></tr>
<tr>
<td></td>
<td style="width: 15rem;">
({{ .Doctor_Name }})
</td>
</tr>
</table>
<div style="height: 3rem;"></div>
<hr style="margin: 20px 0" />
<p>*) Data dapat berubah setelah pasien pulang sesuai prosedur</p>
</body>
</html>
-167
View File
@@ -1,167 +0,0 @@
<html>
<head>
<meta charset="UTF-8" />
<style>
body {
padding: 2rem 3rem;
}
table {
width: 100%;
border-collapse: collapse
}
td {
vertical-align: top;
}
.border-table,
.border-table td,
.border-table th {
border: 1px solid black;
}
.section-title {
margin-top: 1rem;
margin-bottom: 0rem;
}
.data-label {
width: 9rem;
}
.data-colon {
width: 0.1234rem;
}
</style>
</head>
<body style="font-family: Arial, sans-serif; line-height: 1.4">
<!-- Tanggal Terbit (top-right) -->
<div style="
text-align: right;
margin-right: 2rem;
font-size: 0.95rem;
margin-top: 0.5rem;
">
Tanggal Terbit : {{ .IssuedDate }}
</div>
<!-- Patient Info Box -->
<table
style="
margin-top: 1rem;
margin-left: auto;
margin-right: 2rem; /* space from right like example */
border: 1px solid #000;
padding: 0.5rem 1rem;
border-collapse: separate;
border-spacing: 0.3rem 0.2rem;
width: auto;
"
>
<tr>
<td style="width: 9rem;"><b>No. RM</b></td>
<td class="data-colon">:</td>
<td><b>{{ .MedicalRecord }}</b></td>
</tr>
<tr>
<td><b>Nama</b></td>
<td class="data-colon">:</td>
<td><b>{{ .Name }}</b></td>
</tr>
<tr>
<td><b>Tanggal Lahir</b></td>
<td class="data-colon">:</td>
<td>{{ .BirthDate }}</td>
</tr>
</table>
<hr style="margin: 20px 0" />
<h1 style="
text-align: center;
font-weight: bold;
font-size: 1rem;
margin: 0;
">
FORM A
</h1>
<section>
<h4 class="section-title">Kajian Awal Medis:</i></h4>
<table style="margin-top: 0.3rem;">
{{ if gt (len .EarlyMedic) 0 }}
{{ range .EarlyMedic }}
<tr>
<td>
&#9745; {{ . }}
</td>
</tr>
{{ end }}
{{ else }}
<tr>
<td></td>
</tr>
{{ end }}
</table>
</section>
<section>
<h4 class="section-title">ASSESMEN:</h4>
<table style="margin-top: 0.3rem;">
<tr>
<td>
{{ .Assessment }}
</td>
</tr>
</table>
</section>
<section>
<h4 class="section-title">IDENTIFIKASI MASALAH:</h4>
<table style="margin-top: 0.3rem;">
{{ if gt (len .ProblemIdentification) 0 }}
{{ range .ProblemIdentification }}
<tr>
<td>
&#9745; {{ . }}
</td>
</tr>
{{ end }}
{{ else }}
<tr>
<td></td>
</tr>
{{ end }}
</table>
</section>
<section>
<h4 class="section-title">PERENCANAAN:</h4>
<table style="margin-top: 0.3rem;">
<tr>
<td>
{{ .Planning }}
</td>
</tr>
</table>
</section>
<table style="margin-top: 3rem;">
<tr>
<td></td>
<td style="text-align: center; width: 15rem;">
{{ .Date }}<br>
</td>
</tr>
<tr><td style="height: 7rem;"></td></tr>
<tr>
<td></td>
<td style="text-align: center; width: 15rem;">
({{ .Employee_Name }})
</td>
</tr>
</table>
<div style="height: 3rem;"></div>
</body>
</html>
-109
View File
@@ -1,109 +0,0 @@
<html>
<head>
<meta charset="UTF-8" />
<style>
body {
padding: 2rem 3rem;
}
table {
width: 100%;
border-collapse: collapse
}
td {
vertical-align: top;
}
.border-table,
.border-table td,
.border-table th {
border: 1px solid black;
}
.section-title {
margin-top: 1rem;
margin-bottom: 0rem;
}
.data-label {
width: 9rem;
}
.data-colon {
width: 0.1234rem;
}
</style>
</head>
<body style="font-family: Arial, sans-serif; line-height: 1.4">
<!-- Tanggal Terbit (top-right) -->
<div style="
text-align: right;
margin-right: 2rem;
font-size: 0.95rem;
margin-top: 0.5rem;
">
Tanggal Terbit : {{ .IssuedDate }}
</div>
<!-- Patient Info Box -->
<table
style="
margin-top: 1rem;
margin-left: auto;
margin-right: 2rem; /* space from right like example */
border: 1px solid #000;
padding: 0.5rem 1rem;
border-collapse: separate;
border-spacing: 0.3rem 0.2rem;
width: auto;
"
>
<tr>
<td style="width: 9rem;"><b>No. RM</b></td>
<td class="data-colon">:</td>
<td><b>{{ .MedicalRecord }}</b></td>
</tr>
<tr>
<td><b>Nama</b></td>
<td class="data-colon">:</td>
<td><b>{{ .Name }}</b></td>
</tr>
<tr>
<td><b>Tanggal Lahir</b></td>
<td class="data-colon">:</td>
<td>{{ .BirthDate }}</td>
</tr>
</table>
<table class="border-table"
style="margin-top: 1rem; width: 100%; table-layout: fixed;">
<tr>
<th style="width: 3rem; text-align:center;">NO</th>
<th style="width: 9rem; text-align:center;">Tanggal/jam</th>
<th style="width: auto;">
Implementasi, Monitoring, Fasilitasi, koordinasi, komunikasi dan kolaborasi,
advokasi, hasil pelayanan, Terminasi
</th>
<th style="width: 9rem; text-align:center;">MPP</th>
</tr>
{{ range .FormB }}
<tr>
<td style="text-align: center;">{{ .Number }}</td>
<td style="text-align: center;">{{ .Date }}</td>
<td style="white-space: normal; word-wrap: break-word;">
{{ .Value }}
</td>
<td style="text-align: center; white-space: normal;">
{{ .Employee_Name }}
</td>
</tr>
{{ end }}
</table>
<div style="height: 3rem;"></div>
</body>
</html>
-312
View File
@@ -1,312 +0,0 @@
<html>
<head>
<meta charset="UTF-8" />
<title>General Consent</title>
<style>
body {
padding: 2rem 3rem;
}
table {
width: 100%;
border-collapse: collapse
}
td {
vertical-align: top;
}
.border-table, .border-table td, .border-table th {
border: 1px solid black;
}
.section-title {
margin-top: 1rem;
margin-bottom: 0rem;
}
.data-label {
width: 9rem;
}
.data-colon {
width: 0.1234rem;
}
</style>
</head>
<body style="font-family: Arial, sans-serif; line-height: 1.4">
<table style="width: 100%; border-collapse: collapse">
<tr>
<td style="text-align: center">
<img src="logo-1.png" alt="logo" style="height: 70px" />
</td>
<td style="text-align: center">
<div style="font-size: 14px; font-weight: bold">
PEMERINTAH PROVINSI JAWA TIMUR
</div>
<div style="font-size: 14px; font-weight: bold">
RUMAH SAKIT UMUM DAERAH Dr. SAIFUL ANWAR
</div>
<div style="font-size: 13px">
TERAKREDITASI KARS VERSI 2012 TINGKAT PARIPURNA
</div>
<div style="margin-top: 8px">
Jl. Jaksa Agung Suprapto No. 2 MALANG 65111
</div>
<div>Telp. (0341) 362101, Fax. (0341) 362110</div>
<div>Email: [email protected]</div>
<div>Website: www.rsudsaifulanwar.jatimprov.go.id</div>
</td>
<td style="text-align: center">
<img src="logo-rssa.png" alt="logo" style="height: 70px" />
</td>
</tr>
</table>
<hr style="margin: 20px 0" />
<div style="position: relative;">
<h1 style="
text-align: center;
font-weight: bold;
font-size: 1rem;
margin: 0;
">
Protokol Terapi
</h1>
<p style="
margin: 0;
text-align: center;
">Layanan Kedokteran Fisik dan Rehabilitasi
</p>
<div style="padding-inline: 0.5rem;text-align: center;border: 1px solid black;position: absolute;right: 0;top: 0;">
Terapi Ke <br><br>
{{ .Repalcable }}
</div>
</div>
<table class="border-table" style="margin-top: 2rem;">
<tr>
<td style="width: 7rem;">
No RM
</td>
<td>{{ .Repalcable }}</td>
</tr>
<tr>
<td style="width: 7rem;">
Nama Pasien
</td>
<td>{{ .Repalcable }}</td>
</tr>
<tr>
<td style="width: 7rem;">
Tanggal Lahir
</td>
<td>{{ .Repalcable }}</td>
</tr>
<tr>
<td style="width: 7rem;">
Diagnosa
</td>
<td>{{ .Repalcable }}</td>
</tr>
<tr>
<td style="width: 7rem;">
Permintaan Terapi
</td>
<td>{{ .Repalcable }}</td>
</tr>
<tr>
<td style="width: 7rem;">
Frekuensi Terapi
</td>
<td style="padding-left: 0.5rem;">
2 x Per Minggu &emsp; &emsp; &emsp;
Evaluasi: 1 Bulan
</td>
</tr>
<tr>
<td style="width: 7rem;">
Target Terapi
</td>
<td>{{ .Repalcable }}</td>
</tr>
<tr>
<td style="width: 7rem;">
Waktu Mencapai Target
</td>
<td>{{ .Repalcable }}</td>
</tr>
</table>
<table class="border-table" style="margin-top: 1rem;">
<tr>
<th style="width: 2rem;">
NO
</th>
<th>
Tanggal
</th>
<th>
Dokter
</th>
<th>
Fisioterapi
</th>
<th>
Terapi Wicara
</th>
<th>
Okupansi Terapi
</th>
<th>
Ortotik Prostetik
</th>
<th>
PSM
</th>
<th>
TTD Pasien
</th>
</tr>
<tr>
<td style="height: 3rem;text-align: center;">
1
</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
</tr>
<tr>
<td style="height: 3rem;text-align: center;">
2
</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
</tr>
<tr>
<td style="height: 3rem;text-align: center;">
3
</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
</tr>
<tr>
<td style="height: 3rem;text-align: center;">
4
</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
</tr>
<tr>
<td style="height: 3rem;text-align: center;">
5
</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
</tr>
<tr>
<td style="height: 3rem;text-align: center;">
6
</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
</tr>
<tr>
<td style="height: 3rem;text-align: center;">
7
</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
</tr>
<tr>
<td style="height: 3rem;text-align: center;">
8
</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td>
</tr>
</table>
<table class="border-table" style="margin-top: 1rem;">
<tr>
<td style="height: 2rem;width: 7rem;">
Evaluasi
</td>
<td>{{ .Repalcable }}</td>
</tr>
<tr>
<td style="width: 7rem;">
Rencana Selanjutnya
</td>
<td>{{ .Repalcable }}</td>
</tr>
</table>
<table style="margin-top: 2rem;">
<tr>
<td></td>
<td style="width: 15rem;">
Malang,<br>
Cap dan TTD Dr. SpKFR
</td>
</tr>
<tr><td style="height: 6rem;"></td></tr>
<tr>
<td></td>
<td style="height: 10rem;width: 15rem;">
(........................................................)
</td>
</tr>
</table>
<div style="height: 3rem;"></div>
</body>
</html>
-217
View File
@@ -1,217 +0,0 @@
<html>
<head>
<meta charset="UTF-8" />
<title>General Consent</title>
<style>
body {
padding: 2rem 3rem;
}
table {
width: 100%;
border-collapse: collapse
}
td {
vertical-align: top;
}
.border-table, .border-table td, .border-table th {
border: 1px solid black;
}
.section-title {
margin-top: 1rem;
margin-bottom: 0rem;
}
.data-label {
width: 9rem;
}
.data-colon {
width: 0.1234rem;
}
</style>
</head>
<body style="font-family: Arial, sans-serif; line-height: 1.4">
<table style="width: 100%; border-collapse: collapse">
<tr>
<td style="text-align: center">
<img src="logo-1.png" alt="logo" style="height: 70px" />
</td>
<td style="text-align: center">
<div style="font-size: 14px; font-weight: bold">
PEMERINTAH PROVINSI JAWA TIMUR
</div>
<div style="font-size: 14px; font-weight: bold">
RUMAH SAKIT UMUM DAERAH Dr. SAIFUL ANWAR
</div>
<div style="font-size: 13px">
TERAKREDITASI KARS VERSI 2012 TINGKAT PARIPURNA
</div>
<div style="margin-top: 8px">
Jl. Jaksa Agung Suprapto No. 2 MALANG 65111
</div>
<div>Telp. (0341) 362101, Fax. (0341) 362110</div>
<div>Email: [email protected]</div>
<div>Website: www.rsudsaifulanwar.jatimprov.go.id</div>
</td>
</tr>
</table>
<hr style="margin: 20px 0" />
<table class="border-table" style="margin-top: 1rem;">
<tr>
<td style="width: 7rem;">
No RM:
</td>
<td>{{ .Repalcable }}</td>
</tr>
<tr>
<td style="width: 7rem;">
Nama Pasien
</td>
<td>{{ .Repalcable }}</td>
</tr>
<tr>
<td style="width: 7rem;">
Diagnosa
</td>
<td>{{ .Repalcable }}</td>
</tr>
<tr>
<td style="width: 7rem;min-height: 6rem;">
Permintaan Terapi
</td>
<td>{{ .Repalcable }}</td>
</tr>
</table>
<table class="border-table" style="margin-top: 1rem;">
<tr>
<th rowspan="2" style="width: 17rem;">
PELAKSANAAN PROGRAM
</th>
<th rowspan="2">
Tanggal
</th>
<th colspan="3">
TTD
</th>
</tr>
<tr>
<th>
PASIEN
</th>
<th>
DOKTER
</th>
<th>
TERAPIS
</th>
</tr>
<tr>
<td style="height: 2rem;padding-left: 0.5rem;">1. {{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td><td></td><td></td><td></td>
</tr>
<tr>
<td style="height: 2rem;padding-left: 0.5rem;">2. {{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td><td></td><td></td><td></td>
</tr>
<tr>
<td style="height: 2rem;padding-left: 0.5rem;">3. {{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td><td></td><td></td><td></td>
</tr>
<tr>
<td style="height: 2rem;padding-left: 0.5rem;">4. {{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td><td></td><td></td><td></td>
</tr>
<tr>
<td style="height: 2rem;padding-left: 0.5rem;">5. {{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td><td></td><td></td><td></td>
</tr>
<tr>
<td style="height: 2rem;padding-left: 0.5rem;">6. {{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td><td></td><td></td><td></td>
</tr>
<tr>
<td style="height: 2rem;padding-left: 0.5rem;">7. {{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td><td></td><td></td><td></td>
</tr>
<tr>
<td style="height: 2rem;padding-left: 0.5rem;">8. {{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td><td></td><td></td><td></td>
</tr>
<tr>
<td style="height: 2rem;padding-left: 0.5rem;">9. {{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td><td></td><td></td><td></td>
</tr>
<tr>
<td style="height: 2rem;padding-left: 0.5rem;">10. {{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td><td></td><td></td><td></td>
</tr>
<tr>
<td style="height: 2rem;padding-left: 0.5rem;">11. {{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td><td></td><td></td><td></td>
</tr>
<tr>
<td style="height: 2rem;padding-left: 0.5rem;">12. {{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td><td></td><td></td><td></td>
</tr>
<tr>
<td style="height: 2rem;padding-left: 0.5rem;">13. {{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td><td></td><td></td><td></td>
</tr>
<tr>
<td style="height: 2rem;padding-left: 0.5rem;">14. {{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td><td></td><td></td><td></td>
</tr>
<tr>
<td style="height: 2rem;padding-left: 0.5rem;">15. {{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td><td></td><td></td><td></td>
</tr>
<tr>
<td style="height: 2rem;padding-left: 0.5rem;">16. {{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td><td></td><td></td><td></td>
</tr>
<tr>
<td style="height: 2rem;padding-left: 0.5rem;">17. {{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td><td></td><td></td><td></td>
</tr>
<tr>
<td style="height: 2rem;padding-left: 0.5rem;">18. {{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td><td></td><td></td><td></td>
</tr>
<tr>
<td style="height: 2rem;padding-left: 0.5rem;">19. {{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td><td></td><td></td><td></td>
</tr>
<tr>
<td style="height: 2rem;padding-left: 0.5rem;">20. {{ .Repalcable }}</td>
<td>{{ .Repalcable }}</td><td></td><td></td><td></td>
</tr>
</table>
<table style="margin-top: 2rem;">
<tr>
<td></td>
<td style="width: 15rem;">
Tempat & Tanggal<br>
Cap dan TTD Dr. SpKFR
</td>
</tr>
<tr><td style="height: 6rem;"></td></tr>
<tr>
<td></td>
<td style="width: 15rem;">
(.................................................)
</td>
</tr>
</table>
<div style="height: 3rem;"></div>
</body>
</html>
-241
View File
@@ -1,241 +0,0 @@
<html>
<head>
<meta charset="UTF-8" />
<title>General Consent</title>
<style>
body {
padding: 2rem 3rem;
}
table {
width: 100%;
border-collapse: collapse
}
td {
vertical-align: top;
}
.border-table,
.border-table td,
.border-table th {
border: 1px solid black;
}
.section-title {
margin-top: 1rem;
margin-bottom: 0rem;
}
.data-label {
width: 9rem;
}
.data-colon {
width: 0.1234rem;
}
</style>
</head>
<body style="font-family: Arial, sans-serif; line-height: 1.4">
<table style="width: 100%; border-collapse: collapse">
<tr>
<td style="text-align: center">
<img src="logo-1.png" alt="logo" style="height: 70px" />
</td>
<td style="text-align: center">
<div style="font-size: 14px; font-weight: bold">
PEMERINTAH PROVINSI JAWA TIMUR
</div>
<div style="font-size: 14px; font-weight: bold">
RUMAH SAKIT UMUM DAERAH Dr. SAIFUL ANWAR
</div>
<div style="font-size: 13px">
TERAKREDITASI KARS VERSI 2012 TINGKAT PARIPURNA
</div>
<div style="margin-top: 8px">
Jl. Jaksa Agung Suprapto No. 2 MALANG 65111
</div>
<div>Telp. (0341) 362101, Fax. (0341) 362110</div>
<div>Email: [email protected]</div>
<div>Website: www.rsudsaifulanwar.jatimprov.go.id</div>
</td>
</tr>
</table>
<hr style="margin: 20px 0" />
<div style="position: relative;">
<h1 style="
text-align: center;
font-weight: bold;
font-size: 1rem;
margin: 0;
">
Lembar Formulir Rawat Jalan <br> Layanan Kedokteran Fisik dan Rehabilitasi
</h1>
</div>
<div style="
margin-top: 1.5rem;
border: 1px solid black;
padding: 0.3rem;
">
<table style="margin-top: 0.3rem;margin-bottom: 0.3rem;">
<tr>
<td style="width: 19rem;"><b>I. Identitas Pasien</b></td>
<td style="width: 4rem;">No. RM</td>
<td class="data-colon">: </td>
<td>{{ .Repalcable }}</td>
</tr>
</table>
<table>
<tr>
<td style="width: 10rem; height: 1.5rem;">
Nama Pasien
</td>
<td class="data-colon">: </td>
<td>{{ .Repalcable }}</td>
</tr>
<tr>
<td style="height: 1.5rem;">
Tanggal Lahir
</td>
<td class="data-colon">: </td>
<td>{{ .Repalcable }}</td></tr>
<tr>
<td style="height: 1.5rem;">
Aalamat
</td>
<td class="data-colon">: </td>
<td>{{ .Repalcable }}</td></tr>
<tr>
<td style="height: 1.5rem;">
Telp / HP
</td>
<td class="data-colon">: </td>
<td>{{ .Repalcable }}</td></tr>
<tr>
<td style="height: 1.5rem;">
Hubungan dengan Tertanggung
</td>
<td class="data-colon">: </td>
<td>
&#9745; Suami / Istri
&emsp;&emsp;
&#9634; Anak
</td>
</tr>
</table>
</div>
<div style="
margin-top: 1.5rem;
border: 1px solid black;
padding: 0.3rem;
">
<table style="margin-top: 0.3rem;margin-bottom: 0.3rem;">
<tr>
<td style="width: 19rem;"><b>II. Diisi oleh Dokter SpKFR</b></td>
</tr>
</table>
<table>
<tr>
<td style="width: 14rem; height: 1.5rem;">
Tanggal Pelayanan
</td>
<td class="data-colon">: </td>
<td>{{ .Repalcable }}</td></tr>
</tr>
<tr>
<td style="height: 1.5rem;">
Anamnesa
</td>
<td class="data-colon">: </td>
<td>{{ .Repalcable }}</td></tr>
</tr>
<tr>
<td style="height: 1.5rem;">
Pemeriksaan Fisik dan Uji Fungsi
</td>
<td class="data-colon">: </td>
<td>{{ .Repalcable }}</td></tr>
</tr>
<tr>
<td style="height: 1.5rem;">
Diagnosis Medis (ICD-10)
</td>
<td class="data-colon">: </td>
<td>{{ .Repalcable }}</td></tr>
</tr>
<tr>
<td style="height: 1.5rem;">
Diagnosis Fungsi (ICD-10)
</td>
<td class="data-colon">: </td>
<td>{{ .Repalcable }}</td></tr>
</tr>
<tr>
<td style="height: 1.5rem;">
Pemeriksaan Penunjang
</td>
<td class="data-colon">: </td>
<td>{{ .Repalcable }}</td></tr>
</tr>
<tr>
<td style="height: 1.5rem;">
Tata Laksana KFR (ICD 9 CM)
</td>
<td class="data-colon">: </td>
<td>{{ .Repalcable }}</td></tr>
</tr>
<tr>
<td style="height: 1.5rem;">
Anjuran
</td>
<td class="data-colon">: </td>
<td>{{ .Repalcable }}</td></tr>
</tr>
<tr>
<td style="height: 1.5rem;">
Evaluasi
</td>
<td class="data-colon">: </td>
<td>{{ .Repalcable }}</td></tr>
</tr>
<tr>
<td style="height: 1.5rem;">
Suspek Penyakit Akibat Kerja
</td>
<td class="data-colon">: </td>
<td>
&#9745; Ya &emsp; ( {{ .Repalcable }} )
<br>
&#9634; Tidak
</td>
</tr>
</table>
</div>
<table style="margin-top: 2rem;">
<tr>
<td style="text-align: center;">
TTD Pasien
</td>
<td style="text-align: center;">
Tempat & Tanggal<br>
Cap dan TTD Dr. SpKFR
</td>
</tr>
<tr><td style="height: 6rem;"></td></tr>
<tr>
<td style="height: 10rem;text-align: center;">
(........................................................)
</td>
<td style="height: 10rem;text-align: center;">
(........................................................)
</td>
</tr>
</table>
<div style="height: 3rem;"></div>
</body>
</html>
-81
View File
@@ -1,81 +0,0 @@
{
"request-ok": "request is done succesfully",
"request-methodNotAllowed": "request has been rejected, method is not allowed",
"request-tooMany": "too many request",
"payload-bad": "invalid data structure",
"auth-required": "authentication required",
"auth-missingHeader": "authentication header is missing",
"auth-forbidden": "forbidden",
"auth-login-success": "login success",
"auth-login-incorrect": "login failed, icorrect username or password",
"auth-login-tooMany": "login failed, too many login attempts",
"auth-login-blocked": "login failed, account is blocked",
"auth-login-unverified": "login failed, account is not verified",
"auth-logout-success": "logout success",
"auth-reject-suspend": "restricted for suspended account",
"auth-getData-failed": "failed to get user data",
"balance-exceeded": "must not exceeds balance",
"email-confirmation-success": "email confirmation success",
"email-confirmation-fail": "failed to confirm email",
"email-confirmation-resend-fail": "failed to resend email confirmation",
"data-create-success": "data has been created",
"data-create-fail": "failed to create data",
"data-notFound": "data or resource can not be found",
"data-notFound-condition": "\"%v\" with %v \"%v\" can not be found",
"data-get-fail": "get data failed, %v",
"data-get-invalid-relation": "database get failed, invalid relation",
"data-update-fail": "failed to update data",
"data-delete-success": "data has been deleted",
"data-delete-fail": "failed to delete data",
"data-send-fail": "send data failed, %v",
"data-fetch-fail": "failed to fetch data",
"data-copy-fail": "failed to copy data",
"data-process-fail": "failed to process data",
"data-confirm-fail": "failed to confirm data",
"data-generate-fail": "failed to generate data",
"data-registered": "is already registered",
"data-state-mismatch": "\"%v\" is not in \"%v\" state",
"data-duplicate": "duplicate data",
"data-payment-fail": "failed to create payment",
"data-handled-mismatch": "data handled by different user/person",
"expired": "is expired",
"registered": "is already registered",
"mustUuid": "must be a valid uuid",
"invalid": "invalid value",
"equalToField": "must equal to",
"constraint-vioalate": "must not violate constraint",
"config-fetch-done": "app config is fetched successfully",
"userToken-incorrect": "incorrect email, token, or token type",
"token-missing": "missing required token",
"token-invalid": "invalid token",
"token-invalidType": "invalid token type",
"token-sign-unexcpeted": "unexpected signing method: %v",
"token-sign-err": "token signing failed, %v",
"token-parse-fail": "token parsing failed, %v",
"token-expired": "token is expired",
"token-unidentified": "token is could not be identified",
"file-detect-fail": "file type detection failed",
"file-type-mismatch": "file type mismatch",
"file-create-fail": "failed to create file, %v",
"file-open-fail": "failed to open file, %v",
"file-copy-fail": "failed to copy file, %v",
"uuid-gen-fail" : "failed to generate uuid, %v",
"nanoid-gen-fail" : "failed to generate nanoid, %v",
"redis-store-fail": "redis storing value failed, %v",
"eq": "must be equal to %v",
"gt": "must be greater than %v",
"gte": "must be greater than or equal to %v",
"lt": "must be less than %v",
"lte": "must be less than or equal to %v"
}
-84
View File
@@ -1,84 +0,0 @@
{
"request-ok": "'request' berhasil diproses",
"request-methodNotAllowed": "'request' ditolak, method tidak diijinkan",
"request-tooMany": "terlalu banyak 'request'",
"payload-bad": "struktur data tidak sesuai standar",
"auth-required": "butuh autentikasi",
"auth-getData-failed": "gagal mengambil data user",
"auth-missingHeader": "header autentikasi tidak ditemukan",
"auth-forbidden": "tidak diijinkan",
"auth-login-success": "login berhasil",
"auth-login-incorrect": "Username atau Password Tidak Sesuai",
"auth-login-tooMany": "login gagal, terlalu banyak percobaan",
"auth-login-blocked": "login gagal, akun diblokir",
"auth-login-unverified": "login gagal, akun belum terverifikasi",
"auth-logout-success": "logout berhasil",
"auth-reject-suspend": "dibatasi untuk akun dibekukan",
"balance-exceeded": "tidak boleh melebihi saldo",
"email-confirmation-success": "konfimrasi email berhasil",
"email-confirmation-fail": "gagal mengkonfirmasi email",
"email-confirmation-resend-fail": "gagal mengirim konfirmasi email",
"data-create-success": "data telah dibuat",
"data-create-fail": "gagal membuat data",
"data-notFound": "data atau sumber tidak daoat ditemukan",
"data-notFound-condition": "\"%v\" dengan %v \"%v\" tidak dapat ditemukan",
"data-get-fail": "gagal mengambil data, %v",
"data-update-success": "berhasil memperbarui data",
"data-update-fail": "gagal memperbarui data",
"data-delete-success": "data telah dihapus",
"data-delete-fail": "gagal menghapus data",
"data-fetch-fail": "gagal mengambil data",
"data-copy-fail": "gagal menyalin data",
"data-process-fail": "gagal memproses data",
"data-confirm-fail": "gagal mengirim data",
"data-generate-fail": "gagal membuat data",
"data-registered": "sudah pernah dibuat",
"data-state-mismatch": "\"%v\" tidak dalam kondisi \"%v\"",
"data-duplicate": "duplicate data",
"data-payment-fail": "failed to create payment",
"expired": "expired",
"registered": "sudah terdaftar",
"mustUuid": "harus UUID yang valid",
"invalid": "nilai tidak sesuai",
"equalToField": "harus sama dengan",
"constraint-vioalate": "tidak boleh melanggar batasan",
"config-fetch-done": "konfigurasi app berhasil diterapkan",
"userToken-incorrect": "salah email, token, atau jenis token",
"token-missing": "token tidak dapat ditemukan",
"token-invalid": "token tidak berlaku",
"token-invalidType": "jenis token tidak berlaku",
"token-sign-unexcpeted": "metode penanda tidak beralku: %v",
"token-sign-err": "penanda token tidak sesuai, %v",
"token-parse-fail": "%v",
"token-expired": "Token Expired",
"token-unidentified": "token tidak dapat diidentifikasi",
"file-detect-fail": "gagal mendeteksi tipe file",
"file-type-mismatch": "tipe file tidak sesuai",
"file-create-fail": "gagal membuat file, %v",
"file-open-fail": "gagal membuka file, %v",
"file-copy-fail": "gagal menyalin file, %v",
"uuid-gen-fail" : "gagal membuat UUID, %v",
"nanoid-gen-fail" : "gagal membuat NANOID, %v",
"redis-store-fail": "gagal mengimpan data pada redis, %v",
"eq": "must be equal to %v",
"gt": "must be greater than %v",
"gte": "lebih besar atau sama dengan %v",
"lt": "must be less than %v",
"lte": "lebih kecil atau sama dengan %v",
"jknData-required": "%v Belum Diisi",
"jknData-length": "Format %v Tidak Sesuai",
"jknData-numeric": "Format %v Tidak Sesuai",
"jknData-notFound": "%v Tidak Ditemukan"
}
-2
View File
@@ -1,2 +0,0 @@
# convention
Key - value data indexed. Key prefered to be be consisting of 3 part: [feature]-[action]-[status]. Special case for validation that is intended to point error on an input (field), the key can be stated directly to the validation index, for example: min is for minimum value needed.
View File
-66
View File
@@ -1,66 +0,0 @@
appCfg:
fullName: BPJS Bridge
codeName: simrs-vx
version: 0.1.0
env: development
lang: en
httpCfg:
host:
port:
dbCfg:
dsn:
maxOpenConns: 5
maxIdleConns: 5
maxIdleTime: 100
multiDbCfg:
- dbs :
name:
dsn:
maxOpenConns:
maxIdleConns:
maxIdleTime:
- bpjs
name: bpjs
dsn:
maxOpenConns:
maxIdleConns:
maxIdleTime:
loggerCfg:
hideTime:
hideLevel:
msCfg:
dsn:
langCfg:
active:
path:
fileName:
minioCfg:
endpoint:
region:
accessKey:
secretKey:
useSsl:
bucketName:
- patient
corsCfg:
allowedOrigin:
allowedMethod:
satuSehatCfg:
host: localhost:8200
corsCfg:
allowedOrigins:
- http://example.com
allowedMethod:
bpjsCfg:
baseUrl:
-14
View File
@@ -1,14 +0,0 @@
package main
import (
a "github.com/karincake/apem"
d "github.com/karincake/apem/db-gorm-pg"
l "github.com/karincake/apem/logger-zerolog"
m "github.com/karincake/apem/ms-redis"
h "simrs-vx/internal/interface/bpjs-handler"
)
func main() {
a.Run(h.SetRoutes(), &l.O, &m.O, &d.O)
}
-76
View File
@@ -1,76 +0,0 @@
appCfg:
fullName: BPJS Bridge
codeName: simrs-vx
version: 0.1.0
env: development
lang: en
httpCfg:
host:
port:
dbCfg:
dsn:
maxOpenConns: 5
maxIdleConns: 5
maxIdleTime: 100
multiDbCfg:
- dbs :
name:
dsn:
maxOpenConns:
maxIdleConns:
maxIdleTime:
- bpjs
name: bpjs
dsn:
maxOpenConns:
maxIdleConns:
maxIdleTime:
loggerCfg:
hideTime:
hideLevel:
msCfg:
dsn:
langCfg:
active:
path:
fileName:
minioCfg:
endpoint:
region:
accessKey:
secretKey:
useSsl:
bucketName:
- patient
corsCfg:
allowedOrigin:
allowedMethod:
satuSehatCfg:
host: localhost:8200
corsCfg:
allowedOrigins:
- http://example.com
allowedMethod:
bpjsCfg:
baseUrl:
syncUrlCfg:
enable: false
targetHost:
prefix: new-to-old
source: old-app
secretKey: new-world-order!!
docsCfg:
path: ../../assets/docs/
-14
View File
@@ -1,14 +0,0 @@
package main
import (
a "github.com/karincake/apem"
d "github.com/karincake/apem/db-gorm-pg"
l "github.com/karincake/apem/logger-zerolog"
m "github.com/karincake/apem/ms-redis"
h "simrs-vx/internal/interface/main-handler"
)
func main() {
a.Run(h.SetRoutes(), &l.O, &m.O, &d.O)
}
-22
View File
@@ -1,22 +0,0 @@
# Makefile for Atlas migrations
# Default environment
ENV ?= gorm
.PHONY: diff apply hash
## Generate a new migration diff
diff:
atlas migrate diff --env $(ENV)
## Apply migrations to the database
apply:
atlas migrate apply --env $(ENV)
## Calculate the schema hash
hash:
atlas migrate hash
## Apply non-linear
apply-non-linear:
atlas migrate apply --env $(ENV) --exec-order non-linear
-59
View File
@@ -1,59 +0,0 @@
# Database Migration with Atlas
This project uses [Atlas](https://atlasgo.io/) for database schema management and migrations.
## 📋 Prerequisites
1. **Download and Install Atlas CLI**
Run the following command in PowerShell or Git Bash:
```sh
curl -sSf https://atlasgo.sh | sh
```
Verify installation:
```sh
atlas version
```
2. Install GORM Provider
Run inside your Go project:
```sh
go get -u ariga.io/atlas-provider-gorm
```
3. Create atlas.hcl configuration file
Just create an atlas.hcl file in your project root as example given at atlas.hcl.example
4. Create migrations folder
```sh
mkdir migrations
```
5. Usage
You can use the provided Makefile for common commands:
Generate a migration diff
```sh
make diff
```
Apply migrations
```sh
make apply
```
Compute schema hash
```sh
make hash
```
If you dont have make installed, you can run the Atlas commands directly:
```sh
atlas migrate diff --env gorm
```
```sh
atlas migrate apply --env gorm
```
```sh
atlas migrate hash
```
-22
View File
@@ -1,22 +0,0 @@
data "external_schema" "gorm" {
program = [
"go",
"run",
"-mod=mod",
".",
]
}
env "gorm" {
src = data.external_schema.gorm.url
dev = "" // dsn db to check the diff
migration {
dir = "file://migrations"
}
url = "" // dsn db to apply
format {
migrate {
diff = "{{ sql . \" \" }}"
}
}
}
-9
View File
@@ -1,9 +0,0 @@
package main
import (
m "simrs-vx/internal/interface/migration"
)
func main() {
m.Migrate(m.Main)
}
@@ -1,685 +0,0 @@
-- Create "DiagnoseSrc" table
CREATE TABLE "public"."DiagnoseSrc" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(10) NULL,
"Name" character varying(2048) NULL,
"IndName" character varying(2048) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_DiagnoseSrc_Code" UNIQUE ("Code")
);
-- Create "PharmacyCompany" table
CREATE TABLE "public"."PharmacyCompany" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(20) NULL,
"Name" character varying(100) NULL,
"Regency_Code" character varying(4) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_PharmacyCompany_Code" UNIQUE ("Code")
);
-- Create "Uom" table
CREATE TABLE "public"."Uom" (
"Id" serial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(10) NULL,
"Name" character varying(50) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_Uom_Code" UNIQUE ("Code")
);
-- Create "Counter" table
CREATE TABLE "public"."Counter" (
"Id" serial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(10) NULL,
"Name" character varying(30) NULL,
"Number" smallint NULL,
"Parent_Id" integer NULL,
"Type_Code" text NULL,
"Queue_Code" character varying(5) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_Counter_Code" UNIQUE ("Code")
);
-- Create "Item" table
CREATE TABLE "public"."Item" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(50) NULL,
"Name" character varying(100) NULL,
"ItemGroup_Code" character varying(10) NULL,
"Uom_Code" character varying(10) NULL,
"Infra_Id" integer NULL,
"Stock" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_Item_Code" UNIQUE ("Code"),
CONSTRAINT "fk_Item_Uom" FOREIGN KEY ("Uom_Code") REFERENCES "public"."Uom" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Infra" table
CREATE TABLE "public"."Infra" (
"Id" serial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(10) NULL,
"Name" character varying(50) NULL,
"InfraGroup_Code" character varying(10) NULL,
"Parent_Id" integer NULL,
"Item_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_Infra_Code" UNIQUE ("Code"),
CONSTRAINT "fk_Infra_Item" FOREIGN KEY ("Item_Id") REFERENCES "public"."Item" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Device" table
CREATE TABLE "public"."Device" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(10) NULL,
"Name" character varying(50) NOT NULL,
"Uom_Code" character varying(10) NULL,
"Infra_Id" integer NULL,
"Item_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_Device_Code" UNIQUE ("Code"),
CONSTRAINT "fk_Device_Infra" FOREIGN KEY ("Infra_Id") REFERENCES "public"."Infra" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Device_Item" FOREIGN KEY ("Item_Id") REFERENCES "public"."Item" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Device_Uom" FOREIGN KEY ("Uom_Code") REFERENCES "public"."Uom" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Province" table
CREATE TABLE "public"."Province" (
"Id" smallserial NOT NULL,
"Code" character varying(2) NULL,
"Name" character varying(50) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_Province_Code" UNIQUE ("Code")
);
-- Create "Regency" table
CREATE TABLE "public"."Regency" (
"Id" serial NOT NULL,
"Province_Code" character varying(2) NULL,
"Code" character varying(4) NULL,
"Name" character varying(50) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_Regency_Code" UNIQUE ("Code"),
CONSTRAINT "fk_Province_Regencies" FOREIGN KEY ("Province_Code") REFERENCES "public"."Province" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "District" table
CREATE TABLE "public"."District" (
"Id" bigserial NOT NULL,
"Regency_Code" character varying(4) NULL,
"Code" character varying(6) NULL,
"Name" character varying(50) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_District_Code" UNIQUE ("Code"),
CONSTRAINT "fk_Regency_Districts" FOREIGN KEY ("Regency_Code") REFERENCES "public"."Regency" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Division" table
CREATE TABLE "public"."Division" (
"Id" serial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(10) NULL,
"Name" character varying(50) NULL,
"Parent_Id" smallint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_Division_Code" UNIQUE ("Code")
);
-- Create "DivisionPosition" table
CREATE TABLE "public"."DivisionPosition" (
"Id" serial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Division_Id" integer NULL,
"Code" character varying(10) NULL,
"Name" character varying(50) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_DivisionPosition_Code" UNIQUE ("Code"),
CONSTRAINT "fk_DivisionPosition_Division" FOREIGN KEY ("Division_Id") REFERENCES "public"."Division" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Ethnic" table
CREATE TABLE "public"."Ethnic" (
"Id" serial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(20) NULL,
"Name" character varying(50) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_Ethnic_Code" UNIQUE ("Code")
);
-- Create "Language" table
CREATE TABLE "public"."Language" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(10) NULL,
"Name" character varying(50) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_Language_Code" UNIQUE ("Code")
);
-- Create "Person" table
CREATE TABLE "public"."Person" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Name" character varying(150) NOT NULL,
"FrontTitle" character varying(50) NULL,
"EndTitle" character varying(50) NULL,
"BirthDate" timestamptz NULL,
"BirthRegency_Code" character varying(4) NULL,
"Gender_Code" character varying(10) NULL,
"ResidentIdentityNumber" character varying(16) NULL,
"PassportNumber" character varying(20) NULL,
"DrivingLicenseNumber" character varying(20) NULL,
"Religion_Code" character varying(10) NULL,
"Education_Code" character varying(10) NULL,
"Ocupation_Code" character varying(15) NULL,
"Ocupation_Name" character varying(50) NULL,
"Ethnic_Code" character varying(20) NULL,
"Language_Code" character varying(10) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_Person_DrivingLicenseNumber" UNIQUE ("DrivingLicenseNumber"),
CONSTRAINT "uni_Person_PassportNumber" UNIQUE ("PassportNumber"),
CONSTRAINT "uni_Person_ResidentIdentityNumber" UNIQUE ("ResidentIdentityNumber"),
CONSTRAINT "fk_Person_Ethnic" FOREIGN KEY ("Ethnic_Code") REFERENCES "public"."Ethnic" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Person_Language" FOREIGN KEY ("Language_Code") REFERENCES "public"."Language" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "User" table
CREATE TABLE "public"."User" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Name" character varying(25) NOT NULL,
"Password" character varying(255) NOT NULL,
"Status_Code" character varying(10) NOT NULL,
"FailedLoginCount" smallint NULL,
"Position_Code" character varying(20) NOT NULL,
"LoginAttemptCount" bigint NULL,
"LastSuccessLogin" timestamptz NULL,
"LastAllowdLogin" timestamptz NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_User_Name" UNIQUE ("Name")
);
-- Create "Employee" table
CREATE TABLE "public"."Employee" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"User_Id" bigint NULL,
"Person_Id" bigint NULL,
"Division_Code" character varying(10) NULL,
"Number" character varying(20) NULL,
"Status_Code" character varying(10) NOT NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Employee_Division" FOREIGN KEY ("Division_Code") REFERENCES "public"."Division" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Employee_Person" FOREIGN KEY ("Person_Id") REFERENCES "public"."Person" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Employee_User" FOREIGN KEY ("User_Id") REFERENCES "public"."User" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Installation" table
CREATE TABLE "public"."Installation" (
"Id" serial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(10) NULL,
"Name" character varying(50) NULL,
"EncounterClass_Code" character varying(10) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_Installation_Code" UNIQUE ("Code")
);
-- Create "Unit" table
CREATE TABLE "public"."Unit" (
"Id" serial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Installation_Id" integer NULL,
"Code" character varying(10) NULL,
"Name" character varying(50) NULL,
"Type_Code" text NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_Unit_Code" UNIQUE ("Code"),
CONSTRAINT "fk_Unit_Installation" FOREIGN KEY ("Installation_Id") REFERENCES "public"."Installation" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Specialist" table
CREATE TABLE "public"."Specialist" (
"Id" serial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(10) NULL,
"Name" character varying(50) NULL,
"Unit_Id" integer NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_Specialist_Code" UNIQUE ("Code"),
CONSTRAINT "fk_Specialist_Unit" FOREIGN KEY ("Unit_Id") REFERENCES "public"."Unit" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Subspecialist" table
CREATE TABLE "public"."Subspecialist" (
"Id" serial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(10) NULL,
"Name" character varying(50) NULL,
"Specialist_Id" integer NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_Subspecialist_Code" UNIQUE ("Code"),
CONSTRAINT "fk_Subspecialist_Specialist" FOREIGN KEY ("Specialist_Id") REFERENCES "public"."Specialist" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Doctor" table
CREATE TABLE "public"."Doctor" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Employee_Id" bigint NULL,
"IHS_Number" character varying(20) NULL,
"SIP_Number" character varying(20) NULL,
"Unit_Id" integer NULL,
"Specialist_Id" integer NULL,
"Subspecialist_Id" integer NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Doctor_Employee" FOREIGN KEY ("Employee_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Doctor_Specialist" FOREIGN KEY ("Specialist_Id") REFERENCES "public"."Specialist" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Doctor_Subspecialist" FOREIGN KEY ("Subspecialist_Id") REFERENCES "public"."Subspecialist" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Doctor_Unit" FOREIGN KEY ("Unit_Id") REFERENCES "public"."Unit" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "DoctorFee" table
CREATE TABLE "public"."DoctorFee" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Doctor_Id" bigint NULL,
"FeeType_Code" character varying(11) NULL,
"Price" numeric NULL,
"Item_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_DoctorFee_Doctor" FOREIGN KEY ("Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_DoctorFee_Item" FOREIGN KEY ("Item_Id") REFERENCES "public"."Item" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Patient" table
CREATE TABLE "public"."Patient" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Person_Id" bigint NULL,
"RegisteredAt" timestamptz NULL,
"Status_Code" character varying(10) NOT NULL,
"Number" character varying(15) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_Patient_Number" UNIQUE ("Number"),
CONSTRAINT "fk_Patient_Person" FOREIGN KEY ("Person_Id") REFERENCES "public"."Person" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Encounter" table
CREATE TABLE "public"."Encounter" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Patient_Id" bigint NULL,
"RegisteredAt" timestamptz NULL,
"Class_Code" character varying(10) NOT NULL,
"Unit_Id" bigint NULL,
"Specialist_Id" integer NULL,
"Subspecialist_Id" integer NULL,
"VisitDate" timestamptz NULL,
"Assignment_Doctor_Id" bigint NULL,
"Responsible_Doctor_Id" bigint NULL,
"DischardeMethod_Code" character varying(10) NULL,
"RefSource_Name" character varying(100) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Encounter_Assignment_Doctor" FOREIGN KEY ("Assignment_Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Encounter_Patient" FOREIGN KEY ("Patient_Id") REFERENCES "public"."Patient" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Encounter_Responsible_Doctor" FOREIGN KEY ("Responsible_Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Encounter_Specialist" FOREIGN KEY ("Specialist_Id") REFERENCES "public"."Specialist" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Encounter_Subspecialist" FOREIGN KEY ("Subspecialist_Id") REFERENCES "public"."Subspecialist" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Encounter_Unit" FOREIGN KEY ("Unit_Id") REFERENCES "public"."Unit" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "InsuranceCompany" table
CREATE TABLE "public"."InsuranceCompany" (
"Id" serial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(20) NULL,
"Name" character varying(50) NULL,
"Regency_Code" character varying(4) NULL,
"Address" character varying(100) NULL,
"PhoneNumber" character varying(20) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_InsuranceCompany_Code" UNIQUE ("Code"),
CONSTRAINT "fk_InsuranceCompany_Regency" FOREIGN KEY ("Regency_Code") REFERENCES "public"."Regency" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "ItemPrice" table
CREATE TABLE "public"."ItemPrice" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Item_Id" bigint NULL,
"Price" numeric NULL,
"InsuranceCompany_Code" character varying(20) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_ItemPrice_InsuranceCompany" FOREIGN KEY ("InsuranceCompany_Code") REFERENCES "public"."InsuranceCompany" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_ItemPrice_Item" FOREIGN KEY ("Item_Id") REFERENCES "public"."Item" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Laborant" table
CREATE TABLE "public"."Laborant" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Employee_Id" bigint NULL,
"IHS_Number" character varying(20) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Laborant_Employee" FOREIGN KEY ("Employee_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Material" table
CREATE TABLE "public"."Material" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(10) NULL,
"Name" character varying(50) NULL,
"Uom_Code" character varying(10) NULL,
"Infra_Id" integer NULL,
"Stock" bigint NULL,
"Item_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_Material_Code" UNIQUE ("Code"),
CONSTRAINT "fk_Material_Infra" FOREIGN KEY ("Infra_Id") REFERENCES "public"."Infra" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Material_Item" FOREIGN KEY ("Item_Id") REFERENCES "public"."Item" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Material_Uom" FOREIGN KEY ("Uom_Code") REFERENCES "public"."Uom" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "McuSrcCategory" table
CREATE TABLE "public"."McuSrcCategory" (
"Id" serial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(20) NULL,
"Name" character varying(50) NULL,
"Scope_Code" character varying(10) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_McuSrcCategory_Code" UNIQUE ("Code")
);
-- Create "McuSrc" table
CREATE TABLE "public"."McuSrc" (
"Id" serial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(20) NULL,
"Name" character varying(50) NULL,
"CheckupCategory_Code" character varying(20) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_McuSrc_Code" UNIQUE ("Code"),
CONSTRAINT "fk_McuSrc_CheckupCategory" FOREIGN KEY ("CheckupCategory_Code") REFERENCES "public"."McuSrcCategory" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "MedicalActionSrc" table
CREATE TABLE "public"."MedicalActionSrc" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(20) NULL,
"Name" character varying(50) NULL,
"Item_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_MedicalActionSrc_Code" UNIQUE ("Code"),
CONSTRAINT "fk_MedicalActionSrc_Item" FOREIGN KEY ("Item_Id") REFERENCES "public"."Item" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "ProcedureSrc" table
CREATE TABLE "public"."ProcedureSrc" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(10) NULL,
"Name" character varying(2048) NULL,
"IndName" character varying(2048) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_ProcedureSrc_Code" UNIQUE ("Code")
);
-- Create "MedicalActionSrcItem" table
CREATE TABLE "public"."MedicalActionSrcItem" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"MedicalActionSrc_Id" bigint NULL,
"ProcedureSrc_Id" bigint NULL,
"Item_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_MedicalActionSrcItem_Item" FOREIGN KEY ("Item_Id") REFERENCES "public"."Item" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_MedicalActionSrcItem_MedicalActionSrc" FOREIGN KEY ("MedicalActionSrc_Id") REFERENCES "public"."MedicalActionSrc" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_MedicalActionSrcItem_ProcedureSrc" FOREIGN KEY ("ProcedureSrc_Id") REFERENCES "public"."ProcedureSrc" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "MedicineGroup" table
CREATE TABLE "public"."MedicineGroup" (
"Id" serial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(10) NULL,
"Name" character varying(50) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_MedicineGroup_Code" UNIQUE ("Code")
);
-- Create "MedicineMethod" table
CREATE TABLE "public"."MedicineMethod" (
"Id" serial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(10) NULL,
"Name" character varying(50) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_MedicineMethod_Code" UNIQUE ("Code")
);
-- Create "Medicine" table
CREATE TABLE "public"."Medicine" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(10) NULL,
"Name" character varying(50) NULL,
"MedicineGroup_Code" character varying(10) NULL,
"MedicineMethod_Code" character varying(10) NULL,
"Uom_Code" character varying(10) NULL,
"Dose" smallint NULL,
"Infra_Id" integer NULL,
"Stock" bigint NULL,
"Item_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_Medicine_Code" UNIQUE ("Code"),
CONSTRAINT "fk_Medicine_Infra" FOREIGN KEY ("Infra_Id") REFERENCES "public"."Infra" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Medicine_Item" FOREIGN KEY ("Item_Id") REFERENCES "public"."Item" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Medicine_MedicineGroup" FOREIGN KEY ("MedicineGroup_Code") REFERENCES "public"."MedicineGroup" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Medicine_MedicineMethod" FOREIGN KEY ("MedicineMethod_Code") REFERENCES "public"."MedicineMethod" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Medicine_Uom" FOREIGN KEY ("Uom_Code") REFERENCES "public"."Uom" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "MedicineMix" table
CREATE TABLE "public"."MedicineMix" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Name" character varying(50) NULL,
PRIMARY KEY ("Id")
);
-- Create "MedicineMixItem" table
CREATE TABLE "public"."MedicineMixItem" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"MedicineMix_Id" bigint NULL,
"Medicine_Id" bigint NULL,
"Dose" smallint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_MedicineMixItem_Medicine" FOREIGN KEY ("Medicine_Id") REFERENCES "public"."Medicine" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_MedicineMixItem_MedicineMix" FOREIGN KEY ("MedicineMix_Id") REFERENCES "public"."MedicineMix" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Nurse" table
CREATE TABLE "public"."Nurse" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Employee_Id" bigint NULL,
"IHS_Number" character varying(20) NULL,
"Unit_Id" integer NULL,
"Infra_Id" integer NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Nurse_Employee" FOREIGN KEY ("Employee_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Nurse_Infra" FOREIGN KEY ("Infra_Id") REFERENCES "public"."Infra" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Nurse_Unit" FOREIGN KEY ("Unit_Id") REFERENCES "public"."Unit" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Nutritionist" table
CREATE TABLE "public"."Nutritionist" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Employee_Id" bigint NULL,
"IHS_Number" character varying(20) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Nutritionist_Employee" FOREIGN KEY ("Employee_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "PersonAddress" table
CREATE TABLE "public"."PersonAddress" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Person_Id" bigint NULL,
"Address" character varying(150) NULL,
"Rt" character varying(2) NULL,
"Rw" character varying(2) NULL,
"Village_Code" character varying(10) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Person_Addresses" FOREIGN KEY ("Person_Id") REFERENCES "public"."Person" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "PersonContact" table
CREATE TABLE "public"."PersonContact" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Person_Id" bigint NULL,
"Type_Code" character varying(15) NULL,
"Value" character varying(100) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Person_Contacts" FOREIGN KEY ("Person_Id") REFERENCES "public"."Person" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Village" table
CREATE TABLE "public"."Village" (
"Id" bigserial NOT NULL,
"District_Code" character varying(6) NULL,
"Code" character varying(10) NULL,
"Name" character varying(50) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_Village_Code" UNIQUE ("Code"),
CONSTRAINT "fk_District_Villages" FOREIGN KEY ("District_Code") REFERENCES "public"."District" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "PersonRelative" table
CREATE TABLE "public"."PersonRelative" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Person_Id" bigint NULL,
"Relationship_Code" character varying(100) NOT NULL,
"Name" character varying(100) NULL,
"Address" character varying(100) NULL,
"Village_Code" character varying(10) NULL,
"Gender_Code" character varying(10) NULL,
"PhoneNumber" character varying(30) NULL,
"Education_Code" character varying(10) NULL,
"Occupation_Code" character varying(10) NULL,
"Occupation_Name" character varying(50) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_PersonRelative_Village" FOREIGN KEY ("Village_Code") REFERENCES "public"."Village" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Person_Relatives" FOREIGN KEY ("Person_Id") REFERENCES "public"."Person" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Pharmacist" table
CREATE TABLE "public"."Pharmacist" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Employee_Id" bigint NULL,
"IHS_Number" character varying(20) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Pharmacist_Employee" FOREIGN KEY ("Employee_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "PracticeSchedule" table
CREATE TABLE "public"."PracticeSchedule" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Doctor_Id" bigint NULL,
"Unit_Code" character varying(10) NULL,
"Day_Code" smallint NULL,
"StartTime" character varying(5) NULL,
"EndTime" character varying(5) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_PracticeSchedule_Doctor" FOREIGN KEY ("Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_PracticeSchedule_Unit" FOREIGN KEY ("Unit_Code") REFERENCES "public"."Unit" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Room" table
CREATE TABLE "public"."Room" (
"Id" serial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Infra_Id" integer NULL,
"Unit_Id" integer NULL,
"Specialist_Id" integer NULL,
"Subspecialist_Id" integer NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Room_Infra" FOREIGN KEY ("Infra_Id") REFERENCES "public"."Infra" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Room_Specialist" FOREIGN KEY ("Specialist_Id") REFERENCES "public"."Specialist" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Room_Subspecialist" FOREIGN KEY ("Subspecialist_Id") REFERENCES "public"."Subspecialist" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Room_Unit" FOREIGN KEY ("Unit_Id") REFERENCES "public"."Unit" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "SpecialistIntern" table
CREATE TABLE "public"."SpecialistIntern" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Person_Id" bigint NULL,
"Specialist_Id" integer NULL,
"Subspecialist_Id" integer NULL,
"User_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_SpecialistIntern_Person" FOREIGN KEY ("Person_Id") REFERENCES "public"."Person" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_SpecialistIntern_Specialist" FOREIGN KEY ("Specialist_Id") REFERENCES "public"."Specialist" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_SpecialistIntern_Subspecialist" FOREIGN KEY ("Subspecialist_Id") REFERENCES "public"."Subspecialist" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_SpecialistIntern_User" FOREIGN KEY ("User_Id") REFERENCES "public"."User" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
@@ -1,10 +0,0 @@
-- Modify "Doctor" table
ALTER TABLE "public"."Doctor" ADD CONSTRAINT "uni_Doctor_IHS_Number" UNIQUE ("IHS_Number"), ADD CONSTRAINT "uni_Doctor_SIP_Number" UNIQUE ("SIP_Number");
-- Modify "Laborant" table
ALTER TABLE "public"."Laborant" ADD CONSTRAINT "uni_Laborant_IHS_Number" UNIQUE ("IHS_Number");
-- Modify "Nurse" table
ALTER TABLE "public"."Nurse" ADD CONSTRAINT "uni_Nurse_IHS_Number" UNIQUE ("IHS_Number");
-- Modify "Nutritionist" table
ALTER TABLE "public"."Nutritionist" ADD CONSTRAINT "uni_Nutritionist_IHS_Number" UNIQUE ("IHS_Number");
-- Modify "Pharmacist" table
ALTER TABLE "public"."Pharmacist" ADD CONSTRAINT "uni_Pharmacist_IHS_Number" UNIQUE ("IHS_Number");
@@ -1,96 +0,0 @@
-- Create "Appointment" table
CREATE TABLE "public"."Appointment" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"PracticeSchedule_Id" bigint NULL,
"Patient_Id" bigint NULL,
"Person_ResidentIdentityNumber" character varying(16) NULL,
"Person_Name" character varying(100) NULL,
"Person_PhoneNumber" character varying(30) NULL,
"PaymentMethod_Code" character varying(10) NULL,
"RefNumber" character varying(20) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Appointment_Patient" FOREIGN KEY ("Patient_Id") REFERENCES "public"."Patient" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Appointment_PracticeSchedule" FOREIGN KEY ("PracticeSchedule_Id") REFERENCES "public"."PracticeSchedule" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Modify "Encounter" table
ALTER TABLE "public"."Encounter" ADD COLUMN "Appointment_Doctor_Id" bigint NULL, ADD COLUMN "Appointment_Id" bigint NULL, ADD COLUMN "EarlyEducation" text NULL, ADD COLUMN "MedicalDischargeEducation" text NULL, ADD COLUMN "AdmDischargeEducation" text NULL, ADD COLUMN "DischargeReason" text NULL, ADD CONSTRAINT "fk_Encounter_Appointment" FOREIGN KEY ("Appointment_Id") REFERENCES "public"."Appointment" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION, ADD CONSTRAINT "fk_Encounter_Appointment_Doctor" FOREIGN KEY ("Appointment_Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
-- Create "Adime" table
CREATE TABLE "public"."Adime" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Employee_Id" bigint NULL,
"Time" timestamptz NULL,
"Value" text NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Adime_Employee" FOREIGN KEY ("Employee_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Adime_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Ambulatory" table
CREATE TABLE "public"."Ambulatory" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Class_Code" character varying(10) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Ambulatory_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Emergency" table
CREATE TABLE "public"."Emergency" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Class_Code" character varying(10) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Emergency_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Inpatient" table
CREATE TABLE "public"."Inpatient" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Class_Code" character varying(10) NULL,
"Infra_Id" integer NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Inpatient_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Inpatient_Infra" FOREIGN KEY ("Infra_Id") REFERENCES "public"."Infra" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Sbar" table
CREATE TABLE "public"."Sbar" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Employee_Id" bigint NULL,
"Time" timestamptz NULL,
"Value" text NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Sbar_Employee" FOREIGN KEY ("Employee_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Sbar_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Soapi" table
CREATE TABLE "public"."Soapi" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Employee_Id" bigint NULL,
"Time" timestamptz NULL,
"Value" text NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Soapi_Employee" FOREIGN KEY ("Employee_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Soapi_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
@@ -1,2 +0,0 @@
-- Modify "Encounter" table
ALTER TABLE "public"."Encounter" DROP COLUMN "Assignment_Doctor_Id";
@@ -1,2 +0,0 @@
-- Modify "Encounter" table
ALTER TABLE "public"."Encounter" ADD COLUMN "DischargeMethod_Code" character varying(10) NULL;
@@ -1,2 +0,0 @@
-- Modify "Encounter" table
ALTER TABLE "public"."Encounter" DROP COLUMN "DischardeMethod_Code";
@@ -1,2 +0,0 @@
-- Modify "Encounter" table
ALTER TABLE "public"."Encounter" ADD COLUMN "Status_Code" character varying(10) NULL;
@@ -1,146 +0,0 @@
-- Create "DeviceOrder" table
CREATE TABLE "public"."DeviceOrder" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_DeviceOrder_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "DeviceOrderItem" table
CREATE TABLE "public"."DeviceOrderItem" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"DeviceOrder_Id" bigint NULL,
"Device_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_DeviceOrderItem_Device" FOREIGN KEY ("Device_Id") REFERENCES "public"."Device" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_DeviceOrderItem_DeviceOrder" FOREIGN KEY ("DeviceOrder_Id") REFERENCES "public"."DeviceOrder" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "MaterialOrder" table
CREATE TABLE "public"."MaterialOrder" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_MaterialOrder_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "MaterialOrderItem" table
CREATE TABLE "public"."MaterialOrderItem" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"MaterialOrder_Id" bigint NULL,
"Material_Id" bigint NULL,
"Count" integer NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_MaterialOrderItem_Material" FOREIGN KEY ("Material_Id") REFERENCES "public"."Material" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_MaterialOrderItem_MaterialOrder" FOREIGN KEY ("MaterialOrder_Id") REFERENCES "public"."MaterialOrder" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "McuOrder" table
CREATE TABLE "public"."McuOrder" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Status_Code" character varying(10) NOT NULL,
"Doctor_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_McuOrder_Doctor" FOREIGN KEY ("Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_McuOrder_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "McuOrderItem" table
CREATE TABLE "public"."McuOrderItem" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"McuOrder_Id" bigint NULL,
"McuSrc_Id" bigint NULL,
"Result" text NULL,
"Status_Code" text NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_McuOrderItem_McuOrder" FOREIGN KEY ("McuOrder_Id") REFERENCES "public"."McuOrder" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_McuOrderItem_McuSrc" FOREIGN KEY ("McuSrc_Id") REFERENCES "public"."McuSrc" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Medication" table
CREATE TABLE "public"."Medication" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"IssuedAt" timestamptz NULL,
"Pharmacist_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Medication_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Medication_Pharmacist" FOREIGN KEY ("Pharmacist_Id") REFERENCES "public"."Pharmacist" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "MedicationItem" table
CREATE TABLE "public"."MedicationItem" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Medication_Id" bigint NULL,
"IsMix" boolean NULL,
"Medicine_Id" bigint NULL,
"MedicineMix_Id" bigint NULL,
"Usage" smallint NULL,
"Interval" smallint NULL,
"IntervalUnit_Code" text NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_MedicationItem_Medication" FOREIGN KEY ("Medication_Id") REFERENCES "public"."Medication" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_MedicationItem_Medicine" FOREIGN KEY ("Medicine_Id") REFERENCES "public"."Medicine" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_MedicationItem_MedicineMix" FOREIGN KEY ("MedicineMix_Id") REFERENCES "public"."MedicineMix" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "MedicationItemDist" table
CREATE TABLE "public"."MedicationItemDist" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"MedicationItem_Id" bigint NULL,
"DateTime" timestamptz NULL,
"Remain" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_MedicationItemDist_MedicationItem" FOREIGN KEY ("MedicationItem_Id") REFERENCES "public"."MedicationItem" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Prescription" table
CREATE TABLE "public"."Prescription" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Doctor_Id" bigint NULL,
"IssuedAt" timestamptz NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Prescription_Doctor" FOREIGN KEY ("Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Prescription_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "PrescriptionItem" table
CREATE TABLE "public"."PrescriptionItem" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Prescription_Id" bigint NULL,
"IsMix" boolean NULL,
"Medicine_Id" bigint NULL,
"MedicineMix_Id" bigint NULL,
"Usage" smallint NULL,
"Interval" smallint NULL,
"IntervalUnit_Code" text NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_PrescriptionItem_Medicine" FOREIGN KEY ("Medicine_Id") REFERENCES "public"."Medicine" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_PrescriptionItem_MedicineMix" FOREIGN KEY ("MedicineMix_Id") REFERENCES "public"."MedicineMix" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_PrescriptionItem_Prescription" FOREIGN KEY ("Prescription_Id") REFERENCES "public"."Prescription" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
@@ -1,14 +0,0 @@
-- Modify "DeviceOrder" table
ALTER TABLE "public"."DeviceOrder" ADD COLUMN "Status_Code" text NULL;
-- Modify "DeviceOrderItem" table
ALTER TABLE "public"."DeviceOrderItem" ADD COLUMN "Count" smallint NULL;
-- Modify "MaterialOrder" table
ALTER TABLE "public"."MaterialOrder" ADD COLUMN "Status_Code" text NULL;
-- Modify "Medication" table
ALTER TABLE "public"."Medication" ADD COLUMN "Status_Code" text NULL;
-- Modify "MedicationItem" table
ALTER TABLE "public"."MedicationItem" ALTER COLUMN "Usage" TYPE numeric, ADD COLUMN "IsRedeemed" boolean NULL;
-- Modify "PrescriptionItem" table
ALTER TABLE "public"."PrescriptionItem" ALTER COLUMN "Usage" TYPE numeric;
-- Modify "MedicationItemDist" table
ALTER TABLE "public"."MedicationItemDist" ALTER COLUMN "Remain" TYPE numeric, ADD COLUMN "Nurse_Id" bigint NULL, ADD CONSTRAINT "fk_MedicationItemDist_Nurse" FOREIGN KEY ("Nurse_Id") REFERENCES "public"."Nurse" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
@@ -1,8 +0,0 @@
-- Modify "MedicationItem" table
ALTER TABLE "public"."MedicationItem" ADD COLUMN "Quantity" numeric NULL;
-- Modify "MedicineMix" table
ALTER TABLE "public"."MedicineMix" ADD COLUMN "Note" text NULL;
-- Modify "Prescription" table
ALTER TABLE "public"."Prescription" ADD COLUMN "Status_Code" text NULL;
-- Modify "PrescriptionItem" table
ALTER TABLE "public"."PrescriptionItem" ADD COLUMN "Quantity" numeric NULL;
@@ -1,2 +0,0 @@
-- Modify "MedicationItem" table
ALTER TABLE "public"."MedicationItem" ADD COLUMN "Note" character varying(1024) NULL;
@@ -1,2 +0,0 @@
-- Modify "MedicineMixItem" table
ALTER TABLE "public"."MedicineMixItem" DROP CONSTRAINT "fk_MedicineMixItem_MedicineMix", ADD CONSTRAINT "fk_MedicineMix_MixItems" FOREIGN KEY ("MedicineMix_Id") REFERENCES "public"."MedicineMix" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
@@ -1,4 +0,0 @@
-- Modify "MedicineMix" table
ALTER TABLE "public"."MedicineMix" DROP COLUMN "Note";
-- Modify "MedicineMixItem" table
ALTER TABLE "public"."MedicineMixItem" ADD COLUMN "Note" text NULL;
@@ -1,10 +0,0 @@
-- Modify "McuOrder" table
ALTER TABLE "public"."McuOrder" ADD COLUMN "SpecimenPickTime" timestamptz NULL, ADD COLUMN "ExaminationDate" timestamptz NULL, ADD COLUMN "Number" smallint NULL, ADD COLUMN "Temperature" numeric NULL, ADD COLUMN "McuUrgencyLevel_Code" character varying(10) NOT NULL;
-- Modify "McuOrderItem" table
ALTER TABLE "public"."McuOrderItem" ADD COLUMN "ExaminationDate" timestamptz NULL;
-- Create index "idx_order_src" to table: "McuOrderItem"
CREATE UNIQUE INDEX "idx_order_src" ON "public"."McuOrderItem" ("McuOrder_Id", "McuSrc_Id");
-- Modify "PersonRelative" table
ALTER TABLE "public"."PersonRelative" ADD COLUMN "Responsible" boolean NULL;
-- Modify "McuSrc" table
ALTER TABLE "public"."McuSrc" ALTER COLUMN "Id" TYPE bigint, ADD COLUMN "Item_Id" bigint NULL, ADD CONSTRAINT "fk_McuSrc_Item" FOREIGN KEY ("Item_Id") REFERENCES "public"."Item" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
@@ -1,31 +0,0 @@
-- Create "McuSubSrc" table
CREATE TABLE "public"."McuSubSrc" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(20) NULL,
"Name" character varying(50) NULL,
"McuSrc_Id" bigint NULL,
"Item_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_McuSubSrc_Code" UNIQUE ("Code"),
CONSTRAINT "fk_McuSubSrc_Item" FOREIGN KEY ("Item_Id") REFERENCES "public"."Item" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_McuSubSrc_McuSrc" FOREIGN KEY ("McuSrc_Id") REFERENCES "public"."McuSrc" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "McuOrderSubItem" table
CREATE TABLE "public"."McuOrderSubItem" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"McuSubSrc_Id" bigint NULL,
"McuOrderItem_Id" bigint NULL,
"Result" text NULL,
"Status_Code" text NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_McuOrderSubItem_McuOrderItem" FOREIGN KEY ("McuOrderItem_Id") REFERENCES "public"."McuOrderItem" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_McuOrderSubItem_McuSubSrc" FOREIGN KEY ("McuSubSrc_Id") REFERENCES "public"."McuSubSrc" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create index "idx_order_sub_src" to table: "McuOrderSubItem"
CREATE UNIQUE INDEX "idx_order_sub_src" ON "public"."McuOrderSubItem" ("McuSubSrc_Id", "McuOrderItem_Id");
@@ -1,2 +0,0 @@
-- Modify "McuOrder" table
ALTER TABLE "public"."McuOrder" ALTER COLUMN "McuUrgencyLevel_Code" TYPE character varying(15);
@@ -1,17 +0,0 @@
-- Create "Consultation" table
CREATE TABLE "public"."Consultation" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Case" character varying(2048) NULL,
"Solution" character varying(2048) NULL,
"Unit_Id" bigint NULL,
"Doctor_Id" bigint NULL,
"RepliedAt" timestamptz NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Consultation_Doctor" FOREIGN KEY ("Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Consultation_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Consultation_Unit" FOREIGN KEY ("Unit_Id") REFERENCES "public"."Unit" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
@@ -1,2 +0,0 @@
-- Modify "Person" table
ALTER TABLE "public"."Person" ADD COLUMN "ResidentIdentityFileUrl" character varying(1024) NULL, ADD COLUMN "PassportFileUrl" character varying(1024) NULL, ADD COLUMN "DrivingLicenseFileUrl" character varying(1024) NULL, ADD COLUMN "FamilyIdentityFileUrl" character varying(1024) NULL;
@@ -1,2 +0,0 @@
-- Modify "Soapi" table
ALTER TABLE "public"."Soapi" ADD COLUMN "TypeCode" text NULL;
@@ -1,2 +0,0 @@
-- Modify "Soapi" table
ALTER TABLE "public"."Soapi" ALTER COLUMN "TypeCode" TYPE character varying(11);
@@ -1,6 +0,0 @@
-- Modify "MedicationItem" table
ALTER TABLE "public"."MedicationItem" ALTER COLUMN "Usage" TYPE character varying(255), ADD COLUMN "Frequency" integer NULL, ADD COLUMN "Dose" numeric NULL;
-- Modify "PrescriptionItem" table
ALTER TABLE "public"."PrescriptionItem" ALTER COLUMN "Usage" TYPE character varying(255), ADD COLUMN "Frequency" integer NULL, ADD COLUMN "Dose" numeric NULL;
-- Modify "MedicineMix" table
ALTER TABLE "public"."MedicineMix" ADD COLUMN "Uom_Code" character varying(10) NULL, ADD CONSTRAINT "fk_MedicineMix_Uom" FOREIGN KEY ("Uom_Code") REFERENCES "public"."Uom" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
@@ -1,4 +0,0 @@
-- Rename a column from "CheckupCategory_Code" to "McuSrcCategory_Code"
ALTER TABLE "public"."McuSrc" RENAME COLUMN "CheckupCategory_Code" TO "McuSrcCategory_Code";
-- Modify "McuSrc" table
ALTER TABLE "public"."McuSrc" DROP CONSTRAINT "fk_McuSrc_CheckupCategory", ADD CONSTRAINT "fk_McuSrc_McuSrcCategory" FOREIGN KEY ("McuSrcCategory_Code") REFERENCES "public"."McuSrcCategory" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
@@ -1,2 +0,0 @@
-- Modify "Division" table
ALTER TABLE "public"."Division" ALTER COLUMN "Parent_Id" TYPE integer, ADD CONSTRAINT "fk_Division_Childrens" FOREIGN KEY ("Parent_Id") REFERENCES "public"."Division" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
@@ -1,6 +0,0 @@
-- Modify "Infra" table
ALTER TABLE "public"."Infra" ADD CONSTRAINT "fk_Infra_Childrens" FOREIGN KEY ("Parent_Id") REFERENCES "public"."Infra" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
-- Modify "DeviceOrder" table
ALTER TABLE "public"."DeviceOrder" ADD COLUMN "Doctor_Id" bigint NULL, ADD CONSTRAINT "fk_DeviceOrder_Doctor" FOREIGN KEY ("Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
-- Modify "MaterialOrder" table
ALTER TABLE "public"."MaterialOrder" ADD COLUMN "Doctor_Id" bigint NULL, ADD CONSTRAINT "fk_MaterialOrder_Doctor" FOREIGN KEY ("Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
@@ -1,24 +0,0 @@
-- Modify "Person" table
ALTER TABLE "public"."Person" ADD COLUMN "Nationality" text NULL;
-- Create "Chemo" table
CREATE TABLE "public"."Chemo" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Status_Code" text NULL,
"VerifiedAt" timestamptz NULL,
"VerifiedBy_User_Id" bigint NULL,
"SrcUnit_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Chemo_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Chemo_SrcUnit" FOREIGN KEY ("SrcUnit_Id") REFERENCES "public"."Unit" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Chemo_VerifiedBy" FOREIGN KEY ("VerifiedBy_User_Id") REFERENCES "public"."User" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Rename a column from "Unit_Id" to "DstUnit_Id"
ALTER TABLE "public"."Consultation" RENAME COLUMN "Unit_Id" TO "DstUnit_Id";
-- Rename a column from "Doctor_Id" to "DstDoctor_Id"
ALTER TABLE "public"."Consultation" RENAME COLUMN "Doctor_Id" TO "DstDoctor_Id";
-- Modify "Consultation" table
ALTER TABLE "public"."Consultation" DROP CONSTRAINT "fk_Consultation_Doctor", DROP CONSTRAINT "fk_Consultation_Unit", DROP COLUMN "Case", ALTER COLUMN "Solution" TYPE character varying(10240), ADD COLUMN "Date" timestamptz NULL, ADD COLUMN "Problem" character varying(10240) NULL, ADD CONSTRAINT "fk_Consultation_DstDoctor" FOREIGN KEY ("DstDoctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION, ADD CONSTRAINT "fk_Consultation_DstUnit" FOREIGN KEY ("DstUnit_Id") REFERENCES "public"."Unit" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
@@ -1,2 +0,0 @@
-- Modify "DivisionPosition" table
ALTER TABLE "public"."DivisionPosition" ADD COLUMN "Employee_Id" bigint NULL, ADD CONSTRAINT "fk_DivisionPosition_Employee" FOREIGN KEY ("Employee_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
@@ -1,2 +0,0 @@
-- Modify "Person" table
ALTER TABLE "public"."Person" ADD COLUMN "CommunicationIssueStatus" boolean NULL, ADD COLUMN "Disabillity" character varying(100) NULL;
@@ -1,2 +0,0 @@
-- Rename a column from "Disabillity" to "Disability"
ALTER TABLE "public"."Person" RENAME COLUMN "Disabillity" TO "Disability";
@@ -1,2 +0,0 @@
-- Modify "Patient" table
ALTER TABLE "public"."Patient" ADD COLUMN "NewBornStatus" boolean NULL;
@@ -1,2 +0,0 @@
-- Modify "PersonAddress" table
ALTER TABLE "public"."PersonAddress" ADD COLUMN "PostalCode" character varying(6) NULL;
@@ -1,12 +0,0 @@
-- Create "Midwife" table
CREATE TABLE "public"."Midwife" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Employee_Id" bigint NULL,
"IHS_Number" character varying(20) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_Midwife_IHS_Number" UNIQUE ("IHS_Number"),
CONSTRAINT "fk_Midwife_Employee" FOREIGN KEY ("Employee_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
@@ -1,2 +0,0 @@
-- Modify "DivisionPosition" table
ALTER TABLE "public"."DivisionPosition" ADD COLUMN "HeadStatus" boolean NULL;
@@ -1,2 +0,0 @@
-- Modify "Infra" table
ALTER TABLE "public"."Infra" ALTER COLUMN "InfraGroup_Code" TYPE character varying(15);
@@ -1,9 +0,0 @@
-- Create "PostalCode" table
CREATE TABLE "public"."PostalCode" (
"Id" bigserial NOT NULL,
"Code" character varying(5) NULL,
"Village_Code" character varying(10) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_PostalCode_Code" UNIQUE ("Code"),
CONSTRAINT "fk_Village_PostalCodes" FOREIGN KEY ("Village_Code") REFERENCES "public"."Village" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION
);
@@ -1,8 +0,0 @@
-- Modify "Regency" table
ALTER TABLE "public"."Regency" DROP CONSTRAINT "fk_Province_Regencies", ALTER COLUMN "Id" TYPE bigint, ADD CONSTRAINT "fk_Regency_Province" FOREIGN KEY ("Province_Code") REFERENCES "public"."Province" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
-- Modify "District" table
ALTER TABLE "public"."District" DROP CONSTRAINT "fk_Regency_Districts", ADD CONSTRAINT "fk_District_Regency" FOREIGN KEY ("Regency_Code") REFERENCES "public"."Regency" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
-- Modify "Village" table
ALTER TABLE "public"."Village" DROP CONSTRAINT "fk_District_Villages", ADD CONSTRAINT "fk_Village_District" FOREIGN KEY ("District_Code") REFERENCES "public"."District" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
-- Modify "PostalCode" table
ALTER TABLE "public"."PostalCode" DROP CONSTRAINT "fk_Village_PostalCodes", ADD CONSTRAINT "fk_PostalCode_Village" FOREIGN KEY ("Village_Code") REFERENCES "public"."Village" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
@@ -1,6 +0,0 @@
-- Modify "Person" table
ALTER TABLE "public"."Person" ADD CONSTRAINT "fk_Person_BirthRegency" FOREIGN KEY ("BirthRegency_Code") REFERENCES "public"."Regency" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
-- Rename a column from "PostalCode" to "PostalCode_Code"
ALTER TABLE "public"."PersonAddress" RENAME COLUMN "PostalCode" TO "PostalCode_Code";
-- Modify "PersonAddress" table
ALTER TABLE "public"."PersonAddress" ADD CONSTRAINT "fk_PersonAddress_PostalCode" FOREIGN KEY ("PostalCode_Code") REFERENCES "public"."PostalCode" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
@@ -1,15 +0,0 @@
-- Create "PostalRegion" table
CREATE TABLE "public"."PostalRegion" (
"Id" bigserial NOT NULL,
"Village_Code" character varying(10) NULL,
"Code" character varying(5) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_PostalRegion_Code" UNIQUE ("Code"),
CONSTRAINT "fk_PostalRegion_Village" FOREIGN KEY ("Village_Code") REFERENCES "public"."Village" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Rename a column from "PostalCode_Code" to "PostalRegion_Code"
ALTER TABLE "public"."PersonAddress" RENAME COLUMN "PostalCode_Code" TO "PostalRegion_Code";
-- Modify "PersonAddress" table
ALTER TABLE "public"."PersonAddress" DROP CONSTRAINT "fk_PersonAddress_PostalCode", ADD COLUMN "LocationType_Code" character varying(10) NULL, ADD CONSTRAINT "fk_PersonAddress_PostalRegion" FOREIGN KEY ("PostalRegion_Code") REFERENCES "public"."PostalRegion" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
-- Drop "PostalCode" table
DROP TABLE "public"."PostalCode";
@@ -1,2 +0,0 @@
-- Modify "PersonAddress" table
ALTER TABLE "public"."PersonAddress" ADD CONSTRAINT "fk_PersonAddress_Village" FOREIGN KEY ("Village_Code") REFERENCES "public"."Village" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
@@ -1,14 +0,0 @@
-- Create "CheckoutPolies" table
CREATE TABLE "public"."CheckoutPolies" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Unit_Id" integer NULL,
"Doctor_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_CheckoutPolies_Doctor" FOREIGN KEY ("Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_CheckoutPolies_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_CheckoutPolies_Unit" FOREIGN KEY ("Unit_Id") REFERENCES "public"."Unit" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
@@ -1,2 +0,0 @@
-- Modify "Encounter" table
ALTER TABLE "public"."Encounter" ALTER COLUMN "DischargeMethod_Code" TYPE character varying(16);
@@ -1,16 +0,0 @@
-- Create "InternalReference" table
CREATE TABLE "public"."InternalReference" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Unit_Id" integer NULL,
"Doctor_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_InternalReference_Doctor" FOREIGN KEY ("Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_InternalReference_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_InternalReference_Unit" FOREIGN KEY ("Unit_Id") REFERENCES "public"."Unit" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Drop "CheckoutPolies" table
DROP TABLE "public"."CheckoutPolies";
@@ -1,36 +0,0 @@
-- Create "VClaimSepHist" table
CREATE TABLE "public"."VClaimSepHist" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"RequestPayload" text NULL,
"ResponseBody" text NULL,
"Message" text NULL,
PRIMARY KEY ("Id")
);
-- Modify "Encounter" table
ALTER TABLE "public"."Encounter" ADD COLUMN "PaymentMethod_Code" character varying(10) NULL, ADD COLUMN "InsuranceCompany_Id" bigint NULL, ADD COLUMN "Member_Number" character varying(20) NULL, ADD COLUMN "Ref_Number" character varying(20) NULL, ADD COLUMN "Trx_Number" character varying(20) NULL, ADD COLUMN "Adm_Employee_Id" bigint NULL, ADD CONSTRAINT "uni_Encounter_Member_Number" UNIQUE ("Member_Number"), ADD CONSTRAINT "uni_Encounter_Ref_Number" UNIQUE ("Ref_Number"), ADD CONSTRAINT "uni_Encounter_Trx_Number" UNIQUE ("Trx_Number"), ADD CONSTRAINT "fk_Encounter_Adm_Employee" FOREIGN KEY ("Adm_Employee_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION, ADD CONSTRAINT "fk_Encounter_InsuranceCompany" FOREIGN KEY ("InsuranceCompany_Id") REFERENCES "public"."InsuranceCompany" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
-- Create "VClaimSep" table
CREATE TABLE "public"."VClaimSep" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Number" character varying(19) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_VClaimSep_Number" UNIQUE ("Number"),
CONSTRAINT "fk_Encounter_VclaimSep" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "VClaimSepPrint" table
CREATE TABLE "public"."VClaimSepPrint" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"VclaimSep_Number" character varying(19) NULL,
"Counter" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_VClaimSepPrint_VclaimSep" FOREIGN KEY ("VclaimSep_Number") REFERENCES "public"."VClaimSep" ("Number") ON UPDATE NO ACTION ON DELETE NO ACTION
);
@@ -1,16 +0,0 @@
-- Create "VclaimSep" table
CREATE TABLE "public"."VclaimSep" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Number" character varying(19) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_VclaimSep_Number" UNIQUE ("Number"),
CONSTRAINT "fk_Encounter_VclaimSep" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Modify "VClaimSepPrint" table
ALTER TABLE "public"."VClaimSepPrint" DROP CONSTRAINT "fk_VClaimSepPrint_VclaimSep", ADD CONSTRAINT "fk_VClaimSepPrint_VclaimSep" FOREIGN KEY ("VclaimSep_Number") REFERENCES "public"."VclaimSep" ("Number") ON UPDATE NO ACTION ON DELETE NO ACTION;
-- Drop "VClaimSep" table
DROP TABLE "public"."VClaimSep";
@@ -1,26 +0,0 @@
-- Create "VclaimSepHist" table
CREATE TABLE "public"."VclaimSepHist" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"RequestPayload" text NULL,
"ResponseBody" text NULL,
"Message" text NULL,
PRIMARY KEY ("Id")
);
-- Create "VclaimSepPrint" table
CREATE TABLE "public"."VclaimSepPrint" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"VclaimSep_Number" character varying(19) NULL,
"Counter" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_VclaimSepPrint_VclaimSep" FOREIGN KEY ("VclaimSep_Number") REFERENCES "public"."VclaimSep" ("Number") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Drop "VClaimSepHist" table
DROP TABLE "public"."VClaimSepHist";
-- Drop "VClaimSepPrint" table
DROP TABLE "public"."VClaimSepPrint";
@@ -1,2 +0,0 @@
-- Modify "Chemo" table
ALTER TABLE "public"."Chemo" ADD COLUMN "ClassCode" text NULL;
@@ -1,2 +0,0 @@
-- Rename a column from "ClassCode" to "Class_Code"
ALTER TABLE "public"."Chemo" RENAME COLUMN "ClassCode" TO "Class_Code";
@@ -1,17 +0,0 @@
-- Create "PersonInsurance" table
CREATE TABLE "public"."PersonInsurance" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Person_Id" bigint NULL,
"InsuranceCompany_Id" bigint NULL,
"Ref_Number" character varying(20) NULL,
"DefaultStatus" boolean NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_PersonInsurance_Ref_Number" UNIQUE ("Ref_Number"),
CONSTRAINT "fk_PersonInsurance_InsuranceCompany" FOREIGN KEY ("InsuranceCompany_Id") REFERENCES "public"."InsuranceCompany" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Person_Insurances" FOREIGN KEY ("Person_Id") REFERENCES "public"."Person" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create index "idx_person_insurance" to table: "PersonInsurance"
CREATE UNIQUE INDEX "idx_person_insurance" ON "public"."PersonInsurance" ("Person_Id", "DefaultStatus");
@@ -1,54 +0,0 @@
-- Create "AmbulanceTransportReq" table
CREATE TABLE "public"."AmbulanceTransportReq" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Patient_Id" bigint NULL,
"Diagnoses" character varying(1024) NULL,
"RequestData" timestamptz NULL,
"UsageDate" timestamptz NULL,
"Address" character varying(100) NULL,
"RtRw" character varying(10) NULL,
"Province_Code" character varying(2) NULL,
"Regency_Code" character varying(4) NULL,
"District_Code" character varying(6) NULL,
"Village_Code" character varying(10) NULL,
"Facility_Code" character varying(10) NULL,
"Needs_Code" character varying(10) NULL,
"Contact_Name" character varying(100) NULL,
"Contact_Relationship_Code" character varying(10) NULL,
"Contact_PhoneNumber" character varying(20) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_AmbulanceTransportReq_District" FOREIGN KEY ("District_Code") REFERENCES "public"."District" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_AmbulanceTransportReq_Patient" FOREIGN KEY ("Patient_Id") REFERENCES "public"."Patient" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_AmbulanceTransportReq_Province" FOREIGN KEY ("Province_Code") REFERENCES "public"."Province" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_AmbulanceTransportReq_Regency" FOREIGN KEY ("Regency_Code") REFERENCES "public"."Regency" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_AmbulanceTransportReq_Village" FOREIGN KEY ("Village_Code") REFERENCES "public"."Village" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "Vehicle" table
CREATE TABLE "public"."Vehicle" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Type_Code" text NULL,
"PoliceNumber" text NULL,
"FrameNumber" text NULL,
"RegNumber" text NULL,
"AvailableStatus" boolean NULL,
PRIMARY KEY ("Id")
);
-- Create "VehicleHist" table
CREATE TABLE "public"."VehicleHist" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Vehicle_Id" bigint NULL,
"Date" timestamptz NULL,
"Data" text NULL,
"Crud_Code" text NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_VehicleHist_Vehicle" FOREIGN KEY ("Vehicle_Id") REFERENCES "public"."Vehicle" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
@@ -1,2 +0,0 @@
-- Modify "MedicalActionSrc" table
ALTER TABLE "public"."MedicalActionSrc" ADD COLUMN "Type_Code" character varying(20) NULL;
@@ -1,2 +0,0 @@
-- Modify "Item" table
ALTER TABLE "public"."Item" ALTER COLUMN "ItemGroup_Code" TYPE character varying(15);
@@ -1,4 +0,0 @@
-- Modify "Employee" table
ALTER TABLE "public"."Employee" ADD COLUMN "Position_Code" character varying(20) NULL;
-- Rename a column from "Position_Code" to "ContractPosition_Code"
ALTER TABLE "public"."User" RENAME COLUMN "Position_Code" TO "ContractPosition_Code";
@@ -1,13 +0,0 @@
-- Create "Intern" table
CREATE TABLE "public"."Intern" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Person_Id" bigint NULL,
"Position_Code" character varying(20) NULL,
"User_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Intern_Person" FOREIGN KEY ("Person_Id") REFERENCES "public"."Person" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Intern_User" FOREIGN KEY ("User_Id") REFERENCES "public"."User" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
@@ -1,15 +0,0 @@
-- -- Rename a column from "Position_Code" to "ContractPosition_Code"
-- ALTER TABLE "public"."User" RENAME COLUMN "Position_Code" TO "ContractPosition_Code";
-- -- Create "Intern" table
-- CREATE TABLE "public"."Intern" (
-- "Id" bigserial NOT NULL,
-- "CreatedAt" timestamptz NULL,
-- "UpdatedAt" timestamptz NULL,
-- "DeletedAt" timestamptz NULL,
-- "Person_Id" bigint NULL,
-- "Position_Code" character varying(20) NULL,
-- "User_Id" bigint NULL,
-- PRIMARY KEY ("Id"),
-- CONSTRAINT "fk_Intern_Person" FOREIGN KEY ("Person_Id") REFERENCES "public"."Person" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
-- CONSTRAINT "fk_Intern_User" FOREIGN KEY ("User_Id") REFERENCES "public"."User" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
-- );
@@ -1,2 +0,0 @@
-- Rename a column from "RequestData" to "RequestDate"
ALTER TABLE "public"."AmbulanceTransportReq" RENAME COLUMN "RequestData" TO "RequestDate";
@@ -1,60 +0,0 @@
-- Create "DeathCause" table
CREATE TABLE "public"."DeathCause" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NOT NULL,
"Value" text NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_DeathCause_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "EduAssessment" table
CREATE TABLE "public"."EduAssessment" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NOT NULL,
"GeneralEdus" text NULL,
"SpecialEdus" text NULL,
"Assessments" text NULL,
"Plan" text NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_EduAssessment_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "GeneralConsent" table
CREATE TABLE "public"."GeneralConsent" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NOT NULL,
"Value" text NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_GeneralConsent_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "TherapyProtocol" table
CREATE TABLE "public"."TherapyProtocol" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NOT NULL,
"Doctor_Id" bigint NULL,
"Anamnesis" character varying(2048) NULL,
"MedicalDiagnoses" text NULL,
"FunctionDiagnoses" text NULL,
"Procedures" text NULL,
"SupportingExams" character varying(2048) NULL,
"Instruction" character varying(2048) NULL,
"Evaluation" character varying(2048) NULL,
"WorkCauseStatus" character varying(2048) NULL,
"Frequency" bigint NULL,
"IntervalUnit_Code" character varying(10) NULL,
"Duration" bigint NULL,
"DurationUnit_Code" character varying(10) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_TherapyProtocol_Doctor" FOREIGN KEY ("Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_TherapyProtocol_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
@@ -1,8 +0,0 @@
-- Rename a column from "DischargeMethod_Code" to "Discharge_Method_Code"
ALTER TABLE "public"."Encounter" RENAME COLUMN "DischargeMethod_Code" TO "Discharge_Method_Code";
-- Modify "Encounter" table
ALTER TABLE "public"."Encounter" ADD COLUMN "Discharge_Date" timestamptz NULL;
-- Modify "DeathCause" table
ALTER TABLE "public"."DeathCause" DROP CONSTRAINT "fk_DeathCause_Encounter", ADD CONSTRAINT "fk_Encounter_DeathCause" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
-- Modify "InternalReference" table
ALTER TABLE "public"."InternalReference" DROP CONSTRAINT "fk_InternalReference_Encounter", ADD CONSTRAINT "fk_Encounter_InternalReferences" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
@@ -1,90 +0,0 @@
-- Create "AdmEmployeeHist" table
CREATE TABLE "public"."AdmEmployeeHist" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Employee_Id" bigint NULL,
"StartedAt" timestamptz NULL,
"FinishedAt" timestamptz NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_AdmEmployeeHist_Employee" FOREIGN KEY ("Employee_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "InstallationPosition" table
CREATE TABLE "public"."InstallationPosition" (
"Id" serial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Installation_Id" integer NOT NULL,
"Code" character varying(10) NOT NULL,
"Name" character varying(30) NOT NULL,
"HeadStatus" boolean NULL,
"Employee_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_InstallationPosition_Code" UNIQUE ("Code"),
CONSTRAINT "fk_InstallationPosition_Employee" FOREIGN KEY ("Employee_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_InstallationPosition_Installation" FOREIGN KEY ("Installation_Id") REFERENCES "public"."Installation" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "ResponsibleDoctorHist" table
CREATE TABLE "public"."ResponsibleDoctorHist" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Doctor_Id" bigint NULL,
"StartedAt" timestamptz NULL,
"FinishedAt" timestamptz NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_ResponsibleDoctorHist_Doctor" FOREIGN KEY ("Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "SpecialistPosition" table
CREATE TABLE "public"."SpecialistPosition" (
"Id" serial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Specialist_Id" integer NOT NULL,
"Code" character varying(10) NOT NULL,
"Name" character varying(30) NOT NULL,
"HeadStatus" boolean NULL,
"Employee_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_SpecialistPosition_Code" UNIQUE ("Code"),
CONSTRAINT "fk_SpecialistPosition_Employee" FOREIGN KEY ("Employee_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_SpecialistPosition_Specialist" FOREIGN KEY ("Specialist_Id") REFERENCES "public"."Specialist" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "SubspecialistPosition" table
CREATE TABLE "public"."SubspecialistPosition" (
"Id" serial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Subspecialist_Id" integer NOT NULL,
"Code" character varying(10) NOT NULL,
"Name" character varying(30) NOT NULL,
"HeadStatus" boolean NULL,
"Employee_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_SubspecialistPosition_Code" UNIQUE ("Code"),
CONSTRAINT "fk_SubspecialistPosition_Employee" FOREIGN KEY ("Employee_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_SubspecialistPosition_Subspecialist" FOREIGN KEY ("Subspecialist_Id") REFERENCES "public"."Subspecialist" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "UnitPosition" table
CREATE TABLE "public"."UnitPosition" (
"Id" serial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Unit_Id" integer NOT NULL,
"Code" character varying(10) NOT NULL,
"Name" character varying(30) NOT NULL,
"HeadStatus" boolean NULL,
"Employee_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_UnitPosition_Code" UNIQUE ("Code"),
CONSTRAINT "fk_UnitPosition_Employee" FOREIGN KEY ("Employee_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_UnitPosition_Unit" FOREIGN KEY ("Unit_Id") REFERENCES "public"."Unit" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
@@ -1,12 +0,0 @@
-- Modify "Doctor" table
ALTER TABLE "public"."Doctor" ADD COLUMN "Code" character varying(20) NULL, ADD CONSTRAINT "uni_Doctor_Code" UNIQUE ("Code");
-- Modify "Laborant" table
ALTER TABLE "public"."Laborant" ADD COLUMN "Code" character varying(20) NULL, ADD CONSTRAINT "uni_Laborant_Code" UNIQUE ("Code");
-- Modify "Midwife" table
ALTER TABLE "public"."Midwife" ADD COLUMN "Code" character varying(20) NULL, ADD CONSTRAINT "uni_Midwife_Code" UNIQUE ("Code");
-- Modify "Nurse" table
ALTER TABLE "public"."Nurse" ADD COLUMN "Code" character varying(20) NULL, ADD CONSTRAINT "uni_Nurse_Code" UNIQUE ("Code");
-- Modify "Nutritionist" table
ALTER TABLE "public"."Nutritionist" ADD COLUMN "Code" character varying(20) NULL, ADD CONSTRAINT "uni_Nutritionist_Code" UNIQUE ("Code");
-- Modify "Pharmacist" table
ALTER TABLE "public"."Pharmacist" ADD COLUMN "Code" character varying(20) NULL, ADD CONSTRAINT "uni_Pharmacist_Code" UNIQUE ("Code");
@@ -1,2 +0,0 @@
-- Modify "Employee" table
ALTER TABLE "public"."Employee" DROP COLUMN "Division_Code";
@@ -1,4 +0,0 @@
-- Modify "Patient" table
ALTER TABLE "public"."Patient" ADD COLUMN "RegisteredBy_User_Name" character varying(100) NULL;
-- Modify "Person" table
ALTER TABLE "public"."Person" ADD COLUMN "Confidence" character varying(512) NULL, ADD COLUMN "MaritalStatus_Code" character varying(10) NULL;
@@ -1,12 +0,0 @@
-- Create "VclaimMember" table
CREATE TABLE "public"."VclaimMember" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"CardNumber" character varying(20) NULL,
"Person_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_VclaimMember_CardNumber" UNIQUE ("CardNumber"),
CONSTRAINT "fk_Person_VclaimMember" FOREIGN KEY ("Person_Id") REFERENCES "public"."Person" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
@@ -1,2 +0,0 @@
-- Modify "Encounter" table
ALTER TABLE "public"."Encounter" ADD COLUMN "StartedAt" timestamptz NULL, ADD COLUMN "FinishedAt" timestamptz NULL, ADD COLUMN "RefType_Code" text NULL, ADD COLUMN "NewStatus" boolean NULL;
@@ -1,2 +0,0 @@
-- Modify "Patient" table
ALTER TABLE "public"."Patient" ADD COLUMN "Parent_Number" character varying(15) NULL, ADD CONSTRAINT "fk_Patient_Parent" FOREIGN KEY ("Parent_Number") REFERENCES "public"."Patient" ("Number") ON UPDATE NO ACTION ON DELETE NO ACTION;
@@ -1,6 +0,0 @@
-- Modify "McuOrder" table
ALTER TABLE "public"."McuOrder" ADD COLUMN "Scope_Code" character varying(10) NULL;
-- Create index "idx_McuOrder_Scope_Code" to table: "McuOrder"
CREATE INDEX "idx_McuOrder_Scope_Code" ON "public"."McuOrder" ("Scope_Code");
-- Create index "idx_McuSrcCategory_Scope_Code" to table: "McuSrcCategory"
CREATE INDEX "idx_McuSrcCategory_Scope_Code" ON "public"."McuSrcCategory" ("Scope_Code");
@@ -1,2 +0,0 @@
-- Rename a column from "McuUrgencyLevel_Code" to "UrgencyLevel_Code"
ALTER TABLE "public"."McuOrder" RENAME COLUMN "McuUrgencyLevel_Code" TO "UrgencyLevel_Code";
@@ -1,17 +0,0 @@
-- Create "ControlLetter" table
CREATE TABLE "public"."ControlLetter" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Unit_Id" bigint NULL,
"Specialist_Id" bigint NULL,
"Subspecialist_Id" bigint NULL,
"Date" timestamptz NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_ControlLetter_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_ControlLetter_Specialist" FOREIGN KEY ("Specialist_Id") REFERENCES "public"."Specialist" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_ControlLetter_Subspecialist" FOREIGN KEY ("Subspecialist_Id") REFERENCES "public"."Subspecialist" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_ControlLetter_Unit" FOREIGN KEY ("Unit_Id") REFERENCES "public"."Unit" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
@@ -1,2 +0,0 @@
-- Modify "Chemo" table
ALTER TABLE "public"."Chemo" DROP COLUMN "Class_Code", ADD COLUMN "Bed" character varying(1024) NULL, ADD COLUMN "Needs" character varying(2048) NULL;
@@ -1,19 +0,0 @@
-- Modify "Ambulatory" table
ALTER TABLE "public"."Ambulatory" DROP CONSTRAINT "fk_Ambulatory_Encounter", ADD COLUMN "VisitMode_Code" text NULL, ADD CONSTRAINT "fk_Encounter_Ambulatory" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
-- Modify "Emergency" table
ALTER TABLE "public"."Emergency" DROP CONSTRAINT "fk_Emergency_Encounter", ADD CONSTRAINT "fk_Encounter_Emergency" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
-- Modify "Inpatient" table
ALTER TABLE "public"."Inpatient" DROP CONSTRAINT "fk_Inpatient_Encounter", ADD CONSTRAINT "fk_Encounter_Inpatient" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
-- Create "Rehab" table
CREATE TABLE "public"."Rehab" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Doctor_Id" bigint NULL,
"AllocatedVisitCount" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Rehab_Doctor" FOREIGN KEY ("Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Rehab_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
@@ -1,2 +0,0 @@
-- Modify "ControlLetter" table
ALTER TABLE "public"."ControlLetter" ADD COLUMN "Doctor_Id" bigint NULL, ADD CONSTRAINT "fk_ControlLetter_Doctor" FOREIGN KEY ("Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
@@ -1,17 +0,0 @@
-- Create "ChemoProtocol" table
CREATE TABLE "public"."ChemoProtocol" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Patient_Weight" numeric NULL,
"Patient_Height" numeric NULL,
"Diagnoses" text NULL,
"Duration" bigint NULL,
"DurationUnit_Code" character varying(10) NULL,
"StartDate" timestamptz NULL,
"EndDate" timestamptz NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_ChemoProtocol_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
@@ -1,38 +0,0 @@
-- Create "AntibioticSrcCategory" table
CREATE TABLE "public"."AntibioticSrcCategory" (
"Id" serial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(20) NULL,
"Name" character varying(50) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_AntibioticSrcCategory_Code" UNIQUE ("Code")
);
-- Create "AntibioticSrc" table
CREATE TABLE "public"."AntibioticSrc" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Code" character varying(20) NULL,
"Name" character varying(50) NULL,
"AntibioticSrcCategory_Code" character varying(20) NULL,
"Item_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_AntibioticSrc_Code" UNIQUE ("Code"),
CONSTRAINT "fk_AntibioticSrc_AntibioticSrcCategory" FOREIGN KEY ("AntibioticSrcCategory_Code") REFERENCES "public"."AntibioticSrcCategory" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_AntibioticSrc_Item" FOREIGN KEY ("Item_Id") REFERENCES "public"."Item" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "AntibioticInUse" table
CREATE TABLE "public"."AntibioticInUse" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"McuOrder_Id" bigint NULL,
"AntibioticSrc_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_AntibioticInUse_AntibioticSrc" FOREIGN KEY ("AntibioticSrc_Id") REFERENCES "public"."AntibioticSrc" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_AntibioticInUse_McuOrder" FOREIGN KEY ("McuOrder_Id") REFERENCES "public"."McuOrder" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
@@ -1,2 +0,0 @@
-- Modify "AntibioticSrc" table
ALTER TABLE "public"."AntibioticSrc" DROP COLUMN "Item_Id";
Loaded 100 of 1518 files, more files were not shown because too many files have changed in this diff. Show more