feat (resume): add verify and validate, base value structure
This commit is contained in:
No files matched your search
@@ -82,3 +82,10 @@ type Encounter struct {
|
||||
func (d Encounter) IsDone() bool {
|
||||
return d.Status_Code == erc.DSCDone
|
||||
}
|
||||
|
||||
func (d Encounter) IsSameResponsibleDoctor(input *string) bool {
|
||||
if input == nil {
|
||||
return false
|
||||
}
|
||||
return d.Responsible_Doctor_Code == input
|
||||
}
|
||||
@@ -2,11 +2,19 @@ package resume
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
"time"
|
||||
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
|
||||
pa "simrs-vx/internal/lib/auth"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Value *string `json:"value"`
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Value *string `json:"value"`
|
||||
Status_Code erc.DataVerifiedCode `json:"status_code"`
|
||||
|
||||
pa.AuthInfo
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
@@ -16,7 +24,8 @@ type ReadListDto struct {
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Encounter_Id *uint `json:"encounter-id"`
|
||||
Encounter_Id *uint `json:"encounter-id"`
|
||||
Doctor_Code *string `json:"doctor-code"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
@@ -30,6 +39,8 @@ type UpdateDto struct {
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint `json:"id"`
|
||||
|
||||
pa.AuthInfo
|
||||
}
|
||||
|
||||
type MetaDto struct {
|
||||
@@ -40,16 +51,20 @@ type MetaDto struct {
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Value *string `json:"value"`
|
||||
FileUrl *string `json:"fileUrl"`
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Doctor_Code *string `json:"doctor_code"`
|
||||
Value *string `json:"value"`
|
||||
FileUrl *string `json:"fileUrl"`
|
||||
Status_Code erc.DataVerifiedCode `json:"status_code"`
|
||||
}
|
||||
|
||||
func (d Resume) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Doctor_Code: d.Doctor_Code,
|
||||
Value: d.Value,
|
||||
FileUrl: d.FileUrl,
|
||||
Status_Code: d.Status_Code,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
@@ -62,3 +77,95 @@ func ToResponseList(data []Resume) []ResponseDto {
|
||||
}
|
||||
return resp
|
||||
}
|
||||
|
||||
// ValueDto is for resume value
|
||||
type ValueDto struct {
|
||||
Assessment Assessment `json:"assessment"`
|
||||
Diagnosis Diagnosis `json:"diagnosis"`
|
||||
Action Action `json:"action"`
|
||||
Consultation Consultation `json:"consultation"`
|
||||
Supporting SupportingExaminations `json:"supporting"`
|
||||
Pharmacy PharmacyData `json:"pharmacy"`
|
||||
Discharge DischargeCondition `json:"discharge"`
|
||||
National NationalProgram `json:"national"`
|
||||
Management Management `json:"management"`
|
||||
}
|
||||
|
||||
type Assessment struct {
|
||||
StartedAt *time.Time `json:"startedAt`
|
||||
FinishedAt *time.Time `json:"finishedAt`
|
||||
Doctor_Code string `json:"doctor_code`
|
||||
DiagnosisIn string `json:"diagnosesIn`
|
||||
AmbulatoryIndication string `json:"ambulatoryIndication"`
|
||||
MainComplaint string `json:"mainComplaint"`
|
||||
PhysicalExamination string `json:"physicalExamination"`
|
||||
MedicalHistory string `json:"medicalHistory"`
|
||||
MedicalDiagnosis string `json:"medicalDiagnosis"`
|
||||
}
|
||||
|
||||
type Diagnosis struct {
|
||||
PrimaryDiagnosis DiagnosisEntry `json:"primaryDiagnosis"`
|
||||
SecondaryDiagnoses []DiagnosisEntry `json:"secondaryDiagnoses"`
|
||||
}
|
||||
|
||||
type DiagnosisEntry struct {
|
||||
Diagnosis string `json:"diagnosis"`
|
||||
ICD10 string `json:"icd_10"`
|
||||
Basis string `json:"basis"` // Clinical basis of diagnosis / dasar diagnosa
|
||||
}
|
||||
|
||||
type Action struct {
|
||||
PrimaryAction ActionEntry `json:"primaryAction"`
|
||||
AdditionalActions []ActionEntry `json:"additionalActions"`
|
||||
MedicalActions string `json:"medicalActions"` // free-text: "Tindakan Medis"
|
||||
}
|
||||
|
||||
type ActionEntry struct {
|
||||
Action string `json:"action"` // Tindakan
|
||||
ICD9 string `json:"icd_9"` // ICD-9
|
||||
Basis string `json:"basis"` // Dasar Tindakan
|
||||
}
|
||||
|
||||
type Consultation struct {
|
||||
Consultations []ConsultationEntry `json:"consultations"`
|
||||
}
|
||||
|
||||
type ConsultationEntry struct {
|
||||
Consultation string `json:"consultation"` // Konsultasi
|
||||
ConsultationAnswer string `json:"consultationAnswer"` // Jawaban Konsultasi
|
||||
}
|
||||
|
||||
type SupportingExaminations struct {
|
||||
Notes string `json:"notes"` // Free-text list of lab/imaging results
|
||||
}
|
||||
|
||||
type PharmacyData struct {
|
||||
AllergySpecialConditions string `json:"allergySpecialConditions"` // Kelainan Khusus Alergi
|
||||
OtherConditions string `json:"otherConditions"` // Kelainan Lain
|
||||
TherapyDuringCare string `json:"therapyDuringCare"` // Terapi selama dirawat
|
||||
TherapyAtDischarge string `json:"therapyAtDischarge"` // Terapi waktu pulang
|
||||
FollowUpInstructions string `json:"followUpInstructions"` // Edukasi / Anjuran / Follow-up
|
||||
}
|
||||
|
||||
type DischargeCondition struct {
|
||||
BloodPressureSystolic float64 `json:"bloodPressureSystolic"` // Tekanan Darah Sistol (mmHg)
|
||||
BloodPressureDiastolic float64 `json:"bloodPressureDiastolic"` // Tekanan Darah Diastol (mmHg)
|
||||
RespirationRate float64 `json:"respirationRate"` // Pernafasan (kali/menit)
|
||||
HeartRate float64 `json:"heartRate"` // Denyut Jantung (kali/menit)
|
||||
BodyTemperature float64 `json:"bodyTemperature"` // Suhu Tubuh (°C)
|
||||
|
||||
ConsciousnessLevel string `json:"consciousnessLevel"` // Tingkat Kesadaran
|
||||
PainScale int `json:"painScale"` // Skala Nyeri (0–10)
|
||||
}
|
||||
|
||||
type NationalProgram struct {
|
||||
ProgramService string `json:"programService"` // e.g. "Antenatal Care"
|
||||
ProgramServiceStatus string `json:"programServiceStatus"` // e.g. "Suspected"
|
||||
}
|
||||
|
||||
type Management struct {
|
||||
NationalProgramService string `json:"nationalProgramService"` // e.g. selected program
|
||||
FollowUpManagement string `json:"followUpManagement"` // e.g. further management plan
|
||||
ConditionOnDischarge string `json:"conditionOnDischarge"` // e.g. "Stable"
|
||||
DischargeMethod string `json:"dischargeMethod"` // e.g. "Discharged with Doctor's Approval"
|
||||
}
|
||||
@@ -16,3 +16,15 @@ type Resume struct {
|
||||
FileUrl *string `json:"fileUrl" gorm:"size:1024"`
|
||||
Status_Code erc.DataVerifiedCode `json:"status_code" gorm:"not null;size:10"`
|
||||
}
|
||||
|
||||
func (d Resume) IsNew() bool {
|
||||
return d.Status_Code == erc.DVCNew
|
||||
}
|
||||
|
||||
func (d Resume) IsVerified() bool {
|
||||
return d.Status_Code == erc.DVCVerified
|
||||
}
|
||||
|
||||
func (d Resume) IsValidated() bool {
|
||||
return d.Status_Code == erc.DVCValidated
|
||||
}
|
||||
Reference in New Issue
Block a user