prescription ids into codes
This commit is contained in:
@@ -14,7 +14,7 @@ import (
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Doctor_Code *string `json:"doctor_code"`
|
||||
IssuedAt *time.Time `json:"issuedAt"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
|
||||
@@ -29,7 +29,7 @@ type ReadListDto struct {
|
||||
|
||||
type FilterDto struct {
|
||||
Encounter_Id *uint `json:"encounter-id"`
|
||||
Doctor_Id *uint `json:"doctor-id"`
|
||||
Doctor_Code *string `json:"doctor-code"`
|
||||
IssuedAt *time.Time `json:"issuedAt"`
|
||||
Status_Code *erc.DataStatusCode `json:"status-code"`
|
||||
}
|
||||
@@ -58,7 +58,7 @@ type ResponseDto struct {
|
||||
ecore.Main
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Doctor_Code *string `json:"doctor_code"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty"`
|
||||
IssuedAt *time.Time `json:"issuedAt"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
@@ -68,7 +68,7 @@ func (d Prescription) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Encounter: d.Encounter,
|
||||
Doctor_Id: d.Doctor_Id,
|
||||
Doctor_Code: d.Doctor_Code,
|
||||
Doctor: d.Doctor,
|
||||
IssuedAt: d.IssuedAt,
|
||||
Status_Code: d.Status_Code,
|
||||
|
||||
@@ -14,9 +14,8 @@ type Prescription struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Doctor_Code *string `json:"doctor_code" gorm:"size:20"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Id;references:Id"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"`
|
||||
IssuedAt *time.Time `json:"issuedAt"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ func setData[T *e.CreateDto | *e.UpdateDto](input T, data *e.Prescription) {
|
||||
}
|
||||
|
||||
data.Encounter_Id = inputSrc.Encounter_Id
|
||||
// data.Doctor_Id = inputSrc.Doctor_Id
|
||||
data.Doctor_Code = inputSrc.AuthInfo.Doctor_Code
|
||||
data.IssuedAt = inputSrc.IssuedAt
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user