forked from dshills/gofhir
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfamilyhx.go
35 lines (32 loc) · 901 Bytes
/
familyhx.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
package fhir
import (
"encoding/json"
"fmt"
)
// GetFamilyMemberHistory will return a family history for a patient with id pid
func (c *Connection) GetFamilyMemberHistory(pid string) (*FamilyMemberHistory, error) {
b, err := c.Query(fmt.Sprintf("FamilyMemberHistory?patient=%v", pid))
if err != nil {
return nil, err
}
data := FamilyMemberHistory{}
if err := json.Unmarshal(b, &data); err != nil {
return nil, err
}
return &data, nil
}
// FamilyMemberHistory is a FHIR family hx
type FamilyMemberHistory struct {
SearchResult
Entry []struct {
EntryPartial
Resource struct {
ResourcePartial
Date string `json:"date"`
Name string `json:"name"`
DeceasedBoolean bool `json:"deceasedBoolean"`
Relationship Concept `json:"relationship"`
Condition []CodeText `json:"condition"`
} `json:"resource"`
} `json:"entry"`
}