142 lines
4.1 KiB
Go
142 lines
4.1 KiB
Go
package generatefile
|
|
|
|
import (
|
|
evscl "simrs-vx/internal/domain/bpjs-entities/vclaim-sep-control-letter"
|
|
erc "simrs-vx/internal/domain/references/common"
|
|
ere "simrs-vx/internal/domain/references/encounter"
|
|
|
|
er "simrs-vx/internal/domain/main-entities/resume"
|
|
)
|
|
|
|
type GeneralConsentPDF struct {
|
|
Relatives []string `json:"relatives"`
|
|
Responsible string `json:"responsible"`
|
|
Informant string `json:"informant"`
|
|
Witness1 string `json:"witness1"`
|
|
Witness2 string `json:"witness2"`
|
|
Date string `json:"date"`
|
|
}
|
|
|
|
type ControlLetterPDF struct {
|
|
Number string
|
|
Doctor_Name string
|
|
DstUnit_Name string
|
|
CardNumber string
|
|
Name string
|
|
BirthDate string
|
|
Diagnose string
|
|
PlanDate string
|
|
ResponsibleDoctor_Name string
|
|
PrintDate string
|
|
}
|
|
|
|
type ResumePDF struct {
|
|
MedicalRecord string
|
|
NIK string
|
|
Name string
|
|
BirthPlaceDate string
|
|
Gender string
|
|
Phone string
|
|
Class string
|
|
Unit string
|
|
Doctor_Name string
|
|
StartedAt string
|
|
FinishedAt string
|
|
DiagnosisIn string
|
|
DiagnosisOut string
|
|
Diagnosis []er.DiagnosisEntry
|
|
MainComplaint string
|
|
MedicalHistory string
|
|
PhysicalExamination string
|
|
SupportingExamination string
|
|
MedicalActions []er.ActionEntry
|
|
MedicalAction string
|
|
Consultations []er.ConsultationEntry
|
|
Allergy string
|
|
ConsciousnessLevel string
|
|
BloodPressure string
|
|
BodyTemperature float64
|
|
RespirationRate float64
|
|
HeartRate float64
|
|
PainScale int
|
|
ConditionOnDischarge string
|
|
DischargeMethod string
|
|
Medications []er.MedicationEntry
|
|
ControlHealthcare string
|
|
ControlUnit string
|
|
ControlDate string
|
|
Date string
|
|
RssaLogo string
|
|
JatimLogo 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"`
|
|
Type_Code ere.DocTypeCode `json:"type_code" validate:"required"`
|
|
FormatType erc.DocFormatTypeCode `json:"formatType"`
|
|
TemplateName TemplateDocsName `json:"-"`
|
|
Encounter_Id *uint `json:"-"`
|
|
UseA5Lanscape bool `json:"-"`
|
|
|
|
Data *string `json:"data"`
|
|
}
|
|
|
|
type GeneratePDFdto struct {
|
|
TemplatePath string
|
|
TemplateData any
|
|
PdfPath string
|
|
UseA5Lanscape bool
|
|
}
|
|
|
|
type ResponseDto struct {
|
|
FileUrl string `json:"fileUrl"`
|
|
}
|
|
|
|
type TemplateDocsName string
|
|
|
|
// TemplateDocsName is the name of the template file in the assets/docs folder
|
|
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 generateTemplateData(v evscl.ResponseForPDF) ControlLetterPDF {
|
|
return ControlLetterPDF{
|
|
Number: v.Number,
|
|
Doctor_Name: v.Doctor_Name,
|
|
DstUnit_Name: v.DstUnit_Name,
|
|
CardNumber: v.VclaimSep.VclaimMember.CardNumber,
|
|
Name: v.GenerateNameWithGender(),
|
|
BirthDate: v.GenerateBirthDate(),
|
|
Diagnose: v.VclaimSep.Diagnose,
|
|
PlanDate: v.PlannedControlDate,
|
|
ResponsibleDoctor_Name: v.ResponsibleDoctor_Name,
|
|
PrintDate: v.IssuedDate,
|
|
}
|
|
}
|