diff --git a/assets/docs/resume.html b/assets/docs/resume.html index 8cdca672..db66314d 100644 --- a/assets/docs/resume.html +++ b/assets/docs/resume.html @@ -7,26 +7,40 @@ body { padding: 2rem 3rem; } + table { width: 100%; border-collapse: collapse } + td { vertical-align: top; } - .border-table, .border-table td, .border-table th { + + .border-table, + .border-table td, + .border-table th { border: 1px solid black; } - .section-title { + + .section-title { margin-top: 1rem; margin-bottom: 0rem; } - .data-label { + + .data-label { width: 9rem; } - .data-colon { - width: 0.1234rem; + + .data-colon { + width: 15px; padding-left: 10px; } + + .description-label { + font-size: 0.7rem; + margin: 0; + } + @@ -60,7 +74,7 @@
- +
: - {{ .Repalcable }} + {{ .MedicalRecord }} Ruang/Klinik : - {{ .Repalcable }} + {{ .Unit }} NIK : - {{ .Repalcable }} + {{ .NIK }} Kelas : - {{ .Repalcable }} + {{ .Class }} Nama : - {{ .Repalcable }} + {{ .Name }} DPJP : - {{ .Repalcable }} + {{ .Doctor_Name }} - + @@ -121,21 +135,21 @@ Tempat/Tanggal Lahir : - {{ .Repalcable }} + {{ .BirthPlaceDate }} Jenis Kelamin : - {{ .Repalcable }} + {{ .Gender }} No. Telepon : - {{ .Repalcable }} + {{ .Phone }} @@ -165,32 +179,33 @@ Tanggal Masuk : - {{ .Repalcable }} + {{ .StartedAt }} Tanggal Keluar : - {{ .Repalcable }} + {{ .FinishedAt }} Diagnosis Masuk : - {{ .Repalcable }} + {{ .DiagnosisIn }} Diagnosis Keluar : - {{ .Repalcable }} + {{ .DiagnosisOut }} - +
+ - - - - - - - - - - - - - - - - - - -
No @@ -205,31 +220,46 @@ Kode ICD-10
- 1 - {{ .Repalcable }}{{ .Repalcable }}{{ .Repalcable }}
- 2 - {{ .Repalcable }}{{ .Repalcable }}{{ .Repalcable }}
- 3 - {{ .Repalcable }}{{ .Repalcable }}{{ .Repalcable }}
+ + + {{ $dataLen := len .Diagnosis }} + {{ if gt $dataLen 0 }} + + {{ range $index, $diagnosis := .Diagnosis }} + + {{ if eq $index 0 }}1{{ else if eq $index 1 }}2{{ else if eq $index 2 }}3{{ else if eq $index 3 }}4{{ else if eq $index 4 }}5{{ else }}{{ $index }}{{ end }} + {{ $diagnosis.DiagnosisName }} + {{ $diagnosis.Basis }} + {{ $diagnosis.ICD10 }} + + {{ end }} + + + {{ if eq $dataLen 1 }} + + 2 + + + + + {{ end }} + {{ else }} + + + 1 + + + + + + 2 + + + + + {{ end }} + + @@ -237,50 +267,54 @@ -

Kajian Awal Medis

+

Kajian Awal Medis

(Diisi oleh Dokter Penanggung Jawab Pelayanan)

- + ">(Diisi oleh Dokter Penanggung Jawab Pelayanan)

+ - + - + - +
Keluhan Utama : {{ .Repalcable }}{{ .MainComplaint }}
Riwayat Penyakit : {{ .Repalcable }}{{ .MedicalHistory }}
Pemeriksaan Fisik & Keadaan Umum : {{ .Repalcable }}{{ .PhysicalExamination }}
-

Pemeriksaan Penunjang

+

Pemeriksaan Penunjang

- +
Pemeriksaan : {{ .Repalcable }}{{ .SupportingExamination }}
-

Tindakan Medis

- +
+ + +

Tindakan Medis

+ + - - - - - - - - - - - - - - - - - - -
No @@ -295,31 +329,47 @@ Kode ICD 9-CM
- 1 - {{ .Repalcable }}{{ .Repalcable }}{{ .Repalcable }}
- 2 - {{ .Repalcable }}{{ .Repalcable }}{{ .Repalcable }}
- 3 - {{ .Repalcable }}{{ .Repalcable }}{{ .Repalcable }}
+ + + {{ $dataLen := len .MedicalActions }} + {{ if gt $dataLen 0 }} + + {{ range $index, $action := .MedicalActions }} + + {{ if eq $index 0 }}1{{ else if eq $index 1 }}2{{ else if eq $index 2 }}3{{ else if eq $index 3 }}4{{ else if eq $index 4 }}5{{ else }}{{ $index }}{{ end }} + {{ $action.Action }} + {{ $action.Basis }} + {{ $action.ICD9 }} + + {{ end }} + + + {{ if eq $dataLen 1 }} + + 2 + + + + + {{ end }} + {{ else }} + + + 1 + + + + + + 2 + + + + + {{ end }} + + + @@ -327,51 +377,53 @@ Tindakan Medis - +
: {{ .Repalcable }}{{ .MedicalAction }}
+ + +
+

Konsultasi

+
+ + + + + + + + + + {{ $dataLen := len .Consultations }} + {{ if gt $dataLen 0 }} + + {{ range $index, $consultation := .Consultations }} + + + + + + {{ end }} + + + {{ if eq $dataLen 1 }} + + {{ end }} + {{ else }} + + + + {{ end }} + +
NoKonsultasiJawaban Konsultasi
{{ if eq $index 0 }}1{{ else if eq $index 1 }}2{{ else if eq $index 2 }}3{{ else if eq $index 3 }}4{{ else if eq $index 4 }}5{{ else }}{{ $index }}{{ end }}{{ $consultation.Consultation }}{{ $consultation.ConsultationAnswer }}
2
1
2
+ + -

Konsultasi

- - - - - - - - - - - - - - - - - - - - - -
- No - - Konsultasi - - Jawaban Konsultasi -
- 1 - {{ .Repalcable }}{{ .Repalcable }}
- 2 - {{ .Repalcable }}{{ .Repalcable }}
- 3 - {{ .Repalcable }}{{ .Repalcable }}
- -

Terapi

+

Terapi

@@ -379,54 +431,241 @@ : - Replace + {{ .Allergy}}
- -

Obat yang diberikan

- +
- - - - - - - - - - - - - - + +
- Terapi (Farmakologi & Non Farmakologi) Selawa Perawatan - - Terapi (Farmakologi & Non Farmakologi) Selawa Pulang -
{{ .Repalcable }}{{ .Repalcable }}
{{ .Repalcable }}{{ .Repalcable }}
{{ .Repalcable }}{{ .Repalcable }} +

Obat yang diberikan

+ + + + + + + + + + + + + + + + + +
+ Terapi (Farmakologi & Non Farmakologi) Selawa Perawatan + + Terapi (Farmakologi & Non Farmakologi) Selawa Pulang +
{{ .NIK }}{{ .NIK }}
{{ .NIK }}{{ .NIK }}
{{ .NIK }}{{ .NIK }}
+
+ -

Kondisi saat Pulang

+

Kondisi saat Pulang

- + - + + + + + + + + + + + + + + + + + + + + +
- Keluhan Utama - Kesadaran : {{ .Repalcable }}{{ .ConsciousnessLevel }}
+ Tanda Vital +

Vital sign

+
:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ Tekanan Darah +

Blood Pressure

+
: {{ .BloodPressure }} mmHg +
+ Suhu +

Temperatur

+
: {{ .BodyTemperature }} C +
+ Nadi +

Pulse

+
: {{ .HeartRate }} x/Menit
+
+ + + + + + + + + + + + + + +
+ Frekuensi Nafas +

Respiratory rate

+
: {{ .RespirationRate }}
+ Skala Nyeri +

Pain Scale

+
: {{ .PainScale }}
+
+ +
Keadaan Keluar: {{ .ConditionOnDischarge }}
Cara Keluar +

Patient discharge of hospital

+
:{{ .DischargeMethod }}
+ + + + + + + + + + + + + + + + + + + + + + + +
+

INSTRUKSI UNTUK TINDAK LANJUT

+

Follow up Consultation to

+
+

Kontrol Ke

+

Follow up Consultation to

+
+ + + + + + + + + + + + + + + + +
Fasyankes: {{ .NIK }}
Tanggal: {{ .NIK }}
Klinik: {{ .NIK }}
+
+

Dalam keadaan darurat dapat menghubungi

+

In case of emergencycontact

+
+

IGD

+

(Accident & Emergency Instalation)

+
+ + + + + + +
Telepon +

Phone

+
: (0341) 362101
+
+

EDUKASI & RENCANA TINDAK LANJUT

+

Follow up plan (if necessary)

+
+

+

(bila diperlukan)

+
+ + + + + + + + + + + + + +
+ Malang, {{ .Date }}
+ Dokter Penanggung Jawab Pelayanan +
+ ({{ .Doctor_Name }}) +
+
+

*) Data dapat berubah setelah pasien pulang sesuai prosedur

+ \ No newline at end of file diff --git a/internal/domain/main-entities/resume/dto.go b/internal/domain/main-entities/resume/dto.go index 884b8e32..76e959e5 100644 --- a/internal/domain/main-entities/resume/dto.go +++ b/internal/domain/main-entities/resume/dto.go @@ -96,7 +96,7 @@ type Assessment struct { StartedAt *time.Time `json:"startedAt` FinishedAt *time.Time `json:"finishedAt` Doctor_Code string `json:"doctor_code` - DiagnosisIn string `json:"diagnosesIn` + DiagnosisIn string `json:"diagnosisIn` AmbulatoryIndication string `json:"ambulatoryIndication"` MainComplaint string `json:"mainComplaint"` PhysicalExamination string `json:"physicalExamination"` @@ -106,13 +106,13 @@ type Assessment struct { type Diagnosis struct { PrimaryDiagnosis DiagnosisEntry `json:"primaryDiagnosis"` - SecondaryDiagnoses []DiagnosisEntry `json:"secondaryDiagnoses"` + SecondaryDiagnosis []DiagnosisEntry `json:"secondaryDiagnosis"` } type DiagnosisEntry struct { - Diagnosis string `json:"diagnosis"` - ICD10 string `json:"icd_10"` - Basis string `json:"basis"` // Clinical basis of diagnosis / dasar diagnosa + DiagnosisName string `json:"diagnosis"` + ICD10 string `json:"icd_10"` + Basis string `json:"basis"` // Clinical basis of diagnosis / dasar diagnosa } type Action struct { diff --git a/internal/interface/main-handler/resume/handler.go b/internal/interface/main-handler/resume/handler.go index 5574bc7a..9a59f5fd 100644 --- a/internal/interface/main-handler/resume/handler.go +++ b/internal/interface/main-handler/resume/handler.go @@ -52,6 +52,10 @@ func GetDetail(w http.ResponseWriter, r *http.Request) { } func Update(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) + } id := rw.ValidateInt(w, "id", r.PathValue("id")) if id <= 0 { return @@ -62,11 +66,16 @@ func Update(w http.ResponseWriter, r *http.Request) { return } dto.Id = uint(id) + dto.AuthInfo = *authInfo res, err := u.Update(dto) rw.DataResponse(w, res, err) } func Delete(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) + } id := rw.ValidateInt(w, "id", r.PathValue("id")) if id <= 0 { return @@ -74,6 +83,7 @@ func Delete(w http.ResponseWriter, r *http.Request) { dto := e.DeleteDto{} dto.Id = uint(id) + dto.AuthInfo = *authInfo res, err := u.Delete(dto) rw.DataResponse(w, res, err) } diff --git a/internal/use-case/main-use-case/generate-file/helper.go b/internal/use-case/main-use-case/generate-file/helper.go index e42fc13e..02800c3a 100644 --- a/internal/use-case/main-use-case/generate-file/helper.go +++ b/internal/use-case/main-use-case/generate-file/helper.go @@ -250,8 +250,28 @@ func generateResume(input GenerateDto, event pl.Event, tx *gorm.DB) (*ResponseDt } } + templateData, err := generateResumeTemplateData(*r, event, tx) + if err != nil { + return nil, err + } + + input.FormatType = erc.DFTCPDF + input.TemplateName = TDNR + input.Encounter_Id = r.Encounter_Id + + // generate file + urlPub, err := generateFile(input, templateData) + if err != nil { + return nil, err + } + + r.FileUrl = &urlPub + if err := tx.Save(&r).Error; err != nil { + return nil, err + } + response := ResponseDto{ - FileUrl: "", + FileUrl: urlPub, } return &response, nil @@ -264,7 +284,6 @@ func generateResumeTemplateData(resume er.Resume, event pl.Event, tx *gorm.DB) ( if err != nil { return nil, err } - fmt.Println(encounter) // map template data rData := er.ValueDto{} @@ -293,6 +312,24 @@ func generateResumeTemplateData(resume er.Resume, event pl.Event, tx *gorm.DB) ( templateData.Doctor_Name = resume.Doctor.Employee.Person.FullName() templateData.StartedAt = *pc.TimeToStringWithFormat(encounter.StartedAt, "") templateData.FinishedAt = *pc.TimeToStringWithFormat(encounter.FinishedAt, "") + templateData.DiagnosisIn = rData.Assessment.DiagnosisIn + templateData.Diagnosis = rData.Diagnosis.SecondaryDiagnosis + templateData.MainComplaint = rData.Assessment.MainComplaint + templateData.MedicalHistory = rData.Assessment.MedicalHistory + templateData.PhysicalExamination = rData.Assessment.PhysicalExamination + templateData.SupportingExamination = rData.Supporting.Notes + templateData.MedicalActions = rData.Action.AdditionalActions + templateData.MedicalAction = rData.Action.MedicalActions + templateData.Consultations = rData.Consultation.Consultations + templateData.Allergy = rData.Pharmacy.AllergySpecialConditions + templateData.ConsciousnessLevel = rData.Discharge.ConsciousnessLevel + templateData.BloodPressure = fmt.Sprintf("%.0f/%.0f", rData.Discharge.BloodPressureSystolic, rData.Discharge.BloodPressureDiastolic) + templateData.BodyTemperature = rData.Discharge.BodyTemperature + templateData.RespirationRate = rData.Discharge.RespirationRate + templateData.HeartRate = rData.Discharge.HeartRate + templateData.PainScale = rData.Discharge.PainScale + templateData.ConditionOnDischarge = rData.Management.ConditionOnDischarge + templateData.DischargeMethod = rData.Management.DischargeMethod return &templateData, nil } diff --git a/internal/use-case/main-use-case/generate-file/tycovar.go b/internal/use-case/main-use-case/generate-file/tycovar.go index 1dee32ff..d1d1ed6a 100644 --- a/internal/use-case/main-use-case/generate-file/tycovar.go +++ b/internal/use-case/main-use-case/generate-file/tycovar.go @@ -57,6 +57,18 @@ type ResumePDF struct { MedicalAction string Consultations []er.ConsultationEntry Allergy string + ConsciousnessLevel string + BloodPressure string + BodyTemperature float64 + RespirationRate float64 + HeartRate float64 + PainScale int + ConditionOnDischarge string + DischargeMethod string + // fasyankes + // date + // klinik + Date string } type GenerateDto struct { @@ -110,6 +122,7 @@ type TemplateDocsName string const ( TDNGC TemplateDocsName = "general-consent.html" TDNCL TemplateDocsName = "control-letter.html" + TDNR TemplateDocsName = "resume.html" ) func (v VclaimControlLetter) generateTemplateData() ControlLetterPDF {