feat (encounter): update wip
This commit is contained in:
@@ -40,3 +40,40 @@ const (
|
||||
ICMedication InstructionCode = "medication" // Obat
|
||||
ICMaterial InstructionCode = "material" // BMHP
|
||||
)
|
||||
|
||||
type Soapi struct {
|
||||
// Subject
|
||||
PrimaryComplaint string `json:"pri-compl"`
|
||||
SecondaryComplaint string `json:"sec-compl"`
|
||||
CurrentDiseaseHistory string `json:"cur-disea-hist"`
|
||||
PastDiseaseHistory string `json:"pas-disea-hist"`
|
||||
FamilyDiseaseHistory string `json:"fam-disea-hist"`
|
||||
AllergyHistory string `json:"alg-hist"`
|
||||
AllergyReaction string `json:"alg-react"`
|
||||
MedicationHistory string `json:"med-hist"`
|
||||
|
||||
// Object
|
||||
ConsciousnessLevel string `json:"consc-level"`
|
||||
ConsciousnessLevelDet string `json:"consc-level-det"`
|
||||
SystolicBloodPressure string `json:"syst-bp"`
|
||||
DiastolicBloodPressure string `json:"diast-bp"`
|
||||
HeartRate string `json:"hear-rt"`
|
||||
Temperature string `json:"temp"`
|
||||
SpO2 string `json:"spo2"`
|
||||
Weight string `json:"weight"`
|
||||
Height string `json:"height"`
|
||||
|
||||
// Assessment
|
||||
EarlyDiagnosis string `json:"early-diag"`
|
||||
LateDiagnosis string `json:"late-diag"`
|
||||
SecondaryDiag string `json:"sec-diag"`
|
||||
|
||||
// Plan
|
||||
Plan string `json:"plan"`
|
||||
|
||||
// Instruction
|
||||
InstructionDetail string `json:"detail"`
|
||||
MedicalAction string `json:"med-act"`
|
||||
Medication string `json:"medication"`
|
||||
Material string `json:"material"`
|
||||
}
|
||||
|
||||
@@ -37,6 +37,15 @@ func setData[T *e.CreateDto | *e.UpdateDto](input T, data *e.Encounter) {
|
||||
data.Appointment_Id = inputSrc.Appointment_Id
|
||||
}
|
||||
|
||||
func setDataUpdate(src e.UpdateDto, dst *e.Encounter) {
|
||||
dst.Appointment_Doctor_Id = src.Appointment_Doctor_Id
|
||||
dst.Responsible_Doctor_Id = src.Responsible_Doctor_Id
|
||||
dst.Unit_Id = src.Unit_Id
|
||||
dst.Specialist_Id = src.Specialist_Id
|
||||
dst.Subspecialist_Id = src.Subspecialist_Id
|
||||
dst.VisitDate = src.VisitDate
|
||||
}
|
||||
|
||||
func setDataDischarge(src e.DischargeDto, dst *e.Encounter) {
|
||||
dst.DischargeMethod_Code = src.DischargeMethod_Code
|
||||
dst.EarlyEducation = src.EarlyEducation
|
||||
|
||||
@@ -108,7 +108,7 @@ func ReadDetailData(input e.ReadDetailDto, event *pl.Event, dbx ...*gorm.DB) (*e
|
||||
|
||||
func UpdateData(input e.UpdateDto, data *e.Encounter, event *pl.Event, dbx ...*gorm.DB) error {
|
||||
pl.SetLogInfo(event, data, "started", "DBUpdate")
|
||||
setData(&input, data)
|
||||
setDataUpdate(input, data)
|
||||
|
||||
var tx *gorm.DB
|
||||
if len(dbx) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user