Skip to content

Commit 5729dc1

Browse files
willfitzeFuerback
andauthored
Changes to visit note and bill request structs (#42)
* Changes to visit note and bill request structs WIP * Removed updated at from bullets and fix unit tests * Fix Bill mapping fields --------- Co-authored-by: Felipe Fuerback <[email protected]>
1 parent 3a88706 commit 5729dc1

File tree

4 files changed

+91
-90
lines changed

4 files changed

+91
-90
lines changed

bill.go

Lines changed: 49 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -21,58 +21,61 @@ type BillService struct {
2121
}
2222

2323
type Bill struct {
24-
ID int64 `json:"id"` //: 65099661468,
25-
RefNumber *string `json:"ref_number"` //: null, // string(50). required for PATCH that marks bill as processed.
26-
ServiceDate time.Time `json:"service_date"` //: "2016-10-12T12:00:00Z",
27-
BillingDate *time.Time `json:"billing_date"` //: null, // datetime(iso8601). required for PATCH that marks bill as processed.
28-
BillingStatus string `json:"billing_status"` //: "Unbilled",
29-
BillingError *string `json:"billing_error"` //: null, // string(200). required for PATCH that marks bill as failed.
30-
BillingRawError *string `json:"billing_raw_error"` //: null, // longtext. optional for PATCH that marks bill as failed.
31-
Notes string `json:"notes"` //: "patient has not paid yet",
32-
CPTs []*BillCPT `json:"cpts"` //: [{}],
33-
Payment *BillPayment `json:"payment"` //: {},
34-
VisitNoteID int64 `json:"visit_note_id"` //: 64409108504,
35-
VisitNoteSignedDate time.Time `json:"visit_note_signed_date"` //: "2016-10-12T22:11:01Z",
36-
VisitNoteDeletedDate *time.Time `json:"visit_note_deleted_date"` //: null,
37-
ReferringProvider *BillProvider `json:"referring_provider"` //: {},
38-
BillingProvider int64 `json:"billing_provider"` //: 42120898,
39-
RenderingProvider int64 `json:"rendering_provider"` //: 68382673,
40-
SupervisingProvider int64 `json:"supervising_provider"` //: 52893234,
41-
OrderingProvider *BillProvider `json:"ordering_provider"` //: {}
42-
ServiceLocation *BillServiceLocation `json:"service_location"` //: {}
43-
Physician int64 `json:"physician"` //: 64811630594,
44-
Practice int64 `json:"practice"` //: 65540,
45-
Patient int64 `json:"patient"` //: 64901939201,
46-
PriorAuthorization string `json:"prior_authorization"` //: "1234-ABC",
47-
Metadata any `json:"metadata"` //: null,
48-
CreatedDate time.Time `json:"created_date"` //: "2016-05-23T17:50:50Z",
49-
LastModifiedDate time.Time `json:"last_modified_date"` //: "2016-10-12T22:39:46Z"
24+
ID int64 `json:"id"` //: 65099661468,
25+
RefNumber *string `json:"ref_number"` //: null, // string(50). required for PATCH that marks bill as processed.
26+
ServiceDate time.Time `json:"service_date"` //: "2016-10-12T12:00:00Z",
27+
BillingDate *time.Time `json:"billing_date"` //: null, // datetime(iso8601). required for PATCH that marks bill as processed.
28+
BillingStatus string `json:"billing_status"` //: "Unbilled",
29+
BillingError *string `json:"billing_error"` //: null, // string(200). required for PATCH that marks bill as failed.
30+
BillingRawError *string `json:"billing_raw_error"` //: null, // longtext. optional for PATCH that marks bill as failed.
31+
Notes string `json:"notes"` //: "patient has not paid yet",
32+
CPTs []*BillCPT `json:"cpts"` //: [{}],
33+
Payment int64 `json:"payment"` //: 142502884606313,
34+
VisitNote int64 `json:"visit_note"` //: 64409108504,
35+
VisitNoteSignedDate time.Time `json:"visit_note_signed_date"` //: "2016-10-12T22:11:01Z",
36+
VisitNoteDeletedDate *time.Time `json:"visit_note_deleted_date"` //: null,
37+
ReferringProvider *BillProvider `json:"referring_provider"` //: {},
38+
BillingProvider *int64 `json:"billing_provider"` //: 42120898,
39+
RenderingProvider *int64 `json:"rendering_provider"` //: 68382673,
40+
SupervisingProvider *int64 `json:"supervising_provider"` //: 52893234,
41+
OrderingProvider *BillProvider `json:"ordering_provider"` //: {}
42+
ServiceLocation int64 `json:"service_location"` //: 141103949480183,
43+
Physician int64 `json:"physician"` //: 64811630594,
44+
Practice int64 `json:"practice"` //: 65540,
45+
Patient int64 `json:"patient"` //: 64901939201,
46+
PriorAuthorization *string `json:"prior_authorization"` //: "1234-ABC",
47+
Metadata any `json:"metadata"` //: null,
48+
CreatedDate time.Time `json:"created_date"` //: "2016-05-23T17:50:50Z",
49+
LastModifiedDate time.Time `json:"last_modified_date"` //: "2016-10-12T22:39:46Z"
5050
}
5151

5252
type BillCreate struct {
53-
ServiceLocation int64 `json:"service_location"` //: 10 // required
54-
VisitNoteID int64 `json:"visit_note_id"` //: 64409108504, // required
55-
Patient int64 `json:"patient"` //: 64901939201, // required
56-
Practice int64 `json:"practice"` //: 65540, // required
57-
Physician int64 `json:"physician"` //: 64811630594, // required
58-
CPTs []*BillCPT `json:"cpts"` //: [{}],
59-
BillingProvider int64 `json:"billing_provider"` //: 42120898,
60-
RenderingProvider int64 `json:"rendering_provider"` //: 68382673,
61-
SupervisingProvider int64 `json:"supervising_provider"` //: 52893234,
62-
ReferringProvider *BillProvider `json:"referring_provider"` //: {},
63-
OrderingProvider *BillProvider `json:"ordering_provider"` //: {},
64-
PriorAuthorization string `json:"prior_authorization"` //: "1234-ABC",
65-
PaymentAmount float64 `json:"payment_amount"` //: 10.00,
66-
Notes string `json:"notes"` //: "patient has not paid yet",
53+
ServiceLocation int64 `json:"service_location"` //: 10 // required
54+
VisitNote int64 `json:"visit_note"` //: 64409108504, // required
55+
Patient int64 `json:"patient"` //: 64901939201, // required
56+
Practice int64 `json:"practice"` //: 65540, // required
57+
Physician int64 `json:"physician"` //: 64811630594, // required
58+
CPTs []*BillCPT `json:"cpts,omitempty"` //: [{}],
59+
BillingProvider int64 `json:"billing_provider,omitempty"` //: 42120898,
60+
RenderingProvider int64 `json:"rendering_provider,omitempty"` //: 68382673,
61+
SupervisingProvider int64 `json:"supervising_provider,omitempty"` //: 52893234,
62+
ReferringProvider *BillProvider `json:"referring_provider,omitempty"` //: {},
63+
OrderingProvider *BillProvider `json:"ordering_provider,omitempty"` //: {},
64+
PriorAuthorization string `json:"prior_authorization,omitempty"` //: "1234-ABC",
65+
PaymentAmount float64 `json:"payment_amount,omitempty"` //: 10.00,
66+
Notes string `json:"notes,omitempty"` //: "patient has not paid yet",
6767
}
6868

69+
type BillDX struct {
70+
ICD10Code string `json:"icd10_code"`
71+
}
6972
type BillCPT struct {
70-
CPT int64 `json:"cpt"` //: "99213",
71-
Modifiers []string `json:"modifiers"` //: ["10"],
72-
DXs []string `json:"dxs"` //: ["D23.4"],
73-
AltDXs []string `json:"alt_dxs"` //: ["216.4"],
74-
UnitCharge any `json:"unit_charge"` //: null,
75-
Units any `json:"units"` //: null
73+
CPT string `json:"cpt"` //: "99213",
74+
Modifiers []string `json:"modifiers,omitempty"` //: ["10"],
75+
DXs []BillDX `json:"dxs"` //: ["D23.4"],
76+
AltDXs []string `json:"alt_dxs,omitempty"` //: ["216.4"],
77+
UnitCharge string `json:"unit_charge"` //: "10.0",
78+
Units string `json:"units"` //: "1.0"
7679
}
7780

7881
type BillPayment struct {

bill_test.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func TestBillService_Create(t *testing.T) {
1818
"required fields only request": {
1919
create: &BillCreate{
2020
ServiceLocation: 10,
21-
VisitNoteID: 64409108504,
21+
VisitNote: 64409108504,
2222
Patient: 64901939201,
2323
Practice: 65540,
2424
Physician: 64811630594,
@@ -27,16 +27,18 @@ func TestBillService_Create(t *testing.T) {
2727
"all specified fields request": {
2828
create: &BillCreate{
2929
ServiceLocation: 10,
30-
VisitNoteID: 64409108504,
30+
VisitNote: 64409108504,
3131
Patient: 64901939201,
3232
Practice: 65540,
3333
Physician: 64811630594,
3434
CPTs: []*BillCPT{
3535
{
36-
CPT: 12,
37-
Modifiers: []string{"modifier 1", "modifier 2"},
38-
DXs: []string{"dx 1", "dx 2"},
39-
AltDXs: []string{"alt dx 1", "alt dx 2"},
36+
CPT: "12",
37+
Units: "1.0",
38+
UnitCharge: "122.0",
39+
Modifiers: []string{"modifier 1", "modifier 2"},
40+
DXs: []BillDX{{ICD10Code: "dx 1"}, {ICD10Code: "dx 2"}},
41+
AltDXs: []string{"alt dx 1", "alt dx 2"},
4042
},
4143
},
4244
BillingProvider: 42120898,

visit_note.go

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -46,34 +46,33 @@ type VisitNote struct {
4646
}
4747

4848
type VisitNoteCreate struct {
49-
Bullets []*VisitNoteBullet `json:"bullets"` //: [{}], // Required
50-
ChartDate time.Time `json:"chart_date"` //: "2010-06-10T11:05:08Z", // Required
51-
DocumentDate time.Time `json:"document_date"` //: "2010-06-10T11:05:08Z", // Required
52-
Patient int64 `json:"patient"` //: 1638401, // Required
53-
Template string `json:"template"` //: "SOAP", ["Simple", "SOAP", "Complete H&P (1 col)", "Complete H&P (2 col)", "Complete H&P (2 col A/P)", "Pre-Op"] // Required
54-
Physician int64 `json:"physician"` //: 131074, // Required
55-
Type string `json:"type"` //: "Office Visit Note",
56-
Confidential bool `json:"confidential"` //: false,
57-
SignedBy int64 `json:"signed_by"` //: 131074,
58-
SignedDate time.Time `json:"signed_date"` //: "2010-06-10T11:05:08Z",
59-
Signatures []*VisitNoteSignature `json:"signatures"` //: [{}],
49+
Bullets []*VisitNoteBullet `json:"bullets"` //: [{}], // Required
50+
ChartDate time.Time `json:"chart_date"` //: "2010-06-10T11:05:08Z", // Required
51+
DocumentDate time.Time `json:"document_date"` //: "2010-06-10T11:05:08Z", // Required
52+
Patient int64 `json:"patient"` //: 1638401, // Required
53+
Template string `json:"template"` //: "SOAP", ["Simple", "SOAP", "Complete H&P (1 col)", "Complete H&P (2 col)", "Complete H&P (2 col A/P)", "Pre-Op"] // Required
54+
Physician int64 `json:"physician"` //: 131074, // Required
55+
Type string `json:"type,omitempty"` //: "Office Visit Note",
56+
Confidential bool `json:"confidential,omitempty"` //: false,
57+
SignedBy int64 `json:"signed_by,omitempty"` //: 131074,
58+
SignedDate *time.Time `json:"signed_date,omitempty"` //: "2010-06-10T11:05:08Z",
59+
Signatures []*VisitNoteSignature `json:"signatures,omitempty"` //: [{}],
6060
}
6161

6262
type VisitNoteBullet struct {
63-
Category string `json:"category"` //: "Problem", ["Problem", "Past", "Family", "Social", "Instr", "PE", "ROS", "Med", "Data", "Assessment", "Test", "Tx", "Narrative", "Followup", "Reason", "Plan", "Objective", "Hpi", "Allergies", "Habits", "Assessplan", "Consultant", "Attending", "Dateprocedure", "Surgical", "Orders", "Referenced", "Procedure"],
64-
Text string `json:"text"` //: "Dizziness" string(500),
65-
Version int64 `json:"version"` //: 1,
66-
Sequence int64 `json:"sequence"` //: 0,
67-
Author int64 `json:"author"` //: 10,
68-
UpdatedDate time.Time `json:"updated_date"` //: "2022-05-15T13:50:09"
69-
ReplacedByEdit *string `json:"replaced_by_edit"` //: null,
70-
ReplacedBy *string `json:"replaced_by"` //: null,
71-
Edit *string `json:"edit"` //: null,
72-
DeletedDate *time.Time `json:"deleted_date"` //: null,
73-
NoteDocument *VisitNoteNoteDocument `json:"note_document"` //: null,
74-
NoteItem *VisitNoteNoteItem `json:"note_item"` //: null,
75-
Handout *int64 `json:"handout"` //: null,
76-
Children []*VisitNoteChild `json:"children"` //: [{}] // Not visible in the Find Visit Notes endpoint
63+
Category string `json:"category"` //: "Problem", ["Problem", "Past", "Family", "Social", "Instr", "PE", "ROS", "Med", "Data", "Assessment", "Test", "Tx", "Narrative", "Followup", "Reason", "Plan", "Objective", "Hpi", "Allergies", "Habits", "Assessplan", "Consultant", "Attending", "Dateprocedure", "Surgical", "Orders", "Referenced", "Procedure"],
64+
Text string `json:"text"` //: "Dizziness" string(500),
65+
Version int64 `json:"version"` //: 1,
66+
Sequence int64 `json:"sequence"` //: 0,
67+
Author int64 `json:"author"` //: 10,
68+
ReplacedByEdit *string `json:"replaced_by_edit"` //: null,
69+
ReplacedBy *string `json:"replaced_by"` //: null,
70+
Edit *string `json:"edit"` //: null,
71+
DeletedDate *time.Time `json:"deleted_date"` //: null,
72+
NoteDocument *VisitNoteNoteDocument `json:"note_document"` //: null,
73+
NoteItem *VisitNoteNoteItem `json:"note_item"` //: null,
74+
Handout *int64 `json:"handout"` //: null,
75+
Children []*VisitNoteChild `json:"children,omitempty"` //: [{}] // Not visible in the Find Visit Notes endpoint
7776
}
7877

7978
type VisitNoteChild struct {

visit_note_test.go

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ func TestVisitNoteService_Create(t *testing.T) {
2020
create: &VisitNoteCreate{
2121
Bullets: []*VisitNoteBullet{
2222
{
23-
Category: "Subjective",
24-
Text: "Patient",
25-
Version: 1,
26-
Sequence: 1,
27-
Author: 12345,
28-
UpdatedDate: time.Date(2024, 4, 15, 0, 0, 0, 0, time.UTC),
23+
Category: "Subjective",
24+
Text: "Patient",
25+
Version: 1,
26+
Sequence: 1,
27+
Author: 12345,
2928
},
3029
},
3130
ChartDate: time.Date(2024, 4, 15, 0, 0, 0, 0, time.UTC),
@@ -39,12 +38,11 @@ func TestVisitNoteService_Create(t *testing.T) {
3938
create: &VisitNoteCreate{
4039
Bullets: []*VisitNoteBullet{
4140
{
42-
Category: "Subjective",
43-
Text: "Patient",
44-
Version: 1,
45-
Sequence: 1,
46-
Author: 12345,
47-
UpdatedDate: time.Date(2024, 4, 15, 0, 0, 0, 0, time.UTC),
41+
Category: "Subjective",
42+
Text: "Patient",
43+
Version: 1,
44+
Sequence: 1,
45+
Author: 12345,
4846
},
4947
},
5048
ChartDate: time.Date(2024, 4, 15, 0, 0, 0, 0, time.UTC),
@@ -55,7 +53,6 @@ func TestVisitNoteService_Create(t *testing.T) {
5553
Type: "Office Visit Note",
5654
Confidential: true,
5755
SignedBy: 12345,
58-
SignedDate: time.Date(2024, 4, 15, 0, 0, 0, 0, time.UTC),
5956
Signatures: []*VisitNoteSignature{
6057
{
6158
User: 12345,

0 commit comments

Comments
 (0)