Merge branch 'migration-vanilia' of https://github.com/dikstub-rssa/simrs-be into feat/sync-vanili

This commit is contained in:
vanilia
2025-12-09 15:42:11 +07:00
119 changed files with 4930 additions and 344 deletions
+167
View File
@@ -0,0 +1,167 @@
<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
@@ -0,0 +1,109 @@
<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
@@ -0,0 +1,312 @@
<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: rsu-drsaifulanwar@jatimprov.go.id</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
@@ -0,0 +1,217 @@
<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: rsu-drsaifulanwar@jatimprov.go.id</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
@@ -0,0 +1,241 @@
<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: rsu-drsaifulanwar@jatimprov.go.id</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>
@@ -0,0 +1,4 @@
-- Modify "ProcedureRoomOrder" table
ALTER TABLE "public"."ProcedureRoomOrder" DROP COLUMN "Infra_Code";
-- Modify "ProcedureRoomOrderItem" table
ALTER TABLE "public"."ProcedureRoomOrderItem" ADD CONSTRAINT "fk_ProcedureRoomOrderItem_ProcedureRoomOrder" FOREIGN KEY ("ProcedureRoomOrder_Id") REFERENCES "public"."ProcedureRoomOrder" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
@@ -0,0 +1,23 @@
-- Modify "Chemo" table
ALTER TABLE "public"."Chemo" ADD COLUMN "Doctor_Code" character varying(20) NULL, ADD COLUMN "NextChemoDate" timestamptz NULL, ADD CONSTRAINT "fk_Chemo_Doctor" FOREIGN KEY ("Doctor_Code") REFERENCES "public"."Doctor" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;
-- Rename a column from "Encounter_Id" to "Chemo_Id"
ALTER TABLE "public"."ChemoProtocol" RENAME COLUMN "Encounter_Id" TO "Chemo_Id";
-- Modify "ChemoProtocol" table
ALTER TABLE "public"."ChemoProtocol" DROP CONSTRAINT "fk_ChemoProtocol_Encounter", ALTER COLUMN "DurationUnit_Code" TYPE text, ADD COLUMN "Interval" bigint NULL, ADD COLUMN "Cycle" bigint NULL, ADD COLUMN "Series" integer NULL, ADD COLUMN "Status_Code" text NULL, ADD CONSTRAINT "fk_ChemoProtocol_Chemo" FOREIGN KEY ("Chemo_Id") REFERENCES "public"."Chemo" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
-- Create "ChemoPlan" table
CREATE TABLE "public"."ChemoPlan" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Parent_Id" bigint NULL,
"Protocol_Id" bigint NULL,
"SeriesNumber" integer NULL,
"CycleNumber" bigint NULL,
"PlanDate" timestamptz NULL,
"RealizationDate" timestamptz NULL,
"Notes" text NULL,
"Status" text NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_ChemoPlan_Protocol" FOREIGN KEY ("Protocol_Id") REFERENCES "public"."ChemoProtocol" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
@@ -0,0 +1,2 @@
-- Modify "ChemoPlan" table
ALTER TABLE "public"."ChemoPlan" DROP CONSTRAINT "fk_ChemoPlan_Protocol", ADD CONSTRAINT "fk_ChemoProtocol_ChemoPlans" FOREIGN KEY ("Protocol_Id") REFERENCES "public"."ChemoProtocol" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
@@ -0,0 +1,2 @@
-- Modify "ChemoProtocol" table
ALTER TABLE "public"."ChemoProtocol" ADD COLUMN "Patient_Id" bigint NULL;
@@ -0,0 +1,2 @@
-- Modify "ChemoProtocol" table
ALTER TABLE "public"."ChemoProtocol" ADD COLUMN "VerifiedAt" timestamptz NULL, ADD COLUMN "VerifiedBy_User_Id" bigint NULL, ADD CONSTRAINT "fk_ChemoProtocol_VerifiedBy" FOREIGN KEY ("VerifiedBy_User_Id") REFERENCES "public"."User" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
@@ -0,0 +1,26 @@
-- Create "ProcedureReport" table
CREATE TABLE "public"."ProcedureReport" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Date" timestamptz NOT NULL,
"Doctor_Code" character varying(10) NULL,
"Operator_Name" text NULL,
"Assistant_Name" text NULL,
"Instrumentor_Name" text NULL,
"Diagnose" character varying(1024) NULL,
"Nurse_Name" character varying(10) NULL,
"Anesthesia_Doctor_Code" character varying(10) NULL,
"Anesthesia_Nurse_Name" text NULL,
"ProcedureValue" text NULL,
"ExecutionValue" text NULL,
"Type_Code" text NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_ProcedureReport_Anesthesia_Doctor" FOREIGN KEY ("Anesthesia_Doctor_Code") REFERENCES "public"."Doctor" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_ProcedureReport_Doctor" FOREIGN KEY ("Doctor_Code") REFERENCES "public"."Doctor" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_ProcedureReport_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Drop "ActionReport" table
DROP TABLE "public"."ActionReport";
@@ -0,0 +1,22 @@
-- Create "ApMcuOrder" table
CREATE TABLE "public"."ApMcuOrder" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"McuOrder_Id" smallint NULL,
"Substances" text NULL,
"Fictations" text NULL,
"Localization" text NULL,
"ClinicalDiagnoses" text NULL,
"Stadium" text NULL,
"ClinicalNotes" text NULL,
"PastHistory" text NULL,
"CurrentHistory" text NULL,
"PrevApMcu" text NULL,
"PrevApMcuNotes" text NULL,
"SupportingExams" text NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_ApMcuOrder_McuOrder_Id" UNIQUE ("McuOrder_Id"),
CONSTRAINT "fk_ApMcuOrder_McuOrder" FOREIGN KEY ("McuOrder_Id") REFERENCES "public"."McuOrder" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
@@ -0,0 +1,99 @@
-- Modify "ApMcuOrder" table
ALTER TABLE "public"."ApMcuOrder" DROP COLUMN "McuOrder_Id", ADD COLUMN "Encounter_Id" bigint NULL, ADD COLUMN "Number" bigint NULL, ADD COLUMN "Doctor_Code" character varying(20) NULL, ADD CONSTRAINT "uni_ApMcuOrder_Doctor_Code" UNIQUE ("Doctor_Code"), ADD CONSTRAINT "fk_ApMcuOrder_Doctor" FOREIGN KEY ("Doctor_Code") REFERENCES "public"."Doctor" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION, ADD CONSTRAINT "fk_ApMcuOrder_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
-- Create "CpMcuOrder" table
CREATE TABLE "public"."CpMcuOrder" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Number" bigint NULL,
"Doctor_Code" character varying(20) NULL,
"UrgencyLevel_Code" character varying(15) NOT NULL,
"OtherNotes" text NULL,
"ExamScheduleDate" timestamptz NULL,
"Resume" text NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_CpMcuOrder_Doctor_Code" UNIQUE ("Doctor_Code"),
CONSTRAINT "fk_CpMcuOrder_Doctor" FOREIGN KEY ("Doctor_Code") REFERENCES "public"."Doctor" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_CpMcuOrder_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "CpMcuOrderItem" table
CREATE TABLE "public"."CpMcuOrderItem" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"CpMcuOrder_Id" bigint NULL,
"McuSrc_Code" character varying(20) NULL,
"Note" character varying(1024) NULL,
"Result" text NULL,
"Status_Code" text NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_CpMcuOrderItem_CpMcuOrder" FOREIGN KEY ("CpMcuOrder_Id") REFERENCES "public"."CpMcuOrder" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_CpMcuOrderItem_McuSrc" FOREIGN KEY ("McuSrc_Code") REFERENCES "public"."McuSrc" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "MicroMcuOrder" table
CREATE TABLE "public"."MicroMcuOrder" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Number" bigint NULL,
"Doctor_Code" character varying(20) NULL,
"Stage_Code" character varying(10) NOT NULL,
"AxillaryTemp" numeric NULL,
"OtherNotes" text NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_MicroMcuOrder_Doctor_Code" UNIQUE ("Doctor_Code"),
CONSTRAINT "fk_MicroMcuOrder_Doctor" FOREIGN KEY ("Doctor_Code") REFERENCES "public"."Doctor" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_MicroMcuOrder_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "MicroMcuOrderItem" table
CREATE TABLE "public"."MicroMcuOrderItem" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"MicroMcuOrder_Id" bigint NULL,
"McuSrc_Code" character varying(20) NULL,
"Note" character varying(1024) NULL,
"Result" text NULL,
"Status_Code" text NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_MicroMcuOrderItem_McuSrc" FOREIGN KEY ("McuSrc_Code") REFERENCES "public"."McuSrc" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_MicroMcuOrderItem_MicroMcuOrder" FOREIGN KEY ("MicroMcuOrder_Id") REFERENCES "public"."MicroMcuOrder" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "RadiologyMcuOrder" table
CREATE TABLE "public"."RadiologyMcuOrder" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Number" bigint NULL,
"Doctor_Code" character varying(20) NULL,
"ClinicalNotes" text NULL,
"OtherNotes" text NULL,
"Resume" text NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_RadiologyMcuOrder_Doctor_Code" UNIQUE ("Doctor_Code"),
CONSTRAINT "fk_RadiologyMcuOrder_Doctor" FOREIGN KEY ("Doctor_Code") REFERENCES "public"."Doctor" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_RadiologyMcuOrder_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Create "RadiologyMcuOrderItem" table
CREATE TABLE "public"."RadiologyMcuOrderItem" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"RadiologyMcuOrder_Id" bigint NULL,
"McuSrc_Code" character varying(20) NULL,
"Note" character varying(1024) NULL,
"Result" text NULL,
"Status_Code" text NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_RadiologyMcuOrderItem_McuSrc" FOREIGN KEY ("McuSrc_Code") REFERENCES "public"."McuSrc" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_RadiologyMcuOrderItem_RadiologyMcuOrder" FOREIGN KEY ("RadiologyMcuOrder_Id") REFERENCES "public"."RadiologyMcuOrder" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
@@ -0,0 +1,8 @@
-- Modify "ApMcuOrder" table
ALTER TABLE "public"."ApMcuOrder" ADD COLUMN "Status_Code" character varying(10) NOT NULL;
-- Modify "CpMcuOrder" table
ALTER TABLE "public"."CpMcuOrder" ADD COLUMN "Status_Code" character varying(10) NOT NULL;
-- Modify "MicroMcuOrder" table
ALTER TABLE "public"."MicroMcuOrder" ADD COLUMN "Status_Code" character varying(10) NOT NULL;
-- Modify "RadiologyMcuOrder" table
ALTER TABLE "public"."RadiologyMcuOrder" ADD COLUMN "Status_Code" character varying(10) NOT NULL;
@@ -0,0 +1,2 @@
-- Modify "ChemoPlan" table
ALTER TABLE "public"."ChemoPlan" ADD COLUMN "Encounter_Id" bigint NULL, ADD CONSTRAINT "fk_ChemoPlan_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
@@ -0,0 +1,2 @@
-- Modify "Chemo" table
ALTER TABLE "public"."Chemo" ADD COLUMN "Class_Code" text NULL;
@@ -0,0 +1,2 @@
-- Modify "ProcedureReport" table
ALTER TABLE "public"."ProcedureReport" ALTER COLUMN "Nurse_Name" TYPE text;
@@ -0,0 +1,2 @@
-- Modify "ChemoPlan" table
ALTER TABLE "public"."ChemoPlan" ADD COLUMN "Reasons" text NULL;
@@ -0,0 +1,12 @@
-- Create "Registration" table
CREATE TABLE "public"."Registration" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Employee_Id" bigint NULL,
"Installation_Code" character varying(20) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Registration_Employee" FOREIGN KEY ("Employee_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Registration_Installation" FOREIGN KEY ("Installation_Code") REFERENCES "public"."Installation" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION
);
@@ -0,0 +1,2 @@
-- Modify "Person" table
ALTER TABLE "public"."Person" ADD COLUMN "BirthPlace" text NULL;
+15 -1
View File
@@ -1,4 +1,4 @@
h1:DgMML95zGYI7JMvZaIb/gySCvncMu62CANOIXNX0A6w=
h1:YJzcjq4dKD7GKlV0GJ88TOtZgg0JRDcVMlAe5ZYT9/U=
20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k=
20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0=
20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI=
@@ -144,3 +144,17 @@ h1:DgMML95zGYI7JMvZaIb/gySCvncMu62CANOIXNX0A6w=
20251202160848.sql h1:Kd2/TziKSMezrt4XgbjQcYvY/Lo9rX0qw7/Lz0/oyKk=
20251202180207.sql h1:IHmSMIO3ia+YV5GULixbdlV1joaUAWtnjQHPd8+HKiM=
20251202231005.sql h1:lua0KKoeBptSfs/6ehZE6Azo6YUlNkOJwGFyb1HQWkY=
20251203205052.sql h1:nk0VK2Uv4bHE3SBfHo/aevVZxtHzr7zAzvmMU8TCCtk=
20251205073858.sql h1:46qqXnArgJmzGE/WO7v7Ev8Jh7BudDiGbdANexq/5Dk=
20251205211957.sql h1:3fvtZ/mBWsTIXllXMFOuCLJsp4MivVP56dunehlU0yo=
20251205214433.sql h1:rn3++FEfX7ntcJcOmCEuOMnr27TZqH0KMGRppzFwFTc=
20251205221124.sql h1:CRruUvGZqlVDBmbQSVEl4wFm+uq30AurMMDI6sb8jxg=
20251206021053.sql h1:bpuEocu4lOhZ7oLuxd//22dzjfNgU2iaWEqSD1mVwoU=
20251207020537.sql h1:m6uh4NHVF3EKNTVMqOmuBSDFD9oCQk5mAwo05fT46G4=
20251207212015.sql h1:UPelYGTeUR6rm8mU8dfNzgRDEDun0UQ4tkgsaDljn30=
20251207221222.sql h1:bTfUCvCf2UPh+BA2IY2PHQafb9DwY9nhH5FRuMEHy+0=
20251209022744.sql h1:y5/PAiZH/fYCpDJpkQdNRJwWICHH2iNIwM1V+S1P6KA=
20251209025908.sql h1:p3kZA8kyEj+mQZSrdY3k2K1NojQzFJh/MlZJ0Oy6t/k=
20251209030538.sql h1:zltV6/Fu2zJW0/lVBl7MdnWuJcqNTUIRcqYYZ8Fi1wo=
20251209064304.sql h1:Mj6Zh+2b/4AkM1HjnJGjAs788kVN0UaL34jeaKQIjT0=
20251209070128.sql h1:rdqSlAmJS5XSc1w9dka3C53zwgibQwRIUqBcgmIPoTM=
@@ -0,0 +1,72 @@
-- Create "DoctorLink" table
CREATE TABLE "public"."DoctorLink" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Simx_Id" bigint NULL,
"Simgos_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_DoctorLink_Simgos_Id" UNIQUE ("Simgos_Id"),
CONSTRAINT "uni_DoctorLink_Simx_Id" UNIQUE ("Simx_Id")
);
-- Create "DoctorSimgosLog" table
CREATE TABLE "public"."DoctorSimgosLog" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Value" text NULL,
"Date" timestamptz NULL,
"Status" text NULL,
"ErrMessage" text NULL,
PRIMARY KEY ("Id")
);
-- Create "DoctorSimxLog" table
CREATE TABLE "public"."DoctorSimxLog" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Value" text NULL,
"Date" timestamptz NULL,
"Status" text NULL,
"ErrMessage" text NULL,
PRIMARY KEY ("Id")
);
-- Create "NurseLink" table
CREATE TABLE "public"."NurseLink" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Simx_Id" bigint NULL,
"Simgos_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "uni_NurseLink_Simgos_Id" UNIQUE ("Simgos_Id"),
CONSTRAINT "uni_NurseLink_Simx_Id" UNIQUE ("Simx_Id")
);
-- Create "NurseSimgosLog" table
CREATE TABLE "public"."NurseSimgosLog" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Value" text NULL,
"Date" timestamptz NULL,
"Status" text NULL,
"ErrMessage" text NULL,
PRIMARY KEY ("Id")
);
-- Create "NurseSimxLog" table
CREATE TABLE "public"."NurseSimxLog" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Value" text NULL,
"Date" timestamptz NULL,
"Status" text NULL,
"ErrMessage" text NULL,
PRIMARY KEY ("Id")
);
@@ -1,8 +1,9 @@
h1:6YZBXq/r79I5tuYyY1+CBzhZsSeukHSs8MyHCC5QuV4=
h1:D3uD6s7yxMG7Roi9DCeYuLeRazZmQnd3rHMmUWf6YMM=
20251113035508.sql h1:rjDlu6yDdy5xv6nrCOr7NialrLSLT23pzduYNq29Hf0=
20251114071129.sql h1:Z0GQ5bJo3C+tplaWzxT8n3J9HLkEaVsRVp5nn7bmYow=
20251117041601.sql h1:l/RPG5mObqCSBjO4mzG+wTq2ieSycvlfOSz4czpUdWY=
20251118082246.sql h1:xLUwA+EvKWIg3X/TJvu7rqbtBzONiINfag5NJpMV29E=
20251118082915.sql h1:hP6FmUVFuADIN2cDg2Z1l7Wx7PQRb+IYQDvKD7J8VAM=
20251126115527.sql h1:Bvg+Y7k+h5s+/UaezUyJb7J7uzEJS7U5Z/RoCixcUtI=
20251201093443.sql h1:m18tksKG3OzbkxXkhfKUUqbkxnJ0VBPi3Cw34Tbywyc=
20251201093443.sql h1:dyiD1WzU9D6RjGhF0AtGfGLEsG6yocuk3HbcZWt9ZRQ=
20251209083238.sql h1:83pG5dPfMh8v0QognjeacK6s3fGxQ0nkijxtKL5y3Dc=
@@ -81,8 +81,8 @@ type Mr struct {
}
type Provider struct {
Kode string `json:"kdProvider" json:"kode"` // API sometimes uses different keys
NmProvider string `json:"nmProvider" json:"nama"`
Kode string `son:"kode"`
NmProvider string `json:"nama"`
}
type Poli struct {
@@ -1,90 +0,0 @@
package actionreport
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ee "simrs-vx/internal/domain/main-entities/encounter"
"time"
pa "simrs-vx/internal/lib/auth"
)
type CreateDto struct {
Encounter_Id uint64 `json:"encounter_id" validate:"required"`
Date *time.Time `json:"date" validate:"required"`
Doctor_Code string `json:"doctor_code" validate:"required"`
Operator_Employe_Id uint `json:"operator_employe_id" validate:"required"`
Assistant_Employe_Id uint `json:"assistant_employe_id" validate:"required"`
Instrumentor_Employe_Id uint `json:"instrumentor_employe_id" validate:"required"`
Diagnose *string `json:"diagnose"`
Nurse_Code string `json:"nurse_code" validate:"required"`
Value string `json:"value" validate:"required"`
pa.AuthInfo
}
type ReadListDto struct {
FilterDto
Includes string `json:"includes"`
Pagination ecore.Pagination
}
type FilterDto struct {
Encounter_Id *uint `json:"encounter-id"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
}
type UpdateDto struct {
Id uint16 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint16 `json:"id"`
}
type MetaDto struct {
PageNumber int `json:"page_number"`
PageSize int `json:"page_size"`
Count int `json:"count"`
}
type ResponseDto struct {
ecore.Main
Encounter_Id uint64 `json:"encounter_id"`
Encounter *ee.Encounter `json:"encounter,omitempty"`
Date *time.Time `json:"date"`
Doctor_Code string `json:"doctor_code"`
Operator_Employe_Id uint `json:"operator_employe_id"`
Assistant_Employe_Id uint `json:"assistant_employe_id"`
Instrumentor_Employe_Id uint `json:"instrumentor_employe_id"`
Diagnose *string `json:"diagnose"`
Nurse_Code string `json:"nurse_code"`
Value *string `json:"value"`
}
func (d ActionReport) ToResponse() ResponseDto {
resp := ResponseDto{
Encounter_Id: d.Encounter_Id,
Encounter: d.Encounter,
Date: d.Date,
Doctor_Code: d.Doctor_Code,
Operator_Employe_Id: d.Operator_Employe_Id,
Assistant_Employe_Id: d.Assistant_Employe_Id,
Instrumentor_Employe_Id: d.Instrumentor_Employe_Id,
Nurse_Code: d.Nurse_Code,
Value: &d.Value,
}
resp.Main = d.Main
return resp
}
func ToResponseList(data []ActionReport) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -1,51 +0,0 @@
package actionreport
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ed "simrs-vx/internal/domain/main-entities/doctor"
eem "simrs-vx/internal/domain/main-entities/employee"
ee "simrs-vx/internal/domain/main-entities/encounter"
en "simrs-vx/internal/domain/main-entities/nurse"
"time"
)
type ActionReport struct {
ecore.Main // adjust this according to the needs
Encounter_Id uint64 `json:"encounter_id" gorm:"foreignKey"`
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
Date *time.Time `json:"date" gorm:"not null;size:20"`
Doctor_Code string `json:"doctor_code" gorm:"size:10"`
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"`
Operator_Employe_Id uint `json:"operator_employe_id"`
Operator_Employe *eem.Employee `json:"operator_employe,omitempty" gorm:"foreignKey:Operator_Employe_Id;references:Id"`
Assistant_Employe_Id uint `json:"assistant_employe_id"`
Instrumentor_Employe_Id uint `json:"instrumentor_employe_id"`
Instrumentor_Employe *eem.Employee `json:"instrumentor_employe,omitempty" gorm:"foreignKey:Instrumentor_Employe_Id;references:Id"`
Diagnose *string `json:"diagnose" gorm:"size:1024"`
Nurse_Code string `json:"nurse_code" gorm:"size:10"`
Nurse *en.Nurse `json:"nurse,omitempty" gorm:"foreignKey:Nurse_Code;references:Code"`
Value string `json:"value"`
// SurgerySize_Code *string `json:"surgerySize_code" gorm:"size:10"`
// Billing_Code *string `json:"billing_code" gorm:"size:10"`
// SurgerySystem_Code *string `json:"surgerySystem_code" gorm:"size:10"`
// StartAt *string `json:"startAt" gorm:"size:20"`
// EndAt *string `json:"endAt" gorm:"size:20"`
// AnesthesiaStartAt *string `json:"anesthesiaStartAt" gorm:"size:20"`
// AnesthesiaEndAt *string `json:"anesthesiaEndAt" gorm:"size:20"`
// SurgeryType_Code *string `json:"surgeryType_code" gorm:"size:10"`
// SurgeryStage_Code *string `json:"surgeryStage_code" gorm:"size:10"`
// BornMortality_Code *string `json:"bornMortality_code" gorm:"size:10"`
// BornLocation_Code *string `json:"bornLocation_code" gorm:"size:10"`
// Weight *string `json:"weight" gorm:"size:10"`
// BornNotes *string `json:"bornNotes" gorm:"size:1024"`
// Description *string `json:"notes" gorm:"size:1024"`
// BleedingAmount *uint16 `json:"bleedingAmount" gorm:"size:10"`
// BloodInType_Code *string `json:"bloodInType_code" gorm:"size:10"`
// BloodInAmount *uint16 `json:"bloodInAmount" gorm:"size:10"`
// Brand *string `json:"brand" gorm:"size:100"`
// ImplantName *string `json:"implantName" gorm:"size:100"`
// ImplantRegisterNumber *string `json:"implantRegisterNumber" gorm:"size:100"`
// ImplantCompanionName *string `json:"implantCompanionName" gorm:"size:100"`
// SpecimentDest_Code *string `json:"specimentDest" gorm:"size:100"`
// TissueInfo *string `json:"tissueInfo" gorm:"size:100"`
}
@@ -0,0 +1,23 @@
package apmcuorder
type CreateDto struct {
Encounter_Id uint `json:"encounter_id"`
Number uint64 `json:"number"`
Doctor_Code string `json:"-"`
Substances string `json:"substances"`
Fictations string `json:"fictations"`
Localization string `json:"localization"`
ClinicalDiagnoses string `json:"clinicalDiagnoses"`
Stadium string `json:"stadium"`
ClinicalNotes string `json:"clinicalNotes"`
CurrentHistory string `json:"currentHistory"`
PastHistory string `json:"pastHistory"`
PrevApMcu string `json:"prevApMcu"`
PrevApMcuNotes string `json:"prevApMcuNotes"`
SupportingExams string `json:"supportingExams"`
}
type UpdateDto struct {
Id uint64 `json:"id"`
CreateDto
}
@@ -0,0 +1,25 @@
package apmcuorder
import (
ecore "simrs-vx/internal/domain/base-entities/core"
erc "simrs-vx/internal/domain/references/common"
)
type ApMcuOrder struct {
ecore.BigMain
Encounter_Id uint `json:"encounter_id"`
Number uint64 `json:"number"`
Doctor_Code string `json:"doctor_code" gorm:"unique;size:20"`
Substances string `json:"substances"`
Fictations string `json:"fictations"`
Localization string `json:"localization"`
ClinicalDiagnoses string `json:"clinicalDiagnoses"`
Stadium string `json:"stadium"`
ClinicalNotes *string `json:"clinicalNotes"`
CurrentHistory string `json:"currentHistory"`
PastHistory string `json:"pastHistory"`
PrevApMcu *string `json:"prevApMcu"`
PrevApMcuNotes *string `json:"prevApMcuNotes"`
SupportingExams *string `json:"supportingExams"`
Status_Code erc.DataStatusCode `json:"status_code" gorm:"not null;size:10"`
}
@@ -0,0 +1,96 @@
package apmcuorder
import (
la "simrs-vx/internal/lib/auth"
ecore "simrs-vx/internal/domain/base-entities/core"
eamob "simrs-vx/internal/domain/main-entities/ap-mcu-order/base"
ed "simrs-vx/internal/domain/main-entities/doctor"
ee "simrs-vx/internal/domain/main-entities/encounter"
)
type CreateDto struct {
eamob.CreateDto
la.AuthInfo
}
type ReadListDto struct {
FilterDto
Includes string `json:"includes"`
Sort string `json:"sort"`
Pagination ecore.Pagination
}
type FilterDto struct {
McuOrder_Id string `json:"mcu-order-id"`
}
type ReadDetailDto struct {
Id uint64 `json:"id"`
}
type UpdateDto struct {
Id uint64 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint64 `json:"id"`
}
type MetaDto struct {
PageNumber int `json:"page_number"`
PageSize int `json:"page_size"`
Count int `json:"count"`
}
type ResponseDto struct {
ecore.BigMain
Encounter_Id uint `json:"encounter_id"`
Encounter *ee.Encounter
Number uint64 `json:"number"`
Doctor_Code string `json:"doctor_code"`
Doctor *ed.Doctor
Substances string `json:"substances"`
Fictations string `json:"fictations"`
Localization string `json:"localization"`
ClinicalDiagnoses string `json:"clinicalDiagnoses"`
Stadium string `json:"stadium"`
ClinicalNotes *string `json:"clinicalNotes"`
PastHistory string `json:"pastHistory"`
CurrentHistory string `json:"currentHistory"`
PrevApMcu *string `json:"prevApMcu"`
PrevApMcuNotes *string `json:"prevApMcuNotes"`
SupportingExams *string `json:"supportingExams"`
}
func (d ApMcuOrder) ToResponse() ResponseDto {
resp := ResponseDto{
Encounter_Id: d.Encounter_Id,
Encounter: d.Encounter,
Number: d.Number,
Doctor_Code: d.Doctor_Code,
Doctor: d.Doctor,
Substances: d.Substances,
Fictations: d.Fictations,
Localization: d.Localization,
ClinicalDiagnoses: d.ClinicalDiagnoses,
Stadium: d.Stadium,
ClinicalNotes: d.ClinicalNotes,
PastHistory: d.PastHistory,
CurrentHistory: d.CurrentHistory,
PrevApMcu: d.PrevApMcu,
PrevApMcuNotes: d.PrevApMcuNotes,
SupportingExams: d.SupportingExams,
}
resp.BigMain = d.BigMain
return resp
}
func ToResponseList(data []ApMcuOrder) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,26 @@
package apmcuorder
import (
eamob "simrs-vx/internal/domain/main-entities/ap-mcu-order/base"
ed "simrs-vx/internal/domain/main-entities/doctor"
ee "simrs-vx/internal/domain/main-entities/encounter"
erc "simrs-vx/internal/domain/references/common"
)
type ApMcuOrder struct {
eamob.ApMcuOrder
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"`
}
func (d ApMcuOrder) IsNotNew() bool {
return d.Status_Code != erc.DSCNew
}
func (d ApMcuOrder) IsCompleted() bool {
return d.Status_Code == erc.DSCDone
}
func (d ApMcuOrder) IsSameDoctor(doctor_code *string) bool {
return d.Doctor_Code == *doctor_code
}
@@ -0,0 +1,87 @@
package chemo_plan
import (
// std
"time"
ere "simrs-vx/internal/domain/references/encounter"
// internal - domain - main-entities
ecore "simrs-vx/internal/domain/base-entities/core"
)
type CreateDto struct {
Parent_Id *uint `json:"parent_id"`
SeriesNumber *uint16 `json:"seriesNumber"`
CycleNumber *uint `json:"cycleNumber"`
PlanDate *time.Time `json:"planDate"`
RealizationDate *time.Time `json:"realizationDate"`
Notes *string `json:"notes"`
Status ere.StatusProtocolChemo `json:"status"`
}
type ReadListDto struct {
FilterDto
Includes string `json:"includes"`
Pagination ecore.Pagination
}
type FilterDto struct {
Parent_Id *uint `json:"parent-id"`
Protocol_Id *uint `json:"protocol-id"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Includes string `json:"includes"`
}
type UpdateDto struct {
Id uint16 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint16 `json:"id"`
}
type MetaDto struct {
PageNumber int `json:"page_number"`
PageSize int `json:"page_size"`
Count int `json:"count"`
}
type ResponseDto struct {
ecore.Main
Parent_Id *uint `json:"parent_id"` // chemo.Id
Protocol_Id *uint `json:"protocol_id"`
SeriesNumber *uint16 `json:"seriesNumber"` // series ke -
CycleNumber *uint `json:"cycleNumber"` // cycle ke -
PlanDate *time.Time `json:"planDate"`
RealizationDate *time.Time `json:"realizationDate"`
Notes *string `json:"notes"`
Status ere.StatusProtocolChemo `json:"status"`
Reasons *string `json:"reasons"`
}
func (d ChemoPlan) ToResponse() ResponseDto {
resp := ResponseDto{
Parent_Id: d.Parent_Id,
SeriesNumber: d.SeriesNumber,
CycleNumber: d.CycleNumber,
PlanDate: d.PlanDate,
RealizationDate: d.RealizationDate,
Notes: d.Notes,
Status: d.Status,
}
resp.Main = d.Main
return resp
}
func ToResponseList(data []ChemoPlan) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,25 @@
package chemo_plan
import (
ee "simrs-vx/internal/domain/main-entities/encounter"
"time"
ecore "simrs-vx/internal/domain/base-entities/core"
ere "simrs-vx/internal/domain/references/encounter"
)
type ChemoPlan struct {
ecore.Main
Parent_Id *uint `json:"parent_id"` // chemo.Id
Protocol_Id *uint `json:"protocol_id"`
SeriesNumber *uint16 `json:"seriesNumber"` // series ke -
CycleNumber *uint `json:"cycleNumber"` // cycle ke -
PlanDate *time.Time `json:"planDate"`
RealizationDate *time.Time `json:"realizationDate"`
Notes *string `json:"notes"`
Status ere.StatusProtocolChemo `json:"status"`
Encounter_Id *uint `json:"encounter_id"`
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
Reasons *string `json:"reasons"` // json
}
@@ -9,18 +9,21 @@ import (
// internal - domain - main-entities
ecore "simrs-vx/internal/domain/base-entities/core"
ee "simrs-vx/internal/domain/main-entities/encounter"
ec "simrs-vx/internal/domain/main-entities/chemo"
)
type CreateDto struct {
Encounter_Id *uint `json:"encounter_id"`
Patient_Weight *float32 `json:"patient_weight"`
Patient_Height *float32 `json:"patient_height"`
Diagnoses *string `json:"diagnoses"`
Duration *uint `json:"duration"`
DurationUnit_Code *erc.TimeUnitCode `json:"durationUnit_code"`
StartDate *time.Time `json:"startDate"`
EndDate *time.Time `json:"endDate"`
Chemo_Id *uint `json:"chemo_id"`
Patient_Weight *float32 `json:"patient_weight"`
Patient_Height *float32 `json:"patient_height"`
Diagnoses *string `json:"diagnoses"`
Interval *uint `json:"interval"`
Cycle *uint `json:"cycle"`
Series *uint16 `json:"series"`
StartDate *time.Time `json:"startDate"`
EndDate *time.Time `json:"endDate"`
Status_Code erc.DataVerifiedCode `json:"-"`
}
type ReadListDto struct {
@@ -30,7 +33,7 @@ type ReadListDto struct {
}
type FilterDto struct {
Encounter_Id *uint `json:"encounter-id"`
Chemo_Id *uint `json:"chemo-id"`
}
type ReadDetailDto struct {
@@ -55,28 +58,32 @@ type MetaDto struct {
type ResponseDto struct {
ecore.Main
Encounter_Id *uint `json:"encounter_id"`
Encounter *ee.Encounter `json:"encounter,omitempty"`
Patient_Weight *float32 `json:"patient_weight"`
Patient_Height *float32 `json:"patient_height"`
Diagnoses *string `json:"diagnoses"`
Duration *uint `json:"duration"`
DurationUnit_Code *erc.TimeUnitCode `json:"durationUnit_code"`
StartDate *time.Time `json:"startDate"`
EndDate *time.Time `json:"endDate"`
Chemo_Id *uint `json:"chemo_id"`
Chemo *ec.Chemo `json:"chemo,omitempty"`
Patient_Weight *float32 `json:"patient_weight"`
Patient_Height *float32 `json:"patient_height"`
Diagnoses *string `json:"diagnoses"`
Interval *uint `json:"interval"`
Cycle *uint `json:"cycle"`
Series *uint16 `json:"series"`
StartDate *time.Time `json:"startDate"`
EndDate *time.Time `json:"endDate"`
Status_Code erc.DataVerifiedCode `json:"status_code"`
}
func (d ChemoProtocol) ToResponse() ResponseDto {
resp := ResponseDto{
Encounter_Id: d.Encounter_Id,
Encounter: d.Encounter,
Patient_Weight: d.Patient_Weight,
Patient_Height: d.Patient_Height,
Diagnoses: d.Diagnoses,
Duration: d.Duration,
DurationUnit_Code: d.DurationUnit_Code,
StartDate: d.StartDate,
EndDate: d.EndDate,
Chemo_Id: d.Chemo_Id,
Chemo: d.Chemo,
Patient_Weight: d.Patient_Weight,
Patient_Height: d.Patient_Height,
Diagnoses: d.Diagnoses,
Interval: d.Interval,
Cycle: d.Cycle,
Series: d.Series,
StartDate: d.StartDate,
EndDate: d.EndDate,
Status_Code: d.Status_Code,
}
resp.Main = d.Main
return resp
@@ -1,21 +1,34 @@
package chemo_protocol
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ee "simrs-vx/internal/domain/main-entities/encounter"
"simrs-vx/internal/domain/references/common"
"time"
ecore "simrs-vx/internal/domain/base-entities/core"
erc "simrs-vx/internal/domain/references/common"
ec "simrs-vx/internal/domain/main-entities/chemo"
ecp "simrs-vx/internal/domain/main-entities/chemo-plan"
eus "simrs-vx/internal/domain/main-entities/user"
)
type ChemoProtocol struct {
ecore.Main
Encounter_Id *uint `json:"encounter_id"`
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
Patient_Weight *float32 `json:"patient_weight"`
Patient_Height *float32 `json:"patient_height"`
Diagnoses *string `json:"diagnoses"`
Duration *uint `json:"duration"`
DurationUnit_Code *common.TimeUnitCode `json:"durationUnit_code" gorm:"size:10"`
StartDate *time.Time `json:"startDate"`
EndDate *time.Time `json:"endDate"`
Chemo_Id *uint `json:"chemo_id"`
Chemo *ec.Chemo `json:"chemo,omitempty" gorm:"foreignKey:Chemo_Id;references:Id"`
Patient_Weight *float32 `json:"patient_weight"`
Patient_Height *float32 `json:"patient_height"`
Diagnoses *string `json:"diagnoses"`
Duration *uint `json:"duration"` // not used
DurationUnit_Code *erc.TimeUnitCode `json:"durationUnit_code"` // not used
Interval *uint `json:"interval"`
Cycle *uint `json:"cycle"` // total cycle
Series *uint16 `json:"series"` // total series
StartDate *time.Time `json:"startDate"`
EndDate *time.Time `json:"endDate"`
Status_Code erc.DataVerifiedCode `json:"status_code"`
VerifiedAt *time.Time `json:"verifiedAt"`
VerifiedBy_User_Id *uint `json:"verifiedBy_user_id"`
VerifiedBy *eus.User `json:"verifiedBy,omitempty" gorm:"foreignKey:VerifiedBy_User_Id;references:Id"`
ChemoPlans *[]ecp.ChemoPlan `json:"chemoPlans,omitempty" gorm:"foreignKey:Protocol_Id;references:Id"`
Patient_Id *uint `json:"patient_id"`
}
+13 -4
View File
@@ -1,6 +1,7 @@
package chemo
import (
ed "simrs-vx/internal/domain/main-entities/doctor"
// std
"time"
@@ -50,10 +51,12 @@ type DeleteDto struct {
}
type VerifyDto struct {
Id uint16 `json:"id"`
Status_Code erc.DataVerifiedCode `json:"status_code"`
Bed *string `json:"bed" validate:"required"`
Needs *string `json:"needs" validate:"required"`
Id uint16 `json:"id"`
Status_Code erc.DataVerifiedCode `json:"status_code"`
Bed *string `json:"bed"`
Needs *string `json:"needs"`
Doctor_Code *string `json:"doctor_code" validate:"required"`
NextChemoDate *time.Time `json:"nextChemoDate"`
pa.AuthInfo
}
@@ -74,6 +77,9 @@ type ResponseDto struct {
VerifiedBy *eus.User `json:"verifiedBy,omitempty"`
SrcUnit_Code *string `json:"srcUnit_code"`
SrcUnit *eun.Unit `json:"srcUnit,omitempty"`
Doctor_Code *string `json:"doctor_code"`
Doctor *ed.Doctor `json:"doctor,omitempty"`
NextChemoDate *time.Time `json:"nextChemoDate"`
}
func (d Chemo) ToResponse() ResponseDto {
@@ -86,6 +92,9 @@ func (d Chemo) ToResponse() ResponseDto {
VerifiedBy: d.VerifiedBy,
SrcUnit_Code: d.SrcUnit_Code,
SrcUnit: d.SrcUnit,
Doctor_Code: d.Doctor_Code,
Doctor: d.Doctor,
NextChemoDate: d.NextChemoDate,
}
resp.Main = d.Main
return resp
@@ -1,14 +1,16 @@
package chemo
import (
ere "simrs-vx/internal/domain/references/encounter"
"time"
ecore "simrs-vx/internal/domain/base-entities/core"
erc "simrs-vx/internal/domain/references/common"
ed "simrs-vx/internal/domain/main-entities/doctor"
ee "simrs-vx/internal/domain/main-entities/encounter"
eun "simrs-vx/internal/domain/main-entities/unit"
eus "simrs-vx/internal/domain/main-entities/user"
erc "simrs-vx/internal/domain/references/common"
)
type Chemo struct {
@@ -19,8 +21,12 @@ type Chemo struct {
VerifiedAt *time.Time `json:"verifiedAt"`
VerifiedBy_User_Id *uint `json:"verifiedBy_user_id"`
VerifiedBy *eus.User `json:"verifiedBy,omitempty" gorm:"foreignKey:VerifiedBy_User_Id;references:Id"`
SrcUnit_Code *string `json:"src_unit_code"`
SrcUnit_Code *string `json:"src_unit_code"` // klinik asal
SrcUnit *eun.Unit `json:"src_unit,omitempty" gorm:"foreignKey:SrcUnit_Code;references:Code"`
Bed *string `json:"bed" gorm:"size:1024"`
Needs *string `json:"needs" gorm:"size:2048"`
Doctor_Code *string `json:"doctor_code"`
Doctor *ed.Doctor `json:"doctor" gorm:"foreignKey:Doctor_Code;references:Code"`
NextChemoDate *time.Time `json:"nextChemoDate"`
Class_Code ere.ChemoClassCode `json:"class_code"`
}
@@ -0,0 +1,6 @@
package cpmcuorderitem
type SubCreateDto struct {
McuSrc_Code string `json:"mcuSrc_code" validate:"required"`
Note string `json:"note"`
}
@@ -0,0 +1,17 @@
package cpmcuorderitem
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ems "simrs-vx/internal/domain/main-entities/mcu-src"
erc "simrs-vx/internal/domain/references/common"
)
type CpMcuOrderItem struct {
ecore.BigMain // adjust this according to the needs
CpMcuOrder_Id uint64 `json:"cpMcuOrder_id" gorm:"uniqueIndex:idx_order_src"`
McuSrc_Code string `json:"mcuSrc_code" gorm:"uniqueIndex:idx_order_src"`
McuSrc *ems.McuSrc `json:"mcuSrc,omitempty" gorm:"foreignKey:McuSrc_Code;references:Code"`
Note *string `json:"note" gorm:"size:1024"`
Result *string `json:"result"`
Status_Code erc.DataStatusCode `json:"status_code"`
}
@@ -0,0 +1,80 @@
package cpmcuorderitem
import (
ecore "simrs-vx/internal/domain/base-entities/core"
emro "simrs-vx/internal/domain/main-entities/cp-mcu-order"
ems "simrs-vx/internal/domain/main-entities/mcu-src"
erc "simrs-vx/internal/domain/references/common"
"time"
)
type CreateDto struct {
CpMcuOrder_Id uint64 `json:"cpMcuOrder_id"`
McuSrc_Code string `json:"mcuSrc_code"`
}
type ReadListDto struct {
FilterDto
Includes string `json:"includes"`
Pagination ecore.Pagination
}
type FilterDto struct {
CpMcuOrder_Id *uint64 `json:"cp-mcu-order-id"`
McuSrc_Code *string `json:"mcu-src-code"`
Status_Code erc.DataStatusCode `json:"status-code"`
}
type ReadDetailDto struct {
Id uint `json:"id"`
}
type UpdateDto struct {
Id uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint `json:"id"`
}
type SetScheduleDto struct {
Id uint `json:"id"`
ExaminationDate *time.Time `json:"examinationDate"`
}
type MetaDto struct {
PageNumber int `json:"page_number"`
PageSize int `json:"page_size"`
Count int `json:"count"`
}
type ResponseDto struct {
ecore.BigMain
CpMcuOrder_Id uint64 `json:"cpMcuOrder_id"`
CpMcuOrder *emro.CpMcuOrder `json:"cpMcuOrder,omitempty"`
McuSrc_Code string `json:"mcuSrc_code"`
McuSrc *ems.McuSrc `json:"mcuSrc,omitempty"`
Result *string `json:"result"`
Status_Code erc.DataStatusCode `json:"status_code"`
}
func (d CpMcuOrderItem) ToResponse() ResponseDto {
resp := ResponseDto{
CpMcuOrder_Id: d.CpMcuOrder_Id,
CpMcuOrder: d.CpMcuOrder,
McuSrc_Code: d.McuSrc_Code,
McuSrc: d.McuSrc,
Result: d.Result,
Status_Code: d.Status_Code,
}
resp.BigMain = d.BigMain
return resp
}
func ToResponseList(data []CpMcuOrderItem) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,17 @@
package cpmcuorderitem
import (
emo "simrs-vx/internal/domain/main-entities/cp-mcu-order"
emoib "simrs-vx/internal/domain/main-entities/cp-mcu-order-item/base"
erc "simrs-vx/internal/domain/references/common"
)
type CpMcuOrderItem struct {
emoib.CpMcuOrderItem
CpMcuOrder *emo.CpMcuOrder `json:"cpMcuOrder,omitempty" gorm:"foreignKey:CpMcuOrder_Id;references:Id"`
}
func (d CpMcuOrderItem) IsCompleted() bool {
return d.Status_Code == erc.DSCDone
}
@@ -0,0 +1,21 @@
package cpmcuorder
import (
"time"
ecore "simrs-vx/internal/domain/base-entities/core"
ercl "simrs-vx/internal/domain/references/clinical"
erc "simrs-vx/internal/domain/references/common"
)
type CpMcuOrder struct {
ecore.BigMain
Encounter_Id uint `json:"encounter_id"`
Number uint64 `json:"number"`
Doctor_Code string `json:"doctor_code" gorm:"unique;size:20"`
UrgencyLevel_Code ercl.McuUrgencyLevelCode `json:"urgencyLevel_code" gorm:"not null;size:15"`
OtherNotes *string `json:"otherNotes"`
ExamScheduleDate *time.Time `json:"examinationDate"`
Resume *string `json:"resume"`
Status_Code erc.DataStatusCode `json:"status_code" gorm:"not null;size:10"`
}
@@ -0,0 +1,84 @@
package cpmcuorder
import (
la "simrs-vx/internal/lib/auth"
ecore "simrs-vx/internal/domain/base-entities/core"
ed "simrs-vx/internal/domain/main-entities/doctor"
ee "simrs-vx/internal/domain/main-entities/encounter"
)
type CreateDto struct {
Encounter_Id uint `json:"encounter_id" validate:"required"`
Number uint64 `json:"number"` // SHOULD BE AUTOMATIC WITHOUT SYNC
UrgencyLevel_Code string `json:"urgencyLevel_code" validate:"required"`
OtherNotes string `json:"otherNotes"`
la.AuthInfo
}
type ReadListDto struct {
FilterDto
Includes string `json:"includes"`
Sort string `json:"sort"`
Pagination ecore.Pagination
}
type FilterDto struct {
Encounter_Id uint `json:"encounter-id"`
Doctor_Code string `json:"doctor-code"`
}
type ReadDetailDto struct {
Id uint64 `json:"id"`
Includes string `json:"includes"`
}
type UpdateDto struct {
Id uint64 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint64 `json:"id"`
}
type MetaDto struct {
PageNumber int `json:"page_number"`
PageSize int `json:"page_size"`
Count int `json:"count"`
}
type ResponseDto struct {
ecore.BigMain
Encounter_Id uint
Encounter *ee.Encounter
Number uint64 `json:"number"`
Doctor_Code string `json:"doctor_code"`
Doctor *ed.Doctor
UrgencyLevel_Code string `json:"urgencyLevel_code" gorm:"not null;size:15"`
OtherNotes *string `json:"otherNotes"`
Resume *string `json:"resume"`
}
func (d CpMcuOrder) ToResponse() ResponseDto {
resp := ResponseDto{
Encounter_Id: d.Encounter_Id,
Encounter: d.Encounter,
Number: d.Number,
Doctor_Code: d.Doctor_Code,
Doctor: d.Doctor,
UrgencyLevel_Code: string(d.UrgencyLevel_Code),
OtherNotes: d.OtherNotes,
Resume: d.Resume,
}
resp.BigMain = d.BigMain
return resp
}
func ToResponseList(data []CpMcuOrder) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,28 @@
package cpmcuorder
import (
ecmoi "simrs-vx/internal/domain/main-entities/cp-mcu-order-item/base"
eamob "simrs-vx/internal/domain/main-entities/cp-mcu-order/base"
ed "simrs-vx/internal/domain/main-entities/doctor"
ee "simrs-vx/internal/domain/main-entities/encounter"
erc "simrs-vx/internal/domain/references/common"
)
type CpMcuOrder struct {
eamob.CpMcuOrder
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"`
Items []*ecmoi.CpMcuOrderItem `json:"items" gorm:"foreignKey:CpMcuOrder_Id;references:Id"`
}
func (d CpMcuOrder) IsNotNew() bool {
return d.Status_Code != erc.DSCNew
}
func (d CpMcuOrder) IsCompleted() bool {
return d.Status_Code == erc.DSCDone
}
func (d CpMcuOrder) IsSameDoctor(doctor_code *string) bool {
return d.Doctor_Code == *doctor_code
}
@@ -89,8 +89,14 @@ type TRujukan struct {
type ReadListDto struct {
FilterDto
Includes string `json:"includes"`
Pagination ecore.Pagination
Includes string `json:"includes"`
Pagination ecore.Pagination
Patient_Identifier *string `json:"patient-identifier"`
StartDate *string `json:"start-date"`
EndDate *string `json:"end-date"`
PaymentMethod_Code *string `json:"paymentMethod-code"`
Status_Code *string `json:"status-code"`
Unit_Code *string `json:"unit-code"`
pa.AuthInfo
}
@@ -100,7 +106,6 @@ type FilterDto struct {
Patient *ep.Patient `json:"patient,omitempty"`
RegisteredAt *time.Time `json:"registeredAt"`
Class_Code ere.EncounterClassCode `json:"class-code" validate:"maxLength=10"`
Unit_Code *string `json:"unit-code"`
Specialist_Code *string `json:"specialist-code"`
Subspecialist_Code *string `json:"subspecialist-code"`
VisitDate time.Time `json:"visitDate"`
+3 -1
View File
@@ -13,6 +13,8 @@ type CreateDto struct {
Uom_Code *string `json:"uom_code" validate:"maxLength=10"`
Infra_Code *string `json:"infra_code"`
Stock *int `json:"stock"`
BuyingPrice *float64 `json:"buyingPrice"`
SellingPrice *float64 `json:"sellingPrice"`
}
type ReadListDto struct {
@@ -33,7 +35,7 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id *uint16 `json:"id"`
Id *uint `json:"id"`
Code *string `json:"code"`
}
@@ -0,0 +1,6 @@
package micromcuorderitem
type SubCreateDto struct {
McuSrc_Code string `json:"mcuSrc_code" validate:"required"`
Note string `json:"note"`
}
@@ -0,0 +1,17 @@
package micromcuorderitem
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ems "simrs-vx/internal/domain/main-entities/mcu-src"
erc "simrs-vx/internal/domain/references/common"
)
type MicroMcuOrderItem struct {
ecore.BigMain // adjust this according to the needs
MicroMcuOrder_Id uint64 `json:"microMcuOrder_id" gorm:"uniqueIndex:idx_order_src"`
McuSrc_Code string `json:"mcuSrc_code" gorm:"uniqueIndex:idx_order_src"`
McuSrc *ems.McuSrc `json:"mcuSrc,omitempty" gorm:"foreignKey:McuSrc_Code;references:Code"`
Note *string `json:"note" gorm:"size:1024"`
Result *string `json:"result"`
Status_Code erc.DataStatusCode `json:"status_code"`
}
@@ -0,0 +1,80 @@
package micromcuorderitem
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ems "simrs-vx/internal/domain/main-entities/mcu-src"
emro "simrs-vx/internal/domain/main-entities/micro-mcu-order"
erc "simrs-vx/internal/domain/references/common"
"time"
)
type CreateDto struct {
MicroMcuOrder_Id uint64 `json:"microMcuOrder_id"`
McuSrc_Code string `json:"mcuSrc_code"`
}
type ReadListDto struct {
FilterDto
Includes string `json:"includes"`
Pagination ecore.Pagination
}
type FilterDto struct {
MicroMcuOrder_Id *uint64 `json:"micro-mcu-order-id"`
McuSrc_Code *string `json:"mcu-src-code"`
Status_Code erc.DataStatusCode `json:"status-code"`
}
type ReadDetailDto struct {
Id uint `json:"id"`
}
type UpdateDto struct {
Id uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint `json:"id"`
}
type SetScheduleDto struct {
Id uint `json:"id"`
ExaminationDate *time.Time `json:"examinationDate"`
}
type MetaDto struct {
PageNumber int `json:"page_number"`
PageSize int `json:"page_size"`
Count int `json:"count"`
}
type ResponseDto struct {
ecore.BigMain
MicroMcuOrder_Id uint64 `json:"microMcuOrder_id"`
MicroMcuOrder *emro.MicroMcuOrder `json:"microMcuOrder,omitempty"`
McuSrc_Code string `json:"mcuSrc_code"`
McuSrc *ems.McuSrc `json:"mcuSrc,omitempty"`
Result *string `json:"result"`
Status_Code erc.DataStatusCode `json:"status_code"`
}
func (d MicroMcuOrderItem) ToResponse() ResponseDto {
resp := ResponseDto{
MicroMcuOrder_Id: d.MicroMcuOrder_Id,
MicroMcuOrder: d.MicroMcuOrder,
McuSrc_Code: d.McuSrc_Code,
McuSrc: d.McuSrc,
Result: d.Result,
Status_Code: d.Status_Code,
}
resp.BigMain = d.BigMain
return resp
}
func ToResponseList(data []MicroMcuOrderItem) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,18 @@
package micromcuorderitem
import (
ems "simrs-vx/internal/domain/main-entities/mcu-src"
emo "simrs-vx/internal/domain/main-entities/micro-mcu-order"
emoib "simrs-vx/internal/domain/main-entities/micro-mcu-order-item/base"
erc "simrs-vx/internal/domain/references/common"
)
type MicroMcuOrderItem struct {
emoib.MicroMcuOrderItem
MicroMcuOrder *emo.MicroMcuOrder `json:"microMcuOrder,omitempty" gorm:"foreignKey:MicroMcuOrder_Id;references:Id"`
McuSrc *ems.McuSrc `json:"mcuSrc,omitempty" gorm:"foreignKey:McuSrc_Code;references:Code"`
}
func (d MicroMcuOrderItem) IsCompleted() bool {
return d.Status_Code == erc.DSCDone
}
@@ -0,0 +1,18 @@
package micromcuorder
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ercl "simrs-vx/internal/domain/references/clinical"
erc "simrs-vx/internal/domain/references/common"
)
type MicroMcuOrder struct {
ecore.BigMain
Encounter_Id uint `json:"encounter_id"`
Number uint64 `json:"number"`
Doctor_Code string `json:"doctor_code" gorm:"unique;size:20"`
Stage_Code ercl.McuOrderStageCode `json:"stage_code" gorm:"not null;size:10"`
AxillaryTemp float64 `json:"axillaryTemp"`
OtherNotes *string `json:"otherNotes"`
Status_Code erc.DataStatusCode `json:"status_code" gorm:"not null;size:10"`
}
@@ -0,0 +1,86 @@
package micromcuorder
import (
la "simrs-vx/internal/lib/auth"
ecore "simrs-vx/internal/domain/base-entities/core"
ed "simrs-vx/internal/domain/main-entities/doctor"
ee "simrs-vx/internal/domain/main-entities/encounter"
ercl "simrs-vx/internal/domain/references/clinical"
)
type CreateDto struct {
Encounter_Id uint `json:"encounter_id" validate:"required"`
Number uint64 `json:"number"` // SHOULD BE AUTOMATIC WITHOUT SYNC
OrderStage_Code string `json:"orderStage_code" gorm:"not null;size:10"`
AxillaryTemp float64 `json:"axillaryTemp"`
OtherNotes string `json:"otherNotes"`
la.AuthInfo
}
type ReadListDto struct {
FilterDto
Includes string `json:"includes"`
Sort string `json:"sort"`
Pagination ecore.Pagination
}
type FilterDto struct {
Encounter_Id uint `json:"encounter-id"`
Doctor_Code string `json:"doctor-code"`
}
type ReadDetailDto struct {
Id uint64 `json:"id"`
Includes string `json:"includes"`
}
type UpdateDto struct {
Id uint64 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint64 `json:"id"`
}
type MetaDto struct {
PageNumber int `json:"page_number"`
PageSize int `json:"page_size"`
Count int `json:"count"`
}
type ResponseDto struct {
ecore.BigMain
Encounter_Id uint
Encounter *ee.Encounter
Number uint64 `json:"number"`
Doctor_Code string `json:"doctor_code"`
Doctor *ed.Doctor
Stage_Code ercl.McuOrderStageCode `json:"stage_code" gorm:"not null;size:10"`
AxillaryTemp float64 `json:"axillaryTemp"`
OtherNotes *string `json:"otherNotes"`
}
func (d MicroMcuOrder) ToResponse() ResponseDto {
resp := ResponseDto{
Encounter_Id: d.Encounter_Id,
Encounter: d.Encounter,
Number: d.Number,
Doctor_Code: d.Doctor_Code,
Doctor: d.Doctor,
Stage_Code: d.Stage_Code,
AxillaryTemp: d.AxillaryTemp,
OtherNotes: d.OtherNotes,
}
resp.BigMain = d.BigMain
return resp
}
func ToResponseList(data []MicroMcuOrder) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,28 @@
package micromcuorder
import (
ed "simrs-vx/internal/domain/main-entities/doctor"
ee "simrs-vx/internal/domain/main-entities/encounter"
emmoi "simrs-vx/internal/domain/main-entities/micro-mcu-order-item/base"
eamob "simrs-vx/internal/domain/main-entities/micro-mcu-order/base"
erc "simrs-vx/internal/domain/references/common"
)
type MicroMcuOrder struct {
eamob.MicroMcuOrder
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"`
Items []*emmoi.MicroMcuOrderItem `json:"items" gorm:"foreignKey:MicroMcuOrder_Id;references:Id"`
}
func (d MicroMcuOrder) IsNotNew() bool {
return d.Status_Code != erc.DSCNew
}
func (d MicroMcuOrder) IsCompleted() bool {
return d.Status_Code == erc.DSCDone
}
func (d MicroMcuOrder) IsSameDoctor(doctor_code *string) bool {
return d.Doctor_Code == *doctor_code
}
+10 -8
View File
@@ -19,6 +19,7 @@ type CreateDto struct {
FrontTitle *string `json:"frontTitle" validate:"maxLength=50"`
EndTitle *string `json:"endTitle" validate:"maxLength=50"`
BirthDate *time.Time `json:"birthDate,omitempty"`
BirthPlace *string `json:"birthPlace" validate:"maxLength=4"`
BirthRegency_Code *string `json:"birthRegency_code" validate:"maxLength=4"`
Gender_Code *erp.GenderCode `json:"gender_code"`
ResidentIdentityNumber *string `json:"residentIdentityNumber" validate:"nik;maxLength=16"`
@@ -46,14 +47,13 @@ type ReadListDto struct {
type FilterDto struct {
Name string `json:"name"`
FrontTitle *string `json:"frontTitle"`
EndTitle *string `json:"endTitle"`
BirthDate *time.Time `json:"birthDate,omitempty"`
BirthRegency_Code *string `json:"birthRegency-code"`
FrontTitle *string `json:"front-title"`
EndTitle *string `json:"end-title"`
BirthDate *time.Time `json:"birth-date,omitempty"`
Gender_Code *erp.GenderCode `json:"gender-code"`
ResidentIdentityNumber *string `json:"residentIdentityNumber"`
PassportNumber *string `json:"passportNumber"`
DrivingLicenseNumber *string `json:"drivingLicenseNumber"`
ResidentIdentityNumber *string `json:"resident-identity-number"`
PassportNumber *string `json:"passport-number"`
DrivingLicenseNumber *string `json:"driving-license-number"`
Religion_Code *erp.ReligionCode `json:"religion-code"`
Education_Code *erp.EducationCode `json:"education-code"`
Ocupation_Code *erp.OcupationCode `json:"occupation-code"`
@@ -61,7 +61,7 @@ type FilterDto struct {
Nationality *string `json:"nationality"`
Ethnic_Code *string `json:"ethnic-code"`
Language_Code *string `json:"language-code"`
CommunicationIssueStatus bool `json:"communicationIssueStatus"`
CommunicationIssueStatus bool `json:"communication-issue-status"`
Disability *string `json:"disability"`
}
@@ -94,6 +94,7 @@ type ResponseDto struct {
FrontTitle *string `json:"frontTitle"`
EndTitle *string `json:"endTitle"`
BirthDate *time.Time `json:"birthDate,omitempty"`
BirthPlace *string `json:"birthPlace"`
BirthRegency_Code *string `json:"birthRegency_code"`
BirthRegency *er.Regency `json:"birthRegency,omitempty"`
Gender_Code *erp.GenderCode `json:"gender_code"`
@@ -128,6 +129,7 @@ func (d *Person) ToResponse() ResponseDto {
FrontTitle: d.FrontTitle,
EndTitle: d.EndTitle,
BirthDate: d.BirthDate,
BirthPlace: d.BirthPlace,
BirthRegency_Code: d.BirthRegency_Code,
BirthRegency: d.BirthRegency,
Gender_Code: d.Gender_Code,
@@ -23,6 +23,7 @@ type Person struct {
FrontTitle *string `json:"frontTitle" gorm:"size:50"`
EndTitle *string `json:"endTitle" gorm:"size:50"`
BirthDate *time.Time `json:"birthDate,omitempty"`
BirthPlace *string `json:"birthPlace,omitempty"`
BirthRegency_Code *string `json:"birthRegency_code" gorm:"size:4"`
BirthRegency *er.Regency `json:"birthRegency,omitempty" gorm:"foreignKey:BirthRegency_Code;references:Code"`
Gender_Code *erp.GenderCode `json:"gender_code" gorm:"size:10"`
@@ -0,0 +1,111 @@
package procedurereport
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ee "simrs-vx/internal/domain/main-entities/encounter"
"time"
pa "simrs-vx/internal/lib/auth"
)
type CreateDto struct {
Encounter_Id uint64 `json:"encounter_id" validate:"required"`
Date *time.Time `json:"date" validate:"required"`
Doctor_Code string `json:"doctor_code" validate:"required"`
Operator_Name string `json:"operator_name" validate:"required"`
Assistant_Name string `json:"assistant_name" validate:"required"`
Instrumentor_Name string `json:"instrumentor_name" validate:"required"`
Anesthesia_Doctor_Code *string `json:"anesthesia_doctor_code"`
Anesthesia_Nurse_Name *string `json:"anesthesia_nurse_name"`
Diagnose *string `json:"diagnose"`
Nurse_Name string `json:"nurse_name" validate:"required"`
ProcedureValue string `json:"procedure_value" validate:"required"`
ExecutionValue string `json:"execution_value" validate:"required"`
Type_Code string `json:"type_code" validate:"required"`
pa.AuthInfo
// PROPER
// Operator_Employe_Id uint `json:"operator_employe_id" validate:"required"`
// Assistant_Employe_Id uint `json:"assistant_employe_id" validate:"required"`
// Instrumentor_Employe_Id uint `json:"instrumentor_employe_id" validate:"required"`
// Anesthesia_Doctor_Code string `json:"anesthesia_doctor_code" validate:"required"`
// Anesthesia_Nurse_Employe_Id uint `json:"anesthesia_nurse_employe_id" validate:"required"`
// Nurse_Code string `json:"nurse_code" validate:"required"`
}
type ReadListDto struct {
FilterDto
Includes string `json:"includes"`
Pagination ecore.Pagination
}
type FilterDto struct {
Encounter_Id *uint `json:"encounter-id"`
Type_Code string `json:"type-code"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
}
type UpdateDto struct {
Id uint16 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint16 `json:"id"`
}
type MetaDto struct {
PageNumber int `json:"page_number"`
PageSize int `json:"page_size"`
Count int `json:"count"`
}
type ResponseDto struct {
ecore.Main
Encounter_Id uint64 `json:"encounter_id"`
Encounter *ee.Encounter `json:"encounter,omitempty"`
Date *time.Time `json:"date"`
Doctor_Code string `json:"doctor_code"`
Operator_Name string `json:"operator_name"`
Assistant_Name string `json:"assistant_name"`
Instrumentor_Name string `json:"instrumentor_name"`
Anesthesia_Doctor_Code *string `json:"anesthesia_doctor_code"`
Anesthesia_Nurse_Name *string `json:"anesthesia_nurse_name"`
Diagnose *string `json:"diagnose"`
Nurse_Name string `json:"nurse_name"`
ProcedureValue *string `json:"procedure_value"`
ExecutionValue *string `json:"execution_value"`
Type_Code string `json:"type_code"`
}
func (d ProcedureReport) ToResponse() ResponseDto {
resp := ResponseDto{
Encounter_Id: d.Encounter_Id,
Encounter: d.Encounter,
Date: d.Date,
Doctor_Code: d.Doctor_Code,
Operator_Name: d.Operator_Name,
Assistant_Name: d.Assistant_Name,
Instrumentor_Name: d.Instrumentor_Name,
Anesthesia_Doctor_Code: d.Anesthesia_Doctor_Code,
Anesthesia_Nurse_Name: d.Anesthesia_Nurse_Name,
Nurse_Name: d.Nurse_Name,
ProcedureValue: &d.ProcedureValue,
ExecutionValue: &d.ExecutionValue,
Type_Code: d.Type_Code,
}
resp.Main = d.Main
return resp
}
func ToResponseList(data []ProcedureReport) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,67 @@
package procedurereport
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ed "simrs-vx/internal/domain/main-entities/doctor"
ee "simrs-vx/internal/domain/main-entities/encounter"
"time"
)
type ProcedureReport struct {
ecore.Main // adjust this according to the needs
Encounter_Id uint64 `json:"encounter_id" gorm:"foreignKey"`
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
Date *time.Time `json:"date" gorm:"not null;size:20"`
Doctor_Code string `json:"doctor_code" gorm:"size:10"`
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"`
Operator_Name string `json:"operator_name"`
Assistant_Name string `json:"assistant_name"`
Instrumentor_Name string `json:"instrumentor_name"`
Diagnose *string `json:"diagnose" gorm:"size:1024"`
Nurse_Name string `json:"nurse_name"`
Anesthesia_Doctor_Code *string `json:"anesthesia_doctor_code" gorm:"size:10"`
Anesthesia_Doctor *ed.Doctor `json:"anesthesia,omitempty" gorm:"foreignKey:Anesthesia_Doctor_Code;references:Code"`
Anesthesia_Nurse_Name *string `json:"anesthesia_nurse_name"`
ProcedureValue string `json:"procedure_value"`
ExecutionValue string `json:"execution_value"`
Type_Code string `json:"type_code"`
// SurgerySize_Code *string `json:"surgerySize_code" gorm:"size:10"`
// Billing_Code *string `json:"billing_code" gorm:"size:10"`
// SurgerySystem_Code *string `json:"surgerySystem_code" gorm:"size:10"`
// StartAt *string `json:"startAt" gorm:"size:20"`
// EndAt *string `json:"endAt" gorm:"size:20"`
// AnesthesiaStartAt *string `json:"anesthesiaStartAt" gorm:"size:20"`
// AnesthesiaEndAt *string `json:"anesthesiaEndAt" gorm:"size:20"`
// SurgeryType_Code *string `json:"surgeryType_code" gorm:"size:10"`
// SurgeryStage_Code *string `json:"surgeryStage_code" gorm:"size:10"`
// BornMortality_Code *string `json:"bornMortality_code" gorm:"size:10"`
// BornLocation_Code *string `json:"bornLocation_code" gorm:"size:10"`
// Weight *string `json:"weight" gorm:"size:10"`
// BornNotes *string `json:"bornNotes" gorm:"size:1024"`
// Description *string `json:"notes" gorm:"size:1024"`
// BleedingAmount *uint16 `json:"bleedingAmount" gorm:"size:10"`
// BloodInType_Code *string `json:"bloodInType_code" gorm:"size:10"`
// BloodInAmount *uint16 `json:"bloodInAmount" gorm:"size:10"`
// Brand *string `json:"brand" gorm:"size:100"`
// ImplantName *string `json:"implantName" gorm:"size:100"`
// ImplantRegisterNumber *string `json:"implantRegisterNumber" gorm:"size:100"`
// ImplantCompanionName *string `json:"implantCompanionName" gorm:"size:100"`
// SpecimentDest_Code *string `json:"specimentDest" gorm:"size:100"`
// TissueInfo *string `json:"tissueInfo" gorm:"size:100"`
//PROPER
// Doctor_Code string `json:"doctor_code" gorm:"size:10"`
// Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"`
// Operator_Employe_Id uint `json:"operator_employe_id"`
// Operator_Employe *eem.Employee `json:"operator_employe,omitempty" gorm:"foreignKey:Operator_Employe_Id;references:Id"`
// Assistant_Employe_Id uint `json:"assistant_employe_id"`
// Instrumentor_Employe_Id uint `json:"instrumentor_employe_id"`
// Instrumentor_Employe *eem.Employee `json:"instrumentor_employe,omitempty" gorm:"foreignKey:Instrumentor_Employe_Id;references:Id"`
// Nurse_Code string `json:"nurse_code" gorm:"size:10"`
// Nurse *en.Nurse `json:"nurse,omitempty" gorm:"foreignKey:Nurse_Code;references:Code"`
// Anesthesia_Doctor_Code string `json:"anesthesia_doctor_code" gorm:"size:10"`
// Anesthesia *eem.Employee `json:"anesthesia,omitempty" gorm:"foreignKey:Anesthesia_Doctor_Code;references:Code"`
// Anesthesia_Nurse_Employe_Id uint `json:"anesthesia_nurse_employe_id"`
// Anesthesia_Nurse *eem.Employee `json:"anesthesia_nurse,omitempty" gorm:"foreignKey:Anesthesia_Nurse_Employe_Id;references:Id"`
}
@@ -0,0 +1,12 @@
package procedureroomorder
import (
ecore "simrs-vx/internal/domain/base-entities/core"
)
type ProcedureRoomOrderItem struct {
ecore.BigMain
ProcedureRoomOrder_Id uint64 `json:"procedureRoomOrder_id"`
ProcedureRoom_Code string `json:"procedureRoom_code" gorm:"size:20"`
Note string `json:"note" gorm:"size:255"`
}
@@ -18,7 +18,8 @@ type ReadListDto struct {
}
type FilterDto struct {
Encounter_Id uint64 `json:"encounter-id"`
Encounter_Id uint64 `json:"encounter-id"`
ProcedureRoomOrder_Id uint64 `json:"procedure-room-order-id"`
}
type ReadDetailDto struct {
@@ -1,14 +1,13 @@
package procedureroomorder
import (
ecore "simrs-vx/internal/domain/base-entities/core"
epr "simrs-vx/internal/domain/main-entities/procedure-room"
epro "simrs-vx/internal/domain/main-entities/procedure-room-order"
eb "simrs-vx/internal/domain/main-entities/procedure-room-order-item/base"
)
type ProcedureRoomOrderItem struct {
ecore.BigMain
ProcedureRoomOrder_Id uint64 `json:"procedureRoomOrder_id"`
ProcedureRoom_Code string `json:"procedureRoom_code" gorm:"size:20"`
ProcedureRoom *epr.ProcedureRoom `json:"procedureRoom,omitempty" gorm:"foreignKey:ProcedureRoom_Code;references:Code"`
Note string `json:"note" gorm:"size:255"`
eb.ProcedureRoomOrderItem
ProcedureRoomOrder *epro.ProcedureRoomOrder `json:"procedureRoomOrder,omitempty" gorm:"foreignKey:ProcedureRoomOrder_Id;references:Id"`
ProcedureRoom *epr.ProcedureRoom `json:"procedureRoom,omitempty" gorm:"foreignKey:ProcedureRoom_Code;references:Code"`
}
@@ -9,9 +9,9 @@ import (
)
type CreateDto struct {
Encounter_Id uint64 `json:"encounter_id" validate:"required"`
Infra_Code string `json:"infra_code" validate:"required"`
MaterialPackage_Code string `json:"materialPackage_code" validate:"required"`
Encounter_Id uint64 `json:"encounter_id" validate:"required"`
// Infra_Code string `json:"infra_code" validate:"required"`
MaterialPackage_Code *string `json:"materialPackage_code"`
}
type ReadListDto struct {
@@ -48,7 +48,7 @@ type ResponseDto struct {
Encounter_Id uint64 `json:"encounter_id"`
Encounter *ec.Encounter `json:"encounter,omitempty"`
Infra_Code string `json:"procedure"`
MaterialPackage_Code string `json:"materialPackage_code"`
MaterialPackage_Code *string `json:"materialPackage_code"`
Status_Code erc.DataStatusCode `json:"status_code"`
ProcedureRoom *epr.ProcedureRoom `json:"procedureRoom,omitempty"`
MaterialPackage *emp.MaterialPackage `json:"materialPackage,omitempty"`
@@ -56,8 +56,8 @@ type ResponseDto struct {
func (d ProcedureRoomOrder) ToResponse() ResponseDto {
resp := ResponseDto{
Encounter_Id: d.Encounter_Id,
Infra_Code: d.Infra_Code,
Encounter_Id: d.Encounter_Id,
// Infra_Code: d.Infra_Code,
MaterialPackage_Code: d.MaterialPackage_Code,
Status_Code: d.Status_Code,
}
@@ -5,15 +5,20 @@ import (
ecore "simrs-vx/internal/domain/base-entities/core"
emp "simrs-vx/internal/domain/main-entities/material-package"
epr "simrs-vx/internal/domain/main-entities/procedure-room"
eproi "simrs-vx/internal/domain/main-entities/procedure-room-order-item/base"
)
type ProcedureRoomOrder struct {
ecore.BigMain
Encounter_Id uint64 `json:"encounter_id"`
Infra_Code string `json:"infra_code" gorm:"size:20"`
ProcedureRoom *epr.ProcedureRoom `json:"procedureRoom,omitempty" gorm:"foreignKey:Infra_Code;references:Code"`
MaterialPackage_Code string `json:"materialPackage_code" gorm:"size:20"`
MaterialPackage *emp.MaterialPackage `json:"materialPackage,omitempty" gorm:"foreignKey:MaterialPackage_Code;references:Code"`
Status_Code erc.DataStatusCode `json:"status_code" gorm:"size:20"`
Encounter_Id uint64 `json:"encounter_id"`
// Infra_Code string `json:"infra_code" gorm:"size:20"`
// ProcedureRoom *epr.ProcedureRoom `json:"procedureRoom,omitempty" gorm:"foreignKey:Infra_Code;references:Code"`
MaterialPackage_Code *string `json:"materialPackage_code" gorm:"size:20"`
MaterialPackage *emp.MaterialPackage `json:"materialPackage,omitempty" gorm:"foreignKey:MaterialPackage_Code;references:Code"`
Status_Code erc.DataStatusCode `json:"status_code" gorm:"size:20"`
Items []eproi.ProcedureRoomOrderItem `json:"items,omitempty" gorm:"foreignKey:ProcedureRoomOrder_Id;references:Id"`
}
func (d ProcedureRoomOrder) IsNotNew() bool {
return d.Status_Code != erc.DSCNew
}
@@ -25,7 +25,7 @@ type ReadListDto struct {
type FilterDto struct {
Infra_Code *string `json:"infra-code"`
Type_Code string `json:"type_code"`
Type_Code string `json:"type-code"`
Unit_Code *string `json:"unit-code"`
Specialist_Code *string `json:"specialist-code"`
Subspecialist_Code *string `json:"subspecialist-code"`
@@ -0,0 +1,6 @@
package radiologymcuorderitem
type SubCreateDto struct {
McuSrc_Code string `json:"mcuSrc_code" validate:"required"`
Note string `json:"note"`
}
@@ -0,0 +1,17 @@
package radiologymcuorderitem
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ems "simrs-vx/internal/domain/main-entities/mcu-src"
erc "simrs-vx/internal/domain/references/common"
)
type RadiologyMcuOrderItem struct {
ecore.BigMain // adjust this according to the needs
RadiologyMcuOrder_Id uint64 `json:"radiologyMcuOrder_id" gorm:"uniqueIndex:idx_order_src"`
McuSrc_Code string `json:"mcuSrc_code" gorm:"uniqueIndex:idx_order_src"`
McuSrc *ems.McuSrc `json:"mcuSrc,omitempty" gorm:"foreignKey:McuSrc_Code;references:Code"`
Note *string `json:"note" gorm:"size:1024"`
Result *string `json:"result"`
Status_Code erc.DataStatusCode `json:"status_code"`
}
@@ -0,0 +1,80 @@
package radiologymcuorderitem
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ems "simrs-vx/internal/domain/main-entities/mcu-src"
emro "simrs-vx/internal/domain/main-entities/radiology-mcu-order"
erc "simrs-vx/internal/domain/references/common"
"time"
)
type CreateDto struct {
RadiologyMcuOrder_Id uint64 `json:"radiologyMcuOrder_id"`
McuSrc_Code string `json:"mcuSrc_code"`
}
type ReadListDto struct {
FilterDto
Includes string `json:"includes"`
Pagination ecore.Pagination
}
type FilterDto struct {
RadiologyMcuOrder_Id *uint64 `json:"radiology-mcu-order-id"`
McuSrc_Code *string `json:"mcu-src-code"`
Status_Code erc.DataStatusCode `json:"status-code"`
}
type ReadDetailDto struct {
Id uint `json:"id"`
}
type UpdateDto struct {
Id uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint `json:"id"`
}
type SetScheduleDto struct {
Id uint `json:"id"`
ExaminationDate *time.Time `json:"examinationDate"`
}
type MetaDto struct {
PageNumber int `json:"page_number"`
PageSize int `json:"page_size"`
Count int `json:"count"`
}
type ResponseDto struct {
ecore.BigMain
RadiologyMcuOrder_Id uint64 `json:"radiologyMcuOrder_id"`
RadiologyMcuOrder *emro.RadiologyMcuOrder `json:"radiologyMcuOrder,omitempty"`
McuSrc_Code string `json:"mcuSrc_code"`
McuSrc *ems.McuSrc `json:"mcuSrc,omitempty"`
Result *string `json:"result"`
Status_Code erc.DataStatusCode `json:"status_code"`
}
func (d RadiologyMcuOrderItem) ToResponse() ResponseDto {
resp := ResponseDto{
RadiologyMcuOrder_Id: d.RadiologyMcuOrder_Id,
RadiologyMcuOrder: d.RadiologyMcuOrder,
McuSrc_Code: d.McuSrc_Code,
McuSrc: d.McuSrc,
Result: d.Result,
Status_Code: d.Status_Code,
}
resp.BigMain = d.BigMain
return resp
}
func ToResponseList(data []RadiologyMcuOrderItem) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,17 @@
package radiologymcuorderitem
import (
emo "simrs-vx/internal/domain/main-entities/radiology-mcu-order"
emoib "simrs-vx/internal/domain/main-entities/radiology-mcu-order-item/base"
erc "simrs-vx/internal/domain/references/common"
)
type RadiologyMcuOrderItem struct {
emoib.RadiologyMcuOrderItem
RadiologyMcuOrder *emo.RadiologyMcuOrder `json:"radiologyMcuOrder,omitempty" gorm:"foreignKey:RadiologyMcuOrder_Id;references:Id"`
}
func (d RadiologyMcuOrderItem) IsCompleted() bool {
return d.Status_Code == erc.DSCDone
}
@@ -0,0 +1,17 @@
package radiologymcuorder
import (
ecore "simrs-vx/internal/domain/base-entities/core"
erc "simrs-vx/internal/domain/references/common"
)
type RadiologyMcuOrder struct {
ecore.BigMain
Encounter_Id uint `json:"encounter_id"`
Number uint64 `json:"number"`
Doctor_Code string `json:"doctor_code" gorm:"unique;size:20"`
ClinicalNotes *string `json:"clinicalNotes"`
OtherNotes *string `json:"otherNotes"`
Resume *string `json:"resume"`
Status_Code erc.DataStatusCode `json:"status_code" gorm:"not null;size:10"`
}
@@ -0,0 +1,88 @@
package radiologymcuorder
import (
la "simrs-vx/internal/lib/auth"
ecore "simrs-vx/internal/domain/base-entities/core"
ed "simrs-vx/internal/domain/main-entities/doctor"
ee "simrs-vx/internal/domain/main-entities/encounter"
ermoi "simrs-vx/internal/domain/main-entities/radiology-mcu-order-item/base"
)
type CreateDto struct {
Encounter_Id uint `json:"encounter_id"`
Number *uint64 `json:"number"` // SHOULD BE AUTOMATIC WITHOUT SYNC
Doctor_Code string `json:"-" validate:"required"`
ClinicalNotes *string `json:"clinicalNotes"`
OtherNotes *string `json:"otherNotes"`
Items []ermoi.SubCreateDto `json:"items" validate:"required"`
la.AuthInfo
}
type ReadListDto struct {
FilterDto
Includes string `json:"includes"`
Sort string `json:"sort"`
Pagination ecore.Pagination
}
type FilterDto struct {
Encounter_Id uint `json:"encounter-id"`
Doctor_Code string `json:"doctor-code"`
}
type ReadDetailDto struct {
Id uint64 `json:"id"`
Includes string `json:"includes"`
}
type UpdateDto struct {
Id uint64 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint64 `json:"id"`
}
type MetaDto struct {
PageNumber int `json:"page_number"`
PageSize int `json:"page_size"`
Count int `json:"count"`
}
type ResponseDto struct {
ecore.BigMain
Encounter_Id uint `json:"encounter_id"`
Encounter *ee.Encounter
Number uint64 `json:"number"`
Doctor_Code string `json:"doctor_code"`
Doctor *ed.Doctor
ClinicalNotes *string `json:"clinicalNotes"`
OtherNotes *string `json:"otherNotes"`
Resume *string `json:"resume"`
Items []*ermoi.RadiologyMcuOrderItem
}
func (d RadiologyMcuOrder) ToResponse() ResponseDto {
resp := ResponseDto{
Encounter_Id: d.Encounter_Id,
Encounter: d.Encounter,
Number: d.Number,
Doctor_Code: d.Doctor_Code,
Doctor: d.Doctor,
ClinicalNotes: d.ClinicalNotes,
OtherNotes: d.OtherNotes,
Resume: d.Resume,
}
resp.BigMain = d.BigMain
return resp
}
func ToResponseList(data []RadiologyMcuOrder) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,28 @@
package radiologymcuorder
import (
ed "simrs-vx/internal/domain/main-entities/doctor"
ee "simrs-vx/internal/domain/main-entities/encounter"
ermoi "simrs-vx/internal/domain/main-entities/radiology-mcu-order-item/base"
eamob "simrs-vx/internal/domain/main-entities/radiology-mcu-order/base"
erc "simrs-vx/internal/domain/references/common"
)
type RadiologyMcuOrder struct {
eamob.RadiologyMcuOrder
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"`
Items []*ermoi.RadiologyMcuOrderItem `json:"items" gorm:"foreignKey:RadiologyMcuOrder_Id;references:Id"`
}
func (d RadiologyMcuOrder) IsNotNew() bool {
return d.Status_Code != erc.DSCNew
}
func (d RadiologyMcuOrder) IsCompleted() bool {
return d.Status_Code == erc.DSCDone
}
func (d RadiologyMcuOrder) IsSameDoctor(doctor_code *string) bool {
return d.Doctor_Code == *doctor_code
}
@@ -0,0 +1,71 @@
package doctor
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ee "simrs-vx/internal/domain/main-entities/employee"
ei "simrs-vx/internal/domain/main-entities/installation"
)
type CreateDto struct {
Employee_Id uint `json:"employee_id"`
Installation_Code string `json:"installation_code" validate:"maxLength=20"`
}
type ReadListDto struct {
FilterDto
Includes string `json:"includes"`
Pagination ecore.Pagination
}
type FilterDto struct {
Employee_Id *uint `json:"employee-id"`
Installation_Code *string `json:"installation-code"`
}
type ReadDetailDto struct {
Id *uint16 `json:"id"`
Code *string `json:"code"`
Employee_Id *uint `json:"employee_id"`
}
type UpdateDto struct {
Id *uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint `json:"id"`
}
type MetaDto struct {
PageNumber int `json:"page_number"`
PageSize int `json:"page_size"`
Count int `json:"count"`
}
type ResponseDto struct {
ecore.Main
Employee_Id uint `json:"employee_id"`
Employee *ee.Employee `json:"employee,omitempty"`
Installation_Code string `json:"installation_code"`
Installation *ei.Installation `json:"installation,omitempty"`
}
func (d Registration) ToResponse() ResponseDto {
resp := ResponseDto{
Employee_Id: d.Employee_Id,
Employee: d.Employee,
Installation_Code: d.Installation_Code,
Installation: d.Installation,
}
resp.Main = d.Main
return resp
}
func ToResponseList(data []Registration) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,15 @@
package doctor
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ee "simrs-vx/internal/domain/main-entities/employee"
ei "simrs-vx/internal/domain/main-entities/installation"
)
type Registration struct {
ecore.Main // adjust this according to the needs
Employee_Id uint `json:"employee_id"`
Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
Installation_Code string `json:"installation_code" gorm:"size:20"`
Installation *ei.Installation `json:"installation,omitempty" gorm:"foreignKey:Installation_Code;references:Code"`
}
+124 -3
View File
@@ -27,6 +27,7 @@ type CreateDto struct {
type ReadListDto struct {
FilterDto
Includes string `json:"includes"`
Sort string `json:"sort"`
Pagination ecore.Pagination
}
@@ -38,16 +39,17 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id uint `json:"id"`
Includes string `json:"includes"`
}
type UpdateDto struct {
Id uint16 `json:"id"`
Id uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint16 `json:"id"`
Id uint `json:"id"`
}
type MetaDto struct {
@@ -84,3 +86,122 @@ func ToResponseList(data []Screening) []ResponseDto {
}
return resp
}
type ScreeningEntry struct {
AgeAtRisk bool `json:"ageAtRisk"` // Usia Dengan Risiko
LowCognitiveFunction bool `json:"lowCognitiveFunction"` // Pasien Dengan Fungsi Kognitif Rendah
HighRiskPatient bool `json:"highRiskPatient"` // Pasien Dengan Risiko Tinggi
HighComplaintPotential bool `json:"highComplaintPotential"` // Potensi Komplain Tinggi (Medik dan Non Medik)
ChronicOrCatastrophicOrTerminal bool `json:"chronicOrCatastrophicOrTerminal"` // Kasus Dengan Penyakit Kronis, Katastropik, Terminal
LowFunctionalStatus bool `json:"lowFunctionalStatus"` // Status Fungsional Rendah, Kebutuhan Bantuan ADL Tinggi
HistoryOfMedicalDeviceUse bool `json:"historyOfMedicalDeviceUse"` // Pasien Dengan Riwayat Penggunaan Peralatan Medis Masa Lalu
MentalOrSocialIssues bool `json:"mentalOrSocialIssues"` // Riwayat Gangguan Mental, Bunuh Diri, Krisis Keluarga, Isu Sosial
FrequentERVisitsOrReadmission bool `json:"frequentERVisitsOrReadmission"` // Sering Masuk IGD, Readmisi RS
HighCareCostEstimate bool `json:"highCareCostEstimate"` // Perkiraan Asuhan Dengan Biaya Tinggi
ComplexFinancingSystem bool `json:"complexFinancingSystem"` // Kemungkinan Sistem Pembiayaan Yang Kompleks
AboveAverageLengthOfStay bool `json:"aboveAverageLengthOfStay"` // Kasus Yang Melebihi Rata-Rata Lama Dirawat
ImportantOrHighRiskDischargePlanning bool `json:"importantOrHighRiskDischargePlanning"` // Rencana Pemulangan Penting / Kontinuitas Pelayanan
Stagnation bool `json:"stagnation"` // Stagnasi
}
type ProblemIdentification struct {
CareNotFollowingGuidelines bool `json:"careNotFollowingGuidelines"` // Tingkat Asuhan Tidak Sesuai Panduan/ Norma
OverUtilization bool `json:"overUtilization"` // Over Utilization Pelayanan
UnderUtilization bool `json:"underUtilization"` // Under Utilization Pelayanan
PatientNonCompliance bool `json:"patientNonCompliance"` // Ketidakpatuhan Pasien
InadequateEducation bool `json:"inadequateEducation"` // Edukasi Kurang Memadai
LackOfFamilySupport bool `json:"lackOfFamilySupport"` // Kurang Dukungan Keluarga
DecreasedDetermination bool `json:"decreasedDetermination"` // Penurunan Determinasi Ketika Komplikasi Meningkat
FinancialDifficultyDuringComplications bool `json:"financialDifficultyDuringComplications"` // Kendala Keuangan Ketika Komplikasi Meningkat
DischargeCriteriaNotMetOrDelayed bool `json:"dischargeCriteriaNotMetOrDelayed"` // Pemulangan/ Rujukan Belum Memenuhi Kriteria/ Ditunda
}
type FormA struct {
Screening ScreeningEntry `json:"screening"`
AssessmentDetail string `json:"assessmentDetail"` // Masukkan detail assesmen
ProblemIdentification ProblemIdentification `json:"problemIdentification"`
PlanningDetail string `json:"planningDetail"` // Masukkan detail perencanaan
}
func (s ScreeningEntry) SelectedScreeningLabels() []string {
result := []string{}
if s.AgeAtRisk {
result = append(result, "Usia Dengan Risiko")
}
if s.LowCognitiveFunction {
result = append(result, "Pasien Dengan Fungsi Kognitif Rendah")
}
if s.HighRiskPatient {
result = append(result, "Pasien Dengan Risiko Tinggi")
}
if s.HighComplaintPotential {
result = append(result, "Potensi Komplain Tinggi (Medik dan Non Medik)")
}
if s.ChronicOrCatastrophicOrTerminal {
result = append(result, "Kasus Dengan Penyakit Kronis, Katastropik, Terminal")
}
if s.LowFunctionalStatus {
result = append(result, "Status Fungsional Rendah, Kebutuhan Bantuan ADL Tinggi")
}
if s.HistoryOfMedicalDeviceUse {
result = append(result, "Pasien Dengan Riwayat Penggunaan Peralatan Medis Masa Lalu")
}
if s.MentalOrSocialIssues {
result = append(result, "Riwayat Gangguan Mental, Bunuh Diri, Krisis Keluarga, Isu Sosial")
}
if s.FrequentERVisitsOrReadmission {
result = append(result, "Sering Masuk IGD, Readmisi RS")
}
if s.HighCareCostEstimate {
result = append(result, "Perkiraan Asuhan Dengan Biaya Tinggi")
}
if s.ComplexFinancingSystem {
result = append(result, "Kemungkinan Sistem Pembiayaan Yang Kompleks")
}
if s.AboveAverageLengthOfStay {
result = append(result, "Kasus Yang Melebihi Rata-Rata Lama Dirawat")
}
if s.ImportantOrHighRiskDischargePlanning {
result = append(result, "Rencana Pemulangan Penting / Kontinuitas Pelayanan")
}
if s.Stagnation {
result = append(result, "Stagnasi")
}
return result
}
func (p ProblemIdentification) SelectedProblemLabels() []string {
result := []string{}
if p.CareNotFollowingGuidelines {
result = append(result, "Tingkat Asuhan Tidak Sesuai Panduan/ Norma")
}
if p.OverUtilization {
result = append(result, "Over Utilization Pelayanan")
}
if p.UnderUtilization {
result = append(result, "Under Utilization Pelayanan")
}
if p.PatientNonCompliance {
result = append(result, "Ketidakpatuhan Pasien")
}
if p.InadequateEducation {
result = append(result, "Edukasi Kurang Memadai")
}
if p.LackOfFamilySupport {
result = append(result, "Kurang Dukungan Keluarga")
}
if p.DecreasedDetermination {
result = append(result, "Penurunan Determinasi Ketika Komplikasi Meningkat")
}
if p.FinancialDifficultyDuringComplications {
result = append(result, "Kendala Keuangan Ketika Komplikasi Meningkat")
}
if p.DischargeCriteriaNotMetOrDelayed {
result = append(result, "Pemulangan/ Rujukan Belum Memenuhi Kriteria/ Ditunda")
}
return result
}
@@ -18,3 +18,7 @@ type Screening struct {
Value *string `json:"value"`
FileUrl *string `json:"fileUrl" gorm:"size:1024"`
}
func (d Screening) IsFormA() bool {
return d.Type == erc.SFTCA
}
+38 -27
View File
@@ -9,6 +9,7 @@ type (
InstructionCode string
HeadToToeCode string
McuUrgencyLevelCode string
McuOrderStageCode string
McuScopeCode string
SoapiTypeCode string
MedicalActionTypeCode string
@@ -30,6 +31,7 @@ type (
BornMortalityCode string
BornLocationCode string
SpecimentDestCode string
ProcedureReportType string
)
const (
@@ -125,6 +127,9 @@ const (
MULCPF McuUrgencyLevelCode = "priority-form" // Form Prioritas
MULCRT McuUrgencyLevelCode = "routine" // Pemeriksaan Rutin
MOSFirst McuOrderStageCode = "first" // Stage 1
MOSSecond McuOrderStageCode = "repeat" // Stage 2
STCEarlyNurse SoapiTypeCode = "early-nursery" // Kajian Awal Keperawatan
STCEEarlyMedic SoapiTypeCode = "early-medic" // Kajian Awal Rehab Medis
STCEarlyRehab SoapiTypeCode = "early-rehab" // Kajian Awal Rehab Medik
@@ -204,37 +209,40 @@ const (
MSCMicroLab McuScopeCode = "micro-lab"
MSCApLab McuScopeCode = "ap-lab"
SSCSmall SurgerySizeCode = ""
SSCMedium SurgerySizeCode = ""
SSCLarge SurgerySizeCode = ""
SSCSpecial SurgerySizeCode = ""
SSCSmall SurgerySizeCode = "small"
SSCMedium SurgerySizeCode = "medium"
SSCLarge SurgerySizeCode = "large"
SSCSpecial SurgerySizeCode = "special"
SSyCCito SurgerySystemCode = ""
SSyCUrgent SurgerySystemCode = ""
SSyCEfective SurgerySystemCode = ""
SSyCSpecial SurgerySystemCode = ""
SSyCCito SurgerySystemCode = "cito"
SSyCUrgent SurgerySystemCode = "urgent"
SSyCEfective SurgerySystemCode = "efective"
SSyCSpecial SurgerySystemCode = "special"
STCClean SurgeryTypeCode = ""
STCCleanCtm SurgeryTypeCode = ""
STCUncleanCtm SurgeryTypeCode = ""
STCUnclean SurgeryTypeCode = ""
STCClean SurgeryTypeCode = "clean"
STCCleanCtm SurgeryTypeCode = "clean-ctm"
STCUncleanCtm SurgeryTypeCode = "unclean-ctm"
STCUnclean SurgeryTypeCode = "unclean"
SStCFirst SurgeryStageCode = ""
SStCRepeat SurgeryStageCode = ""
SStCFirst SurgeryStageCode = "first"
SStCRepeat SurgeryStageCode = "repeat"
BMCAlive BornMortalityCode = ""
BMCDead BornMortalityCode = ""
BMCAlive BornMortalityCode = "alive"
BMCDead BornMortalityCode = "dead"
BLCExtMiw BornLocationCode = ""
BLCExtDoc BornLocationCode = ""
BLCTradMiw BornLocationCode = ""
BLCLocalMed BornLocationCode = ""
BLCExtParamedic BornLocationCode = ""
BLCExtMiw BornLocationCode = "ext-miw"
BLCExtDoc BornLocationCode = "ext-doc"
BLCTradMiw BornLocationCode = "trad-miw"
BLCLocalMed BornLocationCode = "local-med"
BLCExtParamedic BornLocationCode = "ext-paramedic"
SDCAp SpecimentDestCode = ""
SDCMicro SpecimentDestCode = ""
SDCLab SpecimentDestCode = ""
SDCNone SpecimentDestCode = ""
SDCAp SpecimentDestCode = "ap"
SDCMicro SpecimentDestCode = "micro"
SDCLab SpecimentDestCode = "lab"
SDCNone SpecimentDestCode = "none"
PRTProcedure ProcedureReportType = "procedure"
PRTSurgery ProcedureReportType = "surgery"
)
type Soapi struct {
@@ -360,8 +368,11 @@ type HeadToToe struct {
BodyOthers string `json:"body-others,omitempty"`
}
type RecordAction struct {
Procedures []string `json:"procedures"`
type ProcedureRecord struct {
Procedures []CodeWithName `json:"procedures"`
}
type ProcedureExecution struct {
SurgerySize_Code *string `json:"surgerySize_code"`
Billing_Code *string `json:"billing_code"`
SurgerySystem_Code *string `json:"surgerySystem_code"`
@@ -22,6 +22,7 @@ type (
PolySwitchCode string
DocTypeCode string
EntityTypeCode string
StatusProtocolChemo string
)
const (
@@ -128,6 +129,10 @@ const (
ETCPerson EntityTypeCode = "person"
ETCEncounter EntityTypeCode = "encounter"
ETCMCU EntityTypeCode = "mcu"
SPCComplete StatusProtocolChemo = "complete"
SPCPlanned StatusProtocolChemo = "planned"
SPCSchedule StatusProtocolChemo = "schedule"
)
func (ec EncounterClassCode) Code() string {
@@ -0,0 +1,24 @@
package m_dokter
import "time"
type MDokter struct {
Kddokter uint `gorm:"column:kddokter;primaryKey;autoIncrement" json:"kddokter"`
Kdpoly uint `gorm:"column:kdpoly" json:"kdpoly"`
Namadokter string `gorm:"column:namadokter" json:"namadokter"`
Kdprofesi *uint `gorm:"column:kdprofesi" json:"kdprofesi"`
Namaprofesi *string `gorm:"column:namaprofesi" json:"namaprofesi"`
Aktif uint16 `gorm:"column:aktif" json:"aktif"`
KdSMF *string `gorm:"column:kdsmf" json:"kdsmf"`
KodeDPJP *string `gorm:"column:kode_dpjp" json:"kode_dpjp"`
NIP *string `gorm:"column:nip" json:"nip"`
Kategori *string `gorm:"column:kategori" json:"kategori"`
TglAkhirSIP *time.Time `gorm:"column:tgl_akhir_sip" json:"tgl_akhir_sip"`
NoHP *string `gorm:"column:no_hp" json:"no_hp"`
Email *string `gorm:"column:email" json:"email"`
TglAkhirSPK *time.Time `gorm:"column:tgl_akhir_spk" json:"tgl_akhir_spk"`
}
func (MDokter) TableName() string {
return "m_dokter"
}
@@ -0,0 +1,52 @@
package m_perawat
import (
"time"
)
type MPerawat struct {
Idperawat *uint `json:"idperawat" gorm:"column:idperawat;primaryKey"`
NIP string `json:"nip" gorm:"column:nip"`
UnitKerja *uint `json:"unit_kerja" gorm:"column:unit_kerja"`
Ruang *string `json:"ruang" gorm:"column:ruang"`
Nama string `json:"nama" gorm:"column:nama"`
Tempat *string `json:"tempat" gorm:"column:tempat"`
TglLahir *time.Time `json:"tgllahir" gorm:"column:tgllahir"`
JenisKelamin *string `json:"jeniskelamin" gorm:"column:jeniskelamin"`
Alamat *string `json:"alamat" gorm:"column:alamat"`
Kelurahan *string `json:"kelurahan" gorm:"column:kelurahan"`
Kdkecamatan *uint `json:"kdkecamatan" gorm:"column:kdkecamatan"`
Kota *string `json:"kota" gorm:"column:kota"`
KdProvinsi *uint `json:"kdprovinsi" gorm:"column:kdprovinsi"`
NoTelp *string `json:"notelp" gorm:"column:notelp"`
NoKTP *string `json:"noktp" gorm:"column:noktp"`
Status *uint `json:"status" gorm:"column:status"`
Agama *uint `json:"agama" gorm:"column:agama"`
Pendidikan *uint `json:"pendidikan" gorm:"column:pendidikan"`
AlamatKTP *string `json:"alamat_ktp" gorm:"column:alamat_ktp"`
JabFung *string `json:"jabfung" gorm:"column:jabfung"`
JabStruk *string `json:"jabstruk" gorm:"column:jabstruk"`
LamKer *string `json:"lamker" gorm:"column:lamker"`
TemKer *string `json:"temker" gorm:"column:temker"`
TemKer2 *string `json:"temker2" gorm:"column:temker2"`
PelManKep *string `json:"pelmankep" gorm:"column:pelmankep"`
PelTekKepGaw *string `json:"peltekkepgaw" gorm:"column:peltekkepgaw"`
PelTekKepMedah *string `json:"peltekkepmedah" gorm:"column:peltekkepmedah"`
PelTekKepNak *string `json:"peltekkepnak" gorm:"column:peltekkepnak"`
PelTekKepMat *string `json:"peltekkepmat" gorm:"column:peltekkepmat"`
PelTekKepJiwa *string `json:"peltekkepjiwa" gorm:"column:peltekkepjiwa"`
TemKerTuj *string `json:"temkertuj" gorm:"column:temkertuj"`
TemKerTuj2 *string `json:"temkertuj2" gorm:"column:temkertuj2"`
TglMutasi *time.Time `json:"tglmutasi" gorm:"column:tglmutasi"`
Alasan *string `json:"alasan" gorm:"column:alasan"`
TglKeluar *time.Time `json:"tglkeluar" gorm:"column:tglkeluar"`
ProgPendidikan *uint `json:"progpendidikan" gorm:"column:progpendidikan"`
ProgPeng *string `json:"progpeng" gorm:"column:progpeng"`
JabLain *string `json:"jablain" gorm:"column:jablain"`
PPA uint `json:"ppa" gorm:"column:ppa"`
Aktif uint `json:"aktif" gorm:"column:aktif"`
}
func (MPerawat) TableName() string {
return "m_perawat"
}
@@ -0,0 +1,29 @@
package doctor
import (
ecore "simrs-vx/internal/domain/base-entities/core"
erc "simrs-vx/internal/domain/references/common"
"time"
)
type DoctorLink struct {
ecore.Main
Simx_Id uint `json:"simx_id" gorm:"unique"`
Simgos_Id uint `json:"simgos_id" gorm:"unique"`
}
type DoctorSimxLog struct {
ecore.Main
Value *string `json:"value"`
Date *time.Time `json:"date"`
Status erc.ProcessStatusCode `json:"status"`
ErrMessage *string `json:"errMessage"`
}
type DoctorSimgosLog struct {
ecore.Main
Value *string `json:"value"`
Date *time.Time `json:"date"`
Status erc.ProcessStatusCode `json:"status"`
ErrMessage *string `json:"errMessage"`
}
@@ -0,0 +1,29 @@
package nurse
import (
ecore "simrs-vx/internal/domain/base-entities/core"
erc "simrs-vx/internal/domain/references/common"
"time"
)
type NurseLink struct {
ecore.Main
Simx_Id uint `json:"simx_id" gorm:"unique"`
Simgos_Id uint `json:"simgos_id" gorm:"unique"`
}
type NurseSimxLog struct {
ecore.Main
Value *string `json:"value"`
Date *time.Time `json:"date"`
Status erc.ProcessStatusCode `json:"status"`
ErrMessage *string `json:"errMessage"`
}
type NurseSimgosLog struct {
ecore.Main
Value *string `json:"value"`
Date *time.Time `json:"date"`
Status erc.ProcessStatusCode `json:"status"`
ErrMessage *string `json:"errMessage"`
}
@@ -4,7 +4,6 @@ import (
"net/http"
/******************** main / transaction ********************/
actionreport "simrs-vx/internal/interface/main-handler/action-report"
adime "simrs-vx/internal/interface/main-handler/adime"
admemployeehist "simrs-vx/internal/interface/main-handler/adm-employee-hist"
ambulancetransportrequest "simrs-vx/internal/interface/main-handler/ambulance-transport-req"
@@ -34,11 +33,14 @@ import (
practiceschedule "simrs-vx/internal/interface/main-handler/practice-schedule"
prescription "simrs-vx/internal/interface/main-handler/prescription"
prescriptionitem "simrs-vx/internal/interface/main-handler/prescription-item"
procedurereport "simrs-vx/internal/interface/main-handler/procedure-report"
procedureroom "simrs-vx/internal/interface/main-handler/procedure-room"
procedureroomorder "simrs-vx/internal/interface/main-handler/procedure-room-order"
procedureroomorderitem "simrs-vx/internal/interface/main-handler/procedure-room-order-item"
responsibledoctorhist "simrs-vx/internal/interface/main-handler/responsible-doctor-hist"
resume "simrs-vx/internal/interface/main-handler/resume"
sbar "simrs-vx/internal/interface/main-handler/sbar"
screening "simrs-vx/internal/interface/main-handler/screening"
soapi "simrs-vx/internal/interface/main-handler/soapi"
uploadfile "simrs-vx/internal/interface/main-handler/upload-file"
@@ -176,7 +178,7 @@ func SetRoutes() http.Handler {
hc.RegCrud(r, "/v1/sbar", auth.GuardMW, sbar.O)
hc.RegCrud(r, "/v1/prescription-item", prescriptionitem.O)
hc.RegCrud(r, "/v1/device-order-item", deviceorderitem.O)
hc.RegCrud(r, "/v1/action-report", auth.GuardMW, actionreport.O)
hc.RegCrud(r, "/v1/procedure-report", auth.GuardMW, procedurereport.O)
hc.RegCrud(r, "/v1/material-order-item", materialorderitem.O)
hk.GroupRoutes("/v1/encounter", r, auth.GuardMW, hk.MapHandlerFunc{
@@ -271,7 +273,15 @@ func SetRoutes() http.Handler {
"DELETE /{id}": materialorder.O.Delete,
"PATCH /{id}/complete": materialorder.O.Complete,
})
hc.RegCrud(r, "/v1/procedure-room-order", procedureroomorder.O)
hc.RegCrud(r, "/v1/procedure-room", procedureroom.O)
hk.GroupRoutes("/v1/procedure-room-order", r, auth.GuardMW, hk.MapHandlerFunc{
"GET /": procedureroomorder.O.GetList,
"GET /{id}": procedureroomorder.O.GetDetail,
"POST /": procedureroomorder.O.Create,
"PATCH /{id}": procedureroomorder.O.Update,
"DELETE /{id}": procedureroomorder.O.Delete,
"PATCH /{id}/submit": procedureroomorder.O.Submit,
})
hc.RegCrud(r, "/v1/procedure-room-order-item", procedureroomorderitem.O)
hk.GroupRoutes("/v1/consultation", r, auth.GuardMW, hk.MapHandlerFunc{
"GET /": consultation.O.GetList,
@@ -318,7 +328,11 @@ func SetRoutes() http.Handler {
"PATCH /{id}/verify": resume.Verify,
"PATCH /{id}/validate": resume.Validate,
})
hk.GroupRoutes("/v1/screening", r, auth.GuardMW, hk.MapHandlerFunc{
"POST /": screening.O.Create,
"GET /": screening.O.GetList,
"GET /{id}": screening.O.GetDetail,
})
/******************** actor ********************/
hc.RegCrud(r, "/v1/person", person.O)
hc.RegCrud(r, "/v1/person-address", personaddress.O)
@@ -59,19 +59,18 @@ func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
return
}
dto := e.UpdateDto{}
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
authInfo, err := pa.GetAuthInfo(r)
if err != nil {
rw.WriteJSON(w, http.StatusUnauthorized, d.IS{"message": err.Error()}, nil)
}
dto := e.UpdateDto{}
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
dto.Id = uint(id)
dto.AuthInfo = *authInfo
res, err := u.Update(dto)
rw.DataResponse(w, res, err)
}
@@ -8,8 +8,8 @@ import (
// ua "github.com/karincake/tumpeng/auth/svc"
e "simrs-vx/internal/domain/main-entities/action-report"
u "simrs-vx/internal/use-case/main-use-case/action-report"
e "simrs-vx/internal/domain/main-entities/procedure-report"
u "simrs-vx/internal/use-case/main-use-case/procedure-report"
pa "simrs-vx/internal/lib/auth"
@@ -69,3 +69,15 @@ func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
res, err := u.Delete(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Submit(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
return
}
dto := e.ReadDetailDto{}
dto.Id = uint64(id)
res, err := u.Submit(dto)
rw.DataResponse(w, res, err)
}
@@ -0,0 +1,71 @@
package procedureroom
import (
"net/http"
rw "github.com/karincake/risoles"
sf "github.com/karincake/semprit"
// ua "github.com/karincake/tumpeng/auth/svc"
e "simrs-vx/internal/domain/main-entities/procedure-room"
u "simrs-vx/internal/use-case/main-use-case/procedure-room"
)
type myBase struct{}
var O myBase
func (obj myBase) Create(w http.ResponseWriter, r *http.Request) {
dto := e.CreateDto{}
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
res, err := u.Create(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
dto := e.ReadListDto{}
sf.UrlQueryParam(&dto, *r.URL)
res, err := u.ReadList(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id == 0 {
return
}
dto := e.ReadDetailDto{}
dto.Id = uint16(id)
res, err := u.ReadDetail(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id == 0 {
return
}
dto := e.UpdateDto{}
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
dto.Id = uint16(id)
res, err := u.Update(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id == 0 {
return
}
dto := e.DeleteDto{}
dto.Id = uint16(id)
res, err := u.Delete(dto)
rw.DataResponse(w, res, err)
}
@@ -0,0 +1,80 @@
package screening
import (
"net/http"
rw "github.com/karincake/risoles"
sf "github.com/karincake/semprit"
// ua "github.com/karincake/tumpeng/auth/svc"
e "simrs-vx/internal/domain/main-entities/screening"
u "simrs-vx/internal/use-case/main-use-case/screening"
pa "simrs-vx/internal/lib/auth"
d "github.com/karincake/dodol"
)
type myBase struct{}
var O myBase
func (obj myBase) Create(w http.ResponseWriter, r *http.Request) {
authInfo, err := pa.GetAuthInfo(r)
if err != nil {
rw.WriteJSON(w, http.StatusUnauthorized, d.IS{"message": err.Error()}, nil)
}
dto := e.CreateDto{}
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
dto.AuthInfo = *authInfo
res, err := u.Create(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
dto := e.ReadListDto{}
sf.UrlQueryParam(&dto, *r.URL)
res, err := u.ReadList(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
return
}
dto := e.ReadDetailDto{}
dto.Id = uint(id)
res, err := u.ReadDetail(dto)
rw.DataResponse(w, res, err)
}
// func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
// id := rw.ValidateInt(w, "id", r.PathValue("id"))
// if id <= 0 {
// return
// }
// dto := e.UpdateDto{}
// if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
// return
// }
// dto.Id = uint16(id)
// res, err := u.Update(dto)
// rw.DataResponse(w, res, err)
// }
// func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
// id := rw.ValidateInt(w, "id", r.PathValue("id"))
// if id <= 0 {
// return
// }
// dto := e.DeleteDto{}
// dto.Id = uint16(id)
// res, err := u.Delete(dto)
// rw.DataResponse(w, res, err)
// }
+20 -2
View File
@@ -1,20 +1,23 @@
package migration
import (
actionreport "simrs-vx/internal/domain/main-entities/action-report"
adime "simrs-vx/internal/domain/main-entities/adime"
admemployeehist "simrs-vx/internal/domain/main-entities/adm-employee-hist"
ambulancetransportreq "simrs-vx/internal/domain/main-entities/ambulance-transport-req"
ambulatory "simrs-vx/internal/domain/main-entities/ambulatory"
antibioticinuse "simrs-vx/internal/domain/main-entities/antibiotic-in-use"
antibioticsrccategory "simrs-vx/internal/domain/main-entities/antibiotic-src-category"
apmcuorder "simrs-vx/internal/domain/main-entities/ap-mcu-order"
appointment "simrs-vx/internal/domain/main-entities/appointment"
authpartner "simrs-vx/internal/domain/main-entities/auth-partner"
chemo "simrs-vx/internal/domain/main-entities/chemo"
chemoplan "simrs-vx/internal/domain/main-entities/chemo-plan"
chemoprotocol "simrs-vx/internal/domain/main-entities/chemo-protocol"
consultation "simrs-vx/internal/domain/main-entities/consultation"
controlletter "simrs-vx/internal/domain/main-entities/control-letter"
counter "simrs-vx/internal/domain/main-entities/counter"
cpmcuorder "simrs-vx/internal/domain/main-entities/cp-mcu-order"
cpmcuorderitem "simrs-vx/internal/domain/main-entities/cp-mcu-order-item"
deathcause "simrs-vx/internal/domain/main-entities/death-cause"
device "simrs-vx/internal/domain/main-entities/device"
deviceorder "simrs-vx/internal/domain/main-entities/device-order"
@@ -67,6 +70,8 @@ import (
medicinemethod "simrs-vx/internal/domain/main-entities/medicine-method"
medicinemix "simrs-vx/internal/domain/main-entities/medicine-mix"
medicinemixitem "simrs-vx/internal/domain/main-entities/medicine-mix-item"
micromcuorder "simrs-vx/internal/domain/main-entities/micro-mcu-order"
micromcuorderitem "simrs-vx/internal/domain/main-entities/micro-mcu-order-item"
midwife "simrs-vx/internal/domain/main-entities/midwife"
nurse "simrs-vx/internal/domain/main-entities/nurse"
nutritionist "simrs-vx/internal/domain/main-entities/nutritionist"
@@ -82,12 +87,16 @@ import (
practiceschedule "simrs-vx/internal/domain/main-entities/practice-schedule"
prescription "simrs-vx/internal/domain/main-entities/prescription"
prescriptionitem "simrs-vx/internal/domain/main-entities/prescription-item"
procedurereport "simrs-vx/internal/domain/main-entities/procedure-report"
procedureroom "simrs-vx/internal/domain/main-entities/procedure-room"
procedureroomorder "simrs-vx/internal/domain/main-entities/procedure-room-order"
procedureroomorderitem "simrs-vx/internal/domain/main-entities/procedure-room-order-item"
proceduresrc "simrs-vx/internal/domain/main-entities/procedure-src"
province "simrs-vx/internal/domain/main-entities/province"
radiologymcuorder "simrs-vx/internal/domain/main-entities/radiology-mcu-order"
radiologymcuorderitem "simrs-vx/internal/domain/main-entities/radiology-mcu-order-item"
regency "simrs-vx/internal/domain/main-entities/regency"
registration "simrs-vx/internal/domain/main-entities/registration"
rehab "simrs-vx/internal/domain/main-entities/rehab"
responsibledoctorhist "simrs-vx/internal/domain/main-entities/responsible-doctor-hist"
resume "simrs-vx/internal/domain/main-entities/resume"
@@ -140,6 +149,7 @@ func getMainEntities() []any {
&proceduresrc.ProcedureSrc{},
&employee.Employee{},
&intern.Intern{},
&registration.Registration{},
&doctor.Doctor{},
&nurse.Nurse{},
&nutritionist.Nutritionist{},
@@ -200,6 +210,13 @@ func getMainEntities() []any {
&mcuorderitem.McuOrderItem{},
&mcusubsrc.McuSubSrc{},
&mcuordersubitem.McuOrderSubItem{},
&apmcuorder.ApMcuOrder{},
&radiologymcuorder.RadiologyMcuOrder{},
&radiologymcuorderitem.RadiologyMcuOrderItem{},
&cpmcuorder.CpMcuOrder{},
&cpmcuorderitem.CpMcuOrderItem{},
&micromcuorder.MicroMcuOrder{},
&micromcuorderitem.MicroMcuOrderItem{},
&antibioticsrccategory.AntibioticSrcCategory{},
&antibioticinuse.AntibioticInUse{},
&consultation.Consultation{},
@@ -234,6 +251,7 @@ func getMainEntities() []any {
&resume.Resume{},
&vclaimreference.VclaimReference{},
&screening.Screening{},
&actionreport.ActionReport{},
&procedurereport.ProcedureReport{},
&chemoplan.ChemoPlan{},
}
}
@@ -3,9 +3,11 @@ package migration
import (
/************** Source ***************/
division "simrs-vx/internal/domain/sync-entities/division"
doctor "simrs-vx/internal/domain/sync-entities/doctor"
encounter "simrs-vx/internal/domain/sync-entities/encounter"
installation "simrs-vx/internal/domain/sync-entities/installation"
internalreference "simrs-vx/internal/domain/sync-entities/internal-reference"
nurse "simrs-vx/internal/domain/sync-entities/nurse"
patient "simrs-vx/internal/domain/sync-entities/patient"
soapi "simrs-vx/internal/domain/sync-entities/soapi"
specialist "simrs-vx/internal/domain/sync-entities/specialist"
@@ -42,5 +44,11 @@ func getSyncEntities() []any {
&soapi.SoapiLink{},
&soapi.SoapiSimxLog{},
&soapi.SoapiSimgosLog{},
&doctor.DoctorLink{},
&doctor.DoctorSimxLog{},
&doctor.DoctorSimgosLog{},
&nurse.NurseLink{},
&nurse.NurseSimxLog{},
&nurse.NurseSimgosLog{},
}
}
+15
View File
@@ -66,6 +66,13 @@ func (a AuthInfo) IsPharmacist() bool {
return *a.Employee_Position_Code == string(ero.EPCPha)
}
func (a AuthInfo) IsScreener() bool { // MPP, petugas skrining
if a.Employee_Position_Code == nil {
return false
}
return *a.Employee_Position_Code == string(ero.EPCScr)
}
// func (a AuthInfo) IsPayment() bool {
// if a.Employee_Position_Code == nil {
// return false
@@ -97,3 +104,11 @@ func (a AuthInfo) IsNurseIntern() bool {
func (a AuthInfo) HasEmployeePosition() bool {
return a.Employee_Position_Code != nil
}
func (a AuthInfo) IsReg() bool {
return a.Employee_Position_Code != nil && *a.Employee_Position_Code == string(ero.EPCReg)
}
func (a AuthInfo) IsSys() bool {
return a.User_ContractPosition_Code == string(ero.CSCSys)
}
@@ -1,28 +0,0 @@
/*
DESCRIPTION:
Any functions that are used internally by the use-case
*/
package actionreport
import (
e "simrs-vx/internal/domain/main-entities/action-report"
)
func setData[T *e.CreateDto | *e.UpdateDto](input T, data *e.ActionReport) {
var inputSrc *e.CreateDto
if inputT, ok := any(input).(*e.CreateDto); ok {
inputSrc = inputT
} else {
inputTemp := any(input).(*e.UpdateDto)
inputSrc = &inputTemp.CreateDto
}
data.Encounter_Id = inputSrc.Encounter_Id
data.Date = inputSrc.Date
data.Doctor_Code = inputSrc.Doctor_Code
data.Operator_Employe_Id = inputSrc.Operator_Employe_Id
data.Assistant_Employe_Id = inputSrc.Assistant_Employe_Id
data.Instrumentor_Employe_Id = inputSrc.Instrumentor_Employe_Id
data.Nurse_Code = inputSrc.Nurse_Code
data.Value = inputSrc.Value
}
@@ -0,0 +1,276 @@
package apmcuorder
import (
e "simrs-vx/internal/domain/main-entities/ap-mcu-order"
"strconv"
dg "github.com/karincake/apem/db-gorm-pg"
d "github.com/karincake/dodol"
pl "simrs-vx/pkg/logger"
pu "simrs-vx/pkg/use-case-helper"
"gorm.io/gorm"
)
const source = "device"
func Create(input e.CreateDto) (*d.Data, error) {
data := e.ApMcuOrder{}
event := pl.Event{
Feature: "Create",
Source: source,
}
// Start log
pl.SetLogInfo(&event, input, "started", "create")
err := dg.I.Transaction(func(tx *gorm.DB) error {
mwRunner := newMiddlewareRunner(&event, tx)
mwRunner.setMwType(pu.MWTPre)
// Run pre-middleware
if err := mwRunner.RunCreateMiddleware(createPreMw, &input, &data); err != nil {
return err
}
if resData, err := CreateData(input, &event, tx); err != nil {
return err
} else {
data = *resData
}
mwRunner.setMwType(pu.MWTPost)
// Run post-middleware
if err := mwRunner.RunCreateMiddleware(createPostMw, &input, &data); err != nil {
return err
}
pl.SetLogInfo(&event, nil, "complete")
return nil
})
if err != nil {
return nil, err
}
return &d.Data{
Meta: d.II{
"source": source,
"structure": "single-data",
"status": "created",
},
Data: data.ToResponse(),
}, nil
}
func ReadList(input e.ReadListDto) (*d.Data, error) {
var data *e.ApMcuOrder
var dataList []e.ApMcuOrder
var metaList *e.MetaDto
var err error
event := pl.Event{
Feature: "ReadList",
Source: source,
}
// Start log
pl.SetLogInfo(&event, input, "started", "readList")
err = dg.I.Transaction(func(tx *gorm.DB) error {
mwRunner := newMiddlewareRunner(&event, tx)
mwRunner.setMwType(pu.MWTPre)
// Run pre-middleware
if err := mwRunner.RunReadListMiddleware(readListPreMw, &input, data); err != nil {
return err
}
if dataList, metaList, err = ReadListData(input, &event, tx); err != nil {
return err
}
mwRunner.setMwType(pu.MWTPost)
// Run post-middleware
if err := mwRunner.RunReadListMiddleware(readListPostMw, &input, data); err != nil {
return err
}
return nil
})
if err != nil {
return nil, err
}
return &d.Data{
Meta: d.IS{
"source": source,
"structure": "list-data",
"status": "fetched",
"page_number": strconv.Itoa(metaList.PageNumber),
"page_size": strconv.Itoa(metaList.PageSize),
"record_totalCount": strconv.Itoa(metaList.Count),
"record_currentCount": strconv.Itoa(len(dataList)),
},
Data: e.ToResponseList(dataList),
}, nil
}
func ReadDetail(input e.ReadDetailDto) (*d.Data, error) {
var data *e.ApMcuOrder
var err error
event := pl.Event{
Feature: "ReadDetail",
Source: source,
}
// Start log
pl.SetLogInfo(&event, input, "started", "readDetail")
err = dg.I.Transaction(func(tx *gorm.DB) error {
mwRunner := newMiddlewareRunner(&event, tx)
mwRunner.setMwType(pu.MWTPre)
// Run pre-middleware
if err := mwRunner.RunReadDetailMiddleware(readDetailPreMw, &input, data); err != nil {
return err
}
if data, err = ReadDetailData(input, &event, tx); err != nil {
return err
}
mwRunner.setMwType(pu.MWTPost)
// Run post-middleware
if err := mwRunner.RunReadDetailMiddleware(readDetailPostMw, &input, data); err != nil {
return err
}
return nil
})
if err != nil {
return nil, err
}
return &d.Data{
Meta: d.IS{
"source": source,
"structure": "single-data",
"status": "fetched",
},
Data: data.ToResponse(),
}, nil
}
func Update(input e.UpdateDto) (*d.Data, error) {
rdDto := e.ReadDetailDto{Id: input.Id}
var data *e.ApMcuOrder
var err error
event := pl.Event{
Feature: "Update",
Source: source,
}
// Start log
pl.SetLogInfo(&event, input, "started", "update")
err = dg.I.Transaction(func(tx *gorm.DB) error {
pl.SetLogInfo(&event, rdDto, "started", "DBReadDetail")
if data, err = ReadDetailData(rdDto, &event, tx); err != nil {
return err
}
mwRunner := newMiddlewareRunner(&event, tx)
mwRunner.setMwType(pu.MWTPre)
// Run pre-middleware
if err := mwRunner.RunUpdateMiddleware(readDetailPreMw, &rdDto, data); err != nil {
return err
}
if err := UpdateData(input, data, &event, tx); err != nil {
return err
}
pl.SetLogInfo(&event, nil, "complete")
mwRunner.setMwType(pu.MWTPost)
// Run post-middleware
if err := mwRunner.RunUpdateMiddleware(readDetailPostMw, &rdDto, data); err != nil {
return err
}
return nil
})
if err != nil {
return nil, err
}
return &d.Data{
Meta: d.IS{
"source": source,
"structure": "single-data",
"status": "updated",
},
Data: data.ToResponse(),
}, nil
}
func Delete(input e.DeleteDto) (*d.Data, error) {
rdDto := e.ReadDetailDto{Id: input.Id}
var data *e.ApMcuOrder
var err error
event := pl.Event{
Feature: "Delete",
Source: source,
}
// Start log
pl.SetLogInfo(&event, input, "started", "delete")
err = dg.I.Transaction(func(tx *gorm.DB) error {
pl.SetLogInfo(&event, rdDto, "started", "DBReadDetail")
if data, err = ReadDetailData(rdDto, &event, tx); err != nil {
return err
}
mwRunner := newMiddlewareRunner(&event, tx)
mwRunner.setMwType(pu.MWTPre)
// Run pre-middleware
if err := mwRunner.RunDeleteMiddleware(readDetailPreMw, &rdDto, data); err != nil {
return err
}
if err := DeleteData(data, &event, tx); err != nil {
return err
}
mwRunner.setMwType(pu.MWTPost)
// Run post-middleware
if err := mwRunner.RunDeleteMiddleware(readDetailPostMw, &rdDto, data); err != nil {
return err
}
return nil
})
if err != nil {
return nil, err
}
return &d.Data{
Meta: d.IS{
"source": source,
"structure": "single-data",
"status": "deleted",
},
Data: data.ToResponse(),
}, nil
}
@@ -0,0 +1,27 @@
/*
DESCRIPTION:
Any functions that are used internally by the use-case
*/
package apmcuorder
import (
e "simrs-vx/internal/domain/main-entities/ap-mcu-order"
)
func setData[T *e.CreateDto | *e.UpdateDto](input T, data *e.ApMcuOrder) {
var inputSrc *e.CreateDto
if inputT, ok := any(input).(*e.CreateDto); ok {
inputSrc = inputT
} else {
inputTemp := any(input).(*e.UpdateDto)
inputSrc = &inputTemp.CreateDto
}
data.Substances = inputSrc.Substances
data.Fictations = inputSrc.Fictations
data.Localization = inputSrc.Localization
data.ClinicalDiagnoses = inputSrc.ClinicalDiagnoses
data.Stadium = inputSrc.Stadium
data.PastHistory = inputSrc.PastHistory
data.CurrentHistory = inputSrc.CurrentHistory
}
@@ -0,0 +1,140 @@
package apmcuorder
import (
e "simrs-vx/internal/domain/main-entities/ap-mcu-order"
plh "simrs-vx/pkg/lib-helper"
pl "simrs-vx/pkg/logger"
pu "simrs-vx/pkg/use-case-helper"
dg "github.com/karincake/apem/db-gorm-pg"
gh "github.com/karincake/getuk"
"gorm.io/gorm"
)
func CreateData(input e.CreateDto, event *pl.Event, dbx ...*gorm.DB) (*e.ApMcuOrder, error) {
pl.SetLogInfo(event, nil, "started", "DBCreate")
data := e.ApMcuOrder{}
setData(&input, &data)
var tx *gorm.DB
if len(dbx) > 0 {
tx = dbx[0]
} else {
tx = dg.I
}
if err := tx.Create(&data).Error; err != nil {
return nil, plh.HandleCreateError(input, event, err)
}
pl.SetLogInfo(event, nil, "complete")
return &data, nil
}
func ReadListData(input e.ReadListDto, event *pl.Event, dbx ...*gorm.DB) ([]e.ApMcuOrder, *e.MetaDto, error) {
pl.SetLogInfo(event, input, "started", "DBReadList")
data := []e.ApMcuOrder{}
pagination := gh.Pagination{}
count := int64(0)
meta := e.MetaDto{}
var tx *gorm.DB
if len(dbx) > 0 {
tx = dbx[0]
} else {
tx = dg.I
}
tx = tx.
Model(&e.ApMcuOrder{}).
Scopes(gh.Preload(input.Includes)).
Scopes(gh.Filter(input.FilterDto)).
Count(&count).
Scopes(gh.Paginate(input, &pagination)).
Scopes(gh.Sort(input.Sort))
if err := tx.Find(&data).Error; err != nil {
if err == gorm.ErrRecordNotFound {
return nil, &meta, nil
}
return nil, nil, plh.HandleListError(input, event, err)
}
meta.Count = int(count)
meta.PageNumber = pagination.PageNumber
meta.PageSize = pagination.PageSize
pl.SetLogInfo(event, nil, "complete")
return data, &meta, nil
}
func ReadDetailData(input e.ReadDetailDto, event *pl.Event, dbx ...*gorm.DB) (*e.ApMcuOrder, error) {
pl.SetLogInfo(event, input, "started", "DBReadDetail")
data := e.ApMcuOrder{}
var tx *gorm.DB
if len(dbx) > 0 {
tx = dbx[0]
} else {
tx = dg.I
}
if err := tx.First(&data, input.Id).Error; err != nil {
if processedErr := pu.HandleReadError(err, event, source, input.Id, data); processedErr != nil {
return nil, processedErr
}
}
pl.SetLogInfo(event, nil, "complete")
return &data, nil
}
func UpdateData(input e.UpdateDto, data *e.ApMcuOrder, event *pl.Event, dbx ...*gorm.DB) error {
pl.SetLogInfo(event, data, "started", "DBUpdate")
setData(&input, data)
var tx *gorm.DB
if len(dbx) > 0 {
tx = dbx[0]
} else {
tx = dg.I
}
if err := tx.Save(&data).Error; err != nil {
event.Status = "failed"
event.ErrInfo = pl.ErrorInfo{
Code: "data-update-fail",
Detail: "Database update failed",
Raw: err,
}
return pl.SetLogError(event, input)
}
pl.SetLogInfo(event, nil, "complete")
return nil
}
func DeleteData(data *e.ApMcuOrder, event *pl.Event, dbx ...*gorm.DB) error {
pl.SetLogInfo(event, data, "started", "DBDelete")
var tx *gorm.DB
if len(dbx) > 0 {
tx = dbx[0]
} else {
tx = dg.I
}
if err := tx.Delete(&data).Error; err != nil {
event.Status = "failed"
event.ErrInfo = pl.ErrorInfo{
Code: "data-delete-fail",
Detail: "Database delete failed",
Raw: err,
}
return pl.SetLogError(event, data)
}
pl.SetLogInfo(event, nil, "complete")
return nil
}
@@ -1,7 +1,7 @@
package actionreport
package apmcuorder
import (
e "simrs-vx/internal/domain/main-entities/action-report"
e "simrs-vx/internal/domain/main-entities/ap-mcu-order"
pl "simrs-vx/pkg/logger"
pu "simrs-vx/pkg/use-case-helper"
@@ -23,7 +23,7 @@ func newMiddlewareRunner(event *pl.Event, tx *gorm.DB) *middlewareRunner {
}
// ExecuteCreateMiddleware executes create middleware
func (me *middlewareRunner) RunCreateMiddleware(middlewares []createMw, input *e.CreateDto, data *e.ActionReport) error {
func (me *middlewareRunner) RunCreateMiddleware(middlewares []createMw, input *e.CreateDto, data *e.ApMcuOrder) error {
for _, middleware := range middlewares {
logData := pu.GetLogData(input, data)
@@ -38,7 +38,7 @@ func (me *middlewareRunner) RunCreateMiddleware(middlewares []createMw, input *e
return nil
}
func (me *middlewareRunner) RunReadListMiddleware(middlewares []readListMw, input *e.ReadListDto, data *e.ActionReport) error {
func (me *middlewareRunner) RunReadListMiddleware(middlewares []readListMw, input *e.ReadListDto, data *e.ApMcuOrder) error {
for _, middleware := range middlewares {
logData := pu.GetLogData(input, data)
@@ -53,7 +53,7 @@ func (me *middlewareRunner) RunReadListMiddleware(middlewares []readListMw, inpu
return nil
}
func (me *middlewareRunner) RunReadDetailMiddleware(middlewares []readDetailMw, input *e.ReadDetailDto, data *e.ActionReport) error {
func (me *middlewareRunner) RunReadDetailMiddleware(middlewares []readDetailMw, input *e.ReadDetailDto, data *e.ApMcuOrder) error {
for _, middleware := range middlewares {
logData := pu.GetLogData(input, data)
@@ -68,7 +68,7 @@ func (me *middlewareRunner) RunReadDetailMiddleware(middlewares []readDetailMw,
return nil
}
func (me *middlewareRunner) RunUpdateMiddleware(middlewares []readDetailMw, input *e.ReadDetailDto, data *e.ActionReport) error {
func (me *middlewareRunner) RunUpdateMiddleware(middlewares []readDetailMw, input *e.ReadDetailDto, data *e.ApMcuOrder) error {
for _, middleware := range middlewares {
logData := pu.GetLogData(input, data)
@@ -83,7 +83,7 @@ func (me *middlewareRunner) RunUpdateMiddleware(middlewares []readDetailMw, inpu
return nil
}
func (me *middlewareRunner) RunDeleteMiddleware(middlewares []readDetailMw, input *e.ReadDetailDto, data *e.ActionReport) error {
func (me *middlewareRunner) RunDeleteMiddleware(middlewares []readDetailMw, input *e.ReadDetailDto, data *e.ApMcuOrder) error {
for _, middleware := range middlewares {
logData := pu.GetLogData(input, data)
@@ -1,4 +1,4 @@
package actionreport
package apmcuorder
// example of middleware
// func init() {
@@ -6,27 +6,27 @@ In this sample it also provides type and variable regarding the needs of the
middleware to separate from main use-case which has the basic CRUD
functionality. The purpose of this is to make the code more maintainable.
*/
package actionreport
package apmcuorder
import (
"gorm.io/gorm"
e "simrs-vx/internal/domain/main-entities/action-report"
e "simrs-vx/internal/domain/main-entities/ap-mcu-order"
)
type createMw struct {
Name string
Func func(input *e.CreateDto, data *e.ActionReport, tx *gorm.DB) error
Func func(input *e.CreateDto, data *e.ApMcuOrder, tx *gorm.DB) error
}
type readListMw struct {
Name string
Func func(input *e.ReadListDto, data *e.ActionReport, tx *gorm.DB) error
Func func(input *e.ReadListDto, data *e.ApMcuOrder, tx *gorm.DB) error
}
type readDetailMw struct {
Name string
Func func(input *e.ReadDetailDto, data *e.ActionReport, tx *gorm.DB) error
Func func(input *e.ReadDetailDto, data *e.ApMcuOrder, tx *gorm.DB) error
}
type UpdateMw = readDetailMw
@@ -17,12 +17,9 @@ func setData[T *e.CreateDto | *e.UpdateDto](input T, data *e.ChemoProtocol) {
inputSrc = &inputTemp.CreateDto
}
data.Encounter_Id = inputSrc.Encounter_Id
data.Patient_Weight = inputSrc.Patient_Weight
data.Patient_Height = inputSrc.Patient_Height
data.Diagnoses = inputSrc.Diagnoses
data.Duration = inputSrc.Duration
data.DurationUnit_Code = inputSrc.DurationUnit_Code
data.StartDate = inputSrc.StartDate
data.EndDate = inputSrc.EndDate
}
@@ -65,12 +65,43 @@ func ReadListData(input e.ReadListDto, event *pl.Event, dbx ...*gorm.DB) ([]e.En
tx.Where("\"Responsible_Doctor_Code\" = ?", *input.AuthInfo.Doctor_Code) //
}
tx.Scopes(gh.Preload(input.Includes)).
Scopes(gh.Filter(input.FilterDto)).
if input.StartDate != nil && input.EndDate != nil {
tx = tx.Where(
"DATE(\"Encounter\".\"RegisteredAt\") >= DATE(?) AND DATE(\"Encounter\".\"RegisteredAt\") <= DATE(?)",
input.StartDate,
input.EndDate,
)
}
if input.Patient_Identifier != nil {
tx = tx.Joins("JOIN \"Patient\" ON \"Patient\".\"Id\" = \"Encounter\".\"Patient_Id\"").
Joins("JOIN \"Person\" ON \"Person\".\"Id\" = \"Patient\".\"Person_Id\"").Where("\"Person\".\"Name\" ILIKE ? OR \"Patient\".\"Number\" = ?", "%"+*input.Patient_Identifier+"%", *input.Patient_Identifier)
}
// TODO: getuk lib need to be updated to support this
if input.Status_Code != nil {
tx = tx.Where("\"Encounter\".\"Status_Code\" = ?", *input.Status_Code)
}
if input.Unit_Code != nil {
tx = tx.Where("\"Encounter\".\"Unit_Code\" = ?", *input.Unit_Code)
}
if input.PaymentMethod_Code != nil {
tx = tx.Where("\"Encounter\".\"PaymentMethod_Code\" = ?", *input.PaymentMethod_Code)
}
tx = tx.Scopes(gh.Preload(input.Includes)).
Count(&count).
Scopes(gh.Paginate(input, &pagination)).
Order("\"CreatedAt\" DESC")
// tx.Debug().Scopes(gh.Preload(input.Includes)).
// Scopes(gh.Filter(input.FilterDto)).
// Count(&count).
// Scopes(gh.Paginate(input, &pagination)).
// Order("\"CreatedAt\" DESC")
if err := tx.Find(&data).Error; err != nil {
if err == gorm.ErrRecordNotFound {
return nil, &meta, nil
@@ -51,6 +51,12 @@ func Generate(input GenerateDto) (*d.Data, error) {
return err
}
// screening
case ere.DTCScreening:
response, err = generateScreening(input, event, tx)
if err != nil {
return err
}
default:
return errors.New("invalid type code")
}
@@ -13,13 +13,16 @@ import (
ee "simrs-vx/internal/domain/main-entities/encounter"
egc "simrs-vx/internal/domain/main-entities/general-consent"
er "simrs-vx/internal/domain/main-entities/resume"
es "simrs-vx/internal/domain/main-entities/screening"
uvs "simrs-vx/internal/use-case/bpjs-use-case/vclaim-sep"
uvscl "simrs-vx/internal/use-case/bpjs-use-case/vclaim-sep-control-letter"
ue "simrs-vx/internal/use-case/main-use-case/encounter"
ugc "simrs-vx/internal/use-case/main-use-case/general-consent"
ur "simrs-vx/internal/use-case/main-use-case/resume"
us "simrs-vx/internal/use-case/main-use-case/screening"
ercl "simrs-vx/internal/domain/references/clinical"
erc "simrs-vx/internal/domain/references/common"
docscfg "simrs-vx/internal/infra/docs-cfg"
@@ -339,3 +342,131 @@ func generateResumeTemplateData(resume er.Resume, event pl.Event, tx *gorm.DB) (
return &templateData, nil
}
func generateScreeningTemplateData(screenings []es.Screening, event pl.Event, tx *gorm.DB) (*ScreeningPDF, error) {
// get encounter
includes := "Patient,Patient.Person"
encounter, err := ue.ReadDetailData(ee.ReadDetailDto{Id: *screenings[0].Encounter_Id, Includes: includes}, &event)
if err != nil {
return nil, err
}
switch screenings[0].Type {
case ercl.SFTCA:
// map template data
sData := es.FormA{}
if screenings[0].Value != nil {
err := json.Unmarshal([]byte(*screenings[0].Value), &sData)
if err != nil {
event.ErrInfo = pl.ErrorInfo{
Code: "data-unmarshal-fail",
Detail: err.Error(),
Raw: err,
}
return nil, err
}
} else {
return nil, errors.New("there is no data to be used")
}
templateData := ScreeningPDF{}
templateData.IssuedDate = pu.GetTimeNow().Format("2006-01-02 15:04:05")
templateData.MedicalRecord = *encounter.Patient.Number
templateData.Name = encounter.Patient.Person.FullName()
templateData.BirthDate = encounter.Patient.Person.BirthDate.Format("2006-01-02 15:04:05")
templateData.Employee_Name = screenings[0].Employee.Person.FullName()
templateData.EarlyMedic = sData.Screening.SelectedScreeningLabels()
templateData.Assessment = sData.AssessmentDetail
templateData.ProblemIdentification = sData.ProblemIdentification.SelectedProblemLabels()
templateData.Planning = sData.PlanningDetail
templateData.Date = screenings[0].CreatedAt.Format("2006-01-02 15:04:05")
return &templateData, nil
case ercl.SFTCB:
// map template data
templateData := ScreeningPDF{}
templateData.IssuedDate = pu.GetTimeNow().Format("2006-01-02 15:04:05")
templateData.MedicalRecord = *encounter.Patient.Number
templateData.Name = encounter.Patient.Person.FullName()
templateData.BirthDate = encounter.Patient.Person.BirthDate.Format("2006-01-02 15:04:05")
for k, v := range screenings {
templateData.FormB = append(templateData.FormB, ScreeningFormBPDF{
Number: k + 1,
Date: v.CreatedAt.Format("2006-01-02 15:04:05"),
Employee_Name: v.Employee.Person.FullName(),
Value: *v.Value,
})
}
return &templateData, nil
}
return nil, errors.New("invalid screening type")
}
func generateScreening(input GenerateDto, event pl.Event, tx *gorm.DB) (*ResponseDto, error) {
// get value from resume by ref_id
includes := "Employee.Person"
s, err := us.ReadDetailData(es.ReadDetailDto{Id: uint(*pc.StringToUint64(*input.Ref_Id)), Includes: includes}, &event)
if err != nil {
return nil, err
}
var screenings []es.Screening
var templateData *ScreeningPDF
if s.IsFormA() {
if s.FileUrl != nil {
if err := removeFile(string(input.EntityType_Code), *s.FileUrl); err != nil {
return nil, err
}
}
screenings = append(screenings, *s)
input.FormatType = erc.DFTCPDF
input.TemplateName = TDNSA
input.Encounter_Id = s.Encounter_Id
templateData, err = generateScreeningTemplateData(screenings, event, tx)
if err != nil {
return nil, err
}
} else {
includes := "Employee.Person"
sort := "CreatedAt:ASC"
ss, _, err := us.ReadListData(es.ReadListDto{FilterDto: es.FilterDto{Encounter_Id: s.Encounter_Id, Type: ercl.SFTCB}, Includes: includes, Sort: sort}, &event, tx)
if err != nil {
return nil, err
}
screenings = append(screenings, ss...)
input.FormatType = erc.DFTCPDF
input.TemplateName = TDNSB
input.Encounter_Id = s.Encounter_Id
templateData, err = generateScreeningTemplateData(screenings, event, tx)
if err != nil {
return nil, err
}
}
// generate file
urlPub, err := generateFile(input, templateData)
if err != nil {
return nil, err
}
if len(screenings) > 1 {
for i := range screenings {
screenings[i].FileUrl = &urlPub
}
if err := tx.Save(&screenings).Error; err != nil {
return nil, err
}
} else {
s.FileUrl = &urlPub
if err := tx.Save(&s).Error; err != nil {
return nil, err
}
}
response := ResponseDto{
FileUrl: urlPub,
}
return &response, nil
}
@@ -72,6 +72,27 @@ type ResumePDF struct {
Date string
}
type ScreeningPDF struct {
IssuedDate string
Date string
MedicalRecord string
Name string
BirthDate string
Employee_Name string
EarlyMedic []string
Assessment string
ProblemIdentification []string
Planning string
FormB []ScreeningFormBPDF
}
type ScreeningFormBPDF struct {
Number int
Date string
Employee_Name string
Value string
}
type GenerateDto struct {
EntityType_Code ere.EntityTypeCode `json:"entityType_code" validate:"required"`
Ref_Id *string `json:"ref_id" validate:"required"`
@@ -124,6 +145,8 @@ const (
TDNGC TemplateDocsName = "general-consent.html"
TDNCL TemplateDocsName = "control-letter.html"
TDNR TemplateDocsName = "resume.html"
TDNSA TemplateDocsName = "screening-form-a.html"
TDNSB TemplateDocsName = "screening-form-b.html"
)
func (v VclaimControlLetter) generateTemplateData() ControlLetterPDF {

Some files were not shown because too many files have changed in this diff Show More