import cycle found
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
ea "simrs-vx/internal/domain/main-entities/appointment"
|
||||
ed "simrs-vx/internal/domain/main-entities/doctor"
|
||||
ee "simrs-vx/internal/domain/main-entities/employee"
|
||||
eir "simrs-vx/internal/domain/main-entities/internal-reference"
|
||||
ep "simrs-vx/internal/domain/main-entities/patient"
|
||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||
ess "simrs-vx/internal/domain/main-entities/subspecialist"
|
||||
@@ -100,6 +101,8 @@ type DischargeDto struct {
|
||||
MedicalDischargeEducation *string `json:"medicalDischargeEducation"`
|
||||
AdmDischargeEducation *string `json:"admDischargeEducation"`
|
||||
DischargeReason *string `json:"dischargeReason"`
|
||||
DeathCause *string `json:"deathCause"`
|
||||
InternalReferences *[]eir.CreateDto `json:"internalReferences,omitempty"`
|
||||
}
|
||||
|
||||
type ResponseDto struct {
|
||||
|
||||
@@ -3,12 +3,11 @@ package internal_reference
|
||||
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"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter_Id *uint `json:"-"`
|
||||
Unit_Id *uint16 `json:"unit_id"`
|
||||
Doctor_Id *uint `json:"doctor_Id"`
|
||||
}
|
||||
@@ -47,18 +46,16 @@ type MetaDto struct {
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||
Unit_Id *uint16 `json:"unit_id"`
|
||||
Unit *eu.Unit `json:"unit,omitempty"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty"`
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Unit_Id *uint16 `json:"unit_id"`
|
||||
Unit *eu.Unit `json:"unit,omitempty"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty"`
|
||||
}
|
||||
|
||||
func (d InternalReference) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Encounter: d.Encounter,
|
||||
Unit_Id: d.Unit_Id,
|
||||
Unit: d.Unit,
|
||||
Doctor_Id: d.Doctor_Id,
|
||||
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
u "simrs-vx/internal/use-case/main-use-case/encounter"
|
||||
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
|
||||
pa "simrs-vx/pkg/auth-helper"
|
||||
|
||||
@@ -88,9 +89,14 @@ func (obj myBase) CheckOut(w http.ResponseWriter, r *http.Request) {
|
||||
if id <= 0 {
|
||||
return
|
||||
}
|
||||
|
||||
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
|
||||
return
|
||||
}
|
||||
|
||||
// validate request body
|
||||
if dto.DischargeMethod_Code == ere.
|
||||
|
||||
dto.Id = uint(id)
|
||||
res, err := u.CheckOut(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
|
||||
Reference in New Issue
Block a user