This repository has been archived by the owner on Jul 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
patient_chart.go
80 lines (68 loc) · 3.69 KB
/
patient_chart.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
Copyright 2021 Kidus Tiliksew
This file is part of Tensor EMR.
Tensor EMR is free software: you can redistribute it and/or modify
it under the terms of the version 2 of GNU General Public License as published by
the Free Software Foundation.
Tensor EMR is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package models
import (
"time"
"gorm.io/gorm"
)
// PatientChart ...
type PatientChart struct {
gorm.Model
ID int `gorm:"primaryKey"`
AppointmentID int `json:"appointmentId"`
VitalSigns VitalSigns `json:"vitalSigns"`
PhysicalExamFindings []PhysicalExamFinding `json:"physicalExamFindings"`
PhysicalExamFindingNote *string `json:"physicalExamFindingNote"`
OpthalmologyExam OpthalmologyExam `json:"opthalmologyExam"`
SurgicalProcedure SurgicalProcedure `json:"surgicalProcedure"`
Treatment Treatment `json:"treatment"`
ChiefComplaints []ChiefComplaint `json:"chiefComplaints"`
ChiefComplaintsNote *string `json:"chiefComplaintNote"`
BloodPressure *string `json:"bloodPressure"`
HpiNote *string `json:"hpiNote"`
DiagnosisNote *string `json:"diagnosisNote"`
DifferentialDiagnosisNote *string `json:"differentialDiagnosisNote"`
RightSummarySketch *string `json:"rightSummarySketch"`
LeftSummarySketch *string `json:"leftSummarySketch"`
SummaryNote *string `json:"summaryNote"`
StickieNote *string `json:"stickieNote"`
MedicalRecommendation *string `json:"medicalRecommendation"`
SickLeave *string `json:"sickLeave"`
IllnessType *string `json:"illnessType"`
MedicalPrescriptionOrder MedicalPrescriptionOrder `json:"medicalPrescriptionOrder"`
EyewearPrescriptionOrder EyewearPrescriptionOrder `json:"eyewearPrescriptionOrder"`
DiagnosticProcedureOrder DiagnosticProcedureOrder `json:"diagnosticProcedureOrder"`
SurgicalOrder SurgicalOrder `json:"surgicalOrder"`
TreatmentOrder TreatmentOrder `json:"treatmentOrder"`
ReferralOrder ReferralOrder `json:"referralOrder"`
FollowUpOrder FollowUpOrder `json:"followUpOrder"`
LabOrder LabOrder `json:"labOrder"`
Diagnoses []PatientDiagnosis `json:"diagnoses"`
Locked *bool `json:"locked"`
LockedDate *time.Time `json:"lockedDate"`
LockedByID *int `json:"lockedById"`
LockedBy *User `json:"lockedBy"`
Amendments []Amendment `json:"amendments"`
OldPatientChartId int `json:"oldPatientChartId"`
}
// AfterCreate ...
func (r *PatientChart) AfterCreate(tx *gorm.DB) error {
if err := tx.Create(&VitalSigns{PatientChartID: r.ID}).Error; err != nil {
return err
}
if err := tx.Create(&OpthalmologyExam{PatientChartID: r.ID}).Error; err != nil {
return err
}
return nil
}